AnsweredAssumed Answered

Selecting and changing nodes parent folders using JS

Question asked by ado on Jun 25, 2010
Latest reply on Jun 28, 2010 by ado
Dear experts,

I am currently trying to write a script that would be called by SAP with three parameters, date, document and store. The JS will then create a store if the specified store does not exists, within this store there would be a monthly folder that if it does not exists will be created and then within this monthly folder, I would place my document specified by the document parameter.

So far the entire structure for the store/date folder creation and selection is working perfectly. its with moving the files that I am having some problems.

All the files are stored in a staging store where they can be selected.

I have been able to create a lucene search query to find the node according to the document number specified within the staging store. Is there a way I can then use this selected node and move it into the correct date folder?

Can one access the folderPath property of the node and just change it to be a child of the date node?
Is there another method of moving the files into the correct store?
Is it possible to use the document DOM object within a script to do this? If indeed how do you go about specifying the document object?

Thank you for any help regarding this, I truly am lost.

Best regards