<%@ page import="org.apache.log4j.*" %> <%@ page import="com.ecyrd.jspwiki.*" %> <%! public void jspInit() { wiki = WikiEngine.getInstance( getServletConfig() ); } Category log = Category.getInstance("JSPWiki"); WikiEngine wiki; %> <% String pagereq = wiki.safeGetParameter( request, "page" ); String headerTitle = ""; if( pagereq == null ) { pagereq = "Main"; } NDC.push( wiki.getApplicationName()+":"+pagereq ); String pageurl = wiki.encodeName( pagereq ); log.info("Request for page '"+pagereq+"' from "+request.getRemoteHost()+" by "+request.getRemoteUser() ); String specialpage = wiki.getSpecialPageReference( pagereq ); if( specialpage != null ) { response.sendRedirect( specialpage ); return; } // // Determine requested version. If version == -1, // then fetch current version. // int version = -1; String rev = request.getParameter("version"); String pageReference = "this page"; String versionInfo = ""; if( rev != null ) { version = Integer.parseInt( rev ); pageReference = "current version"; } WikiPage wikipage = wiki.getPage( pagereq, version ); // In the future, user access permits affect this boolean isEditable = (version < 0); String rssURL = wiki.getGlobalRSSURL(); // // Alright, then start responding. // response.setContentType("text/html; charset="+wiki.getContentEncoding() ); %> <%=wiki.getApplicationName()%>: <%=pagereq%><%=versionInfo%> <%@ include file="cssinclude.js" %> <%if( rssURL != null ) { %> <% } %>
<%@ include file="LeftMenu.jsp" %>

<% if( isEditable ) { %> Edit <%=pageReference%> <% } %>

<%@ include file="LeftMenuFooter.jsp" %> <%if(rssURL != null) { %>


<% } %>
<%@ include file="PageHeader.jsp" %> <% if( version > 0 ) { %>

This is version <%=version%>. It is not the current version, and thus it cannot be edited. (Back to current version)

<% } %> <% if( wiki.pageExists( pagereq ) ) { // if version == -1, the current page is returned. out.println(wiki.getHTML(pagereq, version)); } else { if(version == -1) { %> This page does not exist. Why don't you go and create it? <% } else { %> This version of the page does not seem to exist. <% } } %>


<% if( isEditable ) { %> Edit <%=pageReference%>.    <% } %> <% if( wikipage != null ) { %> More info...
<% } %>
<% if( wikipage != null ) { java.util.Date lastchange = wikipage.getLastModified(); String author = wikipage.getAuthor(); if( author == null ) author = "unknown"; if( version == -1 ) { %> This page last changed on <%=lastchange%> by <%=author%>. <% } else { %> This particular version was published on <%=lastchange%> by <%=author%>. <% } } else { %> Page not created yet. <% } %>
<% NDC.pop(); NDC.remove(); %>