diff --git a/src/main/java/org/gcube/gcat/persistence/ckan/CKANPackage.java b/src/main/java/org/gcube/gcat/persistence/ckan/CKANPackage.java index a2d972a..87bac0a 100644 --- a/src/main/java/org/gcube/gcat/persistence/ckan/CKANPackage.java +++ b/src/main/java/org/gcube/gcat/persistence/ckan/CKANPackage.java @@ -360,12 +360,12 @@ public class CKANPackage extends CKAN implements Moderated { boolean privatePackage = objectNode.get(PRIVATE_KEY).asBoolean(); if(privatePackage) { /* - * This version is not properly managed by CKAN. + * objectNode.put(SEARCHABLE_KEY, true); + * This code is not properly managed by the CKAN. * It is converted to: * searchable: "true" - * which is incidentally considered as true value even is not correct. - * We need to provide a string with T as capitol letters to make it working - * objectNode.put(SEARCHABLE_KEY, true); + * which is considered true but only incidentally. + * We need to provide a string with T as capitol letters to be sure it properly works */ objectNode.put(SEARCHABLE_KEY, "True"); } @@ -1387,13 +1387,16 @@ public class CKANPackage extends CKAN implements Moderated { protected void setToRejected(JsonNode jsonNode) { addExtraField(jsonNode, Moderated.SYSTEM_CM_ITEM_STATUS, CMItemStatus.REJECTED.getValue()); + + // Enforcing private again + ((ObjectNode) jsonNode).put(PRIVATE_KEY, true); /* - * This version is not properly managed by CKAN. + * ((ObjectNode) jsonNode).put(SEARCHABLE_KEY, false); + * This code is not properly managed by CKAN. * It is converted to: * searchable: "false" * which is considered as true value. * We need to provide a string with F as capitol letters to make it working - * ((ObjectNode) jsonNode).put(SEARCHABLE_KEY, false); */ ((ObjectNode) jsonNode).put(SEARCHABLE_KEY, "False"); } @@ -1416,12 +1419,12 @@ public class CKANPackage extends CKAN implements Moderated { ((ObjectNode) jsonNode).put(PRIVATE_KEY, true); /* + * ((ObjectNode) jsonNode).put(SEARCHABLE_KEY, false); * This version is not properly managed by CKAN. * It is converted to: * searchable: "false" * which is considered as true value. * We need to provide a string with F as capitol letters to make it working - * ((ObjectNode) jsonNode).put(SEARCHABLE_KEY, false); */ ((ObjectNode) jsonNode).put(SEARCHABLE_KEY, "False"); } @@ -1454,7 +1457,7 @@ public class CKANPackage extends CKAN implements Moderated { } - boolean privateItem = cmItemVisibility == CMItemVisibility.RESTRICTED ? true :false; + boolean privateItem = cmItemVisibility == CMItemVisibility.RESTRICTED ? true : false; ((ObjectNode) jsonNode).put(PRIVATE_KEY, privateItem); if(privateItem) { ((ObjectNode) jsonNode).put(SEARCHABLE_KEY, "True");