public interface ResourceFacade
For accessing resources by location string (http://, jar://, component://, content://, classpath://, etc).
Type Params | Return Type | Name and description |
---|---|---|
|
public boolean |
condition(java.lang.String expression, java.lang.String debugLocation) Evaluate a Groovy expression as a condition. |
|
public boolean |
condition(java.lang.String expression, java.lang.String debugLocation, java.util.Map additionalContext) |
|
public java.lang.String |
expand(java.lang.String inputString, java.lang.String debugLocation) Evaluate a Groovy expression as a GString to be expanded/interpolated into a simple String. |
|
public java.lang.String |
expand(java.lang.String inputString, java.lang.String debugLocation, java.util.Map additionalContext) |
|
public java.lang.String |
expand(java.lang.String inputString, java.lang.String debugLocation, java.util.Map additionalContext, boolean localize) |
|
public java.lang.String |
expandNoL10n(java.lang.String inputString, java.lang.String debugLocation) |
|
public java.lang.Object |
expression(java.lang.String expr, java.lang.String debugLocation) Evaluate a Groovy expression as a context field, or more generally as an expression that evaluates to an Object reference. |
|
public java.lang.Object |
expression(java.lang.String expr, java.lang.String debugLocation, java.util.Map additionalContext) |
|
public java.lang.String |
getContentType(java.lang.String filename) |
|
public javax.activation.DataSource |
getLocationDataSource(java.lang.String location) |
|
public ResourceReference |
getLocationReference(java.lang.String location) Get a ResourceReference representing the Moqui location string passed. |
|
public java.io.InputStream |
getLocationStream(java.lang.String location) Open an InputStream to read the contents of a file/document at a location. |
|
public java.lang.String |
getLocationText(java.lang.String location, boolean cache) Get the text at the given location, optionally from the cache (resource.text.location). |
|
public ResourceReference |
getUriReference(java.net.URI uri) |
|
public java.lang.Object |
script(java.lang.String location, java.lang.String method) Run a script at the given location (optionally with the given method, like in a groovy class) using the current context for its variable space. |
|
public java.lang.Object |
script(java.lang.String location, java.lang.String method, java.util.Map additionalContext) |
|
public void |
template(java.lang.String location, java.io.Writer writer) Render a template at the given location using the current context and write the output to the given writer. |
|
public void |
template(java.lang.String location, java.io.Writer writer, java.lang.String defaultExtension) |
|
public java.lang.String |
template(java.lang.String location, java.lang.String defaultExtension) |
|
public java.lang.Integer |
xslFoTransform(javax.xml.transform.stream.StreamSource xslFoSrc, javax.xml.transform.stream.StreamSource xsltSrc, java.io.OutputStream out, java.lang.String contentType) |
Evaluate a Groovy expression as a condition.
Evaluate a Groovy expression as a GString to be expanded/interpolated into a simple String. NOTE: the inputString is always run through the L10nFacade.localize() method before evaluating the expression in order to implicitly internationalize string expansion.
Evaluate a Groovy expression as a context field, or more generally as an expression that evaluates to an Object reference. This can be used to get a value from an expression or to run any general expression or script.
Get a ResourceReference representing the Moqui location string passed.
location
- A URL-style location string. In addition to the standard URL protocols (http, https, ftp, jar,
and file) can also have the special Moqui protocols of "component://" for a resource location relative to a
component base location, "content://" for a resource in the content repository, and "classpath://" to get a
resource from the Java classpath.Open an InputStream to read the contents of a file/document at a location.
location
- A URL-style location string that also support the Moqui-specific component and content protocols.Get the text at the given location, optionally from the cache (resource.text.location).
Run a script at the given location (optionally with the given method, like in a groovy class) using the current context for its variable space.
Render a template at the given location using the current context and write the output to the given writer.