wxtpages
Class unitTemplate

java.lang.Object
  extended byjavax.swing.tree.DefaultMutableTreeNode
      extended bywxtpages.unit
          extended bywxtpages.unitTemplate
All Implemented Interfaces:
java.lang.Cloneable, javax.swing.tree.MutableTreeNode, java.io.Serializable, javax.swing.tree.TreeNode

public class unitTemplate
extends unit

An instance of unitTemplate holds a template that are used to build pages. Each unitTemplate instance match a template element in the script.

See Also:
Serialized Form

Field Summary
 
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
unitTemplate(unitGroup master, org.w3c.dom.Element elt)
          Creates a new instance of unitTemplate
unitTemplate(unitGroup master, java.lang.String loc, java.lang.String id)
          Creates a new instance of unitTemplate
 
Method Summary
 boolean build()
          Build has no meaning for templates.
protected  boolean establishDom()
          Attempt to establish the DOM for this template Try to figure out the encoding.
 java.lang.String getTemplateID()
          Get the ID for this tempalte
 boolean prepare(unit p, java.lang.String theCommonName, java.lang.String theCommonValue)
          Prepare this unitTemplate with imports from non-content files.
 
Methods inherited from class wxtpages.unit
addTransformationParameters, browseUnit, calculateAbsoluteAddress, controlLinks, correctAllAddressingInDocument, correctAllAddressingInFragment, correctOneCommonLink, correctStyleAttributes, correctStyleElements, correctStyleString, displayProperties, editUnit, getAbsoluteUri, getAbsoluteUriAsString, getAsText, getDescription, getDoc, getDocCopy, getEncoding, getFileName, getName, getNodeList, getOption, getOptions, getOriginalAsString, getOriginalUri, getProperties, getReporter, getTransformation, getTransformationAsString, getTransformationID, getTransformationParameterMap, getType, getURItoAsString, isSameAs, isUpdatedAfterUse, killDocument, loadAsText, makeComment, makeImageRefToPage, makeRefToPage, saveFromDOM, setEncoding, setNowAsLastTimeUsed, setReporter, setTransformationFromString, setTransformationId, setUpPopMenu, toString
 
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
 

Constructor Detail

unitTemplate

public unitTemplate(unitGroup master,
                    java.lang.String loc,
                    java.lang.String id)
             throws java.lang.Exception
Creates a new instance of unitTemplate

Parameters:
master - The unitGroup object that owns the page that will use this template
loc - The location of the template
id - The id that identifies the template when used in a page-element in the script.
Throws:
java.lang.Exception - When the object cannot be established

unitTemplate

public unitTemplate(unitGroup master,
                    org.w3c.dom.Element elt)
             throws java.lang.Exception
Creates a new instance of unitTemplate

Parameters:
master - The unitGroup object that owns the page that will use this template
elt - The element in the script that defines this template
Throws:
java.lang.Exception - When the object cannot be established
Method Detail

getTemplateID

public java.lang.String getTemplateID()
Get the ID for this tempalte

Returns:
the Id that defines this template

establishDom

protected boolean establishDom()
Attempt to establish the DOM for this template Try to figure out the encoding. Read in as string first and build DOM after encoding hunt

Overrides:
establishDom in class unit
Returns:
true if we can establsih the dom, false otherwise

build

public boolean build()
Build has no meaning for templates. A unitPage instance adminitrates building.

Overrides:
build in class unit
Returns:
true, allways

prepare

public boolean prepare(unit p,
                       java.lang.String theCommonName,
                       java.lang.String theCommonValue)
Prepare this unitTemplate with imports from non-content files. Does necessary address calculations Calls supers (unit) prepare

Overrides:
prepare in class unit
Parameters:
p - The unit that will use this unit as content, may not be null
theCommonName - The name used for common resources in the material
theCommonValue - The value that we will use
Returns:
false if a fatal error occurs during preparation, true otherwise