com.ptc.windchill.cadx.common.picker
Class PickerSearcherUtilities

java.lang.Object
  extended bycom.ptc.windchill.cadx.common.picker.PickerUtilities
      extended bycom.ptc.windchill.cadx.common.picker.PickerSearcherUtilities
All Implemented Interfaces:
Externalizable, Serializable

public class PickerSearcherUtilities
extends PickerUtilities
implements Externalizable



Supported API: false

Extendable: false

See Also:
Serialized Form

Field Summary
private static String CLASSNAME
           
private  String criteriaChangedScript
           
private  String criteriaSelectedScript
           
private  String criteriaUnSelectedAndValidateScript
           
private  String criteriaUnSelectedScript
           
static long EXTERNALIZATION_VERSION_UID
           
static String FIND_USERS_ACTION
           
private static String HTML_SEARCH_RESOURCE
           
static int LONG_TEXTBOX
           
protected static long OLD_FORMAT_VERSION_UID
           
static String PICKER_SEARCHER_PAGE_PROP_COOKIE_KEY
           
static String PICKER_SEARCHER_SEARCH_FORM_ACTION_VALUE
           
static String PICKER_SEARCHER_TABLE_NAME
          This is the Search Prferences action value.
static String PICKER_SEARCHER_USE_SEARCH_SORT_PREF_PROP_KEY
           
private static String RESOURCE
           
static String SEARCH_NON_WPDM_ALL_SORT_KEY
           
protected static String SEARCH_PREFERENCES_ASCENDING
           
protected static String SEARCH_PREFERENCES_DESCENDING
           
protected static String SEARCH_PREFERENCES_SORT_PREF_DELIM
           
static String SEARCH_PREFS_ACTION_VALUE
          This is the Search Prferences action value.
static String SEARCH_PREFS_WINDCHILL_ACTION_VALUE
           
private  SearchAttributeListDelegate searcherAttrList
           
(package private) static long serialVersionUID
           
static int SHORT_TEXTBOX
           
 
Fields inherited from class com.ptc.windchill.cadx.common.picker.PickerUtilities
ALL_CONTAINERS_CONTEXT, AUTHORING_APP, CELL_CLASS, COLUMN_SORT_SERVICE_DELIM, DELETABLE_ONLY_FILTER, DO_SORT, FILTER, FIND_RESULTS, formData, IN_SHARED_CABINET_ONLY_FILTER_VALUE, LABEL_ALIGN, LABEL_CLASS, locale, LOCATION, MULTI_SELECT, os, out, PDMLINK_CONTAINERS_CONTEXT, PICKER_ACTION_VALUE, PICKER_BROWSER_ACTION_VALUE, PICKER_CONTAINER_CONTEXT, PICKER_COOKIE_ID, PICKER_POPUP_SUCCESS_ACTION_VALUE, PICKER_RADIO_SET, PICKER_RADIO_SET_BROWSE, PICKER_RADIO_SET_SEARCH, PICKER_REFRESH_ON_TABLE_ACTION_COOKIE_KEY, PICKER_SEARCHER_ACTION_VALUE, PICKER_WS_PROP_COOKIE_KEY, PICKER_WS_PROP_KEY, pickerFormProcessor, POPUP, PROCESS_CALLBACK, properties, QUERY, queryData, REFERER, SELECTED_OBJECT_NAME, SELECTED_OBJECT_NUMBER, SELECTED_OBJECT_OID, SELECTION_MODE, SESSION_ID, SINGLE_SELECT, state, SUBMIT_ACTION, SUBMIT_OID, tableService, TITLE_RESOURCE_CLASS, TITLE_RESOURCE_CLASS_DEFAULT, TITLE_RESOURCE_KEY, TITLE_RESOURCE_KEY_DEFAULT, TYPE_LIST, TYPE_LIST_ID, USE_LOCATION
 
