Esempio n. 1
0
  public WOComponent componentToEmail() {
    System.out.println("ReportListWrapper.componentToEmail()");
    WOComponent comp = null;
    if (isList() == true) {
      comp = (WOComponent) pageWithName("ItemList");
      comp.takeValueForKey(displayGroup, "itemDisplayGroup");
      ((ItemList) comp)
          .displayAll(); // no batching in emails  - how to return it to original setting?
      ((ItemList) comp)
          .setEmailFlag(
              true); // set a flag for emails to hide any content that does not display properly
      ((ItemList) comp).setCommentsFlag(commentsFlag);
      ((ItemList) comp).setReleaseFlag(releaseFlag);

    } else if (isReport() == true) {
      comp = (ReportGenerator) pageWithName("ReportGenerator");
      // ((ReportGenerator)comp).setNeedUpdate(true);
      comp.takeValueForKey(aColumn, "selectedColumn");
      comp.takeValueForKey(aRow, "selectedRow");
      comp.takeValueForKey(displayGroup, "displayGroup");
      ((ReportGenerator) comp).setHideReportSpecifier(true);
      ((ReportGenerator) comp).setHideGraphLink(true);
    }

    /*
          else if(isEstimate() == true) {
              comp = (WOComponent)pageWithName("EstimateActual");
              comp.takeValueForKey(displayGroup, "displayGroup");
              ((EstimateActual)comp).setIsSelected(false);
              ((EstimateActual)comp).setShowLinks(false);
          }
    */
    return (WOComponent) comp;
  }
  @Override
  public WOActionResults performAction() {
    log.debug("The result of the task was " + _result);
    if (_nextPage != null && _nextPageResultKey != null) {
      if (_result instanceof EOGlobalID) {

        // Inflate it to a fault
        EOEditingContext ec = ERXEC.newEditingContext();
        // Let's ensure fresh ec since we are likely coming out of a background task
        ec.setFetchTimestamp(System.currentTimeMillis());

        _result = ec.faultForGlobalID((EOGlobalID) _result, ec);
      }
      _nextPage.takeValueForKey(_result, _nextPageResultKey);
    }

    if (_nextPage != null && _nextPageValues != null) {
      for (String key : nextPageValues().allKeys()) {
        Object value = nextPageValues().valueForKey(key);
        _nextPage.takeValueForKey(value, key);
      }
    }

    if (_nextPage != null && _nextPage instanceof IERXRefreshPage) {
      ((IERXRefreshPage) _nextPage).refresh();
    }

    return _nextPage;
  }
Esempio n. 3
0
 public WOActionResults activateAccountInvitationAction() {
   LOG.info("activateAccountInvitationAction: ");
   WOComponent nextPage = pageWithName(ActivateAccountInvitation.class);
   nextPage.takeValueForKey(request().formValueForKey("key"), "invitationKey");
   nextPage.takeValueForKey(request().formValueForKey("email"), "email");
   return nextPage;
 }
Esempio n. 4
0
 public WOComponent create() {
   //		searchMessage = null;
   //		canCreate = false;
   selection = null;
   setValueForBinding(selection, "selection");
   PersonLink onEdit = Person.Utility.create(ec, entity(), searchString);
   WOComponent returnPage = context().page();
   WOComponent popup = null;
   //		try {
   //			popup = pageWithName("PersonInspector");
   //		} catch (Exception e) {
   popup = pageWithName("SelectorPopup");
   //		}
   if (returnPage instanceof SelectorPopup) {
     SelectorPopup sp = (SelectorPopup) returnPage;
     popup.takeValueForKey(sp.returnPage, "returnPage");
     popup.takeValueForKey(sp.resultPath, "resultPath");
     popup.takeValueForKey(sp.resultGetter, "resultGetter");
     popup.reset();
   } else {
     popup.takeValueForKey(returnPage, "returnPage");
   }
   if (popup instanceof SelectorPopup) {
     NSDictionary dict =
         (NSDictionary) session().valueForKeyPath("strings.RujelBase_Base.newPerson");
     popup.takeValueForKey(onEdit.person(), "value");
     popup.takeValueForKey(dict, "dict");
     //		} else {
     //			popup.takeValueForKey(onEdit, "personLink");
   }
   return popup;
 }
  /**
   * Method to return the result page when the computation is complete. This methods sets the result
   * page, passes all of the computation information, and then returns the page.
   */
  @Override
  public WOComponent pageForResult(Object result) {

    WOComponent resultPage = pageWithName("ResultPage");
    resultPage.takeValueForKey(start, "start");
    resultPage.takeValueForKey(stop, "stop");
    resultPage.takeValueForKey(result, "result");
    return resultPage;
  }
