|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectwt.ixb.publicforapps.ApplicationExportHandlerTemplate
wt.ixb.publicforapps.ApplicationExportHandlerForJar
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
Field Summary | |
private static String |
CLASSNAME
|
private Map |
containerMap
|
private HashSet |
contentFileNames
|
static String |
CONTENTS_DIR_NAME
Supported API: false |
private int |
fileNum
|
private TreeMap |
filesMap
|
private File |
jarFile
|
private IXBJarWriter |
jarWriter
|
private HashSet |
manifestInfos
|
static String |
NAME_IS_TAG
Supported API: false |
private static String |
RESOURCE
|
private File |
saveDir
|
Fields inherited from interface wt.ixb.publicforapps.ApplicationExpImportHandler |
IMPORTANCE_LEVEL_DEFAULT |
Constructor Summary | |
ApplicationExportHandlerForJar(File fileToSave,
File dirToSave)
Supported API: true |
Method Summary | |
private void |
addFileNameToImportList(IxbElement doc,
String fn)
|
void |
addObjectToManifest(String userObjImage)
Add the localized object identifier of the object (userObjImage) to the manifest. |
void |
cleanTempDir()
Delete all files in the directory (including this directory) where is used to save the jar file. |
protected String |
computeUniqueFileName(String fn)
|
void |
createManifest()
Create the manifest file in the jar. |
void |
createManifest(File manifestFile)
Create the manifest file in the jar. |
void |
finalizeAdditionalInfo()
Supported API: true |
private void |
finalizeContainerInfo()
|
private void |
finalizeImportList()
|
File |
getJarFile()
Gets the value of the attribute: jarFile; The jar file to store exportedinformation (meta data and content data) Supported API: true |
IXBJarWriter |
getJarWriter()
Gets the value of the attribute: jarWriter. |
protected File |
getSaveDir()
Gets the value of the attribute: saveDir; Directory where the jar file will be stored. |
protected String |
prepareStoreApplicationData(ApplicationData ad)
|
private String |
prepareStoreExternalFile(String externalFileName)
|
private String |
prepareStoreImageHolder(ImageHolder contentAttr)
|
void |
reallyStoreContent(Object contentHolder,
Exporter exporter,
InputStream content,
String contentId)
Stores the given content of the content parameter "contentAttr". |
void |
storeAdditionalInfo(Object object,
IxbDocument fileXML,
String fileId)
Stores additional information related to object and its XML representation. |
String |
storeContent(File contentFile)
Stores content files residing in the local file system (as in the case of Representation objects). |
protected String |
storeContent(InputStream is,
String fn)
|
String |
storeContent(Object contentAttr)
Stores the given content of exported object. |
String |
storeDocument(IxbElement doc,
String dtd)
Stores the given XML element, which is the XML representation of exported object, based on the provided DTD. |
Methods inherited from class wt.ixb.publicforapps.ApplicationExportHandlerTemplate |
storeDocument, storeLogMessage, storeLogMessage |
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
public static final String NAME_IS_TAG
public static final String CONTENTS_DIR_NAME
private File jarFile
private IXBJarWriter jarWriter
private File saveDir
private int fileNum
private HashSet contentFileNames
private HashSet manifestInfos
private Map containerMap
private TreeMap filesMap
Constructor Detail |
public ApplicationExportHandlerForJar(File fileToSave, File dirToSave) throws WTException
fileToSave
- The jar file to store exportedinformation (meta data and content data)dirToSave
- Directory where the jar file will be stored.
WTException
Method Detail |
public File getJarFile()
public IXBJarWriter getJarWriter()
protected File getSaveDir()
public void reallyStoreContent(Object contentHolder, Exporter exporter, InputStream content, String contentId) throws WTException
storeContent (Object contentAttr)
.
reallyStoreContent
in interface ApplicationExportHandler
reallyStoreContent
in class ApplicationExportHandlerTemplate
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)"
WTException
public String storeContent(File contentFile) throws WTException
storeContent
in interface ApplicationExportHandler
storeContent
in class ApplicationExportHandlerTemplate
contentFile
-
WTException
public String storeContent(Object contentAttr) throws WTException
storeContent
in interface ApplicationExportHandler
storeContent
in class ApplicationExportHandlerTemplate
contentAttr
- The content attribute which is related to InputStream or BLOB. e.g. it can be ApplicationData
, File or String (full path of a file), etc
WTException
public String storeDocument(IxbElement doc, String dtd) throws WTException
storeDocument
in interface ApplicationExportHandler
storeDocument
in class ApplicationExportHandlerTemplate
dtd
- doc
-
WTException
storeDocument (IxbElement elem)
private void addFileNameToImportList(IxbElement doc, String fn) throws WTException
WTException
public void finalizeAdditionalInfo() throws WTException
ApplicationExportHandlerTemplate
finalizeAdditionalInfo
in interface ApplicationExportHandler
finalizeAdditionalInfo
in class ApplicationExportHandlerTemplate
WTException
public void storeAdditionalInfo(Object object, IxbDocument fileXML, String fileId) throws WTException
storeAdditionalInfo
in interface ApplicationExportHandler
storeAdditionalInfo
in class ApplicationExportHandlerTemplate
object
- fileXML
- fileId
-
WTException
public void addObjectToManifest(String userObjImage)
userObjImage
- The localized object identifier of the objectpublic void cleanTempDir() throws WTException
ApplicationExportHandlerForJar( File fileToSave, File dirToSave )
.
WTException
public void createManifest() throws WTException
addObjectToManifest (String userObjImage)
.
WTException
public void createManifest(File manifestFile) throws WTException
File
file.
WTException
protected String computeUniqueFileName(String fn) throws IOException
IOException
protected String storeContent(InputStream is, String fn) throws IOException
IOException
private void finalizeImportList() throws WTException
WTException
private void finalizeContainerInfo() throws WTException
WTException
protected String prepareStoreApplicationData(ApplicationData ad) throws WTException
WTException
private String prepareStoreExternalFile(String externalFileName) throws WTException
WTException
private String prepareStoreImageHolder(ImageHolder contentAttr) throws WTException
WTException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |