wt.part
Class LoadPart

java.lang.Object
  extended bywt.part.LoadPart

public class LoadPart
extends Object

Creates and persists part objects based on input from a comma seperated value (csv) file. Method names and parameters are defined in csvmapfile.txt. wt.load.StandardLoadService.load reads records from a .csv file and passes the fields in a hashtable to methods defined in this class.

The load methods use a wt.load.StandardLoadService cache to cache part masters and part version objects to improve performance of creating assemblies and updating attrbiutes. The load methods use wt.doc.LoadDoc to retrieve documents, taking advantage of its internal caching.

Supported API: true

Extendable: false

See Also:
StandardLoadService, LoadValue, LoadDoc

Field Summary
private static String CURRENT_CONTENT_HOLDER
           
private static String CURRENT_PART
           
private static String DEFAULT_VIEW_PREF_KEY
           
private static String DEFAULT_VIEW_PREF_NODE
           
private static int DESCRIBES_LINK
           
private static String DIRSEP
           
private static double DTOR
           
private static String PART_CACHE_KEY
           
private static String PART_MASTER_CACHE_KEY
           
private static String PART_PREVIOUS_USER
           
private static ResourceBundle rb
           
private static int REFERENCE_LINK
           
private static String REPHELPER_CLASS
           
private static String REPHELPER_METHOD
           
private static String RESOURCE
           
private static String TYPEDEF
           
private static int UNKNOWN_LINK
           
static boolean VERBOSE
          Flag to control vervbose debugging output during part loading.
private static String WTHOME
           
 
Constructor Summary
LoadPart()
           
 
Method Summary
static boolean addPartToAssembly(Hashtable nv, Hashtable cmd_line, Vector return_objects)
          Processes the "AssemblyAdd" directive in the csv load file.
private static boolean addPartToAssembly(Hashtable nv, Hashtable cmd_line, Vector return_objects, boolean cached_only, boolean occurrenced)
           
static boolean addPartToAssemblyLoad(Hashtable nv, Hashtable cmd_line, Vector return_objects)
          Processes the "AssemblyAddLoad" directive in the csv load file.
static boolean addPartToOccurrencedAssembly(Hashtable nv, Hashtable cmd_line, Vector return_objects)
          Processes the "OccurrenceAssemblyAdd" directive in the csv load file.
static boolean addPartToOccurrencedAssemblyLoad(Hashtable nv, Hashtable cmd_line, Vector return_objects)
          Processes the "OccurrenceAssemblyAddLoad" directive in the csv load file.
private static WTPart applyConstructionTimeAttributes(WTPart part, Hashtable nv, Hashtable cmd_line)
           
private static WTPart applyHardAttributes(WTPart part, Hashtable nv, Hashtable cmd_line)
           
static boolean assignUserToProduct(Hashtable nv, Hashtable cmd_line, Vector return_objects)
          Processes the "ProductUser" directive in the csv load file.
static boolean beginCreateOrUpdateWTPart(Hashtable nv, Hashtable cmd_line, Vector return_objects)
          Processes the "BeginCreateOrUpdateWTPart" directive in the csv load file.
static boolean beginCreateWTPart(Hashtable nv, Hashtable cmd_line, Vector return_objects)
          Processes the "csvBeginWTPart" directive in the XML load file.
static boolean beginWTPM(Hashtable nv, Hashtable cmd_line, Vector return_objects)
          Processes the "BeginWTPM" directive in the csv load file.
private static WTPartMaster cacheMaster(WTPartMaster master)
           
static boolean cachePart(Hashtable nv, Hashtable cmd_line, Vector return_objects)
           
private static WTPart cachePart(WTPart part)
           
private static WTPart constructPart(Hashtable nv, Hashtable cmd_line)
          Constructs a part (cached).
static boolean createNewViewVersion(Hashtable nv, Hashtable cmd_line, Vector return_objects)
          Processes the "NewViewVersion" directive in the csv load file.
static boolean createPart(Hashtable nv, Hashtable cmd_line, Vector return_objects)
          Processes the "csvPart" directive in the XML load file.
static boolean createPartDocDescribes(Hashtable nv, Hashtable cmd_line, Vector return_objects)
          Processes the "PartDocDescribes" directive in the csv load file.
static boolean createPartDocLink(Hashtable nv, Hashtable cmd_line, Vector return_objects)
          Adds documents to parts for PLMLink.
private static boolean createPartDocLink(Hashtable nv, Hashtable cmd_line, Vector return_objects, int type, boolean cached_only)
           
static boolean createPartDocReference(Hashtable nv, Hashtable cmd_line, Vector return_objects)
          Processes the "PartDocReference" directive in the csv load file.
static boolean createPartDocReferenceLoadOld(Hashtable nv, Hashtable cmd_line, Vector return_objects)
          Deprecated.  
static boolean createPartDocReferenceOld(Hashtable nv, Hashtable cmd_line, Vector return_objects)
          Deprecated.  
private static boolean createPartObject(Hashtable nv, Hashtable cmd_line, Vector return_objects)
           
static boolean createPartRepresentation(Hashtable nv, Hashtable cmd_line, Vector return_objects)
          Processes the "PartRepresentation" directive in the csv load file.
private static boolean createPartRepresentation(Hashtable nv, Hashtable cmd_line, Vector return_objects, int type, boolean cached_only)
           
static boolean createPartRepresentationLoad(Hashtable nv, Hashtable cmd_line, Vector return_objects)
          Processes the "PartRepresentationLoad" directive in the csv load file.
static boolean createProduct(Hashtable nv, Hashtable cmd_line, Vector return_objects)
          Deprecated. As of release 8.0 replaced by createPart
static boolean createProductContainer(Hashtable nv, Hashtable cmd_line, Vector return_objects)
           
private static boolean createProductEffectivity(Hashtable nv, Hashtable cmd_line, Vector return_objects, String effType)
           
static boolean createProductLotNumberEffectivity(Hashtable nv, Hashtable cmd_line, Vector return_objects)
           
static boolean createProductSerialNumberEffectivity(Hashtable nv, Hashtable cmd_line, Vector return_objects)
           
static boolean endCreateOrUpdateWTPart(Hashtable nv, Hashtable cmd_line, Vector return_objects)
          Processes the "EndCreateOrUpdateWTPart" directive in the csv load file.
