info.aduna.gee.publication.cover
Class Generator

java.lang.Object
  extended by info.aduna.gee.publication.net.WStorable
      extended by info.aduna.gee.publication.cover.Generator
All Implemented Interfaces:
EntryConstants, LocalNames, FileNames

public class Generator
extends WStorable
implements LocalNames, EntryConstants, FileNames

Generates HTML-pages for ZPad based on a configuration file (wif-file), template HTML-files and content entries.


Field Summary
protected  InputHandler _coverInput
          The input handler to use for loading files.
protected  int _lastGeneratedEntryId
          EntryId's should be unique over a full HTML page, since the names of images are e.g.
protected  MultiLevelExpiringCache _sectionToSummarizedEntries
           
protected  MultiLevelExpiringCache _sectionToSummarizingEntries
           
protected  InputHandler _shareInput
          The input handler to use for loading default files.
protected  Vector[] _templates
          The templates [cover, date, user, external].
protected  HashMap _toSummarizeSections
           
static String BGCOLOR_KEY
          The key used to store the background color.
 String bgColorString
          The Background color String of the Cover
static int COVER
           
static String COVER_INPAGE_ALT_TMPL_ID_KEY
          The key used to store inPageAltTmplId.
static String COVER_INPAGE_ALT_TMPL_SOURCE_KEY
          The key used to store inPageAltTmplSource.
static String COVER_INPAGE_SUB_TMPL_ID_KEY
          The key used to store inPageSubTmplId.
static String COVER_INPAGE_SUB_TMPL_SOURCE_KEY
          The key used to store inPageSubTmplSource.
static String COVER_INPAGE_SUBSUB_TMPL_ID_KEY
          The key used to store inPageSubSubTmplId.
static String COVER_INPAGE_SUBSUB_TMPL_SOURCE_KEY
          The key used to store inPageSubSubTmplSource.
static String COVER_INPAGE_TMPL_ID_KEY
          The key used to store inPageTmplId.
static String COVER_INPAGE_TMPL_SOURCE_KEY
          The key used to store inPageTmplSource.
static int COVER_USES_HIERMENU
           
static String COVER_USES_HIERMENU_ALL_KEY
          The key used to store COVER_USES_HIERMENU_ALL_OPTION.
static int COVER_USES_HIERMENU_ALL_OPTION
           
static String COVER_USES_HIERMENU_KEY
          The key used to store COVER_USES_HIERMENU.
static int COVER_USES_INPAGE
           
static String COVER_USES_INPAGE_KEY
          The key used to store COVER_USES_INPAGE.
static int COVER_USES_JOUST
           
static String COVER_USES_JOUST_KEY
          The key used to store COVER_USES_JOUST.
static int DATE
           
 Hashtable descriptorOrIdToTmpl
          Map tmpld-id's ("bill: 999") or descriptions ("bill: xxxxx") to the Tmpl.
 ImageInfo editImage
          Info about the image to display to edit an Entry.
static int EXTERNAL
           
static String FGCOLOR_KEY
          The key used to store the foreground color.
 String fgColorString
          The Foreground color String of the Cover
 Vector implicitSubscriptions
          The "subscriptions" that are caused by - missing TMPL's of existing TMPLD's - clabel inheritance
 String inPageAltTmplId
           
 String inPageAltTmplSource
           
 String inPageSubSubTmplId
           
 String inPageSubSubTmplSource
           
 String inPageSubTmplId
           
 String inPageSubTmplSource
           
 String inPageTmplId
           
 String inPageTmplSource
           
static int MAXIMUM_VIEWABLE_SECTION_SIZE
           
 boolean[] options
           
 Session session
          The session object that has the entries.
static int SHARE
           
 String startSection
          The start page for the cover, default is today.
 Vector subscriptions
          The subscriptions
 Hashtable subscriptionsByMountPath
          Key name, value Vector
 Hashtable subscriptionsByName
          Key name, value Vector
 Hashtable tmplIdToTmpls
          Map tmpld-id's ("bill: 999") to the complete Vector of tmpls.
 WProperties tmplPreferences
          Map tmpld-id's ("bill: 999") to other tmpld-id's ("willie: 888").
 MultiLevelExpiringCache tmplToStubs
          Map a tmpl entry itself to its stubs.
static String treeNodeJoustCode
           
static int USER
           
 
Fields inherited from class info.aduna.gee.publication.net.WStorable
_isStorable, _lastModified, BASE64ENCODING, GZIPCOMPRESSION, NONE, WLZ77COMPRESSION
 
