Antw: Re: AW: [opencms-dev] Sitemap Module [SOLVED]

Björn Schlueter bschlueter at lenord.de
Thu Sep 4 10:05:01 CEST 2003


THANK YOU

>>> ph at ethikom.de 04.09.2003 10:37:04 >>>
Hi,

try to correct

        out.write("<a href=\"" + target + "\">" + nav.getNavText() + "</a>
\n");

into

        out.write("<a href=\"" + target + "\">" + nav.getNavText() +
"</a>\n");

Error is described bellow - see "unclosed string literal".

Regards
Petr


-----Original Message-----
From: opencms-dev-admin at opencms.org 
[mailto:opencms-dev-admin at opencms.org]On Behalf Of Björn Schlueter
Sent: Thursday, September 04, 2003 8:29 AM
To: mmihaili at csc.com.au; opencms-dev at opencms.org 
Subject: Antw: Re: AW: [opencms-dev] Sitemap Module


Hello,

I not a programmer but I would like to use a sitemap at my site.

I tried to enter the code below into a new jsp-page. Unfortunately I receive
a error message like this:

javax.servlet.ServletException: Resource loader error in file '/sitemap.jsp'

Root cause:
org.apache.jasper.JasperException: Unable to compile class for JSP

An error occurred at line: -1 in the jsp file: null

Generated servlet error:
    [javac] Since fork is true, ignoring compiler setting.
    [javac] Compiling 1 source file
    [javac] Since fork is true, ignoring compiler setting.
    [javac]
/var/jakarta-tomcat-4.1.24/work/Standalone/localhost/intra/WEB-INF/jsp/offli
ne/sitemap_jsp_jsp.java:40: unclosed string literal
    [javac]         out.write("<a href=\"" + target + "\">" +
nav.getNavText() + "</a>
    [javac]
^
    [javac]
/var/jakarta-tomcat-4.1.24/work/Standalone/localhost/intra/WEB-INF/jsp/offli
ne/sitemap_jsp_jsp.java:41: illegal character: \92
    [javac] \n");
    [javac] ^
    [javac]
/var/jakarta-tomcat-4.1.24/work/Standalone/localhost/intra/WEB-INF/jsp/offli
ne/sitemap_jsp_jsp.java:41: unclosed string literal
    [javac] \n");
    [javac]   ^
    [javac]
/var/jakarta-tomcat-4.1.24/work/Standalone/localhost/intra/WEB-INF/jsp/offli
ne/sitemap_jsp_jsp.java:43: ')' expected
    [javac]         desc = nav.getDescription();
    [javac]                                    ^
    [javac] 4 errors



	at
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandle
r.java:130)
	at
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:2
93)
	at org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:353)
	at org.apache.jasper.compiler.Compiler.compile(Compiler.java:370)
	at
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:4
73)
	at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:1
90)
	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
	at
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.
java:684)
	at
org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatch
er.java:575)
	at
org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher
.java:498)
	at
com.opencms.flex.cache.CmsFlexRequestDispatcher.include(CmsFlexRequestDispat
cher.java:180)
	at com.opencms.flex.CmsJspLoader.service(CmsJspLoader.java:955)
	at
com.opencms.flex.cache.CmsFlexRequestDispatcher.include(CmsFlexRequestDispat
cher.java:268)
	at com.opencms.flex.CmsJspLoader.load(CmsJspLoader.java:567)
	at com.opencms.flex.CmsJspLoader.initlaunch(CmsJspLoader.java:235)
	at com.opencms.core.OpenCms.showResource(OpenCms.java:956)
	at com.opencms.core.OpenCmsHttpServlet.doGet(OpenCmsHttpServlet.java:310)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:247)
	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:193)
	at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:256)
	at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
	at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
	at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va:191)
	at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
	at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
	at
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
	at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180
)
	at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
	at
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.
java:171)
	at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:641)
	at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172
)
	at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:641)
	at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
	at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
:174)
	at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
	at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
	at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
	at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:594)
	at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConne
ction(Http11Protocol.java:392)
	at
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
	at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav
a:619)
	at java.lang.Thread.run(Thread.java:536)

--------------- End of root cause.

	at com.opencms.flex.CmsJspLoader.service(CmsJspLoader.java:962)
	at
com.opencms.flex.cache.CmsFlexRequestDispatcher.include(CmsFlexRequestDispat
cher.java:268)
	at com.opencms.flex.CmsJspLoader.load(CmsJspLoader.java:567)
	at com.opencms.flex.CmsJspLoader.initlaunch(CmsJspLoader.java:235)
	at com.opencms.core.OpenCms.showResource(OpenCms.java:956)
	at com.opencms.core.OpenCmsHttpServlet.doGet(OpenCmsHttpServlet.java:310)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:247)
	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:193)
	at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:256)
	at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
	at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
	at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va:191)
	at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
	at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
	at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)tardPip
eline.java:643)
	at
	at
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
	at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180
)
	at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
	at
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.
java:171)
	at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:641)
	at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172
)
	at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:641)
	at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
	at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
:174)
	at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
	at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
	at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
	at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:594)
	at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConne
ction(Http11Protocol.java:392)
	at
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
	at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav
a:619)
	at java.lang.Thread.run(Thread.java:536)

