opencms 取得下一级导航

<%@ page import="java.util.*,org.opencms.jsp.*,org.opencms.file.CmsResource.*,org.opencms.frontend.templateone.*" %>
<%
// Create a JSP action element
CmsJspActionElement cms = new CmsJspActionElement(pageContext, request, response);
// Some shortcuts to often used Strings
String filename = cms.getCmsObject().getRequestContext().getUri();
String foldername=org.opencms.file.CmsResource.getFolderPath(filename);
String foldericon=cms.link("system/modules/com.alkacon.documentation/resources/ic_folder.gif");
String fileicon=cms.link("system/modules/com.alkacon.documentation/resources/ic_file.gif");

// List of all pages / subfolders (sorted by NavPos property)
List list = cms.getNavigation().getNavigationForFolder();
Iterator i = list.iterator();
// Now build the navigation
out.println("<div id=\"dhtmlgoodies_slidedown_menu\"><ul>");
while (i.hasNext()) {
    CmsJspNavElement ne = (CmsJspNavElement)i.next();
   
    String target=ne.getProperty("target");
    if(target==null)
        target="_self";
    if (ne.getResourceName().equals(filename)) {
       out.println("<b>");
       out.println(ne.getNavText()+"</b>");
    } 
    else { 
        out.println("<li><a href=\"" + cms.link(ne.getResourceName()) + "\"target=\""+"\">" + ne.getNavText() + "</a></li>");
        if(ne.isFolderLink()){
           List subnav = cms.getNavigation().getSiteNavigation(ne.getResourceName(),-1);
           Iterator j = subnav.iterator();
           out.println("<ul>");
           while (j.hasNext()) {
                CmsJspNavElement ne2 = (CmsJspNavElement)j.next();
                if (!ne2.getResourceName().equals(filename)) {
                   out.println("<li><a href=\"" + cms.link(ne2.getResourceName()) + "\"target=\""+"\">" + ne2.getNavText() + "</a></li>"); 
                }
                else {
                      out.println("<b>");
                      out.println(ne2.getNavText()+"</b>");
                }
            }
         out.println("</ul>");
         } 
    } 
}
    out.println("</ul></div>");
%>



取得当期栏目的子栏目
    <%@ page import="java.util.*,org.opencms.jsp.*" %>
    
    <%   
       // Create a JSP action element
       CmsJspActionElement cms = new CmsJspActionElement(pageContext, request, response);

       // Get the current file and folder name
       String filename = cms.getCmsObject().getRequestContext().getUri();
       String foldername = org.opencms.file.CmsResource.getFolderPath(filename);

       String foldericon = cms.link("/system/modules/com.alkacon.documentation/resources/ic_folder.gif");
       String fileicon = cms.link("/system/modules/com.alkacon.documentation/resources/ic_file.gif");

       // Get a simple navigation of all pages/subfolders in the current folder
       List list = cms.getNavigation().getNavigationForFolder();
   %>


   <%   
      Iterator i = list.iterator();
    
      while (i.hasNext()) {
            CmsJspNavElement ne = (CmsJspNavElement)i.next();

    	    String target = ne.getProperty("target");
            if (target == null) target = "_self";

            if (ne.getResourceName().equals(filename)) {  
                 out.println("\n<li>\n");
                 if (ne.isFolderLink()) {
                     out.println("<img src=\"" + foldericon + "\" border=\"0\" alt=\"folder\"> ");
                 } else {
                     out.println("<img src=\"" + fileicon + "\" border=\"0\" alt=\"file\"> ");
                 }   
                 out.println(ne.getNavText() + "\n</li>\n");
            } else {
                 out.println("<li>\n<a href=\"" + cms.link(ne.getResourceName()) 
                             + "\" target=\"" + target + "\" >");
                 if (ne.isFolderLink()) {
                     out.println("<img src=\"" + foldericon + "\" border=\"0\" alt=\"folder\"> ");
                 } else {
                     out.println("<img src=\"" + fileicon + "\" border=\"0\" alt=\"file\"> ");
                 }               
                 out.println(ne.getNavText() + "\n</li>");
            }
       }
   %>



RIA知识库
flex
RIA

你可能感兴趣的:(cms,jsp,J#)