Removed owner_org from created/updated/read item
This commit is contained in:
parent
eb8e0b7bea
commit
878b5cfae9
|
@ -237,6 +237,14 @@ public class CKANPackage extends CKAN {
|
|||
return checkBaseInformation(json, false);
|
||||
}
|
||||
|
||||
public JsonNode cleanResult(JsonNode jsonNode) {
|
||||
if(jsonNode.has(OWNER_ORG_KEY)) {
|
||||
((ObjectNode) jsonNode).remove(OWNER_ORG_KEY);
|
||||
}
|
||||
return jsonNode;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param json The json to check
|
||||
* @param allowPartialInfo used for patch method which provide only partial information (i.e. the info to patch)
|
||||
|
@ -596,6 +604,8 @@ public class CKANPackage extends CKAN {
|
|||
sendSocialPost(title, catalogueItemURL);
|
||||
}
|
||||
|
||||
result = cleanResult(result);
|
||||
|
||||
return getAsString(result);
|
||||
} catch(WebApplicationException e) {
|
||||
rollbackManagedResources();
|
||||
|
@ -667,6 +677,7 @@ public class CKANPackage extends CKAN {
|
|||
String catalogueItemURL = uriResolver.getCatalogueItemURL(name);
|
||||
((ObjectNode) result).put(ITEM_URL_KEY, catalogueItemURL);
|
||||
*/
|
||||
result = cleanResult(result);
|
||||
|
||||
return getAsString(result);
|
||||
} catch(WebApplicationException e) {
|
||||
|
@ -742,6 +753,8 @@ public class CKANPackage extends CKAN {
|
|||
((ObjectNode) result).put(ITEM_URL_KEY, catalogueItemURL);
|
||||
*/
|
||||
|
||||
result = cleanResult(result);
|
||||
|
||||
return getAsString(result);
|
||||
} catch(WebApplicationException e) {
|
||||
rollbackManagedResources();
|
||||
|
|
|
@ -43,7 +43,7 @@ public class CKANPackageTest extends ContextTest {
|
|||
|
||||
private static final String ITEM_NAME_VALUE = "restful_transaction_model";
|
||||
private static final String LICENSE_VALUE = "CC-BY-SA-4.0";
|
||||
private static final String EXTRAS_TYPE_VALUE_VALUE = "TestEmptyProfile";
|
||||
private static final String EXTRAS_TYPE_VALUE_VALUE = "EmptyProfile";
|
||||
|
||||
@Test
|
||||
public void count() throws Exception {
|
||||
|
@ -330,7 +330,7 @@ public class CKANPackageTest extends ContextTest {
|
|||
|
||||
@Test
|
||||
public void create() throws Exception {
|
||||
ContextTest.setContextByName("/gcube/devNext/NextNext");
|
||||
ContextTest.setContextByName("/gcube/devsec/devVRE");
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
createPackage(mapper);
|
||||
}
|
||||
|
@ -346,7 +346,7 @@ public class CKANPackageTest extends ContextTest {
|
|||
|
||||
@Test
|
||||
public void createReadUpdateUpdatePurge() throws Exception {
|
||||
ContextTest.setContextByName("/gcube/devNext/NextNext");
|
||||
ContextTest.setContextByName("/gcube/devsec/devVRE");
|
||||
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
createPackage(mapper);
|
||||
|
|
Loading…
Reference in New Issue