19 package org.turro.script;
21 import java.io.IOException;
22 import org.turro.action.Contacts;
23 import org.turro.elephant.context.Application;
24 import org.turro.elephant.context.ElephantContext;
25 import org.turro.entities.Entities;
26 import org.turro.entities.IElephantEntity;
27 import org.turro.file.Document;
28 import org.turro.plugin.contacts.IContact;
29 import org.turro.reflection.Instances;
37 public static boolean eval(String value) {
42 return evalFor(contact,
null, value);
45 public static boolean evalFor(Object entity, String value) {
64 script.addVariable(
"user", contact);
76 if(script.startsWith(
"file:")) {
86 return Document.from(file).content();
87 }
catch (IOException ex) {
93 Script script =
new Script();
96 iScript.addFunctions(script);
static IContact getUser()
static String getRealPath(String path)
static IElephantEntity getController(String path)
static String realScript(String script)
static final String SCRIPT_FOLDER
static boolean evalFor(IContact contact, Object entity, String value)
static boolean eval(IContact contact, String value)
static boolean evalFor(Object entity, String value)
static boolean evalFor(IContact contact, IElephantEntity iee, String value)
static String scriptContent(String scriptName)
static boolean eval(String value)
static boolean evalFor(IElephantEntity iee, String value)