wt.doc
Class DocumentStructureProcessor

java.lang.Object
  extended bywt.enterprise.BasicTemplateProcessor
      extended bywt.doc.DocumentStructureProcessor
All Implemented Interfaces:
ContextHolder, ContextTranslator, Evolvable, Externalizable, Serializable, TemplateProcessor

public class DocumentStructureProcessor
extends BasicTemplateProcessor

Template processor class which displays a hierarchical structure view for a given document.

See Also:
Serialized Form

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
           
 
Field Summary
private  DocumentStructureProcessor.Attribute[] attributes
           
private static String CODEBASE
           
static String CODED_NAME
           
protected static String COLLAPSE_GIF
           
protected static int COLLAPSED
           
private  ConfigSpec configSpec
           
static String CONTEXT_ACTION
           
private  String contextAction
           
static String DEFAULT_ACTION
           
private static String DEFAULT_ATTRIBUTE_LIST
           
static String DEFAULT_TEMPLATE
           
static String DISPLAY_SEPARATOR
           
private  boolean docIterationHasBeenChanged
           
protected static String EXPAND_GIF
           
protected static int EXPANDED
           
static String ID_SEPARATOR
           
static String LINE_BREAK
           
static String LINK_ATTRIBUTE
           
static String LIST_SEPARATOR
           
private  WTDocument newDocForHasChanged
           
protected static int NO_CHILDREN
           
static String NODE_COUNT
           
private static Cache nodeCache
           
static String NULL_STRING
           
private  WTDocument oldDocForHasChanged
           
static String PAGE_ID
           
private  String pageId
           
private  Properties params
           
protected static String RESOURCE
           
protected static int ROOT
           
static String SINGLE_SEPARATOR
           
private  WTDocumentMaster topLevelDocMaster
           
private  WTDocument topLevelDocument
           
