chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From f...@apache.org
Subject svn commit: r1342031 - in /chemistry/opencmis/trunk: chemistry-opencmis-commons/chemistry-opencmis-commons-api/src/main/java/org/apache/chemistry/opencmis/commons/server/ chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apac...
Date Wed, 23 May 2012 20:31:07 GMT
Author: fmui
Date: Wed May 23 20:31:06 2012
New Revision: 1342031

URL: http://svn.apache.org/viewvc?rev=1342031&view=rev
Log:
CMIS-534: Server: enabled custom atom:id s

Modified:
    chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-api/src/main/java/org/apache/chemistry/opencmis/commons/server/ObjectInfo.java
    chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/server/ObjectInfoImpl.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/AtomPubUtils.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
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/VersioningService.java

Modified: chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-api/src/main/java/org/apache/chemistry/opencmis/commons/server/ObjectInfo.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-api/src/main/java/org/apache/chemistry/opencmis/commons/server/ObjectInfo.java?rev=1342031&r1=1342030&r2=1342031&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-api/src/main/java/org/apache/chemistry/opencmis/commons/server/ObjectInfo.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-api/src/main/java/org/apache/chemistry/opencmis/commons/server/ObjectInfo.java
Wed May 23 20:31:06 2012
@@ -36,6 +36,13 @@ public interface ObjectInfo {
     String getId();
 
     /**
+     * Returns an id for the atom:id tag. This id must comply with the Atom
+     * specification. If this method returns <code>null</code>, OpenCMIS
+     * generates a valid id.
+     */
+    String getAtomId();
+
+    /**
      * Returns the object name.
      */
     String getName();

Modified: chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/server/ObjectInfoImpl.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/server/ObjectInfoImpl.java?rev=1342031&r1=1342030&r2=1342031&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/server/ObjectInfoImpl.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/server/ObjectInfoImpl.java
Wed May 23 20:31:06 2012
@@ -32,6 +32,7 @@ import org.apache.chemistry.opencmis.com
 public class ObjectInfoImpl implements ObjectInfo {
 
     private String id;
+    private String atomId;
     private String name;
     private String createdBy;
     private GregorianCalendar creationDate;
@@ -72,6 +73,14 @@ public class ObjectInfoImpl implements O
         this.id = id;
     }
 
+    public String getAtomId() {
+        return atomId;
+    }
+
+    public void setAtomId(String atomId) {
+        this.atomId = atomId;
+    }
+
     public String getName() {
         return name;
     }

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=1342031&r1=1342030&r2=1342031&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
Wed May 23 20:31:06 2012
@@ -85,7 +85,7 @@ public class AtomEntry extends AtomDocum
         }
 
         writeAuthor(info.getCreatedBy());
-        writeId(generateAtomId(info.getId()));
+        writeId(info.getAtomId() == null ? generateAtomId(info.getId()) : info.getAtomId());
         writePublished(info.getCreationDate());
         writeTitle(info.getName());
         writeUpdated(info.getLastModificationDate());
@@ -108,7 +108,7 @@ public class AtomEntry extends AtomDocum
         }
 
         long now = System.currentTimeMillis();
-        
+
         writeAuthor(DEFAULT_AUTHOR);
         writeId(generateAtomId(object.getId()));
         writePublished(now);

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=1342031&r1=1342030&r2=1342031&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
Wed May 23 20:31:06 2012
@@ -90,10 +90,10 @@ public class AtomFeed extends AtomDocume
     /**
      * Writes the feed elements that are required by Atom.
      */