Fields inherited from interface info.aduna.gee.publication.LocalNames
AM, APRIL, AUGUST, BUTTON_ADD, BUTTON_ASSOCIATES_MAY_NOT_EDIT, BUTTON_BACKUP, BUTTON_BOTTOM, BUTTON_CLEAR, BUTTON_CLEAR_CART, BUTTON_DELETE, BUTTON_DESCRIPTION, BUTTON_DOWN, BUTTON_EDIT, BUTTON_EDIT_CLABELS, BUTTON_EDIT_SUBSCRIPTION, BUTTON_EDIT_SUBSCRIPTIONS, BUTTON_ENTRY_FROM_CLIPBOARD, BUTTON_ENTRY_TO_CLIPBOARD, BUTTON_EXIT_EDIT_MODE, BUTTON_FAST_BACKWARD, BUTTON_FAST_FORWARD, BUTTON_FIND_FUTURE, BUTTON_FIND_PAST, BUTTON_INTERNALIZE_ENTRY, BUTTON_LINK, BUTTON_LINK_IN_FRAME, BUTTON_LOCK_ZPAD, BUTTON_MORE_TEXT, BUTTON_NEXTCONTENT, BUTTON_PERSONALIZE, BUTTON_PL0, BUTTON_PL1, BUTTON_PL2, BUTTON_PL3, BUTTON_PL4, BUTTON_PREVIOUSCONTENT, BUTTON_PROVIDE_ENTRY, BUTTON_RE_EXPORT, BUTTON_RE_MANUAL, BUTTON_REPEAT, BUTTON_REPEAT_TODAY, BUTTON_RESTORE, BUTTON_SEND_ORDER, BUTTON_SUGGESTED_DESTINATION, BUTTON_SUMMARY, BUTTON_SYNCHRONIZE, BUTTON_TIME, BUTTON_TODAY, BUTTON_TOMORROW, BUTTON_TOOLS, BUTTON_TOP, BUTTON_UNDO, BUTTON_UP, BUTTON_UPLOAD_IMAGE, BUTTON_YESTERDAY, CONFIRM_BACKUP_ERROR, CONFIRM_CHANGE_ALL_REPEATING, CONFIRM_CLABEL_DEFINITION_FORMAT, CONFIRM_COULD_NOT_SAVE, CONFIRM_DELETE_ALL_REPEATING, CONFIRM_DELETE_EXPIRED, CONFIRM_ERROR, CONFIRM_FILE_CHANGED, CONFIRM_FILE_CHANGED_TITLE, CONFIRM_FILE_REALLY_CHANGED, CONFIRM_FIND_CONTENT, CONFIRM_FIRST_SECTION, CONFIRM_HAS_THEMES_FRAME, CONFIRM_MIXED_TODAY, CONFIRM_NO_MORE_CONTENT, CONFIRM_NOT_A_ZPAD, CONFIRM_NOT_REMOVE_SECTION, CONFIRM_QUESTION, CONFIRM_READONLY_BROWSER, CONFIRM_SURE, CONFIRM_THIS_ZPAD, CONFIRM_TODAY_IS_AT_STARTUP, CONFIRM_TODAY_IS_AT_TRANSFER, CONFIRM_UNDO, DECEMBER, ENTRY_TYPE_APPLET, ENTRY_TYPE_HTML, ENTRY_TYPE_IMAGE, ENTRY_TYPE_OBJECT, ENTRY_TYPE_TEXT, ENTRY_TYPE_TMPLD, ERROR_CONFIG_LOAD, ERROR_DATABASE_LOAD, ERROR_IMAGE_LOAD, ERROR_RESOLVE_LOCATION, ERROR_ZPAD_LOAD, EXC_INVALID_PORT_NUMBER, EXC_NO_GZIP_SUPPORT, EXC_NO_HOSTNAME_SPECIFIED, EXC_UNKNOWN_COMPR, EXC_UNKNOWN_ENCODING, EXC_VELOCITY_NOT_SHOWN, FEBRUARY, FRIDAY, FROM, GETTING_BUTTONS, GETTING_CONTENT, HTML_EDIT_ENTRY, HTML_ENTRY_EXPIRED, HTML_ENTRY_NOT_YET_INSPIRED, HTML_ENTRY_WILL_EXPIRE, HTML_MOVE_ENTRY, HTML_ZPAD_GET_ENTRY, INVALID_USER_LOCATION, JANUARY, JULY, JUNE, LABEL_ACCEPT_BATCH, LABEL_ADD_TO_CART, LABEL_ALL_CLABELS, LABEL_ALLSUB_SECTIONS, LABEL_APPLET_CODE, LABEL_APPLET_CODEBASE, LABEL_AT_STARTUP, LABEL_AT_STARTUP_BRIEF, LABEL_BACKGROUND, LABEL_BATCH_IS_MULTIPLE, LABEL_BATCH_NEW_SECTION, LABEL_BLUE, LABEL_BOTTOMUP_SUBSCRIPTION, LABEL_CART_EMPTY, LABEL_CASE_SENSITIVE, LABEL_CHOOSE_SECTION, LABEL_CHOOSE_TMPL, LABEL_CLABEL_IMAGE, LABEL_CLABEL_OVER_IMAGE, LABEL_CLABEL_RULE, LABEL_CLABELS, LABEL_CLABELS_SELECTED, LABEL_COUNT, LABEL_COVER_SECTIONS, LABEL_COVER_SPECIFIC_BUTTONS, LABEL_COVER_SPECIFIC_ENTRY_BUTTONS, LABEL_COVER_USES_HIERMENU, LABEL_COVER_USES_HIERMENU_ALL_OPTION, LABEL_COVER_USES_INPAGE, LABEL_COVER_USES_JOUST, LABEL_CURRENT_SECTIONS, LABEL_DAILY, LABEL_DATE, LABEL_DAYOFWEEK, LABEL_DESCR, LABEL_DESCRIPTION, LABEL_DESTINATION, LABEL_DONT_INHERIT, LABEL_EDIT_BATCH, LABEL_EMBED_SOURCE, LABEL_ENTRY_HTML, LABEL_ENTRY_IS_TMPL, LABEL_FOREGROUND, LABEL_GREEN, LABEL_HEIGHT, LABEL_HTML_STYLE, LABEL_ID, LABEL_IMAGE_LOCATION, LABEL_IMPORT_CLASSNAME, LABEL_IMPORT_SERVERNAME, LABEL_INHERIT_CLABELS, LABEL_INHERIT_PRIVACY_GROUPS, LABEL_INLINE_DESCRIPTION, LABEL_INPAGE_ALT_TEMPLATE_ID, LABEL_INPAGE_ALT_TEMPLATE_SOURCE, LABEL_INPAGE_SUB_TEMPLATE_ID, LABEL_INPAGE_SUB_TEMPLATE_SOURCE, LABEL_INPAGE_SUBSUB_TEMPLATE_ID, LABEL_INPAGE_SUBSUB_TEMPLATE_SOURCE, LABEL_INPAGE_TEMPLATE_ID, LABEL_INPAGE_TEMPLATE_SOURCE, LABEL_LOADED_FRAMES, LABEL_LOADED_TEMPLATES, LABEL_MONTH, LABEL_MONTHLY, LABEL_MOUNTPOINT, LABEL_MULTISUB_SECTIONS, LABEL_NEVER_EXPIRES, LABEL_NEVER_INSPIRES, LABEL_NEW_CLABEL, LABEL_NEW_FRAME, LABEL_NEW_PL_MEMBER, LABEL_NEW_SECTION, LABEL_NEW_SUBSCRIPTION, LABEL_NEW_TEMPLATE, LABEL_NEW_ZPAD_NAME, LABEL_NO_COLOR, LABEL_NO_ENTRY_SPECIFIC_PROPERTIES, LABEL_NO_FRAME, LABEL_NO_TEMPLATE_PREFERENCE, LABEL_NOT_AT_THIS_PL, LABEL_NOT_IN_CLIENTMODE, LABEL_OBJECT_LOCATION, LABEL_OCCURRING_SUBSCRIPTION, LABEL_OPTIONS, LABEL_ORDER_PRICE, LABEL_OWN_CONTENTS_ONLY, LABEL_OWN_SECTIONS, LABEL_OWNER_VERSION, LABEL_PASSWORD, LABEL_PASSWORD_ERROR, LABEL_PL_MEMBERS, LABEL_PLUS_ASSOCIATES, LABEL_PRICE, LABEL_PRICE_PER_ITEM, LABEL_PRO_VERSION, LABEL_RECURSIVE_SUBSCRIPTION, LABEL_RED, LABEL_REPEAT_1, LABEL_REPEAT_2, LABEL_REPEAT_3, LABEL_REQUIRED, LABEL_RGB, LABEL_SELECT_ZPAD, LABEL_SELECTED_ZPAD, LABEL_SHARED_SUBSCRIPTION, LABEL_SHOWING_RESULT, LABEL_STARTPOINT, LABEL_SUBSCRIPTIONS, LABEL_SYSTEM_SUBSCRIPTIONS, LABEL_THIS_IS_HTML, LABEL_THIS_ZPAD, LABEL_TMPL_DESCRIPTOR, LABEL_TMPL_ID, LABEL_TMPL_LOOP, LABEL_TMPL_NOT_AVAILABLE, LABEL_TMPL_STUBCHARS, LABEL_TODAY, LABEL_TOPDOWN_SUBSCRIPTION, LABEL_TOTAL_PRICE, LABEL_TRANSLATION_URL, LABEL_UNCLASSIFIED, LABEL_UP_TO_USER, LABEL_USE_RANGE, LABEL_USER_NAME, LABEL_VOLUME_DISCOUNT, LABEL_WEEKLY, LABEL_WIDTH, LABEL_YEAR, LABEL_YEARLY, MARCH, MAY, MONDAY, MORE, NO_CONTENT_IN_PAGE, NOVEMBER, OCTOBER, PM, PRESSED_DATE_POPUP, PRESSED_EDIT_POPUP, PRESSED_FIND_POPUP, PRESSED_META_POPUP, PRESSED_PERSONALIZE_POPUP, PRESSED_PRIVL_POPUP, PRESSED_SECTION_POPUP, PRESSED_TOOLS_POPUP, QUESTION_ENTRY_TO_CLIPBOARD, QUESTION_OVERWRITE_BACKUP, QUESTION_REPLACE_WITH_BACKUP, QUESTION_SELECT_ADVANCED_VERSION, REMOVE, SATURDAY, SAVING_CONTENT, SEARCH_FOR_MANUAL, SEARCH_FOR_PRIVACY_LEVEL, SEARCH_FOR_PROVIDE_PL, SEARCH_FOR_RE_EXPORT, SEARCH_FOR_RE_MANUAL, SEARCH_FOR_SUBSCRIPTION, SEARCH_FOR_TIME, SEARCH_FOR_TYPE, SEPTEMBER, SHOULD_SYNC, SUNDAY, TEMPLATE_NOT_AVAILABLE, THURSDAY, TITLE_ADD_ALIAS, TITLE_ADD_APPLET, TITLE_ADD_EMBED, TITLE_ADD_HTML, TITLE_ADD_IMAGE, TITLE_ADD_IMPORT, TITLE_ADD_OBJECT, TITLE_ADD_TEXT, TITLE_ADD_TMPLD, TITLE_ADVANCED_ZPAD, TITLE_CHANGE_COVER, TITLE_CLABEL_DEFINITIONS, TITLE_CLABEL_SELECTION, TITLE_COPY_TO, TITLE_COVER_OPTIONS, TITLE_COVER_SECTIONS, TITLE_DATE_OFFSET, TITLE_DATE_SECTIONS, TITLE_DATE_SPEC, TITLE_DESTINATION, TITLE_EDIT_CATEGORIES, TITLE_EDIT_PRIVACY_GROUPS, TITLE_EDIT_SHEET, TITLE_ENTRY_ATTRIBS, TITLE_ENTRY_EXPIRATION, TITLE_ENTRY_INSPIRATION, TITLE_ENTRY_PARAMS, TITLE_ENTRY_PROPS, TITLE_EXPIRED_HANDLING, TITLE_EXTERNAL_SECTIONS, TITLE_FIND_ENTRY, TITLE_FIRST_SECTION, TITLE_IDENTIFY_YOURSELF, TITLE_INSTANT_COVER, TITLE_LAST_SECTION, TITLE_LOGIN_DIALOG, TITLE_MANIPULATE_SECTION, TITLE_MOVE_ENTRY, TITLE_MOVE_TO, TITLE_NAVIGATOR, TITLE_PERSONALIZE_SHEET, TITLE_PL_GROUPS, TITLE_REMOVE_ALIAS, TITLE_REMOVE_FILE, TITLE_REMOVE_IMAGE, TITLE_SELECT_DATE, TITLE_SELECT_PL, TITLE_SELECT_SECTION, TITLE_SELECT_TMPL, TITLE_SET_CLABEL_IMAGES, TITLE_SET_COLOR, TITLE_SET_COLORS, TITLE_SET_FRAME, TITLE_SET_HTML, TITLE_SET_PL, TITLE_START_SECTION, TITLE_STATISTICS, TITLE_SUBSCRIPTIONS, TITLE_TEMPLATE_PREFERENCE, TITLE_TOOLS_SHEET, TITLE_TRANSFER, TITLE_UPLOAD_FILE, TITLE_USER_SECTIONS, TO, TUESDAY, WEDNESDAY, ZPAD
 
