wt.ixb.publicforapps
Class Exporter

java.lang.Object
  extended bywt.ixb.publicforapps.ExpImporter
      extended bywt.ixb.publicforapps.Exporter

public class Exporter
extends ExpImporter

Exporter is the container representing export handlers for the context of the export operation. Exporter instance is not stateless and there should be only one instance for each export request.
To construct an instance of Export, use IxbHelper.newExport() with the desired signatures.
There are two major categories of methods in this class to execute export:



Supported API: true

Extendable: true


Field Summary
private  ApplicationExportHandler applicationExportHandler
           
private static String CLASSNAME
           
private  int countObjectsSkipped
           
private  int countObjectsToBeExported
           
private  int countObjectsWithoutHandler
           
protected  ExportActionTuner expActionTuner
           
private  HashSet ignoredObjectList
           
private  HashSet implicitExportList
           
private static String RESOURCE
           
private  WTContainerRef sourceContainer
           
private  HashSet updateForImplicitExportList
           
 
Fields inherited from class wt.ixb.publicforapps.ExpImporter
attributeExporterImporterManager, dtd, generalContext, ixbHandlersManager, tuner
 
Constructor Summary
(package private) Exporter(ApplicationExportHandler _applicationExportHandler, WTContainerRef _sourceContainer, String targetDTD, File localMappingRuleFile, File policyRuleFile, String actionName)
           
(package private) Exporter(ApplicationExportHandler _applicationExportHandler, WTContainerRef _sourceContainer, String targetDTD, IxbElement localMappingRules)
           
(package private) Exporter(ApplicationExportHandler _applicationExportHandler, WTContainerRef _sourceContainer, String targetDTD, IxbElement localMappingRules, File policyRuleFile, String actionName)
           
 
Method Summary
 void addIntoImplicitExportList(Object obj)
          Adds object into list of object that will be additionally exported in the end of the export process.
 IxbDocument createIxbElementForExportResult(String tag)
          Deprecated.  
 void doExport(Object obj)
          Performs export of given object under Windchill's default DTD.
 void doExport(Object obj, String targetDTD)
          Performs export of given object into given target DTD.
 void doExport(Object obj, String targetDTD, String targetElem)
          Performs export of given object into given target DTD into given element's tag.
private  void finalizeAdditionalInfo()
           
 void finalizeExport()
          Finalizes export process.
