cancel
Showing results for 
Search instead for 
Did you mean: 

How to get path from current space?

gistolero
Champ in-the-making
Champ in-the-making
Hello,

I want to write a custom javascript rule, that creates a folder in the _current_ space (only if this folder doesn't exist) and moves the new/updated document to this space if mimetyp is 'foo'.

How I get the path from _current_ space? The root object 'space' points to the space that the rule resides in. Thats not what I want, because the rule should be inherited for sub folders.

Thanks
Simon
5 REPLIES 5

eesnault
Champ in-the-making
Champ in-the-making
Hello,

Maybe you can get the parent space of the document you're trying to handle…

document.parent should give you the parent node…

Erwan

ndk
Champ in-the-making
Champ in-the-making
I need it too. Can someone help me/us?

for my code:
i have the name of the space with child.properties.name
can you use something like child.properties.path, or child.properties.getpath, or child.properties.url, or … ?

child is a subspace and i need the path of it to move documents to the sub-space(=child)…

ndk
Champ in-the-making
Champ in-the-making
To get the current space use "xxx.displayPath", example: child.displayPath

boumbh
Champ in-the-making
Champ in-the-making
myNode.displayPath
is localized! … I'll soon have a seizure! What is this? Ms Windows and its bloody localized folders?! How do I get the "/app:company_home/app:shared/cm:mybloodyfile" version of the path? The unique one, the technical one! Not the localized "/Espace racine/Partagé/Mon Fichier Sanglant"! How do I make my script compatible? Why every simple thing is so complex in Alfresco? Why can't I find how to get the number of users in the Share interface? How comes the wildcard characters to get all the results sometimes is "*", sometimes is "?" or even "%"? Why do I need to enter three characters when I want to assign a group to a folder? Why is it so inconsistent? My headz gonna blow, I may cry!

kevinr
Star Contributor
Star Contributor
node.qnamePath
Exactly as it says in the docs: https://wiki.alfresco.com/wiki/4.0_JavaScript_API