static boolean endCreateWTPart(Hashtable nv, Hashtable cmd_line, Vector return_objects)
          Processes the "EndWTPart" directive in the csv load file.
static boolean endWTPM(Hashtable nv, Hashtable cmd_line, Vector return_objects)
          Processes the "EndWTPM" directive in the csv load file.
private static boolean getBooleanValue(String name, Hashtable nv, Hashtable cmd_line, boolean required, boolean defaultValue)
           
private static WTPartMaster getCachedMaster()
           
private static WTPartMaster getCachedMaster(String number)
           
private static WTPart getCachedPart()
           
private static WTPart getCachedPart(String number)
           
private static WTPart getCachedPart(String number, String version)
           
private static WTPart getCachedPart(String number, String version, String iteration)
           
private static WTPart getCachedPart(String number, String version, String iteration, String view)
           
static Workable getCheckOutObject(Workable workable)
          check a workable out.
private static String getDisplayInfo(Hashtable nv, Hashtable cmd_line)
           
private static javax.vecmath.Matrix4d getLocationMatrix(String location)
           
private static WTPartMaster getMaster()
           
private static WTPartMaster getMaster(String number)
           
private static String getMasterCacheKey(String number)
           
private static javax.vecmath.Matrix4d getMatrix4dFromLocation(double ax, double ay, double az, double x, double y, double z, double scale)
           
private static WTPart getPart()
           
private static WTPart getPart(String number, String version, String iteration, String view)
           
private static String getPartCacheKey(String number, String version, String iteration, String view)
           
private static String getRefFromObject(Persistable obj)
           
static String getValue(Hashtable nv, String name, boolean required)
           
private static String getValue(String name, Hashtable nv, Hashtable cmd_line, boolean required)
           
private static String[] getValues(String name, Hashtable nv, Hashtable cmd_line, boolean required)
           
static boolean isCheckoutAllowed(Workable workable)
          See if checkout is allowed.
private static boolean isNewVersion(WTPart part, String version)
           
static boolean isUndoCheckoutAllowed(Workable workable)
          See if undo-checkout is allowed.
private static Boolean loadRepresentation(String directory, String poid, boolean republishable, String repName, String repDesc, boolean repDefault, boolean createThumbnail, boolean storeEDZ, Vector options)
           
private static PDMLinkProduct lookupProduct(String name, WTContainerRef containerRef)
           
private static String[] parseTeamTemplate(Hashtable nv, Hashtable cmd_line)
           
private static boolean publishPartObject(Hashtable nv, Hashtable cmd_line)
           
static boolean removePartFromAssembly(Hashtable nv, Hashtable cmd_line, Vector return_objects)
          Processes the "AssemblyRemove" directive in the csv load file.
private static boolean removePartFromAssembly(Hashtable nv, Hashtable cmd_line, Vector return_objects, boolean cached_only)
           
static boolean removePartFromAssemblyLoad(Hashtable nv, Hashtable cmd_line, Vector return_objects)
          Processes the "AssemblyRemoveLoad" directive in the csv load file.
private static void resetUser()
           
private static void setContainer(WTContained the_contained, WTContainerRef containerRef)
           
private static void setFolder(WTContainerRef containerRef, FolderEntry the_folder_entry, String folderpath)
           
private static void setIteration(Iterated the_iterated, String iteration)
           
private static void setLifeCycle(WTContainerRef containerRef, LifeCycleManaged the_lifecycle_managed, String lctemplate)
           
private static void setName(WTPart the_part, String name)
           
private static void setNumber(WTPart the_part, String number)
           
private static void setPartType(WTPart the_part, String type)
           
static boolean setSiteDefaultView(Hashtable nv, Hashtable cmd_line, Vector return_objects)
          Processes the "SiteViewPreference" directive in the csv load file.
private static void setSource(WTPart the_part, String source)
           
private static void setState(LifeCycleManaged the_lifecycle_managed, String state)
           
private static void setTeamTemplate(WTContainerRef containerRef, TeamManaged the_team_managed, String teamTemplate, String domain)
           
private static void setType(Typed the_typed, String subtypedef)
           
private static void setUser(Hashtable nv, Hashtable cmd_line)
           
static boolean setUserDefaultView(Hashtable nv, Hashtable cmd_line, Vector return_objects)
          Processes the "ViewPreference" directive in the csv load file.
private static void setVersion(Versioned the_versioned, String version)
           
private static void setView(WTPart the_part, String viewName)
           
private static boolean updatePartObject(Hashtable nv, Hashtable cmd_line, Vector return_objects)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CURRENT_CONTENT_HOLDER

private static final String CURRENT_CONTENT_HOLDER
See Also:
Constant Field Values

PART_CACHE_KEY

private static final String PART_CACHE_KEY
See Also:
Constant Field Values

PART_MASTER_CACHE_KEY

private static final String PART_MASTER_CACHE_KEY
See Also:
Constant Field Values

PART_PREVIOUS_USER

private static final String PART_PREVIOUS_USER
See Also:
Constant Field Values

CURRENT_PART

private static String CURRENT_PART

RESOURCE

private static String RESOURCE

REFERENCE_LINK

private static final int REFERENCE_LINK
See Also:
Constant Field Values

DESCRIBES_LINK

private static final int DESCRIBES_LINK
See Also:
Constant Field Values

UNKNOWN_LINK

private static final int UNKNOWN_LINK
See Also:
Constant Field Values

rb

private static ResourceBundle rb

TYPEDEF

private static final String TYPEDEF
See Also:
Constant Field Values

DEFAULT_VIEW_PREF_NODE

private static final String DEFAULT_VIEW_PREF_NODE
See Also:
Constant Field Values

DEFAULT_VIEW_PREF_KEY

private static final String DEFAULT_VIEW_PREF_KEY
See Also:
Constant Field Values

VERBOSE

public static final boolean VERBOSE
Flag to control vervbose debugging output during part loading. This constant is controlled via wt.properties file entry
wt.part.load.verbose

The default value is false.


WTHOME

private static final String WTHOME

DIRSEP

private static final String DIRSEP

REPHELPER_CLASS

private static final String REPHELPER_CLASS
See Also:
Constant Field Values

REPHELPER_METHOD

private static final String REPHELPER_METHOD
See Also:
Constant Field Values

DTOR

private static final double DTOR
See Also:
Constant Field Values
Constructor Detail

LoadPart

public LoadPart()
Method Detail

createPart

