chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fguilla...@apache.org
Subject svn commit: r798963 - in /incubator/chemistry/trunk/chemistry: chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/ chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/stax/ chemistry-atompub-server/src/mai...
Date Wed, 29 Jul 2009 16:11:12 GMT
Author: fguillaume
Date: Wed Jul 29 16:11:11 2009
New Revision: 798963

URL: http://svn.apache.org/viewvc?rev=798963&view=rev
Log:
CMIS-44: cleaning up use of AtomPub link relationships

Modified:
    incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/APPConnection.java
    incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/APPDocument.java
    incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/APPFolder.java
    incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/APPObject.java
    incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/stax/ObjectEntryWriter.java
    incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/CMISCollection.java
    incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/CMISObjectsCollection.java
    incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/CMISTypesCollection.java
    incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/jaxrs/AbderaResource.java
    incubator/chemistry/trunk/chemistry/chemistry-atompub/src/main/java/org/apache/chemistry/atompub/Atom.java
    incubator/chemistry/trunk/chemistry/chemistry-atompub/src/main/java/org/apache/chemistry/atompub/CMIS.java
    incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/xml/stax/StaxReader.java
    incubator/chemistry/trunk/chemistry/chemistry-tests/src/main/java/org/apache/chemistry/test/BasicTestCase.java

Modified: incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/APPConnection.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/APPConnection.java?rev=798963&r1=798962&r2=798963&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/APPConnection.java
(original)
+++ incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/APPConnection.java
Wed Jul 29 16:11:11 2009
@@ -46,6 +46,7 @@
 import org.apache.chemistry.Type;
 import org.apache.chemistry.Unfiling;
 import org.apache.chemistry.VersioningState;
+import org.apache.chemistry.atompub.Atom;
 import org.apache.chemistry.atompub.CMIS;
 import org.apache.chemistry.atompub.client.connector.Connector;
 import org.apache.chemistry.atompub.client.connector.Request;