private static boolean VERBOSE
           
 
Fields inherited from class wt.enterprise.BasicTemplateProcessor
ACTION, ADD_HELP_ICON, ALL_CABINETS, BLANK_SPACE, BREAK_SEPARATOR, BREAK_TAG, CLASS, componentFactory, CONTAINER_NAME, CONTENT_RESOURCE, contextClass, DEFAULT_CHARSET, DEFAULT_HELP_ICON_SELECTOR, DEFAULT_HELP_LABEL, DEFAULT_PREFERENCE_CONTEXT, DOCFROMTEMPLATE, ENABLE_HELP_ICON_PROPERTY_NAME, ENTERPRISE_SEARCH, EXTERNALIZATION_VERSION_UID, FEDERATION_SEARCH, GLOBAL_NAVIGATION_ENABLE_HELP_ICON, globalNavBarHelpIconEnabledDefault, HELP_CONTEXT, HELP_ICON_POSITION, HELP_ICON_SELECTOR, HELP_LABEL, HELP_LABEL_RESOURCE, HELP_WINDOW_NAME, helpContext, helpIconEnabled, helpIconEnabledDefault, HOMEPAGE, IDPREFIX, IMPORT, INTEGRATED_SEARCH, isDndMicroAppletEnabled, isDndMicroAppletEnabledInitialized, LABEL_SEPARATOR, LINE_FEED_DELIMITER, linkPrefix, LOCAL_SEARCH, OID, OLD_FORMAT_VERSION_UID, pageContext, PDMLINK_INSTALL_KEY, PERSONAL_CABINET, PREF_WINDOW_NAME, PREFERENCE_CONTEXT, PRESENT_HELP_LABEL, PROJECTLINK_INSTALL_KEY, SEARCH, SHARE_ICON, TEXT_RESOURCE_BUNDLE, URL_RESOURCE, WORKLIST, wtAttribute, WTCORE_IMAGE_DIR
 
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
tag.
protected  String getFormStart(String name, String action, String method)
          Retrieve the starting tag.
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 wt.enterprise.BasicTemplateProcessor
AccessOK, addHiddenProperty, addHTMLHelpLink, addToResponseExceptions, addToResponseFooters, addToResponseHeaders, addToResponseMessages, allVersions, bcwti, buildFormProcessorURL, buildFormProcessorURL, comment, createActionsBar, createFederationNavigationBar, createGlobalNavigationBar, createNavigationBar, createParentFolderLink, currentTimestamp, displayAllCabinets, displayAttributeName, displayAttributesTable, displayAttributeValue, displayFolderContents, displayFolderObject, displayFolderTrail, displayGoToLatestLink, displayOrganizationIdentifier, displayPendingChangeIndicator, displayStyleSheetAttributesTable, displayVisualData, formatDate, getActionPairs, getAllCabinetsURL, getBaselineItems, getCharsetEncoding, getCheckedOutFolderURL, getClassIcon, getClassInfo, getContextAction, getContextClass, getContextClassName, getContextListIn, getContextListOut, getContextObj, getContextProperties, getContextServiceName, getDisplayName, getDomainPath, getEnabledVersion, getEncoding, getFederationSearchURL, getFolderLocation, getFolderPath, getFormData, getGenericInstanceIconImgTag, getGlyphImageTag, getGlyphsArray, getGlyphTagsNoDnD, getHelpContext, getHomepageURL, getHTMLComponentFactory, getHTMLHelpLink, getHTMLHelpURL, getHTMLHelpURL, getHTMLTableService, getIconResource, getIconResource, getIconResource, getIconSelector, getId, getJavaScriptManager, getLocalizedDateFormatMessage, getLocalizedMessage, getLocalizedPrintWriter, getLocalizedString, getObjectDnDIcon, getObjectIcon, getObjectIconDnDTag, getObjectIconGlyphs, getObjectIconImgTag, getObjectIconImgTag, getObjectIconImgTag, getObjectIconImgTag, getObjectIconImgTag, getObjectIconImgTag, getObjectPropertyValueString, getObjectPropertyValueString, getPageContext, getParentFolderLink, getPersonalCabinet, getPersonalCabinetURL, getPreferenceValue, getPrincipalEmailLink, getPrincipalEmailLink, getPrintWriter, getPropertyFromPropertyFile, getQuery, getQueryData, getReferenceString, getReferenceString, getResourceString, getResourceString, getResponseExceptions, getResponseFooters, getResponseHeaders, getResponseMessages, getResponseString, getSearchCriteriaURL, getSearchCriteriaURL, getSearchResultsURL, getShareImage, getShareImage, getState, getStatus, getStringFromResourceBundle, getStringFromResourceBundle, getTemplateDisplayGeneral, getTrailId, getTrlIdAttribute, getURLActions, getURLActions, getURLActions, getURLActions, getURLActionsString, getURLActionsString, getURLFactory, getURLFromDelegate, getURLProcessorLink, getURLProcessorLink, getURLProcessorLink, getURLProcessorLinkWithLabel, getUsedByLinks, getWCColor, getWCColor, getWCColorDec, getWCColorDec, getWCFontFamily, getWCFontFamily, getWorklistURL, getWTAttribute, getWTContainerByName, getWTContainerRef, handleExceptionTP, handleExceptionTP, handleProcessorException, hiddenContextString, include, initJavaScriptManager, isDndMicroAppletEnabled, isEqual, listContent, objectActionLink, objectActionLinkAux, objectActionLinkAux, objectActionLinkAux, objectActionLinkAux, objectActionLinkAux, objectActionLinkAux, objectActionLinkAux, objectBackground, objectIdentification, objectIdentifier, objectProperties, objectPropertyName, objectPropertyNameAux, objectPropertyNameAux2, objectPropertyValue, objectPropertyValueAux, objectPropertyValueAux2, objectPropertyValueString, outputLink, outputPropertyFromPropertyFile, parameterValue, partUsedBy, PDMLinkIsInstalled, printQueryTable, printTable, printTextArea, processSubTemplate, readContext, readExternal, readVersion, setColumnProperties, setContextAction, setContextClass, setContextClassName, setContextListIn, setContextListOut, setContextProperties, setFormData, setHelpContext, setHTMLTableService, setJavaScriptManager, setPageContext, setQueryData, setResponseExceptions, setResponseFooters, setResponseHeaders, setResponseMessages, setResponseString, setState, setStatus, showResponseExceptions, showResponseFooters, showResponseHeaders, showResponseMessage, showResponseMessages, showVersions, sortQueryResult, splitStringIntoTokens, tableService, translateToHtml, useProcessorService, visualizationIsEnabled, writeExternal, writeHiddenContext, writeQueryStringContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

