CenterForDigitalHumanities / TPEN-NL

0 stars 0 forks source link

Import manifest from UofT to start project #7

Closed cubap closed 3 years ago

thehabes commented 3 years ago

Here is a nice small one from Italian paleography production. It is my user's Prayers to Saint Jerome scroll.

thehabes commented 3 years ago

Results in successful project creation. Creates one empty annotation list for the one page : http://devstore.rerum.io/v1/id/5fc54559e4b04b611696f707. Generates new TPEN ID and project is available at http://paleo.rerum.io/TPEN-NL/italianTranscription.html?projectID=5860

thehabes commented 3 years ago

Project title is fromWebService, newBerry fromWebService project

thehabes commented 3 years ago

Compare these for reference

https://transcribe.library.utoronto.ca/paleography/project/5199

http://paleo.rerum.io/TPEN-NL/project/5860

thehabes commented 3 years ago

Looks like it only screws up label and @id so all around good news. Depending on whether we want line content/parsing, only some small fixes to CreateProjectServlet.java and ProjectServlet.java are required.

thehabes commented 3 years ago

Manifest generation :

String repository = "newBerry";
String archive = "";
String city = "unknown";
String collection = "unknown";
city = request.getParameter("city");
if (null == city) {
    city = "fromWebService";
}
textdisplay.Manuscript m = null;
 JSONObject jo = resolveManifestURL(str_manifest);
 archive = jo.getString("@id");
 //create a manuscript
m = new textdisplay.Manuscript("newBerry", archive, city, city, -999);
.
.
.
String tmpProjName = m.getShelfMark() + " project";
if (request.getParameter("title") != null) {
    tmpProjName = request.getParameter("title");
}
try (Connection conn = ServletUtils.getDBConnection()) {
    conn.setAutoCommit(false);
    //This creates a master transcription, so the creating user is the leader so they can parse.
    Group newgroup = new Group(conn, tmpProjName, UID);
    Project newProject = new Project(conn, tmpProjName, newgroup.getGroupID());
.
.
.

We could probably be better about labels/titles/names/whatever. FIXME around this.

Results in a group with one member (current logged in user) who is a leader. This should be right

Annotation List generation. List is connected to Canvas via :

Folio folio = new Folio(ls_folios_keys.get(i));
array_folios[i] = folio;
//Parse folio.getImageURL() to retrieve paleography pid, and then generate new canvas id
String imageURL = folio.getImageURL();
// use regex to extract paleography pid
String canvasID = man.getProperties().getProperty("PALEO_CANVAS_ID_PREFIX") + imageURL.replaceAll("^.*(paleography[^/]+).*$", "$1");
//create anno list for original canvas
JSONObject annoList = CreateAnnoListUtil.createEmptyAnnoList(newProject.getProjectID(), canvasID, man.getProperties().getProperty("TESTING"), new JSONArray(), UID, request.getLocalName() );
URL postUrl = new URL(Constant.ANNOTATION_SERVER_ADDR + "/create.action");
.
.
.
thehabes commented 3 years ago

manifest @id and sequence @id are generated programmatically by ProjectServlet.java and probably should not be http://paleo.rerum.io/TPEN-NL/fromWebService, newBerry fromWebService project/sequence/normal and http://paleo.rerum.io/TPEN-NL/fromWebService, newBerry fromWebService project/manifest.json.

cubap commented 3 years ago

Whiteboard 1 -01

cubap commented 3 years ago

Yeah. This is worth saving.

thehabes commented 3 years ago

Issues required for proper functionality

  1. 37

  2. 39

  3. 40

  4. 41

Related Questions

  1. 26

  2. 27

Other

  1. 42

  2. 16