You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@chemistry.apache.org by fg...@apache.org on 2009/08/05 00:21:30 UTC

svn commit: r800998 - in /incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server: CMISCollection.java CMISObjectsCollection.java

Author: fguillaume
Date: Tue Aug  4 22:21:30 2009
New Revision: 800998

URL: http://svn.apache.org/viewvc?rev=800998&view=rev
Log:
Added service and type (describedby) link

Modified:
    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

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=800998&r1=800997&r2=800998&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 Tue Aug  4 22:21:30 2009
@@ -107,6 +107,10 @@
      * ----- Utilities -----
      */
 
+    public String getServiceLink(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");

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=800998&r1=800997&r2=800998&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 Tue Aug  4 22:21:30 2009
@@ -152,6 +152,9 @@
         entry.addLink(link, "edit");
         // alternate is mandated by Atom when there is no atom:content
         entry.addLink(link, "alternate");
+        String typeId = object.getTypeId();
+        entry.addLink(getTypeLink(typeId, request), AtomPub.LINK_DESCRIBED_BY);
+        entry.addLink(getServiceLink(request), AtomPub.LINK_SERVICE);
 
         // CMIS links
         String oid = object.getId();
@@ -174,7 +177,7 @@
         // entry.addLink("XXX", CMIS.LINK_ALLOWABLE_ACTIONS);
         // entry.addLink("XXX", CMIS.LINK_RELATIONSHIPS);
 
-        Type objectType = repository.getType(object.getTypeId());
+        Type objectType = repository.getType(typeId);
         entry.addExtension(new ObjectElement(factory, object, objectType));
 
         return link;