<%@ 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.ShelfInstance" %> <%@ page import="java.util.StringTokenizer" %> <% String userName = Sessions.getSessionStringValue(request, "userName"); int shelfID = -1; try {shelfID = Integer.parseInt(request.getParameter("shelfID"));} catch (Exception e){} int docID = -1; try {docID = Integer.parseInt(request.getParameter("docID"));} catch (Exception e){} String pageIDs =request.getParameter("pageID"); if (shelfID > -1) { response.setContentType("text/xml"); String role = "VMR Administrator"; // let's check to see if we're a privileged user boolean permission = RightsAndRoles.hasRole(request, response, role); // --------------------------------------------- if (!permission) { %> <% return; } ShelfInstance si = ShelfInstance.getShelfInstance(shelfID); if (si == null) { %> <% return; } StringTokenizer pids = new StringTokenizer(pageIDs, "|"); int success = 0; while (pids.hasMoreTokens()) { try { int pageID = Integer.parseInt(pids.nextToken()); success += si.unlinkPage(docID, pageID); } catch (Exception e) { e.printStackTrace(); } } %> , to shelfID: <%= shelfID %>" /> <% return; } %>

shelfinstance/unlinkpage

Unlink a manuscript page from a shelf instance

Parameters

shelfIDshelf id of the shelf instance
docIDoptional, manuscript id for page(s) to unlink, e.g., 10046, if not passed, all pages of every document will be unlinked from this shelf instance
pageID[|pageID...]option, page id or ids to unlink from the shelf instance, e.g., 10|20|30, if not passed, all pages of the specified docID will be unliked from this shelf instance