<%@ page session="false" %><%@ page import="java.util.*,org.opencms.jsp.*,org.opencms.file.*,java.text.DateFormat, java.text.SimpleDateFormat, org.opencms.main.*" %><%@ taglib prefix="cms" uri="http://www.opencms.org/taglib/cms" %><%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %> <%! protected String BASE_URL=""; public static SimpleDateFormat ISO8601FORMAT = new SimpleDateFormat("yyyy-MM-dd"); private String recurseTree(CmsObject cmso,CmsJspActionElement jsp, String path) { StringBuffer sb = new StringBuffer(); try { ArrayList files = (ArrayList) cmso.getFilesInFolder(path); Iterator i = files.iterator(); while (i.hasNext()) { CmsFile f = (CmsFile) i.next(); //String thispath = jsp.link(cmso.getSitePath(f)); String thispath = cmso.getSitePath(f); CmsProperty secret = cmso.readPropertyObject(f,"sitemap_hidden",true); CmsProperty changeFreqProperty = cmso.readPropertyObject(f,"sitemap_change_frequency",true); CmsProperty priorityProperty = cmso.readPropertyObject(f,"sitemap_priority",true); String changeFrequency = changeFreqProperty.getValue("weekly"); String priority = priorityProperty.getValue("1"); if ((secret.getValue("false") == "false") && (thispath.endsWith("html")||thispath.endsWith("jsp")||thispath.endsWith("pdf"))) { sb.append("\n"); sb.append(""+BASE_URL+thispath+"\n"); //DateFormat df = DateFormat.getDateInstance(); String niceDate = ISO8601FORMAT.format(new Date(f.getDateLastModified())); sb.append(""+niceDate+"\n"); sb.append(""+changeFrequency+"\n"); sb.append(""+priority+"\n"); sb.append("\n"); } } ArrayList folders = (ArrayList) cmso.getSubFolders(path); Iterator j = folders.iterator(); while (j.hasNext()) { CmsFolder f = (CmsFolder) j.next(); sb.append( recurseTree(cmso,jsp, cmso.getSitePath(f) ) ); } } catch (CmsException cmsException) { sb.append("A CMS exception occurred: "+cmsException.toString()); } return sb.toString(); } %><% CmsJspActionElement cms = new org.opencms.jsp.CmsJspActionElement(pageContext, request, response); CmsObject cmso = cms.getCmsObject(); String url = cms.info("opencms.url"); int lastSlash = url.indexOf("/",8); BASE_URL = url.substring(0,lastSlash); out.print(recurseTree(cmso,cms, "/nav/")); %>