[opencms-dev] createResource problem

Ivan Jelenic ivan.jelenic at nbs.yu
Wed Aug 13 09:11:01 CEST 2003


Hi,

I use this code for creating file. File is successfully created but I have have problem when I want to edit it in WYSIWYG editor:

 CmsJspActionElement cmsJSP = new CmsJspActionElement(pageContext, request, response);
 CmsObject cms = cmsJSP.getCmsObject();
 
 Hashtable props = new Hashtable();
  props.put("Title","Uputstvo");
  props.put("Description","Ovo je opis stranice");
  props.put("Keywords","kljucna1, kljucna2, klucna3");
  props.put("NavText","Uputstvo za sajt");
 
 try {
 
  CmsResource newfile = cms.createResource("/Home/","uputstvo.html","page",props,contents);
  CmsXmlControlFile controlFile = new CmsXmlControlFile(cms, (CmsFile)newfile);
  controlFile.setMasterTemplate("/system/modules/org.opencms.default/templates/empty");
  controlFile.write();
  
 } catch(CmsException e) {
  
  out.println("Greska !!!");

 }

When I try to edit this page in WYSIWYG editor I got blank page. But, page is successfully displayed in browser with its content. Then when I switched form WYSIWYG editor I saw exception something like this:

CmsException ID:0
String index out of range: -6

Can anyone help me?

I am using OpenCMS 5, Oracle 8.1.7 (Generic), Tomcat 4.1.24LE on W2K.

Best regards, Ivan.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20030813/1ab14a67/attachment.htm>


More information about the opencms-dev mailing list