wt.projmgmt.ix
Class ProjectResourceIxHandler

java.lang.Object
  extended bywt.ixb.publicforhandlers.ClassExporterImporterTemplateGeneral
      extended bywt.ixb.publicforhandlers.ClassExporterImporterTemplate
          extended bywt.projmgmt.ix.ProjectResourceIxHandler
All Implemented Interfaces:
ClassExporter, ClassExporterImporter, ElementImporter

public class ProjectResourceIxHandler
extends ClassExporterImporterTemplate


Nested Class Summary
 
Nested classes inherited from class wt.ixb.publicforhandlers.ClassExporterImporterTemplate
ClassExporterImporterTemplate.ContentHolderCommitListener
 
Field Summary
private static Map _classMap
           
private static String RESOURCE
           
private static boolean VERBOSE
           
 
Fields inherited from class wt.ixb.publicforhandlers.ClassExporterImporterTemplate
 
Fields inherited from class wt.ixb.publicforhandlers.ClassExporterImporterTemplateGeneral
CONFLICT_RESOURCE
 
Constructor Summary
ProjectResourceIxHandler()
           
 
Method Summary
 Object createObject(IxbElement elem, Importer imp)
          
private  ProjectResource createProjectResource(ProjectPlan plan, String type)
           resourceType (PERSON | ROLE | EQUIPMENT | MATERIAL | INFORMATION | FACILITY) #REQUIRED>
private  void exportCostPerUse(ProjectResource resource, IxbElement elem, Exporter exporter)
          
private  void exportLabel(ProjectResource resource, IxbElement elem, Exporter exporter)
          
private  void exportMaxPercentUtilization(ProjectResource resource, IxbElement elem, Exporter exporter)
          
private  void exportMaxUnits(ProjectResource resource, IxbElement elem, Exporter exporter)
          
 void exportObject(Object obj, Exporter exporter)
          Exports the specified object in context given by parameter exporter.
private  void exportOvertimeRate(ProjectResource resource, IxbElement elem, Exporter exporter)
          
 void exportResource(ProjectResource resource, IxbElement elem, Exporter exporter)
          
private  void exportResourceAttributes(ProjectResource resource, IxbElement elem, Exporter exporter)
          
private  void exportResourceReference(ProjectResource resource, IxbElement elem, Exporter exporter)
          
private  void exportStandardRate(ProjectResource resource, IxbElement elem, Exporter exporter)
          
 Object findAmongExistingObjects(IxbElement elem, Importer imp)
          Implements typical way of finding whether object from given XML file exists already in Windchill database.
private  ProjectResource findResource(ProjectPlan plan, String type, String name)
           
 int getImportPriority()
          Return the import priority of the object type represented by this import handler.
private static ObjectIdentifier getOid(Object obj)
           
private  PersonResource getPersonResource(WTContainerRef cont_ref, ProjectPlan plan, IxbElement ref_elem)
           
private  WTPrincipal getPrincipal(WTContainerRef cont_ref, String princ_name)
           
private  ResourceCategory getResourceCategory(IxbElement elem, Importer imp)
          
private  String getResourceType(ProjectResource resource)
           resourceType (PERSON | ROLE | EQUIPMENT | MATERIAL | INFORMATION | FACILITY) #REQUIRED>
private  void importCostPerUse(ProjectResource resource, IxbElement elem, Importer importer)
          
private  void importLabel(ProjectResource resource, IxbElement elem, Importer importer)
          
private  void importMaxPercentUtilization(ProjectResource resource, IxbElement elem, Importer importer)
          
private  void importMaxUnits(ProjectResource resource, IxbElement elem, Importer importer)
          
private  void importOvertimeRate(ProjectResource resource, IxbElement elem, Importer importer)
          
private  boolean importResourceReference(ProjectResource resource, IxbElement elem, Importer importer)
          