public static boolean createPart(Hashtable nv,
                                 Hashtable cmd_line,
                                 Vector return_objects)
Processes the "csvPart" directive in the XML load file. Creates a part object, persists it in the database, checks it out, applies the default attribute values associated with the specified type definition, persists the part, checks it back in, and caches it in the loader's memory.

Establishes the part as the CURRENT_CONTENT_HOLDER for use by "ContentFile" lines.

This format cannot add Soft Attributes(IBA). For that see beginCreateWTPart.

When using @see wt.load.LoadFromFile to load parts, end items and serial numbered parts, use the following XML format:

XML Format

<csvPart handler="wt.part.LoadPart.createPart" >
 <csvuser> created by user </csvuser>
 <csvpartName> part name </csvpartName>
 <csvpartNumber> part number </csvpartNumber>
 <csvtype> assembly mode </csvtype>
 <csvsource> source </csvsource>
 <csvfolder> folder </csvfolder>
 <csvlifecycle> lifecycle </csvlifecycle>
 <csvview> view </csvview>
 <csvteamTemplate> team template </csvteamTemplate>
 <csvlifecyclestate> lifecycle state </csvlifecyclestate>
 <csvtypedef> typedef </csvtypedef>
 <csvversion> version </csvversion>
 <csviteration> iteration </csviteration>
 <csvparentContainerPath>parent container path </csvparentContainerPath>
</csvPart>

Tag Definitions

created by user This tag allows a user other than the user loading the file to be used as the creator of this part.
  
part name Name of the part.
  
part number Number of the part.
  
assembly mode The assembly mode for the part. Choose one of the following:

  • separable
  • inseparable
  • component
  
source The source of the part. i.e. make, buy
  
folder The full path to the folder. i.e. /Default/Design
  
lifecycle The lifecycle that the part will be created under. i.e. Basic
  
view The view that the part will be created under. i.e. Design, Manufacturing This value is optional. Leave this value blank for serial numbered parts.
  
team template The team template that the part will be created under. This value is optional.
  
lifecycle state The lifecycle state that the part will be created under. This value is optional.
  
typedef This contains the identifier string of a @see com.ptc.core.meta.common.TypeIdentifier .

i.e. wt.part.WTPart|com.mycompany.SoftPart2

This would create a soft typed part. This currently supports the following modeled types:

  • wt.part.WTPart
  • wt.part.WTProduct
  • wt.part.WTSerialNumberedPart

This currently does not handle custom modeled types. If there is a need for one of these, then a custom loader needs to be created.

  
version The version of the part. This value is optional.
  
iteration The version of the part. This value is optional.
  
parent container path The parent container path that the part will be created under. This value is optional.

Versions and Iterations

Supports versioning which allows a part to be created at a specified version and iteration. Multiple part versions imply an "order". I.E. subsequent bulk load runs can "fill in the gaps", but it does so by attaching to the latest iteration of the previous version. If a newer iteration is added to the previous version, the new version will attached to the new latest iteration. For example: Load set 1 (E.1, A.1, C.2) will result in (A.1, C.2, E.1). The predecssors of: C.2 is A.1, E.1 is C.2. Load set 2 (B.1, A.2., C.1, C.3) will result in (A.1, A.2, B.1, C.1, C.2, C.3, E.1). The predecessors of: B.1 is A.2, C.1 is B.1, E.1 is C.3. Any new version/iterations added will continue to change the predessor links to the new latest iteration of the previous version.

Versioning does support gaps in the ordering.

Examples of valid versioning are: (A.1,A.3,B.2,B.5,E.4,E.5)

When loading versions out of sequence and loading relationships to those parts there are a few things that you should understand while ordering your data.

1. Relationships are copied forward from what is identified as the predecessor to the new version. So in an ordered case if you create part 1 A.1 that has references or a describe relationship to doc 2. Then you revise to get part 1 B.1, it will have the relationships of A.1 copied to it so it will have the relationship to doc 2 as well.

2. Relationships are not copied forward if they are created after the new version has already been created. For example if part 1 A.1 and B.1 are created and then part A.1 has a relationship created to doc 2, part 1 B.1 will not have the relationship to doc 2 copied to it. You must explicitely create that relationship if you want it created.

3. Relationships from predecessors are not cumulative. This is really just a further clarification of the first point. Relationships are only copied from the one identified predecessor and not the accumulation of predecessors. So if you create part 1 B.1 that is related to doc 2, create part 1 A.1 that is related to doc 3 and then create part 1 C.1 it will inherit the relationship to doc 2 only.

These are just a few pointers to loading versions and relationships out of sequence. There are other scenarios given these basic rules that can also be imagined. So order the creation of versions/iterations and relationship very carefully to get the results that you intend.



Supported API: true

Extendable: false

Parameters:
nv - Name/Value pairs of part attributes.
cmd_line - command line argument that can contain supplemental load data
return_objects - Vector of the object(s) created by this method. Used by wt.load.StandardLoadService for accurate user feedback messages.
Returns:
truesuccess
falsefailure

createProduct

public static boolean createProduct(Hashtable nv,
                                    Hashtable cmd_line,
                                    Vector return_objects)
Deprecated. As of release 8.0 replaced by createPart

This method matches the createPart method with the following exception. If the <csvtypedef> tag is empty, then the <csvtypedef> tag defaults to @see wt.part.WTProduct and creates an End Item.

Parameters:
nv - Name/Value pairs of part attributes.
cmd_line - command line argument that can contain supplemental load data
return_objects - Vector of the object(s) created by this method. Used by wt.load.StandardLoadService for accurate user feedback messages.
Returns:
truesuccess
falsefailure

beginCreateWTPart

public static boolean beginCreateWTPart(Hashtable nv,
                                        Hashtable cmd_line,
                                        Vector return_objects)
Processes the "csvBeginWTPart" directive in the XML load file. Creates a part object, persists it in the database, checks it out, applies the default attribute values associated with the specified type definition, persists the part, checks it back in, and caches it in the loader's memory.

Establishes the part as the CURRENT_CONTENT_HOLDER for use by "ContentFile" lines.

When using @see wt.load.LoadFromFile to load parts, end items and serial numbered parts, use the following XML format:

XML Format