Fields inherited from interface info.aduna.gee.publication.content.EntryConstants
ACLS_PREFIX, AFTER_TRANSFER, APPLET_TYPE_VALUE, ASSOCIATES_EDIT_LEVEL, BEFORE_STORAGE, BEFORE_TRANSFER, CODE_KEY, CODEBASE_KEY, CONSTRUCTION_KEY, CONTAINER_TTL_KEY, CONTAINERID_KEY, CONTAINERPROPS_KEY, DBPRIVACY_LEVEL_KEY, DESCRIPTION_KEY, EMBED_TYPE_VALUE, END_TIME_KEY, ENTRY_ID_KEY, ENTRYATTRIBS_KEY, ENTRYPARAMS_KEY, ENTRYPROPS_KEY, EXPIRES_KEY, EXTERNAL_ENTRY_KEY, HEIGHT_KEY, HTML_KEY, HTML_TYPE_VALUE, ID2IDID_KEY, IMAGE_TYPE_VALUE, IMPORT_CLASSNAME, IMPORT_DONT_FORWARD, IMPORT_IMPORTED, IMPORT_LANGUAGE, IMPORT_SERVER_NAME, IMPORT_TYPE_VALUE, INFO_EXTENSION, INHERIT_CONFIGURATION, INLINE_DESCRIPTION_IS_HTML_KEY, INLINE_DESCRIPTION_KEY, INSPIRES_KEY, JIT_DESTINATION, JIT_DESTINATION_INDEX, LINK_IN_FRAME_KEY, LINK_KEY, MANUAL_KEY, MINIMALHEIGHT_KEY, MINIMALWIDTH_KEY, NAVIGATION_KEY, OBJECT_TYPE_VALUE, OCCURRING_CLABELS_KEY, OVERRIDE_SUGGESTION_KEY, PRIVACY_LEVEL_KEY, PROVIDE_KEY, PROVIDE_PL_KEY, QUALIFIED_BASE_KEY, RE_EXPORT_KEY, RE_MANUAL_KEY, REPEAT_ID_KEY, REPEAT_TODAY_KEY, REQUIRES_NEW_PAGE, ROTATABLE_KEY, SHARED_CLABELS_KEY, SHOP_GIF_KEY, SHOP_GIF_LOCATION_KEY, SHOP_ID_KEY, SHOP_ORIGIN_KEY, SHOP_OVER_GIF_KEY, SORT_CLABELS, SORT_DESCRIPTION, SOURCE_KEY, STARTSECTION_KEY, SUBSCRIBED_COLOR_KEY, SUBSCRIBED_GIF_KEY, SUBSCRIBED_GIF_LOCATION_KEY, SUBSCRIBED_OVER_GIF_KEY, SUBSCRIBED_VISIBLE_CLABELS_KEY, SUBSCRIPTION_KEY, SUBSCRIPTION_LINK_KEY, SUGGESTION_KEY, SUMMARY_IS_HTML_KEY, SUMMARY_KEY, SUMMARY_TYPE_VALUE, TEMPLATEPREFERENCES_KEY, TEXT_KEY, TEXT_TYPE_VALUE, TIME_KEY, TMPL_DESCRIPTOR_KEY, TMPL_FOREIGN_ID_KEY, TMPL_ID_KEY, TMPL_PREFERENCES_KEY, TMPL_STUB_RECOGNIZER_KEY, TMPLD_TYPE_VALUE, TYPE_KEY, WIDTH_KEY
 