@@ -119,7 +120,7 @@
         }
         APPObjectEntry entry = newObjectEntry(typeId);
         if (folder != null) {
-            entry.addLink(CMIS.LINK_PARENTS,
+            entry.addLink(Atom.LINK_UP,
                     ((APPFolder) folder).entry.getEditLink());
         }
         return new APPDocument(entry, type);
@@ -133,7 +134,7 @@
         APPObjectEntry entry = newObjectEntry(typeId);
         if (folder != null) {
             entry.setValue(Property.PARENT_ID, folder.getId());
-            entry.addLink(CMIS.LINK_PARENTS,
+            entry.addLink(Atom.LINK_UP,
                     ((APPFolder) folder).entry.getEditLink());
         }
         return new APPFolder(entry, type);
@@ -208,7 +209,7 @@
             skipCount = 0;
         }
 
-        String href = getObjectEntry(folder).getLink(CMIS.LINK_CHILDREN);
+        String href = getObjectEntry(folder).getLink(Atom.LINK_DOWN);
         Response resp = connector.get(new Request(href));
         if (!resp.isOk()) {
             throw new ContentManagerException(
@@ -256,7 +257,7 @@
             if (current.getId().equals(rootId)) {
                 break;
             }
-            String href = current.getLink(CMIS.LINK_PARENTS);
+            String href = current.getLink(Atom.LINK_UP);
             Response resp = connector.get(new Request(href));
             if (!resp.isOk()) {
                 throw new ContentManagerException(
@@ -274,7 +275,7 @@
             boolean includeRelationships) {
         // TODO filter, includeRelationship, includeAllowableActions
         APPObjectEntry current = getObjectEntry(object);
-        String href = current.getLink(CMIS.LINK_PARENTS);
+        String href = current.getLink(Atom.LINK_UP);
         Response resp = connector.get(new Request(href));
         if (!resp.isOk()) {
             throw new ContentManagerException(

Modified: incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/APPDocument.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/APPDocument.java?rev=798963&r1=798962&r2=798963&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/APPDocument.java
(original)
+++ incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/APPDocument.java
Wed Jul 29 16:11:11 2009
@@ -28,7 +28,7 @@
 import org.apache.chemistry.Document;
 import org.apache.chemistry.Property;
 import org.apache.chemistry.Type;
-import org.apache.chemistry.atompub.CMIS;
+import org.apache.chemistry.atompub.Atom;
 import org.apache.chemistry.atompub.client.connector.Connector;
 import org.apache.chemistry.atompub.client.connector.Request;
 import org.apache.chemistry.atompub.client.connector.Response;
@@ -54,7 +54,7 @@
     }
 
     public ContentStream getContentStream() {
-        String url = entry.getLink(CMIS.LINK_STREAM);
+        String url = entry.getLink(Atom.LINK_EDIT_MEDIA);
         return url == null ? null : new APPContentStream(url);
     }
 
@@ -122,7 +122,7 @@
     }
 
     public InputStream getStream() throws IOException {
-        String href = entry.getLink(CMIS.LINK_STREAM);
+        String href = entry.getLink(Atom.LINK_EDIT_MEDIA);
         if (href == null) {
             return null;
         }

Modified: incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/APPFolder.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/APPFolder.java?rev=798963&r1=798962&r2=798963&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/APPFolder.java
(original)
+++ incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/APPFolder.java
Wed Jul 29 16:11:11 2009
@@ -28,7 +28,7 @@
 import org.apache.chemistry.ObjectId;
 import org.apache.chemistry.Type;
 import org.apache.chemistry.Unfiling;
-import org.apache.chemistry.atompub.CMIS;
+import org.apache.chemistry.atompub.Atom;
 import org.apache.chemistry.atompub.client.connector.Request;
 import org.apache.chemistry.atompub.client.connector.Response;
 import org.apache.chemistry.atompub.client.stax.ReadContext;
@@ -63,7 +63,7 @@
     }
 
     public List<CMISObject> getChildren(BaseType type) {
-        String href = entry.getLink(CMIS.LINK_CHILDREN);
+        String href = entry.getLink(Atom.LINK_DOWN);
         Response resp = entry.connection.getConnector().get(new Request(href));
         if (!resp.isOk()) {
             throw new ContentManagerException(

Modified: incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/APPObject.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/APPObject.java?rev=798963&r1=798962&r2=798963&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/APPObject.java
(original)
+++ incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/APPObject.java
Wed Jul 29 16:11:11 2009
@@ -30,7 +30,7 @@
 import org.apache.chemistry.Relationship;
 import org.apache.chemistry.RelationshipDirection;
 import org.apache.chemistry.Type;
-import org.apache.chemistry.atompub.CMIS;
+import org.apache.chemistry.atompub.Atom;
 import org.apache.chemistry.atompub.client.connector.Connector;
 import org.apache.chemistry.atompub.client.connector.Request;
 import org.apache.chemistry.atompub.client.connector.Response;
@@ -94,11 +94,13 @@
     /*
      * ----- Navigation Services -----
      */
+
     public Folder getParent() {
-        String href = entry.getLink(CMIS.LINK_PARENTS); // TODO check this
+        String href = entry.getLink(Atom.LINK_UP); // usually a feed entry
         if (href == null) {
             return null;
         }
+        // can read an entry directly, or the first one from a feed
         APPObjectEntry e = (APPObjectEntry) entry.connection.getConnector().getObject(
                 new ReadContext(entry.connection), href);
         if (e == null) {
@@ -202,16 +204,16 @@
         Connector connector = entry.connection.getConnector();
         ReadContext ctx = new ReadContext(entry.connection);
 
-        String href = entry.getLink(CMIS.LINK_PARENTS); // TODO check this
+        // this link value is local, set by APPConnection#newDocument
+        String href = entry.getLink(Atom.LINK_UP);
         if (href == null) {
             throw new IllegalArgumentException(
                     "Cannot create entry: no 'cmis-parents' link is present");
         }
-        // TODO in 0.5 the parents link (entry or feed) wasn't defined clearly
         // TODO hardcoded Chemistry URL pattern here...
         href = href.replaceAll("/object/([0-9a-f-]{36}$)", "/children/$1");
         Request req = new Request(href);
-        req.setHeader("Content-Type", "application/atom+xml;type=entry");
+        req.setHeader("Content-Type", Atom.MEDIA_TYPE_ATOM_ENTRY);
         Response resp = connector.postObject(req, entry);
         if (resp.getStatusCode() != 201) { // Created
             throw new ContentManagerException(
@@ -246,7 +248,7 @@
                     "Cannot edit entry: no 'edit' link is present");
         }
         Request req = new Request(href);
-        req.setHeader("Content-Type", "application/atom+xml;type=entry");
+        req.setHeader("Content-Type", Atom.MEDIA_TYPE_ATOM_ENTRY);
         Response resp = entry.connection.getConnector().putObject(req, entry);
         if (!resp.isOk()) {
             throw new ContentManagerException(

Modified: incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/stax/ObjectEntryWriter.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/stax/ObjectEntryWriter.java?rev=798963&r1=798962&r2=798963&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/stax/ObjectEntryWriter.java
(original)
+++ incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/stax/ObjectEntryWriter.java
Wed Jul 29 16:11:11 2009
@@ -33,7 +33,7 @@
 
     @Override
     public String getContentType() {
-        return "application/atom+xml;type=entry";
+        return Atom.MEDIA_TYPE_ATOM_ENTRY;
     }
 
     @Override

Modified: incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/CMISCollection.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/CMISCollection.java?rev=798963&r1=798962&r2=798963&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/CMISCollection.java
(original)
+++ incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/CMISCollection.java
Wed Jul 29 16:11:11 2009
@@ -98,10 +98,6 @@
      * ----- Utilities -----
      */
 
-    public String getRepositoryLink(RequestContext request) {
-        return request.absoluteUrlFor(TargetType.TYPE_SERVICE, null);
-    }
-
     public String getTypeLink(String tid, RequestContext request) {
         Map<String, String> params = new HashMap<String, String>();
         params.put("entrytype", "type");
@@ -109,20 +105,13 @@
         return request.absoluteUrlFor(TargetType.TYPE_ENTRY, params);
     }
 
-    public String getChildrenLink(String fid, RequestContext request) {
+    public String getDownLink(String fid, RequestContext request) {
         Map<String, String> params = new HashMap<String, String>();
         params.put("entrytype", "children");
         params.put("id", fid);
         return request.absoluteUrlFor(TargetType.TYPE_ENTRY, params);
     }
 
-    public String getDescendantsLink(String fid, RequestContext request) {
-        Map<String, String> params = new HashMap<String, String>();
-        params.put("entrytype", "descendants");
-        params.put("id", fid);
-        return request.absoluteUrlFor(TargetType.TYPE_ENTRY, params);
-    }
-
     public String getParentsLink(String fid, RequestContext request) {
         Map<String, String> params = new HashMap<String, String>();
         params.put("entrytype", "parents");

Modified: incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/CMISObjectsCollection.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/CMISObjectsCollection.java?rev=798963&r1=798962&r2=798963&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/CMISObjectsCollection.java
(original)
+++ incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/CMISObjectsCollection.java
Wed Jul 29 16:11:11 2009
@@ -52,6 +52,7 @@
 import org.apache.chemistry.SPI;
 import org.apache.chemistry.Type;
 import org.apache.chemistry.VersioningState;
+import org.apache.chemistry.atompub.Atom;
 import org.apache.chemistry.atompub.CMIS;
 import org.apache.chemistry.atompub.abdera.ObjectElement;
 import org.apache.chemistry.impl.simple.SimpleObjectId;
@@ -80,7 +81,7 @@
         feed.addAuthor(getAuthor(request));
         feed.setUpdated(new Date()); // XXX
 
-        feed.addLink(getChildrenLink(id, request), "self");
+        feed.addLink(getDownLink(id, request), "self");
         feed.addLink(getObjectLink(id, request), CMIS.LINK_SOURCE);
 
         // RFC 5005 paging
@@ -148,14 +149,13 @@
         // alternate is mandated by Atom when there is no atom:content
         entry.addLink(link, "alternate");
         // CMIS links
-        entry.addLink(getRepositoryLink(request), CMIS.LINK_REPOSITORY);
-        entry.addLink(getTypeLink(object.getTypeId(), request), CMIS.LINK_TYPE);
         String oid = object.getId();
-        entry.addLink(getParentsLink(oid, request), CMIS.LINK_PARENTS);
+        // TODO for folder's up, link to an entry and not a feed
+        entry.addLink(getParentsLink(oid, request), Atom.LINK_UP,
+                Atom.MEDIA_TYPE_ATOM_FEED, null, null, 0);
         if (object.getBaseType() == BaseType.FOLDER) {
-            entry.addLink(getChildrenLink(oid, request), CMIS.LINK_CHILDREN);
-            entry.addLink(getDescendantsLink(oid, request),
-                    CMIS.LINK_DESCENDANTS);
+            entry.addLink(getDownLink(oid, request), Atom.LINK_DOWN,
+                    Atom.MEDIA_TYPE_ATOM_FEED, null, null, 0);
         }
         // entry.addLink("XXX", CMIS.LINK_ALLOWABLE_ACTIONS);
         // entry.addLink("XXX", CMIS.LINK_RELATIONSHIPS);
@@ -264,8 +264,7 @@
             throws ResponseContextException {
         String mediaLink = getMediaLink(object.getId(), request);
         entry.setContent(new IRI(mediaLink), getContentType(object));
-        entry.addLink(mediaLink, "edit-media");
-        entry.addLink(mediaLink, CMIS.LINK_STREAM);
+        entry.addLink(mediaLink, Atom.LINK_EDIT_MEDIA);
         return mediaLink;
     }
 

Modified: incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/CMISTypesCollection.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/CMISTypesCollection.java?rev=798963&r1=798962&r2=798963&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/CMISTypesCollection.java
(original)
+++ incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/CMISTypesCollection.java
Wed Jul 29 16:11:11 2009
@@ -104,7 +104,6 @@
         // alternate is mandated by Atom when there is no atom:content
         entry.addLink(link, "alternate");
         // CMIS links
-        entry.addLink(getRepositoryLink(request), CMIS.LINK_REPOSITORY);
 
         // CMIS-specific
         // TODO refactor this to be a proper ExtensibleElement

Modified: incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/jaxrs/AbderaResource.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/jaxrs/AbderaResource.java?rev=798963&r1=798962&r2=798963&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/jaxrs/AbderaResource.java
(original)
+++ incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/jaxrs/AbderaResource.java
Wed Jul 29 16:11:11 2009
@@ -36,6 +36,7 @@
 import org.apache.abdera.protocol.server.impl.AbstractCollectionAdapter;
 import org.apache.abdera.protocol.server.servlet.ServletRequestContext;
 import org.apache.chemistry.Repository;
+import org.apache.chemistry.atompub.Atom;
 import org.apache.chemistry.atompub.server.CMISProvider;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -138,7 +139,7 @@
     }
 
     @GET
-    @Produces("application/atomsvc+xml")
+    @Produces(Atom.MEDIA_TYPE_ATOM_SERVICE)
     @Path("repository")
     public Response doGetRepository(@Context HttpServletRequest httpRequest) {
         RequestContext requestContext = getRequestContext(1);
@@ -147,14 +148,14 @@
     }
 
     @GET
-    @Produces("application/atom+xml;type=feed")
+    @Produces(Atom.MEDIA_TYPE_ATOM_FEED)
     @Path("types")
     public Response doGetTypes() {
         return getAbderaFeed(1);
     }
 
     @GET
-    @Produces("application/atom+xml;type=feed")
+    @Produces(Atom.MEDIA_TYPE_ATOM_FEED)
     @Path("children/{objectid}")
     public Response doGetChildren() {
         // objectid decoded by Abdera getCollectionAdapter
@@ -162,7 +163,7 @@
     }
 
     @GET
-    @Produces("application/atom+xml;type=entry")
+    @Produces(Atom.MEDIA_TYPE_ATOM_ENTRY)
     @Path("object/{objectid}")
     public Response doGetObject() {
         // objectid decoded by Abdera getCollectionAdapter
@@ -182,7 +183,7 @@
 
     @POST
     @Consumes("application/cmisquery+xml")
-    @Produces("application/atom+xml;type=feed")
+    @Produces(Atom.MEDIA_TYPE_ATOM_FEED)
     @Path("query")
     public Response doPostQuery() {
         return getAbderaPostFeed(1);

Modified: incubator/chemistry/trunk/chemistry/chemistry-atompub/src/main/java/org/apache/chemistry/atompub/Atom.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-atompub/src/main/java/org/apache/chemistry/atompub/Atom.java?rev=798963&r1=798962&r2=798963&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-atompub/src/main/java/org/apache/chemistry/atompub/Atom.java
(original)
+++ incubator/chemistry/trunk/chemistry/chemistry-atompub/src/main/java/org/apache/chemistry/atompub/Atom.java
Wed Jul 29 16:11:11 2009
@@ -39,4 +39,57 @@
 
     public static final QName APP_COLLECTION = new QName(APP_NS, "collection");
 
+    public static final String MEDIA_TYPE_ATOM = "application/atom+xml";
+
+    public static final String MEDIA_TYPE_ATOM_ENTRY = "application/atom+xml;type=entry";
+
+    public static final String MEDIA_TYPE_ATOM_FEED = "application/atom+xml;type=feed";
+
+    public static final String MEDIA_TYPE_ATOM_SERVICE = "application/atomsvc+xml";
+
+    /*
+     * http://www.iana.org/assignments/link-relations/link-relations.xhtml
+     */
+
+    public static final String LINK_SELF = "self";
+
+    public static final String LINK_SERVICE = "service";
+
+    public static final String LINK_DESCRIBED_BY = "describedby";
+
+    public static final String LINK_VIA = "via";
+
+    public static final String LINK_EDIT_MEDIA = "edit-media";
+
+    public static final String LINK_EDIT = "edit";
+
+    public static final String LINK_ALTERNATE = "alternate";
+
+    public static final String LINK_FIRST = "first";
+
+    public static final String LINK_LAST = "last";
+
+    public static final String LINK_PREVIOUS = "previous";
+
+    public static final String LINK_NEXT = "next";
+
+    /*
+     * http://www.ietf.org/id/draft-divilly-atom-hierarchy-03.txt
+     */
+
+    public static final String LINK_UP = "up";
+
+    public static final String LINK_DOWN = "down";
+
+    /*
+     * TODO Will be updated by 0.63 to use properly
+     * http://www.ietf.org/id/draft-brown-versioning-link-relations-01.txt
+     */
+
+    public static final String LINK_VERSION_HISTORY = "allversions"; // TODO
+
+    public static final String LINK_LATEST_VERSION = "latestversion"; // TODO
+
+    public static final String LINK_WORKING_COPY = "pwc"; // TODO
+
 }

Modified: incubator/chemistry/trunk/chemistry/chemistry-atompub/src/main/java/org/apache/chemistry/atompub/CMIS.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-atompub/src/main/java/org/apache/chemistry/atompub/CMIS.java?rev=798963&r1=798962&r2=798963&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-atompub/src/main/java/org/apache/chemistry/atompub/CMIS.java
(original)
+++ incubator/chemistry/trunk/chemistry/chemistry-atompub/src/main/java/org/apache/chemistry/atompub/CMIS.java
Wed Jul 29 16:11:11 2009
@@ -221,32 +221,22 @@
      * ----- CMIS Link Types -----
      */
 
-    public static final String LINK_REPOSITORY = "repository";
-
-    public static final String LINK_LATEST_VERSION = "latestversion";
-
     public static final String LINK_SOURCE = "source";
 
     public static final String LINK_TARGET = "target";
 
-    public static final String LINK_TYPE = "type";
-
     public static final String LINK_ALLOWABLE_ACTIONS = "allowableactions";
 
-    public static final String LINK_STREAM = "stream";
-
-    public static final String LINK_PARENTS = "parents";
-
-    public static final String LINK_CHILDREN = "children";
+    public static final String LINK_RELATIONSHIPS = "relationships";
 
-    public static final String LINK_DESCENDANTS = "descendants";
+    public static final String LINK_POLICIES = "policies";
 
-    public static final String LINK_ALL_VERSIONS = "allversions";
+    public static final String LINK_ACL = "acl";
 
-    public static final String LINK_PWC = "pwc";
+    public static final String LINK_CHANGES = "changes";
 
-    public static final String LINK_RELATIONSHIPS = "relationships";
+    public static final String LINK_TYPES_DESCENDANTS = "typesdescendants";
 
-    public static final String LINK_POLICIES = "policies";
+    public static final String LINK_ROOT_DESCENDANTS = "rootdescendants";
 
 }

Modified: incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/xml/stax/StaxReader.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/xml/stax/StaxReader.java?rev=798963&r1=798962&r2=798963&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/xml/stax/StaxReader.java
(original)
+++ incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/xml/stax/StaxReader.java
Wed Jul 29 16:11:11 2009
@@ -312,7 +312,8 @@
         }
         String val = super.getAttributeValue(namespaceURI, localName);
         if (val == null
-                && (namespaceURI.length() == 0 || namespaceURI.equals(getDefaultNamespaceURI())))
{
+                && (namespaceURI.length() != 0 && namespaceURI.equals(getDefaultNamespaceURI())))
{
+            // try with empty namespace
             val = getAttributeValue("", localName);
         }
         return val;

Modified: incubator/chemistry/trunk/chemistry/chemistry-tests/src/main/java/org/apache/chemistry/test/BasicTestCase.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-tests/src/main/java/org/apache/chemistry/test/BasicTestCase.java?rev=798963&r1=798962&r2=798963&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-tests/src/main/java/org/apache/chemistry/test/BasicTestCase.java
(original)
+++ incubator/chemistry/trunk/chemistry/chemistry-tests/src/main/java/org/apache/chemistry/test/BasicTestCase.java
Wed Jul 29 16:11:11 2009
@@ -98,6 +98,9 @@
 
         List<CMISObject> entries = root.getChildren(null);
         assertEquals(1, entries.size());
+        Folder f1 = (Folder) entries.get(0);
+        Folder fold = f1.getParent();
+        assertEquals(root.getId(), fold.getId());
     }
 
     public void testDefaultValues() {



Mime
View raw message