wt.ixb.publicforhandlers
Class ExpImpForVersionedObject

java.lang.Object
  extended bywt.ixb.publicforhandlers.ClassExporterImporterTemplateGeneral
      extended bywt.ixb.publicforhandlers.ClassExporterImporterTemplate
          extended bywt.ixb.publicforhandlers.ExpImpForVersionedObject
All Implemented Interfaces:
ClassExporter, ClassExporterImporter, ElementImporter
Direct Known Subclasses:
ExpImpForEPMDocument, ExpImpForWTDocument, ExpImpForWTDocument60, ExpImpForWTPart, ExpImpForWTPart60

public abstract class ExpImpForVersionedObject
extends ClassExporterImporterTemplate

Abstract class, most of standard export/import handlers extend. This class implements some typical model of export/import process.

Supported API: true


Nested Class Summary
 
Nested classes inherited from class wt.ixb.publicforhandlers.ClassExporterImporterTemplate
ClassExporterImporterTemplate.ContentHolderCommitListener
 
Field Summary
protected  String actionName
           
private  Actor actor
           
protected static boolean DEBUG
           
private  boolean ignoreObject
           
protected  boolean masterIsNew
           
static String NUMBER
          This method is used to get the Master of existing object, or return null if the object doesn't exist
private  String obId
           
protected  Vector targetObjs
           
 
Fields inherited from class wt.ixb.publicforhandlers.ClassExporterImporterTemplate
 
Fields inherited from class wt.ixb.publicforhandlers.ClassExporterImporterTemplateGeneral
CONFLICT_RESOURCE
 
Constructor Summary
ExpImpForVersionedObject()
           
 
Method Summary
 Versioned createEmptyObject(IxbElement fileXML, Importer importer, Mastered master)
          For restore operation we should use the existing master without creating a new master This method will eventually be made abstract to enforce sub class overwriting.
abstract  Versioned createNewObject(IxbElement fileXML, Importer importer)
           
 Object createObject(IxbElement fileXML, Importer importer)
          Creates new instance of Windchill object.
 void finalizeImport(Importer importer)
          Called in the end of the whole ipport process to execute any import process finalization.
 Object findAmongExistingObjects(IxbElement fileXML, Importer importer)
          Finds among existing objects.
private  Object findAmongExistingObjectsForImport(IxbElement fileXML, Importer importer)
          Implements typical way of finding whether object from given XML file exists already in Windchill database for import application.
 String getActionName()
           
 Folder getCheckoutFolder(String wsName, WTContainerRef target)
          Helper method to be used when Import/Export as Checked out object.
 Mastered getMaster(IxbElement fileXML, Importer importer)
           
 Mastered getMaster(IxbElement fileXML, Importer importer, WTContainerRef containerRef)
           
 String getObjectClassName()
           
 String getObjectMasterClassName()
           
 Object importElement(IxbElement fileXML, Importer importer)
          Implements typical import process

Supported API: true
 void outputLog(Object ob, Importer importer)
          Output log for imported object.
 void previewElement(IxbElement fileXML, Importer importer)
          Preview XML element in context given by importer parameter.
private static void printout(String s)
           
 void removeAllLinks(Object ob)
           
 Object storeObject(Object object, IxbElement fileXML, Importer importer)
          That is the general template how to store object.
protected  void storeObjectsBirthUfid(Object object, IxbElement fileXML, Importer importer)
          Store Ufid from XML file (if any) in the mapping table.
 Object storeVersionedObject(Object object, IxbElement fileXML, Importer importer)
          Stores object into database.
 
Methods inherited from class wt.ixb.publicforhandlers.ClassExporterImporterTemplate
createFileXMLOnExport, exportAttributes, exportObject, finalizeImportObject, getRootTag, importObjectAttributes, importObjectAttributesAfterStore, isObjectIgnored, isObjectNew, rememberNewObInfo, setObjectIgnored, setObjectIsNew, storeAdditionalInfo, storeElement
 
Methods inherited from class wt.ixb.publicforhandlers.ClassExporterImporterTemplateGeneral
checkConflicts, finalizeCheckConflicts, finalizeExport, getAdditionalImportPriority, getImportPriority, getObjectDisplayID, prepareForCheckConflicts, prepareForImport
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

actionName

protected String actionName

actor

private Actor actor

masterIsNew

protected boolean masterIsNew

DEBUG

protected static boolean DEBUG

targetObjs

protected Vector targetObjs

ignoreObject

private boolean ignoreObject

obId

private String obId

NUMBER

public static String NUMBER
This method is used to get the Master of existing object, or return null if the object doesn't exist

Constructor Detail

ExpImpForVersionedObject

public ExpImpForVersionedObject()
Method Detail

getActionName

public String getActionName()

importElement

public Object importElement(IxbElement fileXML,
                            Importer importer)
                     throws WTException
Implements typical import process

Supported API: true

