Package org.projectforge.scripting

Examples of org.projectforge.scripting.GroovyResult


      return;
    }
    amount = BigDecimal.ZERO;
    final Map<String, Object> vars = new HashMap<String, Object>();
    BusinessAssessment.putBusinessAssessmentRows(vars, businessAssessment);
    final GroovyResult result = new GroovyExecutor().execute(groovyScript, vars);
    final Object rval = result.getResult();
    if (rval instanceof BigDecimal) {
      amount = (BigDecimal)rval;
    } else if (rval instanceof Number) {
      amount = new BigDecimal(String.valueOf(rval)).setScale(getScale(), RoundingMode.HALF_UP);
    }
View Full Code Here


    initScriptVariables();
    scriptVariables.put("reportStorage", getReportStorage());
    scriptVariables.put("reportScriptingStorage", getReportScriptingStorage());
    scriptVariables.put("reportList", reportGeneratorList);
    if (StringUtils.isNotBlank(getReportScriptingStorage().getGroovyScript()) == true) {
      groovyResult = groovyExecutor.execute(new GroovyResult(), getReportScriptingStorage().getGroovyScript(), scriptVariables);
      if (groovyResult.hasException() == true) {
        form.error(getLocalizedMessage("exception.groovyError", String.valueOf(groovyResult.getException())));
        return;
      }
      if (groovyResult.hasResult() == true) {
View Full Code Here

         * @see org.apache.wicket.model.Model#getObject()
         */
        @Override
        public String getObject()
        {
          final GroovyResult groovyResult = parentPage.groovyResult;
          final StringBuffer buf = new StringBuffer();
          buf.append(groovyResult.getResultAsHtmlString());
          if (groovyResult.getResult() != null && StringUtils.isNotEmpty(groovyResult.getOutput()) == true) {
            buf.append("<br/>\n");
            buf.append(HtmlHelper.escapeXml(groovyResult.getOutput()));
          }
          return buf.toString();
        }
      }) {
        /**
         * @see org.apache.wicket.Component#isVisible()
         */
        @Override
        public boolean isVisible()
        {
          final GroovyResult groovyResult = parentPage.groovyResult;
          return (groovyResult != null && groovyResult.hasResult() == true);
        }
      };
      groovyResultPanel.getLabel().setEscapeModelStrings(false);
      fs.add(groovyResultPanel);
    }
View Full Code Here

TOP

Related Classes of org.projectforge.scripting.GroovyResult

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.