[opencms-dev] FW: OpenCms5 - set Template of Resource Type Page from Java class ???

james jim at futurate.com
Tue Jan 10 16:32:12 CET 2006


I solved it.

 

Added this:

 

  CmsXmlControlFile pageXml = new CmsXmlControlFile(cms, minisiteRoot +
uniqueFolderName + "/index.html");            

 
pageXml.setMasterTemplate("/system/modules/com.mysite.site/templates/userpag
e");           

  pageXml.write();

 

   _____  

From: james [mailto:jim at futurate.com] 
Sent: 10 January 2006 12:13
To: 'opencms-dev at opencms.org'
Subject: OpenCms5 - set Template of Resource Type Page from Java class ???

 

Hi.

I can create an html page and set its Title, NavText, etc properties from my
Java class, but how do I set the template that it uses??? OpenCms 5.

 

public void createIndexPage() throws CmsException {

  Hashtable prop = new Hashtable();

  prop.put("Title", pageName);

  prop.put("NavPos", "1");

  prop.put("NavText", "Mini-site for " + uniqueFolderName);

  cms.createResource(minisiteRoot + uniqueFolderName + "/", pageName,

                            CmsResource.C_TYPE_PAGE_NAME, prop);

}

 

Thanks…


--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.371 / Virus Database: 267.14.16/225 - Release Date: 09/01/2006



-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.371 / Virus Database: 267.14.16/225 - Release Date: 09/01/2006
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20060110/074b778d/attachment.htm>


More information about the opencms-dev mailing list