Package wt.ixb.publicforapps
Class Importer
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
There are two major categories of methods in this class to execute import:
Supported API: true
Extendable: true
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
finalizeImportreally 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
-
Field Summary
Fields inherited from class wt.ixb.publicforapps.ExpImporter
generalContext, ixbHandlersManager -
Method Summary
Modifier and TypeMethodDescriptionvoidaddToModifiedObjects(Object oldId, Object newId) add new identity of imported object in the hashtable
Supported API: trueProvides information for import.doImport(IxbDocument doc) Provides information for import.voidReally 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: truevoidCall 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.getElementForEndOfLink(IxbElement endXML, String endId) A link always has two ends, each end is represented by its ufid in the link's XML file.Returns the container reference where the import is launched.voidimportElement(IxbElement doc) ATTENTION! This method can not be used directly from application.voidlogMessage(String resourceBundle, String messageKey, Object[] textInserts) Sends log message to export/import application
Supported API: truevoidlogMessage(String resourceBundle, String messageKey, Object[] textInserts, int importanceLevel) Sends log message to export/import application
Supported API: true
-
Method Details
-
doImport
Provides information for import. No real import will be done at that point.
Supported API: true- Parameters:
doc-IxbDocumentrepresenting content of XML document to be imported- Returns:
- IxbDocument
- Throws:
WTException
-
doImport
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 identifierdocTag- tag of root element in this XML document.- Returns:
- IxbDocument
- Throws:
WTException
-
finalizeImport
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:
logMessagein classExpImporter<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:
logMessagein classExpImporter<ImportContextData>- Parameters:
resourceBundle-messageKey-textInserts-importanceLevel-- Throws:
WTException
-
finishImport
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
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
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 itselfnewId- 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
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 linkendId- 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
Returns the container reference where the import is launched.
Supported API: true- Returns:
WTContainerRef- Throws:
WTException
-