<%@ page import="com.arsdigita.cms.*,com.arsdigita.cms.dispatcher.ContentSectionDispatcher,com.arsdigita.dispatcher.*,com.arsdigita.persistence.*" %> <% ContentSection section = ContentSectionDispatcher.getContentSection(request); if (section != null) { %> <% RequestContext rc = DispatcherHelper.getRequestContext(request); String folderPath = rc.getRemainingURLPart(); folderPath = folderPath.substring(0, folderPath.lastIndexOf('/') + 1); DataQuery topFolders = SessionManager.getSession().retrieveQuery( "com.arsdigita.cms.liveTopLevelFolders"); topFolders.setParameter("section_id", section.getID()); while (topFolders.next()) { String topFolderPath = topFolders.get("folderName") + "/"; String folderGraphic = topFolderPath.equals(folderPath) ? "open" : "closed"; %> <% if (folderPath.startsWith((String) topFolders.get("folderName"))) { %> <% DataQuery subFolders = SessionManager.getSession().retrieveQuery( "com.arsdigita.cms.liveSubFolders"); subFolders.setParameter("root_folder_id", topFolders.get("folderID")); while (subFolders.next()) { // Begin subfolder loop String subFolderPath = topFolderPath + subFolders.get("folderName") + "/"; String subFolderGraphic = subFolderPath.equals(folderPath) ? "selected" : "closed"; %> <% } %> <% } %> <% } %>
 <%=topFolders.get("folderLabel")%>
 <%=subFolders.get("folderLabel")%>
<% } %>