Package com.webobjects.foundation

Examples of com.webobjects.foundation.NSArray


    @Override
    public WODisplayGroup displayGroup() {
        if(_displayGroup == null) {
            ERXDateGrouper grouper = new ERXDateGrouper();
            _displayGroup = grouper;
            NSArray sortOrderings = sortOrderings();
            if(sortOrderings.count() > 0) {
                Object o = sortOrderings.objectAtIndex(0);
                if(o instanceof EOSortOrdering) {
                    grouper.setDateKeyPath(((EOSortOrdering)o).key());
                }
            }
        }
View Full Code Here


    public NSDictionary dictionary() {
      if(_dictionary == null) {
        _dictionary = new NSMutableDictionary();
        addPageLevelValues();
        NSArray displayPropertyKeys = (NSArray)_context.valueForKey("displayPropertyKeys");
        if(displayPropertyKeys != null && displayPropertyKeys.count() > 0) {
          NSMutableDictionary componentLevelKeys = new NSMutableDictionary();
          addPropertyKeys(componentLevelKeys, displayPropertyKeys);
          _dictionary.setObjectForKey( componentLevelKeys, "componentLevelKeys");
        }
      }
View Full Code Here

                EOQualifier q = EOQualifier.qualifierWithQualifierFormat( "pageConfiguration = '" + _pageConfiguration + "'" , null);
                Assignment a = createAssigment(key, value);
                arr.addObject(new Rule(level, q, a));
            }
        }
        NSArray keys = (NSArray)_dictionary.valueForKey("displayPropertyKeys");
        if(keys != null && keys.count() > 0) {
            addRulesForPropertyKeys(level, arr, keys);
        }
        return arr;
    }
