Reputation: 141
I am uploading an Alfresco file, I need get the file from documentLibrary
dynamically, how can I do this? .bpm20.xml is possible.
var dest= companyhome.childByNamePath("Sites/test/documentLibrary/"+${trainername});
bpm_package.addNode(dest);
Please help out
Upvotes: 0
Views: 274
Reputation: 6450
The companyhome
is one of root objects
, class org.alfresco.repo.jscript.ScriptNode
.
Method ScriptNode.childByNamePath(String path)
returns another ScriptNode
.
To get file name you can use ScriptNode.getName()
method (Java or JavaScript) or name
property (shortcut access to the cm:name
property) in JavaScript.
var dest= companyhome.childByNamePath("Sites/test/documentLibrary/"+${trainername});
bpm_package.addNode(dest);
logger.info("and the file name is.... "+dest.name);
Is that answers your question?
BTW: "What's the difference between JavaScript and Java?"
Upvotes: 2