cancel
Showing results for 
Search instead for 
Did you mean: 

move node in php

danikun
Champ in-the-making
Champ in-the-making
Hi,

in the wiki says that exists a method on the the Node class to move the node, but when I try to use it an exceotion launches saying me that this method doesn't exists, and if I look into the code of the node class I see that its true, the method doesn't exists.

Is there another way to move a node?
6 REPLIES 6

jariel06
Champ in-the-making
Champ in-the-making
Hello danikun, to move a node, you can do it in the follow way, copy the node to the destination and delete the original node. Copy and move functions are not implemented in the PHP api, these functions are similar, I have implemented the copy function, but still I could not remove a node, if anyone knows how to remove a node with the PHP api, i would appreciate any help.

Greetings…

k_magnai
Champ in-the-making
Champ in-the-making
hi
i have same problem so can you give me your extension copy function by this forum

harris
Champ in-the-making
Champ in-the-making
I think hook_node_type_delete is used to delete node in php api.
syntax
     hook_node_type_delete($info)

ed9362
Champ in-the-making
Champ in-the-making
Some years ago I wrote a class (http://forums.alfresco.com/en/viewtopic.php?f=21&t=13404), that handled this problem (and some others too) for me.

ed

ddanninger
Champ in-the-making
Champ in-the-making
or if you could also execute the RESTFul Service for that …

which is

to Copy ->

http://localhost:8080/alfresco/service/slingshot/doclib/action/copy-to/node 

and for move ->

http://localhost:8080/alfresco/service/slingshot/doclib/action/move-to/node 


On BOTH RESTFul Services you have to send a POST HTTP Request -> POST DATA - "destNode"=>{nodeRef OF DESTINATION NODE},"nodeRefs"=>{ONE OR MORE NODEREFS which should be moved/copied}

dallinns
Champ on-the-rise
Champ on-the-rise
I am trying to use the script listed above but if I only include
http://localhost:8080/alfresco/service/slingshot/doclib/action/move-to/node
I get a 404 error. I looked at the index of webscripts on the server and saw that there are various urls listed for this including:
http://localhost:8080/alfresco/service/slingshot/doclib/action/move-to/node/{store_type}/{store_id}/...}

I am not sure what I should include for {id} though. I've tried the ID of the store, the destination node, and the node to be moved and I haven't been able to get it to work.

tried this but it doesn't work:
http://localhost:8080/alfresco/service/slingshot/doclib/action/move-to/node/workspace/SpacesStore/12...

Also, on noderef do you include the Id of the file? i.e.
12b1fff0-e469-4edb-ac63-385d2e221de5
or
workspace://SpacesStore/12b1fff0-e469-4edb-ac63-385d2e221de5
or something else?