Changeset 5053
- Timestamp:
- Aug 18, 2009, 11:52:16 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/clients/web/net/sf/basedb/clients/web/Base.java
r4989 r5053 58 58 import net.sf.basedb.core.ItemResultIterator; 59 59 import net.sf.basedb.core.Unit; 60 import net.sf.basedb.core.ItemContext.SortDirection; 60 61 import net.sf.basedb.core.query.EntityQuery; 61 62 import net.sf.basedb.core.query.Restrictions; … … 884 885 Create a default <code>ItemContext</code> with settings for default 885 886 visible columns and sort property. 'MINE' and 'SHARED' objects are set to be included. 886 @param sortProperty The property, as a String, to sort on. 887 @param sortProperty The property, as a String, to sort on. If it starts with 888 a '-', the sort is made in descending order (and the minus is removed) 887 889 @param defaultColumns The visible columns as a comma separated String. 888 890 @return an {@link net.sf.basedb.core.ItemContext} object … … 890 892 public static ItemContext createDefaultContext(String sortProperty, String defaultColumns) 891 893 { 892 ItemContext cc = new ItemContext(sortProperty, ItemContext.SortDirection.ASC, 30, 0); 894 SortDirection sortDirection = SortDirection.ASC; 895 if (sortProperty.startsWith("-")) 896 { 897 sortDirection = SortDirection.DESC; 898 sortProperty = sortProperty.substring(1); 899 } 900 ItemContext cc = new ItemContext(sortProperty, sortDirection, 30, 0); 893 901 cc.setSetting("columns", defaultColumns); 894 902 cc.setObject("defaultColumns", defaultColumns); -
trunk/www/common/history/index.jsp
r5048 r5053 63 63 <%! 64 64 private static final ItemContext defaultContext = 65 Base.createDefaultContext(" $hst.time", "time,changeType,user,changeInfo");65 Base.createDefaultContext("-$hst.time", "time,changeType,user,changeInfo"); 66 66 private static final Item itemType = Item.CHANGEHISTORY; 67 67 %>
Note: See TracChangeset
for help on using the changeset viewer.