[opencms-dev] Urgent-Creating HTML page dynamically in OpenCms

Ivan Jelenic ivan.jelenic at nbs.yu
Fri Sep 12 15:50:02 CEST 2003


Hi,

Maybe this wiil help:

byte[] contents = new byte[something];
Hashtable props = new Hashtable();

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();
  out.println("File is created!");

 } catch(Exception e) {

  out.println("Error !!!");

 }

But, when I opened this page in WYSIWYG editor I saw a blank page. In
browser everything is OK and the page is successfully displayed.

Best regards, Ivan.


----- Original Message ----- 
From: "srinivas voleti" <srini_2105 at hotmail.com>
To: <opencms-dev at opencms.org>
Sent: 12 September, 2003 2:54 PM
Subject: [opencms-dev] Urgent-Creating HTML page dynamically in OpenCms


> Hi All:
>
> Is there any way to create a html page dynamically into OpenCms. I have
seen
> a method for doing that
> cmsObject.createResource("/temp/", "1", null, new byte[0], null );
>
> Im trying out with the above method. If anyone has done this before,
please
> respond.
>
> Regards,
> Srini.
>
> _________________________________________________________________
> Get personal loans. It's hassle-free.
>
http://server1.msn.co.in/msnleads/citibankpersonalloan/citibankploanjuly03.asp?type=txt
> It's approved instantly.
>
> _______________________________________________
> This mail is send to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please visit
> http://mail.opencms.org/mailman/listinfo/opencms-dev





More information about the opencms-dev mailing list