wt.query
Class ObjectSearchProcessor

java.lang.Object
  extended bywt.enterprise.BasicTemplateProcessor
      extended bywt.query.LocalSearchProcessor
          extended bywt.query.ObjectSearchProcessor
All Implemented Interfaces:
ContextHolder, ContextTranslator, Evolvable, Externalizable, Serializable, TemplateProcessor

public class ObjectSearchProcessor
extends LocalSearchProcessor

See Also:
Serialized Form

Field Summary
private  String base_class
           
private static String CODEBASE
           
private  Hashtable criteria
           
protected static String CRITERIA_PREFIX
           
protected static String DEFAULT_FORM_METHOD
           
protected static String DEFAULT_NAME_VARIABLE
           
protected static String DEFAULT_OR_VARIABLE
           
protected static String DEFAULT_UPDATE_FUNCTION_NAME
           
protected static String DEFAULT_URLPROCESSOR_METHOD
           
private  Vector error
           
private  boolean form_is_submitted
           
private  String form_name
           
protected static String FORM_PARAM_PREFIX
           
protected static String JAVASCRIPT_LANGUAGE
           
private  String multi_level_BOM
           
protected static String NAME_ARRAY
           
protected static String OBJECT_REFERENCE_ARRAY
           
private static int PAGE_EXPIRATION
           
private  String query_value
           
private static String RESOURCE
           
protected static String RESULTS_FORM_NAME
           
protected static String RETURN_SELECTION_FUNCTION_NAME
           
protected static String SET_FIELD_FUNCTION_NAME
           
private static boolean VERBOSE
           
 
Fields inherited from class wt.query.LocalSearchProcessor
 
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_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
ObjectSearchProcessor()
           
 
Method Summary
 void buildClassList(Properties properties, Locale locale, OutputStream os)
           
static Properties combineProperties(Properties prop_a, Properties prop_b)
          Returns a Properties object which is a result of combining the entries in the two given Properties objects.
 void displayBaseSearchType(Properties parameters, Locale locale, OutputStream os)
           
 void displayIcon(Properties parameters, Locale locale, OutputStream os)
           
 void displaySearchCriteria(Properties parameters, Locale locale, OutputStream os)
          Presents the local search criteria.
 void displaySearchType(Properties parameters, Locale locale, OutputStream os)
           
 void doSearch(Properties parameters, Locale locale, OutputStream os)
          Presents the local search results.
protected  void endScriptTag(PrintWriter out)
          Convenience method to output the ending SCRIPT tag.
protected static Properties getFormParams(Properties props)
           
static String getHiddenFieldHTML(String name, String value)
           
private  WTPartMaster getPartMaster(String oidValue)
          Create a WTReference and return a WTPartMaster.
 HTMLTemplate getTemplate(HTTPRequest request, String action)
          Returns the HTMLTemplate to be processed by this processor.
 void handleRequest(HTTPRequest req, HTTPResponse resp)
          This method handles HTTP GET requests to produce an HTML page which presents the Local Search criteria page.
 void outputContextParameters(PrintWriter out)
           
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 outputReturnSelectionFunction(String or_var, String name_var, PrintWriter out)
          Outputs a JavaScript function to return the object reference and name of the selected search result to the parent document.
protected  void outputSetFieldFunction(PrintWriter out)
          Outputs a JavaScript function which will set the value of a given form element to the given value.
protected  void outputUpdateSelectedFunction(String or_var, String name_var, String function_name, PrintWriter out)
           
 void populateCriteria(Properties params)
          Populate this.criteria from Properties.
static void printParams(Properties parameters)
          Outputs the key-value pairs in the given Properties object.
static void processObjectSearch(HTTPRequest req, HTTPResponse resp)
           
private  void showSearchCriteria(OutputStream os, Properties parameters, Locale locale, PrintWriter out)
           
protected  void startScriptTag(String language, PrintWriter out)
          Convenience method to output the starting SCRIPT tag.
 
Methods inherited from class wt.query.LocalSearchProcessor
displayLocalSearch, displayLocalSearch, getAttributeValueList, getCabinetList, getDataFormatList, getLegalValueList, getTeamTemplateList, getTemplate, getValueList, getViewList, localSearch
 
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, setContextObj, 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

CODEBASE

private static String CODEBASE

VERBOSE

private static boolean VERBOSE

PAGE_EXPIRATION

private static int PAGE_EXPIRATION

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

DEFAULT_OR_VARIABLE

protected static String DEFAULT_OR_VARIABLE

DEFAULT_NAME_VARIABLE

protected static String DEFAULT_NAME_VARIABLE

DEFAULT_UPDATE_FUNCTION_NAME

protected static String DEFAULT_UPDATE_FUNCTION_NAME

OBJECT_REFERENCE_ARRAY

protected static String OBJECT_REFERENCE_ARRAY

NAME_ARRAY

protected static String NAME_ARRAY

RESULTS_FORM_NAME

protected static String RESULTS_FORM_NAME

SET_FIELD_FUNCTION_NAME

protected static String SET_FIELD_FUNCTION_NAME

RETURN_SELECTION_FUNCTION_NAME

protected static String RETURN_SELECTION_FUNCTION_NAME

JAVASCRIPT_LANGUAGE

protected static String JAVASCRIPT_LANGUAGE

DEFAULT_URLPROCESSOR_METHOD

