|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectwt.ixb.publicforhandlers.ClassExporterImporterTemplateGeneral
wt.ixb.publicforhandlers.ClassExporterImporterTemplate
Abstract class, most of standard export/import handlers extend.
This class implements some typical model of export/import process.
Supported API: true
Extendable: false
Nested Class Summary | |
protected class |
ClassExporterImporterTemplate.ContentHolderCommitListener
|
Field Summary | |
private static String |
CLASSNAME
|
private boolean |
objectIgnored
|
private boolean |
objectNew
objectNew is used for log purpose, to count how many new objects are created When a Actor create an object, or find an existing object, it will set objectNew to true or false respectively |
private static String |
RESOURCE
|
Fields inherited from class wt.ixb.publicforhandlers.ClassExporterImporterTemplateGeneral |
CONFLICT_RESOURCE |
Constructor Summary | |
ClassExporterImporterTemplate()
|
Method Summary | |
protected IxbDocument |
createFileXMLOnExport(Exporter exporter)
Creates an IxbDocument with the root tag. |
abstract Object |
createObject(IxbElement fileXML,
Importer importer)
Creates new instance of Windchill object. |
protected void |
exportAttributes(Object object,
IxbDocument fileXML,
Exporter exporter)
Export the attributes according to the DTD. |
void |
exportObject(Object object,
Exporter exporter)
Exports the specified object in context given by parameter exporter. |
Object |
finalizeImportObject(boolean objectNew,
Object object,
IxbElement fileXML,
Importer importer)
Some actions in the end of the import process. |
Object |
findAmongExistingObjects(IxbElement fileXML,
Importer importer)
Implements typical way of finding whether object from given XML file exists already in Windchill database. |
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. |
protected String |
getRootTag()
Returns the desired root tag for the object type to be exported, e.g. |
Object |
importElement(IxbElement fileXML,
Importer importer)
Imports XML element in context given by importer parameter. |
Object |
importObjectAttributes(Object object,
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 |
isObjectIgnored()
|
boolean |
isObjectNew()
|
void |
outputLog(Object ob,
Importer importer)
Output log for imported object. |
private static void |
PP(String s)
|
protected void |
rememberNewObInfo(Object ob,
IxbElement fileXML,
boolean objectNew,
Importer importer)
Implements typical way of storing information about imported object That information can be used if in import package there are other objects, referenced this one Supported API: true |
void |
setObjectIgnored(boolean ignored)
|
void |
setObjectIsNew(boolean isNew)
|
protected void |
storeAdditionalInfo(Object object,
IxbDocument fileXML,
String fileId,
Exporter exporter)
By default will do whatever processing is specified in Application handler. |
protected void |
storeElement(Object object,
IxbDocument fileXML,
Exporter exporter)
Stores the exported result fileXML IxbDocument
into an XML file
or other format accrding to the export handler ApplicationExportHandler . |
Object |
storeObject(Object object,
IxbElement fileXML,
Importer importer)
That is the general template how to store object. |
Methods inherited from class wt.ixb.publicforhandlers.ClassExporterImporterTemplateGeneral |
checkConflicts, finalizeCheckConflicts, finalizeExport, finalizeImport, getAdditionalImportPriority, getImportPriority, getObjectDisplayID, prepareForCheckConflicts, prepareForImport, previewElement |
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
private boolean objectNew
private boolean objectIgnored
Constructor Detail |
public ClassExporterImporterTemplate()
Method Detail |
public void exportObject(Object object, Exporter exporter) throws WTException
createFileXMLOnExport(Exporter exporter)
, which
create an IxbDocument
with the root tag. See getRootTag()
;
exportAttributes (Object object, IxbElement fileXML,
Exporter exporter)
which will export the attributes according
to the DTD. The parameter fileXML is the returned vlue from createFileXMLOnExport(Exporter
exporter)
.
storeElement(Object object, IxbElement fileXML, Exporter
exporter)
which will store the fileXML into an xml-file.
wt.ixb.tuner.ExportActionHelper.performPreExportAction ()
and
wt.ixb.tuner.ExportActionHelper.performPostExportAction ()
will be called before and after th above three protected methods,
respectively.
exportObject
in interface ClassExporter
exportObject
in class ClassExporterImporterTemplateGeneral
object
- exporter
- The Exporter
instance that represents the context of the export operation.
WTException
protected IxbDocument createFileXMLOnExport(Exporter exporter) throws WTException
IxbDocument
with the root tag. See getRootTag()
exporter
-
WTException
protected void exportAttributes(Object object, IxbDocument fileXML, Exporter exporter) throws WTException
createFileXMLOnExport(Exporter
exporter)
.
object
- fileXML
- exporter
-
WTException
protected void storeElement(Object object, IxbDocument fileXML, Exporter exporter) throws WTException
IxbDocument
into an XML file
or other format accrding to the export handler ApplicationExportHandler
.
object
- fileXML
- exporter
-
WTException
protected String getRootTag()
public Object importElement(IxbElement fileXML, Importer importer) throws WTException
importElement
in interface ElementImporter
importElement
in class ClassExporterImporterTemplateGeneral
fileXML
- importer
- The Importer
instance that represents the context of the import operation.
WTException
public Object findAmongExistingObjects(IxbElement fileXML, Importer importer) throws WTException
fileXML
- importer
-
WTException
public abstract Object createObject(IxbElement fileXML, Importer importer) throws WTException
fileXML
- importer
-
WTException
public Object importObjectAttributes(Object object, IxbElement fileXML, Importer importer) throws WTException
object
- fileXML
- importer
-
WTException
public Object storeObject(Object object, IxbElement fileXML, Importer importer) throws WTException
object
- fileXML
- importer
-
WTException
public Object importObjectAttributesAfterStore(Object object, IxbElement fileXML, Importer importer) throws WTException
importObjectAttributes
method
because it is called before store object.
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
object
- fileXML
- importer
-
WTException
public void setObjectIsNew(boolean isNew)
public boolean isObjectNew()
public void setObjectIgnored(boolean ignored)
public boolean isObjectIgnored()
protected void storeAdditionalInfo(Object object, IxbDocument fileXML, String fileId, Exporter exporter) throws WTException
WTException
protected void rememberNewObInfo(Object ob, IxbElement fileXML, boolean objectNew, Importer importer) throws WTException
WTException
public Object finalizeImportObject(boolean objectNew, Object object, IxbElement fileXML, Importer importer) throws WTException
WTException
public void outputLog(Object ob, Importer importer) throws WTException
ClassExporterImporterTemplateGeneral
outputLog
in interface ElementImporter
outputLog
in class ClassExporterImporterTemplateGeneral
ob
- he object for the log. It can be a new imported object or an existing one in the datastore.importer
- The Importer
instance that represents the context of the import operation.
WTException
private Object findAmongExistingObjectsForImport(IxbElement fileXML, Importer importer) throws WTException
fileXML
- importer
-
WTException
private static void PP(String s)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |