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/05/08 21:52:44 UTC
svn commit: r773069 [1/6] - in /incubator/chemistry/trunk/chemistry: ./
chemistry-api/src/main/java/org/apache/chemistry/
chemistry-api/src/main/java/org/apache/chemistry/property/
chemistry-api/src/main/java/org/apache/chemistry/repository/ chemistry-...
Author: fguillaume
Date: Fri May 8 19:52:42 2009
New Revision: 773069
URL: http://svn.apache.org/viewvc?rev=773069&view=rev
Log:
sync with Nuxeo mercurial codebase at rev 0056848cfe96
Added:
incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/BaseType.java
- copied, changed from r773055, incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/type/BaseType.java
incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/Choice.java
- copied, changed from r773055, incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/property/Choice.java
incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/ContentStreamPresence.java
- copied, changed from r773055, incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/type/ContentStreamPresence.java
incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/JoinCapability.java
- copied, changed from r773055, incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/repository/JoinCapability.java
incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/ObjectId.java (with props)
incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/Property.java
- copied, changed from r773055, incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/property/Property.java
incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/PropertyDefinition.java
- copied, changed from r773055, incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/property/PropertyDefinition.java
incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/PropertyType.java
- copied, changed from r773055, incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/property/PropertyType.java
incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/QueryCapability.java
- copied, changed from r773055, incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/repository/QueryCapability.java
incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/Repository.java
- copied, changed from r773055, incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/repository/Repository.java
incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/RepositoryCapabilities.java
- copied, changed from r773055, incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/repository/RepositoryCapabilities.java
incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/RepositoryEntry.java
- copied, changed from r773055, incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/repository/RepositoryEntry.java
incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/RepositoryFactory.java
- copied, changed from r773055, incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/repository/RepositoryFactory.java
incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/RepositoryInfo.java
- copied, changed from r773055, incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/repository/RepositoryInfo.java
incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/RepositoryService.java
- copied, changed from r773055, incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/repository/RepositoryService.java
incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/Type.java
- copied, changed from r773055, incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/type/Type.java
incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/Updatability.java
- copied, changed from r773055, incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/property/Updatability.java
incubator/chemistry/trunk/chemistry/chemistry-atompub/src/main/java/org/apache/chemistry/atompub/abdera/
incubator/chemistry/trunk/chemistry/chemistry-atompub/src/main/java/org/apache/chemistry/atompub/abdera/AllowableActionsElement.java
- copied, changed from r773055, incubator/chemistry/trunk/chemistry/chemistry-atompub/src/main/java/org/apache/chemistry/atompub/AllowableActionsElement.java
incubator/chemistry/trunk/chemistry/chemistry-atompub/src/main/java/org/apache/chemistry/atompub/abdera/ObjectElement.java
- copied, changed from r773055, incubator/chemistry/trunk/chemistry/chemistry-atompub/src/main/java/org/apache/chemistry/atompub/ObjectElement.java
incubator/chemistry/trunk/chemistry/chemistry-atompub/src/main/java/org/apache/chemistry/atompub/abdera/PropertiesElement.java
- copied, changed from r773055, incubator/chemistry/trunk/chemistry/chemistry-atompub/src/main/java/org/apache/chemistry/atompub/PropertiesElement.java
incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/impl/base/
incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/impl/base/BaseObject.java (with props)
incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/impl/base/BaseRepository.java (with props)
incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/impl/simple/SimpleObjectId.java (with props)
incubator/chemistry/trunk/chemistry/chemistry-tests/src/main/java/org/apache/chemistry/test/RepositoryCreationHelper.java
- copied, changed from r773055, incubator/chemistry/trunk/chemistry/chemistry-tests/src/main/java/org/apache/chemistry/test/RepositoryTestFactory.java
incubator/chemistry/trunk/chemistry/chemistry-ws/
incubator/chemistry/trunk/chemistry/chemistry-ws/pom.xml (with props)
incubator/chemistry/trunk/chemistry/chemistry-ws/src/
incubator/chemistry/trunk/chemistry/chemistry-ws/src/main/
incubator/chemistry/trunk/chemistry/chemistry-ws/src/main/resources/
incubator/chemistry/trunk/chemistry/chemistry-ws/src/main/resources/wsdl/
incubator/chemistry/trunk/chemistry/chemistry-ws/src/main/resources/wsdl/APP.xsd (with props)
incubator/chemistry/trunk/chemistry/chemistry-ws/src/main/resources/wsdl/ATOM.xsd (with props)
incubator/chemistry/trunk/chemistry/chemistry-ws/src/main/resources/wsdl/CMIS-Core.xsd (with props)
incubator/chemistry/trunk/chemistry/chemistry-ws/src/main/resources/wsdl/CMIS-Messaging.xsd (with props)
incubator/chemistry/trunk/chemistry/chemistry-ws/src/main/resources/wsdl/CMISWS-Service.wsdl
incubator/chemistry/trunk/chemistry/chemistry-ws/src/main/resources/wsdl/xhtml1-strict.xsd (with props)
incubator/chemistry/trunk/chemistry/chemistry-ws/src/main/resources/wsdl/xml.xsd (with props)
Removed:
incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/property/Choice.java
incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/property/Property.java
incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/property/PropertyDefinition.java
incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/property/PropertyType.java
incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/property/Updatability.java
incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/repository/JoinCapability.java
incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/repository/QueryCapability.java
incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/repository/Repository.java
incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/repository/RepositoryCapabilities.java
incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/repository/RepositoryEntry.java
incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/repository/RepositoryFactory.java
incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/repository/RepositoryInfo.java
incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/repository/RepositoryService.java
incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/type/BaseType.java
incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/type/ContentStreamPresence.java
incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/type/Type.java
incubator/chemistry/trunk/chemistry/chemistry-atompub/src/main/java/org/apache/chemistry/atompub/AllowableActionsElement.java
incubator/chemistry/trunk/chemistry/chemistry-atompub/src/main/java/org/apache/chemistry/atompub/ObjectElement.java
incubator/chemistry/trunk/chemistry/chemistry-atompub/src/main/java/org/apache/chemistry/atompub/PropertiesElement.java
incubator/chemistry/trunk/chemistry/chemistry-tests/src/main/java/org/apache/chemistry/test/RepositoryTestFactory.java
Modified:
incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/CMISObject.java
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/Folder.java
incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/ObjectEntry.java
incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/SPI.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/CMISCollectionForChildren.java
incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/CMISCollectionForOther.java
incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/CMISCollectionForTypes.java
incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/CMISProvider.java
incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/CMISServiceResponse.java
incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/CMISServlet.java
incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/CMISWorkspaceManager.java
incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/test/java/org/apache/chemistry/atompub/server/TestAtomPubServer.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/impl/simple/SimpleConnection.java
incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/impl/simple/SimpleData.java
incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/impl/simple/SimpleDocument.java
incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/impl/simple/SimpleFolder.java
incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/impl/simple/SimpleObject.java
incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/impl/simple/SimpleObjectEntry.java
incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/impl/simple/SimplePolicy.java
incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/impl/simple/SimpleProperty.java
incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/impl/simple/SimplePropertyDefinition.java
incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/impl/simple/SimpleRelationship.java
incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/impl/simple/SimpleRepository.java
incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/impl/simple/SimpleType.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-jcr/src/main/java/org/apache/chemistry/jcr/JcrDocument.java
incubator/chemistry/trunk/chemistry/chemistry-jcr/src/main/java/org/apache/chemistry/jcr/JcrFolder.java
incubator/chemistry/trunk/chemistry/chemistry-jcr/src/main/java/org/apache/chemistry/jcr/JcrNewFolder.java
incubator/chemistry/trunk/chemistry/chemistry-jcr/src/main/java/org/apache/chemistry/jcr/JcrObjectEntry.java
incubator/chemistry/trunk/chemistry/chemistry-jcr/src/main/java/org/apache/chemistry/jcr/JcrProperty.java
incubator/chemistry/trunk/chemistry/chemistry-jcr/src/main/java/org/apache/chemistry/jcr/JcrPropertyDefinition.java
incubator/chemistry/trunk/chemistry/chemistry-jcr/src/main/java/org/apache/chemistry/jcr/JcrRepository.java
incubator/chemistry/trunk/chemistry/chemistry-jcr/src/main/java/org/apache/chemistry/jcr/JcrType.java
incubator/chemistry/trunk/chemistry/chemistry-tests/src/main/java/org/apache/chemistry/test/MainServlet.java
incubator/chemistry/trunk/chemistry/pom.xml
Copied: incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/BaseType.java (from r773055, incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/type/BaseType.java)
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/BaseType.java?p2=incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/BaseType.java&p1=incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/type/BaseType.java&r1=773055&r2=773069&rev=773069&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/type/BaseType.java (original)
+++ incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/BaseType.java Fri May 8 19:52:42 2009
@@ -16,7 +16,7 @@
* Authors:
* Florent Guillaume
*/
-package org.apache.chemistry.type;
+package org.apache.chemistry;
/**
* The CMIS base types.
Modified: incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/CMISObject.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/CMISObject.java?rev=773069&r1=773068&r2=773069&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/CMISObject.java (original)
+++ incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/CMISObject.java Fri May 8 19:52:42 2009
@@ -19,33 +19,61 @@
package org.apache.chemistry;
import java.io.Serializable;
+import java.math.BigDecimal;
+import java.net.URI;
+import java.util.Calendar;
import java.util.Map;
/**
* A CMIS Object.
* <p>
- * This differs from an {@link ObjectEntry} by the fact that it is a "live"
- * object: it will automatically fetch any missing information from the
- * repository if needed, and the values set on this object will be stored into
- * the repository when the object is saved.
+ * This interface contains a lot of common functionality for the four
+ * sub-interfaces that are actually implemented: {@link Folder},
+ * {@link Document}, {@link Relationship} and {@link Policy}.
+ * <p>
+ * This is a "live" object, it will automatically fetch any missing information
+ * from the repository if needed, and the values set on this object will be
+ * stored into the repository when the object is saved.
*
+ * @see Folder
+ * @see Document
+ * @see Relationship
+ * @see Policy
* @author Florent Guillaume
*/
-public interface CMISObject extends ObjectEntry {
+public interface CMISObject extends ObjectId {
/**
- * The parent folder, or the single folder in which the object is filed.
- * <p>
- * For a folder, returns the parent folder, or {@code null} if there is no
- * parent (for the root folder).
- * <p>
- * For a non-folder, if the object is single-filed then the folder in which
- * it is filed is returned, otherwise if the folder is unfiled then {@code
- * null} is returned. An exception is raised if the object is multi-filed.
+ * The object's type definition.
+ */
+ Type getType();
+
+ /*
+ * ----- data access -----
+ */
+
+ /**
+ * Gets a property.
*
- * @return the parent folder, or {@code null}.
+ * @param name the property name
+ * @return the property
*/
- Folder getParent();
+ Property getProperty(String name);
+
+ /**
+ * Gets all the properties.
+ *
+ * @return a map of the properties
+ */
+ Map<String, Property> getProperties();
+
+ /**
+ * Gets a property value.
+ *
+ * @param name the property name
+ * @return the property value
+ */
+ Serializable getValue(String name);
/**
* Sets a property value.
@@ -58,7 +86,6 @@
* @param name the property name
* @param value the property value, or {@code null}
*/
-
void setValue(String name, Serializable value);
/**
@@ -77,19 +104,119 @@
* Saves the modifications done to the object through {@link #setValue},
* {@link #setValues} and {@link Document#setContentStream}.
* <p>
- * Note that a repository is not required to wait until a {@code save()} is
+ * Note that a repository is not required to wait until a {@link #save} is
* called to actually save the modifications, it may do so as soon as
- * {@code setValue()} is called.
+ * {@link #setValue} is called.
* <p>
- * Calling {@code save()} is needed for objects newly created through
+ * Calling {#link #save} is needed for objects newly created through
* {@link Connection#newDocument} and similar methods.
*/
void save();
/*
+ * ----- misc -----
+ */
+
+ /**
+ * The parent folder, or the single folder in which the object is filed.
+ * <p>
+ * For a folder, returns the parent folder, or {@code null} if there is no
+ * parent (for the root folder).
+ * <p>
+ * For a non-folder, if the object is single-filed then the folder in which
+ * it is filed is returned, otherwise if the folder is unfiled then {@code
+ * null} is returned. An exception is raised if the object is multi-filed.
+ *
+ * @return the parent folder, or {@code null}.
+ */
+ Folder getParent();
+
+ /*
+ * ----- convenience methods -----
+ */
+
+ String getString(String name);
+
+ String[] getStrings(String name);
+
+ BigDecimal getDecimal(String name);
+
+ BigDecimal[] getDecimals(String name);
+
+ Integer getInteger(String name);
+
+ Integer[] getIntegers(String name);
+
+ Boolean getBoolean(String name);
+
+ Boolean[] getBooleans(String name);
+
+ Calendar getDateTime(String name);
+
+ Calendar[] getDateTimes(String name);
+
+ URI getURI(String name);
+
+ URI[] getURIs(String name);
+
+ String getId(String name);
+
+ String[] getIds(String name);
+
+ String getXML(String name);
+
+ String[] getXMLs(String name);
+
+ String getHTML(String name);
+
+ String[] getHTMLs(String name);
+
+ /*
* ----- convenience methods for specific properties -----
*/
+ String getId();
+
+ URI getURI();
+
+ String getTypeId();
+
+ String getCreatedBy();
+
+ Calendar getCreationDate();
+
+ String getLastModifiedBy();
+
+ Calendar getLastModificationDate();
+
+ String getChangeToken();
+
+ String getName();
+
+ boolean isImmutable();
+
+ boolean isLatestVersion();
+
+ boolean isMajorVersion();
+
+ boolean isLatestMajorVersion();
+
+ String getVersionLabel();
+
+ String getVersionSeriesId();
+
+ boolean isVersionSeriesCheckedOut();
+
+ String getVersionSeriesCheckedOutBy();
+
+ String getVersionSeriesCheckedOutId();
+
+ String getCheckinComment();
+
+ /*
+ * ----- convenience methods for specific properties (setter) -----
+ */
+
void setName(String name);
}
Copied: incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/Choice.java (from r773055, incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/property/Choice.java)
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/Choice.java?p2=incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/Choice.java&p1=incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/property/Choice.java&r1=773055&r2=773069&rev=773069&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/property/Choice.java (original)
+++ incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/Choice.java Fri May 8 19:52:42 2009
@@ -16,7 +16,7 @@
* Authors:
* Florent Guillaume
*/
-package org.apache.chemistry.property;
+package org.apache.chemistry;
import java.io.Serializable;
import java.util.List;
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=773069&r1=773068&r2=773069&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 Fri May 8 19:52:42 2009
@@ -21,8 +21,6 @@
import java.util.Collection;
import java.util.List;
-import org.apache.chemistry.repository.Repository;
-
/**
* A Connection to a CMIS Repository.
* <p>
@@ -30,7 +28,6 @@
* CMIS repository.
*
* @author Florent Guillaume
- * @author Bogdan Stefanescu
*/
public interface Connection {
@@ -59,21 +56,6 @@
*/
Folder getRootFolder();
- /**
- * Gets the direct children of a folder.
- *
- * @return the list of children
- */
- List<ObjectEntry> getChildren(ObjectEntry folder);
-
- /**
- * The root entry. You can use this start traversing the repository and
- * to get the root document.
- *
- * @return the root entry. Never returns null.
- */
- ObjectEntry getRootEntry();
-
/*
* ----- Factories -----
*/
@@ -86,21 +68,24 @@
*
* @param typeId the type ID
* @param folder the parent folder, or {@code null}
+ * @see CMISObject#save
*/
- Document newDocument(String typeId, ObjectEntry folder);
+ Document newDocument(String typeId, Folder folder);
/**
* Creates a new, unsaved folder.
*
* @param typeId the type ID
* @param folder the parent folder
+ * @see CMISObject#save
*/
- Folder newFolder(String typeId, ObjectEntry folder);
+ Folder newFolder(String typeId, Folder folder);
/**
* Creates a new, unsaved relationship.
*
* @param typeId the type ID
+ * @see CMISObject#save
*/
Relationship newRelationship(String typeId);
@@ -112,8 +97,9 @@
*
* @param typeId the type ID
* @param folder the parent folder, or {@code null}
+ * @see CMISObject#save
*/
- Policy newPolicy(String typeId, ObjectEntry folder);
+ Policy newPolicy(String typeId, Folder folder);
/*
* ----- Object Services -----
@@ -122,11 +108,11 @@
/**
* Gets an object given its ID.
*
- * @param objectId the object ID
+ * @param object the object ID
* @param returnVersion the version to be returned
- * @return the object
+ * @return the object, or {@code null} if it is not found
*/
- CMISObject getObject(String objectId, ReturnVersion returnVersion);
+ CMISObject getObject(ObjectId object, ReturnVersion returnVersion);
/**
* Moves the specified filed object from one folder to another.
@@ -139,8 +125,7 @@
* @param targetFolder the target folder
* @param sourceFolder the source folder, or {@code null}
*/
- void moveObject(ObjectEntry object, ObjectEntry targetFolder,
- ObjectEntry sourceFolder);
+ void moveObject(CMISObject object, Folder targetFolder, Folder sourceFolder);
/**
* Deletes the specified object.
@@ -156,7 +141,7 @@
*
* @param object the object
*/
- void deleteObject(ObjectEntry object);
+ void deleteObject(CMISObject object);
/**
* Deletes a tree of objects.
@@ -196,7 +181,7 @@
* should not stop deletion of other objects
* @return the collection of IDs of objects that could not be deleted
*/
- Collection<String> deleteTree(ObjectEntry folder, Unfiling unfiling,
+ Collection<String> deleteTree(Folder folder, Unfiling unfiling,
boolean continueOnFailure);
/**
@@ -205,7 +190,7 @@
* @param object the object
* @param folder the folder
*/
- void addObjectToFolder(ObjectEntry object, ObjectEntry folder);
+ void addObjectToFolder(CMISObject object, Folder folder);
/**
* Removes a non-folder object from a folder or from all folders.
@@ -220,7 +205,7 @@
* @param object the object
* @param folder the folder, or {@code null} for all folders
*/
- void removeObjectFromFolder(ObjectEntry object, ObjectEntry folder);
+ void removeObjectFromFolder(CMISObject object, Folder folder);
/*
* ----- Discovery Services -----
@@ -249,7 +234,7 @@
* @return the matching objects
*/
// TODO returns a result set actually, there may be computed values
- Collection<ObjectEntry> query(String statement, boolean searchAllVersions);
+ Collection<CMISObject> query(String statement, boolean searchAllVersions);
/*
* ----- Versioning Services -----
@@ -278,7 +263,7 @@
* @param document the document
* @return the private working copy
*/
- CMISObject checkOut(ObjectEntry document);
+ Document checkOut(Document document);
/**
* Cancels a check-out.
@@ -289,7 +274,7 @@
*
* @param document the private working copy
*/
- void cancelCheckOut(ObjectEntry document);
+ void cancelCheckOut(Document document);
/**
* Checks in a private working copy.
@@ -301,7 +286,7 @@
* @param comment a check-in comment, or {@code null}
* @return the the new version of the document
*/
- CMISObject checkIn(ObjectEntry document, boolean major, String comment);
+ Document checkIn(Document document, boolean major, String comment);
/**
* Gets the latest version.
@@ -316,7 +301,7 @@
* @param major {@code true} if the last major version is requested
* @return the latest version or latest major version
*/
- CMISObject getLatestVersion(ObjectEntry document, boolean major);
+ Document getLatestVersion(Document document, boolean major);
/**
* Gets all the versions of a document.
@@ -329,7 +314,7 @@
* @param document the document
* @param filter the properties filter, or {@code null} for all properties
*/
- Collection<ObjectEntry> getAllVersions(ObjectEntry document, String filter);
+ Collection<Document> getAllVersions(Document document, String filter);
/**
* Deletes all the versions of a document.
@@ -339,7 +324,7 @@
*
* @param document the document
*/
- void deleteAllVersions(ObjectEntry document);
+ void deleteAllVersions(Document document);
/*
* ----- Relationship Services -----
@@ -363,7 +348,7 @@
* sub-type of typeId are to be returned as well
* @return the list of relationships
*/
- List<ObjectEntry> getRelationships(ObjectEntry object,
+ List<Relationship> getRelationships(CMISObject object,
RelationshipDirection direction, String typeId,
boolean includeSubRelationshipTypes);
@@ -379,7 +364,7 @@
* @param policy the policy
* @param object the target object
*/
- void applyPolicy(Policy policy, ObjectEntry object);
+ void applyPolicy(Policy policy, CMISObject object);
/**
* Removes a policy from an object.
@@ -392,7 +377,7 @@
* @param policy the policy
* @param object the target object
*/
- void removePolicy(Policy policy, ObjectEntry object);
+ void removePolicy(Policy policy, CMISObject object);
/**
* Gets the policies applied to an object.
@@ -405,6 +390,6 @@
*
* @param object the target object
*/
- Collection<Policy> getAppliedPolicies(ObjectEntry object);
+ Collection<Policy> getAppliedPolicies(CMISObject object);
}
Copied: incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/ContentStreamPresence.java (from r773055, incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/type/ContentStreamPresence.java)
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/ContentStreamPresence.java?p2=incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/ContentStreamPresence.java&p1=incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/type/ContentStreamPresence.java&r1=773055&r2=773069&rev=773069&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/type/ContentStreamPresence.java (original)
+++ incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/ContentStreamPresence.java Fri May 8 19:52:42 2009
@@ -16,7 +16,7 @@
* Authors:
* Florent Guillaume
*/
-package org.apache.chemistry.type;
+package org.apache.chemistry;
/**
* The presence status for a content stream.
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=773069&r1=773068&r2=773069&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 Fri May 8 19:52:42 2009
@@ -53,7 +53,7 @@
*
* @return the content stream
*/
- ContentStream getContentStream();
+ ContentStream getContentStream() throws IOException;
/**
* Sets the content stream for this document.
Modified: incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/Folder.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/Folder.java?rev=773069&r1=773068&r2=773069&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/Folder.java (original)
+++ incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/Folder.java Fri May 8 19:52:42 2009
@@ -20,7 +20,6 @@
import java.util.List;
-import org.apache.chemistry.type.BaseType;
/**
* A CMIS Folder.
@@ -36,17 +35,17 @@
* @param orderBy an {@code ORDER BY} clause, or {@code null}
* @return the list of children
*/
- List<ObjectEntry> getChildren(BaseType type, String orderBy);
+ List<CMISObject> getChildren(BaseType type, String orderBy);
// getDescendants and getParents kept on the Connection
/**
- * Creates a new, unsaved document.
+ * Creates a new, unsaved document as a child of this folder.
*/
Document newDocument(String typeId);
/**
- * Creates a new, unsaved folder.
+ * Creates a new, unsaved folder as a child of this folder.
*/
Folder newFolder(String typeId);
Copied: incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/JoinCapability.java (from r773055, incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/repository/JoinCapability.java)
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/JoinCapability.java?p2=incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/JoinCapability.java&p1=incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/repository/JoinCapability.java&r1=773055&r2=773069&rev=773069&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/repository/JoinCapability.java (original)
+++ incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/JoinCapability.java Fri May 8 19:52:42 2009
@@ -16,7 +16,7 @@
* Authors:
* Florent Guillaume
*/
-package org.apache.chemistry.repository;
+package org.apache.chemistry;
/**
* Support for inner and outer join in query.
Modified: incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/ObjectEntry.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/ObjectEntry.java?rev=773069&r1=773068&r2=773069&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/ObjectEntry.java (original)
+++ incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/ObjectEntry.java Fri May 8 19:52:42 2009
@@ -19,177 +19,74 @@
package org.apache.chemistry;
import java.io.Serializable;
-import java.math.BigDecimal;
-import java.net.URI;
-import java.util.Calendar;
import java.util.Collection;
import java.util.Map;
-import org.apache.chemistry.property.Property;
-import org.apache.chemistry.type.Type;
-
/**
- * A CMIS Object entry returned from a search or a listing.
+ * A CMIS object entry, returned from a search or a listing.
* <p>
- * This is a read-only view of a subset of the properties of a CMIS object. The
- * actual subset will be determined by the method called to return this Entry,
- * and by the actual implementation.
+ * This holds a subset of the properties of a CMIS object. The actual subset
+ * will be determined by the method called to return this object entry, and by
+ * the actual implementation.
*
* @author Florent Guillaume
*/
-public interface ObjectEntry {
-
- /**
- * The object's type definition.
- */
- Type getType();
-
- /**
- * Gets a property.
- *
- * @param name the property name
- * @return the property
- */
- Property getProperty(String name);
+public interface ObjectEntry extends ObjectId {
/**
- * Gets all the properties.
+ * Gets the type id for this entry.
*
- * @return a map of the properties
+ * @return the type id
*/
- Map<String, Property> getProperties();
+ String getTypeId();
/**
* Gets a property value.
+ * <p>
+ * Returns {@code null} is the property is not set, not fetched or unknown.
*
* @param name the property name
- * @return the property value
+ * @return the property value, or {@code null}
*/
Serializable getValue(String name);
/**
- * The allowable actions, if requested.
- */
- Collection<String> getAllowableActions();
-
- /**
- * The relationships in relation to this document, if requested.
- */
- Collection<ObjectEntry> getRelationships();
-
- /*
- * ----- link to Document/Folder/etc classes -----
- */
-
- /**
- * Gets the full {@link Document} corresponding to this entry.
+ * Sets a property value.
+ * <p>
+ * Setting a {@code null} value removes the property.
+ *
+ * @param name the property name
+ * @param value the property value, or {@code null}
*/
- Document getDocument();
+ void setValue(String name, Serializable value);
/**
- * Gets the full {@link Folder} corresponding to this entry.
+ * Gets all the property values known to this entry.
+ * <p>
+ * The map of properties is not necessarily complete, as some of them may
+ * not have been fetched.
+ *
+ * @return a map of the properties values
*/
- Folder getFolder();
+ Map<String, Serializable> getValues();
/**
- * Gets the full {@link Relationship} corresponding to this entry.
+ * Sets several property values.
+ * <p>
+ * Setting a {@code null} value removes a property.
+ *
+ * @param values the property values
*/
- Relationship getRelationship();
+ void setValues(Map<String, Serializable> values);
/**
- * Gets the full {@link Policy} corresponding to this entry.
- */
- Policy getPolicy();
-
- /*
- * ----- convenience methods -----
- */
-
- String getString(String name);
-
- String[] getStrings(String name);
-
- BigDecimal getDecimal(String name);
-
- BigDecimal[] getDecimals(String name);
-
- Integer getInteger(String name);
-
- Integer[] getIntegers(String name);
-
- Boolean getBoolean(String name);
-
- Boolean[] getBooleans(String name);
-
- Calendar getDateTime(String name);
-
- Calendar[] getDateTimes(String name);
-
- URI getURI(String name);
-
- URI[] getURIs(String name);
-
- String getId(String name);
-
- String[] getIds(String name);
-
- String getXML(String name);
-
- String[] getXMLs(String name);
-
- String getHTML(String name);
-
- String[] getHTMLs(String name);
-
- /*
- * ----- convenience methods for specific properties -----
+ * The allowable actions, if fetched.
*/
-
- String getId();
-
- URI getURI();
-
- String getTypeId();
-
- String getCreatedBy();
-
- Calendar getCreationDate();
-
- String getLastModifiedBy();
-
- Calendar getLastModificationDate();
-
- String getChangeToken();
-
- String getName();
-
- boolean isImmutable();
-
- boolean isLatestVersion();
-
- boolean isMajorVersion();
-
- boolean isLatestMajorVersion();
-
- String getVersionLabel();
-
- String getVersionSeriesId();
-
- boolean isVersionSeriesCheckedOut();
-
- String getVersionSeriesCheckedOutBy();
-
- String getVersionSeriesCheckedOutId();
-
- String getCheckinComment();
+ Collection<String> getAllowableActions();
/**
- * Checks if the entry has an associated content stream.
- * <p>
- * Note that the content stream may be present but still have length 0.
- *
- * @return {@code true} if the entry has an associated content stream
+ * The relationships in relation to this document, if fetched.
*/
- boolean hasContentStream();
+ Collection<ObjectEntry> getRelationships();
}
Added: incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/ObjectId.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/ObjectId.java?rev=773069&view=auto
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/ObjectId.java (added)
+++ incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/ObjectId.java Fri May 8 19:52:42 2009
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2009 Nuxeo SA <http://nuxeo.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Authors:
+ * Florent Guillaume
+ */
+package org.apache.chemistry;
+
+/**
+ * A reference to a CMIS object using its ID.
+ *
+ * @author Florent Guillaume
+ */
+public interface ObjectId {
+
+ /**
+ * Gets the ID for this object.
+ *
+ * @return the object ID
+ */
+ String getId();
+
+}
Propchange: incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/ObjectId.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/ObjectId.java
------------------------------------------------------------------------------
svn:keywords = Id
Copied: incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/Property.java (from r773055, incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/property/Property.java)
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/Property.java?p2=incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/Property.java&p1=incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/property/Property.java&r1=773055&r2=773069&rev=773069&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/property/Property.java (original)
+++ incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/Property.java Fri May 8 19:52:42 2009
@@ -16,7 +16,7 @@
* Authors:
* Florent Guillaume
*/
-package org.apache.chemistry.property;
+package org.apache.chemistry;
import java.io.Serializable;
@@ -73,8 +73,6 @@
String CHECKIN_COMMENT = "CheckinComment";
- String CONTENT_STREAM_ALLOWED = "ContentStreamAllowed";
-
String CONTENT_STREAM_LENGTH = "ContentStreamLength";
String CONTENT_STREAM_MIME_TYPE = "ContentStreamMimeType";
Copied: incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/PropertyDefinition.java (from r773055, incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/property/PropertyDefinition.java)
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/PropertyDefinition.java?p2=incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/PropertyDefinition.java&p1=incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/property/PropertyDefinition.java&r1=773055&r2=773069&rev=773069&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/property/PropertyDefinition.java (original)
+++ incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/PropertyDefinition.java Fri May 8 19:52:42 2009
@@ -16,7 +16,7 @@
* Authors:
* Florent Guillaume
*/
-package org.apache.chemistry.property;
+package org.apache.chemistry;
import java.io.Serializable;
import java.net.URI;
Copied: incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/PropertyType.java (from r773055, incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/property/PropertyType.java)
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/PropertyType.java?p2=incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/PropertyType.java&p1=incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/property/PropertyType.java&r1=773055&r2=773069&rev=773069&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/property/PropertyType.java (original)
+++ incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/PropertyType.java Fri May 8 19:52:42 2009
@@ -16,70 +16,155 @@
* Authors:
* Florent Guillaume
*/
-package org.apache.chemistry.property;
+package org.apache.chemistry;
+
+import java.util.HashMap;
+import java.util.Map;
/**
* The type of a CMIS property.
*
* @author Florent Guillaume
*/
-public enum PropertyType {
+public class PropertyType {
+
+ public static final int STRING_ORD = 1;
+
+ public static final int DECIMAL_ORD = 2;
+
+ public static final int INTEGER_ORD = 3;
+
+ public static final int BOOLEAN_ORD = 4;
+
+ public static final int DATETIME_ORD = 5;
+
+ public static final int URI_ORD = 6;
+
+ public static final int ID_ORD = 7;
+
+ public static final int XML_ORD = 8;
+
+ public static final int HTML_ORD = 9;
+
+ private static final Map<String, PropertyType> all = new HashMap<String, PropertyType>();
/**
* A string property, represented as a {@link String}.
*/
- STRING("string"),
+ public static final PropertyType STRING = register(new PropertyType(
+ "string", STRING_ORD));
/**
* A decimal property, represented as a {@link java.math.BigDecimal
* BigDecimal}.
*/
- DECIMAL("decimal"),
+ public static final PropertyType DECIMAL = register(new PropertyType(
+ "decimal", DECIMAL_ORD));
/**
* An integer property, represented as a {@link Integer}.
*/
- INTEGER("integer"),
+ public static final PropertyType INTEGER = register(new PropertyType(
+ "integer", INTEGER_ORD));
/**
* A boolean property, represented as a {@link Boolean}.
*/
- BOOLEAN("boolean"),
+ public static final PropertyType BOOLEAN = register(new PropertyType(
+ "boolean", BOOLEAN_ORD));
/**
* A date-time property, represented as a {@link java.util.Calendar
* Calendar}.
*/
- DATETIME("datetime"),
+ public static final PropertyType DATETIME = register(new PropertyType(
+ "datetime", DATETIME_ORD));
/**
* A URI property, represented as a {@link java.net.URI URI}.
*/
- URI("uri"),
+ public static final PropertyType URI = register(new PropertyType("uri",
+ URI_ORD));
/**
* An ID property, represented as a {@link String}.
*/
- ID("id"),
+ public static final PropertyType ID = register(new PropertyType("id",
+ ID_ORD));
/**
* An XML property, represented as a String.
*/
- XML("xml"),
+ public static final PropertyType XML = register(new PropertyType("xml",
+ XML_ORD));
/**
* An HTML property, represented as a String.
*/
- HTML("html");
+ public static final PropertyType HTML = register(new PropertyType("html",
+ HTML_ORD));
+
+ private final String name;
+
+ private final int ordinal;
+
+ /**
+ * Protected constructor. The {@link #register} static method should be used
+ * by implementors to register new property types or subclasses of it.
+ */
+ protected PropertyType(String name, int ordinal) {
+ this.name = name;
+ this.ordinal = ordinal;
+ }
- private final String value;
+ /**
+ * Registers a new property type. To be used only by implementors.
+ */
+ protected static synchronized <T extends PropertyType> T register(
+ T propertyType) {
+ String n = propertyType.name();
+ int o = propertyType.ordinal();
+ for (PropertyType pt : all.values()) {
+ if (n.equals(pt.name())) {
+ throw new IllegalArgumentException("Name " + n
+ + " already registered for " + pt);
+ }
+ if (o == pt.ordinal()) {
+ throw new IllegalArgumentException("Ordinal " + o
+ + " already registered for " + pt);
+ }
+ }
+ all.put(n, propertyType);
+ return propertyType;
+ }
- private PropertyType(String value) {
- this.value = value;
+ /**
+ * Gets the registered property type for a given name.
+ *
+ * @param name the name
+ * @return the property type, or {@code null} if not found
+ */
+ public static synchronized PropertyType get(String name) {
+ return all.get(name);
+ }
+
+ /**
+ * The name associated to this property type.
+ */
+ public String name() {
+ return name;
+ }
+
+ /**
+ * The ordinal associated to this property type. This is a facility to allow
+ * easier switch statements.
+ */
+ public int ordinal() {
+ return ordinal;
}
@Override
public String toString() {
- return value;
+ return this.getClass().getSimpleName() + '(' + name + ')';
}
}
Copied: incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/QueryCapability.java (from r773055, incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/repository/QueryCapability.java)
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/QueryCapability.java?p2=incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/QueryCapability.java&p1=incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/repository/QueryCapability.java&r1=773055&r2=773069&rev=773069&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/repository/QueryCapability.java (original)
+++ incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/QueryCapability.java Fri May 8 19:52:42 2009
@@ -16,7 +16,7 @@
* Authors:
* Florent Guillaume
*/
-package org.apache.chemistry.repository;
+package org.apache.chemistry;
/**
* Support for query on full-text or metadata.
Copied: incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/Repository.java (from r773055, incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/repository/Repository.java)
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/Repository.java?p2=incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/Repository.java&p1=incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/repository/Repository.java&r1=773055&r2=773069&rev=773069&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/repository/Repository.java (original)
+++ incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/Repository.java Fri May 8 19:52:42 2009
@@ -16,37 +16,38 @@
* Authors:
* Florent Guillaume
*/
-package org.apache.chemistry.repository;
+package org.apache.chemistry;
-import java.io.Serializable;
import java.util.Collection;
import java.util.List;
-import java.util.Map;
-
-import org.apache.chemistry.Connection;
-import org.apache.chemistry.property.PropertyDefinition;
-import org.apache.chemistry.type.Type;
/**
* A CMIS Repository.
*
* @author Florent Guillaume
- * @author Bogdan Stefanescu
*/
public interface Repository extends RepositoryEntry {
/**
- * Gets a connection to the repository.
+ * Gets a new connection using the SPI for this repository.
* <p>
- * This connection can be used to use the other services offered by the
- * repository.
+ * The SPI is a connection providing access to lower-level features.
+ *
+ * @return the SPI connection
+ */
+ SPI getSPI();
+
+ /**
+ * Gets an extension service on this repository.
* <p>
- * The connection parameters are repository-dependent; they can be used for
- * instance to authenticate a user.
+ * This is an optional operation and may always return {@code null} if not
+ * supported.
*
- * @param parameters connection parameters, or {@code null}
+ * @param klass the interface for the requested extension
+ * @return the extension instance if any implementation was found, or
+ * {@code null} if not
*/
- Connection getConnection(Map<String, Serializable> parameters);
+ <T> T getExtension(Class<T> klass);
/*
* ----- Repository Services -----
@@ -106,14 +107,4 @@
*/
Type getType(String typeId);
-
- /**
- * Get an extension service on this repository.
- * This is an optional operation and may always return null if not supported.
- * @param <T>
- * @param klass the interface for the requested extension
- * @return the extension instance if any implementation was found
- */
- <T> T getExtension(Class<T> klass);
-
}
Copied: incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/RepositoryCapabilities.java (from r773055, incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/repository/RepositoryCapabilities.java)
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/RepositoryCapabilities.java?p2=incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/RepositoryCapabilities.java&p1=incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/repository/RepositoryCapabilities.java&r1=773055&r2=773069&rev=773069&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/repository/RepositoryCapabilities.java (original)
+++ incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/RepositoryCapabilities.java Fri May 8 19:52:42 2009
@@ -16,7 +16,7 @@
* Authors:
* Florent Guillaume
*/
-package org.apache.chemistry.repository;
+package org.apache.chemistry;
/**
* The capabilities of a CMIS Repository.
Copied: incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/RepositoryEntry.java (from r773055, incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/repository/RepositoryEntry.java)
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/RepositoryEntry.java?p2=incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/RepositoryEntry.java&p1=incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/repository/RepositoryEntry.java&r1=773055&r2=773069&rev=773069&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/repository/RepositoryEntry.java (original)
+++ incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/RepositoryEntry.java Fri May 8 19:52:42 2009
@@ -16,7 +16,7 @@
* Authors:
* Florent Guillaume
*/
-package org.apache.chemistry.repository;
+package org.apache.chemistry;
import java.net.URI;
Copied: incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/RepositoryFactory.java (from r773055, incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/repository/RepositoryFactory.java)
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/RepositoryFactory.java?p2=incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/RepositoryFactory.java&p1=incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/repository/RepositoryFactory.java&r1=773055&r2=773069&rev=773069&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/repository/RepositoryFactory.java (original)
+++ incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/RepositoryFactory.java Fri May 8 19:52:42 2009
@@ -1,4 +1,4 @@
-package org.apache.chemistry.repository;
+package org.apache.chemistry;
import java.util.Map;
Copied: incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/RepositoryInfo.java (from r773055, incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/repository/RepositoryInfo.java)
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/RepositoryInfo.java?p2=incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/RepositoryInfo.java&p1=incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/repository/RepositoryInfo.java&r1=773055&r2=773069&rev=773069&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/repository/RepositoryInfo.java (original)
+++ incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/RepositoryInfo.java Fri May 8 19:52:42 2009
@@ -16,7 +16,7 @@
* Authors:
* Florent Guillaume
*/
-package org.apache.chemistry.repository;
+package org.apache.chemistry;
import java.util.Collection;
@@ -35,7 +35,7 @@
/**
* The ID of the root Folder of the repository.
*/
- String getRootFolderId();
+ ObjectId getRootFolderId();
/**
* The repository vendor name.
Copied: incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/RepositoryService.java (from r773055, incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/repository/RepositoryService.java)
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/RepositoryService.java?p2=incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/RepositoryService.java&p1=incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/repository/RepositoryService.java&r1=773055&r2=773069&rev=773069&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/repository/RepositoryService.java (original)
+++ incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/RepositoryService.java Fri May 8 19:52:42 2009
@@ -16,7 +16,7 @@
* Authors:
* Florent Guillaume
*/
-package org.apache.chemistry.repository;
+package org.apache.chemistry;
import java.util.Collection;
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=773069&r1=773068&r2=773069&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 Fri May 8 19:52:42 2009
@@ -25,8 +25,6 @@
import java.util.List;
import java.util.Map;
-import org.apache.chemistry.type.BaseType;
-
/**
* A SPI connection to a CMIS Repository.
* <p>
@@ -37,11 +35,36 @@
public interface SPI {
/**
- * Gets the high-level connection for this SPI connection.
+ * Gets the repository for this SPI connection.
*
- * @return the connection
+ * @return the repository
+ */
+ Repository getRepository();
+
+ /**
+ * Closes this SPI connection.
*/
- Connection getConnection();
+ void close();
+
+ /*
+ * ----- Factories -----
+ */
+
+ /**
+ * Creates a new reference to a given object.
+ *
+ * @param id the object ID
+ * @return a reference to that object
+ */
+ ObjectId newObjectId(String id);
+
+ /**
+ * Creates a new empty object entry.
+ *
+ * @param typeId the object type ID
+ * @return a new object entry
+ */
+ ObjectEntry newObjectEntry(String typeId);
/*
* ----- Navigation Services -----
@@ -77,7 +100,7 @@
* <p>
* When returning more than one level, the objects are nested.
*
- * @param folderId the folder ID
+ * @param folder the folder
* @param type the base type, or {@code null} for all types
* @param depth the depth, or {@code -1} for all levels
* @param filter the properties filter, or {@code null} for all properties
@@ -87,7 +110,7 @@
* @param orderBy an {@code ORDER BY} clause, or {@code null}
*/
// TODO return type for a tree
- List<ObjectEntry> getDescendants(String folderId, BaseType type, int depth,
+ List<ObjectEntry> getDescendants(ObjectId folder, BaseType type, int depth,
String filter, boolean includeAllowableActions,
boolean includeRelationships, String orderBy);
@@ -121,7 +144,7 @@
* <p>
* The return value hasMoreItems is filled if {@code maxItems > 0}.
*
- * @param folderId the folder ID
+ * @param folder the folder
* @param type the base type, or {@code null} for all types
* @param filter the properties filter, or {@code null} for all properties
* @param includeAllowableActions {@code true} to include allowable actions
@@ -134,7 +157,7 @@
* @param hasMoreItems a 1-value boolean array to return a flag stating if
* there are more items
*/
- List<ObjectEntry> getChildren(String folderId, BaseType type,
+ List<ObjectEntry> getChildren(ObjectId folder, BaseType type,
String filter, boolean includeAllowableActions,
boolean includeRelationships, int maxItems, int skipCount,
String orderBy, boolean[] hasMoreItems);
@@ -154,7 +177,7 @@
* include the parent and the ObjectID property in the filter to allow
* re-ordering if necessary.
*
- * @param folderId the folder ID
+ * @param folder the folder
* @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
@@ -162,7 +185,7 @@
* @param returnToRoot {@code true} if all ancestors must be returned
* @return the parents and optionally relationships
*/
- List<ObjectEntry> getFolderParent(String folderId, String filter,
+ List<ObjectEntry> getFolderParent(ObjectId folder, String filter,
boolean includeAllowableActions, boolean includeRelationships,
boolean returnToRoot);
@@ -173,7 +196,7 @@
* <p>
* To find the parent of a folder, use {@link #getFolderParent}.
*
- * @param objectId the object ID
+ * @param object the object
* @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
@@ -183,7 +206,7 @@
* @param skipCount the skip count
* @return the collection of parent folders
*/
- Collection<ObjectEntry> getObjectParents(String objectId, String filter,
+ Collection<ObjectEntry> getObjectParents(ObjectId object, String filter,
boolean includeAllowableActions, boolean includeRelationships);
/**
@@ -194,12 +217,12 @@
* the repository may also include checked-out objects that the calling user
* has access to, but did not check out.
* <p>
- * If folderId is not {@code null}, then the results include only direct
+ * If folder is not {@code null}, then the results include only direct
* children of that folder.
* <p>
* The return value hasMoreItems is filled if {@code maxItems > 0}.
*
- * @param folderId the folder ID, or {@code null}
+ * @param folder the folder, or {@code null}
* @param filter
* @param includeAllowableActions
* @param includeRelationships {@code true} if relationships should be
@@ -209,7 +232,7 @@
* there are more items
* @param skipCount
*/
- Collection<ObjectEntry> getCheckedoutDocuments(String folderId,
+ Collection<ObjectEntry> getCheckedoutDocuments(ObjectId folder,
String filter, boolean includeAllowableActions,
boolean includeRelationships, int maxItems, int skipCount,
boolean[] hasMoreItems);
@@ -229,19 +252,18 @@
* {@link VersioningState#MINOR MINOR} version, or as a checked-in
* {@link VersioningState#MAJOR MAJOR} version. If created in a
* {@link VersioningState#CHECKED_OUT CHECKED_OUT} state, the object is a
- * private working copy and there is no corresponding
- * "checked out document".
+ * private working copy and there is no corresponding checked out document.
*
* @param typeId the document type ID
* @param properties the properties
- * @param folderId the containing folder ID, or {@code null}
+ * @param folder the containing folder, or {@code null}
* @param contentStream the content stream, or {@code null}
* @param versioningState the versioning state
* @return the ID of the created document
*/
- String createDocument(String typeId, Map<String, Serializable> properties,
- String folderId, ContentStream contentStream,
- VersioningState versioningState);
+ ObjectId createDocument(String typeId,
+ Map<String, Serializable> properties, ObjectId folder,
+ ContentStream contentStream, VersioningState versioningState);
/**
* Creates a folder.
@@ -250,11 +272,11 @@
*
* @param typeId the folder type ID
* @param properties the properties
- * @param folderId the containing folder ID
+ * @param folder the containing folder
* @return the ID of the created folder
*/
- String createFolder(String typeId, Map<String, Serializable> properties,
- String folderId);
+ ObjectId createFolder(String typeId, Map<String, Serializable> properties,
+ ObjectId folder);
/**
* Creates a relationship.
@@ -263,13 +285,13 @@
*
* @param typeId the relationship type ID
* @param properties the properties
- * @param sourceId the source ID
- * @param targetId the target ID
+ * @param source the source
+ * @param target the target
* @return the ID of the created relationship
*/
- String createRelationship(String typeId,
- Map<String, Serializable> properties, String sourceId,
- String targetId);
+ ObjectId createRelationship(String typeId,
+ Map<String, Serializable> properties, ObjectId source,
+ ObjectId target);
/**
* Creates a policy.
@@ -279,11 +301,11 @@
*
* @param typeId the relationship type ID
* @param properties the properties
- * @param folderId the containing folder ID, or {@code null}
+ * @param folder the containing folder, or {@code null}
* @return the ID of the created policy
*/
- String createPolicy(String typeId, Map<String, Serializable> properties,
- String folderId);
+ ObjectId createPolicy(String typeId, Map<String, Serializable> properties,
+ ObjectId folder);
/**
* Gets the allowable actions.
@@ -292,12 +314,12 @@
* user's context, subject to any access constraints that are currently
* imposed by the repository.
*
- * @param objectId the object ID
+ * @param object the object
* @param asUser the user for which the check should be made, or {@code
* null} for the current user
* @return the allowable actions
*/
- Collection<String> getAllowableActions(String objectId, String asUser);
+ Collection<String> getAllowableActions(ObjectId object, String asUser);
/**
* Gets the properties of an object.
@@ -310,29 +332,43 @@
* <p>
* The content stream of the object is not returned, use
* {@link #getContentStream} for that.
+ * <p>
+ * If the passed object is an {@link ObjectEntry}, the repository
+ * implementation may fill it with additional data and return the same
+ * object.
*
- * @param objectId the object ID
+ * @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
* included as well
- * @return the properties of the object
+ * @return the properties of the object, or {@code null} if the object is
+ * not found
*/
- ObjectEntry getProperties(String objectId, ReturnVersion returnVersion,
+ ObjectEntry getProperties(ObjectId object, ReturnVersion returnVersion,
String filter, boolean includeAllowableActions,
boolean includeRelationships);
/**
+ * Checks if the document has an associated content stream.
+ * <p>
+ * Note that the content stream may be present but still have length 0.
+ *
+ * @return {@code true} if the document has an associated content stream
+ */
+ boolean hasContentStream(ObjectId document);
+
+ /**
* Gets the content stream for a document.
*
- * @param documentId the document ID
+ * @param document the document
* @param offset the offset into the content stream
* @param length the length of stream to return, or {@code -1} for all
* @return the specified part of the content stream
* @throws IOException
*/
- InputStream getContentStream(String documentId, int offset, int length)
+ InputStream getContentStream(ObjectId document, int offset, int length)
throws IOException;
/**
@@ -345,16 +381,18 @@
* support updates.
* <p>
* Because repositories may automatically create new document versions on a
- * user's behalf, the document ID returned may not match the one provided as
- * a parameted to this method.
+ * user's behalf, the document returned may have a different ID from the one
+ * provided as a parameter to this method.
*
- * @param documentId the document ID
+ * @param document the document
* @param overwrite {@code true} if an already-existing content stream must
* be overwritten
* @param contentStream the content stream to set
- * @return the document ID, which may differ from the passed one
+ * @return the resulting document, which may differ from the one passed as
+ * input
*/
- void setContentStream(String documentId, boolean overwrite,
+ // TODO return ObjectId or ObjectEntry?
+ ObjectId setContentStream(ObjectId document, boolean overwrite,
ContentStream contentStream);
/**
@@ -369,9 +407,9 @@
* If the document is a private working copy, some repositories may not
* support updates.
*
- * @param documentId the document ID
+ * @param document the document
*/
- void deleteContentStream(String documentId);
+ void deleteContentStream(ObjectId document);
/**
* Updates the properties of an object.
@@ -387,30 +425,32 @@
* token must be included as-is when calling this method.
* <p>
* Because repositories may automatically create new document versions on a
- * user's behalf, the object ID returned may not match the one provided as a
- * parameter to this method.
+ * user's behalf, the object returned may have a different ID from the one
+ * provided as a parameter to this method.
*
- * @param objectId the object ID
+ * @param object the object
* @param changeToken the change token, or {@code null}
* @param properties the properties to change
- * @return the object ID, which may differ from the passed one
+ * @return the resulting object, which may differ from the one passed as
+ * input
*/
- String updateProperties(String objectId, String changeToken,
+ // TODO return ObjectId or ObjectEntry?
+ ObjectId updateProperties(ObjectId object, String changeToken,
Map<String, Serializable> properties);
/**
* Moves the specified filed object from one folder to another.
* <p>
- * The targetFolderId is the ID of the target folder into which the object
- * has to be moved. When the object is multi-filed, a source folder ID to be
- * moved out of must be specified.
- *
- * @param objectId the object ID
- * @param targetFolderId the target folder ID
- * @param sourceFolderId the source folder ID, or {@code null}
+ * The targetFolder is the target folder into which the object has to be
+ * moved. When the object is multi-filed, a source folder to be moved out of
+ * must be specified.
+ *
+ * @param object the object to move
+ * @param targetFolder the target folder
+ * @param sourceFolder the source folder, or {@code null}
*/
- void moveObject(String objectId, String targetFolderId,
- String sourceFolderId);
+ void moveObject(ObjectId object, ObjectId targetFolder,
+ ObjectId sourceFolder);
/**
* Deletes the specified object.
@@ -422,11 +462,11 @@
* all versions, use {@link #deleteAllVersions}.
* <p>
* Deletion of a private working copy (checked out version) is the same as
- * to cancel checkout.
+ * the cancelling of a checkout.
*
- * @param objectId the object ID
+ * @param object the object to delete
*/
- void deleteObject(String objectId);
+ void deleteObject(ObjectId object);
/**
* Deletes a tree of objects.
@@ -459,38 +499,38 @@
* {@code false} that single object ID is returned, otherwise all IDs of
* objects that could not be deleted are returned.
*
- * @param folderId the folder ID
+ * @param folder the folder to delete
* @param unfiling how to unfile non-folder objects, if {@code null} then
* same as {@link Unfiling#DELETE}
* @param continueOnFailure {@code true} if failure to delete one object
* should not stop deletion of other objects
* @return the collection of IDs of objects that could not be deleted
*/
- Collection<String> deleteTree(String folderId, Unfiling unfiling,
+ Collection<String> deleteTree(ObjectId folder, Unfiling unfiling,
boolean continueOnFailure);
/**
* Adds an existing non-folder, fileable object to a folder.
*
- * @param objectId the object ID
- * @param folderId the folder ID
+ * @param object the object
+ * @param folder the folder
*/
- void addObjectToFolder(String objectId, String folderId);
+ void addObjectToFolder(ObjectId object, ObjectId folder);
/**
* Removes a non-folder object from a folder or from all folders.
* <p>
- * If folderId is {@code null}, then the the object is removed from all
+ * If folder is {@code null}, then the the object is removed from all
* folders.
* <p>
* This never deletes the object, which means that if unfiling is not
* supported, and an object is to be removed from the last folder it exists
* in, or is to be removed from all folders, an exception will be thrown.
*
- * @param objectId the object ID
- * @param folderId the folder ID, or {@code null} for all folders
+ * @param object the object
+ * @param folder the folder, or {@code null} for all folders
*/
- void removeObjectFromFolder(String objectId, String folderId);
+ void removeObjectFromFolder(ObjectId object, ObjectId folder);
/*
* ----- Discovery Services -----
@@ -565,11 +605,11 @@
* is copied, {@code false} if not. Whether the content is copied on
* check-out or not is repository-specific.
*
- * @param documentId the document ID
+ * @param document the document
* @param contentCopied a return array of size 1
- * @return ID of the private working copy
+ * @return a reference to the private working copy
*/
- String checkOut(String documentId, boolean[] contentCopied);
+ ObjectId checkOut(ObjectId document, boolean[] contentCopied);
/**
* Cancels a check-out.
@@ -578,24 +618,24 @@
* the checked-out document, allowing other documents in the version series
* to be checked out again.
*
- * @param documentId the private working copy ID
+ * @param document the private working copy
*/
- void cancelCheckOut(String documentId);
+ void cancelCheckOut(ObjectId document);
/**
* Checks in a private working copy.
* <p>
* Makes the private working copy the current version of the document.
*
- * @param documentId the private working copy ID
+ * @param document the private working copy
* @param major {@code true} if the version is a major version
* @param properties the properties to set on the document, or {@code null}
* @param contentStream the content stream to set on the document, or
* {@code null}
* @param comment a check-in comment, or {@code null}
- * @return the ID for the new version of the document
+ * @return a reference to the new version of the document
*/
- String checkIn(String documentId, boolean major,
+ ObjectId checkIn(ObjectId document, boolean major,
Map<String, Serializable> properties, ContentStream contentStream,
String comment);
@@ -653,7 +693,7 @@
* <p>
* Ordering is repository specific but consistent across requests.
*
- * @param objectId the object ID
+ * @param object the object
* @param direction the direction of relationships to include
* @param typeId the type ID, or {@code null}
* @param includeSubRelationshipTypes {@code true} if relationships of any
@@ -667,7 +707,7 @@
* there are more items
* @return the list of relationships
*/
- List<ObjectEntry> getRelationships(String objectId,
+ List<ObjectEntry> getRelationships(ObjectId object,
RelationshipDirection direction, String typeId,
boolean includeSubRelationshipTypes, String filter,
String includeAllowableActions, int maxItems, int skipCount,
@@ -682,10 +722,10 @@
* <p>
* The target object must be controllable.
*
- * @param policyId the policy ID
- * @param objectId the target object ID
+ * @param policy the policy
+ * @param object the target object
*/
- void applyPolicy(String policyId, String objectId);
+ void applyPolicy(ObjectId policy, ObjectId object);
/**
* Removes a policy from an object.
@@ -695,10 +735,10 @@
* <p>
* The target object must be controllable.
*
- * @param policyId the policy ID
- * @param objectId the target object ID
+ * @param policy the policy
+ * @param object the target object
*/
- void removePolicy(String policyId, String objectId);
+ void removePolicy(ObjectId policy, ObjectId object);
/**
* Gets the policies applied to an object.
@@ -709,9 +749,9 @@
* <p>
* The target object must be controllable.
*
- * @param objectId the target object ID
+ * @param object the target object
* @param filter the properties filter, or {@code null} for all properties
*/
- Collection<ObjectEntry> getAppliedPolicies(String objectId, String filter);
+ Collection<ObjectEntry> getAppliedPolicies(ObjectId object, String filter);
}
Copied: incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/Type.java (from r773055, incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/type/Type.java)
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/Type.java?p2=incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/Type.java&p1=incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/type/Type.java&r1=773055&r2=773069&rev=773069&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/type/Type.java (original)
+++ incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/Type.java Fri May 8 19:52:42 2009
@@ -16,11 +16,10 @@
* Authors:
* Florent Guillaume
*/
-package org.apache.chemistry.type;
+package org.apache.chemistry;
import java.util.Collection;
-import org.apache.chemistry.property.PropertyDefinition;
/**
* A CMIS Type Definition.
Copied: incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/Updatability.java (from r773055, incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/property/Updatability.java)
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/Updatability.java?p2=incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/Updatability.java&p1=incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/property/Updatability.java&r1=773055&r2=773069&rev=773069&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/property/Updatability.java (original)
+++ incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/Updatability.java Fri May 8 19:52:42 2009
@@ -16,7 +16,7 @@
* Authors:
* Florent Guillaume
*/
-package org.apache.chemistry.property;
+package org.apache.chemistry;
/**
* The Updatability of a property.
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=773069&r1=773068&r2=773069&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 Fri May 8 19:52:42 2009
@@ -27,7 +27,7 @@
import org.apache.abdera.protocol.server.TargetType;
import org.apache.abdera.protocol.server.context.ResponseContextException;
import org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter;
-import org.apache.chemistry.repository.Repository;
+import org.apache.chemistry.Repository;
/**
* Base abstract class for the CMIS collections.