]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
NOJIRA: Added additional Nuxeo 6 HF21 jar and the nuxeo reindex jar. Made change...
authorremillet <remillet@yahoo.com>
Thu, 17 Dec 2015 20:40:54 +0000 (12:40 -0800)
committerremillet <remillet@yahoo.com>
Thu, 17 Dec 2015 20:40:54 +0000 (12:40 -0800)
3rdparty/nuxeo/nuxeo-server/6.0-HF21/bundles/nuxeo-core-redis-6.0-HF21.jar [new file with mode: 0644]
3rdparty/nuxeo/nuxeo-server/6.0-HF21/bundles/nuxeo-reindex-fulltext-6.0.jar [new file with mode: 0644]
services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/object-exit-display.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/object-exit.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/oePersonauthority.xml
services/client/pom.xml
services/common-api/src/main/java/org/collectionspace/services/common/api/RefNameUtils.java
services/common/src/main/java/org/collectionspace/services/nuxeo/client/java/NuxeoClientEmbedded.java
services/relation/client/src/test/java/org/collectionspace/services/client/test/RelationServiceTest.java

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 (file)
index 0000000..dcd698a
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 (file)
index 0000000..237d397
Binary files /dev/null and b/3rdparty/nuxeo/nuxeo-server/6.0-HF21/bundles/nuxeo-reindex-fulltext-6.0.jar differ
index 7d377c40a72e58712eba82c8de8eebe61ba47a57..ee8b20241b65a6ff0df9960c85c0e87cd23b7f15 100644 (file)
@@ -1,53 +1,60 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <xmlReplay>
-    <auths>
-        <!-- IMPORTANT: THESE ARE STICKY :: THEY STICK AROUND UNTIL RESET, IN EXEC ORDER OF THIS FILE. -->
-        <auth ID="admin@core.collectionspace.org">YWRtaW5AY29yZS5jb2xsZWN0aW9uc3BhY2Uub3JnOkFkbWluaXN0cmF0b3I=</auth>
-        <auth ID="testAdministator">YWRtaW5AY29sbGVjdGlvbnNwYWNlLm9yZzpBZG1pbmlzdHJhdG9y</auth>
-    </auths>
+       <auths>
+               <!-- IMPORTANT: THESE ARE STICKY :: THEY STICK AROUND UNTIL RESET, IN EXEC ORDER OF THIS FILE. -->
+               <auth ID="admin@core.collectionspace.org">YWRtaW5AY29yZS5jb2xsZWN0aW9uc3BhY2Uub3JnOkFkbWluaXN0cmF0b3I=</auth>
+               <auth ID="testAdministator">YWRtaW5AY29sbGVjdGlvbnNwYWNlLm9yZzpBZG1pbmlzdHJhdG9y</auth>
+       </auths>
 
-    <!-- 
+       <!-- 
     ========================================================
             testGroup :: refNameDisplayNameOnly
               Creates a record using only displayName and not shortIdentifier. 
     ======================================================== 
     -->
-    
-    <testGroup ID="refNameDisplayNameOnly" autoDeletePOSTS="false">
-        <test ID="oePersonauthority">  
-             <method>POST</method>
-             <uri>/cspace-services/personauthorities/</uri>
-             <filename>objectexit/oePersonauthority.xml</filename>
-        </test>
-        <test ID="oePerson">
-             <method>POST</method>
-             <uri>/cspace-services/personauthorities/${oePersonauthority.CSID}/items/</uri>
-             <filename>objectexit/oePersonDisplayOnly.xml</filename>
-             <vars>
-                <var ID="displayName">Finbar the DisplayName</var>
-                <var ID="shortIdentifier">Finbar_the_shortIdentifier</var>
-             </vars>
-        </test>
-        <test ID="oePersonGET">
-            <method>GET</method>
-            <uri>/cspace-services/personauthorities/${oePersonauthority.CSID}/items/${oePerson.CSID}</uri>
-            <response>
-                <expected level="ADDOK" /><!--server adds the csid -->
-                <label>persons_common</label>
-                <filename>objectexit/res/oePersonDisplayGET.res.xml</filename>
-                <vars>
-                    <!-- TODO: .got is not namespace aware yet, so you must make the xpath work around it for now.-->
-                    <var ID="csidGot">${oePersonGET.got("//csid")}</var>                      
-                    <var ID="inAuthority">${oePersonauthority.CSID}</var>
-                    <var ID="inAuthorityShortIdentifier">${oePersonauthority.sent("//shortIdentifier")}</var>
-                       <var ID="displayName">${oePerson.sent("//displayName")}</var>
-                       <var ID="shortIdentifier">${oePerson.sent("//shortIdentifier")}</var>
-                    <var ID="refName">urn:cspace:core.collectionspace.org:personauthorities:name(${inAuthorityShortIdentifier}):item:name(${shortIdentifier})'${displayName}'</var>
-                </vars>
-             </response>
-        </test>
-    </testGroup>
+
+       <testGroup ID="refNameDisplayNameOnly" autoDeletePOSTS="false">
+               <test ID="oePersonauthority">
+                       <method>POST</method>
+                       <uri>/cspace-services/personauthorities/</uri>
+                       <filename>objectexit/oePersonauthority.xml</filename>
+               </test>
+               <test ID="oePerson">
+                       <method>POST</method>
+                       <uri>/cspace-services/personauthorities/${oePersonauthority.CSID}/items/</uri>
+                       <filename>objectexit/oePersonDisplayOnly.xml</filename>
+                       <vars>
+                               <var ID="displayName">Finbar the DisplayName</var>
+                               <var ID="shortIdentifier">Finbar_the_shortIdentifier</var>
+                       </vars>
+               </test>
+               <test ID="oePersonGET">
+                       <method>GET</method>
+                       <uri>/cspace-services/personauthorities/${oePersonauthority.CSID}/items/${oePerson.CSID}</uri>
+                       <response>
+                               <expected level="ADDOK"></expected>
+                               <!--server adds the csid -->
+                               <label>persons_common</label>
+                               <filename>objectexit/res/oePersonDisplayGET.res.xml</filename>
+                               <vars>
+                                       <!-- TODO: .got is not namespace aware yet, so you must make the xpath work around it for now.-->
+                                       <var ID="csidGot">${oePersonGET.got("//csid")}</var>
+                                       <var ID="inAuthority">${oePersonauthority.CSID}</var>
+                                       <var ID="inAuthorityShortIdentifier">${oePersonauthority.sent("//shortIdentifier")}</var>
+                                       <var ID="displayName">${oePerson.sent("//displayName")}</var>
+                                       <var ID="shortIdentifier">${oePerson.sent("//shortIdentifier")}</var>
+                                       <var ID="refName">urn:cspace:core.collectionspace.org:personauthorities:name(${inAuthorityShortIdentifier}):item:name(${shortIdentifier})'${displayName}'</var>
+                               </vars>
+                       </response>
+               </test>
+               <test ID="delete-oePerson">
+                       <method>DELETE</method>
+                       <uri>/cspace-services/personauthorities/${oePersonauthority.CSID}/items/${oePerson.CSID}</uri>
+               </test>
+               <test ID="delete-oePersonauthority">
+                       <method>DELETE</method>
+                       <uri>/cspace-services/personauthorities/${oePersonauthority.CSID}</uri>
+               </test>
+       </testGroup>
 
 </xmlReplay>
