Hi,
I have following structure of physical and smart folder:
Directory-One
+-Subdir-1
|
+-Subdir-2
|
+-MySmartFolder <--- smart folder directory
On my smart folder search query path, how to define the 'relative path' instead of absolute path (e.g. PATH:'/app:company_home/st:sites/cm:finance-site/cm:documentLibrary/cm:report-1/*') ?
The path I want to search is under directory "Directory-One" or parent folder, so I will get Subdir-1 and Subdir-2 as well.
The search query will be put on MySmartFolder directory (smart folder template).
Secondly, I need this approach since I want to create a custom smart folder applied into "space template". So, when I create a "folder from template" -- this new physical folder will have a custom smart folder which contains a relative path to its current location/path.
I've tried with . (prompt) sign, self, self::node() to PATH parameters were failed.
How to solve this problem?
Thank you,
[bayu]
There is no such thing as a relative path for the Alfresco FTS query syntax which is used to define the query for virtual folders. You always have to use a path starting from the root.
If you need dynamic smart folders you may have to implement a script / behaviour to dynamically create the query template based on the (parent) folder with the specific aspect.
OK, I will try and update it here.
Thank you so much!
Did You solve this problem, Bayu? I have the same or a similar one: I have a folder "A" with a type based smart folder "B" in it. I want the smart folder query to show only the results from the folder "A" where the smart folder "B" is in. How can I achieve that?
Axel Faust said, implement a script. But where has the script to reside and when is it supposed to be executed?
Hi Peter,
My question is come when I want to implement it as a template folder (Repository > Data Dictionary > Space Templates), hence when the folder created it will have a relative query to its parent. But as Axel said it couldn't do this approach since smart folder doesn't support relative path. I thought you can still query with absolute path.
Actually I drop this requirement (space templates approach) and create a Javascript based behavior solution as explained in Jeff Potts' blog:
Implementing Custom Behaviors in Alfresco | ECMArchitect | Alfresco Developer Tutorials
Hope it helps.
Thank you,
[bayu]
Hey,
I found a solution, at least for my use case:
I added to my query:
... and (=PARENT:'<sys:store-protocol>://<sys:store-identifier>/<sys:node-uuid>' or =PRIMARYPARENT:'<sys:store-protocol>://<sys:store-identifier>/<sys:node-uuid>')
This way I limit my search on items, who's Parent or Primary Parent NodeRef is equal to the NodeRef of the physical parent folder of my current smart folder location.
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.