[opencms-dev] RE: Add Templates to opencms

manolo fdez manolofdez85 at hotmail.com
Mon Apr 17 13:48:39 CEST 2006



I tried with "lockResource" but I get this error:

Error locking resource "/sites/default/index.jsp" with mode
"CmsLock.C_MODE_COMMON"

<%
org.opencms.file.CmsObject ocms =
org.opencms.main.OpenCms.initCmsObject("Guest");

ocms.loginUser("Admin2", "Admin2"); // an existing user of group
Administrators

org.opencms.file.CmsProperty rProp = new
org.opencms.file.CmsProperty("ResourceProp", null, "Resource property
value", true);

ocms.lockResource("/sites/default/index.jsp");
ocms.writePropertyObject("/sites/default/index.jsp", rProp); // an existing
file
ocms.unlockResource("/sites/default/index.jsp");
%>


--
View this message in context: http://www.nabble.com/Add-Templates-to-opencms-t1391802.html#a3948794
Sent from the OpenCMS - Dev forum at Nabble.com.




More information about the opencms-dev mailing list