|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface I_CmsXmlDocument
Describes the API to access the values of a XML content document.
Method Summary | |
---|---|
void |
addLocale(CmsObject cms,
java.util.Locale locale)
Adds the given locale to this XML document. |
void |
copyLocale(java.util.List possibleSources,
java.util.Locale destination)
Copies the content from the first matching source locale that exists in this XML document to the given destination locale in this XML document. |
void |
copyLocale(java.util.Locale source,
java.util.Locale destination)
Copies the content of the given source locale to the given destination locale in this XML document. |
CmsXmlContentDefinition |
getContentDefinition()
Returns the content definition object for this xml content object. |
java.lang.String |
getConversion()
Returns the content conversion parameter used for this XML document. |
java.lang.String |
getEncoding()
Returns the encoding used for this XML document. |
CmsFile |
getFile()
Returns the file this document was generated from, may be null if the file not available. |
int |
getIndexCount(java.lang.String name,
java.util.Locale locale)
Returns the index count of existing values for the given key name, or -1 if no such value exists. |
CmsLinkProcessor |
getLinkProcessor(CmsObject cms,
CmsLinkTable linkTable)
Returns a link processor for the values of this XML document. |
java.util.List |
getLocales()
Returns a List of all locales that have at last one element in this XML document. |
java.util.List |
getLocales(java.lang.String element)
Returns a List of all locales that have the given element set in this XML document. |
java.util.List |
getNames(java.util.Locale locale)
Returns all available elements names used in this document for the given locale. |
java.lang.String |
getStringValue(CmsObject cms,
java.lang.String name,
java.util.Locale locale)
Returns the first content value for the given key name as a String, or null if no such value exists. |
java.lang.String |
getStringValue(CmsObject cms,
java.lang.String name,
java.util.Locale locale,
int index)
Returns the content value for the given key name from the selected index as a String, or null if no such value exists. |
I_CmsXmlContentValue |
getValue(java.lang.String name,
java.util.Locale locale)
Returns the content value Object for the given key name, or null if no such value exists. |
I_CmsXmlContentValue |
getValue(java.lang.String name,
java.util.Locale locale,
int index)
Returns the content value Object for the given key name from the selected index, or null if no such value exists. |
java.util.List |
getValues(java.util.Locale locale)
Returns all available elements values used in this document for the given locale. |
java.util.List |
getValues(java.lang.String name,
java.util.Locale locale)
Returns all content value Objects for the given key name in a List, or null if no such value exists. |
boolean |
hasLocale(java.util.Locale locale)
Checks if the given locale exists in this XML document. |
boolean |
hasValue(java.lang.String name,
java.util.Locale locale)
Returns true if a value exists with the given key name,
false otherwise. |
boolean |
hasValue(java.lang.String name,
java.util.Locale locale,
int index)
Returns true if a value exists with the given key name at the selected index,
false otherwise. |
void |
initDocument()
Initializes this XML document, required after structural changes to the XML. |
boolean |
isEnabled(java.lang.String name,
java.util.Locale locale)
Returns true if a value exists with the given key name,
and that value is enabled,
false otherwise. |
boolean |
isEnabled(java.lang.String name,
java.util.Locale locale,
int index)
Returns true if a value exists with the given key name at the selected index,
and that value is enabled,
false otherwise. |
void |
moveLocale(java.util.Locale source,
java.util.Locale destination)
Moves the content of the given source locale to the given destination locale in this XML document. |
void |
removeLocale(java.util.Locale locale)
Removes the given locale from this XML document. |
CmsXmlContentErrorHandler |
validate(CmsObject cms)
Validates the content of this XML document. |
Method Detail |
---|
void addLocale(CmsObject cms, java.util.Locale locale) throws CmsXmlException
cms
- the current users OpenCms contextlocale
- the locale to add
CmsXmlException
- in case the locale already existed, or if something else goes wrongvoid copyLocale(java.util.List possibleSources, java.util.Locale destination) throws CmsXmlException
The list of possible sources, has to be sorted in order of preference. The first match that exists in this XML document is used as source for the destination locale. No "locale simplification" ("en_EN" to "en" etc.) is performed for the match.
possibleSources
- the possible source locales in order of preference,
must contain objects of type Locale
destination
- the destination locale
CmsXmlException
- in case non of the source locales did not exist,
or the destination locale already exists in the document, or if something else goes wrongvoid copyLocale(java.util.Locale source, java.util.Locale destination) throws CmsXmlException
source
- the source localedestination
- the destination locale
CmsXmlException
- in case either the source locale did not exist,
or the destination locale already exists in the document, or if something else goes wrongCmsXmlContentDefinition getContentDefinition()
java.lang.String getConversion()
java.lang.String getEncoding()
CmsFile getFile()
null
if the file not available.The file may not be available if the document was generated by a String or a pure XML document.
int getIndexCount(java.lang.String name, java.util.Locale locale)
-1
if no such value exists.
name
- the key to get the index count forlocale
- the locale to get the index count for
CmsLinkProcessor getLinkProcessor(CmsObject cms, CmsLinkTable linkTable)
cms
- the current OpenCms user context that provides access to the link processorlinkTable
- the table with the links to process
java.util.List getLocales()
java.util.List getLocales(java.lang.String element)
If no locale for the given element name is available, an empty list is returned.
element
- the element to look up the locale List for
java.util.List getNames(java.util.Locale locale)
If no element for the given locale is available, an empty list is returned.
locale
- the locale
getValues(Locale)
java.lang.String getStringValue(CmsObject cms, java.lang.String name, java.util.Locale locale) throws CmsXmlException
null
if no such value exists..
cms
- the current OpenCms user contextname
- the key to get the content value forlocale
- the locale to get the content value for
CmsXmlException
- if something goes wrongjava.lang.String getStringValue(CmsObject cms, java.lang.String name, java.util.Locale locale, int index) throws CmsXmlException
null
if no such value exists.
cms
- the current OpenCms user contextname
- the key to get the content value forlocale
- the locale to get the content value forindex
- the index position to get the value from
CmsXmlException
- if something goes wrongI_CmsXmlContentValue getValue(java.lang.String name, java.util.Locale locale)
null
if no such value exists..
You can provide an index for the value by appending a numer in aquare brackets to the name parameter like this "Title[1]". If no index is provided, 0 is used for the index position.
name
- the key to get the content value forlocale
- the locale to get the content value for
I_CmsXmlContentValue getValue(java.lang.String name, java.util.Locale locale, int index)
null
if no such value exists.
name
- the key to get the content value forlocale
- the locale to get the content value forindex
- the index position to get the value from
java.util.List getValues(java.util.Locale locale)
If no element for the given locale is available, an empty list is returned.
locale
- the locale
I_CmsXmlContentValue
)getNames(Locale)
java.util.List getValues(java.lang.String name, java.util.Locale locale)
null
if no such value exists.
name
- the key to get the content values forlocale
- the locale to get the content values for
boolean hasLocale(java.util.Locale locale)
locale
- the locale to check
boolean hasValue(java.lang.String name, java.util.Locale locale)
true
if a value exists with the given key name,
false
otherwise.You can provide an index for the value by appending a numer in aquare brackets to the name parameter like this "Title[1]". If no index is provided, 0 is used for the index position.
name
- the key to checklocale
- the locale to check
boolean hasValue(java.lang.String name, java.util.Locale locale, int index)
true
if a value exists with the given key name at the selected index,
false
otherwise.
name
- the key to checklocale
- the locale to checkindex
- the index position to check
void initDocument()
If nodes in the XML are added, removed or moved, the document needs to be initialized in order to update the internal data structures.
boolean isEnabled(java.lang.String name, java.util.Locale locale)
true
if a value exists with the given key name,
and that value is enabled,
false
otherwise.You can provide an index for the value by appending a numer in aquare brackets to the name parameter like this "Title[1]". If no index is provided, 0 is used for the index position.
name
- the key to checklocale
- the locale to check
boolean isEnabled(java.lang.String name, java.util.Locale locale, int index)
true
if a value exists with the given key name at the selected index,
and that value is enabled,
false
otherwise.
name
- the key to checklocale
- the locale to checkindex
- the index position to check
void moveLocale(java.util.Locale source, java.util.Locale destination) throws CmsXmlException
source
- the source localedestination
- the destination locale
CmsXmlException
- in case either the source locale did not exist, or the destination locale already exists in the document, or if something else goes wrongvoid removeLocale(java.util.Locale locale) throws CmsXmlException
locale
- the locale to remove
CmsXmlException
- in case the locale did not exist in the document, or if something else goes wrongCmsXmlContentErrorHandler validate(CmsObject cms)
To check for errors in a single document locale only, use
CmsXmlContentErrorHandler.hasErrors(Locale)
in the result object.
cms
- the current OpenCms user context
validate(CmsObject)
|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |