public interface Context
| Modifier and Type | Method and Description |
|---|---|
void |
addwarning(java.lang.String msg)
Adds a custom WebTML warning
|
void |
addwarning(java.lang.String msg,
boolean severe)
Adds a custom WebTML warning
|
void |
addwarning(java.lang.String msg,
boolean severe,
java.lang.Throwable cause)
Adds a custom WebTML warning
|
void |
appendvar(java.lang.String name,
java.lang.Object value)
Appends a value to a WebTML variable as list element
|
de.innovationgate.webgate.api.WGContent |
content()
Provides the WGAPI object "WGContent" which represents the current content document in context
|
java.lang.String |
contenturl()
Returns a URL to the content document in context
|
java.lang.String |
contenturl(java.lang.String mediaKey,
java.lang.String layoutKey)
Returns a URL to the content document in context
|
java.lang.String |
contenturl(java.lang.String mediaKey,
java.lang.String layoutKey,
boolean ignoreVirtualLink)
Returns a URL to the content document in context
|
Context |
context(java.lang.String expression)
Creates a TMLContext object for a different content document.
|
Context |
context(java.lang.String expression,
boolean returnContextOnError)
Creates a TMLContext object for a different content document.
|
Context |
context(de.innovationgate.webgate.api.WGContent content)
Takes a content document in form of the WGAPI object "WGContent" and constructs a TMLContext object that has it in context.
|
PortletEvent |
createevent(java.lang.String name)
Creates a new PortletEvent object
|
de.innovationgate.webgate.api.WGDatabase |
db()
Returns a WGAPI database object for the database of the current context
|
java.lang.String |
fileurl(java.lang.String fileName)
Creates a URL pointing to a file attachment on the current context document
|
java.lang.String |
fileurl(java.lang.String containerName,
java.lang.String fileName)
Creates a URL pointing to a file attachment on a content document or file container in the context database
|
java.lang.String |
fileurl(java.lang.String dbKey,
java.lang.String containerName,
java.lang.String fileName)
Creates a URL pointing to a file attachment on a content document or file container
|
javax.servlet.http.HttpSession |
gethttpsession()
Returns the JavaEE object representing the current HTTP browser session
|
java.lang.String |
getlasterror()
Returns the error message of the last failed context expression that was done from this context object
|
org.apache.log4j.Logger |
getlog()
Provides an object for logging output to the application log
|
java.lang.String |
getpath()
Returns an absolute context path to the current context document
|
Portlet |
getportlet()
Returns a portlet object for the current WebTML portlet
|
UserProfile |
getprofile()
Returns the users personalisation profile as profile object
|
javax.servlet.http.HttpServletRequest |
getrequest()
Returns the JavaEE object representing the current HTTP browser request
|
javax.servlet.http.HttpServletResponse |
getresponse()
Returns the JavaEE object representing the current HTTP server response
|
java.lang.Object |
getsessionvar(java.lang.String name)
Retrieves a WebTML session variable
|
Form |
gettmlform()
Returns the TMLForm object representing the current WebTML form
|
java.lang.Object |
getvar(java.lang.String name)
Retrieves a normal WebTML variable
|
boolean |
haschildren()
Returns if the current context document has child documents
|
boolean |
hasgroup(java.lang.String group)
Tests if the user is member of the specified group
|
boolean |
haslabel(java.lang.String key)
Tests if a label is available for the given key that can be served to the user
Uses either the default label container/file or the one determined for the current WebTML range.
|
boolean |
haslabel(java.lang.String fileName,
java.lang.String key)
Tests if a label is available for the given key that can be served to the user
Uses either the default label container "labels_language" or the one determined for the current WebTML range.
|
boolean |
haslabel(java.lang.String containerName,
java.lang.String fileName,
java.lang.String key)
Tests if a label is available for the given key that can be served to the user
|
boolean |
hasoption(java.lang.String option)
Tests if an WebTML option of the given name is defined
|
boolean |
hasprofile()
Returns if the user currently has a user profile
|
boolean |
hasrole(java.lang.String role)
Tests if the user has the given user role
|
boolean |
hassiblings()
Returns if the current context document has sibling documents
|
de.innovationgate.webgate.api.WGHierarchicalDatabase |
hdb()
Returns a WGAPI HDB object for the application in context
|
boolean |
isanonymous()
Tests if the current user is anonymous
|
boolean |
isbrowserinterface()
Returns true if the WebTML page is rendered in some kind of OpenWGA authoring client like the OpenWGA Content Manager
|
boolean |
isdefined(java.lang.String name)
Tests if a name is defined as WebTML variable or item on the context document
|
boolean |
isempty(java.lang.String itemName)
Returns if the given WebTML variable or item is regarded "empty".
|
boolean |
isemptyvalue(java.lang.Object value)
Returns if the given value is regarded "empty"
Empty means being either nonexistent, null, empty/whitespace-only string, an empty list or a string with a single HTML linebreak
|
boolean |
isfilled(java.lang.String attValue)
Returns if the contents of an item or WebTML variable is regarded as "filled", meaning it is not empty like defined on
isempty(String). |
boolean |
isfirstloop()
Tests if a tag
|
boolean |
isfirstloop(java.lang.String tagId)
Tests if a tag
|
boolean |
ishomepage() |
boolean |
islastloop()
Tests if a tag
|
boolean |
islastloop(java.lang.String tagId)
Tests if a tag
|
boolean |
ismaindocument()
Returns if the document in context is the main document of the request
|
boolean |
isnewsession()
Returns if the current request is the first request in a new browser session
|
boolean |
isroot()
Returns if the current context document is a root document
|
boolean |
isselected()
Returns if the current document is the main document of the current request or an ancestor document of it
|
boolean |
isselected(Context mainContext)
Returns if the current document is either the document of the given main context or an ancestor document of it
|
boolean |
istagidvalid(java.lang.String tagid)
Tests if a WebTML tag with the given id is available
|
boolean |
istrue(java.lang.String varname)
Returns if the contents of an item or WebTML variable is regarded "true".
|
boolean |
iswebenvironment()
Returns if the current TMLScript code is executed in the context of a WebTML request
|
java.lang.Object |
item(java.lang.String name)
Returns the value of an item or a WebTML variable as single value.
|
java.util.List<java.lang.Object> |
itemlist(java.lang.String name)
Returns the value of an item or WebTML variable as list value
|
java.lang.String |
label(java.lang.String key)
Returns a WebTML label in a language that the current user should understand.
|
java.lang.String |
label(java.lang.String key,
java.util.List<java.lang.String> params)
Returns a WebTML label in a language that the current user should understand.
|
java.lang.String |
label(java.lang.String fileName,
java.lang.String key)
Returns a WebTML label in a language that the current user should understand.
|
java.lang.String |
label(java.lang.String fileName,
java.lang.String key,
java.util.List<java.lang.String> params)
Returns a WebTML label in a language that the current user should understand.
|
java.lang.String |
label(java.lang.String containerName,
java.lang.String fileName,
java.lang.String key)
Returns a WebTML label in a language that the current user should understand.
|
java.lang.String |
label(java.lang.String containerName,
java.lang.String fileName,
java.lang.String key,
java.util.List<java.lang.String> params)
Returns a WebTML label in a language that the current user should understand.
|
java.lang.String |
label(java.lang.String containerName,
java.lang.String fileName,
java.lang.String key,
java.util.List<java.lang.String> params,
boolean usePlaceholder)
Returns a WebTML label in a language that the current user should understand.
|
java.lang.String |
label(de.innovationgate.webgate.api.WGDatabase designDB,
java.lang.String containerName,
java.lang.String fileName,
java.lang.String key,
java.util.List<java.lang.String> params)
Returns a WebTML label in a language that the current user should understand.
|
java.lang.String |
label(de.innovationgate.webgate.api.WGDatabase designDB,
java.lang.String containerName,
java.lang.String fileName,
java.lang.String key,
java.util.List<java.lang.String> params,
boolean usePlaceholder)
Returns a WebTML label in a language that the current user should understand.
|
java.lang.Object |
meta(java.lang.String name)
Returns the value of a metadata field of type "content" as single value.
|
java.lang.Object |
meta(java.lang.String type,
java.lang.String name)
Returns the value of a metadata field as single value.
|
java.util.List<java.lang.Object> |
metalist(java.lang.String name)
Returns the value of a metadata field of type "content" as list value.
|
java.util.List<java.lang.Object> |
metalist(java.lang.String type,
java.lang.String name)
Returns the value of a metadata field as list value.
|
java.lang.Object |
option(java.lang.String option)
Retrieves the value of a WebTML option.
|
java.lang.Object |
option(java.lang.String option,
java.lang.Object defaultValue)
Retrieves the value of a WebTML option.
|
Portlet |
portletbypath(java.lang.String path)
Retrieves a portlet by a portlet path expression
|
void |
removesessionvar(java.lang.String name)
Removes a WebTML session variable
|
void |
removetmlform(java.lang.String formid)
Removes the form of the given ID from form registry
|
void |
removevar(java.lang.String name)
Removes a (normal) WebTML variable
|
void |
setoption(java.lang.String name,
java.lang.Object value)
Sets a WebTML option
|
void |
setoption(java.lang.String name,
java.lang.Object value,
java.lang.String scope)
Sets a WebTML option
|
void |
setsessionvar(java.lang.String name,
java.lang.Object value)
Sets or updates a WebTML session variable.
|
void |
setsessionvar(java.lang.String name,
java.lang.Object value,
boolean allowSerialisation)
Sets or updates a WebTML session variable.
|
void |
setvar(java.lang.String name,
java.lang.Object value)
Creates or updates a (normal) WebTML variable
|
java.lang.Object |
taginfo(java.lang.String tagId,
java.lang.String name)
Retrieves a WebTML tag information
|
Form |
tmlformbyid(java.lang.String id)
Returns a TMLForm object representing the WebTML form of the given ID
|
void addwarning(java.lang.String msg)
msg - Message of the warningvoid addwarning(java.lang.String msg,
boolean severe)
msg - Message of the warningsevere - Flag that marks the warning as "severe". Severe warnings will cancel the execution of the current functionality and wil be displayed with a different icon in void addwarning(java.lang.String msg,
boolean severe,
java.lang.Throwable cause)
msg - Message of the warningsevere - Flag that marks the warning as "severe". Severe warnings will cancel the execution of the current functionality and wil be displayed with a different icon in cause - A Java exception that caused the warning. It's stack trace will be put out to the log, if warnings logging is enabledvoid appendvar(java.lang.String name,
java.lang.Object value)
throws de.innovationgate.webgate.api.WGAPIException
name - Name of a WebTML variablevalue - Value to append as list element to the variablede.innovationgate.webgate.api.WGAPIExceptionde.innovationgate.webgate.api.WGContent content()
java.lang.String contenturl()
throws de.innovationgate.webgate.api.WGException
de.innovationgate.webgate.api.WGExceptionjava.lang.String contenturl(java.lang.String mediaKey,
java.lang.String layoutKey)
throws de.innovationgate.webgate.api.WGException
mediaKey - Mediakey of the WebTML module that should be used as outer layout for the document. Specify null to render it with its content types layouts.layoutKey - Name of the WebTML module that should be used as outer layout for the document. Specify null to render it with its content types layouts.de.innovationgate.webgate.api.WGExceptionjava.lang.String contenturl(java.lang.String mediaKey,
java.lang.String layoutKey,
boolean ignoreVirtualLink)
throws de.innovationgate.webgate.api.WGException
mediaKey - Mediakey of the WebTML module that should be used as outer layout for the document. Specify null to render it with its content types layouts.layoutKey - Name of the WebTML module that should be used as outer layout for the document. Specify null to render it with its content types layouts.ignoreVirtualLink - If true and the context document is virtual this method returns a normal URL to the virtual document instead of the virtual target URL.de.innovationgate.webgate.api.WGExceptionContext context(java.lang.String expression)
expression - An OpenWGA context expression. Syntax is identical to that of WebTML attribute contextContext context(java.lang.String expression, boolean returnContextOnError)
expression - An OpenWGA context expression. Syntax is identical to that of WebTML attribute contextreturnContextOnError - Determines if on context change error the original context is to be returned. If false this method returns null on a failed context change.Context context(de.innovationgate.webgate.api.WGContent content) throws de.innovationgate.webgate.api.WGAPIException
content - The WGAPI content objectde.innovationgate.webgate.api.WGAPIExceptionPortletEvent createevent(java.lang.String name)
name - Name of the portlet event. All event receivers subscribing to this name will receive it when it is thrown.de.innovationgate.webgate.api.WGDatabase db()
java.lang.String fileurl(java.lang.String fileName)
throws java.io.UnsupportedEncodingException,
de.innovationgate.webgate.api.WGException
fileName - Name of the file attachment on file container or content document. If the file is a ZIP archive you can address files inside it by specifying the path in the ZIP file after the name, divided by slashes.java.io.UnsupportedEncodingExceptionde.innovationgate.webgate.api.WGExceptionjava.lang.String fileurl(java.lang.String containerName,
java.lang.String fileName)
throws de.innovationgate.webgate.api.WGException
containerName - Name of a file container or key of a content documentfileName - Name of the file attachment on file container or content document. If the file is a ZIP archive you can address files inside it by specifying the path in the ZIP file after the name, divided by slashes.de.innovationgate.webgate.api.WGExceptionjava.lang.String fileurl(java.lang.String dbKey,
java.lang.String containerName,
java.lang.String fileName)
throws de.innovationgate.webgate.api.WGException
dbKey - Database key of the database whose file is to be served.containerName - Name of a file container or key of a content documentfileName - Name of the file attachment on file container or content document. If the file is a ZIP archive you can address files inside it by specifying the path in the ZIP file after the name, divided by slashes.de.innovationgate.webgate.api.WGExceptionjavax.servlet.http.HttpSession gethttpsession()
java.lang.String getlasterror()
org.apache.log4j.Logger getlog()
java.lang.String getpath()
throws de.innovationgate.webgate.api.WGAPIException
de.innovationgate.webgate.api.WGAPIExceptionPortlet getportlet() throws de.innovationgate.webgate.api.WGAPIException
de.innovationgate.webgate.api.WGAPIExceptionUserProfile getprofile()
javax.servlet.http.HttpServletRequest getrequest()
javax.servlet.http.HttpServletResponse getresponse()
java.lang.Object getsessionvar(java.lang.String name)
Form gettmlform()
java.lang.Object getvar(java.lang.String name)
throws de.innovationgate.webgate.api.WGAPIException
de.innovationgate.webgate.api.WGAPIExceptionboolean haschildren()
throws de.innovationgate.webgate.api.WGAPIException
de.innovationgate.webgate.api.WGAPIExceptionboolean hasgroup(java.lang.String group)
throws de.innovationgate.webgate.api.WGAPIException
de.innovationgate.webgate.api.WGAPIExceptionboolean haslabel(java.lang.String key)
key - The label keyboolean haslabel(java.lang.String fileName,
java.lang.String key)
fileName - Label file holding label definitions. Omit the suffix ".properties".key - The label keyboolean haslabel(java.lang.String containerName,
java.lang.String fileName,
java.lang.String key)
containerName - Label container base name. Omit the language suffix.fileName - Label file holding label definitions. Omit the suffix ".properties".key - The label keyboolean hasoption(java.lang.String option)
boolean hasprofile()
boolean hasrole(java.lang.String role)
throws de.innovationgate.webgate.api.WGAPIException
de.innovationgate.webgate.api.WGAPIExceptionboolean hassiblings()
throws de.innovationgate.webgate.api.WGAPIException
de.innovationgate.webgate.api.WGAPIExceptionde.innovationgate.webgate.api.WGHierarchicalDatabase hdb()
throws de.innovationgate.webgate.api.WGException
de.innovationgate.webgate.api.WGExceptionboolean isanonymous()
throws de.innovationgate.webgate.api.WGAPIException
de.innovationgate.webgate.api.WGAPIExceptionboolean isbrowserinterface()
boolean isdefined(java.lang.String name)
throws de.innovationgate.webgate.api.WGAPIException
name - Name of WebTML variable or itemde.innovationgate.webgate.api.WGAPIExceptionboolean isempty(java.lang.String itemName)
throws de.innovationgate.webgate.api.WGAPIException
itemName - Name of a WebTML variable or itemde.innovationgate.webgate.api.WGAPIExceptionboolean isemptyvalue(java.lang.Object value)
value - Value to testboolean isfilled(java.lang.String attValue)
throws de.innovationgate.webgate.api.WGAPIException
isempty(String).
This method returns always true when in authoring mode for a document.attValue - The name of the item or WebTML variablede.innovationgate.webgate.api.WGAPIExceptionboolean isfirstloop()
boolean isfirstloop(java.lang.String tagId)
tagId - id of the foreach tagboolean islastloop()
boolean islastloop(java.lang.String tagId)
tagId - id of the foreach tagboolean ismaindocument()
throws de.innovationgate.webgate.api.WGAPIException
de.innovationgate.webgate.api.WGAPIExceptionboolean isnewsession()
boolean isroot()
throws de.innovationgate.webgate.api.WGAPIException
de.innovationgate.webgate.api.WGAPIExceptionboolean isselected()
throws de.innovationgate.webgate.api.WGAPIException
de.innovationgate.webgate.api.WGAPIExceptionboolean isselected(Context mainContext) throws de.innovationgate.webgate.api.WGAPIException
de.innovationgate.webgate.api.WGAPIExceptionboolean istagidvalid(java.lang.String tagid)
tagid - boolean istrue(java.lang.String varname)
throws de.innovationgate.webgate.api.WGAPIException
varname - The name of the item or WebTML variablede.innovationgate.webgate.api.WGAPIExceptionboolean iswebenvironment()
java.lang.Object item(java.lang.String name)
throws de.innovationgate.webgate.api.WGAPIException
name - Name of the item or WebTML variablede.innovationgate.webgate.api.WGAPIExceptionjava.util.List<java.lang.Object> itemlist(java.lang.String name)
throws de.innovationgate.webgate.api.WGAPIException
name - Name of the item or WebTML variablede.innovationgate.webgate.api.WGAPIExceptionjava.lang.String label(java.lang.String key)
key - The label keyjava.lang.String label(java.lang.String key,
java.util.List<java.lang.String> params)
key - The label keyparams - Label parameters that are injected into the label textjava.lang.String label(java.lang.String fileName,
java.lang.String key)
fileName - Label file holding label definitions. Omit the suffix ".properties".key - The label keyjava.lang.String label(java.lang.String fileName,
java.lang.String key,
java.util.List<java.lang.String> params)
fileName - Label file holding label definitions. Omit the suffix ".properties".key - The label keyparams - Label parameters that are injected into the label textjava.lang.String label(java.lang.String containerName,
java.lang.String fileName,
java.lang.String key)
containerName - Label container base name. Omit the language suffix.fileName - Label file holding label definitions. Omit the suffix ".properties".key - The label keyjava.lang.String label(java.lang.String containerName,
java.lang.String fileName,
java.lang.String key,
java.util.List<java.lang.String> params)
containerName - Label container base name. Omit the language suffix.fileName - Label file holding label definitions. Omit the suffix ".properties".key - The label keyparams - Label parameters that are injected into the label textjava.lang.String label(java.lang.String containerName,
java.lang.String fileName,
java.lang.String key,
java.util.List<java.lang.String> params,
boolean usePlaceholder)
containerName - Label container base name. Omit the language suffix.fileName - Label file holding label definitions. Omit the suffix ".properties".key - The label keyparams - Label parameters that are injected into the label textusePlaceholder - Specify true to return a label placeholder in case the label does not exist. Specify false to return null in that case.java.lang.String label(de.innovationgate.webgate.api.WGDatabase designDB,
java.lang.String containerName,
java.lang.String fileName,
java.lang.String key,
java.util.List<java.lang.String> params)
throws de.innovationgate.webgate.api.WGException
designDB - The WGAPI database object of the app from which to load labelscontainerName - Label container base name. Omit the language suffix.fileName - Label file holding label definitions. Omit the suffix ".properties".key - The label keyparams - Label parameters that are injected into the label textde.innovationgate.webgate.api.WGExceptionjava.lang.String label(de.innovationgate.webgate.api.WGDatabase designDB,
java.lang.String containerName,
java.lang.String fileName,
java.lang.String key,
java.util.List<java.lang.String> params,
boolean usePlaceholder)
throws de.innovationgate.webgate.api.WGException
designDB - The WGAPI database object of the app from which to load labelscontainerName - Label container base name. Omit the language suffix.fileName - Label file holding label definitions. Omit the suffix ".properties".key - The label keyparams - Label parameters that are injected into the label textusePlaceholder - Specify true to return a label placeholder in case the label does not exist. Specify false to return null in that case.de.innovationgate.webgate.api.WGExceptionjava.lang.Object meta(java.lang.String name)
throws de.innovationgate.webgate.api.WGAPIException
name - The name of the metadata fieldde.innovationgate.webgate.api.WGAPIExceptionjava.lang.Object meta(java.lang.String type,
java.lang.String name)
throws de.innovationgate.webgate.api.WGAPIException
type - The type of metadata fieldname - The name of the metadata fieldde.innovationgate.webgate.api.WGAPIExceptionjava.util.List<java.lang.Object> metalist(java.lang.String name)
throws de.innovationgate.webgate.api.WGAPIException
name - The name of the metadata fieldde.innovationgate.webgate.api.WGAPIExceptionjava.util.List<java.lang.Object> metalist(java.lang.String type,
java.lang.String name)
throws de.innovationgate.webgate.api.WGAPIException
type - The type of metadata fieldname - The name of the metadata fieldde.innovationgate.webgate.api.WGAPIExceptionjava.lang.Object option(java.lang.String option)
option - Name of the optionjava.lang.Object option(java.lang.String option,
java.lang.Object defaultValue)
option - Name of the optiondefaultValue - A value to return if the option does not existPortlet portletbypath(java.lang.String path) throws de.innovationgate.webgate.api.WGException
path - The portlet pathde.innovationgate.webgate.api.WGExceptionvoid removesessionvar(java.lang.String name)
name - Name of the variablevoid removetmlform(java.lang.String formid)
formid - Id of the formvoid removevar(java.lang.String name)
throws de.innovationgate.webgate.api.WGAPIException
name - Name of the variablede.innovationgate.webgate.api.WGAPIExceptionvoid setoption(java.lang.String name,
java.lang.Object value)
name - Name of the optionvalue - Value of the optionvoid setoption(java.lang.String name,
java.lang.Object value,
java.lang.String scope)
name - Name of the optionvalue - Value of the optionscope - Scope of the option. Use strings "global" or "local".void setsessionvar(java.lang.String name,
java.lang.Object value)
name - Name of the variablevalue - Value of the variablevoid setsessionvar(java.lang.String name,
java.lang.Object value,
boolean allowSerialisation)
name - Name of the variablevalue - Value of the variableallowSerialisation - Determines if the variable value can be serialized and therefor transported to other nodes in a clustervoid setvar(java.lang.String name,
java.lang.Object value)
throws de.innovationgate.webgate.api.WGAPIException
name - Name of the variablevalue - Value of the variablede.innovationgate.webgate.api.WGAPIExceptionjava.lang.Object taginfo(java.lang.String tagId,
java.lang.String name)
throws de.innovationgate.webgate.api.WGAPIException
tagId - id of the tag to retrieve the info fromname - Nmae of the info fieldde.innovationgate.webgate.api.WGAPIExceptionForm tmlformbyid(java.lang.String id)
id - id of the formboolean ishomepage()