From: Richard Millet Date: Mon, 4 Apr 2016 20:07:50 +0000 (-0700) Subject: NOJIRA: Adding code to get the rev number of a remote authority. X-Git-Url: https://git.aero2k.de/?a=commitdiff_plain;h=a3da223f811dfa6832d3d52cf8495ccdd0be986b;p=tmp%2Fjakarta-migration.git NOJIRA: Adding code to get the rev number of a remote authority. --- diff --git a/services/authority/service/src/main/java/org/collectionspace/services/common/vocabulary/nuxeo/AuthorityDocumentModelHandler.java b/services/authority/service/src/main/java/org/collectionspace/services/common/vocabulary/nuxeo/AuthorityDocumentModelHandler.java index aab022d90..3b8b8b9ce 100644 --- a/services/authority/service/src/main/java/org/collectionspace/services/common/vocabulary/nuxeo/AuthorityDocumentModelHandler.java +++ b/services/authority/service/src/main/java/org/collectionspace/services/common/vocabulary/nuxeo/AuthorityDocumentModelHandler.java @@ -28,6 +28,7 @@ import java.util.Map; import javax.ws.rs.core.Response; import org.collectionspace.services.client.AuthorityClient; +import org.collectionspace.services.client.CollectionSpaceClient; import org.collectionspace.services.client.PayloadInputPart; import org.collectionspace.services.client.VocabularyClient; import org.collectionspace.services.client.PoxPayloadIn; @@ -50,11 +51,13 @@ import org.collectionspace.services.nuxeo.client.java.NuxeoDocumentModelHandler; import org.collectionspace.services.nuxeo.client.java.CoreSessionInterface; import org.collectionspace.services.nuxeo.client.java.RepositoryClientImpl; import org.collectionspace.services.nuxeo.util.NuxeoUtils; - +import org.dom4j.Document; +import org.dom4j.Element; import org.nuxeo.ecm.core.api.ClientException; import org.nuxeo.ecm.core.api.DocumentModel; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.testng.Assert; /** * AuthorityDocumentModelHandler @@ -80,7 +83,7 @@ public abstract class AuthorityDocumentModelHandler public Class getEntityResponseType() { return String.class; } - + protected PayloadInputPart extractPart(Response res, String partLabel) throws Exception { PoxPayloadIn input = new PoxPayloadIn((String)res.readEntity(getEntityResponseType())); @@ -127,6 +130,9 @@ public abstract class AuthorityDocumentModelHandler if (payloadInputPart != null) { // result = (client.getc) payloadInputPart.getBody(); } + Document document = input.getDOMDocument(); + Element rootElement = document.getRootElement(); + } finally { res.close(); }