[opencms-dev] Value for path attribute in AddValue method

Manoj Kumar Konakalla konakalla at gmail.com
Fri Nov 11 11:00:39 CET 2005


Hi,
 My requirement is to add new value for content through program.
 There is one method addValue in CmsXmlContent class.

public I_CmsXmlContentValue
<file://dt2752-sridhar/intranet/templates/com.alkacon.documentation.documentation_javadoc_1.0.0/alkacon-documentation/javadoc/core/org/opencms/xml/types/I_CmsXmlContentValue.html>
*addValue*(CmsObject
<file://dt2752-sridhar/intranet/templates/com.alkacon.documentation.documentation_javadoc_1.0.0/alkacon-documentation/javadoc/core/org/opencms/file/CmsObject.html>
cms,
                                     java.lang.String *path*,
                                     java.util.Locale locale,
                                     int index)
                              throws CmsIllegalArgumentException
<file://dt2752-sridhar/intranet/templates/com.alkacon.documentation.documentation_javadoc_1.0.0/alkacon-documentation/javadoc/core/org/opencms/main/CmsIllegalArgumentException.html>,
                                     CmsRuntimeException
<file://dt2752-sridhar/intranet/templates/com.alkacon.documentation.documentation_javadoc_1.0.0/alkacon-documentation/javadoc/core/org/opencms/main/CmsRuntimeException.html>

 Adds a new XML content value for the given element name and locale at the
given index position to this XML content document.

   *Parameters:* cms - the current users OpenCms context *path - the path to
the XML content value element* locale - the locale where to add the new
value index - the index where to add the value (relative to all other values
of this type) *Returns:* the created XML content value *Throws:*
CmsIllegalArgumentException<file://dt2752-sridhar/intranet/templates/com.alkacon.documentation.documentation_javadoc_1.0.0/alkacon-documentation/javadoc/core/org/opencms/main/CmsIllegalArgumentException.html>-
if the given path is invalid
CmsRuntimeException<file://dt2752-sridhar/intranet/templates/com.alkacon.documentation.documentation_javadoc_1.0.0/alkacon-documentation/javadoc/core/org/opencms/main/CmsRuntimeException.html>-
if the element identified by the path already occured
I_CmsXmlSchemaType.getMaxOccurs()<file://dt2752-sridhar/intranet/templates/com.alkacon.documentation.documentation_javadoc_1.0.0/alkacon-documentation/javadoc/core/org/opencms/xml/types/I_CmsXmlSchemaType.html#getMaxOccurs()>or
the given
index is invalid (too high). We should give the path of the element to be
added.
 Any of you ever used this method and if so can you tell me what kind of
value needed to be passed for the argument???
 Regards
Manoj
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opencms.org/pipermail/opencms-dev/attachments/20051111/30ce8fcb/attachment.html>


More information about the opencms-dev mailing list