AW: AW: [opencms-dev] Writing several documents in one page ?

Frank Wunderlich k.frank.wunderlich at gmx.de
Wed Jun 18 14:45:02 CEST 2003


That looks pretty neat! :-)
Thanks!

> -----Ursprüngliche Nachricht-----
> Von: opencms-dev-admin at opencms.org 
> [mailto:opencms-dev-admin at opencms.org] Im Auftrag von Stephan Hartmann
> Gesendet: Mittwoch, 18. Juni 2003 14:19
> An: opencms-dev at opencms.org
> Betreff: Re: AW: [opencms-dev] Writing several documents in one page ?
> 
> 
> Hi Frank,
> 
> the getContent()-method should work on the body file under 
> /system/bodies/... 
> which is of type XMLTEMPLATE.
> 
> To get only the parsed content of the body you could try this:
> 
> <%
>     com.opencms.flex.jsp.CmsJspActionElement cms = new 
> CmsJspActionElement(pageContext, request, response);
> 
>     CmsXmlTemplate t = new CmsXmlTemplate();
>     CmsXmlTemplateFile tf = new 
> CmsXmlTemplateFile(cms.getCmsObject(), 
> "/system/bodies/yourpagebody.html");
> 
>     out.println(tf.getProcessedTemplateContent(t, null, null));
> 
> %>
> 
> The third parameter of getProcessedTemplateContent is the 
> templateSelector. 
> If you have enabled multiple bodies in your page you can select the 
> apropriate body with this parameter.
> 
> Bye,
> Stephan
> 
> 
> Am Mittwoch, 18. Juni 2003 13:34 schrieben Sie:
> > Well, yes... but what if I would just like to include a part of the 
> > body (for example just the first 200 characters, or the 
> first section, 
> > marked bold). The include-Method writes the content into 
> the response 
> > and returns "void", but what if I need the body as a string?
> >
> > Is there just the way I described in my earlier mail 
> (parsing the xml 
> > in "system/bodies")? Is there a reason why the getContent()-method 
> > returns the mentioned error-message?
> >
> > TIA,
> > Frank.
> >
> > > -----Ursprüngliche Nachricht-----
> > > Von: opencms-dev-admin at opencms.org 
> > > [mailto:opencms-dev-admin at opencms.org] Im Auftrag von Alexander 
> > > Kandzior
> > > Gesendet: Mittwoch, 18. Juni 2003 13:13
> > > An: opencms-dev at opencms.org
> > > Betreff: RE: [opencms-dev] Writing several documents in one page ?
> > >
> > >
> > > To output the "body" content of a "page" you can use
> > >
> > > <%
> > > CmsJspNavElement nav;
> > >
> > > // initialize nav somehow...
> > >
> > > String uri = nav.getResourceName(); 
> > > com.opencms.flex.jsp.CmsJspActionElement.include(uri, "body"); %>
> > >
> > > Best Regards,
> > > Alex.
> > >
> > > Alexander Kandzior
> > > Alkacon Software - The OpenCms Experts http://www.alkacon.com
> > >
> > > > -----Original Message-----
> > > > From: opencms-dev-admin at opencms.org 
> > > > [mailto:opencms-dev-admin at opencms.org] On Behalf Of Frank 
> > > > Wunderlich
> > > > Sent: Wednesday, June 18, 2003 12:59 PM
> > > > To: opencms-dev at opencms.org
> > > > Subject: AW: [opencms-dev] Writing several documents in 
> one page ?
> > > >
> > > >
> > > > Hi Alex,
> > > >
> > > > I tried this too, but the resulting String is in my 
> case something 
> > > > like
> > > >
> > > > ??? com.opencms.core.CmsException: XML document 
> > > > /homepage/leistungen/webdevelopment/index.html is not of the 
> > > > expected type. This document is "page", but it should be 
> > > > "XMLTEMPLATE" (OpenCms XML template file). ???...
> > > >
> > > > Any clue?
> > > > Frank.
> > > >
> > > > > Try using
> > > > >
> > > > > <%
> > > > >
> > > > > CmsJspNavElement nav;
> > > > >
> > > > > // initialize nav somehow...
> > > > >
> > > > > String uri = nav.getResourceName();
> > > > > String content =
> > > > > com.opencms.flex.jsp.CmsJspActionElement.getContent(uri);
> > > > > out.println(content);
> > > > >
> > > > > %>
> > > > >
> > > > > Best Regards,
> > > > > Alex.
> > > > >
> > > > > Alexander Kandzior
> > > > > Alkacon Software - The OpenCms Experts http://www.alkacon.com
> > > > >
> > > > > > -----Original Message-----
> > > > > > From: opencms-dev-admin at opencms.org 
> > > > > > [mailto:opencms-dev-admin at opencms.org] On Behalf Of
> > > > >
> > > > > Apostoly Guillaume
> > > > >
> > > > > > Sent: Wednesday, June 18, 2003 11:33 AM
> > > > > > To: opencms-dev at opencms.org
> > > > > > Subject: [opencms-dev] Writing several documents in 
> one page ?
> > > > > >
> > > > > >
> > > > > > Does anybody know how to write several documents (OpenCMS
> > > > > > "pages") on one JSP page ? Let's say i've got an ArrayList 
> > > > > > with several CmsJspNavElement inside, how can i 
> > > > > > "out.println("thecontentofeachelement")" ? Thanks 
> by advance.
> > > > > >
> > > > > > Guillaume.
> > > > > > _______________________________________
> > > > > > Guillaume APOSTOLY
> > > > > > Business-Analyst EIS-BSD
> > > > > > Tél: +33 (0)1.30.44.95.22
> > > > > > Fax: +33 (0)1.30.44.98.08
> > > > > > ApostolyG at mail.europcar.com
> > >
> > > <mailto:ApostolyG at mail.europcar.com>
> > >
> > > _______________________________________
> > >
> > > > > > _______________________________________________
> > > > > > 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
> > > > >
> > > > > _______________________________________________
> > > > > 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
> > > >
> > > > _______________________________________________
> > > > 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
> > >
> > > _______________________________________________
> > > 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
> >
> > _______________________________________________
> > 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
> 
> -- 
> Stephan Hartmann
> 
> Währisch & Feykes GmbH
> Gustav-Adolf-Str. 5
> 47057 Duisburg
> Tel. 0203 / 373 070
> Fax 0203 / 376 766
> hartmann at wfnetz.de
> 
> ------------------------------------------------------
> Ausschlusserklärung (Disclaimer):
> Über das Internet versandte E-mails können unter fremden 
> Namen erstellt oder 
> manipuliert werden. Aus diesem Grund enthalten unsere mit 
> E-mail verschickten 
> Nachrichten grundsätzlich keine rechtsverbindlichen 
> Willenserklärungen. _______________________________________________
> 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
> 





More information about the opencms-dev mailing list