wt.doc
Class DocConfigSpecProcessor

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

public class DocConfigSpecProcessor
extends FormProcessor

Form processor which handles the display of the forms used to set a Configuration Specification. This form processor is used by the DocumentStructureProcessor which requires having a config spec set in order to display a document structure.

See Also:
Serialized Form

Nested Class Summary
static class DocConfigSpecProcessor.ListEntry
          Helper class for maintaining both the OID of an object and its display value.
 
Field Summary
private  ConfigSpec configSpec
           
private  Properties contextProperties
           
private  Properties formProperties
           
static String ID_SEPARATOR
           
private static String RESOURCE
           
private static boolean VERBOSE
           
 
Fields inherited from class wt.enterprise.FormProcessor
CONTEXTUAL_CLASS, CONTEXTUAL_EXCEPTION, CONTEXTUAL_HEADER, CONTEXTUAL_MESSAGE, CONTEXTUAL_OBJECT, CONTEXTUAL_STATUS, DEFAULT_LIFECYCLE, FOLDER_INPUT_NAME, folderLocation, FORM_CLASS, LIFE_CYCLE_INPUT_NAME, NAME_HDR, NAVIGATE_METHOD, RESOURCECLASS_PARAMETER, RESOURCEKEY_PARAMETER, RETURN_TEMPLATE, STATUS_FATAL_ERROR, STATUS_OK, STATUS_USER_ERROR, TEAMTEMPLATE_INPUT_NAME
 
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, 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_ACTION, CONTEXT_CLASS_NAME, CONTEXT_OBJ, CONTEXT_PROPERTIES, FORM_DATA, QUERY_DATA, RESPONSE_EXCEPTIONS, RESPONSE_FOOTERS, RESPONSE_HEADERS, RESPONSE_MESSAGES, RESPONSE_STRING, STATUS
 
Constructor Summary
DocConfigSpecProcessor(Properties props, HTTPRequest request)
          Constructor for DocConfigSpecProcessor.
 
Method Summary
 void buildSearchURL(Properties parameters, Locale locale, OutputStream os)
          Output an HTML link to a search page.
protected static Properties combineParameters(Properties params_to_add, Properties original_params)
          Add the key-value pairs in the first Properties object to the second Properties object.
protected static Properties combineParameters(Properties params_to_add, Properties original_params, boolean strip_oid_and_action)
          Add the key-value pairs in the first Properties object to the second Properties object.
static void configItemSearch(HTTPRequest request, HTTPResponse response)
          Display the HTML page to search for a configuration item.
 void createSetConfigSpecLink(Properties parameters, Locale locale, OutputStream os)
          Output the HTML code to display a link to the form to set a configuration specification.
 void generateAction(Properties parameters, Locale locale, OutputStream os)
          Outputs the URL to be used as the ACTION of an HTML FORM.
static void generateForm(HTTPRequest request, HTTPResponse response)
          Generates the form which supports setting a configuration specification.
protected static String getActionParameter(Properties properties)
          Retrieves the action parameter from the given Properties object.
protected  Object getAttributeValue(String attribute)
          Returns the object which is the value of the given attribute on the current config spec.
 String getAttributeValueString(String attribute, Properties properties, Locale locale)
          Returns the String value of the given attribute for the current config spec.
static Vector getCabinetList()
          Generates a Vector of cabinet strings to be used in the drop down list.
protected  ConfigSpec getConfigSpec()
          Returns the Configuration Specification used to initially populate the form fields.
static Vector getDataFormatList()
          Generates a Vector of data format strings to be used in the drop down list.
static Vector getLCTList()
          Generates a Vector of life cycle template strings to be used in the drop down list.
static Vector getLegalValueList(String method_name)
          Generates a Vector of legal value strings to be used in the drop down list.
protected static PropertyDescriptor getPropertyDescriptor(Class attr_class, String attribute)
          Retrieves the PropertyDescriptor for the given attribute.
static Vector getTeamTemplateList()
          Generates a Vector of teamTemplate strings to be used in the drop down list.
 Vector getValueList(PropertyDescriptor pd, Locale locale)
          Tries to generate a Vector of legal value strings to be used in the drop down list.
static Vector getViewList()
          Generates a Vector of view strings to be used in the drop down list.
