<%@ 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" %> <% int docID = -1; try {docID = Integer.parseInt(request.getParameter("docID"));} catch (Exception e){} int pageID = -1; try {pageID = Integer.parseInt(request.getParameter("pageID"));} catch (Exception e){} String folio = request.getParameter("folio"); String userName = Sessions.getSessionStringValue(request, "userName"); if (docID > -1 && pageID > -1) { 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())); // --------------------------------------------- Page p = Page.getPage(docID, pageID); if (p != null) { Page pOrig = (Page)p.clone(); if (folio != null) { // if (p.getFolioNumber() != null && p.getFolioNumber().length() > 0 && !permission) { // for folios, we want anyone to be able to edit as long as they are logged in if (userName == null || userName.length() == 0) { %> <% return; } p.setFolioNumber(folio); } p.save(pOrig); %> <% } else { // we check permissions here instead of at the top because folio editing can be done by anyone logged in if (!permission) { %> <% return; } p = new Page(); p.setDocumentID(docID); p.setPageID(pageID); if (folio != null) { p.setFolioNumber(folio); } p.saveNew(); %> <% } return; } %>

manuscript/putpage

Submit a new or modified page for a manuscript

Parameters

docIDmanuscript id for the variant reading, e.g., 10046
pageIDpage id for the variant reading, e.g., 10
foliofolio number