[opencms-dev] How to build property list

David Sánchez Hernández sanher82 at gmail.com
Tue Apr 24 08:28:38 CEST 2007


byte[] XMLdocumentBytes = documentXML.getBytes("UTF-8");
List properties = new ArrayList();

              CmsProperty prop = new CmsProperty();
              prop.setName(CmsPropertyDefinition.PROPERTY_TEMPLATE_ELEMENTS
);
              prop.setValue("/system/modules/xxxxx.jsp",
CmsProperty.TYPE_SHARED);
              properties.add(prop);

              prop = new CmsProperty();
              prop.setName(CmsPropertyDefinition.PROPERTY_TITLE);
              prop.setValue("Title",CmsProperty.TYPE_SHARED);
              properties.add(prop);

              cms.createResource(resource,
type,XMLdocumentBytes,properties);

type is the number given in opencms-vfs.xml to that content type.

Regards,
David.

2007/4/23, Isaac R. Higgins <isaac.higgins at isaacray.com>:
>
> Does anyone have an example of how to use:
>
> public CmsResource createResource(java.lang.String resourcename,
>                                   int type,
>                                   byte[] content,
>                                   java.util.List properties)
>
> I am not understanding how to construct the "properties" object, and I
> want to set the title, description, and navigation text of the new resource.
>
> Thanks,
> Isaac
>
>
> _______________________________________________
> This mail is sent to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please visit
> http://lists.opencms.org/mailman/listinfo/opencms-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20070424/d7170fff/attachment.htm>


More information about the opencms-dev mailing list