|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectwt.ixb.publicforapps.ExpImporter
wt.ixb.publicforapps.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 IxbHelper.newImport()
with the desired signatures.
There are two major categories of methods in this class to execute import:
finalizeImport
really performs all work
related to the import: it checks the information
from XML files for potential conflicts and then creates Windchill
objects.
Fields inherited from class wt.ixb.publicforapps.ExpImporter |
attributeExporterImporterManager, dtd, generalContext, ixbHandlersManager, tuner |
Constructor Summary | |
(package private) |
Importer(ApplicationImportHandler _applicationImportHandler,
WTContainerRef cont,
String _dtd,
IxbElement _localMappingRules,
Boolean _overrideConflicts,
Boolean _validate)
|
(package private) |
Importer(ApplicationImportHandler _applicationImportHandler,
WTContainerRef _targetContainer,
String _dtd,
IxbElement _localMappingRules,
Boolean _overrideConflicts,
Boolean _validate,
Boolean _performConflictResolution)
|
(package private) |
Importer(ApplicationImportHandler _applicationImportHandler,
WTContainerRef _targetContainer,
String _dtd,
String _ruleFileName,
String _xslPolicyFileName,
String _containerMappingFileName,
String _actorName,
Boolean _overrideConflicts,
Boolean _validate)
_ruleFileName is the name of XML file or XSL file that is passed in to Importer as mapping rule. |
Method Summary | |
void |
addToModifiedObjects(Object oldId,
Object newId)
add new identity of imported object in the hashtable Supported API: true |
void |
addToNotCreateLinkObjects(Object objectId)
|
private void |
checkConflicts(IxbDocument doc)
|
private void |
checkConflicts(Vector fileNames)
|
private void |
checkConflictsForOneDocFromJar(IxbDocument doc)
|
private void |
closeStream(InputStream is)
|
private int |
compareDocs(IxbDocument doc1,
IxbDocument doc2)
|
private void |
doCheckConflicts()
|
IxbDocument |
doImport(InputStream docStream)
Provides information for import. |
void |
doImport(InputStream docStream,
boolean _validate)
|
IxbDocument |
doImport(IxbDocument doc)
Provides information for import. |
void |
doImport(IxbElement doc)
Deprecated. |
IxbDocument |
doImport(String docName,
String docTag)
Provides information for import. |
void |
doPreview(InputStream docStream)
|
void |
doPreview(IxbDocument doc)
|
void |
doPreview(String docName,
String docTag)
|
private void |
doRealImport()
|
private void |
doRealImport(Vector fileNames)
|
private void |
doRealPreview()
|
private void |
finalizeCheckConflicts()
|
void |
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 |
private void |
finalizeImportFinalize()
|
void |
finalizePreview()
|
ApplicationImportHandler |
getApplicationImportHandler()
|
Hashtable |
getContainerMapping()
|
IxbDocument |
getDocumentByFileName(String fileName)
|
private String |
getDTDFromXML(IxbDocument doc)
|
IxbElement |
getElementForEndOfLink(IxbElement endXML,
String endId)
A link always has two ends, each end is represented by its ufid in the link's XML file. |
Vector |
getIgnoredObjects()
|
private ElementImporter |
getImportHandler(String tag)
|
private InputStream |
getInputStreamFromApplicationHandler(String s)
|
Object |
getNewIdFromOldId(Object oldId)
get new identity of imported object based on its old identity from XML file Supported API: false |
Vector |
getNotCreateLinkObjects()
|
String |
getTargetContainerId()
|
WTContainerRef |
getTargetContainerRef()
Returns the container reference where the import is launched. |
void |
importElement(IxbElement doc)
ATTENTION! This method can not be used directly from application. |
void |
importFiles(Vector fileNames)
Checks conflicts and imports data, given the sorted list of metadata file names. |
void |
importJarFile(IXBJarReader jarReader)
|
private void |
importOneDocFromJar(IxbDocument doc)
|
private void |
initialize(ApplicationImportHandler _applicationImportHandler,
String _dtd,
Boolean _overrideConflicts,
Boolean _validate)
|
private void |
initialize(ApplicationImportHandler _handler,
WTContainerRef cont,
String _dtd,
String _containerMappingFileName,
String _actorName,
Boolean _overrideConflicts,
Boolean _validate)
|
private void |
insertExternalNameToList(Vector extFileNames,
String stDir,
String stKey)
|
private IxbDocument |
insertInListForImport(IxbDocument doc,
String rootElementTag)
|
private void |
insertObjectInHashtable(Hashtable htbObjs,
IxbDocument insertDoc,
ElementImporter handler)
|
private void |
insertObjectInList(Vector vImportList,
Object doc,
int prio,
int subPrio)
|
boolean |
isImportLifeCycleAfterStore()
|
boolean |
isMustImportLifeCycle()
|
void |
logMessage(String resourceBundle,
String messageKey,
Object[] textInserts)
Sends log message to export/import application Supported API: true |
void |
logMessage(String resourceBundle,
String messageKey,
Object[] textInserts,
int importanceLevel)
Sends log message to export/import application Supported API: true |
private static void |
PP(String s)
|
private IxbDocument |
prepareDocForImport(IxbDocument doc)
|
private void |
prepareForCheckConflicts()
|
private void |
prepareForImport()
|
private void |
prepareForImportJar()
|
void |
previewElement(IxbElement doc)
|
void |
previewJarFile(IXBJarReader jarReader)
|
private void |
previewOneDocFromJar(IxbDocument doc)
|
void |
processBigJarFile(IXBJarReader jarReader,
boolean isImportJar)
|
private void |
processFromObjectList(Vector vImportList,
boolean isImportJar)
|
void |
processSmallJarFile(IXBJarReader jarReader,
boolean isImportJar)
|
void |
setClientJarFileName(String aName)
|
void |
setImportLifeCycleAfterStore(boolean bValue)
|
void |
SetMustImportLifeCycle(boolean value)
|
boolean |
shouldPerformConflictResolution()
|
Methods inherited from class wt.ixb.publicforapps.ExpImporter |
getDTD |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final String RESOURCE
private static final String CLASSNAME
public static final String XML_TAG_CONTAINER
public static final String XML_TAG_SOURCE_CONTAINER
public static final String XML_TAG_TARGET_CONTAINER
private static final String NO_CONTAINER
private static final String FILE_NAME_CONNECT_CHAR
private WTContainerRef targetContainer
private String targetContainerId
private Hashtable htContainerMapping
public long countFilesImported
public long countOfNewObjects
public long countOfOldObjects
public long countOfIgnoredObjects
public long countOfCheckedOutObjects
public IXBImpConflictSet generalConflictSet
public ExistObjConflictSet existingObjectsConflictSet
private ApplicationImportHandler applicationImportHandler
private Vector impList
private boolean validate
private String actorName
private StreamSource xslPolicyFile
private String xslPolicyFileName
private boolean performConflictResolution
private String clientJarFileName
private boolean mustImportLifeCycle
private static final int SMALL_JAR_SIZE
private String dtdFromXML
private boolean importLifeCycleAfterStore
private Hashtable htModifiedObjects
private Vector vIgnoredObjects
private Vector vNotCreateLinkObjects
private static boolean ONE_TRANSACTION
Constructor Detail |
Importer(ApplicationImportHandler _applicationImportHandler, WTContainerRef _targetContainer, String _dtd, IxbElement _localMappingRules, Boolean _overrideConflicts, Boolean _validate, Boolean _performConflictResolution) throws WTException
Importer(ApplicationImportHandler _applicationImportHandler, WTContainerRef _targetContainer, String _dtd, String _ruleFileName, String _xslPolicyFileName, String _containerMappingFileName, String _actorName, Boolean _overrideConflicts, Boolean _validate) throws WTException
Importer(ApplicationImportHandler _applicationImportHandler, WTContainerRef cont, String _dtd, IxbElement _localMappingRules, Boolean _overrideConflicts, Boolean _validate) throws WTException
Method Detail |
public IxbDocument doImport(InputStream docStream) throws WTException
docStream
- InputStream representing content of XML document to de imported
WTException
public IxbDocument doImport(IxbDocument doc) throws WTException
doc
- IxbDocument
representing content of XML document to de imported
WTException
public IxbDocument doImport(String docName, String docTag) throws WTException
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.
WTException
public void finalizeImport() throws WTException
WTException
public void logMessage(String resourceBundle, String messageKey, Object[] textInserts) throws WTException
logMessage
in class ExpImporter
resourceBundle
- messageKey
- textInserts
-
WTException
public void logMessage(String resourceBundle, String messageKey, Object[] textInserts, int importanceLevel) throws WTException
logMessage
in class ExpImporter
resourceBundle
- messageKey
- textInserts
- importanceLevel
-
WTException
private void initialize(ApplicationImportHandler _handler, WTContainerRef cont, String _dtd, String _containerMappingFileName, String _actorName, Boolean _overrideConflicts, Boolean _validate) throws WTException
WTException
private void initialize(ApplicationImportHandler _applicationImportHandler, String _dtd, Boolean _overrideConflicts, Boolean _validate) throws WTException
WTException
public void doImport(InputStream docStream, boolean _validate) throws WTException
WTException
public void importFiles(Vector fileNames) throws WTException
fileNames
- Vector of metadata file names, sorted by import priority
WTException
private void checkConflicts(Vector fileNames) throws WTException
WTException
private void doRealImport(Vector fileNames) throws WTException
WTException
private void closeStream(InputStream is) throws WTException
WTException
public void doPreview(InputStream docStream) throws WTException
WTException
public void doPreview(IxbDocument doc) throws WTException
WTException
public void doPreview(String docName, String docTag) throws WTException
WTException
public void finalizePreview() throws WTException
WTException
private void doRealPreview() throws WTException
WTException
public void previewElement(IxbElement doc) throws WTException
WTException
private void doCheckConflicts() throws WTException
WTException
private void doRealImport() throws WTException
WTException
private void prepareForCheckConflicts() throws WTException
WTException
private void checkConflicts(IxbDocument doc) throws WTException
WTException
private void finalizeCheckConflicts() throws WTException
WTException
private void prepareForImport() throws WTException
WTException
public Vector getIgnoredObjects()
public Vector getNotCreateLinkObjects()
public void addToNotCreateLinkObjects(Object objectId)
public void importElement(IxbElement doc) throws WTException
WTException
public void doImport(IxbElement doc) throws WTException
importElement (IxbElement doc)
WTException
private void finalizeImportFinalize() throws WTException
WTException
private InputStream getInputStreamFromApplicationHandler(String s) throws WTException
WTException
private IxbDocument insertInListForImport(IxbDocument doc, String rootElementTag) throws WTException
WTException
public ApplicationImportHandler getApplicationImportHandler()
private ElementImporter getImportHandler(String tag) throws WTException
WTException
public IxbDocument getDocumentByFileName(String fileName) throws WTException
WTException
private String getDTDFromXML(IxbDocument doc)
public boolean shouldPerformConflictResolution()
public void addToModifiedObjects(Object oldId, Object newId)
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 itselfpublic Object getNewIdFromOldId(Object oldId)
oldId
- identity of the object in the XML file,such as ufid, local Id... or it can be the object itself
public IxbElement getElementForEndOfLink(IxbElement endXML, String endId) throws WTException
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)
WTException
public WTContainerRef getTargetContainerRef() throws WTException
WTContainerRef
WTException
public String getTargetContainerId() throws WTException
WTException
public void SetMustImportLifeCycle(boolean value)
public boolean isMustImportLifeCycle()
public Hashtable getContainerMapping()
public void setClientJarFileName(String aName)
public void importJarFile(IXBJarReader jarReader) throws WTException
WTException
public void processSmallJarFile(IXBJarReader jarReader, boolean isImportJar) throws WTException
WTException
private void processFromObjectList(Vector vImportList, boolean isImportJar) throws WTException
WTException
public void processBigJarFile(IXBJarReader jarReader, boolean isImportJar) throws WTException
WTException
private void insertExternalNameToList(Vector extFileNames, String stDir, String stKey) throws WTException
WTException
public void previewJarFile(IXBJarReader jarReader) throws WTException
WTException
private void importOneDocFromJar(IxbDocument doc) throws WTException
WTException
private void checkConflictsForOneDocFromJar(IxbDocument doc) throws WTException
WTException
private void previewOneDocFromJar(IxbDocument doc) throws WTException
WTException
private IxbDocument prepareDocForImport(IxbDocument doc) throws WTException
WTException
private void prepareForImportJar() throws WTException
WTException
private void insertObjectInList(Vector vImportList, Object doc, int prio, int subPrio) throws WTException
WTException
private void insertObjectInHashtable(Hashtable htbObjs, IxbDocument insertDoc, ElementImporter handler) throws WTException
WTException
private int compareDocs(IxbDocument doc1, IxbDocument doc2) throws WTException
WTException
private static void PP(String s)
public void setImportLifeCycleAfterStore(boolean bValue)
public boolean isImportLifeCycleAfterStore()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |