<%@ 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" %> <% String userName = Sessions.getSessionStringValue(request, "userName"); int paramCount = 0; int shelfID = -2; try {shelfID = Integer.parseInt(request.getParameter("shelfID")); ++paramCount; } catch (Exception e){} int instID = -1; try {instID = Integer.parseInt(request.getParameter("instID")); ++paramCount; } catch (Exception e){} String shelfNum = request.getParameter("shelfNum"); if (shelfNum != null) {shelfNum = new String(shelfNum.getBytes("iso8859-1"), "UTF-8"); ++paramCount; } String formerGA = request.getParameter("formerGA"); if (formerGA != null) { formerGA = new String(formerGA.getBytes("iso8859-1"), "UTF-8"); ++paramCount; } String contentOverview = request.getParameter("contentOverview"); if (contentOverview != null) { contentOverview = new String(contentOverview.getBytes("iso8859-1"), "UTF-8"); ++paramCount; } String leavesDesc = request.getParameter("leavesDesc"); if (leavesDesc != null) { leavesDesc = new String(leavesDesc.getBytes("iso8859-1"), "UTF-8"); ++paramCount; } int leavesCount = -1; try {leavesCount = Integer.parseInt(request.getParameter("leavesCount")); ++paramCount; } catch (Exception e){} String origYearDesc = request.getParameter("origYearDesc"); if (origYearDesc != null) { origYearDesc = new String(origYearDesc.getBytes("iso8859-1"), "UTF-8"); ++paramCount; } if (paramCount > 0) { 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); // --------------------------------------------- // assert we have permission if (userName == null || userName.length() == 0) { out.print(""); return; } if (!permission) { out.print(""); return; } ShelfInstance orig = null; ShelfInstance inst = null; if (shelfID == -2) { inst = new ShelfInstance(); if (instID < 0) { %> <% return; } } else { orig = ShelfInstance.getShelfInstance(shelfID); if (orig == null) { %> <% return; } inst = (ShelfInstance)orig.clone(); } if (instID > -1) inst.setInstitutionID(instID); if (shelfNum != null) inst.setShelfNumber(shelfNum); if (formerGA != null) inst.setFormerGANumber(formerGA); if (contentOverview != null) inst.setContentOverview(contentOverview); if (leavesDesc != null) inst.setLeavesDescription(leavesDesc); if (leavesCount > -1) inst.setLeavesCount(leavesCount); if (origYearDesc != null) inst.setOriginYearDescription(origYearDesc); if (orig != null) { inst.save(orig); } else { inst = inst.saveNew(); } out.print(""); return; } %>

shelfinstance/put

Create a new or update an existing shelf instance record.

Parameters

shelfIDShelf Instance ID, supply to edit an existing shelf instance; otherwise, do not include when adding a new shelf instance
instIDInstitution ID of the holding institute
shelfNumShelf Number, assigned by the holding institute
formerGAif this shelf instance was given a Gregory Aland number previously, which is now deprecated.
contentOverviewContent Overview, e.g., eapr
leavesDescLeaves Description, e.g., 12 fragments.
leavesCountLeaves Count, e.g., 12
origYearDescOrigin Year Description, e.g., III