%--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
--%>
<%@ taglib uri="/WEB-INF/jspwiki.tld" prefix="wiki" %>
<%@ page import="org.apache.wiki.*" %>
<%@ page import="org.apache.wiki.auth.*" %>
<%@ page import="org.apache.wiki.auth.permissions.*" %>
<%@ page import="org.apache.wiki.attachment.*" %>
<%@ page import="org.apache.wiki.i18n.InternationalizationManager" %>
<%@ page import="java.security.Permission" %>
<%@ page import="javax.servlet.jsp.jstl.fmt.*" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
WikiContext c = WikiContext.findContext(pageContext);
WikiPage wikiPage = c.getPage();
int attCount = c.getEngine().getAttachmentManager().listAttachments( c.getPage() ).size();
String attTitle = LocaleSupport.getLocalizedMessage(pageContext, "attach.tab");
if( attCount != 0 ) attTitle += " (" + attCount + ")";
String parm_renameto = (String)request.getParameter( "renameto" );
if( parm_renameto == null ) parm_renameto = wikiPage.getName();
String creationAuthor ="";
//FIXME -- seems not to work correctly for attachments !!
WikiPage firstPage = c.getEngine().getPage( wikiPage.getName(), 1 );
if( firstPage != null )
{
creationAuthor = firstPage.getAuthor();
if( creationAuthor != null && creationAuthor.length() > 0 )
{
creationAuthor = TextUtil.replaceEntities(creationAuthor);
}
else
{
creationAuthor = c.getBundle( InternationalizationManager.CORE_BUNDLE ).getString( "common.unknownauthor" );
}
}
int itemcount = 0; //number of page versions
try
{
itemcount = wikiPage.getVersion(); /* highest version */
}
catch( Exception e ) { /* dont care */ }
int pagesize = 20;
int startitem = itemcount-1; /* itemcount==1-20 -> startitem=0-19 ... */
String parm_start = (String)request.getParameter( "start" );
if( parm_start != null ) startitem = Integer.parseInt( parm_start ) ;
/* round to start of block: 0-19 becomes 0; 20-39 becomes 20 ... */
if( startitem > -1 ) startitem = ((startitem)/pagesize) * pagesize;
/* startitem drives the pagination logic */
/* startitem=-1:show all; startitem=0:show block 1-20; startitem=20:block 21-40 ... */
%>
<%-- part 1 : normal wiki pages --%>
<%-- --%>
<%-- actual infopage content --%>