wt.ixb.handlers.forclasses
Class ExpImpForWTDocument

java.lang.Object
  extended bywt.ixb.publicforhandlers.ClassExporterImporterTemplateGeneral
      extended bywt.ixb.publicforhandlers.ClassExporterImporterTemplate
          extended bywt.ixb.publicforhandlers.ExpImpForVersionedObject
              extended bywt.ixb.handlers.forclasses.ExpImpForWTDocument
All Implemented Interfaces:
ClassExporter, ClassExporterImporter, ElementImporter, ExpImpOfObjectRefIfc, ExpOfObjectRefIfc, ImpOfObjectRefIfc
Direct Known Subclasses:
NmWTDocumentHandler

public class ExpImpForWTDocument
extends ExpImpForVersionedObject
implements ExpImpOfObjectRefIfc


Nested Class Summary
 
Nested classes inherited from class wt.ixb.publicforhandlers.ClassExporterImporterTemplate
ClassExporterImporterTemplate.ContentHolderCommitListener
 
Field Summary
 
Fields inherited from class wt.ixb.publicforhandlers.ExpImpForVersionedObject
actionName, DEBUG, masterIsNew, NUMBER, targetObjs
 
Fields inherited from class wt.ixb.publicforhandlers.ClassExporterImporterTemplate
 
Fields inherited from class wt.ixb.publicforhandlers.ClassExporterImporterTemplateGeneral
CONFLICT_RESOURCE
 
Constructor Summary
ExpImpForWTDocument()
           
 
Method Summary
 void checkConflicts(IxbElement fileXML, Importer importer)
          Checks conflicts that can arise while import process.
 Versioned createEmptyObject(IxbElement fileXML, Importer importer, Mastered master)
          Creates an empty object with the specified master and sets related attributes based upon values in the xml archive.
 Versioned createNewObject(IxbElement fileXML, Importer importer)
           
protected  void exportAttributes(Object object, IxbDocument fileXML, Exporter exporter)
          Export the attributes according to the DTD.
protected  void exportCommonAttributes(Object ob, IxbElement fileXML, Exporter exporter, boolean exportOnlyReference)
           
 void exportObjectRef(Object object, IxbElement element, Exporter exporter)
           
 Object findObjectFromXML(IxbElement element, Importer importer)
           
 int getImportPriority()
          Return the import priority of the object type represented by this import handler.
 String getObjectClassName()
           
 String getObjectDisplayID(IxbElement fileXML, Importer importer)
          Return the localized identity of the element that will be used in import operation.
 String getObjectMasterClassName()
           
protected  String getRootTag()
          Returns the desired root tag for the object type to be exported, e.g.
 Object importObjectAttributes(Object ob, IxbElement fileXML, Importer importer)
          Imports class specific atributes from the XML file.
 Object importObjectAttributesAfterStore(Object object, IxbElement fileXML, Importer importer)
          Imports class specific atributes 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.
 boolean objectExistPriorImport(IxbElement element, Importer importer)
           
private static void PP(String s)
           
private static void printout(String s)
           
 
Methods inherited from class wt.ixb.publicforhandlers.ExpImpForVersionedObject
createObject, finalizeImport, findAmongExistingObjects, getActionName, getCheckoutFolder, getMaster, getMaster, importElement, outputLog, previewElement, removeAllLinks, storeObject, storeObjectsBirthUfid, storeVersionedObject
 
Methods inherited from class wt.ixb.publicforhandlers.ClassExporterImporterTemplate
createFileXMLOnExport, exportObject, finalizeImportObject, isObjectIgnored, isObjectNew, rememberNewObInfo, setObjectIgnored, setObjectIsNew, storeAdditionalInfo, storeElement
 
Methods inherited from class wt.ixb.publicforhandlers.ClassExporterImporterTemplateGeneral
finalizeCheckConflicts, finalizeExport, getAdditionalImportPriority, prepareForCheckConflicts, prepareForImport
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExpImpForWTDocument

public ExpImpForWTDocument()
Method Detail

getRootTag

protected String getRootTag()
Description copied from class: ClassExporterImporterTemplate
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