static void invokeAction(HTTPRequest request, HTTPResponse response)
          Method invoked as the action of an HTML FORM.
 void outputAttributeValue(Properties properties, Locale locale, OutputStream os)
          Outputs the value of the given attribute.
 void outputFormFields(Properties parameters, Locale locale, OutputStream os)
          For all of the key-value pairs in the given Properties object, create a hidden form field with the key as the name and the value as the value of the form field.
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.
 void outputObjectReference(Properties properties, Locale locale, OutputStream os)
          Outputs the object reference of a specified object to the given OutputStream.
 void printDataList(Properties parameters, Locale locale, OutputStream os)
          Output an HTML SELECT form field whose values are specified by the value of "type" in the given Properties object.
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.FormProcessor
contextualMessage, contextualValue, createDirTranslationsTabs, createFedAdminBar, createIETranslationsTabs, currentFolderId, currentFolderPath, dirTranslations, displayActionTable, displayIESystemType, displayIESystemTypeOptions, displayInterval, displayOption, displaySearchScope, enumeratedTypeMenu, generateActionTable, getButtonText, getContextProperties, getFormProcessorURL, getTemplate, getTemplateProcessorURL, getWorkingLocationName, getWorkingLocationValue, handleRequest, holderUploadTable, IETranslations, insertDirTranslationTableCheck, insertIETranslationTableCheck, listDirectoryServices, listDirTranslationTables, listIETranslationTables, listInfoEngineServices, listLifeCycles, listTeamTemplates, navigateFolders, navigateFolders, obtainFromCovertProperty, orgDependentField, parentFolderPath, parseServiceURL, processForm, processForm, selectFolderMenu, serviceLink, setContextProperties, updateDirTranslationsTabs, updateIETranslationsTabs, uploadPrimary, viewDirTranslationsTabs, viewIETranslationsTabs, wrapText
 
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, 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, setContextObj, 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

VERBOSE

private static boolean VERBOSE

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

ID_SEPARATOR

public static String ID_SEPARATOR

formProperties

private Properties formProperties

contextProperties

private Properties contextProperties

configSpec

private ConfigSpec configSpec
Constructor Detail

DocConfigSpecProcessor

public DocConfigSpecProcessor(Properties props,
                              HTTPRequest request)
                       throws ClassNotFoundException,
                              WTException,
                              PropertyVetoException
Constructor for DocConfigSpecProcessor. The given Properties object is used to initialize the context properties for this processor.

Parameters:
props - the Properties object used to initialize the context properties
request - the HTTPRequest which resulted in creating this form processor.
Method Detail

generateAction

public void generateAction(Properties parameters,
                           Locale locale,
                           OutputStream os)
                    throws WTException
Outputs the URL to be used as the ACTION of an HTML FORM. The URL is output to the given OutputStream. This method will attempt to retrieve the class name and method to be used in building the URL. If no class is found, this class is used as the class. This method is typically called from a Windchill Script tag in an HTML template.

Overrides:
generateAction in class FormProcessor
Parameters:
parameters - the Properties object which may contain the Class and Method to use in building the URL
locale - the Locale in which the HTML pages are displayed
os - the OutputStream to write the URL to
Throws:
WTException

generateForm

public static void generateForm(HTTPRequest request,
                                HTTPResponse response)
                         throws WTException,
                                PropertyVetoException,
                                IOException,
                                InvocationTargetException,
                                IllegalAccessException,
                                ClassNotFoundException
Generates the form which supports setting a configuration specification. Parameter values used in building the form are retrieved from both the query string and the form data of the given HTTPRequest. This method looks for the following values: class - used by form processor and template processor for determining which HTML page to display form - the HTML template form to process for displaying this form return_action - the action to be used after the form has been submitted return_template - the template to be processed after the form has been submitted. return_oid - the oid of the object to be the context object after the form has been submitted. config_spec - the configuration specification

Parameters:
request - the HTTPRequest object
response - the HTTPResponse object
Throws:
WTException
PropertyVetoException
IOException
InvocationTargetException
IllegalAccessException
ClassNotFoundException

invokeAction

public static void invokeAction(HTTPRequest request,
                                HTTPResponse response)
                         throws Exception
Method invoked as the action of an HTML FORM. This method attempts to retrieve an ActionDelegate to handle the processing of the form.

Throws:
Exception

outputFormFields

public void outputFormFields(Properties parameters,
                             Locale locale,
                             OutputStream os)
For all of the key-value pairs in the given Properties object, create a hidden form field with the key as the name and the value as the value of the form field. The hidden fields are output to the given OutputStream.


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.

createSetConfigSpecLink

public void createSetConfigSpecLink(Properties parameters,
                                    Locale locale,
                                    OutputStream os)
Output the HTML code to display a link to the form to set a configuration specification.


getConfigSpec

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

Returns:
the ConfigSpec initially shown in the form, if no config spec exists, null is returned.

outputObjectReference

public void outputObjectReference(Properties properties,
                                  Locale locale,
                                  OutputStream os)
Outputs the object reference of a specified object to the given OutputStream. This method will output the object reference for the attribute specified in the Properties. This method will typically be called from a Windchill script call in an HTML template. The "attribute" value passed in the properties object is used to retrieve that attribute from the current config spec. Then the object reference of that attribute is output


