Package wt.ixb.publicforapps
Class ApplicationExportHandlerForJar
java.lang.Object
wt.ixb.publicforapps.ApplicationExportHandlerTemplate
wt.ixb.publicforapps.ApplicationExportHandlerForJar
- All Implemented Interfaces:
ApplicationExpImportHandler,ApplicationExportHandler
This class provides methods for storing XML and content files in export jar file. It handles both ApplicationData
content and content residing in local file system.
Supported API: true
Extendable: false
Supported API: true
Extendable: false
-
Constructor Summary
ConstructorsConstructorDescriptionApplicationExportHandlerForJar(File fileToSave, File dirToSave)
Supported API: true -
Method Summary
Modifier and TypeMethodDescriptionvoidaddObjectToManifest(String userObjImage) Add the localized object identifier of the object (userObjImage) to the manifest.voidDelete all files in the directory (including this directory) where is used to save the jar file.voidCreate the manifest file in the jar.voidcreateManifest(File manifestFile, String fileName) Create the manifest file in the jar.voidfinalizeExport(boolean outcome) do finalize actions before export is finished, current only call cleanTempDirGets the value of the attribute: jarFile; The jar file to store exportedinformation (meta data and content data)
Supported API: trueprotected FileGets the value of the attribute: saveDir; Directory where the jar file will be stored.voidreallyStoreContent(Object contentHolder, Exporter exporter, InputStream content, long contentSize, String contentId) Stores the given content of the content parameter "contentAttr".voidreallyStoreContent(Object contentHolder, Exporter exporter, InputStream content, String contentId) Stores the given content of the content parameter "contentAttr".voidstoreAdditionalInfo(Object object, IxbDocument fileXML, String fileId) Stores additional information related to object and its XML representation.storeContent(File contentFile) Stores content files residing in the local file system (as in the case of Representation objects).storeContent(File contentFile, String filename) Stores content files residing in the local file system (as in the case of Representation objects).storeContent(Object contentAttr) Stores the given content of exported object.storeDocument(IxbElement doc, ByteArrayOutputStream bos) Stores the given ByteArrayOutputStream, which is the XML representation of exported object, based on the provided DTD.storeDocument(IxbElement doc, String dtd) Stores the given XML element, which is the XML representation of exported object, based on the provided DTD.voidstoreLogMessage(String resourceBundle, String messageKey, Object[] textInserts) Supplies the localized log message for the application.voidstoreLogMessage(String resourceBundle, String messageKey, Object[] textInserts, int importanceLevel) Supplies the localized log message for the application.Methods inherited from class wt.ixb.publicforapps.ApplicationExportHandlerTemplate
getIXApplicationContext, getOutputs, getTargetVersion, isMultithreadedExportApplicable, setIXApplicationContext, setTargetVersion, storeDocument
-
Constructor Details
-
ApplicationExportHandlerForJar
Supported API: true- Parameters:
fileToSave- The jar file to store exportedinformation (meta data and content data)dirToSave- Directory where the jar file will be stored.- Throws:
WTException
-
-
Method Details
-
getJarFile
Gets the value of the attribute: jarFile; The jar file to store exportedinformation (meta data and content data)
Supported API: true- Overrides:
getJarFilein classApplicationExportHandlerTemplate- Returns:
- File
-
getSaveDir
Gets the value of the attribute: saveDir; Directory where the jar file will be stored.
Supported API: true- Returns:
- File
-
reallyStoreContent
public void reallyStoreContent(Object contentHolder, Exporter exporter, InputStream content, String contentId) throws WTException Stores the given content of the content parameter "contentAttr". The parameter "contentId" is the unique content ID which was previously computed and returned bystoreContent (Object contentAttr).
Supported API: true- Specified by:
reallyStoreContentin interfaceApplicationExportHandler- Overrides:
reallyStoreContentin classApplicationExportHandlerTemplate- Parameters:
contentHolder- The object holding the attribute (directly or indirectly) "contentAttr".exporter-content- The content as InputStream which is associated with the contentId.contentId- The unique content ID which was previously computed by calling "storeContent (Object contentAttr)"- Throws:
WTException
-
reallyStoreContent
public void reallyStoreContent(Object contentHolder, Exporter exporter, InputStream content, long contentSize, String contentId) throws WTException Stores the given content of the content parameter "contentAttr". The parameter "contentId" is the unique content ID which was previously computed and returned bystoreContent (Object contentAttr). *
Supported API: true- Specified by:
reallyStoreContentin interfaceApplicationExportHandler- Overrides:
reallyStoreContentin classApplicationExportHandlerTemplate- Parameters:
contentHolder- The object holding the attribute (directly or indirectly) "contentAttr".exporter-content- The content as InputStream which is associated with the contentId.contentSize- The size of content in bytes.contentId- The unique content ID which was previously computed by calling "storeContent (Object contentAttr)"- Throws:
WTException
-
storeContent
Stores content files residing in the local file system (as in the case of Representation objects).
Supported API: true- Specified by:
storeContentin interfaceApplicationExportHandler- Overrides:
storeContentin classApplicationExportHandlerTemplate- Parameters:
file-- Returns:
- String
- Throws:
WTException
-
storeContent
Stores content files residing in the local file system (as in the case of Representation objects).
Supported API: true- Specified by:
storeContentin interfaceApplicationExportHandler- Overrides:
storeContentin classApplicationExportHandlerTemplate- Parameters:
file-filename-- Returns:
- String
- Throws:
WTException
-
storeContent
Stores the given content of exported object. The return value is String, that will be used in XML file as an identifier of this content. Application should be able to find the content during the import process by this identifier. The content of the associated object might not be saved, depending on the implementation of the this interface.
Supported API: true- Specified by:
storeContentin interfaceApplicationExportHandler- Overrides:
storeContentin classApplicationExportHandlerTemplate- Parameters:
contentAttr- The content attribute which is related to InputStream or BLOB. e.g. it can beApplicationData, File or String (full path of a file), etc- Returns:
- String
- Throws:
WTException
-
storeDocument
Stores the given XML element, which is the XML representation of exported object, based on the provided DTD. If parameter dtd is null, Windchill's default DTD is assumed. Return XML file name or some other string identifier for the stored element.
Supported API: true- Specified by:
storeDocumentin interfaceApplicationExportHandler- Overrides:
storeDocumentin classApplicationExportHandlerTemplate- Parameters:
elem-dtd-- Returns:
- String
- Throws:
WTException- See Also:
-
storeDocument (IxbElement elem)
-
storeDocument
Stores the given ByteArrayOutputStream, which is the XML representation of exported object, based on the provided DTD. Return XML file name or some other string identifier for the stored element.
Supported API: true- Specified by:
storeDocumentin interfaceApplicationExportHandler- Overrides:
storeDocumentin classApplicationExportHandlerTemplate- Parameters:
elem-bos-- Returns:
- String
- Throws:
WTException- See Also:
-
storeDocument (IxbElement elem)
-
storeAdditionalInfo
public void storeAdditionalInfo(Object object, IxbDocument fileXML, String fileId) throws WTException Stores additional information related to object and its XML representation. Currently it stores information regarding the source container of the object. This method is called from the handler after object is exported.
Supported API: true- Specified by:
storeAdditionalInfoin interfaceApplicationExportHandler- Overrides:
storeAdditionalInfoin classApplicationExportHandlerTemplate- Parameters:
object-fileXML-fileId-- Throws:
WTException
-
addObjectToManifest
Add the localized object identifier of the object (userObjImage) to the manifest.
Supported API: true- Overrides:
addObjectToManifestin classApplicationExportHandlerTemplate- Parameters:
userObjImage- The localized object identifier of the object
-
cleanTempDir
Delete all files in the directory (including this directory) where is used to save the jar file. The directory was the one from the constructorApplicationExportHandlerForJar( File fileToSave, File dirToSave ).
Supported API: true *- Throws:
WTException
-
createManifest
Create the manifest file in the jar. The content of the manifest file will copy the information as accumulated by calling the methodaddObjectToManifest (String userObjImage).
Supported API: true *- Throws:
WTException
-
createManifest
Create the manifest file in the jar. The manifest file will copy the contents in theFilefile.
Supported API: true *- Overrides:
createManifestin classApplicationExportHandlerTemplate- Throws:
WTException
-
storeLogMessage
public void storeLogMessage(String resourceBundle, String messageKey, Object[] textInserts) throws WTException Supplies the localized log message for the application.
Supported API: true- Overrides:
storeLogMessagein classApplicationExportHandlerTemplate- Parameters:
resourceBundle-messageKey-textInserts-- Throws:
WTException
-
storeLogMessage
public void storeLogMessage(String resourceBundle, String messageKey, Object[] textInserts, int importanceLevel) throws WTException Supplies the localized log message for the application.
Supported API: true- Specified by:
storeLogMessagein interfaceApplicationExpImportHandler- Overrides:
storeLogMessagein classApplicationExportHandlerTemplate- Parameters:
resourceBundle-messageKey-textInserts-importanceLevel-- Throws:
WTException
-
finalizeExport
do finalize actions before export is finished, current only call cleanTempDir- Overrides:
finalizeExportin classApplicationExportHandlerTemplate- Parameters:
outcome-
Supported API: true *- Throws:
WTException
-