You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@chemistry.apache.org by fm...@apache.org on 2011/03/07 16:20:25 UTC
svn commit: r1078807 - in
/chemistry/opencmis/trunk/chemistry-opencmis-client:
chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/
chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/
Author: fmui
Date: Mon Mar 7 15:20:25 2011
New Revision: 1078807
URL: http://svn.apache.org/viewvc?rev=1078807&view=rev
Log:
CMIS-327: two more getObject() methods
Modified:
chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/Session.java
chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/SessionImpl.java
Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/Session.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/Session.java?rev=1078807&r1=1078806&r2=1078807&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/Session.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/Session.java Mon Mar 7 15:20:25 2011
@@ -179,6 +179,8 @@ public interface Session {
*
* @param objectId
* the object id
+ *
+ * @see #getObject(String)
*/
CmisObject getObject(ObjectId objectId);
@@ -191,6 +193,8 @@ public interface Session {
* the object id
* @param context
* the {@link OperationContext} to use
+ *
+ * @see #getObject(String, OperationContext)
*/
CmisObject getObject(ObjectId objectId, OperationContext context);
@@ -199,6 +203,32 @@ public interface Session {
* cache or the cache is turned off per default {@link OperationContext}, it
* will load the object from the repository and puts it into the cache.
*
+ * @param objectId
+ * the object id
+ *
+ * @see #getObject(ObjectId)
+ */
+ CmisObject getObject(String objectId);
+
+ /**
+ * Returns a CMIS object from the session cache. If the object is not in the
+ * cache or the given {@link OperationContext} has caching turned off, it
+ * will load the object from the repository and puts it into the cache.
+ *
+ * @param objectId
+ * the object id
+ * @param context
+ * the {@link OperationContext} to use
+ *
+ * @see #getObject(ObjectId, OperationContext)
+ */
+ CmisObject getObject(String objectId, OperationContext context);
+
+ /**
+ * Returns a CMIS object from the session cache. If the object is not in the
+ * cache or the cache is turned off per default {@link OperationContext}, it
+ * will load the object from the repository and puts it into the cache.
+ *
* @param path
* the object path
*/
Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/SessionImpl.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/SessionImpl.java?rev=1078807&r1=1078806&r2=1078807&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/SessionImpl.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/SessionImpl.java Mon Mar 7 15:20:25 2011
@@ -353,6 +353,18 @@ public class SessionImpl implements Sess
if ((objectId == null) || (objectId.getId() == null)) {
throw new IllegalArgumentException("Object Id must be set!");
}
+
+ return getObject(objectId.getId(), context);
+ }
+
+ public CmisObject getObject(String objectId) {
+ return getObject(objectId, getDefaultContext());
+ }
+
+ public CmisObject getObject(String objectId, OperationContext context) {
+ if (objectId == null) {
+ throw new IllegalArgumentException("Object Id must be set!");
+ }
if (context == null) {
throw new IllegalArgumentException("Operation context must be set!");
}
@@ -361,14 +373,14 @@ public class SessionImpl implements Sess
// ask the cache first
if (context.isCacheEnabled()) {
- result = this.cache.getById(objectId.getId(), context.getCacheKey());
+ result = this.cache.getById(objectId, context.getCacheKey());
if (result != null) {
return result;
}
}
// get the object
- ObjectData objectData = this.binding.getObjectService().getObject(getRepositoryId(), objectId.getId(),
+ ObjectData objectData = this.binding.getObjectService().getObject(getRepositoryId(), objectId,
context.getFilterString(), context.isIncludeAllowableActions(), context.getIncludeRelationships(),
context.getRenditionFilterString(), context.isIncludePolicies(), context.isIncludeAcls(), null);