Fields inherited from interface info.aduna.gee.publication.net.FileNames
ASA_FILE_NAME, BAK_FILE_NAME, CAT_FILE_NAME, CFG_FILE_NAME, CHS_FILE_NAME, DAT_FILE_NAME, HLP_FILE_NAME, LOCAL_FILE_PREFIX, SBS_FILE_NAME, SSS_FILE_NAME, WIF_FILE_NAME
 
Constructor Summary
Generator(InputHandler coverInput, InputHandler shareInput)
          Creates a new Generator.
 
Method Summary
protected  Vector _applyRule(Entry summaryEntry, Navigator navigator, Vector entries)
          Apply a rule of a summary entry to a set of entries.
protected  Vector _getCountingSummaryEntries(Object section, Navigator navigator)
           
protected  ZContainer _getEntries(Object section, Navigator navigator, boolean doSummaries, boolean forEmptyOnly, boolean removeImports)
           
protected  String _getLabel(String sectionName, String href)
           
protected  Template _getPreferenceTemplate(Navigator navigator, Object section)
          Get the prefered Template for a section.
protected  ZContainer _getSummarizedEntries(Object overviewSection, QualifiedSectionID contentSection, Object placeHolder, int max)
          Get the entries that match an overview entry in a section or null.
protected  Vector _getSummarizeSections(Entry entry, Navigator navigator, boolean forEmptyOnly)
          Get the sections that should be summarized for an summary entry.
