Class OdfOfficeMeta
OdfOfficeMeta represent the meta data feature in the ODF document.
It provides convenient method to get meta data info.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddKeyword(String keyword) Add the keyword to the current document.Receives the OdfMetaAutoReload feature.Receives the value of the ODFDOM element representationMetaCreationDateElement, See <meta:creation-date>Receives the value of the ODFDOM element representationDcCreatorElement, See <dc:creator>getDate()Receives the value of the ODFDOM element representationDcDateElement, See <dc:date>.Receives the value of the ODFDOM element representationDcDescriptionElement, See <dc:description>.Receives the sub feature of OdfMetaDocumentStatistic.Receives the value of the ODFDOM element representationMetaEditingCyclesElement, See <meta:editing-cycles>.Receives the value of the ODFDOM element representationMetaEditingDurationElement, See <meta:editing-duration>.Receives the value of the ODFDOM element representationMetaGeneratorElement, See <meta:generator>.Receives the OdfMetaHyperlinkBehaviour feature.Receives the value of the ODFDOM element representationMetaInitialCreatorElement, See <meta:initial-creator>.Receives the list value of the ODFDOM element representationMetaKeywordElement, See <meta:keyword>.Receives the value of the ODFDOM element representationDcLanguageElement, See <dc:language>.Get the instance ofOfficeMetaElementwhich represents this feature.Receives the value of the ODFDOM element representationMetaPrintDateElement, See <meta:print-date>.Receives the value of the ODFDOM element representationMetaPrintedByElement, See <meta:printed-by>Receives the value of the ODFDOM element representationDcSubjectElement, See <dc:subject>.Receives the OdfMetaTemplate feature.getTitle()Receives the value of the ODFDOM element representationDcTitleElement, See <dc:title>.Receives the list value of the ODFDOM element representationMetaUserDefinedElement, See <meta:user-defined>.getUserDefinedDataType(String name) Receives the data type of the ODFDOM element representationMetaUserDefinedElementby attribute name, See <meta:user-defined>.Receives the value of the ODFDOM element representationMetaUserDefinedElementby attribute name, See <meta:user-defined>.Receives the ODFDOM element representationMetaUserDefinedElementby attribute name, See <meta:user-defined>.booleanvoidRemove the ODFDOM element representationMetaUserDefinedElementby attribute name, See <meta:user-defined>.voidsetAutomaticUpdate(boolean enableAutomaticUpdate) voidsetCreationDate(Calendar creationDate) Sets the value of the ODFDOM element representationMetaCreationDateElement, See <meta:creation-date>.voidsetCreator(String creator) Sets the value of the ODFDOM element representationDcCreatorElement, See <dc:creator>.voidSets the value of the ODFDOM element representationDcDateElement, See <dc:date>.voidsetDescription(String description) Sets the value of the ODFDOM element representationDcDescriptionElement, See <dc:description>.voidsetEditingCycles(Integer editingCycles) Sets the value of the ODFDOM element representationMetaEditingCyclesElement, See <meta:editing-cycles>.voidsetEditingDuration(Duration editingDuration) Sets the value of the ODFDOM element representationMetaEditingDurationElement, See <meta:editing-duration>.voidsetGenerator(String generator) Sets the value of the ODFDOM element representationMetaGeneratorElement, See <meta:generator>.voidsetInitialCreator(String initialCreator) Sets the value of the ODFDOM element representationMetaInitialCreatorElement, See <meta:initial-creator>.voidsetKeywords(List<String> keyList) Sets the list value of the ODFDOM element representationMetaKeywordElement, See <meta:keyword>.voidsetLanguage(String language) Sets the value of the ODFDOM element representationDcLanguageElement, See <dc:language>.voidsetPrintDate(Calendar printDate) Sets the value of the ODFDOM element representationMetaPrintDateElement, See <meta:print-date>.voidsetPrintedBy(String printedBy) Sets the value of the ODFDOM element representationMetaPrintedByElement, See <meta:printed-by>.voidsetSubject(String subject) Sets the value of the ODFDOM element representationDcSubjectElement, See <dc:subject>.voidSets the value of the ODFDOM element representationDcTitleElement, See <dc:title>.voidsetUserDefinedData(String name, String type, String value) Sets the ODFDOM element representationMetaUserDefinedElement, See <meta:user-defined> if the element with the attribute name exists,then update;or create a new element if type or value is null,the original will not be updated.voidsetUserDefinedDataType(String name, String value) Sets the data type of the ODFDOM element representationMetaUserDefinedElementby attribute name, See <meta:user-defined>.voidsetUserDefinedDataValue(String name, String value) Sets the value of the ODFDOM element representationMetaUserDefinedElementby attribute name, See <meta:user-defined>.toString()
-
Constructor Details
-
OdfOfficeMeta
Constructor ofOdfOfficeMetafeature.- Parameters:
metaDom- the file DOM element of meta.xml
-
-
Method Details
-
getOfficeMetaElement
Get the instance ofOfficeMetaElementwhich represents this feature.- Returns:
- the instance of OfficeMetaElement
-
getGenerator
Receives the value of the ODFDOM element representationMetaGeneratorElement, See <meta:generator>.- Returns:
- the generator info of the current document;
null, if the element is not set.
-
setGenerator
Sets the value of the ODFDOM element representationMetaGeneratorElement, See <meta:generator>.- Parameters:
generator- set the specified document generator. NULL will remove the element from the meta.xml.
-
getTitle
Receives the value of the ODFDOM element representationDcTitleElement, See <dc:title>.- Returns:
- the title of the current document;
null, if the element is not set.
-
setTitle
Sets the value of the ODFDOM element representationDcTitleElement, See <dc:title>.- Parameters:
title- set the specified document title. NULL will remove the element from the meta.xml.
-
getDescription
Receives the value of the ODFDOM element representationDcDescriptionElement, See <dc:description>.- Returns:
- the description of the current document;
null, if the element is not set.
-
setDescription
Sets the value of the ODFDOM element representationDcDescriptionElement, See <dc:description>.- Parameters:
description- set the specified document description. NULL will remove the element from the meta.xml.
-
getSubject
Receives the value of the ODFDOM element representationDcSubjectElement, See <dc:subject>.- Returns:
- the subject of the current document;
null, if the element is not set.
-
setSubject
Sets the value of the ODFDOM element representationDcSubjectElement, See <dc:subject>.- Parameters:
subject- set the specified document subject. NULL will remove the element from the meta.xml.
-
getKeywords
Receives the list value of the ODFDOM element representationMetaKeywordElement, See <meta:keyword>.- Returns:
- the keywords of the current document;
null, if the element is not set.
-
setKeywords
Sets the list value of the ODFDOM element representationMetaKeywordElement, See <meta:keyword>.- Parameters:
keyList- set the specified list of keywords
-
addKeyword
Add the keyword to the current document. Create child element <meta:keyword>.- Parameters:
keyword- the value of child element <meta:keyword>.
-
getUserDefinedDataNames
Receives the list value of the ODFDOM element representationMetaUserDefinedElement, See <meta:user-defined>.- Returns:
- get the list of user-defined metadata names;
null, if the element is not set.
-
getUserDefinedElementByAttributeName
Receives the ODFDOM element representationMetaUserDefinedElementby attribute name, See <meta:user-defined>.- Parameters:
name- the name of the user-defined metadata- Returns:
- the
MetaUserDefinedElementwhich is identified by the specified name;null, if the element is not set.
-
getUserDefinedDataValue
Receives the value of the ODFDOM element representationMetaUserDefinedElementby attribute name, See <meta:user-defined>.- Parameters:
name- the name of the user-defined metadata- Returns:
- the value of the user-defined metadata with the specified name;
null, if the element is not set.
-
getUserDefinedDataType
Receives the data type of the ODFDOM element representationMetaUserDefinedElementby attribute name, See <meta:user-defined>.- Parameters:
name- the name of the user-defined metadata- Returns:
- the data type of the user-defined metadata with the specified name;
null, if the element is not set.
-
removeUserDefinedDataByName
Remove the ODFDOM element representationMetaUserDefinedElementby attribute name, See <meta:user-defined>.- Parameters:
name- the name of the user-defined metadata
-
setUserDefinedDataValue
Sets the value of the ODFDOM element representationMetaUserDefinedElementby attribute name, See <meta:user-defined>.- Parameters:
name- the name need to set for the user-defined metadatavalue- the value need to set for the user-defined metadata
-
setUserDefinedDataType
Sets the data type of the ODFDOM element representationMetaUserDefinedElementby attribute name, See <meta:user-defined>.- Parameters:
name- the name need to set for the user-defined metadatavalue- the value need to set for the user-defined metadata
-
setUserDefinedData
Sets the ODFDOM element representationMetaUserDefinedElement, See <meta:user-defined> if the element with the attribute name exists,then update;or create a new element if type or value is null,the original will not be updated.- Parameters:
name- the name need to set for the user-defined metadatatype- the data type need to set for the user-defined metadatavalue- the value need to set for the user-defined metadata
-
getInitialCreator
Receives the value of the ODFDOM element representationMetaInitialCreatorElement, See <meta:initial-creator>.- Returns:
- get the initial creator of the current document;
null, if the element is not set.
-
setInitialCreator
Sets the value of the ODFDOM element representationMetaInitialCreatorElement, See <meta:initial-creator>.- Parameters:
initialCreator- set the specified initial creator. NULL will remove the element from the meta.xml.
-
getCreator
Receives the value of the ODFDOM element representationDcCreatorElement, See <dc:creator>- Returns:
- the creator of the current document;
null, if the element is not set.
-
setCreator
Sets the value of the ODFDOM element representationDcCreatorElement, See <dc:creator>.- Parameters:
creator- set the specified creator. NULL will remove the element from the meta.xml.
-
getPrintedBy
Receives the value of the ODFDOM element representationMetaPrintedByElement, See <meta:printed-by>- Returns:
- the name of the last person who printed the current document;
null, if element is not set
-
setPrintedBy
Sets the value of the ODFDOM element representationMetaPrintedByElement, See <meta:printed-by>.- Parameters:
printedBy- the name need to set for the last person who printed the current document. NULL will remove the element from the meta.xml.
-
getCreationDate
Receives the value of the ODFDOM element representationMetaCreationDateElement, See <meta:creation-date>- Returns:
- the date and time when the document was created initially;
null, if element is not set
-
setCreationDate
Sets the value of the ODFDOM element representationMetaCreationDateElement, See <meta:creation-date>.- Parameters:
creationDate- the date and time need to set. NULL will remove the element from the meta.xml.
-
getDate
Receives the value of the ODFDOM element representationDcDateElement, See <dc:date>.- Returns:
- the date and time when the document was last modified;
null, if the element is not set.
-
setDate
Sets the value of the ODFDOM element representationDcDateElement, See <dc:date>.- Parameters:
date- the date and time need to set. NULL will remove the element from the meta.xml.
-
getPrintDate
Receives the value of the ODFDOM element representationMetaPrintDateElement, See <meta:print-date>.- Returns:
- the date and time when the document was last printed;
null, if the element is not set.
-
setPrintDate
Sets the value of the ODFDOM element representationMetaPrintDateElement, See <meta:print-date>.- Parameters:
printDate- the date and time need to set. NULL will remove the element from the meta.xml.
-
getLanguage
Receives the value of the ODFDOM element representationDcLanguageElement, See <dc:language>.- Returns:
- the default language of the document;
null, if the element is not set.
-
setLanguage
Sets the value of the ODFDOM element representationDcLanguageElement, See <dc:language>.- Parameters:
language- the default language need to set fo the current document. NULL will remove the element from the meta.xml.
-
getEditingCycles
Receives the value of the ODFDOM element representationMetaEditingCyclesElement, See <meta:editing-cycles>.- Returns:
- the number of times that the document has been edited;
null, if the element is not set.
-
setEditingCycles
Sets the value of the ODFDOM element representationMetaEditingCyclesElement, See <meta:editing-cycles>.- Parameters:
editingCycles- set the specified edit times. NULL will remove the element from the meta.xml.
-
getEditingDuration
Receives the value of the ODFDOM element representationMetaEditingDurationElement, See <meta:editing-duration>.- Returns:
- the total time spent editing the document;
null, if the element is not set.
-
setEditingDuration
Sets the value of the ODFDOM element representationMetaEditingDurationElement, See <meta:editing-duration>.- Parameters:
editingDuration- the time need to set. NULL will remove the element from the meta.xml.
-
getDocumentStatistic
Receives the sub feature of OdfMetaDocumentStatistic.- Returns:
- the statistics about the document which can be represented by
OdfMetaDocumentStatisticfeature;null, if the feature is not exist.
-
getHyperlinkBehaviour
Receives the OdfMetaHyperlinkBehaviour feature.- Returns:
- the default behavior of hyperlinks in the current document which can be represented by
OdfMetaHyperlinkBehaviourfeature;null, if the feature is not exist.
-
getAutoReload
Receives the OdfMetaAutoReload feature.- Returns:
- the information whether the document is reloaded or replaced by another document after
a certain period of time has elapsed.
It can be represented by
OdfMetaAutoReloadfeature;null, if the feature is not exist.
-
getTemplate
Receives the OdfMetaTemplate feature.- Returns:
- the information specified the URL for the document that was used to create a document.
It can be represented by
OdfMetaTemplatefeature;null, if the feature is not exist.
-
setAutomaticUpdate
public void setAutomaticUpdate(boolean enableAutomaticUpdate) - Parameters:
enableAutomaticUpdate- If the automatic update of metadata is enabled, metadata such as last modified data is set during saving the document. The default istrue, disabling the default allows to load and save a document without changing any data.
-
hasAutomaticUpdate
public boolean hasAutomaticUpdate()- Returns:
- If the automatic update of metadata is enabled, metadata such as last modified data is
set during saving the document. The default is
true, disabling the default allows to load and save a document without changing any data.
-
toString
-