Constructor Summary
PickerSearcherUtilities()
           
 
Method Summary
 QueryResult filterResults(SortedEnumeration enumResults)
           
 QueryResult findResults(String[] criteriaFilter)
          Searches based on criteria specified for all versions of objects.
 void generateSearchForm()
          

Supported API: false
 void getButtonHTML(StringBuffer output, String action, String freeText, String resourceKey, String resourceClass, String attributeName)
          First the output StringBuffer is printed to standard out.
private  void getCheckFormJavaScript(StringBuffer output)
           
private  Vector getDisplayAttributes(Vector outputAttributes, ClassInfo contextInfo)
           
private  void getIncludeTrlUtlsJavaScript(StringBuffer output)
           
protected  Vector getInputAttributes(int query_type)
          Returns the input attributes for the specified query type from the configured picker search attribute list.
protected  Vector getInputProcessing(int query_type)
          Returns the input processing information for the specified query type from the configured picker search attribute list.
protected  Vector getLegalValueList(String method_name)
          Returns a Vector of legal value strings to be used in the drop down list.
protected  Vector getOutputProcessing(int query_type)
          Returns the output processing information for the specified query type from the configured picker search attribute list.
protected  SearchAttributeListDelegate getPickerSearchAttributeList()
          Returns the configured picker search attribute list.
protected  Vector getPropertyDescriptors(Vector attributes, Class className)
          Returns the property descriptors for the specified vector of class attributes from the configured picker search attribute list.
protected  Vector getPropertyDescriptors(Vector attributes, Vector classes)
          Returns the property descriptors for the specified vector of class attributes for the classes in the classes vector from the configured picker search attribute list.
private  Vector getSearchCriteria(String[] criteriaFilter, ClassInfo contextInfo)
          Return the search criteria based on the form fields.
 void getSelectHTML(StringBuffer output, String name, Vector values)
          

Supported API: false
 void getSelectHTML(StringBuffer output, String name, Vector values, String freeText)
           
protected  String getSortByCommandString(String tableName, String sortPref)
          Returns ColumnSortService.SORT_BY command string.
protected  Vector getSortKeys(int queryType, String sortPref)
           
protected  String getSortPref(String tableName)
          Return valid single value SearchPreference sort preference in the format of :.
 void getTextBoxHTML(StringBuffer output, String name, String value, int size)
          

Supported API: false
 void getTextBoxHTML(StringBuffer output, String name, String value, int size, String freeText)
          

Supported API: false
protected  Vector getValueList(PropertyDescriptor pd)
          Tries to generate a Vector of legal value strings to be used in the drop down list.
protected  boolean inArray(String value, String[] array)
           
 boolean isFindResults()
          Returns true if the FIND_RESULTS property is set to "true"; false is returned otherwise.
 boolean isUseSearchSort()
          Return useSearchSort property value of true or false.
 void readExternal(ObjectInput input)
          Reads the non-transient fields of this class from an external source.
