Display link to the parent folder of a document on a webscript
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-14-2015 09:36 AM
Hi all!
I'm crating a web script in alfresco where I implement a kind of custom search on my document,
after the data are entered on the form the documents are listed on the page.
For each documents I would like to print a link to the parent folder on the ftl template as it appens on the standard search.
This is the format for the link to the parent folder
https://xxxx.com/share/page/repository#filter=path%7C%2Fxxxx%2FProducts%2FImages%2FPrivate%2Fxxxxxxx...
What is the best way to generate this link from the element I have on the script node of the document ?
I'm crating a web script in alfresco where I implement a kind of custom search on my document,
after the data are entered on the form the documents are listed on the page.
For each documents I would like to print a link to the parent folder on the ftl template as it appens on the standard search.
This is the format for the link to the parent folder
https://xxxx.com/share/page/repository#filter=path%7C%2Fxxxx%2FProducts%2FImages%2FPrivate%2Fxxxxxxx...
What is the best way to generate this link from the element I have on the script node of the document ?
Labels:
- Labels:
-
Archive
3 REPLIES 3
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-15-2015 03:33 AM
Hi,
You can get the parent node directly on the script node. The parent node has a "url" property but I don't think it matches the format you described. However there is a "displayPath" property that makes it possible to build your "url". You should take a look at the source code of the standard search results page to see how Alfresco build this kind of url.
You can get the parent node directly on the script node. The parent node has a "url" property but I don't think it matches the format you described. However there is a "displayPath" property that makes it possible to build your "url". You should take a look at the source code of the standard search results page to see how Alfresco build this kind of url.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-15-2015 04:20 AM
Hi mlagneaux thanks for the quick answer,
I already tried to download the alfresco source via SVN but I always get a timeout, from wich repos you suggest me to download it ?
I already tried to download the alfresco source via SVN but I always get a timeout, from wich repos you suggest me to download it ?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-16-2015 09:13 AM
I think you should take a look to the source code of "search.get" Share webscript. You'll find the source code in the share.war file (../WEB-INF/classes/alfresco/site-webscripts/org/alfresco/components/search/search.get*).
I think that what you're looking for is located in search.js file (../components/search). That's the javascript code related to the search.get webscript.
See _getBrowseUrlForRecord method.
I think that what you're looking for is located in search.js file (../components/search). That's the javascript code related to the search.get webscript.
See _getBrowseUrlForRecord method.