<csvBeginWTPart handler="wt.part.LoadPart.beginCreateWTPart" >
 <csvuser> created by user </csvuser>
 <csvpartName> part name </csvpartName>
 <csvpartNumber> part number </csvpartNumber>
 <csvtype> assembly mode </csvtype>
 <csvsource> source </csvsource>
 <csvfolder> folder </csvfolder>
 <csvlifecycle> lifecycle </csvlifecycle>
 <csvview> view </csvview>
 <csvteamTemplate> team template </csvteamTemplate>
 <csvlifecyclestate> lifecycle state </csvlifecyclestate>
 <csvtypedef> typedef </csvtypedef>
 <csvversion> version </csvversion>
 <csviteration> iteration </csviteration>
 <csvparentContainerPath>parent container path </csvparentContainerPath>
</csvBeginWTPart >
 
<csvIBAValue handler="wt.iba.value.service.LoadValue.createIBAValue" >
 ...
</csvIBAValue >
 
<csvIBAValue handler="wt.iba.value.service.LoadValue.createIBAValue" >
 ...
</csvIBAValue >
 
<csvIBAValue handler="wt.iba.value.service.LoadValue.createIBAValue" >
 ...
</csvIBAValue >
 
<csvIBAValue handler="wt.iba.value.service.LoadValue.createIBAValue" >
 ...
</csvIBAValue >
 
<csvEndWTPart handler="wt.part.LoadPart.endCreateWTPart" >
 ...
</csvEndWTPart >

Tag Definitions

created by user This tag allows a user other than the user loading the file to be used as the creator of this part.
  
part name Name of the part.
  
part number Number of the part.
  
assembly mode The assembly mode for the part. Choose one of the following:

  • separable
  • inseparable
  • component
  
source The source of the part. i.e. make, buy
  
folder The full path to the folder. i.e. /Default/Design
  
lifecycle The lifecycle that the part will be created under. i.e. Basic
  
view The view that the part will be created under. i.e. Design, Manufacturing This value is optional. Leave this value blank for serial numbered parts.
  
team template The team template that the part will be created under. This value is optional.
  
lifecycle state The lifecycle state that the part will be created under. This value is optional.
  
typedef This contains the identifier string of a @see com.ptc.core.meta.common.TypeIdentifier .

i.e. wt.part.WTPart|com.mycompany.SoftPart2

This would create a soft typed part. This currently supports the following modeled types:

  • wt.part.WTPart
  • wt.part.WTProduct
  • wt.part.WTSerialNumberedPart

This currently does not handle custom modeled types. If there is a need for one of these, then a custom loader needs to be created.

  
version The version of the part. This value is optional.
  
iteration The version of the part. This value is optional.
  
parent container path The parent container path that the part will be created under. This value is optional.

Versions and Iterations

Supports versioning which allows a part to be created at a specified version and iteration. Multiple part versions imply an "order". I.E. subsequent bulk load runs can "fill in the gaps", but it does so by attaching to the latest iteration of the previous version. If a newer iteration is added to the previous version, the new version will attached to the new latest iteration. For example: Load set 1 (E.1, A.1, C.2) will result in (A.1, C.2, E.1). The predecssors of: C.2 is A.1, E.1 is C.2. Load set 2 (B.1, A.2., C.1, C.3) will result in (A.1, A.2, B.1, C.1, C.2, C.3, E.1). The predecessors of: B.1 is A.2, C.1 is B.1, E.1 is C.3. Any new version/iterations added will continue to change the predessor links to the new latest iteration of the previous version.

Versioning does support gaps in the ordering.

Examples of valid versioning are: (A.1,A.3,B.2,B.5,E.4,E.5)

When loading versions out of sequence and loading relationships to those parts there are a few things that you should understand while ordering your data.

1. Relationships are copied forward from what is identified as the predecessor to the new version. So in an ordered case if you create part 1 A.1 that has references or a describe relationship to doc 2. Then you revise to get part 1 B.1, it will have the relationships of A.1 copied to it so it will have the relationship to doc 2 as well.

2. Relationships are not copied forward if they are created after the new version has already been created. For example if part 1 A.1 and B.1 are created and then part A.1 has a relationship created to doc 2, part 1 B.1 will not have the relationship to doc 2 copied to it. You must explicitely create that relationship if you want it created.

3. Relationships from predecessors are not cumulative. This is really just a further clarification of the first point. Relationships are only copied from the one identified predecessor and not the accumulation of predecessors. So if you create part 1 B.1 that is related to doc 2, create part 1 A.1 that is related to doc 3 and then create part 1 C.1 it will inherit the relationship to doc 2 only.

These are just a few pointers to loading versions and relationships out of sequence. There are other scenarios given these basic rules that can also be imagined. So order the creation of versions/iterations and relationship very carefully to get the results that you intend.



Supported API: true

Extendable: false

Parameters:
nv - Name/Value pairs of part attributes.
cmd_line - command line argument that can contain supplemental load data
return_objects - Vector of the object(s) created by this method. Used by wt.load.StandardLoadService for accurate user feedback messages.
Returns:
truesuccess
falsefailure

endCreateWTPart

public static boolean endCreateWTPart(Hashtable nv,
                                      Hashtable cmd_line,
                                      Vector return_objects)
Processes the "EndWTPart" directive in the csv load file. Causes the cached part to be checked-out, associates soft attribues from preceding IBAValue load file lines with the part, applies the default attribute values associated with the specified type definition, persists the part, checks it back in, and caches it in the loader's memory.

Establishes the part as the CURRENT_CONTENT_HOLDER for use by "ContentFile" lines.

Parameters:
nv - not used
cmd_line - command line argument that can contain supplemental load data
return_objects - Vector of the object(s) created by this method. Used by wt.load.StandardLoadService for accurate user feedback messages.
See Also:
beginCreateWTPart(java.util.Hashtable, java.util.Hashtable, java.util.Vector)

beginCreateOrUpdateWTPart

public static boolean beginCreateOrUpdateWTPart(Hashtable nv,
                                                Hashtable cmd_line,
                                                Vector return_objects)
Processes the "BeginCreateOrUpdateWTPart" directive in the csv load file.

Identical to beginCreateWTPart except in that "BeginCreateOrUpdateWTPart" directive does not support specification of 'version' or 'iteration'. The BeginCreateOrUpdateWTPart directive should not be used. It is maintain here in order to support legacy load files.

Creates a part object, persists it in the database, and caches it in the loader's memory.

Subsequent IBAValue load file lines may be used to associate soft attribute values with the part. These values will not be persisted until a "EndWTPart" load file line is processed.

