Examples of EOSortOrdering


Examples of com.webobjects.eocontrol.EOSortOrdering

     public static EOFetchSpecification localizeFetchSpecification(EOEditingContext ec, EOFetchSpecification fetchSpecification) {
         if(fetchSpecification != null && fetchSpecification.sortOrderings().count() > 0) {
             fetchSpecification = (EOFetchSpecification) fetchSpecification.clone();
             NSMutableArray sortOrderings = new NSMutableArray(fetchSpecification.sortOrderings().count());
             for (Enumeration enumerator = fetchSpecification.sortOrderings().objectEnumerator(); enumerator.hasMoreElements();) {
                 EOSortOrdering item = (EOSortOrdering) enumerator.nextElement();
                 String key = item.key();
                 NSArray path = NSArray.componentsSeparatedByString(key, ".");
                 EOEntity entity = ERXEOAccessUtilities.entityNamed(ec, fetchSpecification.entityName());
                 String attributeName = (String) path.lastObject();
               String prefix = "";
                 if(path.count() > 1) {
                     for (int i = 0; i < path.count() - 1; i++) {
                         String part = (String) path.objectAtIndex(i);
                         EORelationship rel = entity.anyRelationshipNamed(part);
                         entity = rel.destinationEntity();
                         prefix += part + ".";
                     }
                 }
                     if(entity.attributeNamed(attributeName) == null) {
                       EOClassDescription cd = entity.classDescriptionForInstances();
                         if(cd instanceof ERXEntityClassDescription) {
                           String localizedKey = ((ERXEntityClassDescription)cd).localizedKey(attributeName);
                           if(localizedKey != null) {
                                 item = new EOSortOrdering(prefix + localizedKey, item.selector());
                           }
                         }
                     }
                 sortOrderings.addObject(item);
             }
View Full Code Here

Examples of com.webobjects.eocontrol.EOSortOrdering

        _masterCriteria = amc;
        _useGroupTotal = _masterCriteria.shouldTotal();
        resetDefaults();
        _recordGroupDict = groupBy(_reportModel.records(), _masterCriteria);
        _masterCriteriaDrillDownList = DRGroup.drillDownListForMasterCriteriaList(_masterCriteria, _reportModel.criteriaList());
        _ordering = new NSArray(new EOSortOrdering("score", EOSortOrdering.CompareAscending));
    }
View Full Code Here

Examples of com.webobjects.eocontrol.EOSortOrdering

        NSMutableArray nsmutablearray;
        if(nsarray != null)
            nsmutablearray = new NSMutableArray(nsarray);
        else
            nsmutablearray = new NSMutableArray();
        EOSortOrdering eosortordering = EOSortOrdering.sortOrderingWithKey(s, nsselector);
        nsmutablearray.insertObjectAtIndex(eosortordering, 0);
        if(nsmutablearray.count() > 3)
            nsmutablearray.removeLastObject();
        wodisplaygroup.setSortOrderings(nsmutablearray);
    }
View Full Code Here

Examples of com.webobjects.eocontrol.EOSortOrdering

   * @return fetch spec string
   */
  public static String identifierForFetchSpec(EOFetchSpecification fs) {
    StringBuilder sb = new StringBuilder( identifierForQualifier(fs.qualifier()));
    for (Iterator iterator = fs.sortOrderings().iterator(); iterator.hasNext();) {
      EOSortOrdering so = (EOSortOrdering) iterator.next();
      sb.append(so.key()).append(so.selector().name());
    }
    sb.append(fs.fetchesRawRows()).append(fs.fetchLimit()).append(fs.locksObjects()).append(fs.isDeep());
    sb.append(fs.entityName());
    sb.append(fs.hints());
    if (fs instanceof ERXFetchSpecification) {
View Full Code Here

Examples of com.webobjects.eocontrol.EOSortOrdering

    }

    private EOSortOrdering _primarySortOrdering() {
        NSArray nsarray = displayGroup().sortOrderings();
        if (nsarray != null && nsarray.count() > 0) {
            EOSortOrdering eosortordering = (EOSortOrdering)nsarray.objectAtIndex(0);
            return eosortordering;
        }
        return null;
    }
View Full Code Here

Examples of com.webobjects.eocontrol.EOSortOrdering

        }
        return null;
    }

    private boolean _isCurrentKeyPrimary() {
        EOSortOrdering eosortordering = _primarySortOrdering();
        return eosortordering != null && eosortordering.key().equals(key());
    }
View Full Code Here

Examples of com.webobjects.eocontrol.EOSortOrdering

        return eosortordering != null && eosortordering.key().equals(key());
    }

    private NSSelector _primaryKeySortOrderingSelector()
    {
        EOSortOrdering eosortordering = _primarySortOrdering();
        NSSelector nsselector = null;
        if(eosortordering != null)
            nsselector = eosortordering.selector();
        return nsselector;
    }
View Full Code Here

Examples of com.webobjects.eocontrol.EOSortOrdering

        if(nsarray != null)
        {
            NSMutableArray nsmutablearray = new NSMutableArray(nsarray); //.mutableClone();
            for(Enumeration enumeration = nsmutablearray.objectEnumerator(); enumeration.hasMoreElements(); i++)
            {
                EOSortOrdering eosortordering = (EOSortOrdering)enumeration.nextElement();
                if(!s.equals(eosortordering.key()))
                    continue;
                nsmutablearray.removeObjectAtIndex(i);
                break;
            }
View Full Code Here

Examples of com.webobjects.eocontrol.EOSortOrdering

            EORelationship r1=sourceEntity.relationshipNamed((String)valueForBinding("relationshipKey"));
            EOEntity childEntity=r1.destinationEntity();
            EORelationship r2= childEntity.relationshipNamed((String)valueForBinding("restrictingRelationshipKey"));
            EOEntity parentEntity=r2.destinationEntity();
            NSArray unsortedList=EOUtilities.objectsForEntityNamed(ec,parentEntity.name());
            EOSortOrdering sortOrdering=new EOSortOrdering((String)valueForBinding("restrictingRelationshipSortKey"),
                                                           EOSortOrdering.CompareAscending);
            NSMutableArray sortArray=new NSMutableArray(sortOrdering);
            String secondarySortKey=(String)valueForBinding("restrictingSecondarySortKey");
            if (secondarySortKey!=null && secondarySortKey.length()>0) {
                sortOrdering=new EOSortOrdering(secondarySortKey,
                                                EOSortOrdering.CompareAscending);
                sortArray.addObject(sortOrdering);
            }
            _parentList=EOSortOrdering.sortedArrayUsingKeyOrderArray(unsortedList, sortArray);
        }
View Full Code Here

Examples of com.webobjects.eocontrol.EOSortOrdering

    // Utility
    ///////////
    protected EOSortOrdering _primarySortOrdering() {
        NSArray anArray = displayGroup().sortOrderings();
        if ((anArray!=null) && (anArray.count() > 0)) {
            EOSortOrdering anOrdering = (EOSortOrdering)anArray.objectAtIndex(0);
            return anOrdering;
        }
        return null;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.