<%@ 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 --%>

1

<%= creationAuthor %>

  

') && Wiki.submitOnce(this) );">

<%-- DIFF section --%> <%-- DIFF section --%> <%-- --%> <%-- if( itemcount > 1 ) { --%>
<% if( ( startitem == -1 ) || ( ( currentPage.getVersion() > startitem ) && ( currentPage.getVersion() <= startitem + pagesize ) ) ) { %> <% } %>
  | <% String changeNote = (String)currentPage.getAttribute( WikiPage.CHANGENOTE ); changeNote = (changeNote != null) ? TextUtil.replaceEntities( changeNote ) : "" ; %> <%= changeNote %>
${pagination} <%-- } /* itemcount > 1 */ --%>
<%-- part 2 : attachments --%> <% int MAXATTACHNAMELENGTH = 30; String progressId = c.getEngine().getProgressManager().getNewProgressIdentifier(); %>

<%-- Do NOT change the order of wikiname and content, otherwise the servlet won't find its parts. --%>

') && Wiki.submitOnce(this) );" >
<%-- FIXME why not add pagination here - no need for large amounts of attach versions on one page --%>

<%----%> <%-- --%> <%-- --%> <% String name = att.getName(); //att.getFileName(); int dot = name.lastIndexOf("."); String attachtype = ( dot != -1 ) ? name.substring(dot+1) : " "; String sname = name; if( sname.length() > MAXATTACHNAMELENGTH ) sname = sname.substring(0,MAXATTACHNAMELENGTH) + "..."; %> <%----%> <%--FIXME classs parameter throws java exception --%> <%-- // FIXME: This needs to be added, once we figure out what is going on. --%> <%-- --%>
<%= attachtype %>
<%= sname %>   <% String changeNote = (String)att.getAttribute(WikiPage.CHANGENOTE); if( changeNote != null ) { changeNote = TextUtil.replaceEntities(changeNote); %><%=changeNote%><% } %>
<%-- end of .tabs --%>