Establishes the part as the CURRENT_CONTENT_HOLDER for use by "ContentFile" lines.

A typical sequence using this directive might be

BeginCreateOrUpdateWTPart,part-name,part-number,...
IBAValue,definition1,value1,...
IBAValue,definition2,value2,...
EndCreateOrUpdateWTPart
ContentFile,...
PartDocReference,...

Parameters:
nv - Hashtable containing tokens parsed from the csv load file The attributes are as follows: (arguments in <> are optional)
  • partName
  • partNumber
  • type
  • source
  • folder
  • lifecycle
  • <view>
  • <teamTemplate>
  • <lifecyclestate>
  • <typedef>
  • <classToUpdate> (NOT LONGER USED)
cmd_line - command line argument that can contain supplemental load data
return_objects - Vector of the object(s) created by this method. Used by wt.load.StandardLoadService for accurate user feedback messages.
See Also:
endCreateOrUpdateWTPart(java.util.Hashtable, java.util.Hashtable, java.util.Vector)

endCreateOrUpdateWTPart

public static boolean endCreateOrUpdateWTPart(Hashtable nv,
                                              Hashtable cmd_line,
                                              Vector return_objects)
Processes the "EndCreateOrUpdateWTPart" directive in the csv load file. Causes the cached part to be checked-out, associates soft attribues from preceding IBAValue load file lines with the part, applies the default attribute values associated with the specified type definition, persists the part, checks it back in, and caches it in the loader's memory.

Identical to endCreateWTPart. The EndCreateOrUpdateWTPart directive should not be used. It is maintain here in order to support legacy load files.

Establishes the part as the CURRENT_CONTENT_HOLDER for use by "ContentFile" lines.

Parameters:
nv - not used
cmd_line - command line argument that can contain supplemental load data
return_objects - Vector of the object(s) created by this method. Used by wt.load.StandardLoadService for accurate user feedback messages.
See Also:
beginCreateOrUpdateWTPart(java.util.Hashtable, java.util.Hashtable, java.util.Vector), endCreateWTPart(java.util.Hashtable, java.util.Hashtable, java.util.Vector)

beginWTPM

public static boolean beginWTPM(Hashtable nv,
                                Hashtable cmd_line,
                                Vector return_objects)
Processes the "BeginWTPM" directive in the csv load file. Creates a part master object without persisting it and caches it in the loader's memory.

Parameters:
nv - Hashtable containing tokens parsed from the csv load file The attributes are as follows:
  • name (required)
  • number (required)
cmd_line - command line argument that can contain supplemental load data
return_objects - Vector of the object(s) created by this method. Used by wt.load.StandardLoadService for accurate user feedback messages.
See Also:
endWTPM(java.util.Hashtable, java.util.Hashtable, java.util.Vector)

endWTPM

public static boolean endWTPM(Hashtable nv,
                              Hashtable cmd_line,
                              Vector return_objects)
Processes the "EndWTPM" directive in the csv load file. Associates soft attribues from preceding IBAValue load file lines with the cached part master, persists the part master, and caches it in the loader's memory.

Parameters:
nv - not used
cmd_line - command line argument that can contain supplemental load data
return_objects - Vector of the object(s) created by this method. Used by wt.load.StandardLoadService for accurate user feedback messages.
See Also:
beginWTPM(java.util.Hashtable, java.util.Hashtable, java.util.Vector)

addPartToAssembly

public static boolean addPartToAssembly(Hashtable nv,
                                        Hashtable cmd_line,
                                        Vector return_objects)
Processes the "AssemblyAdd" directive in the csv load file. Creates a uses relationship between an assembly part and constituent part.

Fails if both parts are not in loader's cache.

Parameters:
nv - Name/Value pairs of arguments. The arguments are as follows:
  • assemblyPartNumber
  • constitutentPartNumber
  • constituentPartQty
  • constituentPartUnit
  • lineNumber
  • occurrenceLocation
  • referenceDesignator
cmd_line - command line argument that can contain supplemental load data
return_objects - Vector of the object(s) created by this method. Used by wt.load.StandardLoadService for accurate user feedback messages.
See Also:
addPartToAssemblyLoad(java.util.Hashtable, java.util.Hashtable, java.util.Vector)

addPartToAssemblyLoad

public static boolean addPartToAssemblyLoad(Hashtable nv,
                                            Hashtable cmd_line,
                                            Vector return_objects)
Processes the "AssemblyAddLoad" directive in the csv load file. Creates a uses relationship between an assembly part and constituent part.

Does not assume either part is in loader's cache.

Parameters:
nv - Name/Value pairs of arguments. The arguments are as follows:
  • assemblyPartNumber
  • constitutentPartNumber
  • constituentPartQty
  • constituentPartUnit
cmd_line - command line argument that can contain supplemental load data
return_objects - Vector of the object(s) created by this method.
See Also:
addPartToAssembly(java.util.Hashtable, java.util.Hashtable, java.util.Vector)

createPartDocReference

public static boolean createPartDocReference(Hashtable nv,
                                             Hashtable cmd_line,
                                             Vector return_objects)
Processes the "PartDocReference" directive in the csv load file. Adds a reference document to a part:

Optionally checks for parts with versions. Checks cache for part, queries database if not found. If partNumber is not supplied, uses most recently cached part. Checks cache for document, queries database if not found. If docNumber is not supplied, uses most recently cached document. If part and doc exist, creates a document reference link for the part.

Parameters:
nv - Name/Value pairs of arguments. The arguments are as follows: (arguments in <> are optional)
  • <docNumber> (optional)
  • <partNumber> (optional)
  • <partVersion> (optional)
  • <partIteration> (optional)
cmd_line - command line argument that can contain supplemental load data
return_objects - Vector of the object(s) created by this method. Used by wt.load.StandardLoadService for accurate user feedback messages.
See Also:
createPartDocDescribes(java.util.Hashtable, java.util.Hashtable, java.util.Vector)

createPartDocDescribes

public static boolean createPartDocDescribes(Hashtable nv,
                                             Hashtable cmd_line,
                                             Vector return_objects)
Processes the "PartDocDescribes" directive in the csv load file. Adds a describing document to a part:

Optionally checks for parts with versions. Checks cache for part, queries database if not found. If partNumber is not supplied, uses most recently cached part. Optionally checks for documents with versions. Checks cache for document, queries database if not found. If docNumber is not supplied, uses most recently cached document. If part and doc exist, creates a document describes link for the part.

