|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectinfo.aduna.gee.publication.net.WStorable
info.aduna.gee.publication.cover.Generator
public class Generator
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.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 |
|---|
public static int MAXIMUM_VIEWABLE_SECTION_SIZE
public static final int COVER_USES_JOUST
public static final int COVER_USES_HIERMENU
public static final int COVER_USES_INPAGE
public static final int COVER_USES_HIERMENU_ALL_OPTION
public boolean[] options
public String inPageTmplSource
public String inPageTmplId
public String inPageSubTmplSource
public String inPageSubTmplId
public String inPageSubSubTmplSource
public String inPageSubSubTmplId
public String inPageAltTmplSource
public String inPageAltTmplId
public static final int COVER
public static final int DATE
public static final int USER
public static final int EXTERNAL
public static final int SHARE
protected Vector[] _templates
public Session session
public Vector subscriptions
public Hashtable subscriptionsByName
public Hashtable subscriptionsByMountPath
public Vector implicitSubscriptions
protected InputHandler _coverInput
protected InputHandler _shareInput
public String startSection
public String bgColorString
public String fgColorString
public ImageInfo editImage
public static final String BGCOLOR_KEY
public static final String FGCOLOR_KEY
public static final String COVER_USES_JOUST_KEY
public static final String COVER_USES_HIERMENU_KEY
public static final String COVER_USES_HIERMENU_ALL_KEY
public static final String COVER_USES_INPAGE_KEY
public static final String COVER_INPAGE_TMPL_SOURCE_KEY
public static final String COVER_INPAGE_TMPL_ID_KEY
public static final String COVER_INPAGE_SUB_TMPL_SOURCE_KEY
public static final String COVER_INPAGE_SUB_TMPL_ID_KEY
public static final String COVER_INPAGE_SUBSUB_TMPL_SOURCE_KEY
public static final String COVER_INPAGE_SUBSUB_TMPL_ID_KEY
public static final String COVER_INPAGE_ALT_TMPL_SOURCE_KEY
public static final String COVER_INPAGE_ALT_TMPL_ID_KEY
protected MultiLevelExpiringCache _sectionToSummarizedEntries
protected MultiLevelExpiringCache _sectionToSummarizingEntries
public static String treeNodeJoustCode
public Hashtable descriptorOrIdToTmpl
public WProperties tmplPreferences
public Hashtable tmplIdToTmpls
public MultiLevelExpiringCache tmplToStubs
protected int _lastGeneratedEntryId
protected HashMap _toSummarizeSections
| Constructor Detail |
|---|
public Generator(InputHandler coverInput,
InputHandler shareInput)
coverInput - an inputHandler able to load the wif-file, templates and images.shareInput - an inputHandler able to load default images.| Method Detail |
|---|
public InputHandler getInputHandler(int which)
public Section getSection(Object section,
boolean edit,
Navigator navigator)
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
protected Template _getPreferenceTemplate(Navigator navigator,
Object section)
public Vector getNames(int type)
type - one of COVER DATE USER EXTERNAL in class Template.
public Template getTemplate(int type,
String name)
type - the type of the template (one of COVER DATE USER EXTERNAL in
class Template).name - the name of the template.
public void addTemplate(Template template)
template - the template to add.
public void load(InputStream input,
int version)
throws IOException
load in class WStorableinput - the InputStream from which to read the configuration file.version - the version of the input.
IOException - if an I/O error occured while reading
the configuration file.public void load(WProperties wifProps)
wifProps - a WProperties-object containing configuration data for
a Generator.
public void setImage(ImageInfo imgInfo,
String filename)
imgInfo - the ImageInfo to set the image's parameters in.filename - the filename of the new image.
public void store(OutputStream output)
throws IOException
store in class WStorableoutput - the output stream to write to.
IOException - if an I/O error occured while storing.public Object clone()
clone in class WStorable
public ZContainer getEntries(Object section,
Navigator navigator)
public ZContainer getFindContentEntries(Object section,
Navigator navigator)
public int getNumberOfEntries(PathString section,
Navigator navigator)
protected Vector _applyRule(Entry summaryEntry,
Navigator navigator,
Vector entries)
protected Vector _getCountingSummaryEntries(Object section,
Navigator navigator)
protected ZContainer _getEntries(Object section,
Navigator navigator,
boolean doSummaries,
boolean forEmptyOnly,
boolean removeImports)
public boolean isEmpty(Object section,
Navigator navigator)
public Object findContent(Object sectionID,
Vector sectionIDs,
boolean searchFuture,
boolean onlyOwn,
Navigator navigator)
public static void treeSort(Vector theNames)
public static Vector getSectionRange(Vector sectionNames,
String beginSectionName,
String endSectionName)
public static Vector reverse(Vector orig)
public void applyClabelSelection(Navigator navigator,
ZContainer entries,
OpaqueRule rule,
Entry placeHolder,
int numberWanted,
boolean checkForSummary)
public static Vector ensureCompleteTree(Vector tree)
public Vector limitTree(Vector tree)
tree - a complete treeensureCompleteTree(java.util.Vector)
public Result buildJoustSectionTree(Vector sections,
int index,
String href,
int level)
public String getHierMenuArrays(Vector sections,
PathString current,
String prefix,
int index)
sections - the current subtreecurrent - the current topnode of the subtree to handle or nullprefix - the hiermenu arrayname prefixindex - the index of current within its parents menu
protected String _getLabel(String sectionName,
String href)
protected int _relativeLevel(PathString sectionPath,
PathString nextSectionPath)
public void goHighestPL()
public Template getDefensiveTemplate()
public String getCoverName()
public Entry getTmpl(Navigator navigator,
String tmplDescriptorOrId,
boolean isDescriptor,
boolean allowDefault)
tmplDescriptorOrId - a qualified (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.public Vector getTmplDescriptors(Navigator navigator)
public int generateEntryId()
protected ZContainer _loadInternalImport(Object callingSection,
Entry entry,
Navigator navigator,
boolean forEmptyOnly)
public static Vector getRepeatingLineTemplates(Entry origBlockTmpl,
Entry blockTmpl,
String lineStub)
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.
public static void completeRepeatingLines(Navigator navigator,
StringBuffer linesUpToNow,
Vector lineTmpls,
String lineStub,
int nextTmplIndex)
<tr><td>REPEAT_THIS<td>
<td>REPEAT_THIS<td>
<td>REPEAT_THIS<td><tr>
which would not be complete otherwise (no closing TR).
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.public void refresh()
public Object getStartSection(Navigator navigator)
public Entry getWrappedTmpl(Navigator navigator,
String id)
public static void addToolbarStub(WProperties stubs,
Navigator navigator,
Entry sentry,
Object sectionID,
boolean force)
public Subscription getSubscriptionByName(String name)
name - the name of the subscription
protected Vector _getSummarizeSections(Entry entry,
Navigator navigator,
boolean forEmptyOnly)
protected int _numberOfSummarizedEntries(Entry entry,
Navigator navigator,
Vector summarizedEntries)
public void _order(String orderFieldsString,
String orderSequence,
String orderOperation,
String orderOrder,
String orderFactor,
List entries,
List stubs,
List sectionIDs)
public int getSeparatorType(PathString section)
protected ZContainer _getSummarizedEntries(Object overviewSection,
QualifiedSectionID contentSection,
Object placeHolder,
int max)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||