Changeset 3512
- Timestamp:
- 02/28/08 23:32:42 (10 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
openmrs-modules/groovy/build.xml
r2886 r3512 3 3 <!-- ** Basic Module ** --> 4 4 <!-- ** ** --> 5 <!-- ** @version 1. 0** -->5 <!-- ** @version 1.1 ** --> 6 6 <!-- ********************************************************* --> 7 7 <project name="Groovy" default="package-module"> 8 9 <property name="compile.target" value="1.5" /> 10 <echo message="Java compile target (javac -target): ${compile.target}" /> 8 11 9 12 <!-- *********************************************************** --> … … 53 56 54 57 <!-- Compile module java files --> 55 <javac destdir="build" classpathref="classpath" debug="true" debuglevel="lines,source" target=" 1.5">58 <javac destdir="build" classpathref="classpath" debug="true" debuglevel="lines,source" target="${compile.target}"> 56 59 <src path="src/" /> 57 60 <include name="**/*.java" /> … … 59 62 60 63 <!-- Compile module web java files --> 61 <javac destdir="build" classpathref="classpath" debug="true" debuglevel="lines,source" target=" 1.5">64 <javac destdir="build" classpathref="classpath" debug="true" debuglevel="lines,source" target="${compile.target}"> 62 65 <compilerarg line="-g" /> 63 66 <src path="web/src/" /> openmrs-modules/groovy/src/org/openmrs/module/groovy/GroovyActivator.java
r2872 r3512 63 63 binding.setVariable("order", Context.getOrderService()); 64 64 binding.setVariable("patient", Context.getPatientService()); 65 binding.setVariable("patientSet", Context.getPatientSetService()); 65 66 binding.setVariable("person", Context.getPersonService()); 66 67 binding.setVariable("program", Context.getProgramWorkflowService()); openmrs-modules/groovy/web/src/org/openmrs/module/groovy/web/DWRGroovyService.java
r2877 r3512 1 1 package org.openmrs.module.groovy.web; 2 3 import java.io.PrintWriter; 4 import java.io.StringWriter; 5 import java.io.Writer; 2 6 3 7 import org.openmrs.module.ModuleFactory; … … 9 13 10 14 public String eval(String script) { 15 16 Object result = null; 11 17 12 18 getGMA().clearBuffer(); 13 19 try { 14 Object value= getGMA().getShell().evaluate(script);20 result = getGMA().getShell().evaluate(script); 15 21 } catch (Exception e) { 16 return "Exception: " + e.getMessage(); 22 final Writer trace = new StringWriter(); 23 final PrintWriter printWriter = new PrintWriter(trace); 24 e.printStackTrace(printWriter); 25 return "Exception: <b>" + e.getMessage() + "</b><br>" + trace.toString(); 17 26 } 18 return getGMA().getBuffer(); 27 28 String output = getGMA().getBuffer(); 29 if (output != null && output.length() > 0) 30 return output; 31 else 32 return (result == null ? "" : result.toString()); 19 33 } 20 34