AW: [opencms-dev] Sitemap Module
mmihaili at csc.com.au
mmihaili at csc.com.au
Mon Aug 25 04:12:02 CEST 2003
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
More information about the opencms-dev
mailing list