wt.ixb.handlers.forclasses
Class ExpImpForBusinessEntity

java.lang.Object
  extended bywt.ixb.publicforhandlers.ClassExporterImporterTemplateGeneral
      extended bywt.ixb.publicforhandlers.ClassExporterImporterTemplate
          extended bywt.ixb.handlers.forclasses.ExpImpForBusinessEntity
All Implemented Interfaces:
ClassExporter, ClassExporterImporter, ElementImporter

public class ExpImpForBusinessEntity
extends ClassExporterImporterTemplate



Supported API: true

Extendable: false


Nested Class Summary
 
Nested classes inherited from class wt.ixb.publicforhandlers.ClassExporterImporterTemplate
ClassExporterImporterTemplate.ContentHolderCommitListener
 
Field Summary
private static String CLASSNAME
           
private static String EXPORTED_BUSINESS_ENTITY
           
private static String RESOURCE
           
 
Fields inherited from class wt.ixb.publicforhandlers.ClassExporterImporterTemplate
 
Fields inherited from class wt.ixb.publicforhandlers.ClassExporterImporterTemplateGeneral
CONFLICT_RESOURCE
 
Constructor Summary
ExpImpForBusinessEntity()
           
 
Method Summary
private  void checkConflictForAttributes(BusinessEntityDefaultView existingView, IxbElement fileXML, Importer importer)
          Check the conflicts for the BusinessEntity found from database against the XML file.
 void checkConflicts(IxbElement fileXML, Importer importer)
          

Supported API: true
private  BusinessEntityDefaultView createBusinessEntity(IxbElement fileXML, Importer importer)
          To create a brand new BusinessEntity instance and persisted into database absed on the information provided by the XML file
 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.
 Object findAmongExistingObjects(IxbElement fileXML, Importer importer)
          

Supported API: true
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.
private  BusinessEntityDefaultView getBusinessEntityDefaultViewByName(String name)
          Find the ClassificationNodeDefaultView by full path.
 int getImportPriority()
          Return the import priority of the object type represented by this import handler.
 String getObjectDisplayID(IxbElement fileXML, Importer importer)
          Return the localized identity of the element that will be used in import operation.
protected  String getRootTag()
          Returns "BusinessEntity" as the root tag of the XML file.
 Object importElement(IxbElement fileXML, Importer importer)
          Imports XML element in context given by importer parameter.
 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.
 void outputLog(Object ob, Importer importer)
          Output log for imported object.
private static void PP(String s)
           
 
Methods inherited from class wt.ixb.publicforhandlers.ClassExporterImporterTemplate
createFileXMLOnExport, exportObject, finalizeImportObject, importObjectAttributes, isObjectIgnored, isObjectNew, rememberNewObInfo, setObjectIgnored, setObjectIsNew, storeAdditionalInfo, storeElement, storeObject
 
Methods inherited from class wt.ixb.publicforhandlers.ClassExporterImporterTemplateGeneral
finalizeCheckConflicts, finalizeExport, finalizeImport, getAdditionalImportPriority, prepareForCheckConflicts, prepareForImport, previewElement
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

EXPORTED_BUSINESS_ENTITY

private static final String EXPORTED_BUSINESS_ENTITY
See Also:
Constant Field Values
Constructor Detail

ExpImpForBusinessEntity

public ExpImpForBusinessEntity()
Method Detail

getRootTag

protected String getRootTag()
Returns "BusinessEntity" as the root tag of the XML file.

Supported API: true

Overrides:
getRootTag in class ClassExporterImporterTemplate
Returns:
String

exportAttributes

protected void exportAttributes(Object object,
                                IxbDocument fileXML,
                                Exporter exporter)
                         throws WTException
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

findAmongExistingObjects

public Object findAmongExistingObjects(IxbElement fileXML,
                                       Importer importer)
                                throws WTException


Supported API: true

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

checkConflicts

public void checkConflicts(IxbElement fileXML,
                           Importer importer)
                    throws WTException


Supported API: true

Specified by:
checkConflicts in interface ElementImporter
Overrides:
checkConflicts in class ClassExporterImporterTemplateGeneral
Parameters:
fileXML -
importer -
Throws:
WTException

importElement

public Object importElement(IxbElement fileXML,
                            Importer importer)
                     throws WTException
Imports XML element in context given by importer parameter. Returns the BusinessEntityDefaultView, which might be newly created or already existed in the datastore.

Supported API: true

Specified by:
importElement in interface ElementImporter
Overrides:
importElement in class ClassExporterImporterTemplate
Parameters:
fileXML -
importer -
Returns:
Object
Throws:
WTException

createObject

public Object createObject(IxbElement fileXML,
                           Importer importer)
                    throws WTException
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

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

getBusinessEntityDefaultViewByName

private BusinessEntityDefaultView getBusinessEntityDefaultViewByName(String name)
                                                              throws WTException
Find the ClassificationNodeDefaultView by full path. If found, return the associated ClassificationNodeDefaultView; otherwise return null.

Returns:
ClassificationNodeDefaultView
Throws:
WTException

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

checkConflictForAttributes

private void checkConflictForAttributes(BusinessEntityDefaultView existingView,
                                        IxbElement fileXML,
                                        Importer importer)
                                 throws WTException
Check the conflicts for the BusinessEntity found from database against the XML file. The conflicts for soft attributes and ClassificationStruct will be checked separately.

Parameters:
existingView -
fileXML -
importer -
Throws:
WTException

createBusinessEntity

private BusinessEntityDefaultView createBusinessEntity(IxbElement fileXML,
                                                       Importer importer)
                                                throws WTException
To create a brand new BusinessEntity instance and persisted into database absed on the information provided by the XML file

Parameters:
fileXML -
importer -
Returns:
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

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

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

PP

private static void PP(String s)