com.ptc.windchill.enterprise.search.server
Class SearchHelper

java.lang.Object
  extended bycom.ptc.windchill.enterprise.search.server.SearchHelper
All Implemented Interfaces:
Externalizable, RemoteAccess, Serializable

public final class SearchHelper
extends Object
implements RemoteAccess, Externalizable

Provides helper methods for the common search component.

Supported API: false

Extendable: false

See Also:
Serialized Form

Field Summary
private static String CLASSNAME
           
static long EXTERNALIZATION_VERSION_UID
           
private static String FC_RESOURCE
           
private static TypeIdentifier IBAHOLDER_TYPE_ID
           
private static TypeIdentifier INDEXABLE_TYPE_ID
           
protected static long OLD_FORMAT_VERSION_UID
           
private static String RESOURCE
           
static String RWARE_OBJECT_REF
           
(package private) static long serialVersionUID
           
(package private) static boolean SERVER
           
private static FeedbackSpec SPEC
           
private static TypeIdentifier TYPED_TYPE_ID
           
 
Fields inherited from interface wt.method.RemoteAccess
versionID
 
Constructor Summary
SearchHelper()
           
 
Method Summary
protected static Persistable _getPersistable(String reference)
          

Supported API: false
protected static String _getSearchableTypesAsString(String componentId, String containerRef, boolean prioritizeUser)
          Gets the list of searchable types for a given componentId and containerRef.
protected static TypeIdentifier[] _getSearchableTypesFromCache(String componentId)
          Given a componentId, get list of types to search against directly from cache.
static String getAttributesForType(String groupName, String type)
          Retrieves a group of attributes for a given type

Supported API: false
static AttributeTypeIdentifier[] getAttributeTypeIdentifiers(String attributeName)
          Get ATI values from SearchableAttributeCache that correspond to "attributeName" key.
static String[] getContainerTypes(String componentId)
          Given a componentId, e.g.
static Iterator getContainerTypesAndDisplayNames(String componentId, Locale locale)
          Given a componentId, e.g.
static Persistable getPersistable(String reference)
          

Supported API: false
static Map getReferenceAttributeCache()
          

Supported API: false
static String getRwareLibraries()
          Returns RetrievalWare libraries

Supported API: false
static TypeIdentifier[] getSearchableTypes(String componentId, String aContainer, boolean prioritizeUser)
          Given a componentId, e.g.
static String getSearchableTypesAsString(String componentId, String containerRef, boolean prioritizeUser)
          Gets the list of searchable types for a given componentId and containerRef.
static TypeIdentifier[] getSearchableTypesFromCache(String componentId)
          Given a componentId, get list of types to search against directly from cache.
private static TypeIdentifier[] getSearchableTypesFromPrefs(String aContainer, boolean prioritizeUser)
          Get type list for global searches from preferences.
static AttributeTypeIdentifier[] getSearchAttributeTypeIdentifiers(String attributeName, TypeIdentifier context, String delim)
          Method for getting AttributeTypeIdentifiers for an attribute.
static TypeIdentifier[] getTargetDataTypes(Enumeration searchTypes)
          Get types to search against.
static boolean isIndexSearch(String keyword, TypeIdentifier[] targetDataTypes)
          

Supported API: false
static boolean isIndexSearchPreferenceEnabled(SearchInfo searchInfo)
          Returns true if the indexed global search preference is set to true.