private  void importStandardRate(ProjectResource resource, IxbElement elem, Importer importer)
          
 Object storeObject(Object obj, IxbElement elem, Importer imp)
          
private  boolean updateResourceAttributes(ProjectResource resource, String type, IxbElement elem, Importer imp)
          
 
Methods inherited from class wt.ixb.publicforhandlers.ClassExporterImporterTemplate
createFileXMLOnExport, exportAttributes, finalizeImportObject, getRootTag, importElement, importObjectAttributes, importObjectAttributesAfterStore, isObjectIgnored, isObjectNew, outputLog, rememberNewObInfo, setObjectIgnored, setObjectIsNew, storeAdditionalInfo, storeElement
 
Methods inherited from class wt.ixb.publicforhandlers.ClassExporterImporterTemplateGeneral
checkConflicts, finalizeCheckConflicts, finalizeExport, finalizeImport, getAdditionalImportPriority, getObjectDisplayID, prepareForCheckConflicts, prepareForImport, previewElement
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_classMap

private static final Map _classMap

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

VERBOSE

private static final boolean VERBOSE
Constructor Detail

ProjectResourceIxHandler

public ProjectResourceIxHandler()
Method Detail

exportObject

public void exportObject(Object obj,
                         Exporter exporter)
                  throws WTException
Description copied from class: ClassExporterImporterTemplate
Exports the specified object in context given by parameter exporter.
The implementation of this method is partitioned into several protected methods. Individual class handlers can override the following protected methods: Also, export actions from either client or system registry will be performed. Specifically, the two methods wt.ixb.tuner.ExportActionHelper.performPreExportAction () and wt.ixb.tuner.ExportActionHelper.performPostExportAction () will be called before and after th above three protected methods, respectively.

Supported API: true

Specified by:
exportObject in interface ClassExporter
Overrides:
exportObject in class ClassExporterImporterTemplate
Parameters:
obj -
exporter - The Exporter instance that represents the context of the export operation.
Throws:
WTException

exportResource

public void exportResource(ProjectResource resource,
                           IxbElement elem,
                           Exporter exporter)
                    throws WTException
 

 
 

Throws:
WTException

exportResourceAttributes

private void exportResourceAttributes(ProjectResource resource,
                                      IxbElement elem,
                                      Exporter exporter)
                               throws WTException
 
 
 
 

Throws:
WTException

createObject

public Object createObject(IxbElement elem,
                           Importer imp)
                    throws WTException
 

 
 

Specified by:
createObject in class ClassExporterImporterTemplate
Parameters:
elem -
imp -
Returns:
Object
Throws:
WTException

getPersonResource

private PersonResource getPersonResource(WTContainerRef cont_ref,
                                         ProjectPlan plan,
                                         IxbElement ref_elem)
                                  throws WTException
Throws:
WTException

updateResourceAttributes

private boolean updateResourceAttributes(ProjectResource resource,
                                         String type,
                                         IxbElement elem,
                                         Importer imp)
                                  throws WTException
 
 
 
 

Throws:
WTException

getResourceCategory

private ResourceCategory getResourceCategory(IxbElement elem,
                                             Importer imp)
                                      throws WTException
 
 
 

Throws:
WTException

storeObject

public Object storeObject(Object obj,
                          IxbElement elem,
                          Importer imp)
                   throws WTException
 

Overrides:
storeObject in class ClassExporterImporterTemplate
Parameters:
obj -
elem -
imp -
Returns:
Object
Throws:
WTException

findAmongExistingObjects

public Object findAmongExistingObjects(IxbElement elem,
                                       Importer imp)
                                throws WTException
Description copied from class: ClassExporterImporterTemplate
Implements typical way of finding whether object from given XML file exists already in Windchill database.

Supported API: true

Overrides:
findAmongExistingObjects in class ClassExporterImporterTemplate
Parameters:
elem -
imp -
Returns:
Object
Throws:
WTException

getResourceType

