ch.elexis.data
Class Script
java.lang.Object
ch.elexis.data.PersistentObject
ch.elexis.data.NamedBlob2
ch.elexis.data.Script
- All Implemented Interfaces:
- IPersistentObject, ISelectable
public class Script
- extends NamedBlob2
A script. At this moment only beanshell is supported as interpreter, but others are possible
Fields inherited from class ch.elexis.data.PersistentObject |
CACHE_DEFAULT_LIFETIME, CACHE_MIN_LIFETIME, CFG_CONNECTSTRING, CFG_DRIVER, CFG_FOLDED_CONNECTION, CFG_PWD, CFG_TYPE, CFG_USER, DATE_COMPOUND, default_lifetime, DELETED, EXISTS, FLD_DATE, FLD_DELETED, FLD_EXTINFO, FLD_LASTUPDATE, INEXISTENT, INVALID_ID, log, MAPPING_ERROR_MARKER, MATCH_AUTO, MATCH_CONTAINS, MATCH_EXACT, MATCH_REGEXP, MATCH_START |
Constructor Summary |
protected |
Script()
|
protected |
Script(java.lang.String id)
|
Methods inherited from class ch.elexis.data.PersistentObject |
addChangeListener, addMapping, addSticker, addToList, addXid, begin, checkNull, checkZero, checkZeroDouble, clearCache, connect, connect, create, createOrModifyTable, delete, deleteList, disconnect, equals, executeScript, executeSQLScript, exists, exportData, flatten, fold, get, get, getBinary, getCacheTime, getConnection, getConstraint, getDefaultCacheLifetime, getExportFields, getExportUIDValue, getExportUIDVersion, getFieldType, getId, getInt, getLastUpdate, getList, getList, getMap, getSticker, getStickers, getVersionedResource, getWrappedId, getXid, getXid, getXids, hashCode, isAvailable, isDeleted, isMatching, isMatching, isMatching, isMatching, lock, map, removeChangeListener, removeFromList, removeFromList, removeSticker, removeTable, resetCache, set, set, setBinary, setConstraint, setDefaultCacheLifetime, setInt, setMap, setTrace, setVersionedResource, state, storeToString, tableExists, ts, undelete, unlock |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
INTERPRETER_BEANSHELL
public static final java.lang.String INTERPRETER_BEANSHELL
- See Also:
- Constant Field Values
INTERPRETER_SCALA
public static final java.lang.String INTERPRETER_SCALA
- See Also:
- Constant Field Values
INTERPRETER_DEFAULT
public static final java.lang.String INTERPRETER_DEFAULT
- See Also:
- Constant Field Values
SCRIPT_MARKER
public static final java.lang.String SCRIPT_MARKER
- See Also:
- Constant Field Values
Script
protected Script(java.lang.String id)
Script
protected Script()
create
public static Script create(java.lang.String name,
java.lang.String contents)
throws ElexisException
- Throws:
ElexisException
getLabel
public java.lang.String getLabel()
- Description copied from class:
PersistentObject
- Einen menschenlesbaren Identifikationsstring für dieses Objet liefern
- Specified by:
getLabel
in interface IPersistentObject
- Overrides:
getLabel
in class NamedBlob2
init
public void init()
throws ElexisException
- Throws:
ElexisException
finished
public void finished()
throws ElexisException
- Throws:
ElexisException
setVariable
public void setVariable(java.lang.String name,
java.lang.Object value)
throws ElexisException
- Throws:
ElexisException
execute
public static java.lang.Object execute(Interpreter scripter,
java.lang.String script,
java.lang.String params,
PersistentObject... objects)
throws ElexisException
- execute a script entered as string with the given interpreter
- Parameters:
objects
- optional Objects to replace in Variables like [Fall.Grund] in the scriptparams
- optional parameters. These can be of the form name=value or value.
if no name is given, the variables will be inserted for $1, $2 ... in the script.
If a name is given, $names in the script will be replaced with the respective
values.
- Returns:
- The result of the script interpreter
- Throws:
ElexisException
execute
public java.lang.Object execute(java.lang.String params,
PersistentObject... objects)
throws ElexisException
- Throws:
ElexisException
getScripts
public static java.util.List<Script> getScripts()
executeScript
public static java.lang.Object executeScript(java.lang.String call,
PersistentObject... objects)
throws ElexisException
- Execute a script that is part of the call
- Parameters:
call
- e.g. scriptname(a="foo",b="bar")objects
- some Objects to cinvert in the script
- Returns:
- the result of the interpreter
- Throws:
ElexisException
- if no such scruiopt was found or an error occurred
isDragOK
public boolean isDragOK()
- Description copied from class:
PersistentObject
- Darf dieses Objekt mit Drag&Drop verschoben werden?
- Specified by:
isDragOK
in interface IPersistentObject
- Overrides:
isDragOK
in class PersistentObject
- Returns:
- true wenn ja.
isValid
public boolean isValid()
- Description copied from class:
PersistentObject
- Angeben, ob dieses Objekt gültig ist.
- Specified by:
isValid
in interface IPersistentObject
- Overrides:
isValid
in class PersistentObject
- Returns:
- true wenn die Daten gültig (nicht notwendigerweise korrekt) sind
load
public static Script load(java.lang.String id)
getInterpreterFor
public static Interpreter getInterpreterFor(java.lang.String script)
throws ElexisException
- Throws:
ElexisException
importFromFile
public static Script importFromFile(java.lang.String filepath)
throws ElexisException
- Throws:
ElexisException