Class Importer


public class Importer extends ExpImporter<ImportContextData>
Importer is the container representing import handlers for the context of the import operation. Importer instance is not stateless and there should be only one instance for each importer request.
To construct an instance of Importer use IxbHelper.newImport() with the desired signatures.
There are two major categories of methods in this class to execute import:
  • Various forms of the doImport methods allow application to transfer XML documents into IXB service. Really import is not executed at this point
  • The method finalizeImport really performs all work related to the import: it checks the information from XML files for potential conflicts and then creates Windchill objects.


Supported API: true

Extendable: true
  • Method Details

    • doImport

      public IxbDocument doImport(IxbDocument doc) throws WTException
      Provides information for import. No real import will be done at that point.

      Supported API: true
      Parameters:
      doc - IxbDocument representing content of XML document to be imported
      Returns:
      IxbDocument
      Throws:
      WTException
    • doImport

      public IxbDocument doImport(String docName, String docTag) throws WTException
      Provides information for import. No real import will be done at that point.
      This is an optimization: application additionally informs IXB service about root tag of XML document. This helps IXB to avoid additional XML parsing.
      Replication and export/import application use this optimization

      Supported API: true
      Parameters:
      docName - identifier of XML document to be imported. Application import handler must be able to return the XML document based on this identifier
      docTag - tag of root element in this XML document.
      Returns:
      IxbDocument
      Throws:
      WTException
    • finalizeImport

      public void finalizeImport() throws WTException
      Really performs all work, especially the real import, related to the import based on the information, provided by previous calls of doImport methods:
      • Checks the information from XML files for potential conflicts
      • Creates Windchill objects


      Supported API: true
      Throws:
      WTException
    • logMessage

      public void logMessage(String resourceBundle, String messageKey, Object[] textInserts) throws WTException
      Sends log message to export/import application

      Supported API: true
      Specified by:
      logMessage in class ExpImporter<ImportContextData>
      Parameters:
      resourceBundle -
      messageKey -
      textInserts -
      Throws:
      WTException
    • logMessage

      public void logMessage(String resourceBundle, String messageKey, Object[] textInserts, int importanceLevel) throws WTException
      Sends log message to export/import application

      Supported API: true
      Specified by:
      logMessage in class ExpImporter<ImportContextData>
      Parameters:
      resourceBundle -
      messageKey -
      textInserts -
      importanceLevel -
      Throws:
      WTException
    • finishImport

      public void finishImport() throws WTException
      Call finalizeImport method to really performs all work, especially the real import, related to the import based on the information, provided by previous calls of doImport methods. The difference between finishImport and finalizeImport is the finishImport also cleans the Importer instance's cache and makes the it to be reusable. Therefore the Importer instance could be reused to enter a new importing cycle.
      • Call finalizeImport method
      • Clear the cache in the Importer instance


      Supported API: true
      Throws:
      WTException
    • importElement

      public void importElement(IxbElement doc) throws WTException
      ATTENTION! This method can not be used directly from application. Application can use 'doImport (IxbDocument)' only. Method 'importElement (IxbElement doc)'can be used from import handlers only to import inner elements of IxbDocument

      Supported API: true
      Parameters:
      doc -
      Throws:
      WTException
    • addToModifiedObjects

      public void addToModifiedObjects(Object oldId, Object newId)
      add new identity of imported object in the hashtable

      Supported API: true
      Parameters:
      oldId - identity of the object in the XML file,such as ufid, local Id... or it can be the object itself
      newId - identity of the object that is newly created in the system,such as ufid, local Id... or it canbe the object itself
      Since:
      Windchill R6.2.6
    • getElementForEndOfLink

      public IxbElement getElementForEndOfLink(IxbElement endXML, String endId) throws WTException
      A link always has two ends, each end is represented by its ufid in the link's XML file. However, the information about the link's ends in the XML file may not be correct, if ufids of those ends are modified when they (the ends) are imported.
      This method gets the correct IxbElement that represents for one end of the link in the XML file, no matter the end's ufid is modified or not.

      Supported API: true
      Parameters:
      endXML - the original IxbElement in the XML file that represents one end of a link
      endId - the original id (ufid or localId of the end in the XML file (A.K.A. oldId in htModifiedObjects)
      Returns:
      the IxbElement
      Throws:
      WTException
      Since:
      Windchill R6.2.6
    • getTargetContainerRef

      public WTContainerRef getTargetContainerRef() throws WTException
      Returns the container reference where the import is launched.

      Supported API: true
      Returns:
      WTContainerRef
      Throws:
      WTException