private  void finalizeImplicitExportList()
           
 ApplicationExportHandler getApplicationExportHandler()
           
 ExportActionTuner getExportActionTuner()
           
 HashSet getIgnoredObjectList()
          Returns the ignored objects for this export session.
 WTContainerRef getSourceContainerRef()
          Returns the container reference where the export is launched.
 int getTotalExportedObjects()
          Returns the number of exported objects for this export session.
 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  boolean objectShldBeIgnored(Object obj)
          Since IXB framework support the command "IGNORE_MASTER" either through system registry or from client mapping rule files, when this command is satisfied and validated, the object (e.g.
 boolean objectWillBeReallyExported(Object obj)
          Test whether the corresponding object has handler under the default DTD.
private static void PP(String s)
           
 String storeDocument(IxbDocument element)
          Applies export mapping rules and stores XML document through application handler.
 
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

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

applicationExportHandler

private ApplicationExportHandler applicationExportHandler

implicitExportList

private HashSet implicitExportList

updateForImplicitExportList

private HashSet updateForImplicitExportList

ignoredObjectList

private HashSet ignoredObjectList

countObjectsToBeExported

private int countObjectsToBeExported

countObjectsWithoutHandler

private int countObjectsWithoutHandler

countObjectsSkipped

private int countObjectsSkipped

expActionTuner

protected ExportActionTuner expActionTuner

sourceContainer

private WTContainerRef sourceContainer
Constructor Detail

Exporter

Exporter(ApplicationExportHandler _applicationExportHandler,
         WTContainerRef _sourceContainer,
         String targetDTD,
         IxbElement localMappingRules)
   throws WTException

Exporter

Exporter(ApplicationExportHandler _applicationExportHandler,
         WTContainerRef _sourceContainer,
         String targetDTD,
         IxbElement localMappingRules,
         File policyRuleFile,
         String actionName)
   throws WTException

Exporter

Exporter(ApplicationExportHandler _applicationExportHandler,
         WTContainerRef _sourceContainer,
         String targetDTD,
         File localMappingRuleFile,
         File policyRuleFile,
         String actionName)
   throws WTException
Method Detail

addIntoImplicitExportList

public void addIntoImplicitExportList(Object obj)
                               throws WTException
Adds object into list of object that will be additionally exported in the end of the export process.

Supported API: true

Parameters:
obj - object that will be additionally exported
Throws:
WTException

finalizeExport

public void finalizeExport()
                    throws WTException
Finalizes export process. Calls finalizeExport method for all export handlers.

Supported API: true

Throws:
WTException

storeDocument

public String storeDocument(IxbDocument element)
                     throws WTException
Applies export mapping rules and stores XML document through application handler. Should be used by export handlers. Return the file name (or other file id) if the element is actually stored, null otherwise.

Supported API: true

Parameters:
element - element wt.ixb.publicforapps.IxbDocument, representing the XML document, produced by export handler
Returns:
String
Throws:
WTException

doExport

public void doExport(Object obj)
              throws WTException
Performs export of given object under Windchill's default DTD.

Supported API: true

Parameters:
obj -
Throws:
WTException
See Also:
doExport (Object obj, String targetDTD)

doExport

public void doExport(Object obj,
                     String targetDTD)
              throws WTException
Performs export of given object into given target DTD. IXB service supports an ability to export object into different XML languages. To achive that export handler should be registred for given class and given XML language.

Supported API: true

Parameters:
obj -
targetDTD -
Throws:
WTException

doExport

public void doExport(Object obj,
                     String targetDTD,
                     String targetElem)
              throws WTException
Performs export of given object into given target DTD into given element's tag. IXB service supports an ability to export object into different XML languages and into different element's tag. In order to do this the export handler should be registred for given class, given XML language and given element's tag

Supported API: true

Parameters:
obj -
targetDTD -
targetElem -
Throws:
WTException

logMessage

public void logMessage(String resourceBundle,
                       String messageKey,
                       Object[] textInserts)
                throws WTException
Sends log message to export/import application

Supported API: true

Specified by:
logMessage in class ExpImporter
Parameters:
resourceBundle -
messageKey -
textInserts -
Throws:
WTException

logMessage

public void logMessage(String resourceBundle,
                       String messageKey,
                       Object[] textInserts,
                       int importanceLevel)
                throws WTException
Sends log message to export/import application

Supported API: true

Specified by:
logMessage in class ExpImporter
Parameters:
resourceBundle -
messageKey -
textInserts -
importanceLevel -
Throws:
WTException

objectWillBeReallyExported

public boolean objectWillBeReallyExported(Object obj)
                                   throws WTException
Test whether the corresponding object has handler under the default DTD.
This method is deprecated. To test an object has the corresponding export handler or not, use the method IXBHelper.service.getExportHandler (String obType, String dtd)

Throws:
WTException
See Also:


Supported API: true

finalizeImplicitExportList

private void finalizeImplicitExportList()
                                 throws WTException
Throws:
WTException

createIxbElementForExportResult

public IxbDocument createIxbElementForExportResult(String tag)
                                            throws WTException
Deprecated.  

Creates new XML document with given root element. Should be used by export handlers.

This method is deprecated.

Supported API: false

Returns:
IxbDocument
Throws:
WTException

getApplicationExportHandler

public ApplicationExportHandler getApplicationExportHandler()

getExportActionTuner

public ExportActionTuner getExportActionTuner()

getIgnoredObjectList

public HashSet getIgnoredObjectList()
Returns the ignored objects for this export session.

Supported API: true

Returns:
HashSet

getSourceContainerRef

public WTContainerRef getSourceContainerRef()
Returns the container reference where the export is launched.

Supported API: true

Returns:
WTContainerRef

objectShldBeIgnored

private boolean objectShldBeIgnored(Object obj)
                             throws WTException
Since IXB framework support the command "IGNORE_MASTER" either through system registry or from client mapping rule files, when this command is satisfied and validated, the object (e.g. WTDocument) or equivalently, the corresponding XML file will be excluded from exporting. For this reason, the associated link objects (such as WTPartUsageLink) must be egnored also in order to generate a valid jar file, otherwise during the IMPORT, null pointer exception (or similar) will be thrown because of the entity objects are ignored. Practically the command "IGNORE_MASTER" will be applied to entity objects. This method, for performance consideration, will only check the link objects in terms of null pointer exceptions.

Returns:
true if the object shld be ignored because it is linked object(s) is(are) ignored.
Throws:
WTException

finalizeAdditionalInfo

private void finalizeAdditionalInfo()
                             throws WTException
Throws:
WTException

getTotalExportedObjects

public int getTotalExportedObjects()
Returns the number of exported objects for this export session.

Supported API: true


PP

private static void PP(String s)