<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1106" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Verdana size=2>Thanks Stephan,</FONT></DIV>
<DIV><FONT face=Verdana size=2></FONT> </DIV>
<DIV><FONT face=Verdana size=2>the problem was in the path
.........</FONT></DIV>
<DIV><FONT face=Verdana size=2></FONT> </DIV>
<DIV> </DIV>
<DIV style="FONT: 10pt arial">----- Original Message -----
<DIV style="BACKGROUND: #e4e4e4; font-color: black"><B>From:</B> <A
title=beffe@beffe.de href="mailto:beffe@beffe.de">Stephan Hartmann</A> </DIV>
<DIV><B>To:</B> <A title=opencms-dev@opencms.org
href="mailto:opencms-dev@opencms.org">opencms-dev@opencms.org</A> </DIV>
<DIV><B>Sent:</B> Wednesday, October 29, 2003 8:04 PM</DIV>
<DIV><B>Subject:</B> Re: [opencms-dev] create new Resource</DIV></DIV>
<DIV><BR></DIV>
<DIV><FONT face=Arial size=2>try to use a file name with full path, i.e.
"/new_page.html" or "/myfoler/new_page.html"</FONT></DIV>
<DIV> </DIV>
<BLOCKQUOTE dir=ltr
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
<A title=flocci@energit.it href="mailto:flocci@energit.it">Federico Locci</A>
</DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A title=opencms-dev@opencms.org
href="mailto:opencms-dev@opencms.org">opencms-dev@opencms.org</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Wednesday, October 29, 2003 3:34
PM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> Re: [opencms-dev] create new
Resource</DIV>
<DIV><BR></DIV>
<DIV><FONT face=Verdana size=2>Hi,</FONT></DIV>
<DIV><FONT face=Verdana size=2></FONT> </DIV>
<DIV><FONT face=Verdana size=2>the error is the same ..........</FONT></DIV>
<DIV><FONT face=Verdana size=2></FONT> </DIV>
<DIV><FONT face=Verdana size=2>Root
cause:<BR>org.apache.jasper.JasperException: String index out of range:
-1<BR> at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:254)<BR> at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)<BR> </FONT></DIV>
<DIV><FONT face=Verdana size=2></FONT> </DIV>
<DIV><FONT face=Verdana size=2>code :</FONT></DIV>
<DIV><FONT face=Verdana size=2></FONT> </DIV>
<DIV><FONT face=Verdana size=2>String masterTemplate =
"/system/modules/org.opencms.default/templates/empty";
<BR> Hashtable properties = new
Hashtable();<BR> <BR>
properties.put("Description","page");<BR>
properties.put("Keywords","page");<BR>
properties.put("NavPos","4.0");<BR>
properties.put("NavText","page");<BR>
properties.put("title","page");<BR>
properties.put("content-encoding","ISO-8859-1");<BR> <BR> <BR>
CmsJspActionElement cms = new CmsJspActionElement(pageContext,
request,response);<BR> CmsObject cmso =
cms.getCmsObject(); <BR> I_CmsResourceType
resource = cmso.getResourceType("page"); <BR>
<BR> String buffer =
"<![CDATA[]]>";<BR>
com.opencms.file.CmsResource r =
((CmsResourceTypePage)resource).createResourceForTemplate(cmso,"new_page.html",properties,buffer.getBytes(),masterTemplate);
<BR></DIV></FONT>
<DIV><FONT face=Verdana size=2></FONT> </DIV>
<DIV><FONT face=Verdana size=2></FONT> </DIV>
<DIV><FONT face=Verdana size=2></FONT> </DIV>
<DIV style="FONT: 10pt arial">----- Original Message -----
<DIV style="BACKGROUND: #e4e4e4; font-color: black"><B>From:</B> <A
title=hartmann@waehrisch-feykes.de
href="mailto:hartmann@waehrisch-feykes.de">Hartmann, Waehrisch & Feykes
GmbH</A> </DIV>
<DIV><B>To:</B> <A title=opencms-dev@opencms.org
href="mailto:opencms-dev@opencms.org">opencms-dev@opencms.org</A> </DIV>
<DIV><B>Sent:</B> Wednesday, October 29, 2003 12:46 PM</DIV>
<DIV><B>Subject:</B> Re: [opencms-dev] create new Resource</DIV></DIV>
<DIV><FONT face=Verdana size=2></FONT><FONT face=Verdana size=2></FONT><FONT
face=Verdana size=2></FONT><FONT face=Verdana size=2></FONT><FONT face=Verdana
size=2></FONT><BR></DIV>
<DIV><FONT face=Arial size=2>Hi Federico,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>maybe i misunderstood you, too.</FONT></DIV>
<DIV><FONT face=Arial size=2>The error could be that your <FONT
face=Verdana>CmsResourceTypePage is not initialized.</FONT></FONT></DIV>
<DIV><FONT face=Verdana size=2>You should not instantiate it on your own but
use </FONT></DIV>
<DIV><FONT face=Verdana size=2>cmso.getResourceType("page");</FONT></DIV>
<DIV><FONT face=Verdana size=2>Don't forget to cast.</FONT></DIV>
<DIV><FONT face=Verdana size=2></FONT> </DIV>
<DIV><FONT face=Verdana size=2>Bye,</FONT></DIV>
<DIV><FONT face=Verdana size=2>Stephan</FONT></DIV>
<DIV><FONT face=Verdana size=2></FONT> </DIV>
<BLOCKQUOTE
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
<A title=flocci@energit.it href="mailto:flocci@energit.it">Federico
Locci</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A title=opencms-dev@opencms.org
href="mailto:opencms-dev@opencms.org">opencms-dev@opencms.org</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Wednesday, October 29, 2003 12:16
PM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> Re: [opencms-dev] create new
Resource</DIV>
<DIV><BR></DIV>
<DIV><FONT face=Verdana size=2>Scuse me, </FONT></DIV>
<DIV><FONT face=Verdana size=2></FONT> </DIV>
<DIV><FONT face=Verdana size=2>but i don't uderstand</FONT></DIV>
<DIV><FONT face=Verdana size=2></FONT> </DIV>
<DIV><FONT face=Verdana size=2>I've try</FONT></DIV>
<DIV><FONT face=Verdana size=2></FONT> </DIV>
<DIV><FONT face=Verdana size=2></FONT><FONT face=Verdana size=2>Hashtable
properties = new Hashtable();<BR></FONT></DIV>
<DIV><FONT face=Verdana
size=2>properties.put("Description","page");<BR>properties.put("Keywords","page");<BR>properties.put("NavPos","4.0");<BR>properties.put("NavText","page");<BR>properties.put("title","page");<BR>properties.put("content-encoding","ISO-8859-1");<BR></FONT></DIV>
<DIV><FONT face=Verdana size=2>CmsJspActionElement cms = new
CmsJspActionElement(pageContext, request,response);<BR>CmsObject cmso =
cms.getCmsObject(); <BR>String masterTemplate =
""/system/modules/org.opencms.default/templates/empty";</FONT></DIV>
<DIV><FONT face=Verdana size=2></FONT> </DIV>
<DIV><FONT face=Verdana size=2>CmsResourceTypePage resource = new
CmsResourceTypePage();<BR></FONT><FONT face=Verdana size=2>String buffer =
"<![CDATA[hello world]]>";<BR>com.opencms.file.CmsResource r =
resource.createResourceForTemplate(cmso,"new_page",properties,buffer.getBytes(),masterTemplate);
</DIV>
<DIV> </DIV>
<DIV>but error is the same : Root
cause:<BR>org.apache.jasper.JasperException: String index out of range:
-1<BR> at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:254)<BR> </DIV>
<DIV> </DIV>
<DIV>Can you give me a example ??</DIV>
<DIV> </DIV>
<DIV>Thanks, a lot</DIV>
<DIV> </DIV>
<DIV></FONT> </DIV>
<DIV><FONT face=Verdana size=2></FONT> </DIV>
<DIV><FONT face=Verdana size=2></FONT> </DIV>
<DIV><FONT face=Verdana size=2></FONT> </DIV>
<DIV><FONT face=Verdana size=2>----- Original Message ----- </FONT>
<DIV><FONT face=Verdana size=2>From: "Stephan Hartmann" <</FONT><A
href="mailto:beffe@beffe.de"><FONT face=Verdana
size=2>beffe@beffe.de</FONT></A><FONT face=Verdana size=2>></FONT></DIV>
<DIV><FONT face=Verdana size=2>To: <</FONT><A
href="mailto:opencms-dev@opencms.org"><FONT face=Verdana
size=2>opencms-dev@opencms.org</FONT></A><FONT face=Verdana
size=2>></FONT></DIV>
<DIV><FONT face=Verdana size=2>Sent: Tuesday, October 28, 2003 8:30
PM</FONT></DIV>
<DIV><FONT face=Verdana size=2>Subject: Re: [opencms-dev] create new
Resource</FONT></DIV></DIV>
<DIV><FONT face=Verdana><BR><FONT size=2></FONT></FONT></DIV><FONT
face=Verdana size=2>> HI,<BR>> <BR>> the content that you pass to
the method (in your case "hello") has to be<BR>> XML. It is the content
of the control file. Take another page and view its<BR>> control
file.<BR>> <BR>> Bye,<BR>> Stephan<BR>> <BR>> <BR>> -----
Original Message -----<BR>> From: "Federico Locci" <</FONT><A
href="mailto:flocci@energit.it"><FONT face=Verdana
size=2>flocci@energit.it</FONT></A><FONT face=Verdana size=2>><BR>>
To: <</FONT><A href="mailto:opencms-dev@opencms.org"><FONT face=Verdana
size=2>opencms-dev@opencms.org</FONT></A><FONT face=Verdana
size=2>><BR>> Sent: Tuesday, October 28, 2003 5:56 PM<BR>> Subject:
[opencms-dev] create new Resource<BR>> <BR>> <BR>> > hi
all,.<BR>> ><BR>> > i'm trying to create a newResource, but i've
a an error that i don't<BR>> > udenrstand.<BR>> ><BR>> >
Help me please..<BR>> > the error is
org.apache.jasper.JasperException: String index out of<BR>> > range:
-1<BR>> ><BR>> > This is the code that i wrote:<BR>>
><BR>> > CmsJspActionElement cms = new
CmsJspActionElement(pageContext,<BR>> > request,response);<BR>>
> CmsObject cmso = cms.getCmsObject();<BR>> ><BR>>
><BR>> > java.util.Hashtable properties = new Hashtable();<BR>>
><BR>> ><BR>> >
properties.put("Description","page");<BR>> >
properties.put("Keywords","page");<BR>> >
properties.put("NavPos","4.0");<BR>> >
properties.put("NavText","page");<BR>> >
properties.put("title","page");<BR>> >
properties.put("content-encoding","ISO-8859-1");<BR>>
> properties.put("export","page");<BR>>
> properties.put("exportname","page");<BR>>
><BR>> ><BR>> ><BR>> >
CmsResourceTypePage resource = new CmsResourceTypePage();<BR>>
> com.opencms.file.CmsResource newResource
=<BR>> >
resource.createResourceForTemplate(cmso,"new_page.html",properties,new<BR>>
> String("hello").getBytes(),new<BR>> >
String("/system/modules/org.opencms.default/templates/empty"));<BR>>
><BR>> > _______________________________________________<BR>>
> This mail is send to you from the opencms-dev mailing list<BR>> >
To change your list options, or to unsubscribe from the list, please
visit<BR>> > </FONT><A
href="http://mail.opencms.org/mailman/listinfo/opencms-dev"><FONT
face=Verdana
size=2>http://mail.opencms.org/mailman/listinfo/opencms-dev</FONT></A><BR><FONT
face=Verdana size=2>> <BR>>
_______________________________________________<BR>> This mail is send to
you from the opencms-dev mailing list<BR>> To change your list options,
or to unsubscribe from the list, please visit<BR>> </FONT><A
href="http://mail.opencms.org/mailman/listinfo/opencms-dev"><FONT
face=Verdana
size=2>http://mail.opencms.org/mailman/listinfo/opencms-dev</FONT></A><BR><FONT
face=Verdana size=2>> </FONT></BLOCKQUOTE></BLOCKQUOTE></BODY></HTML>