info.aduna.gee.publication.cover
Class Template

java.lang.Object
  extended by info.aduna.gee.publication.cover.Template
All Implemented Interfaces:
EntryConstants, LocalNames

public class Template
extends Object
implements LocalNames, EntryConstants

This class is a representation of a template HTML file for ZPad. A template can contain generator-tags and boxes for content entries. These generator-tags are ZPad-specific strings that are replaced with their actual run-time value by the generator. The boxes are places where the generator can insert a content entry. These boxes appear as images in the template HTML file. The name of these images should be equal to the value of ENTRY_TAG (case-insensitive).

The generator tags that can be used are:

generator tagsubstituted byexample value
__CHUNK[n]__The [n]th chunk of the path (0-based), if it exists
__COLUMNLAYOUT____COLUMNLAYOUT__ 2 is substituted by ""
__DATESTRING__the dateMarch 13, 1998
__DAY__the day of the month13
__ENDREPEAT____ENDREPEAT__ is substituted by ""
__ENDHREPEAT____ENDHREPEAT__ is substituted by ""
__ENTRYID__the (internal) entry ID13
__FULLSECTION__the full path name of the sectioncars/fast/Ferrari
__MAXPAGE__the total number of pages in a section3
__MONTH__the month3
__MONTHNAME__the monthMarch
__PAGE__the number of the current page within a section1
__PAGEOFMAX__if __MAXPAGE__ > 1 then __PAGE__"/"__MAXPAGE__ else ""
__PAGESEQUENCE__if __MAXPAGE__ > 1 then 1 2 3 .... __MAXPAGE__ else ""
__SECTION__the name of the sectionFerrari
__SECTIONNAME__the name of the section, WITHOUT the space and the section toolbarFerrari
__SECTIONPATH__the full, clickable path name of the sectioncars/fast/Ferrari
__SECTIONPAGEURL__the URL of the current page in this Sectionhttp://sydney.zpad.com//jmee?section=Ajax%20Selection&page=2
__SECTIONURL__the URL of this Sectionhttp://sydney.zpad.com//jmee?section=Ajax%20Selection
__SERVER__the server's namesydney.zpad.com
__STARTREPEAT____STARTREPEAT__ 2 10 is substituted by ""
__STARTHREPEAT____STARTHREPEAT__ 600 is substituted by ""
__SUBSECTIONS__the handling of in-page navigation: shows subsections
__SUBSUBSECTIONS__the handling of in-page navigation: shows subsections and their subsubsections
__ALTSECTIONS__
__TIME12__the time (plus optionally end time) an entry in am/pm9:30 pm - 10:30 pm
__TIME24__the time (plus optionally end time) of an entry, 24 hour based21:30 - 22:30
__TOPSECTIONS__the handling of in-page navigation: shows toplevel sections (only if current section is top-section too!)
__USER__the user's nameFrank
__WEEKDAY__the day of the weekFriday
__WEEKNUMBER__the week number (1 is the first full week, first day of week is sunday)46
__WEEKNUMBER2__the week number (1 is the week containing januari 1, first day of week is sunday)47
__WEEKNUMBER3__the week number (1 is the first full week, first day of week is monday)46
__WEEKNUMBER4__the week number (1 is the week containing januari 1, first day of week is monday)47
__YEAR__the year1998
__ZPADID__the user's ZPad IDhttp://sydney.zpad.com//frankh


Field Summary
protected  Vector _actualBoxes
          The boxes for entries in this template (as to be used).
protected static int _ALTSECTIONS
           
protected  int[] _boxCount
          No of Boxes in pre (0), repeat (1), hrepeat (2) en post (3)
protected  InputHandler _coverInput
          The input handler used to load the template HTML file.
protected static String _embedFrame
          The Frame that is use to wrap an Embedded page.
protected  String _html
          The (adapted) HTML string.
protected  String _htmlHOpt
          The optional horizontal HTML part string.
protected  Box _htmlHOptBox
          The box in the horizontal HTML part string.
protected  int _htmlHOptMaxWidth
          Max width of _htmlHOpt repeating.
protected  String _htmlOpt
          The optional HTML part string.
protected  int _htmlOptMax
          Max number of _htmlOpt repeating.
protected  int _htmlOptMin
          Min number of _htmlOpt repeating.
protected static int _MORE_MAX
           
protected static int _MORE_MORE
           
protected static int _MORE_NONE
           
protected  int _numberOfColumns
          The number of columns of the Template (__COLUMNLAYOUT__ N)