protected  ZContainer _loadInternalImport(Object callingSection, Entry entry, Navigator navigator, boolean forEmptyOnly)
           
protected  int _numberOfSummarizedEntries(Entry entry, Navigator navigator, Vector summarizedEntries)
          Note: if summarizedEntries != null, the entries that are summarized are added to it.
 void _order(String orderFieldsString, String orderSequence, String orderOperation, String orderOrder, String orderFactor, List entries, List stubs, List sectionIDs)
          orderFieldsString is a "/" separated String of fields.
protected  int _relativeLevel(PathString sectionPath, PathString nextSectionPath)
           
 void addTemplate(Template template)
          Add a template.
static void addToolbarStub(WProperties stubs, Navigator navigator, Entry sentry, Object sectionID, boolean force)
           
 void applyClabelSelection(Navigator navigator, ZContainer entries, OpaqueRule rule, Entry placeHolder, int numberWanted, boolean checkForSummary)
          Apply label selection to the entries in a ZContainer.
 Result buildJoustSectionTree(Vector sections, int index, String href, int level)
          Build the html String to insert in the Joust-tree template.
 Object clone()
          Clones this Generator.
static void completeRepeatingLines(Navigator navigator, StringBuffer linesUpToNow, Vector lineTmpls, String lineStub, int nextTmplIndex)
          Make sure all line templates are substituted an equal number of times.
static Vector ensureCompleteTree(Vector tree)
          Due to e.g.
 Object findContent(Object sectionID, Vector sectionIDs, boolean searchFuture, boolean onlyOwn, Navigator navigator)
           
 int generateEntryId()
           
 String getCoverName()
          The name of the Cover currently running (ENGINE only)
 Template getDefensiveTemplate()
          Get whatever Template is available.
 ZContainer getEntries(Object section, Navigator navigator)
           
 ZContainer getFindContentEntries(Object section, Navigator navigator)
          To speed up "find content" in a site full of overviews, don't search summaries! By the way, the summary entries are not searchable anyway ...
 String getHierMenuArrays(Vector sections, PathString current, String prefix, int index)
          Build the JavaScript Arrays for an HierMenu.
 InputHandler getInputHandler(int which)
          Gets the input handler of the generator.
 Vector getNames(int type)
           
 int getNumberOfEntries(PathString section, Navigator navigator)
          This function should be used with care.
static Vector getRepeatingLineTemplates(Entry origBlockTmpl, Entry blockTmpl, String lineStub)
           
 Section getSection(Object section, boolean edit, Navigator navigator)
          Generates pages for a requested section.
static Vector getSectionRange(Vector sectionNames, String beginSectionName, String endSectionName)
          Get the range indicated the total list of names and a begin and end name.
 int getSeparatorType(PathString section)
           
 Object getStartSection(Navigator navigator)
          Get the correct start-section of either the current session, one of its subscriptions or the Cover.
 Subscription getSubscriptionByName(String name)
           
 Template getTemplate(int type, String name)
          Get a template of a particular type with a particular name.
 Entry getTmpl(Navigator navigator, String tmplDescriptorOrId, boolean isDescriptor, boolean allowDefault)
          Often used: find the Tmpl for a Tmpld.
 Vector getTmplDescriptors(Navigator navigator)
          This function is NOT privacy PL dependent (it's used by the owner only, but it doesn't care about privacy levels in subscriptions either).
 Entry getWrappedTmpl(Navigator navigator, String id)
          Wrap a sequence of tmpls into a single tmpl.
 void goHighestPL()
          Go to the highest PL that can be achieved.
 boolean isEmpty(Object section, Navigator navigator)
          Is the section empty at the current PL? This is an accelleration function especially for the DateSheet (since it shows the "emptiness" of 30 days in 1 view).
 Vector limitTree(Vector tree)
           
 void load(InputStream input, int version)
          Loads the cover configuration file and initializes the generator with the data from this file.
 void load(WProperties wifProps)
          Loads the generator's configuration from a WProperties-object.
 void refresh()
          Refresh the internal state.
static Vector reverse(Vector orig)
          It's much cheaper to reverse a Vector instead of inserting each element at 0.
 void setImage(ImageInfo imgInfo, String filename)
          Sets the parameters of a specific image (one of the edit, active-edit, export or link images).
 void store(OutputStream output)
          Store the cover configuration file.
static void treeSort(Vector theNames)
           
 
Methods inherited from class info.aduna.gee.publication.net.WStorable
destroy, getCompression, getEncoding, getLastModified, getVersion, isStorable, setLastModified, setStorable, toSeconds
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAXIMUM_VIEWABLE_SECTION_SIZE

public static int MAXIMUM_VIEWABLE_SECTION_SIZE

COVER_USES_JOUST

public static final int COVER_USES_JOUST
See Also:
Constant Field Values

COVER_USES_HIERMENU

public static final int COVER_USES_HIERMENU
See Also:
Constant Field Values

COVER_USES_INPAGE

public static final int COVER_USES_INPAGE
See Also:
Constant Field Values

COVER_USES_HIERMENU_ALL_OPTION

