cancel
Showing results for 
Search instead for 
Did you mean: 

move node thanks to a scheduled action

thibaut
Champ in-the-making
Champ in-the-making
Hello,

i'm trying to implement a scheduled action which allows to move content node in an other folder .

My code is

nodeService.moveNode(currentNode, refSpaceDestination, ContentModel.ASSOC_CONTAINS, QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI,nameDoc));

when i execute  my sheduled action, i see no errors or exeptions but my node isn't deplaced.
I think i've forgotten something but i don't know why. (maybe a transaction ? ) . My scheduled uses the user system .

THanks for you answer !
4 REPLIES 4

tfornoville
Champ in-the-making
Champ in-the-making
Code looks fine to me.

I personally use the FileFolderService for actions such as moving, renaming, copy etc. because it takes care of all the details with the QNames.
Try to use this one:

public FileInfo move(NodeRef sourceNodeRef, NodeRef targetParentRef, String newName)
            throws FileExistsException, FileNotFoundException;

Cheers,
Tom

thibaut
Champ in-the-making
Champ in-the-making
Re,
thanks for your answer,
i have tried via the fileFolderService but in vain.

Maybe do i encapsulate my code in a transaction ?
Maybse is it a right problem ?

I really don"t know cause no errors occured but my document don't move !


Help help ! 😞

Thanks !

tfornoville
Champ in-the-making
Champ in-the-making
I doubt transactions are the problem since NodeService and FileFolderService all have the correct transaction interceptors defines (unless you changed the context.xml?).

Have you tried debugging your service?

thibaut
Champ in-the-making
Champ in-the-making
re,
i'm debugging and it seems that the object returned by the copy (of folderService) have all its property to null.
I see none errors messages .
My sourceNodeRef and TargetNodeRef are not null so they seem to be correctly instantiate.

An idea ?
it's strange !!

I'm searching the .jar where is implemented the folderService .. do you know this ?

thanks