com.ptc.windchill.uwgm.common.pdm
Class RetrieverSpecHelper

java.lang.Object
  extended bycom.ptc.windchill.uwgm.common.pdm.RetrieverSpecHelper

public class RetrieverSpecHelper
extends Object

Helper class to work with Specs for PartDocumentRetriever


Nested Class Summary
private static class RetrieverSpecHelper.FindOfRiiSpec
           
private static class RetrieverSpecHelper.FindOfSpec
           
private static class RetrieverSpecHelper.RetrieverSpecType
          internal implementation for RetrieverSpec.Type
private static class RetrieverSpecHelper.RiiSpec
          internal implementation for versioned specs
private static class RetrieverSpecHelper.Spec
          internal implementation for non-versioned specs
 
Field Summary
static RetrieverSpec.Type ASSEMBLY_OF_SPEC
          (aux)spec for retrieving assembly of component
(package private) static RetrieverSpec.Type[] AUX_SPEC_TYPES
           
static RetrieverSpec.Type CAD_NAME_SPEC
          spec for retrieving objects by CADName (EPMDocuments only)
static RetrieverSpec.Type COMPONENT_OF_SPEC
          (aux)spec for retrieving component of assembly
(package private) static RetrieverSpec.Type[] EPMDOC_SPEC_TYPES
           
static RetrieverSpec.Type FT_MEMBER_OF_SPEC
          (aux)spec for retrieving instance of generic or generic of instance
static RetrieverSpec.Type GENERIC_OF_SPEC
          (aux)spec for retrieving generic of instance
static RetrieverSpec.Type INSTANCE_OF_SPEC
          (aux)spec for retrieving instance of generic
static RetrieverSpec.Type MASTER_ID_SPEC
          spec for retrieving objects by MasterObjectIdentifier
static RetrieverSpec.Type NUMBER_SPEC
          spec for retrieving objects by Number (WTPArts only)
static RetrieverSpec.Type OBJECT_ID_SPEC
          spec for retrieving objects by ObjectIdentifier
(package private) static RetrieverSpec.Type[] WTPART_SPEC_TYPES
           
 
Constructor Summary
RetrieverSpecHelper()
           
 
Method Summary
static RetrieverSpec createCADNameSpec(String cadName, RevisionIterationInfo rii)
           
static RetrieverSpec createFindOfSpec(RetrieverSpec.Type findOfType, RetrieverSpec spec, RetrieverSpec auxSpec)
           
static Map createKeyedSpecMap(Collection specs)
          creates "keyed" Map with specs key as Map key and spec as value
static RetrieverSpec createMasterIdSpec(ObjectIdentifier masterId, RevisionIterationInfo rii)
           
static List createMasterIdSpecs(WTCollection masters)
           
static RetrieverSpec createNumberSpec(String number, RevisionIterationInfo rii)
           
static RetrieverSpec createOidSpec(ObjectIdentifier oid)
           
static Object getKey(RetrieverSpec.Type specType, Persistable persistable)
          returns a sutable Object for RetrieverSpec key according to SpecType
static Map sortSpecs(RetrieverSpec.Type[] types, Collection specs)
          sorts Collection of RetrieverSpec by specType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OBJECT_ID_SPEC

public static final RetrieverSpec.Type OBJECT_ID_SPEC
spec for retrieving objects by ObjectIdentifier


MASTER_ID_SPEC

public static final RetrieverSpec.Type MASTER_ID_SPEC
spec for retrieving objects by MasterObjectIdentifier


CAD_NAME_SPEC

public static final RetrieverSpec.Type CAD_NAME_SPEC
spec for retrieving objects by CADName (EPMDocuments only)


NUMBER_SPEC

public static final RetrieverSpec.Type NUMBER_SPEC
spec for retrieving objects by Number (WTPArts only)


EPMDOC_SPEC_TYPES

static final RetrieverSpec.Type[] EPMDOC_SPEC_TYPES

WTPART_SPEC_TYPES

static final RetrieverSpec.Type[] WTPART_SPEC_TYPES

GENERIC_OF_SPEC

public static final RetrieverSpec.Type GENERIC_OF_SPEC
(aux)spec for retrieving generic of instance


INSTANCE_OF_SPEC

public static final RetrieverSpec.Type INSTANCE_OF_SPEC
(aux)spec for retrieving instance of generic


COMPONENT_OF_SPEC

public static final RetrieverSpec.Type COMPONENT_OF_SPEC
(aux)spec for retrieving component of assembly


ASSEMBLY_OF_SPEC

public static final RetrieverSpec.Type ASSEMBLY_OF_SPEC
(aux)spec for retrieving assembly of component


FT_MEMBER_OF_SPEC

public static final RetrieverSpec.Type FT_MEMBER_OF_SPEC
(aux)spec for retrieving instance of generic or generic of instance


AUX_SPEC_TYPES

static final RetrieverSpec.Type[] AUX_SPEC_TYPES
Constructor Detail

RetrieverSpecHelper

public RetrieverSpecHelper()
Method Detail

createOidSpec

public static RetrieverSpec createOidSpec(ObjectIdentifier oid)

createMasterIdSpec

public static RetrieverSpec createMasterIdSpec(ObjectIdentifier masterId,
                                               RevisionIterationInfo rii)

createCADNameSpec

public static RetrieverSpec createCADNameSpec(String cadName,
                                              RevisionIterationInfo rii)

createNumberSpec

public static RetrieverSpec createNumberSpec(String number,
                                             RevisionIterationInfo rii)

createFindOfSpec

public static RetrieverSpec createFindOfSpec(RetrieverSpec.Type findOfType,
                                             RetrieverSpec spec,
                                             RetrieverSpec auxSpec)

createMasterIdSpecs

public static List createMasterIdSpecs(WTCollection masters)

sortSpecs

public static Map sortSpecs(RetrieverSpec.Type[] types,
                            Collection specs)
sorts Collection of RetrieverSpec by specType

Parameters:
types - SpecType[]
specs - Collection
Returns:
Map Collection specs by type [spec_type, collection of specs with this type]
Throws:
IllegalArgumentException - if input collection has a spec with type not listed in types[]

createKeyedSpecMap

public static Map createKeyedSpecMap(Collection specs)
creates "keyed" Map with specs key as Map key and spec as value

Parameters:
specs - Collection
Returns:
Map

getKey

public static Object getKey(RetrieverSpec.Type specType,
                            Persistable persistable)
returns a sutable Object for RetrieverSpec key according to SpecType

supports only EPMDocuments and WTParts

Parameters:
specType - SpecType
persistable - Persistable
Returns:
Object