public static final int COVER_USES_HIERMENU_ALL_OPTION
See Also:
Constant Field Values

options

public boolean[] options

inPageTmplSource

public String inPageTmplSource

inPageTmplId

public String inPageTmplId

inPageSubTmplSource

public String inPageSubTmplSource

inPageSubTmplId

public String inPageSubTmplId

inPageSubSubTmplSource

public String inPageSubSubTmplSource

inPageSubSubTmplId

public String inPageSubSubTmplId

inPageAltTmplSource

public String inPageAltTmplSource

inPageAltTmplId

public String inPageAltTmplId

COVER

public static final int COVER
See Also:
Constant Field Values

DATE

public static final int DATE
See Also:
Constant Field Values

USER

public static final int USER
See Also:
Constant Field Values

EXTERNAL

public static final int EXTERNAL
See Also:
Constant Field Values

SHARE

public static final int SHARE
See Also:
Constant Field Values

_templates

protected Vector[] _templates
The templates [cover, date, user, external].


session

public Session session
The session object that has the entries.


subscriptions

public Vector subscriptions
The subscriptions


subscriptionsByName

public Hashtable subscriptionsByName
Key name, value Vector


subscriptionsByMountPath

public Hashtable subscriptionsByMountPath
Key name, value Vector


implicitSubscriptions

public Vector implicitSubscriptions
The "subscriptions" that are caused by - missing TMPL's of existing TMPLD's - clabel inheritance


_coverInput

protected InputHandler _coverInput
The input handler to use for loading files.


_shareInput

protected InputHandler _shareInput
The input handler to use for loading default files.


startSection

public String startSection
The start page for the cover, default is today.


bgColorString

public String bgColorString
The Background color String of the Cover


fgColorString

public String fgColorString
The Foreground color String of the Cover


editImage

public ImageInfo editImage
Info about the image to display to edit an Entry. It also defines the sizes of all other Images in the EntryToolbar.


BGCOLOR_KEY

public static final String BGCOLOR_KEY
The key used to store the background color.

See Also:
Constant Field Values

FGCOLOR_KEY

public static final String FGCOLOR_KEY
The key used to store the foreground color.

See Also:
Constant Field Values

COVER_USES_JOUST_KEY

public static final String COVER_USES_JOUST_KEY
The key used to store COVER_USES_JOUST.

See Also:
Constant Field Values

COVER_USES_HIERMENU_KEY

public static final String COVER_USES_HIERMENU_KEY
The key used to store COVER_USES_HIERMENU.

See Also:
Constant Field Values

COVER_USES_HIERMENU_ALL_KEY

public static final String COVER_USES_HIERMENU_ALL_KEY
The key used to store COVER_USES_HIERMENU_ALL_OPTION.

See Also:
Constant Field Values

COVER_USES_INPAGE_KEY

public static final String COVER_USES_INPAGE_KEY
The key used to store COVER_USES_INPAGE.

See Also:
Constant Field Values

COVER_INPAGE_TMPL_SOURCE_KEY

public static final String COVER_INPAGE_TMPL_SOURCE_KEY
The key used to store inPageTmplSource.

See Also:
Constant Field Values

COVER_INPAGE_TMPL_ID_KEY

public static final String COVER_INPAGE_TMPL_ID_KEY
The key used to store inPageTmplId.

See Also:
Constant Field Values

COVER_INPAGE_SUB_TMPL_SOURCE_KEY

public static final String COVER_INPAGE_SUB_TMPL_SOURCE_KEY
The key used to store inPageSubTmplSource.

See Also:
Constant Field Values

COVER_INPAGE_SUB_TMPL_ID_KEY

public static final String COVER_INPAGE_SUB_TMPL_ID_KEY
The key used to store inPageSubTmplId.

See Also:
Constant Field Values

COVER_INPAGE_SUBSUB_TMPL_SOURCE_KEY

public static final String COVER_INPAGE_SUBSUB_TMPL_SOURCE_KEY
The key used to store inPageSubSubTmplSource.

See Also:
Constant Field Values

COVER_INPAGE_SUBSUB_TMPL_ID_KEY

public static final String COVER_INPAGE_SUBSUB_TMPL_ID_KEY
The key used to store inPageSubSubTmplId.

See Also:
Constant Field Values

COVER_INPAGE_ALT_TMPL_SOURCE_KEY

public static final String COVER_INPAGE_ALT_TMPL_SOURCE_KEY
The key used to store inPageAltTmplSource.

See Also:
Constant Field Values

COVER_INPAGE_ALT_TMPL_ID_KEY

public static final String COVER_INPAGE_ALT_TMPL_ID_KEY
The key used to store inPageAltTmplId.

See Also:
Constant Field Values

_sectionToSummarizedEntries

protected MultiLevelExpiringCache _sectionToSummarizedEntries

_sectionToSummarizingEntries

protected MultiLevelExpiringCache _sectionToSummarizingEntries

treeNodeJoustCode

public static String treeNodeJoustCode

descriptorOrIdToTmpl

public Hashtable descriptorOrIdToTmpl
Map tmpld-id's ("bill: 999") or descriptions ("bill: xxxxx") to the Tmpl. This Hashtable is public for refresh only.


tmplPreferences

public WProperties tmplPreferences
Map tmpld-id's ("bill: 999") to other tmpld-id's ("willie: 888"). This WProperties is public for refresh only.


tmplIdToTmpls

public Hashtable tmplIdToTmpls
Map tmpld-id's ("bill: 999") to the complete Vector of tmpls.


tmplToStubs