Does anyone know what to do?

Thanks in advance
Björn

>>> mmihaili at csc.com.au 25.08.2003 03:48:36 >>>
Give the following element a go (obviously the presentation can be
improved) ...

<%@ page session="false" %>
<%@ page import="com.opencms.flex.jsp.*,com.opencms.file.*,java.util.*" %>
<%!
public void buildSiteMap(com.opencms.flex.jsp.CmsJspActionElement cms,
String uri, java.io.Writer out) throws Exception {

  String desc;
  ArrayList navList = cms.getNavigation().getNavigationForFolder(uri);

  if (navList.size() > 0) {

    out.write("<ul>\n");

    Iterator navItem = navList.iterator();
    CmsJspNavElement nav;
    String target;
    while (navItem.hasNext()) {
      nav = (CmsJspNavElement) navItem.next();
      if (nav != null) {
        target = nav.getResourceName();

        out.write("<li>");

        if (nav.isFolderLink()) {
           target = cms.link(target + "index.html");
        } else {
          target = cms.link(target);
        }

        out.write("<a href=\"" + target + "\">" + nav.getNavText() + "</a>
\n");

        desc = nav.getDescription();
        if (desc != null) out.write("  " + desc);

        if (nav.isFolderLink()) {
          buildSiteMap(cms, nav.getResourceName(), out);
        }

      }
    }

    out.write("</ul>\n");

  }
}
%>

<%
  com.opencms.flex.jsp.CmsJspActionElement cms =
      new com.opencms.flex.jsp.CmsJspActionElement(pageContext, request,
response);

  String uri = "index.html";

  buildSiteMap(cms, uri, out);
%>

Later,
Moris Mihailidis
__________________________________________________
CSC
EBS-BSS Web Services e-Business South
58 Queensbridge St, Southbank, VIC 3006, Australia
Ph: +61-3-8695-1527    Fax:+61-3-8695-1540
Email: mmihaili at csc.com.au 
----------------------------------------------------------------------------
------------

This is a PRIVATE message. If you are not the intended recipient, please
delete without copying and kindly advise us by e-mail of the mistake in
delivery. NOTE: Regardless of content, this e-mail shall not operate to
bind CSC to any order or other contract unless pursuant to explicit written
agreement or government initiative expressly permitting the use of e-mail
for such purpose.
----------------------------------------------------------------------------
------------





                      "Joachim Arrasz"
                      <info at arrasz.de>           To:
<opencms-dev at opencms.org>
                      Sent by:                   cc:
                      opencms-dev-admin@         Subject: Re: AW:
[opencms-dev] Sitemap Module
                      opencms.org


                      24/08/2003 01:17
                      AM
                      Please respond to
                      opencms-dev






Hehe Mario,

this is the code, which creates the sitemap :-)

Kind Regards

Achim
--
Questions about OpenCMS?
--> www.opencms-forum.de 


> Mario Wallnöfer>
> Hi Achim,
>
> thanks a lot for your help. but i think your example is more a
> breadcrumb navigation.
>
> what i need is a page, where automatically the whole website is
> displayed(with links)
> like the content in your Sitemap page.
>
> mario
>
> -----Ursprüngliche Nachricht-----
> Von: opencms-dev-admin at opencms.org 
> [mailto:opencms-dev-admin at opencms.org]Im Auftrag von Joachim Arrasz
> Gesendet: Samstag, 23. August 2003 12:41
> An: opencms-dev at opencms.org 
> Betreff: Re: [opencms-dev] Sitemap Module
>
>
> Hi Mario,
>
> i did this with just one jsp. I`m not sure if this works for you but
> have a look:
> <%@ page import="java.util.*,com.opencms.flex.jsp.*" %>
> <%@ page import="com.opencms.file.*" %>
> <%@ taglib prefix="cms" uri="http://www.opencms.org/taglib/cms" %>
>
> <%
>
> // Create a JSP action element
> CmsJspActionElement cms = new CmsJspActionElement(pageContext, request,
> response);CmsObject oCms = cms.getCmsObject();
> String filename = oCms.getRequestContext().getUri();
>
> String sMainNavPath = null;
> String sAbsolutePath = null;
> final String sServletPath =
> oCms.getRequestContext().getRequest().getServletUrl();out.print("<a
> href=\"" + cms.link("/synyx/sitemap.jsp") +"\"
> class=\"Kategorie\">Sitemap:</a>  ");out.print("<a href=\"" +
> cms.link("/synyx/index.jsp") +"\">Home</a> ");
> String sCurrentFolderName =
> oCms.getRequestContext().currentFolder().getName();out.print(">
 <a
> href=\"" +
> cms.link(cms.getRequestContext().currentFolder().getAbsolutePath())
> +"\">" + oCms.getRequestContext().currentFolder().getName() +
>          "</a> ");%>
>
> The output you can see on
>
> www.synyx.de/opencms/opencms/synyx/ 
>
> then just click on sitemap ...
>
> Hope this helps
>
> --
> Questions about OpenCMS?
> --> www.opencms-forum.de 
>
>
>> Mario Wallnofer>
>> Did anyone develop something like a Sitemap Module ??
>>
>>
>> Mario
>> _______________________________________________
>> 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 
_______________________________________________
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



More information about the opencms-dev mailing list