Package com.webobjects.eocontrol

Examples of com.webobjects.eocontrol.EOArrayDataSource


            int indexOfDot = keyPath.indexOf(".");
            if(indexOfDot > 0) {
                String entityName = keyPath.substring(0, indexOfDot);
                String relationshipPath = keyPath.substring(indexOfDot+1, keyPath.length());
                EOEnterpriseObject eo = EOUtilities.objectWithPrimaryKey(ec, entityName, primaryKeyFromRequest(ec, entityName));
                EOArrayDataSource ds = new EOArrayDataSource(cd, ec);
                ds.setArray((NSArray)eo.valueForKeyPath(relationshipPath));
                return ds;
            }
        }
        return null;
    }
View Full Code Here


                              : null);
            }
            if(entityName != null) {
                if (_dataSource == null || !entityName.equals(_dataSource.classDescriptionForObjects().entityName()) || _dataSource.editingContext() != eoeditingcontext)
                    _dataSource = (eoeditingcontext != null
                                   ? (new EOArrayDataSource(EOClassDescription.classDescriptionForEntityName(entityName), eoeditingcontext)) : null);
            }
            if (_dataSource != null)
                _dataSource.setArray(nsarray);
        }
        return _dataSource;
View Full Code Here

      EOEnterpriseObject eo = recordForObject(ec, o);
      ec = eo.editingContext();
      cd = eo.classDescription();
      objects.addObject(eo);
    }
    EOArrayDataSource ds = new EOArrayDataSource(cd, ec);
    ds.setArray(objects);
    return ds;
  }
View Full Code Here

    /**
     * Utility to return a new array datasource
     * @param ec
     */
    public EOArrayDataSource newArrayDataSource(EOEditingContext ec) {
      return new EOArrayDataSource(classDescription(), ec);
    }
View Full Code Here

    }

    protected WODisplayGroup _massChangeDisplayGroup;
    public WODisplayGroup massChangeDisplayGroup() {
        if (_massChangeDisplayGroup == null) {
            final EOArrayDataSource ads = new EOArrayDataSource(massChangeEO().classDescription(), massChangeEO().editingContext());
            ads.setArray(new NSArray(massChangeEO()));
            _massChangeDisplayGroup = new WODisplayGroup();
            _massChangeDisplayGroup.setDataSource(ads);
            _massChangeDisplayGroup.setNumberOfObjectsPerBatch(0);
            _massChangeDisplayGroup.fetch();
            if(log.isDebugEnabled()) log.debug("_massChangeDisplayGroup: " + _massChangeDisplayGroup);
View Full Code Here

     *    data source
     * @return an array data source corresponding to the array
     *    of objects passed in.
     */
    public static EOArrayDataSource dataSourceForArray(NSArray<? extends EOEnterpriseObject> array) {
        EOArrayDataSource dataSource = null;
        if (array != null && array.count() > 0) {
            EOEnterpriseObject eo = array.objectAtIndex(0);
            dataSource = new EOArrayDataSource(eo.classDescription(), eo.editingContext());
            dataSource.setArray(array);
        }
        return dataSource;
    }
View Full Code Here

     *    data source
     * @return an array data source corresponding to the array
     *    of objects passed in.
     */
    public static EOArrayDataSource dataSourceForArray(EOEditingContext ec, String entityName, NSArray array) {
      EOArrayDataSource dataSource = new EOArrayDataSource(EOClassDescription.classDescriptionForEntityName(entityName), ec);
      if (array != null && array.count() > 0) {
        dataSource.setArray(array);
      }
      return dataSource;
    }
View Full Code Here

        }
        return _selectionList;
    }

    public EOArrayDataSource selectionDataSource() {
        EOArrayDataSource dataSource = new EOArrayDataSource(EOClassDescription.classDescriptionForEntityName(relationshipEntityName()), object().editingContext());
        dataSource.setArray(selectionList());
        return dataSource;
    }
View Full Code Here

          EOQualifier qualifier = qualifier();
            if (_dataSource == null) {
              String destinationEntityName = destinationEntityName();
              EOEditingContext editingContext = editingContext();
              if (ERXEOAccessUtilities.entityWithNamedIsShared(editingContext(), destinationEntityName) ) {
                 EOArrayDataSource arrayDataSource = new EOArrayDataSource(destinationEntity().classDescriptionForInstances(), editingContext);
                 NSArray sharedEOs = ERXEOControlUtilities.sharedObjectsForEntityNamed(destinationEntityName);
                
                 if (sharedEOs == null) {
                   sharedEOs = NSArray.EmptyArray;
                 }
                 else if (qualifier != null) {
                   sharedEOs = EOQualifier.filteredArrayWithQualifier(sharedEOs, qualifier);
                 }
                
                 arrayDataSource.setArray(sharedEOs);
                 _dataSource = arrayDataSource;
              }
              else {
                _dataSource = new EODatabaseDataSource(editingContext, destinationEntityName);
                if (qualifier != null) {
View Full Code Here

    public WOComponent listMyRequirements() {
      EOEditingContext ec = ERXEC.newEditingContext();
    ec.lock();
    try {
          NSArray array = Requirement.clazz.myRequirementsWithUser(ec, People.clazz.currentUser(ec));
          EOArrayDataSource ds = Requirement.clazz.newArrayDataSource(ec);
          ds.setArray(array);
          return (WOComponent) listPageNamed("ListMyRequirement", ds);
    } finally {
      ec.unlock();
    }
    }
View Full Code Here

TOP

Related Classes of com.webobjects.eocontrol.EOArrayDataSource

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.