public MultiLevelExpiringCache tmplToStubs
Map a tmpl entry itself to its stubs. Note that this mapping is dependent on the the navigator, so the entry itself can not cache its stubs on its own.


_lastGeneratedEntryId

protected int _lastGeneratedEntryId
EntryId's should be unique over a full HTML page, since the names of images are e.g. "linkImg" + entryId; The following "memory" (per Generator) of generated entryId's used does it.


_toSummarizeSections

protected HashMap _toSummarizeSections
Constructor Detail

Generator

public Generator(InputHandler coverInput,
                 InputHandler shareInput)
Creates a new Generator. You must set a Session object for this generator if you want it to produce HTML-pages. Otherwise, it can only be used for configuration purposes.

Parameters:
coverInput - an inputHandler able to load the wif-file, templates and images.
shareInput - an inputHandler able to load default images.
Method Detail

getInputHandler

public InputHandler getInputHandler(int which)
Gets the input handler of the generator. This method can be used to create a new Template that uses the same input handler as the generator.

Returns:
an InputHandler.

getSection

public Section getSection(Object section,
                          boolean edit,
                          Navigator navigator)
Generates pages for a requested section.

Parameters:
section - the section to generate pages for. Can be a QualifiedSectionID, a PathString, a WDate or (because of ServerZpad usage) a String.
edit - flag indicating whether to generate pages in edit mode.
navigator - the navigator to get all extra info
Returns:
a Section object or null if the 'section' parameter wasn't valid.

_getPreferenceTemplate

protected Template _getPreferenceTemplate(Navigator navigator,
                                          Object section)
Get the prefered Template for a section. We look for the Session's preference and in sequence all Subscription's preferences until we find an applicable one.


getNames

public Vector getNames(int type)
Parameters:
type - one of COVER DATE USER EXTERNAL in class Template.
Returns:
the names of all templates of a particular type.

getTemplate

public Template getTemplate(int type,
                            String name)
Get a template of a particular type with a particular name.

Parameters:
type - the type of the template (one of COVER DATE USER EXTERNAL in class Template).
name - the name of the template.
Returns:
a Template or null if the template could not be found.

addTemplate

public void addTemplate(Template template)
Add a template.

Parameters:
template - the template to add.

load

public void load(InputStream input,
                 int version)
          throws IOException
Loads the cover configuration file and initializes the generator with the data from this file.

Specified by:
load in class WStorable
Parameters:
input - the InputStream from which to read the configuration file.
version - the version of the input.
Throws:
IOException - if an I/O error occured while reading the configuration file.

load

public void load(WProperties wifProps)
Loads the generator's configuration from a WProperties-object.

Parameters:
wifProps - a WProperties-object containing configuration data for a Generator.

setImage

public void setImage(ImageInfo imgInfo,
                     String filename)
Sets the parameters of a specific image (one of the edit, active-edit, export or link images).

Parameters:
imgInfo - the ImageInfo to set the image's parameters in.
filename - the filename of the new image.

store

public void store(OutputStream output)
           throws IOException
Store the cover configuration file.

Specified by:
store in class WStorable
Parameters:
output - the output stream to write to.
Throws:
IOException - if an I/O error occured while storing.

clone

public Object clone()
Clones this Generator.

Specified by:
clone in class WStorable
Returns:
a clone of the generator.

getEntries

public ZContainer getEntries(Object section,
                             Navigator navigator)
Returns:
the requested entries or null

getFindContentEntries

public ZContainer getFindContentEntries(Object section,
                                        Navigator navigator)
To speed up "find content" in a site full of overviews, don't search summaries! By the way, the summary entries are not searchable anyway ...

Returns:
the requested entries or null

getNumberOfEntries

public int getNumberOfEntries(PathString section,
                              Navigator navigator)
This function should be used with care. It is designed for hierarchical navigation through a set of objects only. It may return unexpected results under all other circumstances.

Returns:
the number of entries or -1

_applyRule

protected Vector _applyRule(Entry summaryEntry,
                            Navigator navigator,
                            Vector entries)
Apply a rule of a summary entry to a set of entries.

Returns:
a vector of matching entries.

_getCountingSummaryEntries

protected Vector _getCountingSummaryEntries(Object section,
                                            Navigator navigator)
Returns:
the hightest priority summary entries that are responsible for counting, or null

_getEntries

protected ZContainer _getEntries(Object section,
                                 Navigator navigator,
                                 boolean doSummaries,
                                 boolean forEmptyOnly,
                                 boolean removeImports)
Returns:
the requested entries or null

isEmpty

public boolean isEmpty(Object section,
                       Navigator navigator)
Is the section empty at the current PL? This is an accelleration function especially for the DateSheet (since it shows the "emptiness" of 30 days in 1 view). It is expensive to find out whether an Section is empty by generating all Entries of the section. So we tried to avoid that .... but due to e.g. Generator-level includes summaries, etc, the result was not correct any more. So, we made the code slower in using the full getEntries(). However, since we want evolve to support "any-combination-subscriptions", we again would like to have a fast isEmpty


findContent

public Object findContent(Object sectionID,
                          Vector sectionIDs,
                          boolean searchFuture,
                          boolean onlyOwn,
                          Navigator navigator)

treeSort

public static void treeSort(Vector theNames)

getSectionRange

public static Vector getSectionRange(Vector sectionNames,
                                     String beginSectionName,
                                     String endSectionName)
Get the range indicated the total list of names and a begin and end name.


reverse

public static Vector reverse(Vector orig)
It's much cheaper to reverse a Vector instead of inserting each element at 0.


applyClabelSelection

