Class ManifestDocument
- All Implemented Interfaces:
Document,Serializable
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 the Document
interface 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:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a file to this meta data archive.Gets content of this meta data archive.Gets the generator of this meta data archive.voidremoveFile(String fileName) Removes a file from this meta data archive.voidsetContent(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
-
Constructor Details
-
ManifestDocument
public ManifestDocument()
-
-
Method Details
-
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
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
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
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
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
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.
-