Examples of EODataSource


Examples of com.webobjects.eocontrol.EODataSource

            super();
        }

        public WOComponent searchAction(WOComponent currentPage) {
            D2WContext d2wContext = ((D2WComponent)currentPage.parent()).d2wContext();
            EODataSource ds = ((QueryPageInterface)currentPage.parent()).queryDataSource();
            log.info("searchAction: " + ds);
            ListPageInterface listpageinterface = null;
            String listConfigurationName=(String)d2wContext.valueForKey("listConfigurationName");
            if(listConfigurationName==null) {
                listConfigurationName = "__list__" + d2wContext().entity().name();
View Full Code Here

Examples of com.webobjects.eocontrol.EODataSource

        //ak: this check could be better...but anyway, as we edit, we should get a peer context
        if(lpi instanceof ERD2WEditableListPage) {
            ec = ERXEC.newEditingContext(session().defaultEditingContext().parentObjectStore());
        }
        EOEntity entity = ERXEOAccessUtilities.entityNamed(ec, entityName);
        EODataSource ds = relationshipArrayFromRequest(ec, entity.classDescriptionForInstances());
        if(ds == null) {
            ds = new EODatabaseDataSource(ec, entityName);
            EOFetchSpecification fs = fetchSpecificationFromRequest(entityName);
            if(fs == null) {
                fs = new EOFetchSpecification(entityName, null, null);
View Full Code Here

Examples of com.webobjects.eocontrol.EODataSource

        _relationshipKey = relationshipName;
        setObject(_masterObject);
        _singleSelection = _masterObject.classDescription().toManyRelationshipKeys().containsObject(_relationshipKey) ? Boolean.FALSE : Boolean.TRUE;
        d2wContext().takeValueForKey(_singleSelection, "singleSelection");
        
        EODataSource ds;
        String restrictedChoiceKey = (String)d2wContext().valueForKeyPath("restrictedChoiceKey");
        if(restrictedChoiceKey != null && restrictedChoiceKey.length() > 0) {
            Object choices = d2wContext().valueForKeyPath(restrictedChoiceKey);
            ds = ERXEOControlUtilities.dataSourceForArray((NSArray)choices);
        } else {
View Full Code Here

Examples of com.webobjects.eocontrol.EODataSource

        }
        return ds;
    }*/

    public EODataSource internalDataSource() {
        EODataSource ds = dataSource();
        ds = (ds == null) ? ERXEOControlUtilities.dataSourceForArray(list()) : ds;
        return ds;
    }
View Full Code Here

Examples of com.webobjects.eocontrol.EODataSource

        return (WOComponent)qpi;
    }

    public WOComponent listAllMovies() {
        ListPageInterface lpi = (ListPageInterface)D2W.factory().pageForConfigurationNamed("ListAllMovies", this);
        EODataSource ds = new EODatabaseDataSource(ERXEC.newEditingContext(), "Movie");
        lpi.setDataSource(ds);
        return (WOComponent)lpi;
    }
View Full Code Here

Examples of com.webobjects.eocontrol.EODataSource

    EODatabaseDataSource ds = (eodatasource instanceof EODatabaseDataSource) ? (EODatabaseDataSource) eodatasource : null;
    Object newDataSourceState = null;
    if (ds != null) {
      newDataSourceState = ds.fetchSpecification().toString().replaceAll("\\n", "") + ":" + ds.fetchSpecificationForFetch().toString().replaceAll("\\n", "") + " fetchLimit: " + ds.fetchSpecification().fetchLimit() + ", " + ds.fetchSpecificationForFetch().fetchLimit();
    }
    EODataSource old = displayGroup().dataSource();
    super.setDataSource(eodatasource);
    displayGroup().setDataSource(eodatasource);
    if (ds == null || (dataSourceState == null) || (dataSourceState != null && !dataSourceState.equals(newDataSourceState)) || alwaysRefetchList()) {
      log.debug("updating:\n" + dataSourceState + " vs\n" + newDataSourceState);
      dataSourceState = newDataSourceState;
      _hasToUpdate = true;

      // AK: when you use the page in a embedded component and have a few
      // of them in a tab
      // page, WO reuses the component for a new dataSource. If this DS
      // doesn't have the
      // sort order keys required it leads to a KVC error later on. We fix
      // this here to re-init
      // the sort ordering from the rules.
      if (old != null && eodatasource != null && ObjectUtils.notEqual(eodatasource.classDescriptionForObjects(), old.classDescriptionForObjects())) {
        setSortOrderingsOnDisplayGroup(sortOrderings(), displayGroup());
      }
    }
  }
View Full Code Here

Examples of com.webobjects.eocontrol.EODataSource

  protected void setupPhase() {
    WODisplayGroup dg = displayGroup();
    if (dg != null) {
      NSArray sortOrderings = dg.sortOrderings();
      EODataSource ds = dataSource();
      if (!_hasBeenInitialized) {
        log.debug("Initializing display group");
        String fetchspecName = (String) d2wContext().valueForKey("restrictingFetchSpecification");
        if (fetchspecName != null) {
          if (ds instanceof EODatabaseDataSource) {
View Full Code Here

Examples of com.webobjects.eocontrol.EODataSource

  public static final ERD2WQueryActionDelegate instance = new ERD2WQueryActionDelegate();
 
  public WOComponent nextPage(WOComponent sender) {
    WOComponent target = D2WEmbeddedComponent.findTarget(sender);
    if(target.hasBinding("queryDataSource")) {
      EODataSource dataSource = ((QueryPageInterface)sender).queryDataSource();
      target.setValueForBinding(dataSource, "queryDataSource");
    }
    return (WOComponent)target.valueForBinding("action");
  }
View Full Code Here

Examples of com.webobjects.eocontrol.EODataSource

     * Default implementation of which assembles the data source for the search results page, configured
     * for the current query.
     * @return the prepared data source
     */
    public EODataSource defaultQueryDataSource() {
        EODataSource ds = dataSource();
        if (ds == null || !(ds instanceof EODatabaseDataSource)) {
            ds = new EODatabaseDataSource(session().defaultEditingContext(), entity().name());
            setDataSource(ds);
        }
        EOFetchSpecification fs = queryFetchSpecification();
View Full Code Here

Examples of com.webobjects.eocontrol.EODataSource

            _displayGroup=displayGroup;
        }
        public WOComponent nextPage(WOComponent sender) {
            WOComponent result=_nextPage;
            QueryPageInterface qpi=(QueryPageInterface)sender;
            EODataSource eds=qpi.queryDataSource();
            if (eds!=null) {
                if (eds instanceof EODatabaseDataSource) {
                    EODatabaseDataSource dbds=(EODatabaseDataSource)eds;
                    EOQualifier q=dbds.fetchSpecification().qualifier();
                    log.debug("Setting qualifier to "+q);
                    _displayGroup.setQualifier(q);
                    _displayGroup.updateDisplayedObjects();
                } else {
                    log.warn("Data source of unknown type: "+eds.getClass().getName());
                }
            }
            return result;
        }
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.