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

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

public class PickerBrowserUtilities
extends PickerUtilities
implements Externalizable



Supported API: false

Extendable: false

See Also:
Serialized Form

Field Summary
static String ALL_CABINETS
          This is the value used to indentify all cabinets.
private static String CLASSNAME
           
static long EXTERNALIZATION_VERSION_UID
           
static String LAST_LOCATION_PREF_KEY
          This is the last location preference system key used by the picker.
private  String lastLocation
           
static String MY_WORKSPACES
          This is the value used to indentify all my workspaces (ie the users workspaces).
protected static String NAME_ATTRIBUTE
           
protected static long OLD_FORMAT_VERSION_UID
           
static String PICKER_BROWSER_TABLE_NAME
          This is the Search Prferences action value.
private static String RESOURCE
           
static String SAVE_LAST_LOCATION
          This is the save last location key used by the picker.
(package private) static long serialVersionUID
           
private static String UI_RESOURCE
           
 
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
PickerBrowserUtilities()
           
 
Method Summary
protected  QuerySpec appendNavigateCriteria(QuerySpec qs)
           
 QueryResult filterResults(QueryResult results)
          Filter based on state.
protected  QueryResult filterShortcutResults(QueryResult results, Folder folder)
           
 QueryResult findCabinets()
          

Supported API: false
 QueryResult findContents(Folder folder)
          

Supported API: false
 QueryResult findContexts()
           
 QueryResult findFolders(Folder folder)
          Returns subfolders of the specified folder.
 QueryResult findObjects(Folder folder)
          Return non-Folder contents of the specified folder.
 QueryResult findPDMLinkContexts()
           
 QueryResult findPersistables(Folder folder)
          Return non-Folder and non-Shortcut folder contents.
 QueryResult findProducts()
          

Supported API: false
 QueryResult findRepositories()
          

Supported API: false
 QueryResult findShortcuts(Folder folder)
          Return shortcuts to objects which are of the types specified configured valid types to display.
 QueryResult findWorkspaceContents(EPMWorkspace workspace)
          Returns the contents of the specified workspace.The list of objects is filtered based on the value returned by getQuery().
 QueryResult findWorkspaces()
          

Supported API: false
 void generateFolderTrail(Object folder, String blank)
          Generates HTML which represents the path of the object.
private  void generateMyWorkspacesTrail(String blank, Locale locale)
           
private  void generateRootPath(String blank)
           
private  void generateWorkspacePath(EPMWorkspace workspace, String blank, Locale locale)
           
protected  QueryResult getContentsInFolder(Folder folder, Vector classes, boolean includeShares)
           
 Folder getFolder(String oid)
          Returns the Folder object identified by the oid.
private  String getFolderPathSeparator()
           
private  String getLabelAndRootPath(String blank)
           
 String getLastLocation()
          Gets the value of the attribute: lastLocation; This attribute is persisted a preference.
protected  String getLastLocationPrefKey()
           
protected  String getLastLocationPrefValue()
           
private  String getMyWorkspacesLink(Locale locale)
           
protected  Vector getOutputAttributes(int query_type)
          Returns the output attributes for the specified query type from the configured picker search attribute list.
static String getPickerBrowserNavigateLink(Persistable persistable, URLFactory factory)
          Returns the Picker Browser specific Link (href).
static String getPickerBrowserNavigateURL(Persistable pesistable, URLFactory factory)
          Returns the Picker Browser specific URL.
private  String getPickerBrowserRootURL(String root)
           
protected  String getPrefRoot()
           
 String getSaveLastLocation()
          Gets the property value from the form processor.
protected  QueryResult getShortcutsInFolder(Folder folder)
           
protected  Vector getSortList(int query_type)
          Returns the sort list for the specified query type from the configured picker search attribute list.
protected  EPMWorkspace getWorkspace(Folder workspaceFolder)
          If running in Wildfire mode and if the folder is a workspace folder then the EPMWorkspace object which has the WORKSPACE_ROLE is returned.
 EPMWorkspace getWorkspace(String oid)
          Returns the EPMWorkspace object identified by the oid.
private  String getWorkspaceLink(EPMWorkspace workspace)
           
 boolean isContextAlias(String alias)
          Returns true if the alias value is:
 boolean isSaveLastLocation()
          Returns true if the SAVE_LAST_LOCATION property value is set to true.
