cancel
Showing results for 
Search instead for 
Did you mean: 

How to write paths in Javascript's Listener?

upforsin
Star Collaborator
Star Collaborator

Hello, I would like to move some documents inside TaskListener.

I use:

var node = companyhome.childByNamePath(DESTINATION)
doc.move(node);

How am I supposed to write the DESTINATION 

Let's say the path is: (copied from the node browser)

/app:company_home/st:sites/cm:sample-project/cm:documentLibrary/cm:_x0030_Directory_x0020_With_x0020__x0020_Whitespace/cm:_x0030_Final

 (Sites/sample project/documentLibrary/Directory With Whitespace/Final)

The more specific question, how to enter the destination with a whitespace character? (I tried the one above but it does not work )

Error: Caused by: java.lang.IllegalArgumentException: Destination Node is a mandatory parameter

howkymike
Alfresco Developer
1 ACCEPTED ANSWER

upforsin
Star Collaborator
Star Collaborator

For future readers, path CAN contain whitespaces and it should be formatted just as you see it (without st:, cm:, etc).

For example:

Sites/my-site/documentLibrary/Dir With Whitespace/Final

is correct.

howkymike
Alfresco Developer

View answer in original post

2 REPLIES 2

upforsin
Star Collaborator
Star Collaborator

For future readers, path CAN contain whitespaces and it should be formatted just as you see it (without st:, cm:, etc).

For example:

Sites/my-site/documentLibrary/Dir With Whitespace/Final

is correct.

howkymike
Alfresco Developer

EddieMay
World-Class Innovator
World-Class Innovator

Hi @upforsin,

Thanks for pposting your solution - really helpful to other users.

Cheers, 

Digital Community Manager, Alfresco Software.
Problem solved? Click Accept as Solution!