Overrides:
getRootTag in class ClassExporterImporterTemplate
Returns:
String

exportAttributes

protected void exportAttributes(Object object,
                                IxbDocument fileXML,
                                Exporter exporter)
                         throws WTException
Description copied from class: ClassExporterImporterTemplate
Export the attributes according to the DTD. The parameter fileXML is the returned vlue from the method createFileXMLOnExport(Exporter exporter).

Supported API: true

Overrides:
exportAttributes in class ClassExporterImporterTemplate
Parameters:
object -
fileXML -
exporter -
Throws:
WTException

checkConflicts

public void checkConflicts(IxbElement fileXML,
                           Importer importer)
                    throws WTException
Description copied from class: ClassExporterImporterTemplateGeneral
Checks conflicts that can arise while import process.

Supported API: true

Specified by:
checkConflicts in interface ElementImporter
Overrides:
checkConflicts 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

getObjectClassName

public String getObjectClassName()
Overrides:
getObjectClassName in class ExpImpForVersionedObject

getObjectMasterClassName

public String getObjectMasterClassName()
Overrides:
getObjectMasterClassName in class ExpImpForVersionedObject

createNewObject

public Versioned createNewObject(IxbElement fileXML,
                                 Importer importer)
                          throws WTException
Specified by:
createNewObject in class ExpImpForVersionedObject
Throws:
WTException

importObjectAttributes

public Object importObjectAttributes(Object ob,
                                     IxbElement fileXML,
                                     Importer importer)
                              throws WTException
Description copied from class: ClassExporterImporterTemplate
Imports class specific atributes 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 ansector

Supported API: true

Overrides:
importObjectAttributes in class ClassExporterImporterTemplate
Parameters:
ob -
fileXML -
importer -
Returns:
Object
Throws:
WTException

importObjectAttributesAfterStore

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

Supported API: true

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

getImportPriority

public int getImportPriority()
                      throws WTException
Description copied from class: ClassExporterImporterTemplateGeneral
Return the import priority of the object type represented by this import handler.
Import priority defines the order in which objects will be imported. This method does not carry parameters in the signature. The return value can not be negative. Those XML files will have a higher import priority for smaller returned values.

Supported API: true

Specified by:
getImportPriority in interface ElementImporter
Specified by:
getImportPriority in class ClassExporterImporterTemplateGeneral
Returns:
int
Throws:
WTException

PP

private static void PP(String s)

getObjectDisplayID

public String getObjectDisplayID(IxbElement fileXML,
                                 Importer importer)
                          throws WTException
Description copied from class: ClassExporterImporterTemplateGeneral
Return the localized identity of the element that will be used in import operation. This is mostly for localized log purpose.

Supported API: true

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

findObjectFromXML

public Object findObjectFromXML(IxbElement element,
                                Importer importer)
                         throws WTException
Specified by:
findObjectFromXML in interface ImpOfObjectRefIfc
Throws:
WTException

objectExistPriorImport

public boolean objectExistPriorImport(IxbElement element,
                                      Importer importer)
                               throws WTException
Specified by:
objectExistPriorImport in interface ImpOfObjectRefIfc
Throws:
WTException

exportObjectRef

public void exportObjectRef(Object object,
                            IxbElement element,
                            Exporter exporter)
                     throws WTException
Specified by:
exportObjectRef in interface ExpOfObjectRefIfc
Throws:
WTException

createEmptyObject

public Versioned createEmptyObject(IxbElement fileXML,
                                   Importer importer,
                                   Mastered master)
                            throws WTException
Creates an empty object with the specified master and sets related attributes based upon values in the xml archive. This is used for restore operation where the master typically exists.

Overrides:
createEmptyObject in class ExpImpForVersionedObject
Parameters:
fileXML - the xml
importer - the importer
master - the existing master
Returns:
the newly created object
Throws:
WTException - when the operation fails

exportCommonAttributes

protected void exportCommonAttributes(Object ob,
                                      IxbElement fileXML,
                                      Exporter exporter,
                                      boolean exportOnlyReference)
                               throws WTException
Throws:
WTException

printout

private static void printout(String s)