Esempio n. 6
0
  public WOComponent emailCurrentPage() {
    // System.out.println("ReportListWrapper.emailCurrentPage()");

    WOComponent nextPage = (WOComponent) pageWithName("EmailPage");

    nextPage.takeValueForKey(componentToEmail(), "componentToEmail");
    nextPage.takeValueForKey(context().page(), "nextPage");

    return nextPage;
  }
Esempio n. 7
0
 public WOActionResults editor() {
   WOComponent editor = pageWithName("ERXQualifierEditor");
   if (selectedRule() != null) editor.takeValueForKey(selectedRule().lhs(), "qualifier");
   return editor;
 }
Esempio n. 8
0
  public WOActionResults export() {
    sys.setDataDict(extraData, base);
    sys.setIndexes(indexes, base);
    if (ec.hasChanges()) {
      try {
        ec.saveChanges();
      } catch (Exception e) {
        session().takeValueForKey(e.getMessage(), "message");
        returnPage.ensureAwakeInContext(context());
        return returnPage;
      }
    }
    NSMutableDictionary reportDict = new NSMutableDictionary();
    reportDict.takeValueForKey(plist, "reporter");
    reportDict.takeValueForKey(section, "section");
    reportDict.takeValueForKey(ec, "ec");
    reportDict.takeValueForKey(indexes, "indexes");
    reportDict.takeValueForKey("ImportExport", "reportDir");
    reportDict.takeValueForKey(session().valueForKey("today"), "today");

    NSMutableDictionary info =
        new NSMutableDictionary(
            MyUtility.presentEduYear((Integer) session().valueForKey("eduYear")), "eduYear");
    info.takeValueForKey(extraData, "extraData");
    NSArray indList = (NSArray) plist.valueForKey("indexes");
    if (indList != null && indList.count() > 0) {
      for (int i = 0; i < indList.count(); i++) {
        NSDictionary ind = (NSDictionary) indList.objectAtIndex(i);
        if (Various.boolForObject(ind.valueForKey("inOptions"))) {
          String indName = (String) ind.valueForKey("name");
          info.takeValueForKey(indexes.valueForKey(indName), indName);
        }
      }
    }
    reportDict.takeValueForKey(info, "info");
    if (returnPage instanceof ImportExport) returnPage.takeValueForKey(plist, "reporter");
    Progress progress = (Progress) pageWithName("Progress");
    progress.returnPage = returnPage;
    progress.resultPath = (String) plist.valueForKey("resultPath");
    if (progress.resultPath == null) progress.resultPath = "result";
    progress.title = (String) plist.valueForKey("title");
    progress.state = XMLGenerator.backgroundGenerate(reportDict);
    return progress.refresh();
    /*
    byte[] result = null;
    try {
    	result = XMLGenerator.generate(session(), (NSMutableDictionary)reportDict);
    } catch (Exception e) {
    	result = WOLogFormatter.formatTrowable(e).getBytes();
    }
    WOResponse response = application().createResponseInContext(context());
    response.setContent(result);
    String contentType = (String)plist.valueForKey("ContentType");
    if(contentType == null)
    	contentType = "application/octet-stream";
    response.setHeader(contentType,"Content-Type");
    StringBuilder buf = new StringBuilder("attachment; filename=\"");
    buf.append("filename");
    contentType = (String)plist.valueForKey("filext");
    if(contentType != null) {
    	if(contentType.charAt(0) != '.')
    		buf.append('.');
    	buf.append(contentType);
    }
    buf.append('"');
    response.setHeader(buf.toString(),"Content-Disposition");
    return response; */
  }