topLevelDocument

private WTDocument topLevelDocument

topLevelDocMaster

private WTDocumentMaster topLevelDocMaster

docIterationHasBeenChanged

private boolean docIterationHasBeenChanged

oldDocForHasChanged

private WTDocument oldDocForHasChanged

newDocForHasChanged

private WTDocument newDocForHasChanged

params

private Properties params

configSpec

private ConfigSpec configSpec

pageId

private String pageId

contextAction

private String contextAction

attributes

private DocumentStructureProcessor.Attribute[] attributes

VERBOSE

private static boolean VERBOSE

CODEBASE

private static String CODEBASE

DEFAULT_ATTRIBUTE_LIST

private static String DEFAULT_ATTRIBUTE_LIST

nodeCache

private static Cache nodeCache

ID_SEPARATOR

public static final String ID_SEPARATOR
See Also:
Constant Field Values

DISPLAY_SEPARATOR

public static final String DISPLAY_SEPARATOR
See Also:
Constant Field Values

SINGLE_SEPARATOR

public static final String SINGLE_SEPARATOR
See Also:
Constant Field Values

LIST_SEPARATOR

public static final String LIST_SEPARATOR
See Also:
Constant Field Values

LINK_ATTRIBUTE

public static final String LINK_ATTRIBUTE
See Also:
Constant Field Values

DEFAULT_ACTION

public static final String DEFAULT_ACTION
See Also:
Constant Field Values

DEFAULT_TEMPLATE

public static final String DEFAULT_TEMPLATE
See Also:
Constant Field Values

LINE_BREAK

public static final String LINE_BREAK
See Also:
Constant Field Values

CODED_NAME

public static final String CODED_NAME
See Also:
Constant Field Values

NULL_STRING

public static final String NULL_STRING
See Also:
Constant Field Values

NODE_COUNT

public static final String NODE_COUNT
See Also:
Constant Field Values

PAGE_ID

public static final String PAGE_ID
See Also:
Constant Field Values

CONTEXT_ACTION

public static final String CONTEXT_ACTION
See Also:
Constant Field Values

EXPAND_GIF

protected static final String EXPAND_GIF
See Also:
Constant Field Values

COLLAPSE_GIF

protected static final String COLLAPSE_GIF
See Also:
Constant Field Values

RESOURCE

protected static String RESOURCE

EXPANDED

protected static final int EXPANDED
See Also:
Constant Field Values

COLLAPSED

protected static final int COLLAPSED
See Also:
Constant Field Values

NO_CHILDREN

protected static final int NO_CHILDREN
See Also:
Constant Field Values

ROOT

protected static final int ROOT
See Also:
Constant Field Values
Constructor Detail

DocumentStructureProcessor

public DocumentStructureProcessor()
Method Detail

handleRequest

public void handleRequest(HTTPRequest request,
                          HTTPResponse response)
                   throws WTException
Method invoked when a URL to this template processor is followed. This method instantiates an HTML template to be displayed.

Parameters:
request - the HTTPRequest object
response - the HTTPResponse object
Throws:
WTException

getTemplate

public HTMLTemplate getTemplate(Vector preferences)
                         throws WTException
Method which retrieves the HTML template to be processed by this processor.

Parameters:
preferences - the Vector of preferences used to initialize the HTML template
Returns:
the initialized HTML template processed by this processor
Throws:
WTException