public void applyClabelSelection(Navigator navigator,
                                 ZContainer entries,
                                 OpaqueRule rule,
                                 Entry placeHolder,
                                 int numberWanted,
                                 boolean checkForSummary)
Apply label selection to the entries in a ZContainer.


ensureCompleteTree

public static Vector ensureCompleteTree(Vector tree)
Due to e.g. privacy restrictions the result of getSectionNames might not be a complete tree. Our tree algorithms require a complete tree, therefore apply this ensureCompleteTree() to their argument.


limitTree

public Vector limitTree(Vector tree)
Parameters:
tree - a complete tree
See Also:
ensureCompleteTree(java.util.Vector)

buildJoustSectionTree

public Result buildJoustSectionTree(Vector sections,
                                    int index,
                                    String href,
                                    int level)
Build the html String to insert in the Joust-tree template.


getHierMenuArrays

public String getHierMenuArrays(Vector sections,
                                PathString current,
                                String prefix,
                                int index)
Build the JavaScript Arrays for an HierMenu.

Parameters:
sections - the current subtree
current - the current topnode of the subtree to handle or null
prefix - the hiermenu arrayname prefix
index - the index of current within its parents menu

_getLabel

protected String _getLabel(String sectionName,
                           String href)

_relativeLevel

protected int _relativeLevel(PathString sectionPath,
                             PathString nextSectionPath)
Returns:
0 for peers, 1 if nextSectionPath is a direct child, -1 otherwise

goHighestPL

public void goHighestPL()
Go to the highest PL that can be achieved.


getDefensiveTemplate

public Template getDefensiveTemplate()
Get whatever Template is available.


getCoverName

public String getCoverName()
The name of the Cover currently running (ENGINE only)


getTmpl

public Entry getTmpl(Navigator navigator,
                     String tmplDescriptorOrId,
                     boolean isDescriptor,
                     boolean allowDefault)
Often used: find the Tmpl for a Tmpld.

Parameters:
tmplDescriptorOrId - a qualified (: ) or unqualified () descriptor or id.
isDescriptor - if true the tmplDescriptorOrId is a descriptor, otherwise it is an ID.
allowDefault - if true, always return a tmpl, otherwise this method will return null if tmpl can't be found.

getTmplDescriptors

public Vector getTmplDescriptors(Navigator navigator)
This function is NOT privacy PL dependent (it's used by the owner only, but it doesn't care about privacy levels in subscriptions either).


generateEntryId

public int generateEntryId()

_loadInternalImport

protected ZContainer _loadInternalImport(Object callingSection,
                                         Entry entry,
                                         Navigator navigator,
                                         boolean forEmptyOnly)

getRepeatingLineTemplates

public static Vector getRepeatingLineTemplates(Entry origBlockTmpl,
                                               Entry blockTmpl,
                                               String lineStub)
Parameters:
origBlockTmpl - The original template that support multiple lines.
blockTmpl - The template to make the substitutions in. Note: this will be modified!
lineStub - The stub that indicates a repeating line. Note: the same stub, with "LINES" appended to it is assumed to be the stub that will ultimately be substituted.
Returns:
a list of TMPL Entries to be used in a round-robin fashion when substituting lines in a template that supports multiple lines (e.g. when used for an overview or in-page navigation)

completeRepeatingLines

public static void completeRepeatingLines(Navigator navigator,
                                          StringBuffer linesUpToNow,
                                          Vector lineTmpls,
                                          String lineStub,
                                          int nextTmplIndex)
Make sure all line templates are substituted an equal number of times. This is to support repeating lines like: <tr><td>REPEAT_THIS<td> <td>REPEAT_THIS<td> <td>REPEAT_THIS<td><tr> which would not be complete otherwise (no closing TR).

Parameters:
linesUpToNow - The lines up to now. Note: this may be modified by this method.
lineTmpls - The line templates to use in round-robin fashion.
nextTmplIndex - The index of the next line template to use.

refresh

public void refresh()
Refresh the internal state.


getStartSection

public Object getStartSection(Navigator navigator)
Get the correct start-section of either the current session, one of its subscriptions or the Cover.

Returns:
a specified startsection or null

getWrappedTmpl

public Entry getWrappedTmpl(Navigator navigator,
                            String id)
Wrap a sequence of tmpls into a single tmpl.


addToolbarStub

public static void addToolbarStub(WProperties stubs,
                                  Navigator navigator,
                                  Entry sentry,
                                  Object sectionID,
                                  boolean force)

getSubscriptionByName

public Subscription getSubscriptionByName(String name)
Parameters:
name - the name of the subscription
Returns:
a subscription for this name or null

_getSummarizeSections

protected Vector _getSummarizeSections(Entry entry,
                                       Navigator navigator,
                                       boolean forEmptyOnly)
Get the sections that should be summarized for an summary entry.


_numberOfSummarizedEntries

protected int _numberOfSummarizedEntries(Entry entry,
                                         Navigator navigator,
                                         Vector summarizedEntries)
Note: if summarizedEntries != null, the entries that are summarized are added to it.

Returns:
the number of entries matching a summarize-sections entry.

_order

public void _order(String orderFieldsString,
                   String orderSequence,
                   String orderOperation,
                   String orderOrder,
                   String orderFactor,
                   List entries,
                   List stubs,
                   List sectionIDs)
orderFieldsString is a "/" separated String of fields.


getSeparatorType

public int getSeparatorType(PathString section)

_getSummarizedEntries

protected ZContainer _getSummarizedEntries(Object overviewSection,
                                           QualifiedSectionID contentSection,
                                           Object placeHolder,
                                           int max)
Get the entries that match an overview entry in a section or null.



Copyright © 1997-2008 Aduna. All Rights Reserved.