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

public abstract class ClassExporterImporterTemplate extends ClassExporterImporterTemplateGeneral
Abstract class, most of standard export/import handlers extend. This class implements some typical model of export/import process.

Supported API: true

Extendable: true
  • Method Details

    • createFileXMLOnExport

      protected IxbDocument createFileXMLOnExport(Exporter exporter) throws WTException
      Creates an IxbDocument with the root tag. See getRootTag()

      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 method createFileXMLOnExport(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 method createFileXMLOnExport(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
      Parameters:
      object -
      fileXML -
      exporter -
      Throws:
      WTException
    • storeElement

      protected void storeElement(Object object, IxbDocument fileXML, Exporter exporter) throws WTException
      Stores the exported result fileXML IxbDocument into an XML file or other format accrding to the export handler ApplicationExportHandler.

      Supported API: true
      Parameters:
      object -
      fileXML -
      exporter -
      Throws:
      WTException
    • getRootTag

      protected String 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 public Object importElement(IxbElement fileXML, Importer importer) throws WTException
      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:
      importElement in interface ElementImporter
      Specified by:
      importElement in class ClassExporterImporterTemplateGeneral
      Parameters:
      fileXML -
      importer - The Importer instance that represents the context of the import operation.
      Returns:
      Object
      Throws:
      WTException
    • createObject

      public abstract Object createObject(IxbElement fileXML, Importer importer) throws WTException
      Creates new instance of Windchill object. Every class requires its own method to create object of this class. So, this method must be overridden 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 attributes 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 ancestor

      Supported API: true
      Parameters:
      object -
      fileXML -
      importer -
      Returns:
      Object
      Throws:
      WTException
    • storeObject

      @Deprecated public Object storeObject(Object obj, IxbElement fileXML, Importer importer) throws WTException
      Deprecated.
      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:
      obj -
      fileXML -
      importer -
      Returns:
      Object
      Throws:
      WTException
    • importObjectAttributesAfterStore

      @Deprecated public Object importObjectAttributesAfterStore(Object object, IxbElement fileXML, Importer importer) throws WTException
      Deprecated.
      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 in importObjectAttributes method because it is called before store object.
      If class inherits from another replicated class (for example, inherits from WTPart) then for this class generally a new implementation of this method should be given; in this implementation it should at first call importObjectAttributesAfterStore() of its ancestor

      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
      Parameters:
      object -
      fileXML -
      fileId -
      exporter -
      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
      Parameters:
      obj -
      fileXML -
      objectNew -
      importer -
      Throws:
      WTException
    • finalizeImportObject

      @Deprecated public Object finalizeImportObject(boolean objectNew, Object obj, IxbElement fileXML, Importer importer) throws WTException
      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 -
      obj -
      fileXML -
      importer -
      Returns:
      Throws:
      WTException