chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From f...@apache.org
Subject svn commit: r1034438 - in /incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client: chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/ chemistry-opencmis-client-impl/src/main/java/org/ap...
Date Fri, 12 Nov 2010 16:00:37 GMT
Author: fmui
Date: Fri Nov 12 16:00:37 2010
New Revision: 1034438

URL: http://svn.apache.org/viewvc?rev=1034438&view=rev
Log:
more refactoring

Modified:
    incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/CmisObject.java
    incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/Document.java
    incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/TransientCmisObject.java
    incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/TransientFolder.java
    incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/TransientPolicy.java
    incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/TransientRelationship.java
    incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/AbstractTransientCmisObject.java
    incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/TransientFolderImpl.java
    incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/TransientPolicyImpl.java
    incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/TransientRelationshipImpl.java

Modified: incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/CmisObject.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/CmisObject.java?rev=1034438&r1=1034437&r2=1034438&view=diff
==============================================================================
--- incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/CmisObject.java
(original)
+++ incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/CmisObject.java
Fri Nov 12 16:00:37 2010
@@ -168,7 +168,9 @@ public interface CmisObject extends Obje
      * 
      * @return the object id of the updated object (a repository might have
      *         created a new object)
+     *         
      */
+    // TODO: change name
     ObjectId updatePropertiesOnly(Map<String, ?> properties);
 
     // renditions

Modified: incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/Document.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/Document.java?rev=1034438&r1=1034437&r2=1034438&view=diff
==============================================================================
--- incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/Document.java
(original)
+++ incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/Document.java
Fri Nov 12 16:00:37 2010
@@ -62,6 +62,7 @@ public interface Document extends Fileab
     /**
      * Sets a new content stream for the document.
      */
+    // TODO: change name
     ObjectId setContentStreamOnly(ContentStream contentStream, boolean overwrite);
 
     /**
@@ -72,6 +73,7 @@ public interface Document extends Fileab
     /**
      * Removes the current content stream from the document.
      */
+    // TODO: change name
     ObjectId deleteContentStreamOnly();
 
     // versioning service

Modified: incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/TransientCmisObject.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/TransientCmisObject.java?rev=1034438&r1=1034437&r2=1034438&view=diff
==============================================================================
--- incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/TransientCmisObject.java
(original)
+++ incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/TransientCmisObject.java
Fri Nov 12 16:00:37 2010
@@ -112,5 +112,5 @@ public interface TransientCmisObject ext
 
     // shared object
 
-    CmisObject getSharedObject();
+    CmisObject getCmisObject();
 }

Modified: incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/TransientFolder.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/TransientFolder.java?rev=1034438&r1=1034437&r2=1034438&view=diff
==============================================================================
--- incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/TransientFolder.java
(original)
+++ incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/TransientFolder.java
Fri Nov 12 16:00:37 2010
@@ -18,6 +18,61 @@
  */
 package org.apache.chemistry.opencmis.client.api;
 
