cancel
Showing results for 
Search instead for 
Did you mean: 

Accessing app:dictionary from Javascript server code

bgl
Champ on-the-rise
Champ on-the-rise
Hi,

I would like to use variables defined for system path (like app:dictionary) for accessing a freemarker template file that is here :

Data Dictionary/Email Templates/template.ftl

When I try the syntax
companyhome.childByNamePath("app:dictionary/app:email_templates/template.ftl")

it can't find my resource. It seems that it does not translate the variable.

Any idea on how I can do this ? And if this is not possible, what is the way to do it ?

Thank you !
2 REPLIES 2

kevinr
Star Contributor
Star Contributor
That syntax is known as the "QName Path" to the object - it represents the association names down to the object rather than the "name" path which is based on the cm:name properties of the folders down to the object. If you prefer to use QName path then that is good because it's actually a lot more efficient and you can use a Lucene search using the PATH: operator.

So instead do something like this:
var results = search.luceneSearch("PATH:/app:company_home/app:dictionary/app:email_templates/cm:template.ftl");

See:
http://wiki.alfresco.com/wiki/JavaScript_API#Search_API
http://wiki.alfresco.com/wiki/Search#Path_Queries

Thanks,

Kevin

bgl
Champ on-the-rise
Champ on-the-rise
Thank you Kevin ! That is exactly what I was looking for !

Thanks a lot !