Specified by:
importElement in interface ElementImporter
Overrides:
importElement in class ClassExporterImporterTemplate
Parameters:
fileXML -
importer - The Importer instance that represents the context of the import operation.
Returns:
Object
Throws:
WTException

outputLog

public void outputLog(Object ob,
                      Importer importer)
               throws WTException
Description copied from class: ClassExporterImporterTemplateGeneral
Output log for imported object.

Supported API: true

Specified by:
outputLog in interface ElementImporter
Overrides:
outputLog in class ClassExporterImporterTemplate
Throws:
WTException

storeVersionedObject

public Object storeVersionedObject(Object object,
                                   IxbElement fileXML,
                                   Importer importer)
                            throws WTException
Stores object into database. The manner of storing is decided by actionName 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

Throws:
WTException

removeAllLinks

public void removeAllLinks(Object ob)
                    throws WTException
Throws:
WTException

createNewObject

public abstract Versioned createNewObject(IxbElement fileXML,
                                          Importer importer)
                                   throws WTException
Throws:
WTException

createEmptyObject

public Versioned createEmptyObject(IxbElement fileXML,
                                   Importer importer,
                                   Mastered master)
                            throws WTException
For restore operation we should use the existing master without creating a new master This method will eventually be made abstract to enforce sub class overwriting. Each sub class has to explicitely overwrite this method so that class specific creation and initialization can be made. The method is temporarily created as a concrete method to minimize impact to all its sub classes.

Parameters:
fileXML - the xml
importer - importer
master - the master object
Returns:
Throws:
WTException

createObject

public Object createObject(IxbElement fileXML,
                           Importer importer)
                    throws WTException
Description copied from class: ClassExporterImporterTemplate
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

Specified by:
createObject in class ClassExporterImporterTemplate
Parameters:
fileXML -
importer -
Returns:
Object
Throws:
WTException

storeObject

public Object storeObject(Object object,
                          IxbElement fileXML,
                          Importer importer)
                   throws WTException
Description copied from class: ClassExporterImporterTemplate
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

Overrides:
storeObject in class ClassExporterImporterTemplate
Parameters:
object -
fileXML -
importer -
Returns:
Object
Throws:
WTException

finalizeImport

public void finalizeImport(Importer importer)
                    throws WTException
Description copied from class: ClassExporterImporterTemplateGeneral
Called in the end of the whole ipport process to execute any import process finalization.

Supported API: true

Specified by:
finalizeImport in interface ElementImporter
Overrides:
finalizeImport in class ClassExporterImporterTemplateGeneral
Parameters:
importer - The Importer instance that represents the context of the import operation.
Throws:
WTException

printout

private static void printout(String s)

previewElement

public void previewElement(IxbElement fileXML,
                           Importer importer)
                    throws WTException
Description copied from class: ClassExporterImporterTemplateGeneral
Preview XML element in context given by importer parameter. Usually it will check conflicts without performing real import.

Supported API: true

Specified by:
previewElement in interface ElementImporter
Overrides:
previewElement in class ClassExporterImporterTemplateGeneral
Parameters:
fileXML - the XML element to be imported.
importer - The Importer instance that represents the context of the import operation.
Throws:
WTException

findAmongExistingObjects

public Object findAmongExistingObjects(IxbElement fileXML,
                                       Importer importer)
                                throws WTException
Finds among existing objects.

Different mechanisms are used (UFID vs. OID) to locate the existing object based upon the application context (import vs. restore).

Overrides:
findAmongExistingObjects in class ClassExporterImporterTemplate
Parameters:
fileXML -
importer -
Returns:
object found
Throws:
WTException

findAmongExistingObjectsForImport

private Object findAmongExistingObjectsForImport(IxbElement fileXML,
                                                 Importer importer)
                                          throws WTException
Description copied from class: ClassExporterImporterTemplate
Implements typical way of finding whether object from given XML file exists already in Windchill database for import application.

Throws:
WTException

getObjectClassName

public String getObjectClassName()

getObjectMasterClassName

public String getObjectMasterClassName()

getMaster

public Mastered getMaster(IxbElement fileXML,
                          Importer importer)
                   throws WTException
Throws:
WTException

getMaster

public Mastered getMaster(IxbElement fileXML,
                          Importer importer,
                          WTContainerRef containerRef)
                   throws WTException
Throws:
WTException

getCheckoutFolder

public Folder getCheckoutFolder(String wsName,
                                WTContainerRef target)
                         throws WTException
Helper method to be used when Import/Export as Checked out object. It should be overriddden by class handlers which need to checkout to some alternative place, e.g. EPM Workspace

Parameters:
wsName - Is ignored (to be used for EPM ch-out)
target - Is ignored (to be used for EPM ch-out)
Returns:
personal check out folder (e.g /Checked Out )
Throws:
WTException

storeObjectsBirthUfid

protected void storeObjectsBirthUfid(Object object,
                                     IxbElement fileXML,
                                     Importer importer)
                              throws WTException
Store Ufid from XML file (if any) in the mapping table.

Throws:
WTException