+import java.util.List;
+import java.util.Map;
+
+import org.apache.chemistry.opencmis.commons.data.Ace;
+import org.apache.chemistry.opencmis.commons.data.ContentStream;
+import org.apache.chemistry.opencmis.commons.enums.UnfileObject;
+import org.apache.chemistry.opencmis.commons.enums.VersioningState;
+
 public interface TransientFolder extends TransientCmisObject {
 
+    Document createDocument(Map<String, ?> properties, ContentStream contentStream,
VersioningState versioningState,
+            List<Policy> policies, List<Ace> addAces, List<Ace> removeAces,
OperationContext context);
+
+    Document createDocument(Map<String, ?> properties, ContentStream contentStream,
VersioningState versioningState);
+
+    Document createDocumentFromSource(ObjectId source, Map<String, ?> properties, VersioningState
versioningState,
+            List<Policy> policies, List<Ace> addAces, List<Ace> removeAces,
OperationContext context);
+
+    Document createDocumentFromSource(ObjectId source, Map<String, ?> properties, VersioningState
versioningState);
+
+    Folder createFolder(Map<String, ?> properties, List<Policy> policies, List<Ace>
addAces, List<Ace> removeAces,
+            OperationContext context);
+
+    Folder createFolder(Map<String, ?> properties);
+
+    Policy createPolicy(Map<String, ?> properties, List<Policy> policies, List<Ace>
addAces, List<Ace> removeAces,
+            OperationContext context);
+
+    Policy createPolicy(Map<String, ?> properties);
+
+    void deleteTree(boolean allversions, UnfileObject unfile, boolean continueOnFailure);
+
+    List<Tree<FileableCmisObject>> getFolderTree(int depth);
+
+    List<Tree<FileableCmisObject>> getFolderTree(int depth, OperationContext
context);
+
+    List<Tree<FileableCmisObject>> getDescendants(int depth);
+
+    List<Tree<FileableCmisObject>> getDescendants(int depth, OperationContext
context);
+
+    ItemIterable<CmisObject> getChildren();
+
+    ItemIterable<CmisObject> getChildren(OperationContext context);
+
+    boolean isRootFolder();
+
+    Folder getFolderParent();
+
+    String getPath();
+
+    ItemIterable<Document> getCheckedOutDocs();
+
+    ItemIterable<Document> getCheckedOutDocs(OperationContext context);
+
+    List<ObjectType> getAllowedChildObjectTypes(); // cmis:allowedChildObjectTypeIds
+
+    void setAllowedChildObjectTypes(List<ObjectType> types);
 }

Modified: incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/TransientPolicy.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/TransientPolicy.java?rev=1034438&r1=1034437&r2=1034438&view=diff
==============================================================================
--- incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/TransientPolicy.java
(original)
+++ incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/TransientPolicy.java
Fri Nov 12 16:00:37 2010
@@ -20,4 +20,7 @@ package org.apache.chemistry.opencmis.cl
 
 public interface TransientPolicy extends TransientCmisObject {
 
+    String getPolicyText();
+
+    void setPolicyText(String policyText);
 }

Modified: incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/TransientRelationship.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/TransientRelationship.java?rev=1034438&r1=1034437&r2=1034438&view=diff
==============================================================================
--- incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/TransientRelationship.java
(original)
+++ incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/TransientRelationship.java
Fri Nov 12 16:00:37 2010
@@ -20,4 +20,19 @@ package org.apache.chemistry.opencmis.cl
 
 public interface TransientRelationship extends TransientCmisObject {
 
+    CmisObject getSource();
+
+    CmisObject getSource(OperationContext context);
+
+    ObjectId getSourceId(); // cmis:sourceId
+
+    void setSourceId(ObjectId id);
+
+    CmisObject getTarget();
+
+    CmisObject getTarget(OperationContext context);
+
+    ObjectId getTargetId(); // cmis:targetId
+
+    void setTargetId(ObjectId id);
 }

Modified: incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/AbstractTransientCmisObject.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/AbstractTransientCmisObject.java?rev=1034438&r1=1034437&r2=1034438&view=diff
==============================================================================
--- incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/AbstractTransientCmisObject.java
(original)
+++ incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/AbstractTransientCmisObject.java
Fri Nov 12 16:00:37 2010
@@ -56,8 +56,6 @@ import org.apache.chemistry.opencmis.com
 import org.apache.chemistry.opencmis.commons.spi.CmisBinding;
 import org.apache.chemistry.opencmis.commons.spi.Holder;
 
-import com.sun.xml.internal.txw2.IllegalAnnotationException;
-
 public abstract class AbstractTransientCmisObject implements TransientCmisObject {
 
     private Session session;
@@ -76,9 +74,9 @@ public abstract class AbstractTransientC
     private Map<ExtensionLevel, List<CmisExtensionElement>> inputExtensions;
     private Map<ExtensionLevel, List<CmisExtensionElement>> ouputExtensions;
 
-    private boolean isModified;
-    private boolean isPropertyUpdateRequired;
-    private boolean isMarkedForDelete;
+    protected boolean isModified;
+    protected boolean isPropertyUpdateRequired;
+    protected boolean isMarkedForDelete;
     private boolean deleteAllVersions;
 
     @SuppressWarnings({ "rawtypes", "unchecked" })
@@ -137,7 +135,7 @@ public abstract class AbstractTransientC
         isMarkedForDelete = false;
     }
 