Parameters:
nv - Name/Value pairs of arguments. The arguments are as follows: (arguments in <> are optional)
  • <docNumber> (optional)
  • <docVersion> (optional)
  • <docIteration> (optional)
  • <partNumber> (optional)
  • <partVersion> (optional)
  • <partIteration> (optional)
cmd_line - command line argument that can contain supplemental load data
return_objects - Vector of the object(s) created by this method. Used by wt.load.StandardLoadService for accurate user feedback messages.
See Also:
createPartDocReference(java.util.Hashtable, java.util.Hashtable, java.util.Vector), LoadDoc

createPartDocLink

public static boolean createPartDocLink(Hashtable nv,
                                        Hashtable cmd_line,
                                        Vector return_objects)
Adds documents to parts for PLMLink.

Optionally checks for parts with versions. Checks cache for part, queries database if not found. If partNumber is not supplied, uses most recently cached part. Optionally checks for documents with versions. Checks cache for document, queries database if not found. If docNumber is not supplied, uses most recently cached document. If part and doc exist, creates either a document reference link or a document describes link for the part, depending on the soft type of the document.

Parameters:
nv - Name/Value pairs of arguments. The arguments are as follows: (arguments in <> are optional)
  • <docNumber> (optional)
  • <docVersion> (optional)
  • <docIteration> (optional)
  • <partNumber> (optional)
  • <partVersion> (optional)
  • <partIteration> (optional)
cmd_line - command line argument that can contain supplemental load data
return_objects - Vector of the object(s) created by this method. Used by wt.load.StandardLoadService for accurate user feedback messages.
See Also:
LoadDoc

createPartRepresentationLoad

public static boolean createPartRepresentationLoad(Hashtable nv,
                                                   Hashtable cmd_line,
                                                   Vector return_objects)
Processes the "PartRepresentationLoad" directive in the csv load file. Imports the information to create a Representation, and associate it with a part

Does not assume either part is in loader's cache.

Parameters:
nv - Name/Value pairs of arguments. The arguments are as follows:
  • partNumber
  • partVersion
  • partIteration
  • repName
  • repDirectory
  • repDefault
  • repCreateThumbnail
  • repStoreEdz
cmd_line - command line argument that can contain supplemental load data
return_objects - Vector of the object(s) created by this method.

createPartRepresentation

public static boolean createPartRepresentation(Hashtable nv,
                                               Hashtable cmd_line,
                                               Vector return_objects)
Processes the "PartRepresentation" directive in the csv load file. Imports the information to create a Representation, and associate it with a part

Parameters:
nv - Name/Value pairs of arguments. The arguments are as follows:
  • partNumber
  • partVersion
  • partIteration
  • repName
  • repDirectory
  • repDefault
  • repCreateThumbnail
  • repStoreEdz
cmd_line - command line argument that can contain supplemental load data
return_objects - Vector of the object(s) created by this method.

removePartFromAssembly

public static boolean removePartFromAssembly(Hashtable nv,
                                             Hashtable cmd_line,
                                             Vector return_objects)
Processes the "AssemblyRemove" directive in the csv load file. Removes a uses relationship between an assembly part and constituent part

Parameters:
nv - Name/Value pairs of arguments. The arguments are as follows:
  • assemblyPartNumber
  • assemblyPartVersion
  • constitutentPartNumber
cmd_line - command line argument that can contain supplemental load data
return_objects - Vector of the object(s) created by this method.

removePartFromAssemblyLoad

public static boolean removePartFromAssemblyLoad(Hashtable nv,
                                                 Hashtable cmd_line,
                                                 Vector return_objects)
Processes the "AssemblyRemoveLoad" directive in the csv load file. Removes a uses relationship between an assembly part and constituent part

Does not assume either part is in loader's cache.

Parameters:
nv - Name/Value pairs of arguments. The arguments are as follows:
  • assemblyPartNumber
  • assemblyPartVersion
  • constitutentPartNumber
cmd_line - command line argument that can contain supplemental load data
return_objects - Vector of the object(s) created by this method.

addPartToOccurrencedAssembly

public static boolean addPartToOccurrencedAssembly(Hashtable nv,
                                                   Hashtable cmd_line,
                                                   Vector return_objects)
Processes the "OccurrenceAssemblyAdd" directive in the csv load file. Creates a uses relationship between an assembly part and constituent part, and then populate occurrence information

Parameters:
nv - Name/Value pairs of arguments. The arguments are as follows:
  • assemblyPartNumber
  • assemblyPartVersion
  • constitutentPartNumber
  • constituentPartQty
  • constituentPartUnit
  • lineNumber
  • occurrenceLocation
  • referenceDesignator
cmd_line - command line argument that can contain supplemental load data
return_objects - Vector of the object(s) created by this method.
See Also:
addPartToAssembly(java.util.Hashtable, java.util.Hashtable, java.util.Vector)

addPartToOccurrencedAssemblyLoad

public static boolean addPartToOccurrencedAssemblyLoad(Hashtable nv,
                                                       Hashtable cmd_line,
                                                       Vector return_objects)
Processes the "OccurrenceAssemblyAddLoad" directive in the csv load file. Creates a uses relationship between an assembly part and constituent part, and then populate occurrence information

Does not assume either part is in loader's cache.

Parameters:
nv - Name/Value pairs of arguments. The arguments are as follows:
  • assemblyPartNumber
  • assemblyPartVersion
  • constitutentPartNumber
  • constituentPartQty
  • constituentPartUnit
  • lineNumber
  • occurrenceLocation
  • referenceDesignator
cmd_line - command line argument that can contain supplemental load data
return_objects - Vector of the object(s) created by this method.
See Also:
addPartToAssembly(java.util.Hashtable, java.util.Hashtable, java.util.Vector)

createPartDocReferenceOld

public static boolean createPartDocReferenceOld(Hashtable nv,
                                                Hashtable cmd_line,
                                                Vector return_objects)
Deprecated.  

Processes the "PartDocReference" directive in the csv load file. Adds a reference document to a part:

Uses most recently cached part. Checks cache for document, queries database if not found. If docNumber is not supplied, uses most recently cached document. If part and doc exist, creates a document reference link for the part.

Kept around for old loaders. (Does not support versioning.)

