[opencms-dev] FW: OCMS5- Create folder and html page from JSP

James jim at futurate.com
Tue Nov 22 13:01:58 CET 2005


Well.. I know what I’m doing but don’t know why the doing isn’t doing what
it should!

 

   _____  

From: James [mailto:jim at futurate.com] 
Sent: 22 November 2005 11:45
To: opencms-dev at opencms.org
Subject: OCMS5- Create folder and html page from JSP

 

How do I create a folder and an html page inside that folder from within a
JSP page on my website???

 

I’ve tried this:

 

<%@ page import="com.opencms.flex.jsp.CmsJspActionElement,

                 com.opencms.core.CmsException,

                 com.opencms.file.CmsObject,

                 com.opencms.file.CmsUser,

                 com.opencms.file.CmsRequestContext,

                 java.lang.String,

                 java.util.Enumeration"

%>

 

<%

CmsJspActionElement cmsjsp = new CmsJspActionElement( pageContext, request,
response );

CmsObject cms = cmsjsp.getCmsObject();

 

 

 // CmsObject cms =
((com.opencms.flex.cache.CmsFlexRequest)request).getCmsObject(); 

//  CmsRequestContext reqContext = cms.getRequestContext(); 

 // out.print(cms.loginUser("Admin","administrators")); 

 // reqContext.setCurrentProject(4); //in my DB project_id = 4 

  String content = "test"; 

 
cms.createResource("/opencms/opencms/cida/creativeweb/newminisite/","newpage
.html", "plain", null, content.getBytes()); 

 
cms.unlockResource("/opencms/opencms/cida/creativeweb/newminisite/newpage.ht
ml"); 

 
cms.publishResource("/opencms/opencms/cida/creativeweb/newminisite/newpage.h
tml"); 

//  reqContext.setCurrentProject(1); 

 

%>

 

But don’t really know what I’m doing to be honest!

 

Can anyone point me in the right direction?

 

THANKYOU…………**************** xxxxxxxxxxxxxxxxxxx


--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.362 / Virus Database: 267.13.5/177 - Release Date: 21/11/2005



-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.362 / Virus Database: 267.13.5/177 - Release Date: 21/11/2005
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20051122/17bdcf7c/attachment.htm>


More information about the opencms-dev mailing list