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/07/29 14:03:11 UTC
svn commit: r798867 - in /incubator/chemistry/trunk/chemistry:
chemistry-api/src/main/java/org/apache/chemistry/
chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/
chemistry-atompub-server/src/main/java/org/apache/chemistry/ato...
Author: fguillaume
Date: Wed Jul 29 12:03:11 2009
New Revision: 798867
URL: http://svn.apache.org/viewvc?rev=798867&view=rev
Log:
CMIS-44: Removed ReturnVersion and its use in SPI.getProperties
Removed:
incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/ReturnVersion.java
Modified:
incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/Connection.java
incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/Document.java
incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/SPI.java
incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/APPConnection.java
incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/CMISObjectsCollection.java
incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/impl/simple/SimpleConnection.java
incubator/chemistry/trunk/chemistry/chemistry-commons/src/test/java/org/apache/chemistry/impl/simple/TestSimpleRepository.java
incubator/chemistry/trunk/chemistry/chemistry-jcr/src/main/java/org/apache/chemistry/jcr/JcrConnection.java
incubator/chemistry/trunk/chemistry/chemistry-tests/src/main/java/org/apache/chemistry/test/BasicTestCase.java
Modified: incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/Connection.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/Connection.java?rev=798867&r1=798866&r2=798867&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/Connection.java (original)
+++ incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/Connection.java Wed Jul 29 12:03:11 2009
@@ -104,10 +104,9 @@
* Gets an object given its ID.
*
* @param object the object ID
- * @param returnVersion the version to be returned
- * @return the object, or {@code null} if it is not found
+ * @return the object, or {@code null} if not found
*/
- CMISObject getObject(ObjectId object, ReturnVersion returnVersion);
+ CMISObject getObject(ObjectId object);
/*
* ----- Discovery Services -----
Modified: incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/Document.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/Document.java?rev=798867&r1=798866&r2=798867&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/Document.java (original)
+++ incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/Document.java Wed Jul 29 12:03:11 2009
@@ -78,12 +78,10 @@
* <p>
* Returns the latest version, or the latest major version, of this
* document.
- * <p>
- * If the latest major version is requested and the version series of this
- * document has no major version, an exception is thrown.
*
- * @param major {@code true} if the last major version is requested
- * @return the latest version or latest major version
+ * @param major {@code true} if the latest major version is requested
+ * @return the latest version or latest major version, or {@code null} if
+ * not found
*/
Document getLatestVersion(boolean major);
Modified: incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/SPI.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/SPI.java?rev=798867&r1=798866&r2=798867&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/SPI.java (original)
+++ incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/SPI.java Wed Jul 29 12:03:11 2009
@@ -320,9 +320,6 @@
* Returns the properties of an object, and optionally the operations that
* the user is allowed to perform on the object.
* <p>
- * If a returnVersion is specified, it's actually the properties of that
- * version of the given object that is returned.
- * <p>
* The content stream of the object is not returned, use
* {@link #getContentStream} for that.
* <p>
@@ -331,7 +328,6 @@
* object.
*
* @param object the object
- * @param returnVersion the version to be returned
* @param filter the properties filter, or {@code null} for all properties
* @param includeAllowableActions {@code true} to include allowable actions
* @param includeRelationships {@code true} if relationships should be
@@ -339,9 +335,8 @@
* @return the properties of the object, or {@code null} if the object is
* not found
*/
- ObjectEntry getProperties(ObjectId object, ReturnVersion returnVersion,
- String filter, boolean includeAllowableActions,
- boolean includeRelationships);
+ ObjectEntry getProperties(ObjectId object, String filter,
+ boolean includeAllowableActions, boolean includeRelationships);
/**
* Checks if the document has an associated content stream.
@@ -642,12 +637,12 @@
* version, an exception is thrown.
*
* @param versionSeriesId the version series ID
- * @param majorVersion {@code true} if the last major version is requested
+ * @param major {@code true} if the last major version is requested
* @param filter the properties filter, or {@code null} for all properties
* @return a collection of properties
*/
Map<String, Serializable> getPropertiesOfLatestVersion(
- String versionSeriesId, boolean majorVersion, String filter);
+ String versionSeriesId, boolean major, String filter);
/**
* Gets all the versions of a document.
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=798867&r1=798866&r2=798867&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 12:03:11 2009
@@ -42,7 +42,6 @@
import org.apache.chemistry.Relationship;
import org.apache.chemistry.RelationshipDirection;
import org.apache.chemistry.Repository;
-import org.apache.chemistry.ReturnVersion;
import org.apache.chemistry.SPI;
import org.apache.chemistry.Type;
import org.apache.chemistry.Unfiling;
@@ -94,8 +93,7 @@
public Folder getRootFolder() {
if (root == null) {
- root = (APPFolder) getObject(repository.info.getRootFolderId(),
- ReturnVersion.THIS);
+ root = (APPFolder) getObject(repository.info.getRootFolderId());
}
return root;
}
@@ -335,10 +333,7 @@
return (APPObjectEntry) resp.getObject(new ReadContext(this));
}
- public CMISObject getObject(ObjectId object, ReturnVersion returnVersion) {
- if (returnVersion == null) {
- returnVersion = ReturnVersion.THIS;
- }
+ public CMISObject getObject(ObjectId object) {
APPObjectEntry entry = getObjectEntry(object);
Type type = getRepository().getType(entry.getTypeId());
switch (entry.getBaseType()) {
@@ -353,8 +348,6 @@
default:
throw new AssertionError(entry.getBaseType());
}
-
- // throw new UnsupportedOperationException("Not yet implemented");
}
public ObjectId createDocument(String typeId,
@@ -388,8 +381,7 @@
throw new UnsupportedOperationException();
}
- public ObjectEntry getProperties(ObjectId object,
- ReturnVersion returnVersion, String filter,
+ public ObjectEntry getProperties(ObjectId object, String filter,
boolean includeAllowableActions, boolean includeRelationships) {
// TODO Auto-generated method stub
throw new UnsupportedOperationException();
@@ -504,7 +496,7 @@
}
public Map<String, Serializable> getPropertiesOfLatestVersion(
- String versionSeriesId, boolean majorVersion, String filter) {
+ String versionSeriesId, boolean major, String filter) {
// TODO Auto-generated method stub
throw new UnsupportedOperationException();
}
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=798867&r1=798866&r2=798867&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 12:03:11 2009
@@ -49,7 +49,6 @@
import org.apache.chemistry.ObjectId;
import org.apache.chemistry.Property;
import org.apache.chemistry.Repository;
-import org.apache.chemistry.ReturnVersion;
import org.apache.chemistry.SPI;
import org.apache.chemistry.Type;
import org.apache.chemistry.VersioningState;
@@ -202,8 +201,7 @@
SPI spi = repository.getSPI(); // TODO XXX connection leak
ObjectId objectId = spi.createDocument(typeId, properties,
new SimpleObjectId(id), contentStream, versioningState);
- ObjectEntry object = spi.getProperties(objectId, null, null, false,
- false);
+ ObjectEntry object = spi.getProperties(objectId, null, false, false);
// prepare the updated entry to return in the response
entry = request.getAbdera().getFactory().newEntry();
@@ -292,8 +290,7 @@
public ObjectEntry getEntry(String id, RequestContext request)
throws ResponseContextException {
SPI spi = repository.getSPI(); // TODO XXX connection leak
- return spi.getProperties(spi.newObjectId(id), ReturnVersion.THIS, null,
- false, false);
+ return spi.getProperties(spi.newObjectId(id), null, false, false);
}
@Override
Modified: incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/impl/simple/SimpleConnection.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/impl/simple/SimpleConnection.java?rev=798867&r1=798866&r2=798867&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/impl/simple/SimpleConnection.java (original)
+++ incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/impl/simple/SimpleConnection.java Wed Jul 29 12:03:11 2009
@@ -53,7 +53,6 @@
import org.apache.chemistry.Relationship;
import org.apache.chemistry.RelationshipDirection;
import org.apache.chemistry.Repository;
-import org.apache.chemistry.ReturnVersion;
import org.apache.chemistry.SPI;
import org.apache.chemistry.Type;
import org.apache.chemistry.Unfiling;
@@ -70,8 +69,7 @@
public SimpleConnection(SimpleRepository repository) {
this.repository = repository;
- rootFolder = (SimpleFolder) getObject(
- repository.getInfo().getRootFolderId(), ReturnVersion.THIS);
+ rootFolder = (SimpleFolder) getObject(repository.getInfo().getRootFolderId());
}
public Connection getConnection() {
@@ -418,8 +416,7 @@
throw new UnsupportedOperationException();
}
- public ObjectEntry getProperties(ObjectId object,
- ReturnVersion returnVersion, String filter,
+ public ObjectEntry getProperties(ObjectId object, String filter,
boolean includeAllowableActions, boolean includeRelationships) {
SimpleData data = repository.datas.get(object.getId());
if (data == null) {
@@ -428,8 +425,7 @@
return new SimpleObjectEntry(data, this);
}
- public CMISObject getObject(ObjectId object, ReturnVersion returnVersion) {
- // TODO returnVersion
+ public CMISObject getObject(ObjectId object) {
SimpleData data = repository.datas.get(object.getId());
if (data == null) {
return null;
@@ -663,7 +659,7 @@
}
public Map<String, Serializable> getPropertiesOfLatestVersion(
- String versionSeriesId, boolean majorVersion, String filter) {
+ String versionSeriesId, boolean major, String filter) {
// TODO Auto-generated method stub
throw new UnsupportedOperationException();
}
Modified: incubator/chemistry/trunk/chemistry/chemistry-commons/src/test/java/org/apache/chemistry/impl/simple/TestSimpleRepository.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-commons/src/test/java/org/apache/chemistry/impl/simple/TestSimpleRepository.java?rev=798867&r1=798866&r2=798867&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-commons/src/test/java/org/apache/chemistry/impl/simple/TestSimpleRepository.java (original)
+++ incubator/chemistry/trunk/chemistry/chemistry-commons/src/test/java/org/apache/chemistry/impl/simple/TestSimpleRepository.java Wed Jul 29 12:03:11 2009
@@ -36,7 +36,6 @@
import org.apache.chemistry.QueryCapability;
import org.apache.chemistry.RepositoryCapabilities;
import org.apache.chemistry.RepositoryInfo;
-import org.apache.chemistry.ReturnVersion;
import org.apache.chemistry.Type;
import org.apache.chemistry.Unfiling;
import org.apache.chemistry.Updatability;
@@ -176,7 +175,7 @@
assertEquals("Yo!", d1.getString("title"));
// refetch
- d1 = (Document) conn.getObject(d1, null);
+ d1 = (Document) conn.getObject(d1);
assertEquals("Yo!", d1.getString("title"));
Property prop = d1.getProperty("title");
@@ -211,7 +210,7 @@
Document d1 = root.newDocument("doc");
d1.save();
d1.delete();
- assertNull(conn.getObject(d1, ReturnVersion.THIS));
+ assertNull(conn.getObject(d1));
}
public void testRemoveFolder() {
@@ -233,9 +232,9 @@
d1.setName("bar");
d1.save();
f2.deleteTree(Unfiling.UNFILE);
- assertEquals(f1.getId(), conn.getObject(f1, ReturnVersion.THIS).getId());
- assertNull(conn.getObject(f2, ReturnVersion.THIS));
- assertNull(conn.getObject(d1, ReturnVersion.THIS));
+ assertEquals(f1.getId(), conn.getObject(f1).getId());
+ assertNull(conn.getObject(f2));
+ assertNull(conn.getObject(d1));
}
public void testBasicQuery() {
Modified: incubator/chemistry/trunk/chemistry/chemistry-jcr/src/main/java/org/apache/chemistry/jcr/JcrConnection.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-jcr/src/main/java/org/apache/chemistry/jcr/JcrConnection.java?rev=798867&r1=798866&r2=798867&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-jcr/src/main/java/org/apache/chemistry/jcr/JcrConnection.java (original)
+++ incubator/chemistry/trunk/chemistry/chemistry-jcr/src/main/java/org/apache/chemistry/jcr/JcrConnection.java Wed Jul 29 12:03:11 2009
@@ -45,7 +45,6 @@
import org.apache.chemistry.Relationship;
import org.apache.chemistry.RelationshipDirection;
import org.apache.chemistry.Repository;
-import org.apache.chemistry.ReturnVersion;
import org.apache.chemistry.SPI;
import org.apache.chemistry.Unfiling;
import org.apache.chemistry.VersioningState;
@@ -70,7 +69,7 @@
session.logout();
}
- public CMISObject getObject(ObjectId objectId, ReturnVersion returnVersion) {
+ public CMISObject getObject(ObjectId objectId) {
try {
String relPath = JcrObjectEntry.getPath(objectId.getId()).substring(1);
if (relPath.equals("")) {
@@ -178,8 +177,7 @@
VersioningState versioningState) {
try {
- JcrFolder folder = (JcrFolder) getObject(folderId,
- ReturnVersion.LATEST);
+ JcrFolder folder = (JcrFolder) getObject(folderId);
Document doc = folder.newDocument(null);
doc.setValues(properties);
if (contentStream != null) {
@@ -347,7 +345,6 @@
}
public ObjectEntry getProperties(ObjectId objectId,
- ReturnVersion returnVersion,
String filter,
boolean includeAllowableActions,
boolean includeRelationships) {
@@ -372,7 +369,7 @@
}
public Map<String, Serializable> getPropertiesOfLatestVersion(String versionSeriesId,
- boolean majorVersion,
+ boolean major,
String filter) {
// TODO Auto-generated method stub
return null;
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=798867&r1=798866&r2=798867&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 12:03:11 2009
@@ -183,7 +183,7 @@
public void testGetObjectParents() {
Folder root = conn.getRootFolder();
ObjectId folder1Id = root.getChildren(null).get(0);
- Folder folder1 = (Folder) conn.getObject(folder1Id, null);
+ Folder folder1 = (Folder) conn.getObject(folder1Id);
Document doc = (Document) folder1.getChildren(BaseType.DOCUMENT).get(0);
Collection<ObjectEntry> parents = spi.getObjectParents(doc, null,
false, false);