on 11-30-2009 9:49 AM
Hi ,
Requirement is Sort the Km files which is displayed in JSP dynpage by filename , by created date, by size.
Please suggest the solution.
Regards
Priya
Hi Priya
While creating the ResourceList you can use the Collator class which is used to sort the resource list according to the specified property. Here comes the Code for it
//To Get handle for the Folder where the Files reside
ICollection collection=(ICollection)resourceFactory.getResource(rid,context);
//Proceding if the Folder Exixt
if(collection!=null && collection.hasChildren())
{
//Creating a Prperty by which we need to Sort the Files
IPropertyName propName=new PropertyName("http://sapportals.com/xmlns/cm","displayname");
//Creating Collator object
Collator collator =new Collator();
//Adding the Property as sort Criteria
collator.addCriteria(propName,true);
//Generating resource list by the sort order
IResourceList resourceList=collection.getChildren(null,collator,null);
resourceListItr = resourceList.listIterator();
}
Hope this will help you..
Regards
Noel
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
74 | |
10 | |
8 | |
7 | |
6 | |
5 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.