Examples of WODisplayGroup


Examples of com.webobjects.appserver.WODisplayGroup

     */
    public void validateQuery(ERD2WQueryPage sender) {
        d2wContext = sender.d2wContext();

        // First check to see if there are any query values.
        WODisplayGroup displayGroup = sender.displayGroup();
        if (displayGroup.queryMatch().allKeys().count() == 0 && displayGroup.queryMin().allKeys().count() == 0 &&
            displayGroup.queryMax().allKeys().count() == 0 && displayGroup.queryBindings().allKeys().count() == 0 &&
            !ERXValueUtilities.booleanValueWithDefault(d2wContext.valueForKey(ValidationKeys.AllowsEmptyQuery), true)) {
            throw ERXValidationFactory.defaultFactory().createCustomException(null, ErrorKeys.QueryEmpty);
        }

        // Check the query values.
View Full Code Here

Examples of com.webobjects.appserver.WODisplayGroup

  }

  public static WOComponent printerFriendlyVersion(D2WContext d2wContext, WOSession session, EODataSource dataSource, WODisplayGroup displayGroup) {
    ListPageInterface result = (ListPageInterface) ERD2WFactory.erFactory().printerFriendlyPageForD2WContext(d2wContext, session);
    result.setDataSource(dataSource);
    WODisplayGroup dg = null;
    if (result instanceof D2WListPage) {
      dg = ((D2WListPage) result).displayGroup();
    } else if (result instanceof ERDListPageInterface) {
      dg = ((ERDListPageInterface) result).displayGroup();
    } else {
      try {
        dg = (WODisplayGroup) ((WOComponent) result).valueForKey("displayGroup");
      } catch (Exception ex) {
        log.warn("Can't get displayGroup from page of class: " + result.getClass().getName());
      }
    }
    if (dg != null) {
      dg.setSortOrderings(displayGroup.sortOrderings());
      dg.setNumberOfObjectsPerBatch(displayGroup.allObjects().count());
      dg.updateDisplayedObjects();
    }
    return (WOComponent) result;
  }
View Full Code Here

Examples of com.webobjects.appserver.WODisplayGroup

  protected void didUpdate() {
  }

  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) {
            EOFetchSpecification fs = ((EODatabaseDataSource) ds).entity().fetchSpecificationNamed(fetchspecName);
            if (fs != null) {
              fs = (EOFetchSpecification) fs.clone();
            }
            ((EODatabaseDataSource) ds).setFetchSpecification(fs);
          }
        }
        if (sortOrderings == null) {
          sortOrderings = sortOrderings();
          setSortOrderingsOnDisplayGroup(sortOrderings, dg);
        }
        dg.setNumberOfObjectsPerBatch(numberOfObjectsPerBatch());
        _fetchDisplayGroup(dg);
        dg.updateDisplayedObjects();
        _hasBeenInitialized = true;
        _hasToUpdate = false;
      }
      // AK: if we have a DB datasource, then we might want to refetch if
      // the sort ordering changed
      // because if we have a fetch limit then the displayed matches on
      // the first page come from the
      // results, not from the real order in the DB. Set
      // "alwaysRefetchList" to false in your
      // rules to prevent that.
      // In addition, we need to refetch if we use a batching display
      // group, as the sort ordering is
      // always applied from the DB.
      if ((sortOrderings != null) && (ds instanceof EODatabaseDataSource)) {
        EOFetchSpecification fs = ((EODatabaseDataSource) ds).fetchSpecification();
        if (!fs.sortOrderings().equals(sortOrderings) && (fs.fetchLimit() != 0 || useBatchingDisplayGroup())) {
          fs.setSortOrderings(sortOrderings);
          _hasToUpdate = _hasToUpdate ? true : alwaysRefetchList();
        }
      }
      // this will have the side effect of resetting the batch # to sth
      // correct, in case
      // the current index if out of range
      log.debug("dg.currentBatchIndex() " + dg.currentBatchIndex());
      dg.setCurrentBatchIndex(dg.currentBatchIndex());
      if (listSize() > 0 && displayGroup().selectsFirstObjectAfterFetch()) {
        d2wContext().takeValueForKey(dg.allObjects().objectAtIndex(0), "object");
      }
    }
  }
View Full Code Here

Examples of com.webobjects.appserver.WODisplayGroup

    public AppDetailPage(WOContext aWocontext) {
        super(aWocontext);
        handler().updateForPage(name());

        displayGroup = new WODisplayGroup();
        displayGroup.setFetchesOnLoad(false);
    }
