Package com.composum.sling.core.script
Class GroovyRunner
- java.lang.Object
-
- com.composum.sling.core.script.GroovyRunner
-
public class GroovyRunner extends Object
Created by rw on 06.10.15.
-
-
Field Summary
Fields Modifier and Type Field Description protected org.osgi.framework.BundleContext
bundleContext
static String
DEFAULT_SETUP_SCRIPT
static String
ENCODING
protected Map<String,Object>
generalBindings
static String
JAVA_RESOURCE_BASE
protected PrintWriter
out
protected javax.jcr.query.QueryManager
queryManager
protected org.apache.sling.api.resource.ResourceResolver
resourceResolver
protected org.apache.sling.api.resource.ResourceResolverFactory
resourceResolverFactory
protected javax.jcr.Session
session
protected String
setupScript
protected javax.jcr.Workspace
workspace
-
Constructor Summary
Constructors Constructor Description GroovyRunner(javax.jcr.Session session, PrintWriter out)
GroovyRunner(javax.jcr.Session session, PrintWriter out, String setupScript)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
extendBinding(groovy.lang.Binding binding, Object variables)
protected void
extendBinding(groovy.lang.Script script, Object variables)
protected org.osgi.framework.BundleContext
getBundleContext()
protected javax.jcr.query.QueryManager
getQueryManager(javax.jcr.Workspace workspace)
protected org.apache.sling.api.resource.ResourceResolver
getResolver()
protected org.apache.sling.api.resource.ResourceResolverFactory
getResourceResolverFactory()
protected groovy.lang.Script
getScript(Reader scriptReader, Map<String,Object> variables, String name)
protected Reader
getScriptResource(String path)
Object
run(Reader scriptReader, Map<String,Object> variables)
Object
run(Reader scriptReader, Map<String,Object> variables, String name)
Object
run(String path, Map<String,Object> variables)
protected Object
setup(groovy.lang.Script script)
-
-
-
Field Detail
-
DEFAULT_SETUP_SCRIPT
public static final String DEFAULT_SETUP_SCRIPT
- See Also:
- Constant Field Values
-
JAVA_RESOURCE_BASE
public static final String JAVA_RESOURCE_BASE
- See Also:
- Constant Field Values
-
ENCODING
public static final String ENCODING
- See Also:
- Constant Field Values
-
bundleContext
protected org.osgi.framework.BundleContext bundleContext
-
resourceResolverFactory
protected org.apache.sling.api.resource.ResourceResolverFactory resourceResolverFactory
-
resourceResolver
protected org.apache.sling.api.resource.ResourceResolver resourceResolver
-
session
protected javax.jcr.Session session
-
workspace
protected javax.jcr.Workspace workspace
-
queryManager
protected javax.jcr.query.QueryManager queryManager
-
out
protected PrintWriter out
-
setupScript
protected String setupScript
-
-
Constructor Detail
-
GroovyRunner
public GroovyRunner(javax.jcr.Session session, PrintWriter out)
-
GroovyRunner
public GroovyRunner(javax.jcr.Session session, PrintWriter out, String setupScript)
-
-
Method Detail
-
run
public Object run(String path, Map<String,Object> variables) throws InterruptedException
- Throws:
InterruptedException
-
run
public Object run(Reader scriptReader, Map<String,Object> variables) throws InterruptedException
- Throws:
InterruptedException
-
run
public Object run(Reader scriptReader, Map<String,Object> variables, String name) throws InterruptedException
- Throws:
InterruptedException
-
getScript
protected groovy.lang.Script getScript(Reader scriptReader, Map<String,Object> variables, String name)
-
extendBinding
protected void extendBinding(groovy.lang.Script script, Object variables)
-
extendBinding
protected void extendBinding(groovy.lang.Binding binding, Object variables)
-
setup
protected Object setup(groovy.lang.Script script)
-
getBundleContext
protected org.osgi.framework.BundleContext getBundleContext()
-
getResourceResolverFactory
protected org.apache.sling.api.resource.ResourceResolverFactory getResourceResolverFactory()
-
getResolver
protected org.apache.sling.api.resource.ResourceResolver getResolver()
-
getQueryManager
protected javax.jcr.query.QueryManager getQueryManager(javax.jcr.Workspace workspace)
-
-