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);
|
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 json The json to check
|
||||||
* @param allowPartialInfo used for patch method which provide only partial information (i.e. the info to patch)
|
* @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);
|
sendSocialPost(title, catalogueItemURL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
result = cleanResult(result);
|
||||||
|
|
||||||
return getAsString(result);
|
return getAsString(result);
|
||||||
} catch(WebApplicationException e) {
|
} catch(WebApplicationException e) {
|
||||||
rollbackManagedResources();
|
rollbackManagedResources();
|
||||||
|
@ -667,6 +677,7 @@ public class CKANPackage extends CKAN {
|
||||||
String catalogueItemURL = uriResolver.getCatalogueItemURL(name);
|
String catalogueItemURL = uriResolver.getCatalogueItemURL(name);
|
||||||
((ObjectNode) result).put(ITEM_URL_KEY, catalogueItemURL);
|
((ObjectNode) result).put(ITEM_URL_KEY, catalogueItemURL);
|
||||||
*/
|
*/
|
||||||
|
result = cleanResult(result);
|
||||||
|
|
||||||
return getAsString(result);
|
return getAsString(result);
|
||||||
} catch(WebApplicationException e) {
|
} catch(WebApplicationException e) {
|
||||||
|
@ -742,6 +753,8 @@ public class CKANPackage extends CKAN {
|
||||||
((ObjectNode) result).put(ITEM_URL_KEY, catalogueItemURL);
|
((ObjectNode) result).put(ITEM_URL_KEY, catalogueItemURL);
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
result = cleanResult(result);
|
||||||
|
|
||||||
return getAsString(result);
|
return getAsString(result);
|
||||||
} catch(WebApplicationException e) {
|
} catch(WebApplicationException e) {
|
||||||
rollbackManagedResources();
|
rollbackManagedResources();
|
||||||
|
|
|
@ -43,7 +43,7 @@ public class CKANPackageTest extends ContextTest {
|
||||||
|
|
||||||
private static final String ITEM_NAME_VALUE = "restful_transaction_model";
|
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 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
|
@Test
|
||||||
public void count() throws Exception {
|
public void count() throws Exception {
|
||||||
|
@ -330,7 +330,7 @@ public class CKANPackageTest extends ContextTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void create() throws Exception {
|
public void create() throws Exception {
|
||||||
ContextTest.setContextByName("/gcube/devNext/NextNext");
|
ContextTest.setContextByName("/gcube/devsec/devVRE");
|
||||||
ObjectMapper mapper = new ObjectMapper();
|
ObjectMapper mapper = new ObjectMapper();
|
||||||
createPackage(mapper);
|
createPackage(mapper);
|
||||||
}
|
}
|
||||||
|
@ -346,7 +346,7 @@ public class CKANPackageTest extends ContextTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void createReadUpdateUpdatePurge() throws Exception {
|
public void createReadUpdateUpdatePurge() throws Exception {
|
||||||
ContextTest.setContextByName("/gcube/devNext/NextNext");
|
ContextTest.setContextByName("/gcube/devsec/devVRE");
|
||||||
|
|
||||||
ObjectMapper mapper = new ObjectMapper();
|
ObjectMapper mapper = new ObjectMapper();
|
||||||
createPackage(mapper);
|
createPackage(mapper);
|
||||||
|
|
Loading…
Reference in New Issue