<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@ page trimDirectiveWhitespaces="true" %> <%@ page import="org.crosswire.community.projects.ntmss.data.Apparatus" %> <%@ page import="org.crosswire.community.projects.ntmss.data.Apparatus.Segment" %> <%@ page import="org.crosswire.community.projects.ntmss.data.ProjectManagement" %> <%@ page import="org.crosswire.community.projects.ntmss.data.Transcription" %> <%@ page import="org.crosswire.webtools.RightsAndRoles" %> <%@ page import="org.crosswire.xml.XMLBlock" %> <%@ page import="org.crosswire.webtools.annotation.*" %> <%@ page import="org.crosswire.webtools.*" %> <%@ page import="javax.validation.constraints.NotNull" %> <%! @Description(value = "Submit a new or modified segment reading witness attestation.", name = "variant/put") public static class MyParameters extends Parameters { protected ProjectManagement.Project project = null; @NotNull @Description(value = "segment id at which an attestation is being made", example = "18582") public Integer segmentID = null; @Description(value = "internal") public Integer segID = null; @NotNull @Description(value = "manuscript id which is attesting to a reading at a segment", example = "10046") public Integer docID = null; @Description(value = "verse instance identifier to disambiguate for manuscripts which have multiple attestations to the same verse at a segment. This is used when a witness repeats the same verse multiple times, e.g., a commentary or lectionary may have multiple occurances of John 3:16 within the document. This field allows a designator to specify which occurance a witness attestation is being created or modified", example = "A") public String verseInstance; @Description(value = "which scribal hand within a witness, other than the original scribe, is attesting to a reading at a segment (i.e., if a corrector is witnessing differently from the original hand)", example = "C1") public String hand; @NotNull @Description(value = "which reading is being attested to by this witness at this segment", example = "27932") public Integer segmentReadingID = null; @Description(value = "if this reading is unsure, i.e. ut videtur (= V)", defaultValue = "false", example = "true") public Boolean unsure = false; @Description(value = "if this reading is unsureMajor, i.e. ut videtur (= V) with supplied which spans an entire word or more", defaultValue = "false", example = "true") public Boolean unsureMajor = false; @Description(value = "if this reading is regularized (= r) to a point that we wish to mark it as such. It may not be a desire to markup some minor or common regularizations, like NomSacs", defaultValue = "false", example = "true") public Boolean regularized = false; @Description(value = "if this reading is from a document supplement (= S) and not the original production unit", defaultValue = "false", example = "true") public Boolean supplement = false; @Description(value = "if this reading is determined nonsensical, i.e. Fehler (= f), a non-deliberate scribal error", defaultValue = "false", example = "true") public Boolean nonsense = false; @Description(value = "if this reading contains an omission and determined haplography (= lacuna H)", defaultValue = "false", example = "true") public Boolean omHap = false; @Description(value = "if this reading contains an omission and determined commentary abbreviated (= lacuna A)", defaultValue = "false", example = "true") public Boolean omComAbbr = false; @Description(value = "[use boolean flags above instead of {siglumSuffix}, if possible] any suffix to add to the witness siglum when displaying; this overrides any computed suffix from {unsure}, {unsureMajor}, {regularized}, {supplement}, {nonsense}, {omHap}, {omComAbbr} (VrSfHA)", example = "rV") public String siglumSuffix; @Description(value = "the witness transcription at this point", example = "Χριστου") public String transcription; @Description(value = "subLabel suffix for the segment reading label", example = "o") public String subLabel; @Description(value = "Alternate subLabel reading transcription. Sublabel transcriptions are normally simply the original witness transcription, but if this is not the desire for this instance (due to regularization) the subLabel reading text can be supplied here", example = "Ιησου") public String altSublabelTranscription; @Description(value = "If this siglum represents a witness group, this allows additional qualification of that group at this location", example = "+1022, -1549") public String siglumGroupQualifier; @Description(value = "Comment regarding this segment reading witness attestation. Meant only for internal team use") public String commentPrivate; @Description(value = "Comment regarding this segment reading witness attestation. Meant for publication") public String commentPublic; @Description(value = "Comment regarding this segment witness attestation. Meant for publication") public String commentSegmentPublic; @Description(value = "internal") public String comment; @Description(value = "keep this entry within an alternate projectID, overriding the default segmentGroupID", example = "1") public Integer projectID; @Description(value = "specify {projectID} by supplying a project name", example = "ECM Matthew") public String projectName; @Description(value = "whether or not to include a checksum for the segment and reading, for checking and syncing back to modified segments and readings. Useful for versionists who add data to an apparatus which may change from under them", defaultValue = "false", example = "true") public Boolean addChecksum = false; @Override protected void afterLoad() { transcription = Transcription.assureUnicode(transcription); hand = Transcription.assureUnicode(hand); verseInstance = Transcription.assureUnicode(verseInstance); siglumGroupQualifier = Transcription.assureUnicode(siglumGroupQualifier); commentPrivate = Transcription.assureUnicode(commentPrivate); commentPublic = Transcription.assureUnicode(commentPublic); commentSegmentPublic = Transcription.assureUnicode(commentSegmentPublic); comment = Transcription.assureUnicode(comment); if (comment != null && comment.trim().length() > 0 && (commentPublic == null || commentPublic.trim().length() == 0)) commentPublic = comment; altSublabelTranscription = Transcription.assureUnicode(altSublabelTranscription); if (segmentID == null && segID != null) segmentID = segID; if (segmentReadingID == null) segmentReadingID = -1; } @Override protected void customValidation() { try { if (projectName != null) projectName = Transcription.assureUnicode(projectName); } catch (Exception e) {} project = projectID != null ? ProjectManagement.getProject(projectID) : ProjectManagement.getProject(projectName); if (projectID == null && project != null) projectID = project.getProjectID(); } } %> <% MyParameters params = new MyParameters().loadFromRequest(request, response, false); int segmentReadingID = -1; try {segmentReadingID = Integer.parseInt(request.getParameter("segmentReadingID"));} catch (Exception e){} if (params.docID != null && params.segmentID != null) { response.setContentType("text/xml"); // let's check to see if we're a privileged user boolean permission = RightsAndRoles.hasRole(request, response, "VMR Administrator"); if (!permission) { Segment seg = Apparatus.Segment.getSegment(params.segmentID); if (seg != null) { for (Integer i : seg.getSegmentGroups()) { ProjectManagement.Project pr = ProjectManagement.getProject(i); permission = RightsAndRoles.hasRole(request, response, "Site Administrator", pr.getProjectName()); if (!permission) permission = RightsAndRoles.hasRole(request, response, "Project Managing Editor", pr.getProjectName()); if (!permission) permission = RightsAndRoles.hasRole(request, response, "Project Editor", pr.getProjectName()); if (permission) break; } } } if (!permission && params.projectID != null) { ProjectManagement.Project pr = ProjectManagement.getProject(params.projectID); if (pr != null) permission = RightsAndRoles.hasRole(request, response, "Project Editor", pr.getProjectName()) || RightsAndRoles.hasRole(request, response, "Project Managing Editor", pr.getProjectName()); } if (permission) { Apparatus.setSegmentReadingWitness(params.segmentID, params.docID, params.verseInstance, params.hand, params.segmentReadingID, params.unsure, params.unsureMajor, params.regularized, params.supplement, params.nonsense, params.omHap, params.omComAbbr, params.transcription, params.commentPrivate, params.commentPublic, params.commentSegmentPublic, params.subLabel, params.altSublabelTranscription, false, params.siglumSuffix, params.siglumGroupQualifier, params.projectID, params.addChecksum, params.getUser().getUserName()); %> <% } else { %> <% } return; } else params.format = "html"; Serializer.reportErrors(request, response, out, params, true); %>