Package com.webobjects.directtoweb

Examples of com.webobjects.directtoweb.D2WContext


        ((EditPageInterface)result).setObject(object());
        return result;
    }

    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) {
View Full Code Here


    // FIXME switch to using a localized template
    @Override
    public String headerString() {
      if (_headerString == null) {
          if (object() != null) {
              D2WContext tempContext = new D2WContext();
              tempContext.setEntity(EOUtilities.entityNamed(object().editingContext(),object().entityName()));
              tempContext.setPropertyKey(key());
              tempContext.setTask("editRelationship");
              String key = (String)tempContext.valueForKey(Keys.displayKeyForEntity);
          if (key.equals("entity.name")) {
            _headerString = localizedValueForDisplayNameOfKeyPath(key, object());
          } else {
            _headerString = (String)object().valueForKeyPath(key);
          }
View Full Code Here

        }
        return result;
    }
   
    public WOComponent createNew(WOComponent sender) {
        D2WContext context = d2wContext(sender);
        String pageName = (String)context.valueForKey("createConfigurationName");
        InspectPageInterface epi = Factory.bugTracker().editPageForNewObjectWithConfigurationNamed(pageName, session(sender));
        return (WOComponent) epi;
    }
View Full Code Here

        return (WOComponent) epi;
    }

    public WOComponent view(WOComponent sender) {
        EOEnterpriseObject eo = object(sender);
        D2WContext context = d2wContext(sender);
        String pageName = (String)context.valueForKey("inspectConfigurationName");
        InspectPageInterface epi = Factory.bugTracker().inspectPageNamed(pageName, eo);
        return (WOComponent) epi;
    }
View Full Code Here

        return (WOComponent) epi;
    }

    public WOComponent delete(WOComponent sender) {
        EOEnterpriseObject eo = object(sender);
        D2WContext context = d2wContext(sender);
        String pageName = (String)context.valueForKey("confirmDeleteConfigurationName");
        ERD2WMessagePage epi = (ERD2WMessagePage) Factory.bugTracker().pageForConfigurationNamed(pageName, session(sender));
        epi.setObject(eo);
        String message = ERXLocalizer.currentLocalizer().localizedTemplateStringForKeyWithObject("ERDTrashcan.confirmDeletionMessage", epi.d2wContext());
        epi.setMessage(message);
        epi.setCancelPage(sender.context().page());
View Full Code Here

        return epi;
    }

    public WOComponent edit(WOComponent sender) {
        EOEnterpriseObject eo = object(sender);
        D2WContext context = d2wContext(sender);
        String pageName = (String)context.valueForKey("editConfigurationName");
        InspectPageInterface epi = Factory.bugTracker().editPageNamed(pageName, eo);
        return (WOComponent) epi;
    }
View Full Code Here

   * Gives each property its own d2wContext rather than sharing one
   * Necessary for ajax or dyanmic D2W
   */
  @Override
  public void setPropertyKey(String propertyKey) {
    _subContext = new D2WContext(d2wContext());
    _subContext.takeValueForKey(propertyKey, "propertyKey");
  }
View Full Code Here

   * Gives each property its own d2wContext rather than sharing one
   * Necessary for ajax or dyanmic D2W
   */
  @Override
  public void setPropertyKey(String propertyKey) {
    _subContext = new D2WContext(d2wContext());
    _subContext.takeValueForKey(propertyKey, "propertyKey");
  }
View Full Code Here

TOP

Related Classes of com.webobjects.directtoweb.D2WContext

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.