<< Back - Alkacon logo

OpenCms 6.0 interactive documentation:

Show source

OpenCms logo - Forward >>

Source code for: /alkacon-documentation/examples_directedit/demo_7.jsp


<%@ page import="java.util.*, org.opencms.file.*, org.opencms.jsp.*"
	 buffer="none"
	 session="false"
%><%	     
    // create a JSP action element
    CmsJspActionElement cms = new CmsJspActionElement(pageContext, request, response);    

    // create nav builder
    CmsJspNavBuilder nav = cms.getNavigation();
    List entries = nav.getNavigationForFolder();

    // get own uri
    String uri = cms.getRequestContext().getUri();

    // get the template
    String template = cms.property("template", uri);

    // get edit uri
    String editUri = request.getParameter("edit");

    // include the template head
    cms.include(template, "head");

    // set editable
    cms.editable(true);
%>

<h2>Demo for the Java API on a JSP</h2>

<P>
Please see the source code of the JSP generating this page for an example 
of how to work with multiple elements from various pages.
</P>

<%
    for (Iterator i = entries.iterator(); i.hasNext();) {
        String u = ((CmsJspNavElement)i.next()).getFileName();
        if (!u.startsWith("index") && u.endsWith("html")) {
%>        
			<hr>
<%
	        // include editable element from another html file        
        	cms.includeSilent(u, "teaser", true);
        }
%>
<%
    }

    // include the template foot
    cms.include(template, "foot");
%>


©2005 Alkacon Software GmbH (http://www.alkacon.com) - The OpenCms experts