• sort the files inside folder to update date by default

  • OpenKM has many interesting features, but requires some configuration process to show its full potential.
OpenKM has many interesting features, but requires some configuration process to show its full potential.
Forum rules: Please, before asking something see the documentation wiki or use the search feature of the forum. And remember we don't have a crystal ball or mental readers, so if you post about an issue tell us which OpenKM are you using and also the browser and operating system version. For more info read How to Report Bugs Effectively.
 #12894  by prashanth
 
As a default when we open the folder in openkm the files are sorted by according to name as a default. Is there any way to sort the files according to update date[/b] as a default. I mean recently updated files should show first as a default.
 #25908  by gr87
 
Okay, I'm currently working on changing the Java code and recompiling it. The client insists on this functionality.

Could you please provide some guidance what should be changed? I have found the class ExtendedColumnSorter. Is this where it should be changed? Could you provide the code for the appropriate class?

Any help would be greatly appreciated.
 #25914  by jllort
 
I think the most easiest way for doing it is change OKMDocumentServlet -> getChilds
http://doxygen.openkm.com/openkm/d5/d4d ... 1bed4c47b5

As you can see default list is based on ordering by DocumentComparator
Code: Select all
Collections.sort(docList, DocumentComparator.getInstance(getLanguage()));
The easiest will be change it ( and similar for folders and mails, FolderServlet and MailServlet ). That will have the only inconvenience that will be sorted folders, documents and mails ordered by date but grouped by type.

If you want more fine ordering then you should take a look at FileBrowser.java -> ExtendedScrollTable.java and force by default ordering by column date ( I think by default is not ordered ). To ensure all is right when you see ordered elements click on toolbar refresh. Try to change ordering to other column and refresh etc...
 #26034  by gr87
 
Thank you jllort,

we have managed to take care of the sorting, over the weekend, but I think we used another method.

Now I have another similar question. In the "Pending Tasks" list, the order is ascending. Would it be possible to make it so that the newest dates are on top?
 #26049  by jllort
 
Please add other post for it do not merge several questions in same post because can cause confusion to users who read it ( I will advace that's easy, simply doing minimal change in WorkflowServlet and apply ordering there using new comparator ).

About Us

OpenKM is part of the management software. A management software is a program that facilitates the accomplishment of administrative tasks. OpenKM is a document management system that allows you to manage business content and workflow in a more efficient way. Document managers guarantee data protection by establishing information security for business content.