-    public CmisObject getSharedObject() {
+    public CmisObject getCmisObject() {
         return object;
     }
 
@@ -375,7 +373,7 @@ public abstract class AbstractTransientC
     }
 
     public ObjectId save() {
-        if (!isModified) {
+        if (!isModified()) {
             // nothing has change, so there is nothing to do
             return getObjectId();
         }
@@ -576,11 +574,11 @@ public abstract class AbstractTransientC
 
         public AceChangeHolder(String principalId, List<String> permissions, AclPropagation
aclPropagation) {
             if ((principalId == null) || (principalId.length() == 0)) {
-                throw new IllegalAnnotationException("Principal id must be set!");
+                throw new IllegalArgumentException("Principal id must be set!");
             }
 
             if ((permissions == null) || (permissions.size() == 0)) {
-                throw new IllegalAnnotationException("Permissions id must be set!");
+                throw new IllegalArgumentException("Permissions id must be set!");
             }
 
             this.principalId = principalId;

Modified: incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/TransientFolderImpl.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/TransientFolderImpl.java?rev=1034438&r1=1034437&r2=1034438&view=diff
==============================================================================
--- incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/TransientFolderImpl.java
(original)
+++ incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/TransientFolderImpl.java
Fri Nov 12 16:00:37 2010
@@ -18,8 +18,188 @@
  */
 package org.apache.chemistry.opencmis.client.runtime;
 
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.chemistry.opencmis.client.api.CmisObject;
+import org.apache.chemistry.opencmis.client.api.Document;
+import org.apache.chemistry.opencmis.client.api.FileableCmisObject;
+import org.apache.chemistry.opencmis.client.api.Folder;
+import org.apache.chemistry.opencmis.client.api.ItemIterable;
+import org.apache.chemistry.opencmis.client.api.ObjectId;
+import org.apache.chemistry.opencmis.client.api.ObjectType;
+import org.apache.chemistry.opencmis.client.api.OperationContext;
+import org.apache.chemistry.opencmis.client.api.Policy;
+import org.apache.chemistry.opencmis.client.api.Session;
 import org.apache.chemistry.opencmis.client.api.TransientFolder;
+import org.apache.chemistry.opencmis.client.api.Tree;
+import org.apache.chemistry.opencmis.commons.PropertyIds;
+import org.apache.chemistry.opencmis.commons.data.Ace;
+import org.apache.chemistry.opencmis.commons.data.ContentStream;
+import org.apache.chemistry.opencmis.commons.data.FailedToDeleteData;
+import org.apache.chemistry.opencmis.commons.enums.UnfileObject;
+import org.apache.chemistry.opencmis.commons.enums.VersioningState;
+import org.apache.chemistry.opencmis.commons.exceptions.CmisConstraintException;
 
 public class TransientFolderImpl extends AbstractTransientCmisObject implements TransientFolder
{
 
+    private boolean isMarkedForDeleteTree;
+    private boolean deleteTreeAllVersions;
+    private UnfileObject deleteTreeUnfile;
+    private boolean deleteTreeContinueOnFailure;
+
+    @Override
+    protected void initialize(Session session, CmisObject object) {
+        super.initialize(session, object);
+
+        isMarkedForDeleteTree = false;
+    }
+
+    public Document createDocument(Map<String, ?> properties, ContentStream contentStream,
+            VersioningState versioningState, List<Policy> policies, List<Ace>
addAces, List<Ace> removeAces,
+            OperationContext context) {
+        return ((Folder) getCmisObject()).createDocument(properties, contentStream, versioningState,
policies, addAces,
+                removeAces, context);
+    }
+
+    public Document createDocument(Map<String, ?> properties, ContentStream contentStream,
+            VersioningState versioningState) {
+        return ((Folder) getCmisObject()).createDocument(properties, contentStream, versioningState);
+    }
+
+    public Document createDocumentFromSource(ObjectId source, Map<String, ?> properties,
+            VersioningState versioningState, List<Policy> policies, List<Ace>
addAces, List<Ace> removeAces,
+            OperationContext context) {
+        return ((Folder) getCmisObject()).createDocumentFromSource(source, properties, versioningState,
policies,
+                addAces, removeAces, context);
+    }
+
+    public Document createDocumentFromSource(ObjectId source, Map<String, ?> properties,
VersioningState versioningState) {
+        return ((Folder) getCmisObject()).createDocumentFromSource(source, properties, versioningState);
+    }
+
+    public Folder createFolder(Map<String, ?> properties, List<Policy> policies,
List<Ace> addAces,
+            List<Ace> removeAces, OperationContext context) {
+        return ((Folder) getCmisObject()).createFolder(properties, policies, addAces, removeAces,
context);
+    }
+
+    public Folder createFolder(Map<String, ?> properties) {
+        return ((Folder) getCmisObject()).createFolder(properties);
+    }
+
+    public Policy createPolicy(Map<String, ?> properties, List<Policy> policies,
List<Ace> addAces,
+            List<Ace> removeAces, OperationContext context) {
+        return ((Folder) getCmisObject()).createPolicy(properties, policies, addAces, removeAces,
context);
+    }
+
+    public Policy createPolicy(Map<String, ?> properties) {
+        return ((Folder) getCmisObject()).createPolicy(properties);
+    }
+
+    public void deleteTree(boolean allversions, UnfileObject unfile, boolean continueOnFailure)
{
+        deleteTreeAllVersions = allversions;
+        deleteTreeUnfile = unfile;
+        deleteTreeContinueOnFailure = continueOnFailure;
+
+        isMarkedForDeleteTree = true;
+        isMarkedForDelete = true;
+        isModified = true;
+    }
+
+    public List<Tree<FileableCmisObject>> getFolderTree(int depth) {
+        return ((Folder) getCmisObject()).getFolderTree(depth);
+    }
+
+    public List<Tree<FileableCmisObject>> getFolderTree(int depth, OperationContext
context) {
+        return ((Folder) getCmisObject()).getFolderTree(depth, context);
+    }
+
+    public List<Tree<FileableCmisObject>> getDescendants(int depth) {
+        return ((Folder) getCmisObject()).getDescendants(depth);
+    }
+
+    public List<Tree<FileableCmisObject>> getDescendants(int depth, OperationContext
context) {
+        return ((Folder) getCmisObject()).getDescendants(depth, context);
+    }
+
+    public ItemIterable<CmisObject> getChildren() {
+        return ((Folder) getCmisObject()).getChildren();
+    }
+
+    public ItemIterable<CmisObject> getChildren(OperationContext context) {
+        return ((Folder) getCmisObject()).getChildren(context);
+    }
+
+    public boolean isRootFolder() {
+        return ((Folder) getCmisObject()).isRootFolder();
+    }
+
+    public Folder getFolderParent() {
+        return ((Folder) getCmisObject()).getFolderParent();
+    }
+
+    public String getPath() {
+        return ((Folder) getCmisObject()).getPath();
+    }
+
+    public ItemIterable<Document> getCheckedOutDocs() {
+        return ((Folder) getCmisObject()).getCheckedOutDocs();
+    }
+
+    public ItemIterable<Document> getCheckedOutDocs(OperationContext context) {
+        return ((Folder) getCmisObject()).getCheckedOutDocs();
+    }
+
+    public List<ObjectType> getAllowedChildObjectTypes() {
+        List<ObjectType> result = new ArrayList<ObjectType>();
+
+        List<String> otids = getPropertyValue(PropertyIds.ALLOWED_CHILD_OBJECT_TYPE_IDS);
+        if (otids == null) {
+            return result;
+        }
+
+        for (String otid : otids) {
+            result.add(getSession().getTypeDefinition(otid));
+        }
+
+        return result;
+    }
+
+    public void setAllowedChildObjectTypes(List<ObjectType> types) {
+        List<String> typeIds = new ArrayList<String>();
+
+        if ((types != null) && (!types.isEmpty())) {
+            for (ObjectType type : types) {
+                if (type != null) {
+                    typeIds.add(type.getId());
+                }
+            }
+        }
+
+        setPropertyValue(PropertyIds.ALLOWED_CHILD_OBJECT_TYPE_IDS, typeIds);
+    }
+
+    // override save()
+
+    @Override
+    public ObjectId save() {
+        if (!isModified()) {
+            // nothing has change, so there is nothing to do
+            return getObjectId();
+        }
+
+        if (isMarkedForDeleteTree) {
+            FailedToDeleteData ftd = getBinding().getObjectService().deleteTree(getRepositoryId(),
getId(),
+                    deleteTreeAllVersions, deleteTreeUnfile, deleteTreeContinueOnFailure,
null);
+
+            if ((ftd != null) && (!ftd.getIds().isEmpty())) {
+                throw new CmisConstraintException("deleteTree could not delete all folder
children!");
+            }
+
+            return null;
+        }
+
+        return super.save();
+    }
 }

Modified: incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/TransientPolicyImpl.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/TransientPolicyImpl.java?rev=1034438&r1=1034437&r2=1034438&view=diff
==============================================================================
--- incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/TransientPolicyImpl.java
(original)
+++ incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/TransientPolicyImpl.java
Fri Nov 12 16:00:37 2010
@@ -19,7 +19,15 @@
 package org.apache.chemistry.opencmis.client.runtime;
 
 import org.apache.chemistry.opencmis.client.api.TransientPolicy;
+import org.apache.chemistry.opencmis.commons.PropertyIds;
 
 public class TransientPolicyImpl extends AbstractTransientCmisObject implements TransientPolicy
{
 
+    public String getPolicyText() {
+        return getPropertyValue(PropertyIds.POLICY_TEXT);
+    }
+
+    public void setPolicyText(String policyText) {
+        setPropertyValue(PropertyIds.POLICY_TEXT, policyText);
+    }
 }

Modified: incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/TransientRelationshipImpl.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/TransientRelationshipImpl.java?rev=1034438&r1=1034437&r2=1034438&view=diff
==============================================================================
--- incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/TransientRelationshipImpl.java
(original)
+++ incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/TransientRelationshipImpl.java
Fri Nov 12 16:00:37 2010
@@ -18,8 +18,61 @@
  */
 package org.apache.chemistry.opencmis.client.runtime;
 
+import org.apache.chemistry.opencmis.client.api.CmisObject;
+import org.apache.chemistry.opencmis.client.api.ObjectId;
+import org.apache.chemistry.opencmis.client.api.OperationContext;
 import org.apache.chemistry.opencmis.client.api.TransientRelationship;
+import org.apache.chemistry.opencmis.commons.PropertyIds;
 
 public class TransientRelationshipImpl extends AbstractTransientCmisObject implements TransientRelationship
{
 
+    public CmisObject getSource() {
+        return getSource(getSession().getDefaultContext());
+    }
+
+    public CmisObject getSource(OperationContext context) {
+        return getSession().getObject(getSourceId(), context);
+    }
+
+    public ObjectId getSourceId() {
+        String sourceId = getPropertyValue(PropertyIds.SOURCE_ID);
+        if ((sourceId == null) || (sourceId.length() == 0)) {
+            return null;
+        }
+
+        return getSession().createObjectId(sourceId);
+    }
+
+    public void setSourceId(ObjectId id) {
+        if ((id == null) || (id.getId() == null) || (id.getId().length() == 0)) {
+            throw new IllegalArgumentException("Id is invalid!");
+        }
+
+        setPropertyValue(PropertyIds.SOURCE_ID, id.getId());
+    }
+
+    public CmisObject getTarget() {
+        return getTarget(getSession().getDefaultContext());
+    }
+
+    public CmisObject getTarget(OperationContext context) {
+        return getSession().getObject(getTargetId(), context);
+    }
+
+    public ObjectId getTargetId() {
+        String targetId = getPropertyValue(PropertyIds.TARGET_ID);
+        if ((targetId == null) || (targetId.length() == 0)) {
+            return null;
+        }
+
+        return getSession().createObjectId(targetId);
+    }
+
+    public void setTargetId(ObjectId id) {
+        if ((id == null) || (id.getId() == null) || (id.getId().length() == 0)) {
+            throw new IllegalArgumentException("Id is invalid!");
+        }
+
+        setPropertyValue(PropertyIds.TARGET_ID, id.getId());
+    }
 }



Mime
View raw message