Class OdfOfficeMeta
- java.lang.Object
-
- org.odftoolkit.odfdom.incubator.meta.OdfOfficeMeta
-
public class OdfOfficeMeta extends Object
OdfOfficeMeta
represent the meta data feature in the ODF document.It provides convenient method to get meta data info.
-
-
Constructor Summary
Constructors Constructor Description OdfOfficeMeta(OdfFileDom metaDom)
Constructor ofOdfOfficeMeta
feature.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addKeyword(String keyword)
Add the keyword to the current document.OdfMetaAutoReload
getAutoReload()
Receives the OdfMetaAutoReload feature.Calendar
getCreationDate()
Receives the value of the ODFDOM element representationMetaCreationDateElement
, See <meta:creation-date>String
getCreator()
Receives the value of the ODFDOM element representationDcCreatorElement
, See <dc:creator>Calendar
getDate()
Receives the value of the ODFDOM element representationDcDateElement
, See <dc:date>.String
getDescription()
Receives the value of the ODFDOM element representationDcDescriptionElement
, See <dc:description>.OdfMetaDocumentStatistic
getDocumentStatistic()
Receives the sub feature of OdfMetaDocumentStatistic.Integer
getEditingCycles()
Receives the value of the ODFDOM element representationMetaEditingCyclesElement
, See <meta:editing-cycles>.Duration
getEditingDuration()
Receives the value of the ODFDOM element representationMetaEditingDurationElement
, See <meta:editing-duration>.String
getGenerator()
Receives the value of the ODFDOM element representationMetaGeneratorElement
, See <meta:generator>.OdfMetaHyperlinkBehaviour
getHyperlinkBehaviour()
Receives the OdfMetaHyperlinkBehaviour feature.String
getInitialCreator()
Receives the value of the ODFDOM element representationMetaInitialCreatorElement
, See <meta:initial-creator>.List<String>
getKeywords()
Receives the list value of the ODFDOM element representationMetaKeywordElement
, See <meta:keyword>.String
getLanguage()
Receives the value of the ODFDOM element representationDcLanguageElement
, See <dc:language>.OfficeMetaElement
getOfficeMetaElement()
Get the instance ofOfficeMetaElement
which represents this feature.Calendar
getPrintDate()
Receives the value of the ODFDOM element representationMetaPrintDateElement
, See <meta:print-date>.String
getPrintedBy()
Receives the value of the ODFDOM element representationMetaPrintedByElement
, See <meta:printed-by>String
getSubject()
Receives the value of the ODFDOM element representationDcSubjectElement
, See <dc:subject>.OdfMetaTemplate
getTemplate()
Receives the OdfMetaTemplate feature.String
getTitle()
Receives the value of the ODFDOM element representationDcTitleElement
, See <dc:title>.List<String>
getUserDefinedDataNames()
Receives the list value of the ODFDOM element representationMetaUserDefinedElement
, See <meta:user-defined>.String
getUserDefinedDataType(String name)
Receives the data type of the ODFDOM element representationMetaUserDefinedElement
by attribute name, See <meta:user-defined>.String
getUserDefinedDataValue(String name)
Receives the value of the ODFDOM element representationMetaUserDefinedElement
by attribute name, See <meta:user-defined>.MetaUserDefinedElement
getUserDefinedElementByAttributeName(String name)
Receives the ODFDOM element representationMetaUserDefinedElement
by attribute name, See <meta:user-defined>.boolean
hasAutomaticUpdate()
void
removeUserDefinedDataByName(String name)
Remove the ODFDOM element representationMetaUserDefinedElement
by attribute name, See <meta:user-defined>.void
setAutomaticUpdate(boolean enableAutomaticUpdate)
void
setCreationDate(Calendar creationDate)
Sets the value of the ODFDOM element representationMetaCreationDateElement
, See <meta:creation-date>.void
setCreator(String creator)
Sets the value of the ODFDOM element representationDcCreatorElement
, See <dc:creator>.void
setDate(Calendar date)
Sets the value of the ODFDOM element representationDcDateElement
, See <dc:date>.void
setDescription(String description)
Sets the value of the ODFDOM element representationDcDescriptionElement
, See <dc:description>.void
setEditingCycles(Integer editingCycles)
Sets the value of the ODFDOM element representationMetaEditingCyclesElement
, See <meta:editing-cycles>.void
setEditingDuration(Duration editingDuration)
Sets the value of the ODFDOM element representationMetaEditingDurationElement
, See <meta:editing-duration>.void
setGenerator(String generator)
Sets the value of the ODFDOM element representationMetaGeneratorElement
, See <meta:generator>.void
setInitialCreator(String initialCreator)
Sets the value of the ODFDOM element representationMetaInitialCreatorElement
, See <meta:initial-creator>.void
setKeywords(List<String> keyList)
Sets the list value of the ODFDOM element representationMetaKeywordElement
, See <meta:keyword>.void
setLanguage(String language)
Sets the value of the ODFDOM element representationDcLanguageElement
, See <dc:language>.void
setPrintDate(Calendar printDate)
Sets the value of the ODFDOM element representationMetaPrintDateElement
, See <meta:print-date>.void
setPrintedBy(String printedBy)
Sets the value of the ODFDOM element representationMetaPrintedByElement
, See <meta:printed-by>.void
setSubject(String subject)
Sets the value of the ODFDOM element representationDcSubjectElement
, See <dc:subject>.void
setTitle(String title)
Sets the value of the ODFDOM element representationDcTitleElement
, See <dc:title>.void
setUserDefinedData(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.void
setUserDefinedDataType(String name, String value)
Sets the data type of the ODFDOM element representationMetaUserDefinedElement
by attribute name, See <meta:user-defined>.void
setUserDefinedDataValue(String name, String value)
Sets the value of the ODFDOM element representationMetaUserDefinedElement
by attribute name, See <meta:user-defined>.String
toString()
-
-
-
Constructor Detail
-
OdfOfficeMeta
public OdfOfficeMeta(OdfFileDom metaDom)
Constructor ofOdfOfficeMeta
feature.- Parameters:
metaDom
- the file DOM element of meta.xml
-
-
Method Detail
-
getOfficeMetaElement
public OfficeMetaElement getOfficeMetaElement()
Get the instance ofOfficeMetaElement
which represents this feature.- Returns:
- the instance of OfficeMetaElement
-
getGenerator
public String 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
public void setGenerator(String generator)
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
public String 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
public void setTitle(String title)
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
public String 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
public void setDescription(String description)
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
public String 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
public void setSubject(String subject)
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
public List<String> 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
public void setKeywords(List<String> keyList)
Sets the list value of the ODFDOM element representationMetaKeywordElement
, See <meta:keyword>.- Parameters:
keyList
- set the specified list of keywords
-
addKeyword
public void addKeyword(String keyword)
Add the keyword to the current document. Create child element <meta:keyword>.- Parameters:
keyword
- the value of child element <meta:keyword>.
-
getUserDefinedDataNames
public List<String> 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
public MetaUserDefinedElement getUserDefinedElementByAttributeName(String name)
Receives the ODFDOM element representationMetaUserDefinedElement
by attribute name, See <meta:user-defined>.- Parameters:
name
- the name of the user-defined metadata- Returns:
- the
MetaUserDefinedElement
which is identified by the specified name;null
, if the element is not set.
-
getUserDefinedDataValue
public String getUserDefinedDataValue(String name)
Receives the value of the ODFDOM element representationMetaUserDefinedElement
by 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
public String getUserDefinedDataType(String name)
Receives the data type of the ODFDOM element representationMetaUserDefinedElement
by 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
public void removeUserDefinedDataByName(String name)
Remove the ODFDOM element representationMetaUserDefinedElement
by attribute name, See <meta:user-defined>.- Parameters:
name
- the name of the user-defined metadata
-
setUserDefinedDataValue
public void setUserDefinedDataValue(String name, String value)
Sets the value of the ODFDOM element representationMetaUserDefinedElement
by 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
public void setUserDefinedDataType(String name, String value)
Sets the data type of the ODFDOM element representationMetaUserDefinedElement
by 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
public void setUserDefinedData(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.- 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
public String 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
public void setInitialCreator(String initialCreator)
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
public String 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
public void setCreator(String creator)
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
public String 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
public void setPrintedBy(String printedBy)
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
public Calendar 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
public void setCreationDate(Calendar creationDate)
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
public Calendar 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
public void setDate(Calendar date)
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
public Calendar 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
public void setPrintDate(Calendar printDate)
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
public String 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
public void setLanguage(String language)
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
public Integer 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
public void setEditingCycles(Integer editingCycles)
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
public Duration 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
public void setEditingDuration(Duration editingDuration)
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
public OdfMetaDocumentStatistic getDocumentStatistic()
Receives the sub feature of OdfMetaDocumentStatistic.- Returns:
- the statistics about the document which can be represented by
OdfMetaDocumentStatistic
feature;null
, if the feature is not exist.
-
getHyperlinkBehaviour
public OdfMetaHyperlinkBehaviour getHyperlinkBehaviour()
Receives the OdfMetaHyperlinkBehaviour feature.- Returns:
- the default behavior of hyperlinks in the current document which can be represented by
OdfMetaHyperlinkBehaviour
feature;null
, if the feature is not exist.
-
getAutoReload
public OdfMetaAutoReload 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
OdfMetaAutoReload
feature;null
, if the feature is not exist.
-
getTemplate
public OdfMetaTemplate 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
OdfMetaTemplate
feature;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.
-
-