From: remillet Date: Thu, 17 Dec 2015 20:40:54 +0000 (-0800) Subject: NOJIRA: Added additional Nuxeo 6 HF21 jar and the nuxeo reindex jar. Made change... X-Git-Url: https://git.aero2k.de/?a=commitdiff_plain;h=e88dfab9530fc6fa9d8063c61684d21b0c6bfe8b;p=tmp%2Fjakarta-migration.git NOJIRA: Added additional Nuxeo 6 HF21 jar and the nuxeo reindex jar. Made change to relation service tests and xmlreply tests to use unique short ids. --- diff --git a/3rdparty/nuxeo/nuxeo-server/6.0-HF21/bundles/nuxeo-core-redis-6.0-HF21.jar b/3rdparty/nuxeo/nuxeo-server/6.0-HF21/bundles/nuxeo-core-redis-6.0-HF21.jar new file mode 100644 index 000000000..dcd698a19 Binary files /dev/null and b/3rdparty/nuxeo/nuxeo-server/6.0-HF21/bundles/nuxeo-core-redis-6.0-HF21.jar differ diff --git a/3rdparty/nuxeo/nuxeo-server/6.0-HF21/bundles/nuxeo-reindex-fulltext-6.0.jar b/3rdparty/nuxeo/nuxeo-server/6.0-HF21/bundles/nuxeo-reindex-fulltext-6.0.jar new file mode 100644 index 000000000..237d39700 Binary files /dev/null and b/3rdparty/nuxeo/nuxeo-server/6.0-HF21/bundles/nuxeo-reindex-fulltext-6.0.jar differ diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/object-exit-display.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/object-exit-display.xml index 7d377c40a..ee8b20241 100644 --- a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/object-exit-display.xml +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/object-exit-display.xml @@ -1,53 +1,60 @@ - - - YWRtaW5AY29yZS5jb2xsZWN0aW9uc3BhY2Uub3JnOkFkbWluaXN0cmF0b3I= - YWRtaW5AY29sbGVjdGlvbnNwYWNlLm9yZzpBZG1pbmlzdHJhdG9y - + + + YWRtaW5AY29yZS5jb2xsZWN0aW9uc3BhY2Uub3JnOkFkbWluaXN0cmF0b3I= + YWRtaW5AY29sbGVjdGlvbnNwYWNlLm9yZzpBZG1pbmlzdHJhdG9y + - - - - - POST - /cspace-services/personauthorities/ - objectexit/oePersonauthority.xml - - - POST - /cspace-services/personauthorities/${oePersonauthority.CSID}/items/ - objectexit/oePersonDisplayOnly.xml - - Finbar the DisplayName - Finbar_the_shortIdentifier - - - - GET - /cspace-services/personauthorities/${oePersonauthority.CSID}/items/${oePerson.CSID} - - - - objectexit/res/oePersonDisplayGET.res.xml - - - ${oePersonGET.got("//csid")} - ${oePersonauthority.CSID} - ${oePersonauthority.sent("//shortIdentifier")} - ${oePerson.sent("//displayName")} - ${oePerson.sent("//shortIdentifier")} - urn:cspace:core.collectionspace.org:personauthorities:name(${inAuthorityShortIdentifier}):item:name(${shortIdentifier})'${displayName}' - - - - + + + + POST + /cspace-services/personauthorities/ + objectexit/oePersonauthority.xml + + + POST + /cspace-services/personauthorities/${oePersonauthority.CSID}/items/ + objectexit/oePersonDisplayOnly.xml + + Finbar the DisplayName + Finbar_the_shortIdentifier + + + + GET + /cspace-services/personauthorities/${oePersonauthority.CSID}/items/${oePerson.CSID} + + + + + objectexit/res/oePersonDisplayGET.res.xml + + + ${oePersonGET.got("//csid")} + ${oePersonauthority.CSID} + ${oePersonauthority.sent("//shortIdentifier")} + ${oePerson.sent("//displayName")} + ${oePerson.sent("//shortIdentifier")} + urn:cspace:core.collectionspace.org:personauthorities:name(${inAuthorityShortIdentifier}):item:name(${shortIdentifier})'${displayName}' + + + + + DELETE + /cspace-services/personauthorities/${oePersonauthority.CSID}/items/${oePerson.CSID} + + + DELETE + /cspace-services/personauthorities/${oePersonauthority.CSID} + + - - diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/object-exit.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/object-exit.xml index ad84ffdd7..81eadadb0 100644 --- a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/object-exit.xml +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/object-exit.xml @@ -54,15 +54,19 @@ + + DELETE + /cspace-services/objectexit/${oe1.CSID} + - + POST /cspace-services/objectexit/ objectexit/oe1.xml - + GET /cspace-services/objectexit/${oe1.CSID} diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/oePersonauthority.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/oePersonauthority.xml index 0fd40a588..6b64bcf80 100644 --- a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/oePersonauthority.xml +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/oePersonauthority.xml @@ -1,12 +1,8 @@ - - Default Person Authority - defaultPersonAuthority - PersonAuthority - + + Default Person Authority + TestPersonAuthForObjectExitTest + PersonAuthority + - - diff --git a/services/client/pom.xml b/services/client/pom.xml index 3a3be105f..b25549573 100644 --- a/services/client/pom.xml +++ b/services/client/pom.xml @@ -102,7 +102,7 @@ com.sun.xml.bind jaxb-impl - 2.2.2 + 2.2.7 jar compile diff --git a/services/common-api/src/main/java/org/collectionspace/services/common/api/RefNameUtils.java b/services/common-api/src/main/java/org/collectionspace/services/common/api/RefNameUtils.java index 382a68dc4..bc4cbff79 100644 --- a/services/common-api/src/main/java/org/collectionspace/services/common/api/RefNameUtils.java +++ b/services/common-api/src/main/java/org/collectionspace/services/common/api/RefNameUtils.java @@ -111,7 +111,7 @@ public class RefNameUtils { public String getRelativeUri() { StringBuilder uri = new StringBuilder(); - // FIXME This should not be hard-coded. + // FIXME This should not be hard-coded -see https://issues.collectionspace.org/browse/CSPACE-5987 if(resource.equals("vocabulary")) { uri.append("/vocabularies/"); } else if(resource.equals("personauthority")) { @@ -124,7 +124,7 @@ public class RefNameUtils { || resource.equals("locationauthorities") || resource.equals("placeauthorities") || resource.equals("vocabularies"))) { - logger.error("Unrecognized Authority Type: " + resource); + logger.warn("Unrecognized Authority Type: " + resource); } uri.append("/"+resource+"/"); } diff --git a/services/common/src/main/java/org/collectionspace/services/nuxeo/client/java/NuxeoClientEmbedded.java b/services/common/src/main/java/org/collectionspace/services/nuxeo/client/java/NuxeoClientEmbedded.java index b3904c0aa..5d192f215 100644 --- a/services/common/src/main/java/org/collectionspace/services/nuxeo/client/java/NuxeoClientEmbedded.java +++ b/services/common/src/main/java/org/collectionspace/services/nuxeo/client/java/NuxeoClientEmbedded.java @@ -235,11 +235,15 @@ public final class NuxeoClientEmbedded { // if (repository != null) { result = getCoreSessionWrapper(repository); - logger.trace(String.format("A new transaction was started on thread '%d' : %s.", - Thread.currentThread().getId(), startedTransaction ? "true" : "false")); - logger.trace(String.format("Added a new repository instance to our repo list. Current count is now: %d", - repositoryInstances.size())); - } else { + if (result != null) { + logger.trace(String.format("A new transaction was started on thread '%d' : %s.", + Thread.currentThread().getId(), startedTransaction ? "true" : "false")); + logger.trace(String.format("Added a new repository instance to our repo list. Current count is now: %d", + repositoryInstances.size())); + } + } + + if (repository == null || result == null) { // // If we couldn't open a repo session, we need to close the transaction we started. // @@ -285,10 +289,16 @@ public final class NuxeoClientEmbedded { * Nuxeo repository and check for network related failures. We will retry all calls to the Nuxeo repo that fail because * of network erros. */ - private CoreSessionInterface getCoreSessionWrapper(Repository repository) throws Exception { + private CoreSessionInterface getCoreSessionWrapper(Repository repository) { CoreSessionInterface result = null; - CoreSession coreSession = CoreInstance.openCoreSession(repository.getName(), getSystemPrincipal()); // A Nuxeo repo instance handler proxy + CoreSession coreSession = null; + try { + coreSession = CoreInstance.openCoreSession(repository.getName(), getSystemPrincipal()); // A Nuxeo repo instance handler proxy + } catch (Exception e) { + logger.warn(String.format("Could not open a session to the '%s' repository. The current request to the CollectionSpace services API will fail.", + repository != null ? repository.getName() : "not specified"), e); + } if (coreSession != null) { result = this.getAOPProxy(coreSession); // This is our AOP proxy @@ -296,15 +306,14 @@ public final class NuxeoClientEmbedded { String key = result.getSessionId(); repositoryInstances.put(key, result); } else { + // + // Since we couldn't get an AOP proxy, we need to close the core session. + // + CoreInstance.closeCoreSession(coreSession); String errMsg = String.format("Could not instantiate a Spring AOP proxy for class '%s'.", CoreSessionWrapper.class.getName()); logger.error(errMsg); - throw new Exception(errMsg); } - } else { - String errMsg = String.format("Could not create a new repository instance for '%s' repository.", repository.getName()); - logger.error(errMsg); - throw new Exception(errMsg); } return result; diff --git a/services/relation/client/src/test/java/org/collectionspace/services/client/test/RelationServiceTest.java b/services/relation/client/src/test/java/org/collectionspace/services/client/test/RelationServiceTest.java index 53e57fdb8..7c2247f40 100644 --- a/services/relation/client/src/test/java/org/collectionspace/services/client/test/RelationServiceTest.java +++ b/services/relation/client/src/test/java/org/collectionspace/services/client/test/RelationServiceTest.java @@ -75,7 +75,8 @@ public class RelationServiceTest extends AbstractPoxServiceTestImpl