Parameters:
nv - Name/Value pair containing the document reference name, docName. The arguments are as follows: (arguments in <> are optional)
  • <docNumber> (optional)
cmd_line - command line argument that can contain supplemental load data
return_objects - Vector of the object(s) created by this method. Used by wt.load.StandardLoadService for accurate user feedback messages.
See Also:
createPartDocReference(java.util.Hashtable, java.util.Hashtable, java.util.Vector), LoadDoc

createPartDocReferenceLoadOld

public static boolean createPartDocReferenceLoadOld(Hashtable nv,
                                                    Hashtable cmd_line,
                                                    Vector return_objects)
Deprecated.  

Processes the "PartDocReference" directive in the csv load file. Adds a reference document to a part:

Checks cache for part, fails if not found. If partNumber is not supplied, uses most recently cached part. Checks cache for document, queries database if not found. If docNumber is not supplied, uses most recently cached document. If part and doc exist, creates a document reference link for the part.

Kept around for old loaders. (Does not support versioning.)

Parameters:
nv - Name/Value pair containing the document reference name, docName. The arguments are as follows: (arguments in <> are optional)
  • <docNumber> (optional)
  • <partNumber> (optional)
cmd_line - not used with CounterPart bulk data loader
return_objects - Vector of the object(s) created by this method. Used by wt.load.StandardLoadService for accurate user feedback messages.
See Also:
createPartDocReference(java.util.Hashtable, java.util.Hashtable, java.util.Vector), LoadDoc

assignUserToProduct

public static boolean assignUserToProduct(Hashtable nv,
                                          Hashtable cmd_line,
                                          Vector return_objects)
Processes the "ProductUser" directive in the csv load file. Associates a user to a named product in a specified role

Assumes user, product and role exists.

Parameters:
nv - Name/Value pairs of arguments. The arguments are as follows:
  • user
  • name
  • role
cmd_line - command line argument that can contain supplemental load data
return_objects - Vector not used

setUserDefaultView

public static boolean setUserDefaultView(Hashtable nv,
                                         Hashtable cmd_line,
                                         Vector return_objects)
Processes the "ViewPreference" directive in the csv load file. Associates a view preference used when creating the default config spec to a user

Assumes user, and view exists.

Parameters:
nv - Name/Value pairs of arguments. The arguments are as follows:
  • user
  • view
cmd_line - command line argument that can contain supplemental load data
return_objects - Vector not used

setSiteDefaultView

public static boolean setSiteDefaultView(Hashtable nv,
                                         Hashtable cmd_line,
                                         Vector return_objects)
Processes the "SiteViewPreference" directive in the csv load file. Creates a Site level view preference which is used when creating the default config spec for users. This preference is overrideable allow users to set their own view preference.

Assumes user, and view exists.

Parameters:
nv - Name/Value pairs of arguments. The arguments are as follows:
  • view
cmd_line - command line argument that can contain supplemental load data
return_objects - Vector not used

getValue

public static String getValue(Hashtable nv,
                              String name,
                              boolean required)
                       throws WTException
Throws:
WTException

isCheckoutAllowed

public static boolean isCheckoutAllowed(Workable workable)
                                 throws LockException,
                                        WTException
See if checkout is allowed.

Parameters:
workable - Workable
Returns:
boolean yes or no
Throws:
LockException
WTException

isUndoCheckoutAllowed

public static boolean isUndoCheckoutAllowed(Workable workable)
See if undo-checkout is allowed.

Parameters:
workable - Workable
Returns:
boolean yes or no

getCheckOutObject

public static Workable getCheckOutObject(Workable workable)
                                  throws LockException,
                                         WTException
check a workable out.

Parameters:
workable - workable
Returns:
the checked-out object
Throws:
LockException
WTException

createPartObject

private static boolean createPartObject(Hashtable nv,
                                        Hashtable cmd_line,
                                        Vector return_objects)

getDisplayInfo

private static String getDisplayInfo(Hashtable nv,
                                     Hashtable cmd_line)

updatePartObject

private static boolean updatePartObject(Hashtable nv,
                                        Hashtable cmd_line,
                                        Vector return_objects)

publishPartObject

private static boolean publishPartObject(Hashtable nv,
                                         Hashtable cmd_line)

addPartToAssembly

private static boolean addPartToAssembly(Hashtable nv,
                                         Hashtable cmd_line,
                                         Vector return_objects,
                                         boolean cached_only,
                                         boolean occurrenced)

createPartDocLink

private static boolean createPartDocLink(Hashtable nv,
                                         Hashtable cmd_line,
                                         Vector return_objects,
                                         int type,
                                         boolean cached_only)

removePartFromAssembly

private static boolean removePartFromAssembly(Hashtable nv,
                                              Hashtable cmd_line,
                                              Vector return_objects,
                                              boolean cached_only)

createNewViewVersion

public static boolean createNewViewVersion(Hashtable nv,
                                           Hashtable cmd_line,
                                           Vector return_objects)
                                    throws WTException
Processes the "NewViewVersion" directive in the csv load file. Locates the part and creates a new view version in the specified view.

Parameters:
nv - Name/Value pairs of arguments. The arguments are as follows:
  • partName
  • partNumber
  • type
  • source
  • folder
  • lifecycle
  • <view>
  • <teamTemplate>
  • <lifecyclestate>
  • <typedef>
  • <version>
  • <iteration>
cmd_line - command line argument that can contain supplemental load data
return_objects - Vector of the object(s) created by this method.
Throws:
WTException

createPartRepresentation

private static boolean createPartRepresentation(Hashtable nv,
                                                Hashtable cmd_line,
                                                Vector return_objects,
                                                int type,
                                                boolean cached_only)

cachePart

public static boolean cachePart(Hashtable nv,
                                Hashtable cmd_line,
                                Vector return_objects)

loadRepresentation

private static Boolean loadRepresentation(String directory,
                                          String poid,
                                          boolean republishable,
                                          String repName,
                                          String repDesc,
                                          boolean repDefault,
                                          boolean createThumbnail,
                                          boolean storeEDZ,
                                          Vector options)

getRefFromObject

private static String getRefFromObject(Persistable obj)

getLocationMatrix

private static javax.vecmath.Matrix4d getLocationMatrix(String location)

getMatrix4dFromLocation

