[opencms-dev] New pages creation from jsp code
Federico Locci
flocci at energit.it
Fri Oct 31 10:16:01 CET 2003
try this :
CmsJspActionElement cms = new CmsJspActionElement(pageContext, request,response);
CmsObject cmso = cms.getCmsObject();
HashMap properties = new HasMap();
properties.put("Description","page");
properties.put("Keywords","page");
properties.put("NavPos","4.0");
properties.put("NavText","page");
properties.put("title","page");
properties.put("content-encoding","ISO-8859-1");
com.opencms.file.CmsResource resource = cmso.createResource("your path where put the file ","prova.html",I_CmsConstants.C_TYPE_PAGE_NAME,properties);
----- Original Message -----
From: Giuseppe Troianiello
To: opencms-dev at opencms.org
Sent: Thursday, October 30, 2003 6:23 PM
Subject: [opencms-dev] New pages creation from jsp code
Dear all,
I am trying to create a new file from a jsp fragment code, using openCMS APIs.
In particular, I used method createResource(cmsObject cms, string name, Map properties, byte[] content, HashMap parameter) from class com.opencms.file.CmsResourceTypePage.
But it doesn't seem to work properly. If I give a name like /opencms/opencms/something/file.html I obtain this exception
com.opencms.core.CmsException: 2 Not found. Detailed error: [com.opencms.file.mySql.CmsDbAccess] /default/vfs/opencms/opencms/something/
at com.opencms.file.genericSql.CmsDbAccess.readFolder(CmsDbAccess.java:8259)
at com.opencms.file.genericSql.CmsResourceBroker.readFolder(CmsResourceBroker.java:5608)
at com.opencms.file.genericSql.CmsResourceBroker.readFolder(CmsResourceBroker.java:5575)
at com.opencms.file.genericSql.CmsResourceBroker.createFile(CmsResourceBroker.java:1786)
...
and if I give only a name like file.html I obtain this
com.opencms.core.CmsException: 2 Not found. Detailed error: [com.opencms.file.mySql.CmsResourceBroker] null.
at com.opencms.file.genericSql.CmsResourceBroker.getResourceType(CmsResourceBroker.java:3769)
at com.opencms.file.genericSql.CmsResourceBroker.createFile(CmsResourceBroker.java:1789)
at com.opencms.file.CmsObject.doCreateFile(CmsObject.java:978)
at com.opencms.file.CmsResourceTypePage.createResource(CmsResourceTypePage.java:461)
...
I suppose (afer looking class sources) there is a wrong separator ("/") management.
Is there anyone who can give me a hint on how to proceed, like use another class / method?
Thanks a lot
Giuseppe
_______________________________________________ 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20031031/904c916d/attachment.htm>
More information about the opencms-dev
mailing list