<DIV><BR><BR><B><I>"Miyuru C. Ratnayake" <miyuruchanna@yahoo.com></I></B> wrote:
<BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">Date: Tue, 9 Mar 2004 03:28:03 -0800 (PST)<BR>From: "Miyuru C. Ratnayake" <MIYURUCHANNA@YAHOO.COM><BR>Subject: Method missing in Opencms 5.0.1<BR>To: opencms-dev-request@opencms.org<BR><BR>Hi I used this method to create a CmsObject from a Request in a JSP file com.opencms.file.CmsObject cms = ((com.opencms.flex.cache.CmsFlexRequest)request).getCmsObject(); but in OpenCMS 5.0.0 its working properly but in OpenCMS 5.0.1 it is not working. There is no such method getCmsObject() in CmsFlexRequest in OpenCMS 5.0.1 My code is as follows <%
com.opencms.file.CmsObject cms = ((com.opencms.flex.cache.CmsFlexRequest)request).getCmsObject();
com.opencms.file.CmsRequestContext reqContext = cms.getRequestContext();
reqContext.setCurrentProject(4);
String WORKING_PATH=reqContext.getUri();
com.opencms.core.CmsRequestHttpServlet req = (com.opencms.core.CmsRequestHttpServlet)(reqContext.getRequest());
java.util.Enumeration files = req.getFileNames();
Hashtable h=new Hashtable(2);
h.put("Title",req.getParameter("title"));
h.put("NavText",req.getParameter("navText"));
while(files.hasMoreElements()){
String this_filename = (String) files.nextElement();
byte[] filecontent = req.getFile(this_filename);
cms.createResource(WORKING_PATH, this_filename, req.getParameter("type"), h, filecontent);
cms.unlockResource(WORKING_PATH + this_filename);
cms.publishResource(WORKING_PATH + this_filename);
}
%>I need to run this in Opencms 5.0.1 is there a different method to use. Thanks, Miyuru Ratnayake
<P>
<HR SIZE=1>
Do you Yahoo!?<BR>Yahoo! Search - <A href="http://search.yahoo.com/?fr=ad-mailsig-home">Find what you’re looking for faster.</A></BLOCKQUOTE></DIV><p><hr SIZE=1>
Do you Yahoo!?<br>
Yahoo! Search - <a href="http://search.yahoo.com/?fr=ad-mailsig-home">Find what you’re looking for faster.</a>