Change behavior of filename link from document-details

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-30-2012 07:51 PM
Hi,
I am having difficulties locating the appropriate file to extend in order to change the behavior of the filename link in Share's document library view. By default, the filename link will launch "document-details" but I would like to perform a document "view in browser" instead. Is this possible?
Thanks to anyone in advance that may have a solution and sorry for the newbie question.
I am having difficulties locating the appropriate file to extend in order to change the behavior of the filename link in Share's document library view. By default, the filename link will launch "document-details" but I would like to perform a document "view in browser" instead. Is this possible?
Thanks to anyone in advance that may have a solution and sorry for the newbie question.
Labels:
- Labels:
-
Archive
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-31-2012 06:19 AM
Yes it is possible
You can get this by making changes in <Alfresco>\tomcat\webapps\share\components\documentlibrary\documentlist.js file
replace Alfresco.DocumentList.generateFileFolderLinkMarkup with the following piece of code
You can get this by making changes in <Alfresco>\tomcat\webapps\share\components\documentlibrary\documentlist.js file
replace Alfresco.DocumentList.generateFileFolderLinkMarkup with the following piece of code
Alfresco.DocumentList.generateFileFolderLinkMarkup = function DL_generateFileFolderLinkMarkup(scope, record) { var jsNode = record.jsNode, recordSiteName = $isValueSet(record.location.site) ? record.location.site.name : null, html; // Test for: handling a link and the link's target does not live within this site if (jsNode.isLink && recordSiteName !== scope.options.siteId) { if (jsNode.isContainer) { // Create a URL to either the Repository or Site document library where the link target lives html = $siteURL((recordSiteName === null ? "repository" : "documentlibrary") + "?path=" + encodeURIComponent($combine(record.location.path, record.location.file)), { site: recordSiteName }); } else { // Create a URL to the document details page for the link target html = scope.getActionUrls(record, recordSiteName).viewUrl; } } else { if (jsNode.isContainer) { // Create path-change filter markup html = '#" class="filter-change" rel="' + Alfresco.DocumentList.generatePathMarkup(record.location); } else { // Create a URL to the document details page for the link target html = scope.getActionUrls(record).viewUrl; } } return '<a href="' + html + '">'; };


Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-31-2012 04:43 PM
That worked great! Thanks so much!
