<%@ 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.ProjectManagement" %> <%@ page import="org.crosswire.community.projects.ntmss.data.ProjectManagement.Project" %> <% int paramCount = 0; int projectID = -2; try {projectID = Integer.parseInt(request.getParameter("projectID")); ++paramCount; } catch (Exception e){} int documentGroupID = -1; try {documentGroupID = Integer.parseInt(request.getParameter("documentGroupID")); ++paramCount; } catch (Exception e){} int taskTypeID = -1; try {taskTypeID = Integer.parseInt(request.getParameter("taskTypeID")); ++paramCount; } catch (Exception e){} String name = request.getParameter("name"); if (name != null) {name = new String(name.getBytes("iso8859-1"), "UTF-8"); ++paramCount; } String configuration = request.getParameter("configuration"); if (configuration != null) {configuration = new String(configuration.getBytes("iso8859-1"), "UTF-8"); ++paramCount; } String transcriptionAttribution = request.getParameter("transcriptionAttribution"); if (transcriptionAttribution != null) {transcriptionAttribution = new String(transcriptionAttribution.getBytes("iso8859-1"), "UTF-8"); ++paramCount; } String userGroup = request.getParameter("userGroup"); if (userGroup != null) { userGroup = new String(userGroup.getBytes("iso8859-1"), "UTF-8"); ++paramCount; } String objectPart = request.getParameter("objectPart"); if (objectPart != null) { objectPart = new String(objectPart.getBytes("iso8859-1"), "UTF-8"); ++paramCount; } String userName = Sessions.getSessionStringValue(request, "userName"); if (paramCount > 0) { response.setContentType("text/xml"); // // let's check to see if we're a privileged user String role = "VMR Administrator"; Project p = null; if (projectID > -1) { p = ProjectManagement.getProject(projectID); } boolean permission = RightsAndRoles.hasRole(request, response, role) || RightsAndRoles.hasRole(request, response, "Site Owner", (p != null) ? p.getProjectName() : name); if (userName == null) { out.print(""); return; } if (!permission) { out.print(""); return; } Project orig = null; Project project = null; if (projectID == -2) { project = new Project(); if (name == null) { %> <% return; } } else { orig = ProjectManagement.getProject(projectID); if (orig == null) { %> <% return; } project = (Project)orig.clone(); } if (name != null) project.setProjectName(name); if (userGroup != null) project.setUserGroup(userGroup); if (objectPart != null) project.setObjectPart(objectPart); if (documentGroupID != -1) project.setDocumentGroupID(documentGroupID); if (taskTypeID != -1) project.setTaskTypeID(taskTypeID); if (configuration != null) project.setConfiguration(configuration); if (transcriptionAttribution != null) project.setTranscriptionAttribution(transcriptionAttribution); if (orig != null) { project.save(orig); } else { project = project.saveNew(); } out.print(""); return; } %>

project/put

Create a new or update an existing project record.

Parameters

projectIDProject ID, supply to edit an existing project; otherwise, do not include when adding a new project
nameProject name
userGroupUser Group for this project; corresponds to a portal user group name
objectPartObject Part for this project; limits project to a portion of each object, e.g., "Matthew"
documentGroupIDDocument Group ID for this project; limits project to list of documents
taskTypeIDTask Type ID for this project (1-imaging; 2-indexing; 3-transcribing; 4-variant selection)
configurationProject-specific configuration data
transcriptionAttributionCredit to include with project transription