configItemSearch

public static void configItemSearch(HTTPRequest request,
                                    HTTPResponse response)
                             throws WTException,
                                    IOException,
                                    PropertyVetoException,
                                    ClassNotFoundException
Display the HTML page to search for a configuration item.

Throws:
WTException
IOException
PropertyVetoException
ClassNotFoundException

buildSearchURL

public void buildSearchURL(Properties parameters,
                           Locale locale,
                           OutputStream os)
                    throws WTException
Output an HTML link to a search page. The link will be created to a search using the EffectivitySearchProcessor.

Throws:
WTException

printDataList

public void printDataList(Properties parameters,
                          Locale locale,
                          OutputStream os)
                   throws WTException
Output an HTML SELECT form field whose values are specified by the value of "type" in the given Properties object.

Throws:
WTException

combineParameters

protected static Properties combineParameters(Properties params_to_add,
                                              Properties original_params)
Add the key-value pairs in the first Properties object to the second Properties object.

Parameters:
params_to_add - the Properties object containing the parameters to add to the second Properties object
original_params - the Properties object to add the first given Properties to.
Returns:
the second Properties object with the key-values pairs of the first added.

combineParameters

protected static Properties combineParameters(Properties params_to_add,
                                              Properties original_params,
                                              boolean strip_oid_and_action)
Add the key-value pairs in the first Properties object to the second Properties object. The given boolean value indicates whether or not to strip out any "oid" and "action" parameters found in the given parameters to be added.

Parameters:
params_to_add - the Properties object containing the parameters to add to the second Properties object
original_params - the Properties object to add the first given Properties to.
strip_oid_and_action - if true, any parameters with the key "oid" or the key "action" will not be combined.
Returns:
the second Properties object with the key-values pairs of the first added.

getActionParameter

protected static String getActionParameter(Properties properties)
Retrieves the action parameter from the given Properties object. This method will attempt to find an action parameter by using keys of "action", "Action" and "_action".

Parameters:
properties - the Properties object from which the action parameter is retrieved
Returns:
the String value corresponding to the action parameter retrieved from the given properties. If no action parameter is found, null is returned

getTeamTemplateList

public static Vector getTeamTemplateList()
                                  throws WTException
Generates a Vector of teamTemplate strings to be used in the drop down list.

Throws:
WTException

getCabinetList

public static Vector getCabinetList()
                             throws WTException
Generates a Vector of cabinet strings to be used in the drop down list.

Throws:
WTException

getViewList

public static Vector getViewList()
                          throws WTException
Generates a Vector of view strings to be used in the drop down list.

Throws:
WTException

getDataFormatList

public static Vector getDataFormatList()
                                throws WTException
Generates a Vector of data format strings to be used in the drop down list.

Throws:
WTException

getLCTList

public static Vector getLCTList()
                         throws WTException
Generates a Vector of life cycle template strings to be used in the drop down list.

Throws:
WTException

getLegalValueList

public static Vector getLegalValueList(String method_name)
                                throws WTException
Generates a Vector of legal value strings to be used in the drop down list. Does an invoke on the method name.

Throws:
WTException

getValueList

public Vector getValueList(PropertyDescriptor pd,
                           Locale locale)
Tries to generate a Vector of legal value strings to be used in the drop down list. Checks for attribute types that it knows how to generate lists for like boolean and extensions of EnumeratedType.


outputAttributeValue

public void outputAttributeValue(Properties properties,
                                 Locale locale,
                                 OutputStream os)
                          throws WTException
Outputs the value of the given attribute. This method is typically invoked as a Windchill script call in an HTML template.

Parameters:
properties - parameters passed into the script call
locale - the locale in which to display the value
os - the OutputStream to write to
Throws:
WTException

getAttributeValueString

public String getAttributeValueString(String attribute,
                                      Properties properties,
                                      Locale locale)
Returns the String value of the given attribute for the current config spec.

Parameters:
attribute - the attribute whose value is retrieved from the current config spec
Returns:
the String representation of the given attribute on the current config spec

getAttributeValue

protected Object getAttributeValue(String attribute)
                            throws InvocationTargetException,
                                   IllegalAccessException,
                                   WTException
Returns the object which is the value of the given attribute on the current config spec. This method does no formatting of the result object.

Parameters:
attribute - the attribute whose value is retrieved
Throws:
InvocationTargetException
IllegalAccessException
WTException

getPropertyDescriptor

protected static PropertyDescriptor getPropertyDescriptor(Class attr_class,
                                                          String attribute)
                                                   throws WTException
Retrieves the PropertyDescriptor for the given attribute.

Throws:
WTException

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