[opencms-dev] Programmatically creating a site with the OpenCms API

Yves Glodt yg at mind.lu
Sun Apr 3 19:18:52 CEST 2011


Hi,

imagine you have a "template site" in /sites/template, and it contains the
following files:


   - template.jsp
   - site-config.jsp
   - style.css
   - index.html
   - about.html
   - contact.html

Now what I would like to do is to is to create a "Site Creator" jsp page
(which will be located in another site in fact, but that should not matter)
which has a simple
form to collect some data like e.g. the title, some color settings, logo
selection, etc of the new site to be created.

When that form is then being submitted I would like to create a subfolder in
/sites/production (e.g. /sites/production/site01) and copy the files from
/sites/template
over there (and probably create a sibling to template.jsp). At the end the
new site should also be published.

Does anyone have some example code (CmsObject looks good to me) which could
be useful in this case?

Best regards,
Yves
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20110403/e92f23c6/attachment.htm>


More information about the opencms-dev mailing list