protected  InputHandler _shareInput
          The input handler used to load default files.
protected static int _SUBSECTIONS
           
protected static int _SUBSUBSECTIONS
           
protected static int _TOPSECTIONS
           
 DateSpec dateSpec
          The date specification of this template (only for DATE Template's).
protected static String DATESPEC_KEY
          The key used to store the datespec (only for DATE Template's) in the cover configuration file.
static String defaultFrame
          The FrameSet that is to be used for all HTML Template pages that have no FrameSet.
static String ENTRY_TAG
          The string indicating the place for an entry in a template.
 String filename
          The name of the template HTML file (READ-ONLY).
protected static String FILENAME_KEY
          The key used for storing the filename for this template in the cover configuration file.
 String frame
          The real HTML i.e.
 boolean frameIsLoaded
          Flag indicating whether the frame is already loaded (READ-ONLY).
 String framename
          The name of the Frame HTML file (READ-ONLY).
protected static String FRAMENAME_KEY
          The key used for storing the framename for this template in the cover configuration file.
 int imageHeight
           
 int imageWidth
           
 boolean isLoaded
          Flag indicating whether the template is already loaded (READ-ONLY).
 String name
          An identifying name for the template.
protected static String NAME_KEY
          The key used for storing the template's name in the cover configuration file.
static String TEMPLATEPROPS_KEY
          The key under which the template properties are stored.
static String TRANSPARENT_IMAGE
          The name of the file containing the transparent image.
 int type
          The type of the template.
protected static String TYPE_KEY
          The key used for storing the template's type in the cover configuration file.
 
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, WIDTH_KEY
 
Constructor Summary
Template(InputHandler coverInput, InputHandler shareInput)
          Creates a new template.
 
Method Summary
protected  String _calculateTemplate(Vector entries, int entryToDo, Vector selEntries, Navigator navigator, boolean editMode, boolean forReal, WProperties coverEntryStubs)
          Calculate a Template.
protected  String _correctCutting(String s, boolean start, boolean end)
          Correct the effect of cutting right in the middle of <....> This method removes the remainings of the tag just cut.
protected  int _countBoxes(String html)
           
protected  String _generateEntryCode(Entry entry, Box box, Navigator navigator, int border, WProperties coverEntryStubs)
          Generates the HTML code for an entry and appends it to a StringBuffer.
protected  void _generateExpiredImage(Entry entry, String imgName, int width, int height, int entryId, boolean editMode, StringBuffer buf)
          Generates a expired-image tag with a link to the "expired" Javascript function and appends it to a StringBuffer.
protected  void _generateImage(String httpDir, String file, String name, int width, int height, String altText, StringBuffer buf)
          Generates an image tag that can be included in an HTML page and appends it to a StringBuffer.
protected  void _generateLinkedImage(String href, String onMouseOver, String onMouseOut, String target, String httpDir, String file, String name, int width, int height, String altText, StringBuffer buf)
          Generates an image tag with a link attached to it that can be included in an HTML page and appends it to a StringBuffer.
protected  void _generateProvideImage(String imgName, int width, int height, int entryId, StringBuffer buf)
          Generates a provide-image tag with a link to the "export"- Javascript function and appends it to a StringBuffer.
protected  String _getClickablePath(String sectionName, String host, Navigator navigator, boolean reallyClickable)
           
protected  String _getInPageNavigation(Navigator navigator, PathString sectionName, int type, int subtype, int metaIndex)
           
protected  Vector _getInPageStubValues(Navigator navigator, String section, PathString fullsection, String moreString)
           
protected  void _getMetaAlternatives(PathString sectionName, Navigator navigator, Vector children, Vector fullchildren, Vector extraInfo)
          Calculate the meta steps for which alternative values should be found.
protected  Entry _getTransparentEntry(int width, int height)
          Return an entry for a transparent image.
protected  void _getValueAlternatives(PathString sectionName, int metaIndex, int maxChildren, Navigator navigator, Vector children, Vector fullchildren, String removeString)
          Get alternative values for a meta in a path.
protected  void _initParseTemplate(String html)
          Parses the boxes and the strings from an HTML document.
protected  String _parseTemplate(String html)
          Parses the boxes and the strings from an HTML document.
protected  String _substituteGeneratorTags(String page, String sectionName, int pageNo, int pageCount, String sectionURL, String sectionPageURL, String userName, String serverName, int entryIdBase, Vector origEntries, boolean editMode, int pl, Navigator navigator, WProperties coverEntryStubs)
          Substitutes the generator tags (__DATESTRING__, __SECTION__, etc.) in a page by their actual values ("November 20, 1997", "Addresses", etc.).
 Object clone()
           
static Vector columnLayout(Vector objects, int columns, Object placeHolder)
          Example 10 objects over 4 columns, the original indexes (0 based): 0 3 6 9 1 4 7 2 5 8
static Template create(InputHandler coverInput, InputHandler shareInput, WProperties props)
          Create a template from a properties object containing the configuration for the new object.
static String formalizeLink(String link)
          Take care of a correct Link.
 String generateEntryToolbar(Entry entry, boolean editMode, int entryId, int pl, Navigator navigator, Object sectionID, WProperties coverEntryStubs)
          Generates the HTML code for an entry with a toolbar and appends it to a StringBuffer.
 String generatePage(String sectionName, int pageNo, int pageCount, Vector entryPages, Navigator navigator, boolean editMode)
          Generate the HTML page that corresponds to all ingredients.
 Section generateSection(Vector entries, String sectionName, boolean editMode, Navigator navigator)
          Generates a section from the template.
static String getExternalEntryLink(Entry entry, int entryId, String sub)
          Get the correct link for an Entry that carries an EXTERNAL_ENTRY.
static String getParamValue(String tag, String param)
          Gets the value of a parameter from an HTML tag.
static boolean isInternalLink(String link, Navigator navigator)
           
 String linkActionOf(Navigator navigator, Entry entry, int entryId, String sub)
          Get the correct action when the entry's link is clicked.
 String locationOfImage(String imageName)
          What is the location of a entry toolbar image ?
static String purifyHTMLFile(String html)
          Zpad should be as browser insensitive as possible.
static String removeHTML(String html, String tag, boolean hasEnd, boolean contents)
          Removes unsupported HTML from an HTML file or fragment.
 void setFilename(String filename)
          Sets a (new) filename for the template HTML file.
 void setFramename(String framename)
          Sets a (new) Framename for the Frame HTML file.
static void sortEntriesOnTime(Vector entries, Navigator navigator)
           
static void substituteInEntry(Entry entry, Navigator navigator, WProperties coverEntryStubs)
          Do "cover stubs" substitutions in the Entry itself.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

defaultFrame

public static String defaultFrame
The FrameSet that is to be used for all HTML Template pages that have no FrameSet.


_embedFrame

protected static String _embedFrame
The Frame that is use to wrap an Embedded page. We avoid JavaScript access to the page by incident, which would result in rather 'dramatic' "JavaScript security messages". By the way: Netscape can't handle FRAMESETs with only a single FRAME.


framename

public String framename
The name of the Frame HTML file (READ-ONLY).

See Also:
setFramename(java.lang.String)

frame

public String frame
The real HTML i.e. the contents of the Frame file.


frameIsLoaded

public boolean frameIsLoaded
Flag indicating whether the frame is already loaded (READ-ONLY). The default frame is built-in so is definitely loaded. A non-default frame is not loaded at creation time to accellerate ZPad start up.


ENTRY_TAG

public static final String ENTRY_TAG
The string indicating the place for an entry in a template. This string should be in upper case!

See Also:
Constant Field Values

TRANSPARENT_IMAGE

public static final String TRANSPARENT_IMAGE
The name of the file containing the transparent image.

See Also:
Constant Field Values

TEMPLATEPROPS_KEY

public static final String TEMPLATEPROPS_KEY
The key under which the template properties are stored.

See Also:
Constant Field Values

_actualBoxes

protected Vector _actualBoxes
The boxes for entries in this template (as to be used).


_boxCount

protected int[] _boxCount
No of Boxes in pre (0), repeat (1), hrepeat (2) en post (3)


_html

protected String _html
The (adapted) HTML string.


_htmlOpt

protected String _htmlOpt
The optional HTML part string.


_htmlOptMin

protected int _htmlOptMin
Min number of _htmlOpt repeating.


_htmlOptMax

protected int _htmlOptMax
Max number of _htmlOpt repeating.


_htmlHOpt

protected String _htmlHOpt
The optional horizontal HTML part string.


_htmlHOptBox

protected Box _htmlHOptBox
The box in the horizontal HTML part string.


_htmlHOptMaxWidth

protected int _htmlHOptMaxWidth
Max width of _htmlHOpt repeating.


name

public String name
An identifying name for the template. For cover templates, this name is also used for substituting the "__SECTION__" generator tag.


_coverInput

protected InputHandler _coverInput
The input handler used to load the template HTML file.


_shareInput

protected InputHandler _shareInput
The input handler used to load default files.


filename

public String filename
The name of the template HTML file (READ-ONLY).

See Also:
setFilename(java.lang.String)

_numberOfColumns

protected int _numberOfColumns
The number of columns of the Template (__COLUMNLAYOUT__ N)


type

public int type
The type of the template. This should be equal to one of the constants COVER, DATE or USER in class Generator.

See Also:
Generator

dateSpec

public DateSpec dateSpec
The date specification of this template (only for DATE Template's).


imageHeight

public int imageHeight

imageWidth

public int imageWidth

isLoaded

public boolean isLoaded
Flag indicating whether the template is already loaded (READ-ONLY). A template is not loaded at creation time to speed up the starting of the ZPad.


NAME_KEY

protected static final String NAME_KEY
The key used for storing the template's name in the cover configuration file.

See Also:
Constant Field Values

TYPE_KEY

protected static final String TYPE_KEY
The key used for storing the template's type in the cover configuration file.

See Also:
Constant Field Values

FILENAME_KEY

protected static final String FILENAME_KEY
The key used for storing the filename for this template in the cover configuration file.

See Also:
Constant Field Values

FRAMENAME_KEY

protected static final String FRAMENAME_KEY
The key used for storing the framename for this template in the cover configuration file.

See Also:
Constant Field Values

DATESPEC_KEY

protected static final String DATESPEC_KEY
The key used to store the datespec (only for DATE Template's) in the cover configuration file.

See Also:
Constant Field Values

_TOPSECTIONS

protected static int _TOPSECTIONS

_SUBSECTIONS

protected static int _SUBSECTIONS

_SUBSUBSECTIONS

protected static int _SUBSUBSECTIONS

_ALTSECTIONS

protected static int _ALTSECTIONS

_MORE_NONE

protected static int _MORE_NONE

_MORE_MORE

protected static int _MORE_MORE

_MORE_MAX

protected static int _MORE_MAX
Constructor Detail

Template

public Template(InputHandler coverInput,
                InputHandler shareInput)
Creates a new template.

Parameters:
coverInput - the input handler to use for loading the HTML file.
Method Detail

create

public static Template create(InputHandler coverInput,
                              InputHandler shareInput,
                              WProperties props)
Create a template from a properties object containing the configuration for the new object.

Parameters:
input - an input handler for the new template.
props - the properties object containing the configuration.
Returns:
a template object.

setFramename

public void setFramename(String framename)
Sets a (new) Framename for the Frame HTML file.

Parameters:
filename - the name of the Frame HTML file.

setFilename

public void setFilename(String filename)
Sets a (new) filename for the template HTML file.

Parameters:
filename - the name of the template HTML file.

_initParseTemplate

protected void _initParseTemplate(String html)
Parses the boxes and the strings from an HTML document. This method sets _html _htmlOpt _htmlOptMax.

Parameters:
html - a string containing an HTML document.

_parseTemplate

protected String _parseTemplate(String html)
Parses the boxes and the strings from an HTML document. This method sets the _actualBoxes variable.

Parameters:
html - a string containing an HTML document.

clone

public Object clone()
Overrides:
clone in class Object

generateSection

public Section generateSection(Vector entries,
                               String sectionName,
                               boolean editMode,
                               Navigator navigator)
Generates a section from the template. The boxes of the template are filled with the supplied content entries. Generator tags in the HTML file are substituted by their actual value.

Parameters:
entries - a Vector containing Entry's.
sectionName - the name of the section to create.
editMode - flag indicating whether the generated section should be in edit mode.
navigator - the navigator to be used for all extra information.
Returns:
a section containing the generated pages.

_calculateTemplate

protected String _calculateTemplate(Vector entries,
                                    int entryToDo,
                                    Vector selEntries,
                                    Navigator navigator,
                                    boolean editMode,
                                    boolean forReal,
                                    WProperties coverEntryStubs)
Calculate a Template.

Parameters:
entries - the full set of Entries in the current Section.
entryToDo - the index of the first Entry to use.
selEntries - if not null, the Entries for the calculated Template will be returned in this Vector.
editMode - if true, show an editMode page
forReal - if true, really calculate the resulting String (if false, selEntries is the interesting result).

generatePage

public String generatePage(String sectionName,
                           int pageNo,
                           int pageCount,
                           Vector entryPages,
                           Navigator navigator,
                           boolean editMode)
Generate the HTML page that corresponds to all ingredients. Note that we have delayed this generation as long as possible.


_generateEntryCode

protected String _generateEntryCode(Entry entry,
                                    Box box,
                                    Navigator navigator,
                                    int border,
                                    WProperties coverEntryStubs)
Generates the HTML code for an entry and appends it to a StringBuffer. If entry is equal to 'null', the code for a transparent image will be generated.

Parameters:
entry - the entry to generate the code for.
box - the box to fill.
navigator - the navigator
border - the border width
Returns:
the HTML code for the supplied entry.

generateEntryToolbar

public String generateEntryToolbar(Entry entry,
                                   boolean editMode,
                                   int entryId,
                                   int pl,
                                   Navigator navigator,
                                   Object sectionID,
                                   WProperties coverEntryStubs)
Generates the HTML code for an entry with a toolbar and appends it to a StringBuffer.

Parameters:
entry - the entry to generate the code for.
editMode - flag indicating whether edit mode is active.
entryId - an identifying integer for the entry.

_generateLinkedImage

protected void _generateLinkedImage(String href,
                                    String onMouseOver,
                                    String onMouseOut,
                                    String target,
                                    String httpDir,
                                    String file,
                                    String name,
                                    int width,
                                    int height,
                                    String altText,
                                    StringBuffer buf)
Generates an image tag with a link attached to it that can be included in an HTML page and appends it to a StringBuffer. Optional items are not generated if their parameter is equal to null.

Parameters:
href - a URL for the link or null.
onMouseOver - actions when the mouse moves over it (optional).
onMouseOut - actions when the mouse moves out (optional).
target - the target (e.g. _blank or _top) for the link (optional).
httpDir - the URL of the directory the image is in (including the trailing slash).
file - the name of the image file.
name - an optional name for the image (optional).
width - the width of the image.
height - the height of the image.
altText - a alternative message to display (optional).
buf - the StringBuffer the image tag will be appended to.

_generateImage

protected void _generateImage(String httpDir,
                              String file,
                              String name,
                              int width,
                              int height,
                              String altText,
                              StringBuffer buf)
Generates an image tag that can be included in an HTML page and appends it to a StringBuffer. Optional items are not generated if their parameter is equal to null.

Parameters:
httpDir - the URL of the directory the image is in (including the trailing slash).
file - the name of the image file.
name - an optional name for the image (optional)
width - the width of the image.
height - the height of the image.
altText - a alternative message to display (optional).
buf - the StringBuffer the image tag will be appended to.

_generateProvideImage

protected void _generateProvideImage(String imgName,
                                     int width,
                                     int height,
                                     int entryId,
                                     StringBuffer buf)
Generates a provide-image tag with a link to the "export"- Javascript function and appends it to a StringBuffer.

Parameters:
imgName - the filename of the export image.
width - the width of the image in the generated tag.
height - the height of the image in the generated tag.
entryId - the entryId of the entry to export.
buf - the StringBuffer to append the code to.

_generateExpiredImage

protected void _generateExpiredImage(Entry entry,
                                     String imgName,
                                     int width,
                                     int height,
                                     int entryId,
                                     boolean editMode,
                                     StringBuffer buf)
Generates a expired-image tag with a link to the "expired" Javascript function and appends it to a StringBuffer.

Parameters:
imgName - the filename of the export image.
width - the width of the image in the generated tag.
height - the height of the image in the generated tag.
entryId - the entryId of the entry to export.
editMode - true if ZPad in edit mode, false otherwise
buf - the StringBuffer to append the code to.

_getTransparentEntry

protected Entry _getTransparentEntry(int width,
                                     int height)
Return an entry for a transparent image.

Parameters:
width - the width of the entry.
box - the height of the entry.
Returns:
an Entry.

_substituteGeneratorTags

protected String _substituteGeneratorTags(String page,
                                          String sectionName,
                                          int pageNo,
                                          int pageCount,
                                          String sectionURL,
                                          String sectionPageURL,
                                          String userName,
                                          String serverName,
                                          int entryIdBase,
                                          Vector origEntries,
                                          boolean editMode,
                                          int pl,
                                          Navigator navigator,
                                          WProperties coverEntryStubs)
Substitutes the generator tags (__DATESTRING__, __SECTION__, etc.) in a page by their actual values ("November 20, 1997", "Addresses", etc.).

Parameters:
page - a page containing meta tags.
sectionName - the name of the section.
pageNo - the number of the page.
pageCount - the total number of pages.
sectionURL - the URL of the full section.
userName - the user's name.
serverName - the server's name. REMIND
Returns:
the original page with the meta tags substituted.

removeHTML

public static String removeHTML(String html,
                                String tag,
                                boolean hasEnd,
                                boolean contents)
Removes unsupported HTML from an HTML file or fragment. Nesting is NOT supported! NEITHER is removal of COMMENT. The constructs removed will hang some browsers (i.e. Netscape ;-) and Zpad should be as browser insensitive as possible. Examples of things that can be removed: For HTML fragments: ..... (a contents operation) ..... (a contents operation) For all HTML:

Parameters:
html - an HTML document.
Returns:
the processed HTML document.

purifyHTMLFile

public static String purifyHTMLFile(String html)
Zpad should be as browser insensitive as possible.


getParamValue

public static String getParamValue(String tag,
                                   String param)
Gets the value of a parameter from an HTML tag. The search for the parameter is done case-insensitive.

Parameters:
tag - an HTML tag (e.g. <IMG src="bla" width="100" height="50">).
param - the parameter to look for (e.g. width).
Returns:
the value of the parameter (e.g. 100), or null if not found.

linkActionOf

public String linkActionOf(Navigator navigator,
                           Entry entry,
                           int entryId,
                           String sub)
Get the correct action when the entry's link is clicked.

Parameters:
sub - the subkey identifier (used for e.g. clabel specific links) NOTE: don't run EVERYTHING through the ZPad applet because of "Copy Link Location"! It would work, but it's not user-friendly.

isInternalLink

public static boolean isInternalLink(String link,
                                     Navigator navigator)

formalizeLink

public static String formalizeLink(String link)
Take care of a correct Link.

Parameters:
link - a link or null

substituteInEntry

public static void substituteInEntry(Entry entry,
                                     Navigator navigator,
                                     WProperties coverEntryStubs)
Do "cover stubs" substitutions in the Entry itself. The "cover stubs" are: __ENTRYID__ __MAXPAGE__ __PAGE__ __SECTIONNAME__ __SECTIONPAGEURL__ __SECTIONURL__ __SERVER__ __USER__ Always apply this method to a CLONE, never to the Entry itself.


_countBoxes

protected int _countBoxes(String html)

getExternalEntryLink

public static String getExternalEntryLink(Entry entry,
                                          int entryId,
                                          String sub)
Get the correct link for an Entry that carries an EXTERNAL_ENTRY.


_correctCutting

protected String _correctCutting(String s,
                                 boolean start,
                                 boolean end)
Correct the effect of cutting right in the middle of <....> This method removes the remainings of the tag just cut.

Parameters:
s - the string to be corrected
start - if true, correct the start
end - if true, correct the end

_getClickablePath

protected String _getClickablePath(String sectionName,
                                   String host,
                                   Navigator navigator,
                                   boolean reallyClickable)

_getInPageNavigation

protected String _getInPageNavigation(Navigator navigator,
                                      PathString sectionName,
                                      int type,
                                      int subtype,
                                      int metaIndex)
Parameters:
type - one of _TOPSECTIONS, _SUBSECTIONS, _SUBSUBSECTIONS

columnLayout

public static Vector columnLayout(Vector objects,
                                  int columns,
                                  Object placeHolder)
Example 10 objects over 4 columns, the original indexes (0 based): 0 3 6 9 1 4 7 2 5 8


sortEntriesOnTime

public static void sortEntriesOnTime(Vector entries,
                                     Navigator navigator)

locationOfImage

public String locationOfImage(String imageName)
What is the location of a entry toolbar image ?


_getInPageStubValues

protected Vector _getInPageStubValues(Navigator navigator,
                                      String section,
                                      PathString fullsection,
                                      String moreString)

_getMetaAlternatives

protected void _getMetaAlternatives(PathString sectionName,
                                    Navigator navigator,
                                    Vector children,
                                    Vector fullchildren,
                                    Vector extraInfo)
Calculate the meta steps for which alternative values should be found.


_getValueAlternatives

protected void _getValueAlternatives(PathString sectionName,
                                     int metaIndex,
                                     int maxChildren,
                                     Navigator navigator,
                                     Vector children,
                                     Vector fullchildren,
                                     String removeString)
Get alternative values for a meta in a path.



Copyright © 1997-2008 Aduna. All Rights Reserved.