setContextObj

public void setContextObj(Object obj)
Sets the context object for this processor. This method will set both the context object and the action object to the given object.

Specified by:
setContextObj in interface ContextHolder
Overrides:
setContextObj in class BasicTemplateProcessor
Parameters:
obj -

hasConfigSpec

protected boolean hasConfigSpec()
Determines whether or not a Configuration Specification exists in which to show the structure.


getConfigSpec

protected ConfigSpec getConfigSpec()
Returns the Configuration Specification used to show the structure. If the current configuration specification is null, this method will attempt to retrieve a config spec first by checking the Properties for this page, next by checking if a config spec has been saved for the current session and then by checking if a config spec has been saved for the current user.

Returns:
the ConfigSpec used for showing this structure, if no config spec exists, null is returned.

displayDocumentStructure

public void displayDocumentStructure(Properties parameters,
                                     Locale locale,
                                     OutputStream os)
                              throws WTException
Outputs the structure tree. This method is invoked as a Windchill Script call in an HTML template file.

Parameters:
parameters - any parameters passed in the Windchill Script call
locale - the Locale of the client displaying the HTML page
os - the OutputStream to write to
Throws:
WTException

outputInitialDocumentStructure

protected void outputInitialDocumentStructure(Properties parameters,
                                              Locale locale,
                                              PrintWriter out)
                                       throws WTException
Outputs the hierarchical structure for the context object to the given PrintWriter. This method does not retrieve any information from the cache, but gets it all from the database.

Throws:
WTException

outputDocumentStructure

protected void outputDocumentStructure(Properties parameters,
                                       Locale locale,
                                       PrintWriter out)
                                throws WTException
Displays the structure hierarchy using information that was passed in as form data. The form data contains all of the information needed to build the structure hierarchy.

Parameters:
parameters - a Properties object containing any parameters for the Windchill Script call
locale - the locale in which this page will be displayed
out - the PrintWriter to write to
Throws:
WTException

getDocumentId

protected static String getDocumentId(WTObject document,
                                      WTObject document_usage_link,
                                      int level,
                                      int order,
                                      int expanded)
                               throws WTException
Throws:
WTException

getDocumentId

protected static String getDocumentId(DocumentStructureProcessor.DocumentTreeNode document_node)
Return the String ID to be used as the value of a hidden form field. The String ID contains the level, order, state, oid of the document and oid of the document link.

Parameters:
document_node - the DocumentTreeNode whose ID is returned
Returns:
a String representation of the DocumentTreeNode

outputDocumentId

protected void outputDocumentId(WTObject document,
                                WTObject document_usage_link,
                                PrintWriter out,
                                int level,
                                int order,
                                int expanded)
                         throws WTException
Throws:
WTException

outputDocumentId

protected void outputDocumentId(DocumentStructureProcessor.DocumentTreeNode document_node,
                                PrintWriter out)

getFormStart

protected String getFormStart(String name)
                       throws WTException
Output the starting tag.

Throws:
WTException

getFormStart

protected String getFormStart(String name,
                              String action,
                              String method)
Retrieve the starting tag. The FORM is named with the given name and the action is set with the given action. The method, if not given, is assumed to be a POST.

Parameters:
name - the name of the form.
action - the action of the form.
method - the method of the form.

getFormEnd

protected String getFormEnd()
Return the ending tag.


outputContext

protected void outputContext(PrintWriter out)
                      throws WTException
Method to output the current oid and action in hidden fields. Because this template processor is using a form with a POST, values are not passed on the query string of the URL and need to be passed in hidden fields.

Throws:
WTException

outputDocumentUses

protected void outputDocumentUses(SortedEnumeration document_uses,
                                  int level,
                                  int order,
                                  int state,
                                  Locale locale,
                                  PrintWriter out)
                           throws WTException
Outputs the given QueryResult of Document Uses. This method outputs the String to display in the structure hierarchy as well as the hidden field containing the data of the document displayed. This method will also add the document data to the cache.