-        
-        
index ad84ffdd714c15b6b4f8d05448bdd0753c264d86..81eadadb08ec36fe8f7119c461b70b36c8b5c37c 100644 (file)
                 <label>objectexit_common</label>
              </response>
         </test>
+         <test ID="cleanup"  auth="test">
+             <method>DELETE</method>
+             <uri>/cspace-services/objectexit/${oe1.CSID}</uri>
+         </test>               
     </testGroup>
     
     <testGroup ID="testStartName" autoDeletePOSTS="false">
-         <test ID="oe1"  auth="test">
+         <test ID="oe1x"  auth="test">
              <method>POST</method>
              <uri>/cspace-services/objectexit/</uri>
              <filename>objectexit/oe1.xml</filename>
          </test>
-        <test ID="oe2">
+        <test ID="oe2x">
             <method>GET</method>
             <uri>/cspace-services/objectexit/${oe1.CSID}</uri>
             <response>
index 0fd40a5888fc13b96564aa0815a477387bdb9fca..6b64bcf8010a3392f4106cf8db2b5d96d25467e5 100644 (file)
@@ -1,12 +1,8 @@
 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
 <document name="personauthorities">
-<ns2:personauthorities_common
-xmlns:ns2="http://collectionspace.org/services/person"
-xmlns:ns3="http://collectionspace.org/services/jaxb">
-  <displayName>Default Person Authority</displayName>
-  <shortIdentifier>defaultPersonAuthority</shortIdentifier>
-  <vocabType>PersonAuthority</vocabType>
-</ns2:personauthorities_common>
+       <ns2:personauthorities_common xmlns:ns2="http://collectionspace.org/services/person" xmlns:ns3="http://collectionspace.org/services/jaxb">
+               <displayName>Default Person Authority</displayName>
+               <shortIdentifier>TestPersonAuthForObjectExitTest</shortIdentifier>
+               <vocabType>PersonAuthority</vocabType>
+       </ns2:personauthorities_common>
 </document>
-
-
index 3a3be105f0730a93192e73665309f45de6b2348c..b25549573fd2c0f698500e441188b6fb4a0f3c6b 100644 (file)
         <dependency>
                    <groupId>com.sun.xml.bind</groupId>
                    <artifactId>jaxb-impl</artifactId>
-                   <version>2.2.2</version>
+                   <version>2.2.7</version>
                    <type>jar</type>
                    <scope>compile</scope>
                </dependency>        
index 382a68dc491dcfa13e90d91bd61cc04d1d0f0666..bc4cbff796b9a5ed20b4419885407ec1254f807a 100644 (file)
@@ -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+"/");
                }
index b3904c0aa8f87b2cdd2c856c6a1d8f7a5baa66d7..5d192f2151551c513798e10ef7061bf74439bad0 100644 (file)
@@ -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;
index 53e57fdb82e280b02960fbf0bf459e695f87901f..7c2247f40c1567a8a0176a55c3e9a39a37f5abc8 100644 (file)
@@ -75,7 +75,8 @@ public class RelationServiceTest extends AbstractPoxServiceTestImpl<RelationsCom
     private String oliveObjectRefName = UNINITIALIZED_REFNAME;
     
     private String personAuthCSID = null;
-    private String personShortId = PERSON_AUTHORITY_NAME;
+    private String personAuthShortId = PERSON_AUTHORITY_NAME + System.currentTimeMillis();
+    private String personAuthDisplayName = personAuthShortId;
     
 
     /** The SERVICE path component. */
@@ -102,7 +103,7 @@ public class RelationServiceTest extends AbstractPoxServiceTestImpl<RelationsCom
 
         PersonAuthorityClient personAuthClient = new PersonAuthorityClient();
         PoxPayloadOut multipart = PersonAuthorityClientUtils.createPersonAuthorityInstance(
-                PERSON_AUTHORITY_NAME, PERSON_AUTHORITY_NAME, personAuthClient.getCommonPartName());
+                       personAuthDisplayName, personAuthShortId, personAuthClient.getCommonPartName());
         Response res = personAuthClient.create(multipart);
         try {
                int statusCode = res.getStatus();