protected  boolean isWildfireEnabled()
           
 void listLocations()
          Generates list of "look in" locations.
protected  QueryResult navigate(Persistable object, Class cls, String role)
          Navigates based on specified parameters.
 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(PickerBrowserUtilities thisObject, ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source.
 void setLastLocation(String a_LastLocation)
          Sets the value of the attribute: lastLocation; This attribute is persisted a preference.
protected  void setLastLocationPrefValue(String lastLocation)
           
 void showResults(String tableName, QueryResult qr)
          Generates an HTMLTable with the rows corresponding to the query results.
 void showResults(String tableName, SortedEnumeration folders, SortedEnumeration results)
          Generates an HTMLTable with the rows corresponding to the folders and results enumerations.
private  Vector switchNameWithFirstColumnAttribute(Vector attrs)
           
 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, generatePickerPageURL, generateString, generateStringWithOutNewLine, getAuthoringApplication, getBasicTemplateProcessor, getColumnSortService, getContainerVisibilityMask, getContainerVisibilityMask, getContainerVisibilityMask, getContainerVisibilityMask, getEncodedOID, getFindResults, getFormData, getHTMLTableService, getLabelHTML, getLabelHTML, getLocation, getObject, getOID, getPickerSearchAttributeList, getPickList, getPickValues, getPrintWriter, getProperty, getQuery, getQueryClass, getQueryClassName, getQueryClassWithNoDescendents, getQueryData, getQueryProperties, getQueryType, getRowDataTableModel, getSelectionMode, getSessionId, getSortableColumns, getSortByCommandString, getSortedColumnName, getSortedEnumeration, getSortedEnumeration, 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, 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

lastLocation

private String lastLocation

ALL_CABINETS

public static final String ALL_CABINETS
This is the value used to indentify all cabinets.

Supported API: false

See Also:
Constant Field Values

PICKER_BROWSER_TABLE_NAME

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

Supported API: false

See Also:
Constant Field Values

MY_WORKSPACES

public static final String MY_WORKSPACES
This is the value used to indentify all my workspaces (ie the users workspaces).

Supported API: false

See Also:
Constant Field Values

LAST_LOCATION_PREF_KEY

public static final String LAST_LOCATION_PREF_KEY
This is the last location preference system key used by the picker. Needs to be changed if the key name is modified.

Supported API: false

See Also:
Constant Field Values

SAVE_LAST_LOCATION

public static final String SAVE_LAST_LOCATION
This is the save last location key used by the picker. Needs to be changed if the key name is modified. If set to true then on OK the current location is save in the preference system.

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

UI_RESOURCE

private static final String UI_RESOURCE
See Also:
Constant Field Values

NAME_ATTRIBUTE

protected static String NAME_ATTRIBUTE
Constructor Detail

PickerBrowserUtilities

public PickerBrowserUtilities()
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(PickerBrowserUtilities 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

getLastLocation

public String getLastLocation()
Gets the value of the attribute: lastLocation; This attribute is persisted a preference. Each use of the Picker has it's own key/value pair where the key is: //. If a TYPE_LIST_ID value is not specified then the pref key is /.

Supported API: false

Returns:
String

setLastLocation

public void setLastLocation(String a_LastLocation)
Sets the value of the attribute: lastLocation; This attribute is persisted a preference. Each use of the Picker has it's own key/value pair where the key is: //. If a TYPE_LIST_ID value is not specified then the pref key is /.

Supported API: false

Parameters:
a_LastLocation -

findCabinets

public QueryResult findCabinets()
                         throws WTException


Supported API: false

Returns:
QueryResult
Throws:
WTException

findFolders

public QueryResult findFolders(Folder folder)
                        throws WTException
Returns subfolders of the specified folder. If a subfolder is a WorkspaceFolder then the object returned for the subfolder will be an EPMWorkspace

Supported API: false

Parameters:
folder -
Returns:
QueryResult
Throws:
WTException

findObjects

public QueryResult findObjects(Folder folder)
                        throws WTException
Return non-Folder contents of the specified folder. The list of objects is filtered based on the value returned by getQuery().

Supported API: false

Parameters:
folder -
Returns:
QueryResult
Throws:
WTException

findContents

public QueryResult findContents(Folder folder)
                         throws WTException


Supported API: false

Parameters:
folder -
Returns:
QueryResult
Throws:
WTException

generateFolderTrail

public void generateFolderTrail(Object folder,
                                String blank)
                         throws WTException
Generates HTML which represents the path of the object. For Cabinets and SubFolders this is the path to the Folder. If the folder value is null or not a Folder then the root path is displayed. What is displayed is sometjing like: / > Cabinet1 > SubFolder1 > SubFolder2 Folder names are links.

Supported API: false

Parameters:
folder - The folder to generate the HTML trail.
blank - The HTML representation of the blank space to be used in the trail.
Throws:
WTException

getPickerBrowserNavigateURL

public static String getPickerBrowserNavigateURL(Persistable pesistable,
                                                 URLFactory factory)
                                          throws WTException
Returns the Picker Browser specific URL. The URL requires the PickerBrowser page to contain or include a Java Script browseFolder (url) function.

Supported API: false

Parameters:
pesistable -
factory -
Returns:
String
Throws:
WTException

getPickerBrowserNavigateLink

public static String getPickerBrowserNavigateLink(Persistable persistable,
                                                  URLFactory factory)
                                           throws WTException
Returns the Picker Browser specific Link (href).

Supported API: false

Parameters:
persistable -
factory -
Returns:
String
Throws:
WTException

getOutputAttributes

protected Vector getOutputAttributes(int query_type)
                              throws WTException
Returns the output attributes for the specified query type from the configured picker search attribute list. If one of the attributes is name then name is moved to the first entry in the Vector.

Supported API: false

Overrides:
getOutputAttributes in class PickerUtilities
Parameters:
query_type -
Returns:
Vector
Throws:
WTException

showResults

public void showResults(String tableName,
                        SortedEnumeration folders,
                        SortedEnumeration results)
                 throws WTException
Generates an HTMLTable with the rows corresponding to the folders and results enumerations. The results are sorted using the ColumnSortService.

Supported API: false

Parameters:
tableName -
folders - The folders to be displayed in the Picker Browser.
results - The non-older objects to be displayed in the Picker Browser.
Throws:
WTException

getFolder

public Folder getFolder(String oid)
                 throws WTException
Returns the Folder object identified by the oid. If the oid is not a Folder oid then null is returned.

Supported API: false

Parameters:
oid -
Returns:
Folder
Throws:
WTException

listLocations

public void listLocations()
                   throws WTException
Generates list of "look in" locations.

Supported API: false

Throws:
WTException

findWorkspaceContents

public QueryResult findWorkspaceContents(EPMWorkspace workspace)
                                  throws WTException
Returns the contents of the specified workspace.The list of objects is filtered based on the value returned by getQuery().

Supported API: false

Parameters:
workspace -
Returns:
QueryResult
Throws:
WTException

getWorkspace

public EPMWorkspace getWorkspace(String oid)
                          throws WTException
Returns the EPMWorkspace object identified by the oid. If the oid is not a EPMWorkspace oid then null is returned.

Supported API: false

Parameters:
oid -
Returns:
EPMWorkspace
Throws:
WTException

getSortList

protected Vector getSortList(int query_type)
                      throws WTException
Returns the sort list for the specified query type from the configured picker search attribute list. The name attribute is switched with teh first attribute in the list.

Supported API: false

Overrides:
getSortList in class PickerUtilities
Parameters:
query_type -
Returns:
Vector
Throws:
WTException

findWorkspaces

public QueryResult findWorkspaces()
                           throws WTException


Supported API: false

Returns:
QueryResult
Throws:
WTException

getSaveLastLocation

public String getSaveLastLocation()
Gets the property value from the form processor.

Supported API: false

Returns:
String

isSaveLastLocation

public boolean isSaveLastLocation()
Returns true if the SAVE_LAST_LOCATION property value is set to true. Otherwise false is returned.

Supported API: false

Returns:
boolean

findProducts

public QueryResult findProducts()
                         throws WTException


Supported API: false

Returns:
QueryResult
Throws:
WTException

findRepositories

public QueryResult findRepositories()
                             throws WTException


Supported API: false

Returns:
QueryResult
Throws:
WTException

isContextAlias

public boolean isContextAlias(String alias)
Returns true if the alias value is:

PickerBrowserUtilities.ALL_CABINETS, PickerBrowserUtilities.MY_WORKSPACES, FolderUtilities.PDMLINK_PRODUCTS_ALIAS_VALUE, or FolderUtilities.PDMLINK_REPOSITORIES_ALIAS_VALUE.

Supported API: false

Parameters:
alias -
Returns:
boolean

showResults

public void showResults(String tableName,
                        QueryResult qr)
                 throws WTException
Generates an HTMLTable with the rows corresponding to the query results. If the table column to sort on is the "name" attribute column then sort using FolderCollationKeyFactory. This will gropup folders together and non-folders together. Each group is sorted based on sort order. Otherwise the results are sorted using the ColumnSortService.

Supported API: false

Overrides:
showResults in class PickerUtilities
Parameters:
tableName -
qr - The folders to be displayed in the Picker Browser.
Throws:
WTException

findPersistables

public QueryResult findPersistables(Folder folder)
                             throws WTException
Return non-Folder and non-Shortcut folder contents.

Supported API: false

Parameters:
folder -
Returns:
QueryResult
Throws:
WTException

findShortcuts

public QueryResult findShortcuts(Folder folder)
                          throws WTException
Return shortcuts to objects which are of the types specified configured valid types to display. This includes shortcuts to folders.

Supported API: false

Parameters:
folder -
Returns:
QueryResult
Throws:
WTException

findContexts

public QueryResult findContexts()

findPDMLinkContexts

public QueryResult findPDMLinkContexts()

filterShortcutResults

protected QueryResult filterShortcutResults(QueryResult results,
                                            Folder folder)
                                     throws WTException
Throws:
WTException

getShortcutsInFolder

protected QueryResult getShortcutsInFolder(Folder folder)
                                    throws WTException
Throws:
WTException

getContentsInFolder

protected QueryResult getContentsInFolder(Folder folder,
                                          Vector classes,
                                          boolean includeShares)
                                   throws WTException
Throws:
WTException

generateRootPath

private void generateRootPath(String blank)

getLabelAndRootPath

private String getLabelAndRootPath(String blank)

getPickerBrowserRootURL

private String getPickerBrowserRootURL(String root)

getFolderPathSeparator

private String getFolderPathSeparator()

navigate

protected QueryResult navigate(Persistable object,
                               Class cls,
                               String role)
                        throws WTException
Navigates based on specified parameters. Only objects which match the classes associated to query value returned by getQuery() are returned, in the QueryResult.

Throws:
WTException

switchNameWithFirstColumnAttribute

private Vector switchNameWithFirstColumnAttribute(Vector attrs)
                                           throws WTException
Throws:
WTException

getWorkspace

protected EPMWorkspace getWorkspace(Folder workspaceFolder)
If running in Wildfire mode and if the folder is a workspace folder then the EPMWorkspace object which has the WORKSPACE_ROLE is returned. Otherwise, null is returned.


isWildfireEnabled

protected boolean isWildfireEnabled()

getLastLocationPrefValue

protected String getLastLocationPrefValue()

setLastLocationPrefValue

protected void setLastLocationPrefValue(String lastLocation)
                                 throws WTException
Throws:
WTException

getPrefRoot

protected String getPrefRoot()

getLastLocationPrefKey

protected String getLastLocationPrefKey()

filterResults

public QueryResult filterResults(QueryResult results)
Filter based on state.

Overrides:
filterResults in class PickerUtilities

appendNavigateCriteria

protected QuerySpec appendNavigateCriteria(QuerySpec qs)
                                    throws WTException
Throws:
WTException

generateWorkspacePath

private void generateWorkspacePath(EPMWorkspace workspace,
                                   String blank,
                                   Locale locale)
                            throws WTException
Throws:
WTException

generateMyWorkspacesTrail

private void generateMyWorkspacesTrail(String blank,
                                       Locale locale)
                                throws WTException
Throws:
WTException

getMyWorkspacesLink

private String getMyWorkspacesLink(Locale locale)
                            throws WTException
Throws:
WTException

getWorkspaceLink

private String getWorkspaceLink(EPMWorkspace workspace)
                         throws WTException
Throws:
WTException