Problem moving node in new folder

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-09-2009 08:21 AM
Hi!!
I have a problem, inside an action, when trying to move actionedUponNodeRef into new folder I've created just before.
I create new folder A (where A is a parameter generated dynamically by the first part of the action) as a child of companyHome with fileFolderService.create and then put my actionedUponNodeRef in. Here is the code:
Executing the action I get a "null pointer" exception; It seems like "fileFolderService.move" method doesn't found the new folderA I've just created; probably because the new folder isn't really created (phisically) until the action ends successfully ( in fact, when I get the exception, action is stopped and new folder isn't created).
How can I solve this problem?? Is there any method like commit, flush, or .save() in js that makes me sure the folder is created (effectively in the repository) before moving the node??
I think a method like preceedings should exist, just thinking that methods dealing with repository inside an action take effectiveness only when the action ends succesfully (otherwise, they don't take effect); unfortunately, nowadays, I don't yet found such methods.
Any suggest, help or comment is appreciated
Thanks a lot!!
I have a problem, inside an action, when trying to move actionedUponNodeRef into new folder I've created just before.
I create new folder A (where A is a parameter generated dynamically by the first part of the action) as a child of companyHome with fileFolderService.create and then put my actionedUponNodeRef in. Here is the code:
…NodeRef folderA=fileFolderService.create(companyHomeNode, A, ContentModel.TYPE_FOLDER).getNodeRef(); try { NodeRef movedNode=fileFolderService.move(actionedUponNodeRef, folderA, null).getNodeRef(); } catch (FileExistsException e) { e.printStackTrace(); } catch (FileNotFoundException e) { e.printStackTrace(); }
Executing the action I get a "null pointer" exception; It seems like "fileFolderService.move" method doesn't found the new folderA I've just created; probably because the new folder isn't really created (phisically) until the action ends successfully ( in fact, when I get the exception, action is stopped and new folder isn't created).
How can I solve this problem?? Is there any method like commit, flush, or .save() in js that makes me sure the folder is created (effectively in the repository) before moving the node??
I think a method like preceedings should exist, just thinking that methods dealing with repository inside an action take effectiveness only when the action ends succesfully (otherwise, they don't take effect); unfortunately, nowadays, I don't yet found such methods.
Any suggest, help or comment is appreciated
Thanks a lot!!
Labels:
- Labels:
-
Archive
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2013 04:30 AM
Hi carotti,
did you find a solution for that old problem ? I have the same issue now!
Let me know!
Thank you.
did you find a solution for that old problem ? I have the same issue now!
Let me know!
Thank you.
