Document Library sort order

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-18-2009 02:04 AM
I am trying to find a way to sort the documents in the Share Document Library by creation date.
Is it possible and if yes, … how!
Thanks
- Labels:
-
Archive
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-18-2009 03:59 AM
However, if you want to make the change permanently you can update / override the filters.lib.js script on the Repository.
classpath:alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/filters.lib.js
At the top of the script is the default sort order:var filterParams ={ … sortBy: "@{http://www.alfresco.org/model/content/1.0}name", sortByAscending: true, …}
Thanks,
Mike
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-18-2009 01:18 PM
I was looking for a way to change my docLib sort order to have all files be sorted by their names. Your posting does help find a way to do this, but it looks like it's not working for me. I have looked at the filters.lib.js and its sort order on creation is set to "name", right. Yet the three test files I have now are sorted this way (by creation date):
Canon.txt
Aaron.txt
Bolton.txt
however, the filters.lib.js file has this:
…sortBy: "@{http://www.alfresco.org/model/content/1.0}name",sortByAscending: true,…
please assist, am I doing something wrong?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-18-2009 03:51 PM
Thanks,
Mike

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2009 02:42 AM
Just what I needed!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-02-2009 12:33 PM
default: var filterQuery = "+PATH:\"" + parsedArgs.parentNode.qnamePath + "/*\""; filterQuery += " -ASPECT:\"{http://www.alfresco.org/model/content/1.0}workingcopy\""; filterParams.query = filterQuery; break;
Change that to look like this
default: var filterQuery = "+PATH:\"" + parsedArgs.parentNode.qnamePath + "/*\""; filterQuery += " -ASPECT:\"{http://www.alfresco.org/model/content/1.0}workingcopy\""; filterQuery.sortBy = "@{http://www.alfresco.org/model/content/1.0}name"; filterQuery.sortByAscending = true; filterParams.query = filterQuery; break;
That will make sure that the documents are sorted in the document library
and in the All documents link in the document library
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-02-2009 04:10 PM
No - that's not quite correct. The "sortBy" and "sortByAscending" values are members of the filterParams object literal, not the filterQuery string. The default sort order is by name (ascending) but this is overridden for the "recently modified" and "recently added" filters. As I mentioned before, you might need a fairly recent build to pick up on the changes to the query engine which correctly honoured the sortBy parameters.
Thanks,
Mike
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-02-2009 06:29 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-02-2010 10:33 AM
Regards,
Michael

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-31-2012 04:21 AM
I was wondering if someone got this working without changing the filters.lib.js in the deployed war. I'm trying to do the same thing (well, for action-sets.lib.js actually), but I can't seem to get it to override the default…
Regards,
Michael
I also tried to override this file with a jar. I tried to put it in :
- config\alfresco\templates\webscripts\org\alfresco\slingshot\documentlibrary-v2\filters.lib.js
- config\alfresco\extension\templates\webscripts\org\alfresco\slingshot\documentlibrary-v2\filters.lib.js
Nothing overrided the original file.
The only way I found that worked is to delete the original filters.lib.js. Without the original file, Alfresco uses my custom filters.lib.js (if it's in config\alfresco\templates\webscripts\org\alfresco\slingshot\documentlibrary-v2\filters.lib.js of my jar)
With Alfresco 4.0.2.9
