Package wt.ixb.publicforhandlers
Class ClassExporterImporterTemplate
java.lang.Object
wt.ixb.publicforhandlers.ClassExporterImporterTemplateGeneral
wt.ixb.publicforhandlers.ClassExporterImporterTemplate
- All Implemented Interfaces:
ClassExporter,ClassExporterImporter,ElementImporter
- Direct Known Subclasses:
wt.esi.ixb.handlers.forclasses._ExpImpForERPPartSpecificPlantData,ExpImpForLinkObject,ExpImpForVersionedObject
Abstract class, most of standard export/import handlers extend. This class implements some typical model of
export/import process.
Supported API: true
Extendable: true
Supported API: true
Extendable: true
-
Field Summary
Fields inherited from interface wt.ixb.publicforhandlers.ClassExporter
NO_PRIORITYFields inherited from interface wt.ixb.publicforhandlers.ElementImporter
NO_PRIORITY -
Method Summary
Modifier and TypeMethodDescriptionvoid_checkConflicts(List<IxbElement> elements, Importer importer, String actionName, String tag) Checks conflicts that can arise while import process.protected IxbDocumentcreateFileXMLOnExport(Exporter exporter) Creates anIxbDocumentwith the root tag.abstract ObjectcreateObject(IxbElement fileXML, Importer importer) Creates new instance of Windchill object.protected voidexecExportObjectContents(Object object, IxbDocument fileXML, Exporter exporter) Calls the exportObjectContents method of all AttributeExporterImporter implementing ExpImpForContentAttrtItfc interface
Supported API: trueprotected voidexportAttributes(Object object, IxbDocument fileXML, Exporter exporter) Export the attributes according to the DTD.protected voidexportAttributes(Object object, IxbElement fileXML, Exporter exporter) Export the attributes according to the DTD.voidexportObject(Object object, Exporter exporter) Exports the specified object in context given by parameter exporter.finalizeImportObject(boolean objectNew, Object object, IxbElement fileXML, Importer importer) Deprecated.protected StringReturns the desired root tag for the object type to be exported, e.g.importElement(IxbElement fileXML, Importer importer) Deprecated.UseimportElements(List, Importer, String, String)instead.importObjectAttributes(Object object, IxbElement fileXML, Importer importer) Imports class specific atributes from the XML file.importObjectAttributesAfterStore(Object object, IxbElement fileXML, Importer importer) Imports class specific attributes from the XML element after object gets stored
This method should be implemented for most of the classes This method is required because some of attributes (IBA, Content) can not be added to the object before it gets stored.voidprepareForCheckConflicts(List<IxbElement> ixbElementLst, Importer importer) Called in the beginning of conflict check process prior to the real import or preview.protected voidrememberNewObInfo(Object obj, IxbElement fileXML, boolean objectNew, Importer importer) Implements typical way of storing information about imported object That information can be used if in import package there are other objects, referenced this one
Supported API: trueprotected voidstoreAdditionalInfo(Object object, IxbDocument fileXML, String fileId, Exporter exporter) By default will do whatever processing is specified in Application handler.protected voidstoreElement(Object object, IxbDocument fileXML, Exporter exporter) Stores the exported result fileXMLIxbDocumentinto an XML file or other format accrding to the export handlerApplicationExportHandler.storeObject(Object object, IxbElement fileXML, Importer importer) Deprecated.UsestoreObjects(List, Importer)instead.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface wt.ixb.publicforhandlers.ElementImporter
getObjectDisplayIDs
-
Method Details
-
exportObject
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:createFileXMLOnExport(Exporter exporter), which create anIxbDocumentwith the root tag. SeegetRootTag();exportAttributes (Object object, IxbElement fileXML, Exporter exporter)which will export the attributes according to the DTD. The parameter fileXML is the returned vlue fromcreateFileXMLOnExport(Exporter exporter).storeElement(Object object, IxbElement fileXML, Exporter exporter)which will store the fileXML into an xml-file.
wt.ixb.tuner.ExportActionHelper.performPreExportAction ()andwt.ixb.tuner.ExportActionHelper.performPostExportAction ()will be called before and after th above three protected methods, respectively.
Supported API: true- Specified by:
exportObjectin interfaceClassExporter- Specified by:
exportObjectin classClassExporterImporterTemplateGeneral- Parameters:
object-exporter- TheExporterinstance that represents the context of the export operation.- Throws:
WTException
-
createFileXMLOnExport
Creates anIxbDocumentwith the root tag. SeegetRootTag()
Supported API: true- Parameters:
exporter-- Returns:
- IxbDocument
- Throws:
WTException
-
exportAttributes
protected void exportAttributes(Object object, IxbDocument fileXML, Exporter exporter) throws WTException Export the attributes according to the DTD. The parameter fileXML is the returned vlue from the methodcreateFileXMLOnExport(Exporter exporter).
Supported API: true- Parameters:
object-fileXML-exporter-- Throws:
WTException
-
exportAttributes
protected void exportAttributes(Object object, IxbElement fileXML, Exporter exporter) throws WTException Export the attributes according to the DTD. The parameter fileXML is the returned value from the methodcreateFileXMLOnExport(Exporter exporter).
Supported API: true- Parameters:
object-fileXML-exporter-- Throws:
WTException
-
execExportObjectContents
protected void execExportObjectContents(Object object, IxbDocument fileXML, Exporter exporter) throws WTException Calls the exportObjectContents method of all AttributeExporterImporter implementing ExpImpForContentAttrtItfc interface
Supported API: true- Throws:
WTException
-
prepareForCheckConflicts
public void prepareForCheckConflicts(List<IxbElement> ixbElementLst, Importer importer) throws WTException Called in the beginning of conflict check process prior to the real import or preview.
Supported API: true- Specified by:
prepareForCheckConflictsin interfaceElementImporter- Overrides:
prepareForCheckConflictsin classClassExporterImporterTemplateGeneral- Parameters:
ixbElementLst- List of IxbElementsimporter- TheImporterinstance that represents the context of the import operation- Throws:
WTException
-
storeElement
protected void storeElement(Object object, IxbDocument fileXML, Exporter exporter) throws WTException Stores the exported result fileXMLIxbDocumentinto an XML file or other format accrding to the export handlerApplicationExportHandler.
Supported API: true- Parameters:
object-fileXML-exporter-- Throws:
WTException
-
getRootTag
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- Returns:
- String
-
importElement
Deprecated.UseimportElements(List, Importer, String, String)instead.Imports XML element in context given by importer parameter. Returns the imported object, which might be newly created or already existed in the datastore.
Supported API: true- Specified by:
importElementin interfaceElementImporter- Specified by:
importElementin classClassExporterImporterTemplateGeneral- Parameters:
fileXML-importer- TheImporterinstance that represents the context of the import operation.- Returns:
- Object
- Throws:
WTException
-
_checkConflicts
public void _checkConflicts(List<IxbElement> elements, Importer importer, String actionName, String tag) throws WTException Checks conflicts that can arise while import process. This method is used to delegate the checkConflict to actor.
Supported API: true- Specified by:
_checkConflictsin interfaceElementImporter- Overrides:
_checkConflictsin classClassExporterImporterTemplateGeneral- Parameters:
elements- the XML elements to be imported.importer- TheImporterinstance that represents the context of the import operation.- Throws:
WTException
-
createObject
Creates new instance of Windchill object. Every class requires its own method to create object of this class. So, this method must be overriden by any class specific import handler
Supported API: true- Parameters:
fileXML-importer-- Returns:
- Object
- Throws:
WTException
-
importObjectAttributes
public Object importObjectAttributes(Object object, IxbElement fileXML, Importer importer) throws WTException Imports class specific atributes from the XML file. This method should be implemented for most of the class handlers. If the object class inherits from another replicated class (for example, inherits from WTPart) then it generally should give a new implementation for this method; in this implementation it should at first call importObjectAttributes of its ansector
Supported API: true- Parameters:
object-fileXML-importer-- Returns:
- Object
- Throws:
WTException
-
storeObject
@Deprecated public Object storeObject(Object object, IxbElement fileXML, Importer importer) throws WTException Deprecated.UsestoreObjects(List, Importer)instead.That is the general template how to store object. It looks like it will be good for many classes. If for some class it is not good then it can be override this method
Supported API: true- Parameters:
object-fileXML-importer-- Returns:
- Object
- Throws:
WTException
-
importObjectAttributesAfterStore
public Object importObjectAttributesAfterStore(Object object, IxbElement fileXML, Importer importer) throws WTException Imports class specific attributes from the XML element after object gets stored
This method should be implemented for most of the classes This method is required because some of attributes (IBA, Content) can not be added to the object before it gets stored. So, we can not set this attribute inimportObjectAttributesmethod because it is called before store object.
If class inherits from another replicated class (for example, inherits fromWTPart) then for this class generally a new implementation of this method should be given; in this implementation it should at first callimportObjectAttributesAfterStore()of its ansector
Supported API: true- Parameters:
object-fileXML-importer-- Returns:
- Object
- Throws:
WTException
-
storeAdditionalInfo
protected void storeAdditionalInfo(Object object, IxbDocument fileXML, String fileId, Exporter exporter) throws WTException By default will do whatever processing is specified in Application handler. Handlers which need to do something different (or nothing at all) should override this method. *
Supported API: true- Throws:
WTException
-
rememberNewObInfo
protected void rememberNewObInfo(Object obj, IxbElement fileXML, boolean objectNew, Importer importer) throws WTException Implements typical way of storing information about imported object That information can be used if in import package there are other objects, referenced this one
Supported API: true- Throws:
WTException
-
finalizeImportObject
@Deprecated public Object finalizeImportObject(boolean objectNew, Object object, IxbElement fileXML, Importer importer) throws WTException Deprecated.UsefinalizeImportObjects(boolean, List, Importer)instead.Some actions in the end of the import process. This method is called even if there were no real import - i.e. if existing object was found, that represents object to be imported
Supported API: true- Parameters:
objectNew-object-fileXML-importer-- Returns:
- Throws:
WTException
-
finalizeImportObjects(boolean, List, Importer)instead.