Class ManifestDocument
- java.lang.Object
-
- com.priint.pubserver.metadata.xml.base.DocumentImpl
-
- com.priint.pubserver.metadata.ManifestDocument
-
- All Implemented Interfaces:
Document,java.io.Serializable
public class ManifestDocument extends DocumentImpl
JAXB class for the manifest XML document type.
JAXB class for the manifest XML document type.
The manifest document provides information about- how and when this meta data archive was created
- which files are part of this meta data archive
DocumentImpl, this means: also implements theDocumentinterface with rather detailed information about this meta data archives origin.To unserialize / unmarshall a XML file to a ManifestDocument object, you can use the following code fragment:
String filename = "manifest.xml"; // XMLUtils from PubServerSDK ManifestDocument manifest = XMLUtils.objectFromXML(new FileReader(new File(filename)), ManifestDocument.class); // ...To serialize / marshall a ManifestDocument to a XML String, you can use the following code fragment:ManifestDocument manifest; // XMLUtils from PubServerSDK. There is also a couple of variants for serializing // objects to XML in the XMLUtils class. String xml = XMLUtils.objectToXML(manifest, ManifestDocument.class);- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ManifestDocument()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddFile(File file)Adds a file to this meta data archive.java.util.List<File>getContent()Gets content of this meta data archive.GeneratorgetGenerator()Gets the generator of this meta data archive.voidremoveFile(java.lang.String fileName)Removes a file from this meta data archive.voidsetContent(java.util.List<File> content)Sets content of this meta data archive.voidsetGenerator(Generator generator)Sets the generator of this meta data archive.-
Methods inherited from class com.priint.pubserver.metadata.xml.base.DocumentImpl
getCreator, getDocumentId, getDocumentName, getDocumentPath, getElementId, getGroupId, getIsConverted, getIsMissingPlugIns, getIsModified, getIsReadOnly, getPageId, getPluginRevision, getRef, getSpreadId, getVersion, setCreator, setDocumentId, setDocumentName, setDocumentPath, setElementId, setGroupId, setIsConverted, setIsMissingPlugIns, setIsModified, setIsReadOnly, setPageId, setPluginRevision, setRef, setSpreadId, setVersion
-
-
-
-
Method Detail
-
getGenerator
public Generator getGenerator()
Gets the generator of this meta data archive.
Gets the generator of this meta data archive.
The generator is a non normative information about the component / application, which created this meta data archive. For more information seeGenerator.- Returns:
- generator of this meta data archive.
-
setGenerator
public void setGenerator(Generator generator)
Sets the generator of this meta data archive.
Sets the generator of this meta data archive.
The generator is a non normative information about the component / application, which created this meta data archive. For more information seeGenerator.- Parameters:
generator- of this meta data archive.
-
getContent
public java.util.List<File> getContent()
Gets content of this meta data archive.
Gets content of this meta data archive, i.e. the list of files contained in this archive.
SeeFilefor further information.- Returns:
- list of files contained in this meta data archive
-
setContent
public void setContent(java.util.List<File> content)
Sets content of this meta data archive.
Sets content of this meta data archive, i.e. the list of files contained in this archive.
SeeFilefor further information.- Parameters:
content- the new content
-
addFile
public void addFile(File file)
Adds a file to this meta data archive.
Adds a file to this meta data archive.
Virtually the same could be achieved withmanifest.getContent().add(file);The content list is checked for null and set to a new ArrayList if required. Note: this does not actually add a file to the archive, but only add the information, that such a file should be present to the manifest of this archive.- Parameters:
file- file to be added to this meta data archive
-
removeFile
public void removeFile(java.lang.String fileName)
Removes a file from this meta data archive.
Removes a file from this meta data archive. The file is looked up by the name provided as parameter, e.g. spreads.xml or previews/0.jpg (see
File.getName()for further information).
Note: this does not actually remove the file from the archive, but only remove the information, that such a file should be present from the manifest of this archive.
No error is reported, if such a file does not exist.- Parameters:
fileName- name of the file to be removed.
-
-