wt.ixb.handlers.forclasses
Class ExpImpForWTPartUsageLink

java.lang.Object
  extended bywt.ixb.publicforhandlers.ClassExporterImporterTemplateGeneral
      extended bywt.ixb.publicforhandlers.ClassExporterImporterTemplate
          extended bywt.ixb.handlers.forclasses.ExpImpForWTPartUsageLink
All Implemented Interfaces:
ClassExporter, ClassExporterImporter, ElementImporter
Direct Known Subclasses:
NmWTPartUsageLinkHandler

public class ExpImpForWTPartUsageLink
extends ClassExporterImporterTemplate


Nested Class Summary
 
Nested classes inherited from class wt.ixb.publicforhandlers.ClassExporterImporterTemplate
ClassExporterImporterTemplate.ContentHolderCommitListener
 
Field Summary
private  boolean ignored
          These member variables are not required, so don't use them private Persistable end_1 = null; private Persistable end_2 = null;
 
Fields inherited from class wt.ixb.publicforhandlers.ClassExporterImporterTemplate
 
Fields inherited from class wt.ixb.publicforhandlers.ClassExporterImporterTemplateGeneral
CONFLICT_RESOURCE
 
Constructor Summary
ExpImpForWTPartUsageLink()
           
 
Method Summary
 void checkConflicts(IxbElement fileXML, Importer importer)
          Checks conflicts that can arise while import process.
 Object createObject(IxbElement fileXML, Importer importer)
          Create a WTPartUsageLink based on ufids of its ends (Uses and UsedBy).
Those ufids are retrieved from the WTPartUsageLink's XML file.
protected  void exportAttributes(Object object, IxbDocument fileXML, Exporter exporter)
          Export the attributes according to the DTD.
 Object findAmongExistingObjects(IxbElement fileXML, Importer importer)
          Implements typical way of finding whether object from given XML file exists already in Windchill database.
private  Object findAmongExistingObjectsForImport(IxbElement fileXML, Importer importer)
          We don't have to find the link anymore, because links are created or not will be decided by actor.
 int getImportPriority()
          Return the import priority of the object type represented by this import handler.
protected  String getRootTag()
          Returns the desired root tag for the object type to be exported, e.g.
 Object importObjectAttributes(Object ob, IxbElement fileXML, Importer importer)
          Import attributes for a WTPartUsageLink from its XML file.


Supported API: true
 Object importObjectAttributesAfterStore(Object ob, IxbElement fileXML, Importer importer)
          Import attributes for a WTPartUsageLink from its XML file after it is stored.
The import for PartUsesOccurence must take place here, because PartUsesOccurences are imported only after the link is stored.
private static void PP(String s)
           
 Object storeObject(Object object, IxbElement fileXML, Importer importer)
          Store a WTPartUsageLink .


Supported API: true
 
Methods inherited from class wt.ixb.publicforhandlers.ClassExporterImporterTemplate
createFileXMLOnExport, exportObject, finalizeImportObject, importElement, isObjectIgnored, isObjectNew, outputLog, rememberNewObInfo, setObjectIgnored, setObjectIsNew, storeAdditionalInfo, storeElement
 
Methods inherited from class wt.ixb.publicforhandlers.ClassExporterImporterTemplateGeneral
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

ignored

private boolean ignored
These member variables are not required, so don't use them private Persistable end_1 = null; private Persistable end_2 = null;

Constructor Detail

ExpImpForWTPartUsageLink

public ExpImpForWTPartUsageLink()
Method Detail

getRootTag

protected String getRootTag()
Description copied from class: ClassExporterImporterTemplate
Returns the desired root tag for the object type to be exported, e.g. "WTDocument". Individual class handlers are expected to implement this method, otherwise the importer might be confused to choosed the exact class handler during import.

Supported API: true

Overrides:
getRootTag in class ClassExporterImporterTemplate
Returns:
String

exportAttributes

protected void exportAttributes(Object object,
                                IxbDocument fileXML,
                                Exporter exporter)
                         throws WTException
Description copied from class: ClassExporterImporterTemplate
Export the attributes according to the DTD. The parameter fileXML is the returned vlue from the method createFileXMLOnExport(Exporter exporter).

Supported API: true

Overrides:
exportAttributes in class ClassExporterImporterTemplate
Parameters:
object -
fileXML -
exporter -
Throws:
WTException

checkConflicts

public void checkConflicts(IxbElement fileXML,
                           Importer importer)
                    throws WTException
Description copied from class: ClassExporterImporterTemplateGeneral
Checks conflicts that can arise while import process.

Supported API: true

Specified by:
checkConflicts in interface ElementImporter
Overrides:
checkConflicts in class ClassExporterImporterTemplateGeneral
Parameters:
fileXML - the XML element to be imported.
importer - The Importer instance that represents the context of the import operation.
Throws:
WTException

findAmongExistingObjects

public Object findAmongExistingObjects(IxbElement fileXML,
                                       Importer importer)
                                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:
fileXML -
importer -
Returns:
Object
Throws:
WTException

findAmongExistingObjectsForImport

private Object findAmongExistingObjectsForImport(IxbElement fileXML,
                                                 Importer importer)
                                          throws WTException
We don't have to find the link anymore, because links are created or not will be decided by actor. The method IxbHndHelper.isLinkIgnored indicates whether the link must be created.

Supported API: true

Parameters:
fileXML - XML file that contains information about the WTPartUsageLink
Returns:
always return null
Throws:
WTException

createObject

public Object createObject(IxbElement fileXML,
                           Importer importer)
                    throws WTException
Create a WTPartUsageLink based on ufids of its ends (Uses and UsedBy).
Those ufids are retrieved from the WTPartUsageLink's XML file.
If the ufids of the ends of the link are modified when they are imported, their new ufids will be retrieved from the Hashtable htModifiedObject defined in the class Importer.

Supported API: true

Specified by:
createObject in class ClassExporterImporterTemplate
Parameters:
fileXML - XML file that contains information about the WTPartUsageLink
importer -
Returns:
the link if it is successfully created, or null
Throws:
WTException

storeObject

public Object storeObject(Object object,
                          IxbElement fileXML,
                          Importer importer)
                   throws WTException
Store a WTPartUsageLink .


Supported API: true

Overrides:
storeObject in class ClassExporterImporterTemplate
Parameters:
fileXML - XML file that contains information about the WTPartUsageLink
object -
importer -
Returns:
the link if it is successfully stored, or null
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

importObjectAttributes

public Object importObjectAttributes(Object ob,
                                     IxbElement fileXML,
                                     Importer importer)
                              throws WTException
Import attributes for a WTPartUsageLink from its XML file.


Supported API: true

Overrides:
importObjectAttributes in class ClassExporterImporterTemplate
Parameters:
ob - The WTPartUsageLink
fileXML - XML file that contains information about the WTPartUsageLink
importer -
Returns:
the link if its attributes are successfully imported, or null
Throws:
WTException

importObjectAttributesAfterStore

public Object importObjectAttributesAfterStore(Object ob,
                                               IxbElement fileXML,
                                               Importer importer)
                                        throws WTException
Import attributes for a WTPartUsageLink from its XML file after it is stored.
The import for PartUsesOccurence must take place here, because PartUsesOccurences are imported only after the link is stored.

Supported API: true

Overrides:
importObjectAttributesAfterStore in class ClassExporterImporterTemplate
Parameters:
ob - The WTPartUsageLink
fileXML - XML file that contains information about the WTPartUsageLink
importer -
Returns:
the link if its attributes are successfully imported, or null
Throws:
WTException

PP

private static void PP(String s)