static boolean isModeledAttribute(String attributeName, TypeIdentifier context, String delim)
           
 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(SearchHelper thisObject, ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source.
 void writeExternal(ObjectOutput output)
          Writes the non-transient fields of this class to an external source.
 
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

TYPED_TYPE_ID

private static final TypeIdentifier TYPED_TYPE_ID

IBAHOLDER_TYPE_ID

private static final TypeIdentifier IBAHOLDER_TYPE_ID

INDEXABLE_TYPE_ID

private static final TypeIdentifier INDEXABLE_TYPE_ID

SERVER

static final boolean SERVER

FC_RESOURCE

private static final String FC_RESOURCE
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

RWARE_OBJECT_REF

public static final String RWARE_OBJECT_REF
See Also:
Constant Field Values

SPEC

private static FeedbackSpec SPEC
Constructor Detail

SearchHelper

public SearchHelper()
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
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
Parameters:
input -
Throws:
IOException
ClassNotFoundException

readVersion

protected boolean readVersion(SearchHelper 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

getSearchableTypes

public static TypeIdentifier[] getSearchableTypes(String componentId,
                                                  String aContainer,
                                                  boolean prioritizeUser)
                                           throws WTException
Given a componentId, e.g. "changePicker", return the TypeIdentifiers to search against. If null or "allSearch" is passed then the list of types is determined by either the users preference, if prioritizeUser is set to true, or the containers preference setting, which is typically the OrganizationContainer.

Supported API: false

Parameters:
componentId - The componentId being used from a search picker. This is always the first priority in getting the types
aContainer - Container Ref that is used to retrive the types from preferences
prioritizeUser - Set this to true if the users preferences should take precedence over the container
Returns:
TypeIdentifier[]
Throws:
WTException

getAttributeTypeIdentifiers

public static AttributeTypeIdentifier[] getAttributeTypeIdentifiers(String attributeName)
Get ATI values from SearchableAttributeCache that correspond to "attributeName" key.

Supported API: false

Parameters:
attributeName -
Returns:
AttributeTypeIdentifier[]

getContainerTypes

public static String[] getContainerTypes(String componentId)
Given a componentId, e.g. "changePicker", return the container class names to search against from the SearchableTypeCache. If null or "allSearch" is inputted the aggregate list of all container types for all applications for container type entries in SearchableTypes.properties containing "allSearch" is returned.

Supported API: false

Parameters:
componentId -
Returns:
String[]

getContainerTypesAndDisplayNames

public static Iterator getContainerTypesAndDisplayNames(String componentId,
                                                        Locale locale)
                                                 throws WTIntrospectionException
Given a componentId, e.g. "changePicker", return an Iterator of String arrays with each String array containing a container type and its display name. If null or "allSearch" is inputted the aggregate list of all container types for all applications for container type entries in SearchableTypes.properties containing "allSearch" is returned.

Supported API: false

Parameters:
componentId -
locale -
Returns:
Iterator
Throws:
WTIntrospectionException

getSearchAttributeTypeIdentifiers

public static AttributeTypeIdentifier[] getSearchAttributeTypeIdentifiers(String attributeName,
                                                                          TypeIdentifier context,
                                                                          String delim)
                                                                   throws WTException
Method for getting AttributeTypeIdentifiers for an attribute. 1. If a context is Persistable then check SearchableAttributesCache for attribute to ATI mappings, otherwise create a ModeledAttributeTypeIdentifier directly. 2. Otherwise use LogicalIdentifierFactory to construct AttributeTypeIdentifier.

Supported API: false

Parameters:
attributeName -
context -
delim -
Returns:
AttributeTypeIdentifier[]
Throws:
WTException

isIndexSearchPreferenceEnabled

public static boolean isIndexSearchPreferenceEnabled(SearchInfo searchInfo)
                                              throws WTException
Returns true if the indexed global search preference is set to true. If a SearchInfo is passed in will check value of SearchInfo's "keywordSearch" attribute. If null is passed in for the SearchInfo use the value defined in preferences.

Supported API: false

Parameters:
searchInfo -
Returns:
boolean
Throws:
WTException

getSearchableTypesFromPrefs

private static TypeIdentifier[] getSearchableTypesFromPrefs(String aContainer,
                                                            boolean prioritizeUser)
                                                     throws WTException
Get type list for global searches from preferences.

Parameters:
aContainer -
prioritizeUser -
Returns:
TypeIdentifier[]
Throws:
WTException

getSearchableTypesFromCache

public static TypeIdentifier[] getSearchableTypesFromCache(String componentId)
                                                    throws WTException
Given a componentId, get list of types to search against directly from cache.

Supported API: false

Parameters:
componentId -
Returns:
TypeIdentifier[]
Throws:
WTException

_getSearchableTypesFromCache

protected static TypeIdentifier[] _getSearchableTypesFromCache(String componentId)
                                                        throws WTException
Given a componentId, get list of types to search against directly from cache.

Supported API: false

Parameters:
componentId -
Returns:
TypeIdentifier[]
Throws:
WTException

getSearchableTypesAsString

public static String getSearchableTypesAsString(String componentId,
                                                String containerRef,
                                                boolean prioritizeUser)
                                         throws WTException
Gets the list of searchable types for a given componentId and containerRef.

Supported API: false

Parameters:
componentId -
containerRef -
prioritizeUser -
Returns:
String
Throws:
WTException

_getSearchableTypesAsString

protected static String _getSearchableTypesAsString(String componentId,
                                                    String containerRef,
                                                    boolean prioritizeUser)
                                             throws WTException
Gets the list of searchable types for a given componentId and containerRef.

Supported API: false

Parameters:
componentId -
containerRef -
prioritizeUser -
Returns:
String
Throws:
WTException

getRwareLibraries

public static String getRwareLibraries()
                                throws WTException
Returns RetrievalWare libraries

Supported API: false

Returns:
String
Throws:
WTException

getAttributesForType

public static String getAttributesForType(String groupName,
                                          String type)
Retrieves a group of attributes for a given type

Supported API: false

Parameters:
groupName -
type -
Returns:
String

getReferenceAttributeCache

public static Map getReferenceAttributeCache()


Supported API: false

Returns:
Map

isIndexSearch

public static boolean isIndexSearch(String keyword,
                                    TypeIdentifier[] targetDataTypes)
                             throws WTException


Supported API: false

Parameters:
keyword -
targetDataTypes -
Returns:
boolean
Throws:
WTException

getPersistable

public static Persistable getPersistable(String reference)
                                  throws WTException


Supported API: false

Parameters:
reference -
Returns:
Persistable
Throws:
WTException

_getPersistable

protected static Persistable _getPersistable(String reference)
                                      throws WTException


Supported API: false

Parameters:
reference -
Returns:
Persistable
Throws:
WTException

getTargetDataTypes

public static TypeIdentifier[] getTargetDataTypes(Enumeration searchTypes)
                                           throws WTException
Get types to search against. If a single type specified search for that type. If no type and a componentId is specified resolve list of types based on componentId. If no type and no componentId then do all search.

Supported API: false

Returns:
TypeIdentifier[]
Throws:
WTException

isModeledAttribute

public static boolean isModeledAttribute(String attributeName,
                                         TypeIdentifier context,
                                         String delim)