[opencms-dev] How to use CmsObject.writePropertyObject

Jonathan Woods jonathan.woods at scintillance.com
Fri Jun 9 17:29:24 CEST 2006


I reckon Christian is right.  You can also get more information about the
ServletException, for example what caused it, by looking in OpenCms's log at
<opencms home>/WEB-INF/logs/opencms.log.  This is always a good place to
start finding out what's wrong.

Jon

-----Original Message-----
From: opencms-dev-bounces at opencms.org
[mailto:opencms-dev-bounces at opencms.org] On Behalf Of Christian Steinert
Sent: 09 June 2006 16:21
To: The OpenCms mailing list
Subject: Re: [opencms-dev] How to use CmsObject.writePropertyObject

Xuan Wang schrieb:
> hi everyone :
>   I  use CmsObject.writePropertyObject to modify the property of my 
> Xmlpage file. I create CmsProperty use this code
>
>       CmsProperty prop = new CmsProperty();
>       prop.setAutoCreatePropertyDefinition(true);
>       // set property name
>       prop.setName(name);
>       // set property value
>       if
> (OpenCms.getWorkplaceManager().isDefaultPropertiesOnStructure()) {
>           prop.setValue(value, CmsProperty.TYPE_INDIVIDUAL);
>       } else {
>           prop.setValue(value, CmsProperty.TYPE_SHARED);
>       }
>
> Then I use writePropertyObject(java.lang.String
> resourcename,CmsProperty property) function to modify page property.
> I write  title property of page ,can't succeed.
> the error are
> javax.servlet.ServletException: Error writing property "Keywords" on 
> resource "/news/20060606/4.html".

Hi

maybe you have to lock the resource, before writing?
    cmsObject.lockResource(<filename>,CmsLock.COMMON);

hth

christian

_______________________________________________
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





More information about the opencms-dev mailing list