View Full Code Here

Examples of com.webobjects.appserver.WODisplayGroup

         */
        @Override
        public void validateQueryValues(ERD2WQueryPage sender) {
            queryPage = sender;
           
            WODisplayGroup displayGroup = queryPage.displayGroup();
            _validateQueryValues(displayGroup.queryMatch());
            _validateQueryValues(displayGroup.queryMin());
            _validateQueryValues(displayGroup.queryMax());
            _validateQueryValues(displayGroup.queryBindings());
        }
View Full Code Here

Examples of com.webobjects.appserver.WODisplayGroup

    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

Examples of com.webobjects.appserver.WODisplayGroup

 
    public Main(WOContext context) {
        super(context);
        setEditingContext(session().defaultEditingContext());
        entities = EOModelGroup.defaultGroup().models().lastObject().entities();
        displayGroup = new WODisplayGroup();
        setTaskEntity("edit", EOUtilities.entityNamed(editingContext(), "String"));
    }
View Full Code Here

Examples of com.webobjects.appserver.WODisplayGroup

   *
   * @return WODisplayGroup lazily instantiated display group.
   */
  public WODisplayGroup relationshipDisplayGroup() {
    if (_relationshipDisplayGroup == null) {
      _relationshipDisplayGroup = new WODisplayGroup();
      String count = (String)d2wContext().valueForKey("defaultBatchSize");
      if (count != null) {
        int intCount = Integer.parseInt(count);
        _relationshipDisplayGroup.setNumberOfObjectsPerBatch(intCount);
      }
View Full Code Here

Examples of com.webobjects.appserver.WODisplayGroup

    }

    public void setRuleFileName(String value) {
        fileName = value;
        model = new ERD2WRuleEditorModel(new File(fileName));
        group = new WODisplayGroup();
        group.setObjectArray(model.publicRules());
        group.setDefaultStringMatchFormat("*%@*");
    }
View Full Code Here

Examples of com.webobjects.appserver.WODisplayGroup

    }

    public WOComponent listPrinterFriendlyVersion() {
        D2WContext d2wContext = d2wContext();
        WOSession session = session();
        WODisplayGroup displayGroup = displayGroup();
        EODataSource dataSource = dataSource();
        if(dataSource == null) {
          if (displayGroup instanceof ERXBatchingDisplayGroup) {
        ERXBatchingDisplayGroup dg = (ERXBatchingDisplayGroup) displayGroup;
              dataSource = ERXEOControlUtilities.dataSourceForArray(displayGroup.displayedObjects());
      } else {
              dataSource = ERXEOControlUtilities.dataSourceForArray(displayGroup.allObjects());
      }
        }
        D2WContext newContext = ERD2WContext.newContext(session);
        String newTask = d2wContext.task().equals("edit") ? "inspect" : d2wContext.task();
        // for editable list pages...
        if("list".equals(d2wContext().valueForKey("subTask"))) {
            newTask = "list";
        }
        newContext.takeValueForKey(newTask, "task");
        // not using subTask directly here because the cache mechanism relies on
        // being able to compute wether this key
        // is 'computable' (subTask is since a rule can fire to give a default)
        // or an external output
        //        newContext.takeValueForKey("excel","subTask");
        newContext.takeValueForKey("excel", "forcedSubTask");
        newContext.takeValueForKey(d2wContext.valueForKey("pageName"), "existingPageName");
        newContext.takeValueForKey(d2wContext.valueForKey("subTask"), "existingSubTask");
        newContext.takeValueForKey(d2wContext.valueForKey("pageConfiguration"), "pageConfiguration");
        newContext.takeValueForKey(d2wContext.entity(), "entity");
        ListPageInterface result = (ListPageInterface) WOApplication.application().pageWithName((String) newContext.valueForKey("pageName"), session.context());
        ((D2WPage) result).setLocalContext(newContext);

        result.setDataSource(dataSource);
        WODisplayGroup dg = null;
        if (result instanceof D2WListPage) {
            dg = ((D2WListPage) result).displayGroup();
        } else if (result instanceof ERDListPageInterface) {
            dg = ((ERDListPageInterface) result).displayGroup();
        } else {
            dg = (WODisplayGroup) ((WOComponent) result).valueForKey("displayGroup");
        }
        if (dg != null) {
            dg.setSortOrderings(displayGroup.sortOrderings());
            dg.setNumberOfObjectsPerBatch(displayGroup.allObjects().count());
            dg.updateDisplayedObjects();
        }
        return (WOComponent) 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.