EOSortOrdering sortOrdering= new EOSortOrdering((String)sortOrderingDefinition.objectAtIndex(i++), new NSSelector((String)sortOrderingDefinition.objectAtIndex(i++), ERXConstant.ObjectClassArray));
String sortKey=(String)sortOrderingDefinition.objectAtIndex(i++); String sortSelectorKey=(String)sortOrderingDefinition.objectAtIndex(i++); EOSortOrdering sortOrdering=new EOSortOrdering(sortKey, ERXUtilities.sortSelectorWithKey(sortSelectorKey));
    public NSArray sortOrderings() {        NSArray sortOrderings=null;        if (userPreferencesCanSpecifySorting()) {            NSKeyValueCoding userPreferences=(NSKeyValueCoding)d2wContext().valueForKey("userPreferences");            if (userPreferences!=null) {                String key=ERXExtensions.userPreferencesKeyFromContext("sortOrdering", d2wContext());                // sort ordering prefs are expected in the form vfk sortOrdering.<pageConfigName>                sortOrderings=(NSArray)userPreferences.valueForKey(key);                if (cat.isDebugEnabled()) cat.debug("Found sort Orderings in user prefs "+ sortOrderings);            }        }        if (sortOrderings==null) {            NSArray sortOrderingDefinition=(NSArray)d2wContext().valueForKey("defaultSortOrdering");            if (sortOrderingDefinition!=null) {                NSMutableArray so=new NSMutableArray();                for (int i=0; i< sortOrderingDefinition.count();) {                    EOSortOrdering sortOrdering=                       new EOSortOrdering((String)sortOrderingDefinition.objectAtIndex(i++),                                          new NSSelector((String)sortOrderingDefinition.objectAtIndex(i++),                                                         ERXConstant.ObjectClassArray));                    so.addObject(sortOrdering);                }                sortOrderings=so;                if (cat.isDebugEnabled()) cat.debug("Found sort Orderings in rules "+ sortOrderings);            }        }        return sortOrderings;    }