protected static String DEFAULT_URLPROCESSOR_METHOD

DEFAULT_FORM_METHOD

protected static String DEFAULT_FORM_METHOD

FORM_PARAM_PREFIX

protected static String FORM_PARAM_PREFIX

CRITERIA_PREFIX

protected static String CRITERIA_PREFIX

criteria

private Hashtable criteria

query_value

private String query_value

base_class

private String base_class

form_name

private String form_name

form_is_submitted

private boolean form_is_submitted

error

private Vector error

multi_level_BOM

private String multi_level_BOM
Constructor Detail

ObjectSearchProcessor

public ObjectSearchProcessor()
Method Detail

handleRequest

public void handleRequest(HTTPRequest req,
                          HTTPResponse resp)
                   throws WTException
This method handles HTTP GET requests to produce an HTML page which presents the Local Search criteria page.

Specified by:
handleRequest in interface TemplateProcessor
Overrides:
handleRequest in class LocalSearchProcessor
Parameters:
req - HTTPRequest
resp - HTTPResponse
Throws:
WTException
See Also:
URLProcessor

getTemplate

public HTMLTemplate getTemplate(HTTPRequest request,
                                String action)
                         throws WTException
Returns the HTMLTemplate to be processed by this processor. This method uses the DefaultHTMLTemplateFactory which looks up an HTML template resource using the given action. The returned HTMLTemplate has been initialized.

Parameters:
request - The HTTPRequest used in setting the language preferences for this template
action - The action used in selecting the appropriate HTML template resource.
Returns:
the initialized HTMLTemplate
Throws:
WTException

processObjectSearch

public static void processObjectSearch(HTTPRequest req,
                                       HTTPResponse resp)
                                throws WTException
Throws:
WTException

buildClassList

public void buildClassList(Properties properties,
                           Locale locale,
                           OutputStream os)
                    throws WTException
Throws:
WTException

displaySearchCriteria

public void displaySearchCriteria(Properties parameters,
                                  Locale locale,
                                  OutputStream os)
                           throws WTException
Presents the local search criteria. Generates the html and java script required.

Throws:
WTException

showSearchCriteria

private void showSearchCriteria(OutputStream os,
                                Properties parameters,
                                Locale locale,
                                PrintWriter out)
                         throws WTException
Throws:
WTException

doSearch

public void doSearch(Properties parameters,
                     Locale locale,
                     OutputStream os)
              throws WTException
Presents the local search results. Does the search and presents the results.

Throws:
WTException

displaySearchType

public void displaySearchType(Properties parameters,
                              Locale locale,
                              OutputStream os)
                       throws WTException
Throws:
WTException

displayBaseSearchType

public void displayBaseSearchType(Properties parameters,
                                  Locale locale,
                                  OutputStream os)
                           throws WTException
Throws:
WTException

displayIcon

public void displayIcon(Properties parameters,
                        Locale locale,
                        OutputStream os)

outputContextParameters

public void outputContextParameters(PrintWriter out)

outputUpdateSelectedFunction

protected void outputUpdateSelectedFunction(String or_var,
                                            String name_var,
                                            String function_name,
                                            PrintWriter out)

outputSetFieldFunction

protected void outputSetFieldFunction(PrintWriter out)
Outputs a JavaScript function which will set the value of a given form element to the given value. The JavaScript function will set the value of a form element in the document that opened this search.

Parameters:
out - the PrintWriter to write the function to

outputReturnSelectionFunction

protected void outputReturnSelectionFunction(String or_var,
                                             String name_var,
                                             PrintWriter out)
Outputs a JavaScript function to return the object reference and name of the selected search result to the parent document. This function invokes the 'setField' JavaScript function to set the value of the form element corresponding to the object reference and the form element corresponding to the object name. The names of the fields within the search page which correspond to the object reference and object name are passed in as parameters.

Parameters:
or_var - the form element name within this page which contains the value of the selected object reference
name_var - the form element name within this page which contains the value of the selected object name
out - the PrintWriter to write the JavaScript function to

startScriptTag

protected void startScriptTag(String language,
                              PrintWriter out)
Convenience method to output the starting SCRIPT tag. The given String parameter specifies the language to use in the SCRIPT tag. The tag is written out to the given PrintWriter.

Parameters:
language - the String language to use in the SCRIPT tag
out - the PrintWriter to write to

endScriptTag

protected void endScriptTag(PrintWriter out)
Convenience method to output the ending SCRIPT tag. The tag is written to the given PrintWriter


getFormParams

protected static Properties getFormParams(Properties props)

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)

printParams

public static void printParams(Properties parameters)
Outputs the key-value pairs in the given Properties object.

Parameters:
parameters - the Properties object whose entries are output

combineProperties

public static Properties combineProperties(Properties prop_a,
                                           Properties prop_b)
Returns a Properties object which is a result of combining the entries in the two given Properties objects.

Parameters:
prop_a - one of the two Properties objects to be combined
prop_b - one of the two Properties objects to be combined
Returns:
a Properties object containing all of the key-value pairs from both of the given Properties objects.

populateCriteria

public void populateCriteria(Properties params)
Populate this.criteria from Properties.


getPartMaster

private WTPartMaster getPartMaster(String oidValue)
                            throws WTException
Create a WTReference and return a WTPartMaster.

Parameters:
oidValue - an oid used to get the OR.
Throws:
WTException