View Full Code Here

      //EOQualifier q3 = new EOKeyValueQualifier("userCount", EOQualifier.QualifierOperatorLessThan, Long.valueOf(82));
      EOQualifier q3 = new EOKeyValueQualifier("userCount", EOQualifier.QualifierOperatorLessThanOrEqualTo, Long.valueOf(802));
      EOQualifier qualifier = new EOAndQualifier(new NSArray<EOQualifier>(new EOQualifier[]{q1, q2, q3}));
      EOFetchSpecification fs = new EOFetchSpecification("LuceneAsset", qualifier, null);
      fs.setFetchLimit(5);
      fs.setSortOrderings(new NSArray(new EOSortOrdering("userCount", EOSortOrdering.CompareAscending)));
      Query query = ERLuceneAdaptorChannel.queryForQualifier(new EOKeyValueQualifier("userCount", EOQualifier.QualifierOperatorLessThanOrEqualTo, 802), EOUtilities.entityNamed(ec, "LuceneAsset"));
      fs.setHints(new NSDictionary(query, ERLuceneAdaptor.QUERY_HINTS));
      NSArray<EOEnterpriseObject> result = ec.objectsWithFetchSpecification(fs);
      log.info(result.count() + ": " + result.valueForKey("userCount"));
      for (EOEnterpriseObject eo : result) {
View Full Code Here

                    parentEC.lock();

                    try {
                        if (ec.deletedObjects().count() > 0) {
                            final NSArray deletedObjectsToFlushInParent = ERXEOControlUtilities.localInstancesOfObjects(parentEC, ec.deletedObjects());

                            if (log.isDebugEnabled()) {
                                log.debug("saveChanges: before save to child context " + ec
                                        + ", need to flush caches on deleted objects in parent context " + parentEC + ": "
                                        + deletedObjectsToFlushInParent);
View Full Code Here

        public void editingContextDidSaveChanges(NSNotification n) {
            EOEditingContext ec = (EOEditingContext) n.object();
            final boolean isNestedEditingContext = (ec.parentObjectStore() instanceof EOEditingContext);
           
            NSArray insertedObjects = (NSArray)n.userInfo().objectForKey("inserted");
            NSArray updatedObjects = (NSArray)n.userInfo().objectForKey("updated");
            NSArray deletedObjects = (NSArray)n.userInfo().objectForKey("deleted");
           
            ERXEnterpriseObject.DidUpdateProcessor.perform(ec, updatedObjects);
            ERXEnterpriseObject.DidDeleteProcessor.perform(ec, deletedObjects);
            ERXEnterpriseObject.DidInsertProcessor.perform(ec, insertedObjects);

            if ( isNestedEditingContext ) {
                // we can assume insertedObjectGIDs and updatedObjectGIDs are non null.  if we execute this branch, they're at
                // least empty arrays.
                final EOEditingContext parentEC = (EOEditingContext)ec.parentObjectStore();

                if (insertedObjects.count() > 0 || updatedObjects.count() > 0) {
                    NSMutableArray flushableObjects = new NSMutableArray();
                    flushableObjects.addObjectsFromArray(insertedObjects);
                    flushableObjects.addObjectsFromArray(updatedObjects);

                    parentEC.lock();
                    try {
                        final NSArray flushableObjectsInParent = ERXEOControlUtilities.localInstancesOfObjects(parentEC, flushableObjects);

                        if ( log.isDebugEnabled() ) {
                            log.debug("saveChanges: before save to child context " + ec +
                                    ", need to flush caches on objects in parent context " + parentEC + ": " + flushableObjectsInParent);
                        }
View Full Code Here

    /**
     * @see com.webobjects.eoaccess.EODatabaseContext.Delegate#databaseContextWillOrderAdaptorOperations(com.webobjects.eoaccess.EODatabaseContext, com.webobjects.foundation.NSArray)
     */
   public NSArray databaseContextWillOrderAdaptorOperations(EODatabaseContext dbCtxt, NSArray databaseOps) {
       NSArray result = (NSArray)perform("databaseContextWillOrderAdaptorOperations", new Object[] {dbCtxt, databaseOps}, null);

       /* OK, this is really quite brutal.  This delegate method has no way of returning an "I did not handle this so do the default thing"
        * response.  The default thing is private so it can't be called directly.  Rather than re-implement it, we use reflection to
        * gain access to the private default implementation private NSArray orderAdaptorOperations().
        */
 
View Full Code Here

        return displayGroup().qualifier() == null ? displayGroup().allObjects() : EOQualifier.filteredArrayWithQualifier(displayGroup().allObjects(), displayGroup().qualifier());
    }
   
    public WOComponent selectAll() {
        NSMutableArray selectedObjects = new NSMutableArray();
        NSArray list = filteredObjects();
        for (Enumeration e = list.objectEnumerator(); e.hasMoreElements();) {
            selectedObjects.addObject(e.nextElement());
        }
        setSelectedObjects(selectedObjects);
        return context().page();
    }
View Full Code Here

        return context().page();
    }
   
    public WOComponent selectAllOnPage() {
        NSMutableArray selectedObjects = new NSMutableArray();
        NSArray list = displayGroup().displayedObjects();
        for (Enumeration e = list.objectEnumerator(); e.hasMoreElements();) {
            selectedObjects.addObject(e.nextElement());
        }
        setSelectedObjects(selectedObjects);
        return context().page();
    }
View Full Code Here

            ds = new EODatabaseDataSource(ec, d2wContext().entity().name(), (String)d2wContext().valueForKeyPath("restrictingFetchSpecification"));
        }
        setDataSource(ds);
       
        Object relationshipValue = _masterObject.valueForKey(relationshipName);
        NSArray objects;
        if(relationshipValue instanceof NSArray) {
            objects = (NSArray)relationshipValue;
        } else if(relationshipValue != null) {
            objects = new NSArray(relationshipValue);
        } else {
            objects = NSArray.EmptyArray;
        }
        setSelectedObjects(objects);
     }
View Full Code Here

TOP

Related Classes of com.webobjects.foundation.NSArray

Copyright © 2018 www.massapicom. 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.