How to write paths in Javascript's Listener?

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Established Member II

How to write paths in Javascript's Listener?

Jump to solution

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

1 Solution

Accepted Solutions
Highlighted
Established Member II

Re: How to write paths in Javascript's Listener?

Jump to solution

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.

View solution in original post

2 Replies
Highlighted
Established Member II

Re: How to write paths in Javascript's Listener?

Jump to solution

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.

View solution in original post

Community Manager
Community Manager

Re: How to write paths in Javascript's Listener?

Jump to solution

Hi @upforsin,

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

Cheers, 

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