chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From f...@apache.org
Subject svn commit: r1456406 - /chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/
Date Thu, 14 Mar 2013 12:49:25 GMT
Author: fmui
Date: Thu Mar 14 12:49:25 2013
New Revision: 1456406

URL: http://svn.apache.org/r1456406
Log:
CMIS-638: fixed feed self links

Modified:
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/AtomDocumentBase.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/AtomEntry.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/AtomFeed.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/DiscoveryService.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/NavigationService.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/PolicyService.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/RelationshipService.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/RepositoryService.java

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/AtomDocumentBase.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/AtomDocumentBase.java?rev=1456406&r1=1456405&r2=1456406&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/AtomDocumentBase.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/AtomDocumentBase.java
Thu Mar 14 12:49:25 2013
@@ -183,8 +183,8 @@ public abstract class AtomDocumentBase e
         }
     }
 
-    public void writeSelfLink(String href, String id) throws XMLStreamException {
-        writeLink(Constants.REL_SELF, href, Constants.MEDIATYPE_ENTRY, id);
+    public void writeSelfLink(String href, String type, String id) throws XMLStreamException
{
+        writeLink(Constants.REL_SELF, href, type, id);
     }
 
     public void writeEnclosureLink(String href) throws XMLStreamException {

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/AtomEntry.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/AtomEntry.java?rev=1456406&r1=1456405&r2=1456406&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/AtomEntry.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/AtomEntry.java
Thu Mar 14 12:49:25 2013
@@ -24,6 +24,7 @@ import javax.xml.stream.XMLStreamWriter;
 import org.apache.chemistry.opencmis.commons.data.ObjectData;
 import org.apache.chemistry.opencmis.commons.definitions.TypeDefinition;
 import org.apache.chemistry.opencmis.commons.enums.CmisVersion;
+import org.apache.chemistry.opencmis.commons.impl.Constants;
 import org.apache.chemistry.opencmis.commons.impl.XMLConstants;
 import org.apache.chemistry.opencmis.commons.impl.XMLConverter;
 import org.apache.chemistry.opencmis.commons.server.ObjectInfo;
@@ -74,6 +75,13 @@ public class AtomEntry extends AtomDocum
     }
 
     /**
+     * Writes an entry self link.
+     */
+    public void writeSelfLink(String href, String id) throws XMLStreamException {
+        writeSelfLink(href, Constants.MEDIATYPE_ENTRY, id);
+    }
+
+    /**
      * Writes an object.
      */
     public void writeObject(ObjectData object, ObjectInfo info, String contentSrc, String
contentType,

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/AtomFeed.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/AtomFeed.java?rev=1456406&r1=1456405&r2=1456406&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/AtomFeed.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/AtomFeed.java
Thu Mar 14 12:49:25 2013
@@ -90,6 +90,13 @@ public class AtomFeed extends AtomDocume
     }
 
     /**
+     * Writes an feed self link.
+     */
+    public void writeSelfLink(String href, String id) throws XMLStreamException {
+        writeSelfLink(href, Constants.MEDIATYPE_FEED, id);
+    }
+
+    /**
      * Writes the feed elements that are required by Atom.
      */
     public void writeFeedElements(String id, String atomId, String author, String title,
GregorianCalendar updated,

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/DiscoveryService.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/DiscoveryService.java?rev=1456406&r1=1456405&r2=1456406&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/DiscoveryService.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/DiscoveryService.java
Thu Mar 14 12:49:25 2013
@@ -254,6 +254,15 @@ public final class DiscoveryService {
 
         feed.writeServiceLink(baseUrl.toString(), repositoryId);
 
+        UrlBuilder selfLink = compileUrlBuilder(baseUrl, RESOURCE_CHANGES, null);
+        selfLink.addParameter(Constants.PARAM_CHANGE_LOG_TOKEN, changeLogToken);
+        selfLink.addParameter(Constants.PARAM_PROPERTIES, includeProperties);
+        selfLink.addParameter(Constants.PARAM_FILTER, filter);
+        selfLink.addParameter(Constants.PARAM_POLICY_IDS, includePolicyIds);
+        selfLink.addParameter(Constants.PARAM_ACL, includeAcl);
+        selfLink.addParameter(Constants.PARAM_MAX_ITEMS, maxItems);
+        feed.writeSelfLink(selfLink.toString(), null);
+
         if (changeLogTokenHolder.getValue() != null) {
             UrlBuilder nextLink = compileUrlBuilder(baseUrl, RESOURCE_CHANGES, null);
             nextLink.addParameter(Constants.PARAM_CHANGE_LOG_TOKEN, changeLogTokenHolder.getValue());

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/NavigationService.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/NavigationService.java?rev=1456406&r1=1456405&r2=1456406&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/NavigationService.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/NavigationService.java
Thu Mar 14 12:49:25 2013
@@ -120,7 +120,16 @@ public final class NavigationService {
 
         feed.writeServiceLink(baseUrl.toString(), repositoryId);
 
-        feed.writeSelfLink(compileUrl(baseUrl, RESOURCE_CHILDREN, folderInfo.getId()), null);
+        UrlBuilder selfLink = compileUrlBuilder(baseUrl, RESOURCE_CHILDREN, folderInfo.getId());
+        selfLink.addParameter(Constants.PARAM_FILTER, filter);
+        selfLink.addParameter(Constants.PARAM_ORDER_BY, orderBy);
+        selfLink.addParameter(Constants.PARAM_ALLOWABLE_ACTIONS, includeAllowableActions);
+        selfLink.addParameter(Constants.PARAM_RELATIONSHIPS, includeRelationships);
+        selfLink.addParameter(Constants.PARAM_RENDITION_FILTER, renditionFilter);
+        selfLink.addParameter(Constants.PARAM_PATH_SEGMENT, includePathSegment);
+        selfLink.addParameter(Constants.PARAM_MAX_ITEMS, maxItems);
+        selfLink.addParameter(Constants.PARAM_SKIP_COUNT, skipCount);
+        feed.writeSelfLink(selfLink.toString(), null);
 
         feed.writeDescribedByLink(compileUrl(baseUrl, RESOURCE_TYPE, folderInfo.getTypeId()));
 
@@ -237,7 +246,14 @@ public final class NavigationService {
 
         feed.writeServiceLink(baseUrl.toString(), repositoryId);
 
-        feed.writeSelfLink(compileUrl(baseUrl, RESOURCE_DESCENDANTS, folderInfo.getId()),
null);
+        UrlBuilder selfLink = compileUrlBuilder(baseUrl, RESOURCE_DESCENDANTS, folderInfo.getId());
+        selfLink.addParameter(Constants.PARAM_DEPTH, depth);
+        selfLink.addParameter(Constants.PARAM_FILTER, filter);
+        selfLink.addParameter(Constants.PARAM_ALLOWABLE_ACTIONS, includeAllowableActions);
+        selfLink.addParameter(Constants.PARAM_RELATIONSHIPS, includeRelationships);
+        selfLink.addParameter(Constants.PARAM_RENDITION_FILTER, renditionFilter);
+        selfLink.addParameter(Constants.PARAM_PATH_SEGMENT, includePathSegment);
+        feed.writeSelfLink(selfLink.toString(), null);
 
         feed.writeViaLink(compileUrl(baseUrl, RESOURCE_ENTRY, folderInfo.getId()));
 
@@ -312,7 +328,14 @@ public final class NavigationService {
 
         feed.writeServiceLink(baseUrl.toString(), repositoryId);
 
-        feed.writeSelfLink(compileUrl(baseUrl, RESOURCE_DESCENDANTS, folderInfo.getId()),
null);
+        UrlBuilder selfLink = compileUrlBuilder(baseUrl, RESOURCE_FOLDERTREE, folderInfo.getId());
+        selfLink.addParameter(Constants.PARAM_DEPTH, depth);
+        selfLink.addParameter(Constants.PARAM_FILTER, filter);
+        selfLink.addParameter(Constants.PARAM_ALLOWABLE_ACTIONS, includeAllowableActions);
+        selfLink.addParameter(Constants.PARAM_RELATIONSHIPS, includeRelationships);
+        selfLink.addParameter(Constants.PARAM_RENDITION_FILTER, renditionFilter);
+        selfLink.addParameter(Constants.PARAM_PATH_SEGMENT, includePathSegment);
+        feed.writeSelfLink(selfLink.toString(), null);
 
         feed.writeViaLink(compileUrl(baseUrl, RESOURCE_ENTRY, folderInfo.getId()));
 
@@ -387,7 +410,13 @@ public final class NavigationService {
 
         feed.writeServiceLink(baseUrl.toString(), repositoryId);
 
-        feed.writeSelfLink(compileUrl(baseUrl, RESOURCE_PARENTS, objectInfo.getId()), null);
+        UrlBuilder selfLink = compileUrlBuilder(baseUrl, RESOURCE_PARENTS, objectInfo.getId());
+        selfLink.addParameter(Constants.PARAM_FILTER, filter);
+        selfLink.addParameter(Constants.PARAM_ALLOWABLE_ACTIONS, includeAllowableActions);
+        selfLink.addParameter(Constants.PARAM_RELATIONSHIPS, includeRelationships);
+        selfLink.addParameter(Constants.PARAM_RENDITION_FILTER, renditionFilter);
+        selfLink.addParameter(Constants.PARAM_RELATIVE_PATH_SEGMENT, includeRelativePathSegment);
+        feed.writeSelfLink(selfLink.toString(), null);
 
         // write entries
         AtomEntry entry = new AtomEntry(feed.getWriter());
@@ -466,9 +495,16 @@ public final class NavigationService {
 
         feed.writeServiceLink(baseUrl.toString(), repositoryId);
 
-        feed.writeSelfLink(compileUrl(baseUrl, RESOURCE_CHECKEDOUT, folderInfo.getId()),
null);
+        UrlBuilder selfLink = compileUrlBuilder(baseUrl, RESOURCE_CHECKEDOUT, folderInfo.getId());
+        selfLink.addParameter(Constants.PARAM_FILTER, filter);
+        selfLink.addParameter(Constants.PARAM_ORDER_BY, orderBy);
+        selfLink.addParameter(Constants.PARAM_ALLOWABLE_ACTIONS, includeAllowableActions);
+        selfLink.addParameter(Constants.PARAM_RELATIONSHIPS, includeRelationships);
+        selfLink.addParameter(Constants.PARAM_MAX_ITEMS, maxItems);
+        selfLink.addParameter(Constants.PARAM_SKIP_COUNT, skipCount);
+        feed.writeSelfLink(selfLink.toString(), null);
 
-        UrlBuilder pagingUrl = new UrlBuilder(compileUrlBuilder(baseUrl, RESOURCE_CHECKEDOUT,
folderInfo.getId()));
+        UrlBuilder pagingUrl = compileUrlBuilder(baseUrl, RESOURCE_CHECKEDOUT, folderInfo.getId());
         pagingUrl.addParameter(Constants.PARAM_FILTER, filter);
         pagingUrl.addParameter(Constants.PARAM_ORDER_BY, orderBy);
         pagingUrl.addParameter(Constants.PARAM_ALLOWABLE_ACTIONS, includeAllowableActions);

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/PolicyService.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/PolicyService.java?rev=1456406&r1=1456405&r2=1456406&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/PolicyService.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/PolicyService.java
Thu Mar 14 12:49:25 2013
@@ -21,7 +21,6 @@ package org.apache.chemistry.opencmis.se
 import static org.apache.chemistry.opencmis.commons.impl.Converter.convert;
 import static org.apache.chemistry.opencmis.server.impl.atompub.AtomPubUtils.RESOURCE_POLICIES;
 import static org.apache.chemistry.opencmis.server.impl.atompub.AtomPubUtils.compileBaseUrl;
-import static org.apache.chemistry.opencmis.server.impl.atompub.AtomPubUtils.compileUrl;
 import static org.apache.chemistry.opencmis.server.impl.atompub.AtomPubUtils.compileUrlBuilder;
 import static org.apache.chemistry.opencmis.server.impl.atompub.AtomPubUtils.getNamespaces;
 import static org.apache.chemistry.opencmis.server.shared.HttpUtils.getStringParameter;
@@ -88,7 +87,9 @@ public final class PolicyService {
 
         feed.writeServiceLink(baseUrl.toString(), repositoryId);
 
-        feed.writeSelfLink(compileUrl(baseUrl, RESOURCE_POLICIES, objectInfo.getId()), null);
+        UrlBuilder selfLink = compileUrlBuilder(baseUrl, RESOURCE_POLICIES, objectInfo.getId());
+        selfLink.addParameter(Constants.PARAM_FILTER, filter);
+        feed.writeSelfLink(selfLink.toString(), null);
 
         // write entries
         AtomEntry entry = new AtomEntry(feed.getWriter());

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/RelationshipService.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/RelationshipService.java?rev=1456406&r1=1456405&r2=1456406&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/RelationshipService.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/RelationshipService.java
Thu Mar 14 12:49:25 2013
@@ -20,7 +20,6 @@ package org.apache.chemistry.opencmis.se
 
 import static org.apache.chemistry.opencmis.server.impl.atompub.AtomPubUtils.RESOURCE_RELATIONSHIPS;
 import static org.apache.chemistry.opencmis.server.impl.atompub.AtomPubUtils.compileBaseUrl;
-import static org.apache.chemistry.opencmis.server.impl.atompub.AtomPubUtils.compileUrl;
 import static org.apache.chemistry.opencmis.server.impl.atompub.AtomPubUtils.compileUrlBuilder;
 import static org.apache.chemistry.opencmis.server.impl.atompub.AtomPubUtils.getNamespaces;
 import static org.apache.chemistry.opencmis.server.impl.atompub.AtomPubUtils.writeObjectEntry;
@@ -99,7 +98,15 @@ public final class RelationshipService {
 
         feed.writeServiceLink(baseUrl.toString(), repositoryId);
 
-        feed.writeSelfLink(compileUrl(baseUrl, RESOURCE_RELATIONSHIPS, objectInfo.getId()),
null);
+        UrlBuilder selfLink = compileUrlBuilder(baseUrl, RESOURCE_RELATIONSHIPS, objectInfo.getId());
+        selfLink.addParameter(Constants.PARAM_SUB_RELATIONSHIP_TYPES, includeSubRelationshipTypes);
+        selfLink.addParameter(Constants.PARAM_RELATIONSHIP_DIRECTION, relationshipDirection);
+        selfLink.addParameter(Constants.PARAM_TYPE_ID, typeId);
+        selfLink.addParameter(Constants.PARAM_FILTER, filter);
+        selfLink.addParameter(Constants.PARAM_ALLOWABLE_ACTIONS, includeAllowableActions);
+        selfLink.addParameter(Constants.PARAM_MAX_ITEMS, maxItems);
+        selfLink.addParameter(Constants.PARAM_SKIP_COUNT, skipCount);
+        feed.writeSelfLink(selfLink.toString(), null);
 
         UrlBuilder pagingUrl = new UrlBuilder(compileUrlBuilder(baseUrl, RESOURCE_RELATIONSHIPS,
objectInfo.getId()));
         pagingUrl.addParameter(Constants.PARAM_SUB_RELATIONSHIP_TYPES, includeSubRelationshipTypes);

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/RepositoryService.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/RepositoryService.java?rev=1456406&r1=1456405&r2=1456406&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/RepositoryService.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/RepositoryService.java
Thu Mar 14 12:49:25 2013
@@ -288,6 +288,8 @@ public final class RepositoryService {
         UrlBuilder selfLink = compileUrlBuilder(baseUrl, RESOURCE_TYPES, null);
         selfLink.addParameter(Constants.PARAM_TYPE_ID, typeId);
         selfLink.addParameter(Constants.PARAM_PROPERTY_DEFINITIONS, includePropertyDefinitions);
+        selfLink.addParameter(Constants.PARAM_MAX_ITEMS, maxItems);
+        selfLink.addParameter(Constants.PARAM_SKIP_COUNT, skipCount);
         feed.writeSelfLink(selfLink.toString(), typeId);
 
         feed.writeViaLink(compileUrl(baseUrl, RESOURCE_TYPE, typeId));



Mime
View raw message