Throws:
WTException

buildDocumentNodeString

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. This String contains the expand/collapse GIF, the document icon and the document string.

Parameters:
level - the Level at which this document is in the tree
state - whether this document is expanded, collapsed, or has no children
locale - the locale in which the structure tree will be displayed
Returns:
the String to display in the tree

buildDocumentNodeString

protected String buildDocumentNodeString(DocumentStructureProcessor.DocumentTreeNode document_node,
                                         String document_id,
                                         String display_string,
                                         Locale locale)
                                  throws WTException
Returns the String to be displayed in the structure tree. This String contains the expand/collapse GIF, the document icon and the document string.

Parameters:
document_node - the DocumentTreeNode corresponding to the document to display
document_id - the id of the document to be used as the parameter in the JavaScript function to
locale - the locale in which the structure tree will be displayed
Returns:
the String to display in the tree
Throws:
WTException

getDocumentString

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.

Parameters:
document - the document whose display string is returned
Returns:
a string containing attribute values for the given document.

getDocumentString

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.

Parameters:
document_master - the document master whose display string is returned
Returns:
a string containing attribute values for the given document master.

getDocumentsUsed

protected SortedEnumeration getDocumentsUsed(WTDocument document,
                                             Locale locale)
                                      throws ConfigException,
                                             WTException
Returns a QueryResult corresponding to the documents used by the given document. Each entry in the QueryResult is an array of length 2 containing persistables. The first entry in the array is the IteratedUsageLink corresponding to the uses relationship. The second entry in the link is the document iteration which is used. If no iteration is found which matches the set configuration specification, the master is returned instead.

Throws:
ConfigException
WTException

getNodeString

protected String getNodeString(DocumentStructureProcessor.DocumentTreeNode document_node,
                               String page_id,
                               Locale locale)
                        throws WTException
Returns the String containing the HTML code to display an entry for the given node in the structure hierarchy. This method will attempt to get the String from the cache using the given page id.

Parameters:
document_node - the Document Node whose String representation is returned
page_id - the page id used for locating the node in the cache
Throws:
WTException

getNodeStringFromDatabase

protected String getNodeStringFromDatabase(DocumentStructureProcessor.DocumentTreeNode document_node,
                                           Locale locale)
                                    throws WTException
Returns the String to display in the structure tree for the given DocumentTreeNode. The String is built by retrieving information from the database.

Parameters:
document_node - the DocumentTreeNode whose display string is returned
locale - the Locale in which the structure is displayed
Returns:
the String to be displayed as the tree node for the given DocumentTreeNode
Throws:
WTException

getImage

protected static String getImage(String gif_file)
Returns the String form of the URL to the given image.

Returns:
the String representation of the URL to the given image

getContextActionLink

protected static String getContextActionLink(String document_id,
                                             String label)

outputHiddenField

public 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.

Parameters:
name - the Name of the hidden field
value - the value of the hidden field
out - the PrintWriter to write to.

getHiddenFieldHTML

public static String getHiddenFieldHTML(String name,
                                        String value)

outputGoToPageFunction

public void outputGoToPageFunction(PrintWriter out,
                                   String name)
                            throws WTException
Outputs the JavaScript function which opens the page corresponding to the given action and the given object. The given name is used as the name of the JavaScript function. If no name is given, "goToPage" is used as the name.

Parameters:
out - the PrintWriter to write the function to.
name - the name of the JavaScript function. If no name is given, 'goToPage' is used.
Throws:
WTException

outputSubmitFunction

public void outputSubmitFunction(PrintWriter out,
                                 String name)
Outputs the JavaScript code to build the function to submit the form. The function build takes as parameters a string which is set as the value of the hidden field names "context_action". The "context_action" hidden field specifies which node to expand or contract when the form is submitted. The name of the function is given by the given String parameter. If no name is given, the function is defined as "submitForm".

Parameters:
out - the PrintWriter to write to
name - the name of the function

outputScriptStart

