Examples of GroovyEngine


Examples of com.CompPad.model.GroovyEngine

    }

    public void testTest() throws Exception{
        System.out.println("testComplex");
        // Parser must refer to a GroovyEngine
        GroovyEngine gEngine = new GroovyEngine();
        Parser.setGroovyEngine(gEngine);

        /* get real and imaginary components */
//        String s = "round(a + b,c)";
        String[] ss = {
View Full Code Here

Examples of com.CompPad.model.GroovyEngine

    }

        public void testFunctionDef() throws Exception{
        System.out.println("testFunctionDef");
        // Parser must refer to a GroovyEngine
        GroovyEngine gEngine = new GroovyEngine();
        Parser.setGroovyEngine(gEngine);
        // define a closure in the groovy shell
        gEngine.evaluate("f = {x,y-> x + y}");
        String ss[] ={
                "z := f(1,2)","z+1",
                "f",
                /* treat function as variable if it is followed by an end of line or a
                 closing parentheses or an operator.  That way it can be
View Full Code Here

Examples of org.projectforge.scripting.GroovyEngine

    data.put("createdLabel", PFUserContext.getLocalizedString("created"));
    data.put("loggedInUser", user);
    data.put("recipient", recipient);
    data.put("msg", composedMessage);
    log.debug("groovyTemplate=" + groovyTemplate);
    final GroovyEngine engine = new GroovyEngine(data, recipient.getLocale(), recipient.getTimeZoneObject());
    final String result = engine.executeTemplateFile(groovyTemplate);
    return result;
  }
View Full Code Here

Examples of org.projectforge.scripting.GroovyEngine

        transformer.setParameter(entry.getKey(), entry.getValue());
      }

      // First run jelly through xmlData:
      result = configXml.getContent(groovyXml);
      final GroovyEngine groovyEngine = new GroovyEngine(data, PFUserContext.getLocale(), PFUserContext.getTimeZone());
      final String groovyXmlInput = groovyEngine.preprocessGroovyXml((String) result[0]);
      final String xmlData = groovyEngine.executeTemplate(groovyXmlInput);

      // Setup input for XSLT transformation
      final StringReader xmlDataReader = new StringReader(xmlData);
      final Source src = new StreamSource(xmlDataReader);
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.