You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@chemistry.apache.org by Владимир Лукьянович <vl...@mainsoft.by> on 2011/08/02 11:50:28 UTC

Problem with moving an object

Hi,

When I try to move object by means of a method move, in a directory 
targetFolderId the copy of my object is located, and in a directory 
sourceFolderId the object remains.
If I carry out changes from one of copies of the given object the same 
changes occur and to the second copy of this object.
But I expected that at method performance move there will be a moving of 
object to all versions from a directory sourceFolderId in a directory 
targetFolderId, and the original object with all versions sourceFolderId 
will be removed from a directory.

Why it occurs, and as I can realize moving of object with all its 
versions in other directory? I can something not so I do?

Listing:

FileableCmisObject fileableCmisObject = sourceDocumentId.move(
                         sourceDocumentId.getParents().get(0), 
targetFolderId);

when: sourceDocumentId - object of type Document (moved object)
             targetFolderId - object of type Folder (target folder)

Thanks

-- 
Best regards, Vladimir Lukyanovich
"Mainsoft", QA
phone: +375333330304
skype: v.lukyanovich
ICQ: 605150692


Re: Problem with moving an object

Posted by Florian Müller <fl...@alfresco.com>.
Hi Vladimir,

That sounds like a problem on the server side. The move operation is supposed to remove the object from the source folder.
Which repository are you using?

Maybe addToFolder() and removeFromFolder() work better...


- Florian


On 02/08/2011 10:50, Владимир Лукьянович wrote:
> Hi,
> 
> When I try to move object by means of a method move, in a directory
> targetFolderId the copy of my object is located, and in a directory
> sourceFolderId the object remains.
> If I carry out changes from one of copies of the given object the same
> changes occur and to the second copy of this object.
> But I expected that at method performance move there will be a moving of
> object to all versions from a directory sourceFolderId in a directory
> targetFolderId, and the original object with all versions sourceFolderId
> will be removed from a directory.
> 
> Why it occurs, and as I can realize moving of object with all its
> versions in other directory? I can something not so I do?
> 
> Listing:
> 
> FileableCmisObject fileableCmisObject = sourceDocumentId.move(
>                         sourceDocumentId.getParents().get(0),
> targetFolderId);
> 
> when: sourceDocumentId - object of type Document (moved object)
>             targetFolderId - object of type Folder (target folder)
> 
> Thanks
>