Page 1 of 1

sort the files inside folder to update date by default

PostPosted:Tue Nov 15, 2011 6:07 am
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.

Re: sort the files inside folder to update date by default

PostPosted:Tue Nov 15, 2011 12:51 pm
by jllort
Now it's needed minimal source code change for doing it, really not much complicated. I've added this feature to be included in our roadmap http://issues.openkm.com/view.php?id=1892

Re: sort the files inside folder to update date by default

PostPosted:Mon Oct 14, 2013 10:22 am
by gr87
Hello,

has this feature been implemented? I'd be interested in changing this, without changing java code...

Re: sort the files inside folder to update date by default

PostPosted:Tue Oct 15, 2013 6:08 pm
by jllort
Is still not implemented.

Re: sort the files inside folder to update date by default

PostPosted:Wed Oct 16, 2013 11:28 am
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.

Re: sort the files inside folder to update date by default

PostPosted:Fri Oct 18, 2013 7:58 am
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...

Re: sort the files inside folder to update date by default

PostPosted:Mon Oct 21, 2013 10:36 am
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?

Re: sort the files inside folder to update date by default

PostPosted:Tue Oct 22, 2013 6:57 am
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 ).