|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.tree.DefaultMutableTreeNode
wxtpages.unit
wxtpages.unitPage
Instances of unitPage holds the structure that merges a template and a series of content units. Each instance of unitPage matches a page element in the script.
Field Summary | |
protected java.util.Vector |
m_allURIs
All contributing URIs, including direct imports, template and all content. |
protected java.util.Vector |
m_contentFileIndex
Index for this pages content objects |
protected boolean |
m_keepDOM
Flag to keep DOMstructure after build, ready for second phase |
protected int |
m_pageNo
number of this page, counted preorderwise within group |
protected java.lang.String |
m_templateID
The ID for this page's one and only template |
Fields inherited from class wxtpages.unit |
CONTENT_TYPE, DBCONTENT_TYPE, GROUP_TYPE, m_absoluteUri, m_description, m_Doc, m_GroupMaster, m_lastTimeUsed, m_myElement, m_name, m_optionMap, m_originalUri, m_parameterMap, m_propertyMap, m_txtContent, m_type, PAGE_TYPE, TEMPLATE_TYPE, TEXTCONTENT_TYPE, TRANSFORMATION_TYPE, UNIT_TYPE |
Fields inherited from class javax.swing.tree.DefaultMutableTreeNode |
allowsChildren, children, EMPTY_ENUMERATION, parent, userObject |
Constructor Summary | |
unitPage(unitGroup master,
org.w3c.dom.Element elt,
int pno)
Creates a new instance of unitPage. |
Method Summary | |
void |
appendToAddresses(java.net.URI theUri)
Append an URI to this page's list of all contributing URIs template, direct imports, content, groupanchor Used for recalculation of addresses |
protected void |
assembleAllContent()
Assemble all content, all types in the order they have been spesified We are only interested in imports that have noe URI, that is they are part of the structure as given in the script |
boolean |
atleastOneComponentChanged()
Try to find out if any of the components are updated from an other program since the last build. |
boolean |
build()
Build this page |
protected void |
buildSecondPhase()
Build second phase. |
protected org.w3c.dom.DocumentFragment |
collectFromPages(command cmd)
Collect from a lot of pages which may be distributed on more groups. |
void |
collectFromScript()
Pick up data from script Attributes: name location templateid transformationid Children: description content textcontent dbcontent thumb properties options |
void |
displayProperties(javax.swing.JFrame dialogOwner)
Show the properties of this unitPage in a dialog box |
protected void |
fetchResources()
Fetch resources referenced by the addressing mechanism with http-addresses. |
java.net.URI |
getAbsoluteThumbUri()
Get the absolute URI for the thumb of this page, if any |
java.util.Vector |
getAllAddresses()
Get all URI's that contribute to this apge template, direct imports, content, groupanchor Used for recalculation of addresses |
java.util.Vector |
getContentListAsStrings()
Get the URI's of all content units of this page |
int |
getPageNo()
Get the page number within the group, counted preorderwise. |
java.lang.String |
getPageNoAsString()
Get the page number as string, counted preorderwise. |
protected java.util.Vector |
getPageTocEntries(org.w3c.dom.Node theN,
int lo,
int max,
java.lang.String header)
Find all entries of a given level below the given node |
unitTemplate |
getTemplate()
Get the template for this page |
java.lang.String |
getTemplateID()
Get the id for this pages template |
java.lang.String |
getTemplateURIAsString()
Get the absolute URI of template for this page as a String |
boolean |
isSameAs(unitPage u)
Comparing this unitPage to another unitPage, equality in the sense that they have the same absolute location |
void |
killDocument()
Take this page down: Release all involved components |
protected org.w3c.dom.DocumentFragment |
makeMenuToc(command cmd)
Produce a menu toc, typically left column toc Following are optional parameters in command: cols: number of columns, default 1 left: string to the left of each entry, default is the empty string right: string to the right of each entry, default is the empty string divider: string between each entry, default is the empty string |
protected java.util.Vector |
makePageListByDirectNaming(java.lang.String pages)
Find a list of pages based on a string naming those pages An alternative to picking pages by an xpath on the script, See scripthandler::makePagelistByXPath |
protected org.w3c.dom.DocumentFragment |
makePageRef(command cmd)
Make a reference to another page in the group. |
protected org.w3c.dom.DocumentFragment |
makePageToc(command cmd)
Make a toc for this page This function does not exercise any intelligent as to where in the logical (as seen from the author) structure of the page the toc is based. |
protected org.w3c.dom.DocumentFragment |
makePopup(command cmd)
Make a call to a javascript which pops a page in a separate window Relies on the existance of a javascript Expect to find in command parameter: uri: name of the file to show text: the text in the reference style: the style to set for the fragment image: alternative to text popname: the name of the window that pops Only file is mandatory |
protected org.w3c.dom.DocumentFragment |
makeSimpleToc(command cmd)
Produce a simple toc, children or siblings Following are optional parameters in command: cols: number of columns, default 0 left: string to the left of each entry, default is "[" right: string to the right of each entry, default is "]" divider: string between each entry, default the empty string |
protected org.w3c.dom.DocumentFragment |
makeTotalGroupToc(command cmd)
Produce a total toc for the entire group Following are optional parameters in command: cols: number of columns, default 1 left: string to the left of each entry, default is the empty string right: string to the right of each entry, default is the empty string divider: string between each entry, default is the empty string lo: lowest pagelevel to take into account, default is 1 hi: highest pagelevel to take into account, default is highest level defined |
protected org.w3c.dom.DocumentFragment |
makeTrailToc(command cmd)
Produce a trail, that is references to all ancestors and home Following are optional parameters in command: cols: number of columns, default 0 left: string to the left of each entry, default is the empty string right: string to the right of each entry, default is the empty string divider: string between each entry, default is ">" |
boolean |
prepare(unit p,
java.lang.String theCommonName,
java.lang.String theCommonValue)
Prepare this unitPage with imports from non-content files. |
protected org.w3c.dom.DocumentFragment |
publishToc(java.util.Vector refList,
int cols,
java.lang.String leftpar,
java.lang.String rightpar,
java.lang.String divider)
Produce a DocumentFragment for a general toc |
protected void |
removeNodes(org.w3c.dom.Node theN,
java.lang.String xp)
Remove all nodes identifed by an xpath in a fragment |
javax.swing.JPopupMenu |
setUpPopMenu(javax.swing.JPopupMenu theMenu,
javax.swing.JFrame main)
Set up a popupMenu for this unitPage. |
java.lang.String |
toString()
Let the page be identified with name as string |
Methods inherited from class javax.swing.tree.DefaultMutableTreeNode |
add, breadthFirstEnumeration, children, clone, depthFirstEnumeration, getAllowsChildren, getChildAfter, getChildAt, getChildBefore, getChildCount, getDepth, getFirstChild, getFirstLeaf, getIndex, getLastChild, getLastLeaf, getLeafCount, getLevel, getNextLeaf, getNextNode, getNextSibling, getParent, getPath, getPathToRoot, getPreviousLeaf, getPreviousNode, getPreviousSibling, getRoot, getSharedAncestor, getSiblingCount, getUserObject, getUserObjectPath, insert, isLeaf, isNodeAncestor, isNodeChild, isNodeDescendant, isNodeRelated, isNodeSibling, isRoot, pathFromAncestorEnumeration, postorderEnumeration, preorderEnumeration, remove, remove, removeAllChildren, removeFromParent, setAllowsChildren, setParent, setUserObject |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected java.lang.String m_templateID
protected java.util.Vector m_contentFileIndex
protected int m_pageNo
protected java.util.Vector m_allURIs
protected boolean m_keepDOM
Constructor Detail |
public unitPage(unitGroup master, org.w3c.dom.Element elt, int pno) throws java.lang.Exception
master
- The unitGroup object that owns this pageelt
- The element in the script that defines this pagepno
- The number of the page in a preorder traversal
java.lang.Exception
- When something goes wrong in establishing the structure for this pageMethod Detail |
public boolean isSameAs(unitPage u)
u
- The unitPage we will compare to
public void appendToAddresses(java.net.URI theUri)
theUri
- The URI we appendpublic java.util.Vector getAllAddresses()
public java.net.URI getAbsoluteThumbUri()
public void collectFromScript() throws java.lang.Exception
java.lang.Exception
- when we have problems finding a locationpublic void killDocument()
killDocument
in class unit
public java.lang.String getTemplateID()
public unitTemplate getTemplate()
public java.lang.String getTemplateURIAsString()
public java.util.Vector getContentListAsStrings()
public int getPageNo()
public java.lang.String getPageNoAsString()
public java.lang.String toString()
toString
in class unit
public void displayProperties(javax.swing.JFrame dialogOwner)
displayProperties
in class unit
dialogOwner
- The frame that will own this dialog.public javax.swing.JPopupMenu setUpPopMenu(javax.swing.JPopupMenu theMenu, javax.swing.JFrame main)
setUpPopMenu
in class unit
theMenu
- The menu we will preparemain
- The frame that owns the menu
public boolean atleastOneComponentChanged()
public boolean build()
build
in class unit
protected void buildSecondPhase()
protected void assembleAllContent()
protected void fetchResources()
protected org.w3c.dom.DocumentFragment makePopup(command cmd)
Expect to find in command parameter: uri: name of the file to show text: the text in the reference style: the style to set for the fragment image: alternative to text popname: the name of the window that pops Only file is mandatory
cmd
- An instance of type command that describes what we want to do
protected org.w3c.dom.DocumentFragment makePageRef(command cmd)
Expect to find in command parameter: pageid: name or location for the page to refer to, with or without groupname prefix text: the text in the reference image: the image in the ref
text and image may be omitted
cmd
- An instance of type command that describes what we want to do
protected org.w3c.dom.DocumentFragment makeMenuToc(command cmd) throws java.lang.Exception
Following are optional parameters in command: cols: number of columns, default 1 left: string to the left of each entry, default is the empty string right: string to the right of each entry, default is the empty string divider: string between each entry, default is the empty string
cmd
- An instance of type command that describes what we want to do
java.lang.Exception
- When we have problems with DOMprotected org.w3c.dom.DocumentFragment makeTotalGroupToc(command cmd) throws java.lang.Exception
Following are optional parameters in command: cols: number of columns, default 1 left: string to the left of each entry, default is the empty string right: string to the right of each entry, default is the empty string divider: string between each entry, default is the empty string lo: lowest pagelevel to take into account, default is 1 hi: highest pagelevel to take into account, default is highest level defined
cmd
- An instance of type command thatdescribes what we want to do
java.lang.Exception
- When we cannot make the table of contentprotected org.w3c.dom.DocumentFragment makeTrailToc(command cmd) throws java.lang.Exception
Following are optional parameters in command: cols: number of columns, default 0 left: string to the left of each entry, default is the empty string right: string to the right of each entry, default is the empty string divider: string between each entry, default is ">"
cmd
- An instance of type command thatdescribes what we want to do
java.lang.Exception
- When we cannot make the table of contentprotected org.w3c.dom.DocumentFragment makeSimpleToc(command cmd) throws java.lang.Exception
Following are optional parameters in command: cols: number of columns, default 0 left: string to the left of each entry, default is "[" right: string to the right of each entry, default is "]" divider: string between each entry, default the empty string
cmd
- An instance of type command thatdescribes what we want to do
java.lang.Exception
- When we cannot make the table of contentprotected org.w3c.dom.DocumentFragment makePageToc(command cmd) throws java.lang.Exception
This function does not exercise any intelligent as to where in the logical (as seen from the author) structure of the page the toc is based. Local, distributed, tocs are thus not supported.
Following are optional parameters in command: cols: number of columns, default 1 left: string to the left of each entry, default is the empty string right: string to the right of each entry, default is the empty string divider: string between each entry, default is the empty string lo: lowest heading level to take into account, default is 1 hi: highest heading level to take into account, default is 3 header: the style of the heading elements, default is "h"
cmd
- An instance of type command thatdescribes what we want to do
java.lang.Exception
- When we cannot make the table of contentprotected java.util.Vector getPageTocEntries(org.w3c.dom.Node theN, int lo, int max, java.lang.String header)
theN
- A node which definins the subtreeheader
- What we are looking for here, typically hlo
- The lower version, typically 1max
- The high version, typically 3
protected org.w3c.dom.DocumentFragment publishToc(java.util.Vector refList, int cols, java.lang.String leftpar, java.lang.String rightpar, java.lang.String divider) throws java.lang.Exception
refList
- The references to display, tocEntrycols
- The number of columns we wantleftpar
- The string we want to display left of each entryrightpar
- The he string we want to display right of each entrydivider
- The string we want to display between each entry
java.lang.Exception
- When we cannot format the table of contentprotected org.w3c.dom.DocumentFragment collectFromPages(command cmd)
The command is supposed to have parameter: pages: a commasepareted list of pagedids xpath: what to select from each page
A pageid may be a pagename or part of a pagepath. A pageid may be prefixed with: groupname#, to allow collections from other groups. A pageid may be suffixed with +, indicating this page and all children of this page
cmd
- The command that describes the collection
protected java.util.Vector makePageListByDirectNaming(java.lang.String pages)
pages
- The string holding the pages
protected void removeNodes(org.w3c.dom.Node theN, java.lang.String xp)
xp
- An xpath-expression that identifies the nodes to removetheN
- The node defining the fragmentpublic boolean prepare(unit p, java.lang.String theCommonName, java.lang.String theCommonValue)
prepare
in class unit
p
- The unit that will use this unit as content, may not be null but may be this unitPagetheCommonName
- The name used for common resources in the materialtheCommonValue
- The value that we will use
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |