cancel
Showing results for 
Search instead for 
Did you mean: 

CMIS CheckIn

ivo_c_costa
Champ in-the-making
Champ in-the-making
Hi,

Today I found a problem in a project of mine that connects through CMIS to Alfresco. Because we cannot update content and properties at the same time using OpenCMIS, folder rules were getting executed twice per file on update, and so I tried to add check-in and check-out on our code with the condition to ignore working copies on the rules.

Unfortunately I'm getting a really strange error while trying to check-in. I'm already a bit at lost, since I've tried a lot of things.
While checking in I'm getting a duplicate file exception But I also got it a few time while checking out.

Any idea on what might be happening?

Maybe I'm missing something on the check-out/check-in procedure

This is one of the errors I'm getting:
<blockquote>
2013-02-11 17:55:43,149  ERROR [extensions.webscripts.AbstractRuntime] [http-8080-29] Exception from executeScript - redirecting to status template error: 01110008 011
10468 Failed to execute script 'classpath*:alfresco/templates/webscripts/org/alfresco/cmis/pwc.put.atom.js': Existing file or folder test_report.pd
f already exists
org.springframework.extensions.webscripts.WebScriptException: 01110008 01110468 Failed to execute script 'classpath*:alfresco/templates/webscripts/org/alfresco/cmis/pw
c.put.atom.js': Existing file or folder test_report.pdf already exists
        at org.alfresco.repo.cmis.rest.CMISWebScript.executeScript(CMISWebScript.java:53)
</blockquote>



Any help is appreciated
Thanks,
Ivo Costa
7 REPLIES 7

jpotts
World-Class Innovator
World-Class Innovator
Which version of Alfresco are you using? Which CMIS client (language and version), if any?

I note that you are using an old set of CMIS URLs but that may not be a problem if you are using 3.x.

Jeff

ivo_c_costa
Champ in-the-making
Champ in-the-making
Hi Jeff,

We're using Alfresco Community 4.0c for this project, I already changed the url but it did not fix this issue on the first test we did. I've seen a few problems in the past weeks with CMIS not working due to index errors so we're re-indexing right now.

We're using Apache OpenCMIS 0.6.0

I've tried checking in with OpenCMIS Workbench and had no problem, so my guess is that something must be wrong with the code it-self.

Thanks,
Ivo Costa

jpotts
World-Class Innovator
World-Class Innovator
I agree that it is likely a code problem. Can you share the code please? Also, if you are using the /alfresco/cmisatom URL you must be seeing a different error message so please share that as well.

Jeff

ivo_c_costa
Champ in-the-making
Champ in-the-making
Hi Jeff,

I've been working on a lot of other fixes, and this one kind of got the lowest priority. Here is the sequence I'm using for the check out - check in through cmis.

We added the cancel check-out, because it looks like checkin wasn't enough

<java>
id = doc.checkOut();

                doc = (Document) session.getObject(id);

                id = doc.checkIn(false, properties, contentStream, "Updated Through Doorway");

                doc = (Document) session.getObject(id);

                doc.cancelCheckOut();
</java>

I tried getting the errors from this, but ever since I changed to the new connection url, the logs stopped appearing. I do get CMIS logs but only from the developers who are still using the old connection string.

Thanks,
Ivo Costa

jpotts
World-Class Innovator
World-Class Innovator
I cannot reproduce this using Alfresco 4.2.c Community and the following code running in the OpenCMIS workbench 0.9.0-beta1 groovy console:

doc = session.getObjectByPath("/cmis-demo/temp.txt");
id = doc.checkOut();
doc = (Document) session.getObject(id);
cs = doc.getContentStream();
print doc.name
id = doc.checkIn(false, null, cs, "Updated Through Doorway");
doc = (Document) session.getObject(id);


Jeff

ivo_c_costa
Champ in-the-making
Champ in-the-making
Jeff, thanks for your help.

I managed to plan a migration thanks to a lot of other stuff we had running. I'll check if anything changes with the new version. Still I find it strange that I'm not getting any CMIS log entries right now. I'll check that too.

Thanks,
Ivo Costa

arannasousa
Champ on-the-rise
Champ on-the-rise
It worked for me - recursively

1 - Create a script in / Data Dictionary / Scripts / unlock.js file
<javascript>
doc = document;
id = doc.checkout ();
doc = id;
cs = doc.content;
id = doc.checkin("Updated Through Doorway");
doc = id;
</javascript>
2 - Create a Rule in a folder by putting to run the script created in step 1 and have run into subfolders …