[ 
https://issues.apache.org/jira/browse/CMIS-530?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13271798#comment-13271798
 ] 

Florian Müller commented on CMIS-530:
-------------------------------------

A file system is not really a content management system and the FileShare 
repository has to do some quirks to implement CMIS.

The only unique id of a document on a file system is its paths. If you rename 
or move a document, you also change its id.
The {{updateProperties()}} method that you are using, tries to reload the 
object after the update. Since the id of the document changed, it cannot find 
it anymore and throws an exception.

That's not what you would expect from a real content management system, but it 
still CMIS compliant.

If you want to avoid this exception, use the other {{updateProperties()}} 
method that has a {{refresh}} parameter.

                
> update cmis:name property of a previously uploaded file "appears" to fail 
> with CmisObjectNotFoundException" but actually does the rename
> ----------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CMIS-530
>                 URL: https://issues.apache.org/jira/browse/CMIS-530
>             Project: Chemistry
>          Issue Type: Bug
>          Components: opencmis-client
>    Affects Versions: OpenCMIS 0.8.0
>         Environment: Win 7 Enterprise/32-bit Tomcat 7.0.22/ JDK 1.6.0_29 
> using the project WAR - chemistry-opencmis-server-fileshare  created from 
> source: chemistry-opencmis-server-fileshare-0.8.0-SNAPSHOT.war
>            Reporter: mark streit
>              Labels: AbstractCmisObject, CmisObjectNotFoundException, 
> getObjectService(), refresh()
>
> when attempting to follow the approach that is shown in the example code 
> called GettingStarted.java
> {code} 
>         Document doc2 = (Document) session.getObject(id2);
>         System.out.println("renaming " + doc2.getName() + " to test3.txt");
>         properties = new HashMap<String, Object>();
>         properties.put(PropertyIds.NAME, "test3.txt");
>         id2 = doc2.updateProperties(properties);
>         System.out.println("renamed to " + doc2.getName());
> {code} 
> The call to updateProperties(), with a correctly populated Map containing the 
> new name throws back a CmisObjectNotFoundException which I've traced back to 
> the refresh() method of AbstractCmisObject.java.  
> {code} 
>     public void refresh() {
>         writeLock();
>         try {
>             String objectId = getObjectId();
>             OperationContext oc = getCreationContext();
>             // get the latest data from the repository
>             ObjectData objectData = getSession()
>                     
> .getBinding().getObjectService().getObject(getRepositoryId(), objectId, 
> oc.getFilterString(), oc.isIncludeAllowableActions(), 
> oc.getIncludeRelationships(), oc.getRenditionFilterString(), 
> oc.isIncludePolicies(), oc.isIncludeAcls(), null);
>             // reset this object
>             initialize(getSession(), getObjectType(), objectData, 
> this.creationContext);
>         } finally {
>             writeUnlock();
>         }
>     }
> {code} 
> When you start inspecting the values of each of the objects in the chained 
> call above where it tries to get back an ObjectData instance... things look 
> OK UNTIL you hit the method: getObjectService() 
> {code} 
> getBinding() IS OK returing this:
> org.apache.chemistry.opencmis.client.bindings.impl.CmisBindingImpl@4c689e  
> objectId = L0NoZW1Eb2NzXzExL1Rlc3RGaWxlOS5wZGY=    // this is also OK
> {code} 
> but this call, getObjectService() reports that "the method getObjectService() 
> is undefined for the type AbstractCmisObject"
> The objectData instance is never created, and it skips to the finally block,  
> so I AM ASSUMING, this might be the root cause.  I don't know enough about 
> Chemistry, but what is more odd:
> 1) the file on the file system DOES get renamed correctly
> 2) the execution path getting there however involves this 
> {code} 
> org.apache.chemistry.opencmis.commons.exceptions.CmisObjectNotFoundException: 
> Object not found!
> {code} 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira


Reply via email to