private static javax.vecmath.Matrix4d getMatrix4dFromLocation(double ax,
                                                              double ay,
                                                              double az,
                                                              double x,
                                                              double y,
                                                              double z,
                                                              double scale)

constructPart

private static WTPart constructPart(Hashtable nv,
                                    Hashtable cmd_line)
                             throws WTException
Constructs a part (cached).

Constructs a new part if a part with the supplied part number does not exist. Otherwise if a version is supplied, then it constructs a new version of the existing part if the supplied version does not exist. Otherwise it constructs a new iteration of the supplied version. Otherwise constructs a new iteration of the latest version.

Throws:
WTException

isNewVersion

private static boolean isNewVersion(WTPart part,
                                    String version)
                             throws WTException
Throws:
WTException

getPart

private static WTPart getPart()
                       throws WTException
Throws:
WTException

getPart

private static WTPart getPart(String number,
                              String version,
                              String iteration,
                              String view)
                       throws WTException
Throws:
WTException

getMaster

private static WTPartMaster getMaster()
                               throws WTException
Throws:
WTException

getMaster

private static WTPartMaster getMaster(String number)
                               throws WTException
Throws:
WTException

getCachedPart

private static WTPart getCachedPart()
                             throws WTException
Throws:
WTException

getCachedPart

private static WTPart getCachedPart(String number)
                             throws WTException
Throws:
WTException

getCachedPart

private static WTPart getCachedPart(String number,
                                    String version)
                             throws WTException
Throws:
WTException

getCachedPart

private static WTPart getCachedPart(String number,
                                    String version,
                                    String iteration)
                             throws WTException
Throws:
WTException

getCachedPart

private static WTPart getCachedPart(String number,
                                    String version,
                                    String iteration,
                                    String view)
                             throws WTException
Throws:
WTException

getPartCacheKey

private static String getPartCacheKey(String number,
                                      String version,
                                      String iteration,
                                      String view)
                               throws WTException
Throws:
WTException

cachePart

private static WTPart cachePart(WTPart part)
                         throws WTException
Throws:
WTException

getCachedMaster

private static WTPartMaster getCachedMaster()
                                     throws WTException
Throws:
WTException

getCachedMaster

private static WTPartMaster getCachedMaster(String number)
                                     throws WTException
Throws:
WTException

getMasterCacheKey

private static String getMasterCacheKey(String number)
                                 throws WTException
Throws:
WTException

cacheMaster

private static WTPartMaster cacheMaster(WTPartMaster master)
                                 throws WTException
Throws:
WTException

applyHardAttributes

private static WTPart applyHardAttributes(WTPart part,
                                          Hashtable nv,
                                          Hashtable cmd_line)
                                   throws WTException
Throws:
WTException

applyConstructionTimeAttributes

private static WTPart applyConstructionTimeAttributes(WTPart part,
                                                      Hashtable nv,
                                                      Hashtable cmd_line)
                                               throws WTException
Throws:
WTException

setName

private static void setName(WTPart the_part,
                            String name)
                     throws WTException
Throws:
WTException

setNumber

private static void setNumber(WTPart the_part,
                              String number)
                       throws WTException
Throws:
WTException

setView

private static void setView(WTPart the_part,
                            String viewName)
                     throws WTException
Throws:
WTException

setPartType

private static void setPartType(WTPart the_part,
                                String type)
                         throws WTException
Throws:
WTException

setSource

private static void setSource(WTPart the_part,
                              String source)
                       throws WTException
Throws:
WTException

parseTeamTemplate

private static String[] parseTeamTemplate(Hashtable nv,
                                          Hashtable cmd_line)
                                   throws WTException
Throws:
WTException

getValue

private static String getValue(String name,
                               Hashtable nv,
                               Hashtable cmd_line,
                               boolean required)
                        throws WTException
Throws:
WTException

getValues

private static String[] getValues(String name,
                                  Hashtable nv,
                                  Hashtable cmd_line,
                                  boolean required)
                           throws WTException
Throws:
WTException

getBooleanValue

private static boolean getBooleanValue(String name,
                                       Hashtable nv,
                                       Hashtable cmd_line,
                                       boolean required,
                                       boolean defaultValue)
                                throws WTException
Throws:
WTException

setContainer

private static void setContainer(WTContained the_contained,
                                 WTContainerRef containerRef)
                          throws WTException
Throws:
WTException

setType

private static void setType(Typed the_typed,
                            String subtypedef)
                     throws WTException
Throws:
WTException

setVersion

private static void setVersion(Versioned the_versioned,
                               String version)
                        throws WTException
Throws:
WTException

setIteration

private static void setIteration(Iterated the_iterated,
                                 String iteration)
                          throws WTException
Throws:
WTException

setFolder

private static void setFolder(WTContainerRef containerRef,
                              FolderEntry the_folder_entry,
                              String folderpath)
                       throws WTException
Throws:
WTException

setLifeCycle

private static void setLifeCycle(WTContainerRef containerRef,
                                 LifeCycleManaged the_lifecycle_managed,
                                 String lctemplate)
                          throws WTException
Throws:
WTException

setState

private static void setState(LifeCycleManaged the_lifecycle_managed,
                             String state)
                      throws WTException
Throws:
WTException

setTeamTemplate

private static void setTeamTemplate(WTContainerRef containerRef,
                                    TeamManaged the_team_managed,
                                    String teamTemplate,
                                    String domain)
                             throws WTException
Throws:
WTException

lookupProduct

private static PDMLinkProduct lookupProduct(String name,
                                            WTContainerRef containerRef)
                                     throws WTException
Throws:
WTException

createProductContainer

public static boolean createProductContainer(Hashtable nv,
                                             Hashtable cmd_line,
                                             Vector return_objects)

createProductSerialNumberEffectivity

public static boolean createProductSerialNumberEffectivity(Hashtable nv,
                                                           Hashtable cmd_line,
                                                           Vector return_objects)

createProductLotNumberEffectivity

public static boolean createProductLotNumberEffectivity(Hashtable nv,
                                                        Hashtable cmd_line,
                                                        Vector return_objects)

createProductEffectivity

private static boolean createProductEffectivity(Hashtable nv,
                                                Hashtable cmd_line,
                                                Vector return_objects,
                                                String effType)

setUser

private static void setUser(Hashtable nv,
                            Hashtable cmd_line)
                     throws WTException
Throws:
WTException

resetUser

private static void resetUser()
                       throws WTException
Throws:
WTException