private String getResourceType(ProjectResource resource)
                        throws WTException
      resourceType (PERSON | ROLE | EQUIPMENT | MATERIAL | INFORMATION | FACILITY) #REQUIRED>
 

Throws:
WTException

exportLabel

private void exportLabel(ProjectResource resource,
                         IxbElement elem,
                         Exporter exporter)
                  throws WTException
 
 

Throws:
WTException

exportMaxUnits

private void exportMaxUnits(ProjectResource resource,
                            IxbElement elem,
                            Exporter exporter)
                     throws WTException
 
 

Throws:
WTException

exportResourceReference

private void exportResourceReference(ProjectResource resource,
                                     IxbElement elem,
                                     Exporter exporter)
                              throws WTException
 
 
 

Throws:
WTException

exportStandardRate

private void exportStandardRate(ProjectResource resource,
                                IxbElement elem,
                                Exporter exporter)
                         throws WTException
 
 
 

Throws:
WTException

exportCostPerUse

private void exportCostPerUse(ProjectResource resource,
                              IxbElement elem,
                              Exporter exporter)
                       throws WTException
 
 
 

Throws:
WTException

exportOvertimeRate

private void exportOvertimeRate(ProjectResource resource,
                                IxbElement elem,
                                Exporter exporter)
                         throws WTException
 
 
 

Throws:
WTException

exportMaxPercentUtilization

private void exportMaxPercentUtilization(ProjectResource resource,
                                         IxbElement elem,
                                         Exporter exporter)
                                  throws WTException
 
 

Throws:
WTException

findResource

private ProjectResource findResource(ProjectPlan plan,
                                     String type,
                                     String name)
                              throws WTException
Throws:
WTException

createProjectResource

private ProjectResource createProjectResource(ProjectPlan plan,
                                              String type)
                                       throws WTException
      resourceType (PERSON | ROLE | EQUIPMENT | MATERIAL | INFORMATION | FACILITY) #REQUIRED>
 

Throws:
WTException

importLabel

private void importLabel(ProjectResource resource,
                         IxbElement elem,
                         Importer importer)
                  throws WTException
 
 

Throws:
WTException

importMaxUnits

private void importMaxUnits(ProjectResource resource,
                            IxbElement elem,
                            Importer importer)
                     throws WTException
 
 

Throws:
WTException

importResourceReference

private boolean importResourceReference(ProjectResource resource,
                                        IxbElement elem,
                                        Importer importer)
                                 throws WTException
 
 
 

Throws:
WTException

getPrincipal

private WTPrincipal getPrincipal(WTContainerRef cont_ref,
                                 String princ_name)
                          throws WTException
Throws:
WTException

importStandardRate

private void importStandardRate(ProjectResource resource,
                                IxbElement elem,
                                Importer importer)
                         throws WTException
 
 
 

Throws:
WTException

importCostPerUse

private void importCostPerUse(ProjectResource resource,
                              IxbElement elem,
                              Importer importer)
                       throws WTException
 
 
 

Throws:
WTException

importOvertimeRate

private void importOvertimeRate(ProjectResource resource,
                                IxbElement elem,
                                Importer importer)
                         throws WTException
 
 
 

Throws:
WTException

importMaxPercentUtilization

private void importMaxPercentUtilization(ProjectResource resource,
                                         IxbElement elem,
                                         Importer importer)
                                  throws WTException
 
 

Throws:
WTException

getImportPriority

public int getImportPriority()
                      throws WTException
Description copied from class: ClassExporterImporterTemplateGeneral
Return the import priority of the object type represented by this import handler.
Import priority defines the order in which objects will be imported. This method does not carry parameters in the signature. The return value can not be negative. Those XML files will have a higher import priority for smaller returned values.

Supported API: true

Specified by:
getImportPriority in interface ElementImporter
Specified by:
getImportPriority in class ClassExporterImporterTemplateGeneral
Returns:
int
Throws:
WTException

getOid

private static ObjectIdentifier getOid(Object obj)