Author: sklevenz Date: Thu Sep 16 07:43:12 2010 New Revision: 997632 URL: http://svn.apache.org/viewvc?rev=997632&view=rev Log: fix of issue
https://issues.apache.org/jira/browse/CMIS-242 Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/Document.java incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/Folder.java incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/Session.java incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/PersistentDocumentImpl.java incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/PersistentFolderImpl.java incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/PersistentSessionImpl.java incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/AbstractWriteAclT.java incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/AbstractWriteObjectIT.java incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/AbstractWriteObjectRelationIT.java Modified: incubator/chemistry/opencmis/trunk/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/trunk/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/Document.java?rev=997632&r1=997631&r2=997632&view=diff ============================================================================== --- incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/Document.java (original) +++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/Document.java Thu Sep 16 07:43:12 2010 @@ -86,6 +86,14 @@ public interface Document extends Fileab List<Policy> policies, List<Ace> addAces, List<Ace> removeAces); /** + * If this is a PWC (private working copy) it performs a check in. If this + * is not a PWC it an exception will be thrown. + * + * @return new document id + */ + ObjectId checkIn(boolean major, Map<String, ?> properties, ContentStream contentStream, String checkinComment); + + /** * Fetches the latest major or minor version of this document. * * @param major @@ -154,5 +162,9 @@ public interface Document extends Fileab */ Document copy(List<Property<?>> properties, VersioningState versioningState, List<Policy> policies, List<Ace> addACEs, List<Ace> removeACEs); + /** + * Creates a (content) copy of this document. + */ + Document copy(List<Property<?>> properties, VersioningState versioningState); } Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/Folder.java URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/Folder.java?rev=997632&r1=997631&r2=997632&view=diff ============================================================================== --- incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/Folder.java (original) +++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/Folder.java Thu Sep 16 07:43:12 2010 @@ -45,6 +45,15 @@ public interface Folder extends Fileable List<Policy> policies, List<Ace> addAces, List<Ace> removeAces, OperationContext context); /** + * Creates a new document in this folder. + * + * @return the new document object or <code>null</code> if the parameter + * <code>context</code> was set to <code>null</code> + */ + Document createDocument(Map<String, ?> properties, ContentStream contentStream, VersioningState versioningState, + OperationContext context); + + /** * Creates a new document from a source document in this folder. * * @return the new document object or <code>null</code> if the parameter @@ -54,6 +63,15 @@ public interface Folder extends Fileable List<Policy> policies, List<Ace> addAces, List<Ace> removeAces, OperationContext context); /** + * Creates a new document from a source document in this folder. + * + * @return the new document object or <code>null</code> if the parameter + * <code>context</code> was set to <code>null</code> + */ + Document createDocumentFromSource(ObjectId source, Map<String, ?> properties, VersioningState versioningState, + OperationContext context); + + /** * Creates a new subfolder in this folder. * * @return the new folder object or <code>null</code> if the parameter @@ -63,6 +81,14 @@ public interface Folder extends Fileable OperationContext context); /** + * Creates a new subfolder in this folder. + * + * @return the new folder object or <code>null</code> if the parameter + * <code>context</code> was set to <code>null</code> + */ + Folder createFolder(Map<String, ?> properties, OperationContext context); + + /** * Creates a new policy in this folder. * * @return the new policy object or <code>null</code> if the parameter @@ -72,6 +98,14 @@ public interface Folder extends Fileable OperationContext context); /** + * Creates a new policy in this folder. + * + * @return the new policy object or <code>null</code> if the parameter + * <code>context</code> was set to <code>null</code> + */ + Policy createPolicy(Map<String, ?> properties, OperationContext context); + + /** * Deletes this folder and all subfolders. * * @return a list of object ids which failed to be deleted Modified: incubator/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/incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/Session.java?rev=997632&r1=997631&r2=997632&view=diff ============================================================================== --- incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/Session.java (original) +++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/Session.java Thu Sep 16 07:43:12 2010 @@ -280,6 +280,17 @@ public interface Session { VersioningState versioningState, List<Policy> policies, List<Ace> addAces, List<Ace> removeAces); /** + * Creates a new document. + * + * @return the object id of the new document + * + * @see Folder#createDocument(Map, ContentStream, VersioningState, List, + * List, List, OperationContext) + */ + ObjectId createDocument(Map<String, ?> properties, ObjectId folderId, ContentStream contentStream, + VersioningState versioningState); + + /** * Creates a new document from a source document. * * @return the object id of the new document @@ -291,6 +302,17 @@ public interface Session { VersioningState versioningState, List<Policy> policies, List<Ace> addAces, List<Ace> removeAces); /** + * Creates a new document from a source document. + * + * @return the object id of the new document + * + * @see Folder#createDocumentFromSource(ObjectId, Map, VersioningState, + * List, List, List, OperationContext) + */ + ObjectId createDocumentFromSource(ObjectId source, Map<String, ?> properties, ObjectId folderId, + VersioningState versioningState); + + /** * Creates a new folder. * * @return the object id of the new folder @@ -301,6 +323,15 @@ public interface Session { List<Ace> removeAces); /** + * Creates a new folder. + * + * @return the object id of the new folder + * + * @see Folder#createFolder(Map, List, List, List, OperationContext) + */ + ObjectId createFolder(Map<String, ?> properties, ObjectId folderId); + + /** * Creates a new policy. * * @return the object id of the new policy @@ -311,10 +342,26 @@ public interface Session { List<Ace> removeAces); /** + * Creates a new policy. + * + * @return the object id of the new policy + * + * @see Folder#createPolicy(Map, List, List, List, OperationContext) + */ + ObjectId createPolicy(Map<String, ?> properties, ObjectId folderId); + + /** * Creates a new relationship. * * @return the object id of the new relationship */ ObjectId createRelationship(Map<String, ?> properties, List<Policy> policies, List<Ace> addAces, List<Ace> removeAces); + + /** + * Creates a new relationship. + * + * @return the object id of the new relationship + */ + ObjectId createRelationship(Map<String, ?> properties); } Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/PersistentDocumentImpl.java URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/PersistentDocumentImpl.java?rev=997632&r1=997631&r2=997632&view=diff ============================================================================== --- incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/PersistentDocumentImpl.java (original) +++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/PersistentDocumentImpl.java Thu Sep 16 07:43:12 2010 @@ -395,4 +395,12 @@ public class PersistentDocumentImpl exte return getSession().createObjectId(objectIdHolder.getValue()); } + + public ObjectId checkIn(boolean major, Map<String, ?> properties, ContentStream contentStream, String checkinComment) { + return this.checkIn(major, properties, contentStream, checkinComment, null, null, null); + } + + public Document copy(List<Property<?>> properties, VersioningState versioningState) { + return this.copy(properties, versioningState, null, null, null); + } } Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/PersistentFolderImpl.java URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/PersistentFolderImpl.java?rev=997632&r1=997631&r2=997632&view=diff ============================================================================== --- incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/PersistentFolderImpl.java (original) +++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/PersistentFolderImpl.java Thu Sep 16 07:43:12 2010 @@ -442,4 +442,22 @@ public class PersistentFolderImpl extend public List<String> getPaths() { return Collections.singletonList(getPath()); } + + public Document createDocument(Map<String, ?> properties, ContentStream contentStream, + VersioningState versioningState, OperationContext context) { + return this.createDocument(properties, contentStream, versioningState, null, null, null, context); + } + + public Document createDocumentFromSource(ObjectId source, Map<String, ?> properties, + VersioningState versioningState, OperationContext context) { + return this.createDocumentFromSource(source, properties, versioningState, null, null, null, context); + } + + public Folder createFolder(Map<String, ?> properties, OperationContext context) { + return this.createFolder(properties, null, null, null, context); + } + + public Policy createPolicy(Map<String, ?> properties, OperationContext context) { + return this.createPolicy(properties, null, null, null, context); + } } Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/PersistentSessionImpl.java URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/PersistentSessionImpl.java?rev=997632&r1=997631&r2=997632&view=diff ============================================================================== --- incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/PersistentSessionImpl.java (original) +++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/PersistentSessionImpl.java Thu Sep 16 07:43:12 2010 @@ -664,4 +664,26 @@ public class PersistentSessionImpl imple return createObjectId(newId); } + public ObjectId createDocument(Map<String, ?> properties, ObjectId folderId, ContentStream contentStream, + VersioningState versioningState) { + return this.createDocument(properties, folderId, contentStream, versioningState, null, null, null); + } + + public ObjectId createDocumentFromSource(ObjectId source, Map<String, ?> properties, ObjectId folderId, + VersioningState versioningState) { + return this.createDocumentFromSource(source, properties, folderId, versioningState, null, null, null); + } + + public ObjectId createFolder(Map<String, ?> properties, ObjectId folderId) { + return this.createFolder(properties, folderId, null, null, null); + } + + public ObjectId createPolicy(Map<String, ?> properties, ObjectId folderId) { + return this.createPolicy(properties, folderId, null, null, null); + } + + public ObjectId createRelationship(Map<String, ?> properties) { + return this.createRelationship(properties, null, null, null); + } + } Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/AbstractWriteAclT.java URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/AbstractWriteAclT.java?rev=997632&r1=997631&r2=997632&view=diff ============================================================================== --- incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/AbstractWriteAclT.java (original) +++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/AbstractWriteAclT.java Thu Sep 16 07:43:12 2010 @@ -66,7 +66,7 @@ public abstract class AbstractWriteAclT aces.add(this.session.getObjectFactory().createAce("everyone", permissions)); // create document - ObjectId id = this.session.createDocument(properties, parentId, null, VersioningState.NONE, null, null, null); + ObjectId id = this.session.createDocument(properties, parentId, null, VersioningState.NONE); assertNotNull(id); // get document for id Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/AbstractWriteObjectIT.java URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/AbstractWriteObjectIT.java?rev=997632&r1=997631&r2=997632&view=diff ============================================================================== --- incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/AbstractWriteObjectIT.java (original) +++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/AbstractWriteObjectIT.java Thu Sep 16 07:43:12 2010 @@ -51,7 +51,7 @@ public abstract class AbstractWriteObjec properties.put(PropertyIds.NAME, folderName); properties.put(PropertyIds.OBJECT_TYPE_ID, typeId); - ObjectId id = this.session.createFolder(properties, parentId, null, null, null); + ObjectId id = this.session.createFolder(properties, parentId); assertNotNull(id); } @@ -75,8 +75,7 @@ public abstract class AbstractWriteObjec mimetype, in1); assertNotNull(contentStream); - ObjectId id = this.session.createDocument(properties, parentId, contentStream, VersioningState.NONE, null, - null, null); + ObjectId id = this.session.createDocument(properties, parentId, contentStream, VersioningState.NONE); assertNotNull(id); // verify content @@ -105,7 +104,7 @@ public abstract class AbstractWriteObjec properties.put(PropertyIds.NAME, name); ObjectId dstDocumentId = this.session.createDocumentFromSource(srcDocument, properties, parentFolder, - VersioningState.NONE, null, null, null); + VersioningState.NONE); assertNotNull(dstDocumentId); Document dstDocument = (Document) this.session.getObject(dstDocumentId); String dstContent = this.getContentAsString(dstDocument.getContentStream()); @@ -239,7 +238,7 @@ public abstract class AbstractWriteObjec mimetype, in1); assertNotNull(contentStream); - ObjectId id = this.session.createDocument(properties, parentId, null, VersioningState.NONE, null, null, null); + ObjectId id = this.session.createDocument(properties, parentId, null, VersioningState.NONE); assertNotNull(id); // set and verify content @@ -275,7 +274,7 @@ public abstract class AbstractWriteObjec mimetype, in1); assertNotNull(contentStream); - ObjectId id = this.session.createDocument(properties, parentId, null, VersioningState.NONE, null, null, null); + ObjectId id = this.session.createDocument(properties, parentId, null, VersioningState.NONE); assertNotNull(id); // set and verify content @@ -310,8 +309,7 @@ public abstract class AbstractWriteObjec mimetype, in1); assertNotNull(contentStream1); - ObjectId id = this.session.createDocument(properties, parentId, contentStream1, VersioningState.NONE, null, - null, null); + ObjectId id = this.session.createDocument(properties, parentId, contentStream1, VersioningState.NONE); assertNotNull(id); // set and verify content @@ -356,8 +354,7 @@ public abstract class AbstractWriteObjec mimetype, in1); assertNotNull(contentStream1); - ObjectId id = this.session.createDocument(properties, parentId, contentStream1, VersioningState.NONE, null, - null, null); + ObjectId id = this.session.createDocument(properties, parentId, contentStream1, VersioningState.NONE); assertNotNull(id); // set and verify content Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/AbstractWriteObjectRelationIT.java URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/AbstractWriteObjectRelationIT.java?rev=997632&r1=997631&r2=997632&view=diff ============================================================================== --- incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/AbstractWriteObjectRelationIT.java (original) +++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/AbstractWriteObjectRelationIT.java Thu Sep 16 07:43:12 2010 @@ -53,7 +53,7 @@ public abstract class AbstractWriteObjec properties.put(PropertyIds.SOURCE_ID, document1.getId()); properties.put(PropertyIds.TARGET_ID, document2.getId()); - ObjectId id = this.session.createRelationship(properties, null, null, null); + ObjectId id = this.session.createRelationship(properties); ObjectType ot = document1.getType(); ItemIterable<Relationship> relations = document1.getRelationships(true, RelationshipDirection.EITHER, ot,