public void outputScriptStart(PrintWriter out,
                              String language)
Outputs the starting tag for a scripting section in an HTML page. The given language string specifies the value of the parameter LANGUAGE in the SCRIPT tag.

Parameters:
out - the PrintWriter to write to.
language - the String language to specify in the script tag

outputScriptEnd

public void outputScriptEnd(PrintWriter out)
Outputs the closing tag for a scripting section in an HTML page.

Parameters:
out - the PrintWriter to write to.

getUniqueId

protected String getUniqueId()
Returns a String representation of a unique page id. The unique page ID is built by combining the session context id and the current time.

Returns:
a String unique page id

addToCache

protected void addToCache(String key,
                          String value)
Enters the given String into the cache. The key for the entry is formed by combining the unique page id with the String key passed in.

Parameters:
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 cache

dumpCache

protected void dumpCache()
Outputs the entire contents of the Cache.


getParameters

protected Properties getParameters(HTTPRequest request)
Returns a Properties object containing the parameters received in the given HTTPRequest. This method will get the parameters from the query string of the HTTPRequest, form data of the HTTPRequest, and bizData of the HTTPRequest.

Returns:
the Properties of the HTTPRequest object.

combineParameters

protected static Properties combineParameters(Properties params_to_add,
                                              Properties original_params)

getObjectFromReference

public static Persistable getObjectFromReference(String reference)
                                          throws WTException
Returns the Persistable which corresponds to the given String object reference.

Returns:
the Persistable corresponding to the given String reference
Throws:
WTException

outputConfigSpec

public void outputConfigSpec(Properties properties,
                             Locale locale,
                             OutputStream os)
Outputs a displayable representation of the current configuration specification.

Parameters:
properties - the Properties object containing the script parameters
locale - the locale in which to display the link
os - the OutputStream to write the link to

getConfigSpecDisplayTemplate

protected HTMLTemplate getConfigSpecDisplayTemplate(Locale locale)
                                             throws WTException
Returns the HTMLTemplate for displaying the properties of the configuration specification

Throws:
WTException

getConfigSpecForm

protected String getConfigSpecForm()
                            throws WTException
Returns the String specifying the form for displaying the current configuration specification

Throws:
WTException

outputConfigSpecLink

public void outputConfigSpecLink(Properties properties,
                                 Locale locale,
                                 OutputStream os)
Outputs a link to modify the config spec. This method is invoked as a Windchill script call in an HTML template. The given Properties object contains parameters of the script call. The following parameters can be given: "label" - specifies the label to use as the text of the HREF, "style" - specifies any style information used to format the link.

Parameters:
properties - the Properties object containing the script parameters
locale - the locale in which to display the link
os - the OutputStream to write the link to

getConfigSpecLink

public String getConfigSpecLink(Properties properties,
                                Locale locale)
Returns a string representation of the HTML code to create a link to change the current configuration specification.


splitString

protected static String splitString(String string_to_split)
Removes the ID_SEPARATOR characters in the given string and replaces them with spaces. This method is useful for allowing arguments with spaces to be passed in to Windchill scripts.

Parameters:
string_to_split - the string to split
Returns:
the given string with spaces replacing the separators

getAttributeList

protected DocumentStructureProcessor.Attribute[] getAttributeList(String attr_list)
Returns an array of Attribute objects corresponding to the given String. The given String is parsed and Attribute objects are created for each attribute in the String.

Parameters:
attr_list - a string containing a comma-separated list of attributes
Returns:
an array of Attribute objects corresponding to the given string

getDefaultAttributeList

protected DocumentStructureProcessor.Attribute[] getDefaultAttributeList()
Returns an array of Attribute objects corresponding to the default list of attributes specified in wt.properties. This method creates an array of Attribute objects by parsing a string retrieved. from the wt.properties file. The string is the value in wt.properties corresponding to the key given by DEFAULT_ATTRIBUTE_LIST.

Returns:
an array of Attribute objects corresponding to the given string