From feaaa8f7abc362db30b22d35d3901bd8a9e58e5b Mon Sep 17 00:00:00 2001 From: Sarah Morrissey Date: Wed, 25 Oct 2017 13:54:11 -0400 Subject: [PATCH] added publish for digital objects --- .../plugin/utils/aspace/ASpaceEnumUtil.java | 5 +---- .../archiviststoolkit/plugin/utils/aspace/ASpaceMapper.java | 5 +++++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/org/archiviststoolkit/plugin/utils/aspace/ASpaceEnumUtil.java b/src/org/archiviststoolkit/plugin/utils/aspace/ASpaceEnumUtil.java index 521d9b7..c28474d 100644 --- a/src/org/archiviststoolkit/plugin/utils/aspace/ASpaceEnumUtil.java +++ b/src/org/archiviststoolkit/plugin/utils/aspace/ASpaceEnumUtil.java @@ -84,8 +84,6 @@ public Object[] getASpaceSubjectSource(String atValue) { String code; code = lookupListValuesToCodes.get(atValue); - System.out.println(atValue); - System.out.println(code); atValue = atValue.toLowerCase(); @@ -107,8 +105,7 @@ public Object[] getASpaceSubjectSource(String atValue) { if (code == null || code.isEmpty()) code = "local"; else code = code.replace(".", ""); } - System.out.println(code); - System.out.println(getASpaceEnumValue("subject_source", code)[0] + "\n"); + return getASpaceEnumValue("subject_source", code); } diff --git a/src/org/archiviststoolkit/plugin/utils/aspace/ASpaceMapper.java b/src/org/archiviststoolkit/plugin/utils/aspace/ASpaceMapper.java index d1695e1..9060e58 100644 --- a/src/org/archiviststoolkit/plugin/utils/aspace/ASpaceMapper.java +++ b/src/org/archiviststoolkit/plugin/utils/aspace/ASpaceMapper.java @@ -1337,6 +1337,8 @@ public JSONObject convertToDigitalObjectComponent(DigitalObjects record) throws String title = record.getObjectLabel(); json.put("title", fixEmptyString(title)); + json.put("publish", publishHashMap.get("digitalObjects")); + addLanguageCode(json, record.getLanguageCode()); /* add fields required for digital object component*/ @@ -1784,6 +1786,9 @@ private JSONArray addAssessmentsAgent(String name, Assessments assessment) throw namesJA.put(nameJSON); json.put("names", namesJA); + json.put("publish", false); + json.put("agent_type", "agent_person"); + //save the agent to ASpace String endpoint = "/agents/people"; String id = aspaceCopyUtil.saveRecord(endpoint , json.toString(), "Assessments->" + assessment.getIdentifier());