<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@ page trimDirectiveWhitespaces="true" %> <%@ page import="org.crosswire.utils.Sessions" %> <%@ page import="org.crosswire.community.RightsAndRoles" %> <%@ page import="org.crosswire.community.projects.ntmss.data.Document" %> <%@ page import="org.crosswire.community.projects.ntmss.data.Page" %> <% String userName = Sessions.getSessionStringValue(request, "userName"); int docID = -1; try {docID = Integer.parseInt(request.getParameter("docID"));} catch (Exception e){} boolean all = false; String pageID[] = null; if ("all".equals(request.getParameter("pageID"))) all = true; else try {pageID = request.getParameterValues("pageID");} catch (Exception e){} if (docID > -1 && (all || (pageID != null && pageID.length > 0))) { response.setContentType("text/xml"); Document doc = Document.getDocument(docID); if (doc == null) { %> <% return; } String role = "VMR Administrator"; // let's check to see if we're a privileged user boolean permission = RightsAndRoles.hasRole(request, response, role) || (userName != null && userName.equals(doc.getUserID())); // --------------------------------------------- if (permission) { if (all) { doc.removeAllPagesAndSurrogates(); %> <% } else { int success = 0; for (String pid : pageID) { int id = -1; try { id = Integer.parseInt(pid); } catch (Exception e) {} if (id > -1) { Page p = null; p = Page.getPage(docID, id); if (p != null) { Page.deletePage(p.getDocumentID(), p.getPageID()); ++success; } } } %> <% } } else { %> <% } return; } %>

manuscript/deletepage

Delete page (along with all surrogates for page) from a manuscript

Parameters

docIDmanuscript id, e.g., 10046
pageIDpage id or 'all', e.g., 10