Check-in; adding versionable aspect

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2009 07:15 AM
Hi all,
I'm trying to use the Check in/Check out API to do just that.
My problem appears once I try to add the versionable aspect to the node I'm checking out, so that the versioning works once I check the node back in.
Problem is that adding aspect locks the node, and that stops me from checking it out.
I'm not sure how to go around this problem, and any help is appreciated.
I'm trying to use the Check in/Check out API to do just that.
My problem appears once I try to add the versionable aspect to the node I'm checking out, so that the versioning works once I check the node back in.
//Add versionable aspect in order for check-in history to work targetNode.addAspect("cm:versionable"); targetNode.save(); var workingCopyNode = targetNode.checkout();
Problem is that adding aspect locks the node, and that stops me from checking it out.
I'm not sure how to go around this problem, and any help is appreciated.

Labels:
- Labels:
-
Archive
5 REPLIES 5

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-05-2009 03:54 AM
I still haven't been able to solve this.
This is the error I'm getting:
There one more thing, too: I get undefined response when calling .isLocked or .hasLockAccess.
Thanks
This is the error I'm getting:
Message: Failed to execute transaction-level behaviour public abstract void org.alfresco.repo.node.NodeServicePolicies$OnAddAspectPolicy.onAddAspect(org.alfresco.service.cmr.repository.NodeRef,org.alfresco.service.namespace.QName) in transaction e550bfe8-1057-49ae-b771-220b61915098 Exception: org.alfresco.service.cmr.lock.NodeLockedException - Can not perform operation since the node (id:b3ed0a6a-4e84-4cbe-97a3-f0311b93c0b2) is locked.
There one more thing, too: I get undefined response when calling .isLocked or .hasLockAccess.
Thanks


Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-11-2009 05:07 AM
This problem happened because a web script is processing the code inside a transaction.
Adding this piece of code to the web script descriptor will take care of the issue:
I don't know how I haven't seen this before.
Hopefully, this will be of a help to someone else.
Cheers!
Adding this piece of code to the web script descriptor will take care of the issue:
<transaction>none</transaction>
I don't know how I haven't seen this before.
Hopefully, this will be of a help to someone else.
Cheers!

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2009 10:59 AM
Hi All,
I got the same problem.
Where are we supposed (file..)to put the <transaction>none</transaction>
Thanks in advance for a reply
Regards
Stéf
I got the same problem.
Where are we supposed (file..)to put the <transaction>none</transaction>
Thanks in advance for a reply
Regards
Stéf
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2009 11:24 AM
In your webscript's .desc.xml

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2009 03:46 AM
Just keep in my that the transaction was set to required in the first place for a reason, and always take care of what you're doing.
In case you didn't know, once you set the authentication to user, transaction is set to required by default, without you specifying so. If the authentication is set to none, then the transaction is set to none by default too.
In case you didn't know, once you set the authentication to user, transaction is set to required by default, without you specifying so. If the authentication is set to none, then the transaction is set to none by default too.