private  boolean readOldVersion(ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source, which is not the current version.
protected  boolean readVersion(PickerSearcherUtilities thisObject, ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source.
protected  void setSearchFilter(SearchTask st)
          Sets filter to SearchTask.CHANGEABLE_VERSIONS if isChangebalesOnly() returns true.
 void setUseSearchSort(boolean userPref)
          Set useSearchSort property value.
 void writeExternal(ObjectOutput output)
          Writes the non-transient fields of this class to an external source.
 
Methods inherited from class com.ptc.windchill.cadx.common.picker.PickerUtilities
addHiddenFields, addHiddenFields, clearDoSort, columnNameToSortAttribute, createTagIDValuePair, createUniqueTagIDValue, filterResults, generatePickerPageURL, generateString, generateStringWithOutNewLine, getAuthoringApplication, getBasicTemplateProcessor, getColumnSortService, getContainerVisibilityMask, getContainerVisibilityMask, getContainerVisibilityMask, getContainerVisibilityMask, getEncodedOID, getFindResults, getFormData, getHTMLTableService, getLabelHTML, getLabelHTML, getLocation, getObject, getOID, getOutputAttributes, getPickList, getPickValues, getPrintWriter, getProperty, getQuery, getQueryClass, getQueryClassName, getQueryClassWithNoDescendents, getQueryData, getQueryProperties, getQueryType, getRowDataTableModel, getSelectionMode, getSessionId, getSortableColumns, getSortedColumnName, getSortedEnumeration, getSortedEnumeration, getSortList, getState, getSubmitAction, getSubmitOID, getTitleResourceClass, getTitleResourceKey, getTypeList, getTypeListID, getTypeListValuesString, getURL, getUseLocation, initialize, isChangeablesOnly, isCollapse, isDeletableOnlyFilter, isDoSort, isExpandCollapse, isInSharedCabinetOnlyFilter, isPopup, isSortBy, isTableAction, isValidType, listTypes, readVersion, setDoSort, setSessionId, setSortBy, showResults, showResults, showResults, showResults, showResults, showResults, sortAttributeToColumnName, toQueryResult, toQueryResult, toQueryResult, toResultsVector, toResultsVector, toResultsVector
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

SEARCH_PREFS_ACTION_VALUE

public static final String SEARCH_PREFS_ACTION_VALUE
This is the Search Prferences action value.

Supported API: false

See Also:
Constant Field Values

PICKER_SEARCHER_TABLE_NAME

public static final String PICKER_SEARCHER_TABLE_NAME
This is the Search Prferences action value.

Supported API: false

See Also:
Constant Field Values

serialVersionUID

static final long serialVersionUID
See Also:
Constant Field Values

EXTERNALIZATION_VERSION_UID

public static final long EXTERNALIZATION_VERSION_UID
See Also:
Constant Field Values

OLD_FORMAT_VERSION_UID

protected static final long OLD_FORMAT_VERSION_UID
See Also:
Constant Field Values

searcherAttrList

private SearchAttributeListDelegate searcherAttrList

HTML_SEARCH_RESOURCE

private static final String HTML_SEARCH_RESOURCE
See Also:
Constant Field Values

criteriaUnSelectedAndValidateScript

private String criteriaUnSelectedAndValidateScript

criteriaSelectedScript

private String criteriaSelectedScript

criteriaUnSelectedScript

private String criteriaUnSelectedScript

criteriaChangedScript

private String criteriaChangedScript

LONG_TEXTBOX

public static final int LONG_TEXTBOX
See Also:
Constant Field Values

SHORT_TEXTBOX

public static final int SHORT_TEXTBOX
See Also:
Constant Field Values

FIND_USERS_ACTION

public static final String FIND_USERS_ACTION
See Also:
Constant Field Values

SEARCH_PREFERENCES_SORT_PREF_DELIM

protected static String SEARCH_PREFERENCES_SORT_PREF_DELIM

SEARCH_PREFS_WINDCHILL_ACTION_VALUE

public static final String SEARCH_PREFS_WINDCHILL_ACTION_VALUE
See Also:
Constant Field Values

SEARCH_NON_WPDM_ALL_SORT_KEY

public static final String SEARCH_NON_WPDM_ALL_SORT_KEY
See Also:
Constant Field Values

PICKER_SEARCHER_PAGE_PROP_COOKIE_KEY

public static final String PICKER_SEARCHER_PAGE_PROP_COOKIE_KEY
See Also:
Constant Field Values

PICKER_SEARCHER_USE_SEARCH_SORT_PREF_PROP_KEY

public static final String PICKER_SEARCHER_USE_SEARCH_SORT_PREF_PROP_KEY
See Also:
Constant Field Values

PICKER_SEARCHER_SEARCH_FORM_ACTION_VALUE

public static final String PICKER_SEARCHER_SEARCH_FORM_ACTION_VALUE
See Also:
Constant Field Values

SEARCH_PREFERENCES_ASCENDING

protected static final String SEARCH_PREFERENCES_ASCENDING
See Also:
Constant Field Values

SEARCH_PREFERENCES_DESCENDING

protected static final String SEARCH_PREFERENCES_DESCENDING
See Also:
Constant Field Values
Constructor Detail

PickerSearcherUtilities

public PickerSearcherUtilities()
Method Detail

writeExternal

public void writeExternal(ObjectOutput output)
                   throws IOException
Writes the non-transient fields of this class to an external source.

Supported API: false

Specified by:
writeExternal in interface Externalizable
Overrides:
writeExternal in class PickerUtilities
Parameters:
output -
Throws:
IOException

readExternal

public void readExternal(ObjectInput input)
                  throws IOException,
                         ClassNotFoundException
Reads the non-transient fields of this class from an external source.

Supported API: false

Specified by:
readExternal in interface Externalizable
Overrides:
readExternal in class PickerUtilities
Parameters:
input -
Throws:
IOException
ClassNotFoundException

readVersion

protected boolean readVersion(PickerSearcherUtilities thisObject,
                              ObjectInput input,
                              long readSerialVersionUID,
                              boolean passThrough,
                              boolean superDone)
                       throws IOException,
                              ClassNotFoundException
Reads the non-transient fields of this class from an external source.

Supported API: false

Parameters:
thisObject -
input -
readSerialVersionUID -
passThrough -
superDone -
Returns:
boolean
Throws:
IOException
ClassNotFoundException

readOldVersion

private boolean readOldVersion(ObjectInput input,
                               long readSerialVersionUID,
                               boolean passThrough,
                               boolean superDone)
                        throws IOException,
                               ClassNotFoundException
Reads the non-transient fields of this class from an external source, which is not the current version.

Parameters:
input -
readSerialVersionUID -
passThrough -
superDone -
Returns:
boolean
Throws:
IOException
ClassNotFoundException

findResults

public QueryResult findResults(String[] criteriaFilter)
                        throws WTException
Searches based on criteria specified for all versions of objects.

Supported API: false

Parameters:
criteriaFilter - Array of keys to filter from the criteria form data.
Returns:
QueryResult
Throws:
WTException

generateSearchForm

public void generateSearchForm()
                        throws WTException,
                               WTIntrospectionException


Supported API: false

Throws:
WTException
WTIntrospectionException

getTextBoxHTML

public void getTextBoxHTML(StringBuffer output,
                           String name,
                           String value,
                           int size)


Supported API: false

Parameters:
output -
name -
value -
size -

getButtonHTML

public void getButtonHTML(StringBuffer output,
                          String action,
                          String freeText,
                          String resourceKey,
                          String resourceClass,
                          String attributeName)
First the output StringBuffer is printed to standard out. Then output buffer is reset to be zero length. Then UtilProcessorService.getButton is called. Lastly, output is appended with some html text.

Supported API: false

Parameters:
output -
action -
freeText -
resourceKey -
resourceClass -
attributeName -

getLegalValueList

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

Supported API: false

Parameters:
method_name -
Returns:
Vector
Throws:
WTException

getValueList

protected Vector getValueList(PropertyDescriptor pd)
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.

Supported API: false

Parameters:
pd -
Returns:
Vector

getInputAttributes

protected Vector getInputAttributes(int query_type)
                             throws WTException
Returns the input attributes for the specified query type from the configured picker search attribute list.

Supported API: false

Parameters:
query_type -
Returns:
Vector
Throws:
WTException

getInputProcessing

protected Vector getInputProcessing(int query_type)
                             throws WTException
Returns the input processing information for the specified query type from the configured picker search attribute list.

Supported API: false

Parameters:
query_type -
Returns:
Vector
Throws:
WTException

getPropertyDescriptors

protected Vector getPropertyDescriptors(Vector attributes,
                                        Class className)
                                 throws WTException
Returns the property descriptors for the specified vector of class attributes from the configured picker search attribute list.

Supported API: false

Parameters:
attributes -
className -
Returns:
Vector
Throws:
WTException

getPickerSearchAttributeList

protected SearchAttributeListDelegate getPickerSearchAttributeList()
                                                            throws WTException
Returns the configured picker search attribute list. The list's filter is set to the value returned by getQuery.

Supported API: false

Overrides:
getPickerSearchAttributeList in class PickerUtilities
Returns:
SearchAttributeListDelegate
Throws:
WTException

getOutputProcessing

protected Vector getOutputProcessing(int query_type)
                              throws WTException
Returns the output processing information for the specified query type from the configured picker search attribute list.

Supported API: false

Parameters:
query_type -
Returns:
Vector
Throws:
WTException

getPropertyDescriptors

protected Vector getPropertyDescriptors(Vector attributes,
                                        Vector classes)
                                 throws WTException
Returns the property descriptors for the specified vector of class attributes for the classes in the classes vector from the configured picker search attribute list.

Supported API: false

Parameters:
attributes -
classes -
Returns:
Vector
Throws:
WTException

getSelectHTML

public void getSelectHTML(StringBuffer output,
                          String name,
                          Vector values)


Supported API: false

Parameters:
output -
name -
values -

isFindResults

public boolean isFindResults()
Returns true if the FIND_RESULTS property is set to "true"; false is returned otherwise.

Supported API: false

Returns:
boolean

getSortByCommandString

protected String getSortByCommandString(String tableName,
                                        String sortPref)
Returns ColumnSortService.SORT_BY command string. The sort column and order are determined based on the sortPref value which has a format of: :. true indicates DESCEDNING and false indicates ASCENDING; the sortable attribute is the attribute returned by wt.query.SearchAttributeList.getAllSortAttributes().

Supported API: false

Overrides:
getSortByCommandString in class PickerUtilities
Parameters:
tableName -
sortPref -
Returns:
String

getSortPref

protected String getSortPref(String tableName)
Return valid single value SearchPreference sort preference in the format of :.

Supported API: false

Parameters:
tableName -
Returns:
String

getTextBoxHTML

public void getTextBoxHTML(StringBuffer output,
                           String name,
                           String value,
                           int size,
                           String freeText)


Supported API: false

Parameters:
output -
name -
value -
size -
freeText -

getCheckFormJavaScript

private void getCheckFormJavaScript(StringBuffer output)

getIncludeTrlUtlsJavaScript

private void getIncludeTrlUtlsJavaScript(StringBuffer output)

inArray

protected boolean inArray(String value,
                          String[] array)

getSearchCriteria

private Vector getSearchCriteria(String[] criteriaFilter,
                                 ClassInfo contextInfo)
                          throws WTException
Return the search criteria based on the form fields. Values for keys specified in criteriaFilter are filtered out.

Throws:
WTException

getDisplayAttributes

private Vector getDisplayAttributes(Vector outputAttributes,
                                    ClassInfo contextInfo)
                             throws WTException
Throws:
WTException

setSearchFilter

protected void setSearchFilter(SearchTask st)
                        throws Exception
Sets filter to SearchTask.CHANGEABLE_VERSIONS if isChangebalesOnly() returns true. Otherwise the filter is set to SearchTask.ALL_VERSIONS.

Throws:
Exception

filterResults

public QueryResult filterResults(SortedEnumeration enumResults)

getSelectHTML

public void getSelectHTML(StringBuffer output,
                          String name,
                          Vector values,
                          String freeText)

getSortKeys

protected Vector getSortKeys(int queryType,
                             String sortPref)
                      throws WTException
Throws:
WTException

isUseSearchSort

public boolean isUseSearchSort()
Return useSearchSort property value of true or false.


setUseSearchSort

public void setUseSearchSort(boolean userPref)
Set useSearchSort property value.