-    public void writeFeedElements(String id, String author, String title, GregorianCalendar
updated,
+    public void writeFeedElements(String id, String atomId, String author, String title,
GregorianCalendar updated,
             String pathSegment, BigInteger numItems) throws XMLStreamException {
         writeAuthor(author);
-        writeId(generateAtomId(id));
+        writeId(atomId == null ? generateAtomId(id) : atomId);
         writeTitle(title);
         writeUpdated(updated);
         writePathSegment(pathSegment);

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/AtomPubUtils.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/AtomPubUtils.java?rev=1342031&r1=1342030&r2=1342031&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/AtomPubUtils.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/AtomPubUtils.java
Wed May 23 20:31:06 2012
@@ -310,8 +310,8 @@ public final class AtomPubUtils {
         feed.startFeed(false);
 
         // write basic Atom feed elements
-        feed.writeFeedElements(folderInfo.getId(), folderInfo.getCreatedBy(), folderInfo.getName(),
-                folderInfo.getLastModificationDate(), null, null);
+        feed.writeFeedElements(folderInfo.getId(), folderInfo.getAtomId(), folderInfo.getCreatedBy(),
+                folderInfo.getName(), folderInfo.getLastModificationDate(), null, null);
 
         // write links
         feed.writeServiceLink(baseUrl.toString(), repositoryId);
@@ -388,7 +388,8 @@ public final class AtomPubUtils {
         feed.startFeed(false);
 
         // write basic Atom feed elements
-        feed.writeFeedElements(type.getId(), TYPE_AUTHOR, type.getDisplayName(), new GregorianCalendar(),
null, null);
+        feed.writeFeedElements(type.getId(), null, TYPE_AUTHOR, type.getDisplayName(), new
GregorianCalendar(), null,
+                null);
 
         feed.writeServiceLink(baseUrl.toString(), repositoryId);
 

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=1342031&r1=1342030&r2=1342031&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
Wed May 23 20:31:06 2012
@@ -162,7 +162,7 @@ public class DiscoveryService {
 
         // write basic Atom feed elements
         GregorianCalendar now = new GregorianCalendar();
-        feed.writeFeedElements("query", "", "Query", now, null, results.getNumItems());
+        feed.writeFeedElements("query", null, "", "Query", now, null, results.getNumItems());
 
         // write links
         feed.writeServiceLink(baseUrl.toString(), repositoryId);
@@ -244,7 +244,7 @@ public class DiscoveryService {
 
         // write basic Atom feed elements
         GregorianCalendar now = new GregorianCalendar();
-        feed.writeFeedElements("contentChanges", "", "Content Change", now, null, changes.getNumItems());
+        feed.writeFeedElements("contentChanges", null, "", "Content Change", now, null, changes.getNumItems());
 
         // write links
         UrlBuilder baseUrl = compileBaseUrl(request, repositoryId);

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=1342031&r1=1342030&r2=1342031&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
Wed May 23 20:31:06 2012
@@ -112,8 +112,8 @@ public final class NavigationService {
         feed.startFeed(true);
 
         // write basic Atom feed elements
-        feed.writeFeedElements(folderInfo.getId(), folderInfo.getCreatedBy(), folderInfo.getName(),
-                folderInfo.getLastModificationDate(), null, children.getNumItems());
+        feed.writeFeedElements(folderInfo.getId(), folderInfo.getAtomId(), folderInfo.getCreatedBy(),
+                folderInfo.getName(), folderInfo.getLastModificationDate(), null, children.getNumItems());
 
         // write links
         UrlBuilder baseUrl = compileBaseUrl(request, repositoryId);
@@ -229,8 +229,8 @@ public final class NavigationService {
         feed.startFeed(true);
 
         // write basic Atom feed elements
-        feed.writeFeedElements(folderInfo.getId(), folderInfo.getCreatedBy(), folderInfo.getName(),
-                folderInfo.getLastModificationDate(), null, null);
+        feed.writeFeedElements(folderInfo.getId(), folderInfo.getAtomId(), folderInfo.getCreatedBy(),
+                folderInfo.getName(), folderInfo.getLastModificationDate(), null, null);
 
         // write links
         UrlBuilder baseUrl = compileBaseUrl(request, repositoryId);
@@ -304,8 +304,8 @@ public final class NavigationService {
         feed.startFeed(true);
 
         // write basic Atom feed elements
-        feed.writeFeedElements(folderInfo.getId(), folderInfo.getCreatedBy(), folderInfo.getName(),
-                folderInfo.getLastModificationDate(), null, null);
+        feed.writeFeedElements(folderInfo.getId(), folderInfo.getAtomId(), folderInfo.getCreatedBy(),
+                folderInfo.getName(), folderInfo.getLastModificationDate(), null, null);
 
         // write links
         UrlBuilder baseUrl = compileBaseUrl(request, repositoryId);
@@ -379,8 +379,8 @@ public final class NavigationService {
         feed.startFeed(true);
 
         // write basic Atom feed elements
-        feed.writeFeedElements(objectInfo.getId(), objectInfo.getCreatedBy(), objectInfo.getName(),
-                objectInfo.getLastModificationDate(), null, null);
+        feed.writeFeedElements(objectInfo.getId(), objectInfo.getAtomId(), objectInfo.getCreatedBy(),
+                objectInfo.getName(), objectInfo.getLastModificationDate(), null, null);
 
         // write links
         UrlBuilder baseUrl = compileBaseUrl(request, repositoryId);
@@ -458,8 +458,8 @@ public final class NavigationService {
         feed.startFeed(true);
 
         // write basic Atom feed elements
-        feed.writeFeedElements(folderInfo.getId(), folderInfo.getCreatedBy(), folderInfo.getName(),
-                folderInfo.getLastModificationDate(), null, checkedOut.getNumItems());
+        feed.writeFeedElements(folderInfo.getId(), folderInfo.getAtomId(), folderInfo.getCreatedBy(),
+                folderInfo.getName(), folderInfo.getLastModificationDate(), null, checkedOut.getNumItems());
 
         // write links
         UrlBuilder baseUrl = compileBaseUrl(request, repositoryId);

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=1342031&r1=1342030&r2=1342031&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
Wed May 23 20:31:06 2012
@@ -79,8 +79,8 @@ public class PolicyService {
         feed.startFeed(true);
 
         // write basic Atom feed elements
-        feed.writeFeedElements(objectInfo.getId(), objectInfo.getCreatedBy(), objectInfo.getName(),
-                objectInfo.getLastModificationDate(), null, null);
+        feed.writeFeedElements(objectInfo.getId(), objectInfo.getAtomId(), objectInfo.getCreatedBy(),
+                objectInfo.getName(), objectInfo.getLastModificationDate(), null, null);
 
         // write links
         UrlBuilder baseUrl = compileBaseUrl(request, repositoryId);

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=1342031&r1=1342030&r2=1342031&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
Wed May 23 20:31:06 2012
@@ -91,8 +91,8 @@ public class RelationshipService {
         feed.startFeed(true);
 
         // write basic Atom feed elements
-        feed.writeFeedElements(objectInfo.getId(), objectInfo.getCreatedBy(), objectInfo.getName(),
-                objectInfo.getLastModificationDate(), null, relationships.getNumItems());
+        feed.writeFeedElements(objectInfo.getId(), objectInfo.getAtomId(), objectInfo.getCreatedBy(),
+                objectInfo.getName(), objectInfo.getLastModificationDate(), null, relationships.getNumItems());
 
         // write links
         UrlBuilder baseUrl = compileBaseUrl(request, repositoryId);

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=1342031&r1=1342030&r2=1342031&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
Wed May 23 20:31:06 2012
@@ -276,7 +276,7 @@ public final class RepositoryService {
         feed.startFeed(true);
 
         // write basic Atom feed elements
-        feed.writeFeedElements(typeId, TYPE_AUTHOR, typeName, new GregorianCalendar(), null,
numItems);
+        feed.writeFeedElements(typeId, null, TYPE_AUTHOR, typeName, new GregorianCalendar(),
null, numItems);
 
         // write links
         UrlBuilder baseUrl = compileBaseUrl(request, repositoryId);
@@ -357,7 +357,7 @@ public final class RepositoryService {
         feed.startFeed(true);
 
         // write basic Atom feed elements
-        feed.writeFeedElements(typeId, TYPE_AUTHOR, typeName, new GregorianCalendar(), null,
null);
+        feed.writeFeedElements(typeId, null, TYPE_AUTHOR, typeName, new GregorianCalendar(),
null, null);
 
         // write links
         UrlBuilder baseUrl = compileBaseUrl(request, repositoryId);

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/VersioningService.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/VersioningService.java?rev=1342031&r1=1342030&r2=1342031&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/VersioningService.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/VersioningService.java
Wed May 23 20:31:06 2012
@@ -125,7 +125,7 @@ public class VersioningService {
         ObjectInfo latestObjectInfo = service.getObjectInfo(repositoryId, versions.get(0).getId());
         ObjectInfo firstObjectInfo = service.getObjectInfo(repositoryId, versions.get(versions.size()
- 1).getId());
 
-        feed.writeFeedElements(versionSeriesId, firstObjectInfo.getCreatedBy(), latestObjectInfo.getName(),
+        feed.writeFeedElements(versionSeriesId, null, firstObjectInfo.getCreatedBy(), latestObjectInfo.getName(),
                 latestObjectInfo.getLastModificationDate(), null, null);
 
         // write links



Mime
View raw message