|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectwt.enterprise.BasicTemplateProcessor
wt.doc.DocumentStructureProcessor
Template processor class which displays a hierarchical structure view for a given document.
Nested Class Summary | |
class |
DocumentStructureProcessor.Attribute
Helper class which maintains information about an attribute. |
class |
DocumentStructureProcessor.DocumentTreeNode
Helper class for rebuilding the nodes in the structure tree from the form data retrieved during template processing. |
private class |
DocumentStructureProcessor.SortCollationKeyFactory
|
Fields inherited from interface wt.templateutil.processor.ContextTranslator |
CONTEXT_LIST_IN, CONTEXT_LIST_OUT |
Fields inherited from interface wt.templateutil.processor.ContextHolder |
CONTEXT_CLASS_NAME, CONTEXT_OBJ, CONTEXT_PROPERTIES, FORM_DATA, QUERY_DATA, RESPONSE_EXCEPTIONS, RESPONSE_FOOTERS, RESPONSE_HEADERS, RESPONSE_MESSAGES, RESPONSE_STRING, STATUS |
Constructor Summary | |
DocumentStructureProcessor()
|
Method Summary | |
protected void |
addToCache(String key,
String value)
Enters the given String into the cache. |
protected String |
buildDocumentNodeString(DocumentStructureProcessor.DocumentTreeNode document_node,
String document_id,
String display_string,
Locale locale)
Returns the String to be displayed in the structure tree. |
protected String |
buildDocumentNodeString(int level,
int state,
WTObject document,
String document_id,
String display_string,
Locale locale)
Returns the String to be displayed in the structure tree. |
protected static Properties |
combineParameters(Properties params_to_add,
Properties original_params)
|
void |
displayDocumentStructure(Properties parameters,
Locale locale,
OutputStream os)
Outputs the structure tree. |
protected void |
dumpCache()
Outputs the entire contents of the Cache. |
protected DocumentStructureProcessor.Attribute[] |
getAttributeList(String attr_list)
Returns an array of Attribute objects corresponding to the given String. |
protected ConfigSpec |
getConfigSpec()
Returns the Configuration Specification used to show the structure. |
protected HTMLTemplate |
getConfigSpecDisplayTemplate(Locale locale)
Returns the HTMLTemplate for displaying the properties of the configuration specification |
protected String |
getConfigSpecForm()
Returns the String specifying the form for displaying the current configuration specification |
String |
getConfigSpecLink(Properties properties,
Locale locale)
Returns a string representation of the HTML code to create a link to change the current configuration specification. |
protected static String |
getContextActionLink(String document_id,
String label)
|
protected DocumentStructureProcessor.Attribute[] |
getDefaultAttributeList()
Returns an array of Attribute objects corresponding to the default list of attributes specified in wt.properties. |
protected static String |
getDocumentId(DocumentStructureProcessor.DocumentTreeNode document_node)
Return the String ID to be used as the value of a hidden form field. |
protected static String |
getDocumentId(WTObject document,
WTObject document_usage_link,
int level,
int order,
int expanded)
|
protected String |
getDocumentString(WTDocumentMaster document_master,
WTDocumentUsageLink link,
Locale locale)
Returns a string containing the attribute values to be displayed as the entry for the given document master in the structure hiearchy. |
protected String |
getDocumentString(WTDocument document,
WTDocumentUsageLink link,
Locale locale)
Returns a string containing the attribute values to be displayed as the entry for the given document in the structure hiearchy. |
protected SortedEnumeration |
getDocumentsUsed(WTDocument document,
Locale locale)
Returns a QueryResult corresponding to the documents used by the given document. |
protected String |
getFormEnd()
Return the ending tag. |
protected String |
getFormStart(String name)
Output the starting |
protected String |
getFormStart(String name,
String action,
String method)
Retrieve the starting |
static String |
getHiddenFieldHTML(String name,
String value)
|
protected static String |
getImage(String gif_file)
Returns the String form of the URL to the given image. |
protected String |
getNodeString(DocumentStructureProcessor.DocumentTreeNode document_node,
String page_id,
Locale locale)
Returns the String containing the HTML code to display an entry for the given node in the structure hierarchy. |
protected String |
getNodeStringFromDatabase(DocumentStructureProcessor.DocumentTreeNode document_node,
Locale locale)
Returns the String to display in the structure tree for the given DocumentTreeNode. |
static Persistable |
getObjectFromReference(String reference)
Returns the Persistable which corresponds to the given String object reference. |
protected Properties |
getParameters(HTTPRequest request)
Returns a Properties object containing the parameters received in the given HTTPRequest. |
HTMLTemplate |
getTemplate(Vector preferences)
Method which retrieves the HTML template to be processed by this processor. |
protected String |
getUniqueId()
Returns a String representation of a unique page id. |
void |
handleRequest(HTTPRequest request,
HTTPResponse response)
Method invoked when a URL to this template processor is followed. |
protected boolean |
hasConfigSpec()
Determines whether or not a Configuration Specification exists in which to show the structure. |
void |
outputConfigSpec(Properties properties,
Locale locale,
OutputStream os)
Outputs a displayable representation of the current configuration specification. |
void |
outputConfigSpecLink(Properties properties,
Locale locale,
OutputStream os)
Outputs a link to modify the config spec. |
protected void |
outputContext(PrintWriter out)
Method to output the current oid and action in hidden fields. |
protected void |
outputDocumentId(DocumentStructureProcessor.DocumentTreeNode document_node,
PrintWriter out)
|
protected void |
outputDocumentId(WTObject document,
WTObject document_usage_link,
PrintWriter out,
int level,
int order,
int expanded)
|
protected void |
outputDocumentStructure(Properties parameters,
Locale locale,
PrintWriter out)
Displays the structure hierarchy using information that was passed in as form data. |
protected void |
outputDocumentUses(SortedEnumeration document_uses,
int level,
int order,
int state,
Locale locale,
PrintWriter out)
Outputs the given QueryResult of Document Uses. |
void |
outputGoToPageFunction(PrintWriter out,
String name)
Outputs the JavaScript function which opens the page corresponding to the given action and the given object. |
static void |
outputHiddenField(String name,
String value,
PrintWriter out)
Outputs a HIDDEN form field with the given name and given value to the given printwriter. |
protected void |
outputInitialDocumentStructure(Properties parameters,
Locale locale,
PrintWriter out)
Outputs the hierarchical structure for the context object to the given PrintWriter. |
void |
outputScriptEnd(PrintWriter out)
Outputs the closing tag for a scripting section in an HTML page. |
void |
outputScriptStart(PrintWriter out,
String language)
Outputs the starting tag for a scripting section in an HTML page. |
void |
outputSubmitFunction(PrintWriter out,
String name)
Outputs the JavaScript code to build the function to submit the form. |
void |
setContextObj(Object obj)
Sets the context object for this processor. |
protected static String |
splitString(String string_to_split)
Removes the ID_SEPARATOR characters in the given string and replaces them with spaces. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private WTDocument topLevelDocument
private WTDocumentMaster topLevelDocMaster
private boolean docIterationHasBeenChanged
private WTDocument oldDocForHasChanged
private WTDocument newDocForHasChanged
private Properties params
private ConfigSpec configSpec
private String pageId
private String contextAction
private DocumentStructureProcessor.Attribute[] attributes
private static boolean VERBOSE
private static String CODEBASE
private static String DEFAULT_ATTRIBUTE_LIST
private static Cache nodeCache
public static final String ID_SEPARATOR
public static final String DISPLAY_SEPARATOR
public static final String SINGLE_SEPARATOR
public static final String LIST_SEPARATOR
public static final String LINK_ATTRIBUTE
public static final String DEFAULT_ACTION
public static final String DEFAULT_TEMPLATE
public static final String LINE_BREAK
public static final String CODED_NAME
public static final String NULL_STRING
public static final String NODE_COUNT
public static final String PAGE_ID
public static final String CONTEXT_ACTION
protected static final String EXPAND_GIF
protected static final String COLLAPSE_GIF
protected static String RESOURCE
protected static final int EXPANDED
protected static final int COLLAPSED
protected static final int NO_CHILDREN
protected static final int ROOT
Constructor Detail |
public DocumentStructureProcessor()
Method Detail |
public void handleRequest(HTTPRequest request, HTTPResponse response) throws WTException
request
- the HTTPRequest objectresponse
- the HTTPResponse object
WTException
public HTMLTemplate getTemplate(Vector preferences) throws WTException
preferences
- the Vector of preferences used to initialize
the HTML template
WTException
public void setContextObj(Object obj)
setContextObj
in interface ContextHolder
setContextObj
in class BasicTemplateProcessor
obj
- protected boolean hasConfigSpec()
protected ConfigSpec getConfigSpec()
public void displayDocumentStructure(Properties parameters, Locale locale, OutputStream os) throws WTException
parameters
- any parameters passed in the Windchill Script calllocale
- the Locale of the client displaying the HTML pageos
- the OutputStream to write to
WTException
protected void outputInitialDocumentStructure(Properties parameters, Locale locale, PrintWriter out) throws WTException
WTException
protected void outputDocumentStructure(Properties parameters, Locale locale, PrintWriter out) throws WTException
parameters
- a Properties object containing any parameters for the
Windchill Script calllocale
- the locale in which this page will be displayedout
- the PrintWriter to write to
WTException
protected static String getDocumentId(WTObject document, WTObject document_usage_link, int level, int order, int expanded) throws WTException
WTException
protected static String getDocumentId(DocumentStructureProcessor.DocumentTreeNode document_node)
document_node
- the DocumentTreeNode whose ID is returned
protected void outputDocumentId(WTObject document, WTObject document_usage_link, PrintWriter out, int level, int order, int expanded) throws WTException
WTException
protected void outputDocumentId(DocumentStructureProcessor.DocumentTreeNode document_node, PrintWriter out)
protected String getFormStart(String name) throws WTException
protected String getFormStart(String name, String action, String method)
protected String getFormEnd()
protected void outputContext(PrintWriter out) throws WTException
WTException
protected void outputDocumentUses(SortedEnumeration document_uses, int level, int order, int state, Locale locale, PrintWriter out) throws WTException
WTException
protected String buildDocumentNodeString(int level, int state, WTObject document, String document_id, String display_string, Locale locale)
level
- the Level at which this document is in the treestate
- whether this document is expanded, collapsed, or
has no childrenlocale
- the locale in which the structure tree
will be displayed
protected String buildDocumentNodeString(DocumentStructureProcessor.DocumentTreeNode document_node, String document_id, String display_string, Locale locale) throws WTException
document_node
- the DocumentTreeNode corresponding to the document to
displaydocument_id
- the id of the document to be used as the parameter
in the JavaScript function tolocale
- the locale in which the structure tree
will be displayed
WTException
protected String getDocumentString(WTDocument document, WTDocumentUsageLink link, Locale locale)
document
- the document whose display string is returned
protected String getDocumentString(WTDocumentMaster document_master, WTDocumentUsageLink link, Locale locale)
document_master
- the document master whose display string is returned
protected SortedEnumeration getDocumentsUsed(WTDocument document, Locale locale) throws ConfigException, WTException
ConfigException
WTException
protected String getNodeString(DocumentStructureProcessor.DocumentTreeNode document_node, String page_id, Locale locale) throws WTException
document_node
- the Document Node whose String representation is
returnedpage_id
- the page id used for locating the node in the
cache
WTException
protected String getNodeStringFromDatabase(DocumentStructureProcessor.DocumentTreeNode document_node, Locale locale) throws WTException
document_node
- the DocumentTreeNode whose display string is returnedlocale
- the Locale in which the structure is
displayed
WTException
protected static String getImage(String gif_file)
protected static String getContextActionLink(String document_id, String label)
public static void outputHiddenField(String name, String value, PrintWriter out)
name
- the Name of the hidden fieldvalue
- the value of the hidden fieldout
- the PrintWriter to write to.public static String getHiddenFieldHTML(String name, String value)
public void outputGoToPageFunction(PrintWriter out, String name) throws WTException
out
- the PrintWriter to write the function to.name
- the name of the JavaScript function. If no name
is given, 'goToPage' is used.
WTException
public void outputSubmitFunction(PrintWriter out, String name)
out
- the PrintWriter to write toname
- the name of the functionpublic void outputScriptStart(PrintWriter out, String language)
out
- the PrintWriter to write to.language
- the String language to specify in the script tagpublic void outputScriptEnd(PrintWriter out)
out
- the PrintWriter to write to.protected String getUniqueId()
protected void addToCache(String key, String value)
key
- the String key which is used in forming the key for
the entry in the cache. The key is formed by combining
the unique page ID with the given key.value
- the String value to put in the cacheprotected void dumpCache()
protected Properties getParameters(HTTPRequest request)
protected static Properties combineParameters(Properties params_to_add, Properties original_params)
public static Persistable getObjectFromReference(String reference) throws WTException
WTException
public void outputConfigSpec(Properties properties, Locale locale, OutputStream os)
properties
- the Properties object containing the script parameterslocale
- the locale in which to display the linkos
- the OutputStream to write the link toprotected HTMLTemplate getConfigSpecDisplayTemplate(Locale locale) throws WTException
WTException
protected String getConfigSpecForm() throws WTException
WTException
public void outputConfigSpecLink(Properties properties, Locale locale, OutputStream os)
properties
- the Properties object containing the script parameterslocale
- the locale in which to display the linkos
- the OutputStream to write the link topublic String getConfigSpecLink(Properties properties, Locale locale)
protected static String splitString(String string_to_split)
string_to_split
- the string to split
protected DocumentStructureProcessor.Attribute[] getAttributeList(String attr_list)
attr_list
- a string containing a comma-separated list of
attributes
protected DocumentStructureProcessor.Attribute[] getDefaultAttributeList()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |