public class WGA
extends java.lang.Object
get()
when running on behalf of a WebTML/TMLScript environment
get(Context)
when a WebTML context object is available
get(JobContext)
in OpenWGA Java Jobs
get(HttpServletRequest, HttpServletResponse, ServletContext)
or get(ServletContext)
in Servlet Filters
get(WGACore)
in other core functionalities
UnavailableResourceException
.Modifier and Type | Method and Description |
---|---|
WGARequestInformation |
accessLogging()
Returns the request information object for the current WebTML request to modify access logging data
|
java.lang.String |
alias(java.lang.String str,
java.util.List<java.lang.String> aliases)
Returns an alias for a string value from a list of WebTML aliases.
|
java.lang.String |
alias(java.lang.String str,
java.lang.String aliasesStr)
Returns an alias for a string value from a WebTML aliases string
The aliases string given as parameter is expected to consist of a comma-separated list of elements of value plus corresponding alias, divided by a pipe symbol: alias|value,alias|value,alias|value ...
|
App |
app()
Returns an application object for the current environment
This will only work in WebTML/TMLScript environments and returns the object of the main context app.
|
App |
app(Context cx)
Returns an application object for the WebTML context
This will only work if the context database represents an OpenWGA application.
|
App |
app(java.lang.String dbKey)
Returns an application object for the database of the given key
This will only work if the database represents an OpenWGA application.
|
App |
app(de.innovationgate.webgate.api.WGDatabase db)
Returns an application object for the given database
This will only work if the database represents an OpenWGA application.
|
Auth |
auth()
Deprecated.
Instead use
Domain.auth() to get a domain specific authentication object. |
java.util.List<java.lang.String> |
buildOptions(java.lang.Iterable<de.innovationgate.webgate.api.WGContent> contents,
java.lang.String titleExpr,
java.lang.String emptyTitle)
Builds options for WebTML form inputs from a list of contents
Use this method to build the options of WebTML form inputs whose choices are based on content documents.
|
Call |
call()
Returns an object providing information about the call that inited the current runtime environment, if available.
|
java.lang.Object |
callAction(Context context,
java.lang.String actionID,
java.util.List<java.lang.Object> actionArgs,
DesignResourceReference baseReference,
GlobalExpressionScope globalScope)
Calls a WebTML action
This can be used to call WebTML actions that are defined in any allowed way, including master and async actions.
|
java.lang.Object |
callAction(java.lang.String actionID,
java.util.List<java.lang.Object> actionArgs,
DesignResourceReference baseReference,
GlobalExpressionScope globalScope)
Calls a WebTML action
This can be used to call WebTML actions that are defined in any allowed way, including master and async actions.
|
Context |
context(java.lang.String expression) |
Context |
context(java.lang.String expression,
boolean returnContextOnError) |
Context |
context(de.innovationgate.webgate.api.WGContent content) |
java.util.Calendar |
createCalendar()
Creates a Java Calendar object offering diverse functionality to modify date values
This method is provided for TMLScript.
|
java.util.Calendar |
createCalendar(java.util.Date date)
Creates a Java Calendar object offering diverse functionality to modify date values
This method is provided for TMLScript.
|
javax.servlet.http.Cookie |
createCookie(java.lang.String name,
java.lang.String value)
Creates a browser cookie object that can be added to the users browser session
This method is provided for TMLScript.
|
java.util.Date |
createDate(boolean includeMillis)
Creates a new
Date object for the current time. |
Form |
createForm(FormInfo formInfo)
Creates a new TMLForm object as configured by a FormInfo object.
|
FormInfo |
createFormInfo(java.lang.String id,
boolean htmlInput,
boolean persistent)
Creates a new FormInfo object
Objects of this type define settings for creating TMLForm objects from Java and TMLScript.
|
org.apache.commons.httpclient.HttpClient |
createHttpClient()
Creates an object to do custom HTTP requests
The returned object is an instance of the Jakarta Commons HTTP Client, a Java class providing extensive functionality to perform HTTP requests.
|
de.innovationgate.utils.ImageScaler |
createImageScaler(java.io.File file)
Creates an ImageScaler object to perform scaling operations on an image file.
|
de.innovationgate.utils.ImageScaler |
createImageScaler(java.io.InputStream in)
Creates an ImageScaler object to perform scaling operations on an image provided by an input stream
ImageScaler objects are capable of scaling images to custom sizes.
|
java.util.List<java.lang.Object> |
createList()
Creates a list object.
|
java.util.List<java.lang.Object> |
createList(java.lang.Object[] array)
Creates a list object from an array..
|
java.util.List<java.lang.String> |
createList(java.lang.String collection,
java.lang.String delimiter)
Creates an list object from a collection string with delimiter.
|
java.util.Map<java.lang.Object,java.lang.Object> |
createLookupTable()
Creates a map, known to TMLScript as "lookup table"
This method is provided for TMLScript.
|
java.util.Map<java.lang.Object,java.lang.Object> |
createLookupTable(java.util.Map<java.lang.Object,java.lang.Object> map)
Creates a map, known to TMLScript as "lookup table", initializing it with the given maps entries
This method is provided for TMLScript.
|
SmtpMail |
createMail()
Creates a Mail object for sending e-mails.
|
SmtpMail |
createMail(java.lang.String smtpHost,
java.lang.String username,
java.lang.String password)
Creates a Mail object for sending e-mails.
|
Context |
createTMLContext(de.innovationgate.webgate.api.WGContent content)
Creates an WebTML context object for the given content
If a WebTML environment is available this context will belong to this environment.
|
Context |
createTMLContext(de.innovationgate.webgate.api.WGContent content,
Design design)
Creates an WebTML context object for the given content
If a WebTML environment is available this context will belong to this environment.
|
Context |
createTMLContext(de.innovationgate.webgate.api.WGDatabase db)
Creates an WebTML context object for the given database
The context will be on a dummy document of the given database.
|
Context |
createTMLContext(de.innovationgate.webgate.api.WGDatabase db,
Design design)
Creates an WebTML context object for the given database
The context will be on a dummy document of the given database.
|
Context |
createTMLContext(de.innovationgate.webgate.api.WGDatabase db,
de.innovationgate.webgate.api.WGLanguageChooser chooser)
Creates an WebTML context object for the given database, using the given language chooser
The context will be on a dummy document of the given database.
|
Context |
createTMLContext(de.innovationgate.webgate.api.WGDatabase db,
de.innovationgate.webgate.api.WGLanguageChooser chooser,
Design design)
Creates an WebTML context object for the given database, using the given language chooser
The context will be on a dummy document of the given database.
|
Database |
database()
Returns a database object for the current environment.
|
Database |
database(Context cx)
Returns a database object for the WebTML context
This either returns an
App or DataSource object, depending on the database type |
Database |
database(java.lang.String dbKey)
Returns a database object for the database of the given key
This either returns an
App or DataSource object, depending on the database type |
Database |
database(de.innovationgate.webgate.api.WGDatabase db)
Returns a database object for the given database
This either returns an
App or DataSource object, depending on the database type |
DataSource |
dataSource()
Returns a data source object for the current environment
This will only work in WebTML/TMLScript environments and returns the object of the main context data source.
|
DataSource |
dataSource(Context cx)
Returns a data source object for the WebTML context
This will only work if the context database represents an OpenWGA data source.
|
DataSource |
dataSource(java.lang.String dbKey)
Returns an application object for the database of the given key
This will only work if the database represents an OpenWGA application.
|
DataSource |
dataSource(de.innovationgate.webgate.api.WGDatabase db)
Returns a data source object for the given database
This will only work if the database represents an OpenWGA data source.
|
java.util.Date |
dateOnly(java.util.Date date)
Removes all daytime information from a date
This method returns a new date which represents the date give but has hour, minute, second and millisecond information set to 0.
|
de.innovationgate.webgate.api.WGDatabase |
db(java.lang.String dbKey)
Returns the WGAPI database object for the given database key
When accessing a database that has not yet been accessed in this request OpenWGA will try to login the user to this database, using whatever login information is available on the session.
|
de.innovationgate.webgate.api.WGDatabase |
db(java.lang.String dbKey,
boolean open)
Returns the WGAPI database object for the given database key
When accessing a database that has not yet been accessed in this request and parameter "open" is true then OpenWGA will try to login the user to this database, using whatever login information is available on the session.
|
java.util.List<java.lang.Object> |
deleteDoublets(java.util.List<java.lang.Object> lObj)
Removes multiple equal entries from a list.
|
java.lang.Object |
deserializeObject(java.lang.String encrypted)
Converts a string created by
serializeObject(Object) back to the original object. |
Design |
design()
Returns a design context object for the current environment
This will only work in WebTML/TMLScript environments and returns the design of the main context app.
|
Design |
design(Design otherDesign)
Returns a design context resembling the given design for the current WGA context
|
Design |
design(DesignResourceReference ref)
Returns a design context object for the given design resource reference
|
Design |
design(java.lang.String dbKey)
Returns a design context object for the database of the given key
This will only work if the database represents an OpenWGA application.
|
Design |
design(TMLDesignContext designContext)
Returns a design context object for the given WebTML design context
The parameter object is an object of the WebTML implementation.
|
Design |
design(de.innovationgate.webgate.api.WGDatabase db)
Returns a design context object for the given database
This will only work if the database represents an OpenWGA application.
|
Domain |
domain(java.lang.String name)
Returns a domain object for the domain of the given name
|
java.lang.String |
encode(java.lang.String encoding,
java.lang.Object obj)
Encodes some text with a WebTML encoding
This is the server API pendant of WebTML attribute encode.
|
java.lang.String |
encode(java.lang.String encoding,
java.lang.Object obj,
TMLContext ctx) |
java.lang.String |
format(java.lang.Object toBeFormatted,
java.lang.String formatString)
reates a formatted date string from a
Date object or a formatted number string from a Number object |
java.lang.String |
format(java.lang.Object toBeFormatted,
java.lang.String formatString,
java.lang.String language)
reates a formatted date string from a
Date object or a formatted number string from a Number object |
static WGA |
get()
Retrieves an WGA instance trying to use the current threads main WebTML context for an environment
Note however that the context used may not be the most specific context of your threads stack.
|
static WGA |
get(Context context)
Returns a WGA instance using the given TMLContext object for a context.
|
static WGA |
get(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
javax.servlet.http.HttpSession session,
WGACore core)
Returns a WGA instance using the given JavaEE objects for a context, for use in HTTP servlet requests.
|
static WGA |
get(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
javax.servlet.ServletContext servletContext)
Returns a WGA instance using the given JavaEE objects for a context, for use in HTTP servlet requests.
|
static WGA |
get(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
WGACore core)
Returns a WGA instance using the given JavaEE objects for a context, for use in HTTP servlet requests.
|
static WGA |
get(javax.servlet.http.HttpSession session)
Returns a WGA instance for an HTTP session
|
static WGA |
get(JobContext jobContext)
Returns a WGA instance using the given
JobContext for a context, for use within WGA job tasks
The instance provided may have no WebTML/TMLScript/Request specific functionalities available. |
static WGA |
get(JspHelper jspHelper)
Returns a WGA instanceof using the given
JspHelper as context |
static WGA |
get(javax.servlet.ServletContext servletContext)
Returns a WGA instance using the given servlet context for a context.
|
static WGA |
get(javax.websocket.Session wsSession)
Returns a WGA instance for an independent WebSocket session
|
static WGA |
get(javax.websocket.Session wsSession,
javax.servlet.http.HttpSession httpSession)
Returns a WGA instance for an WebSocket session attached to a HTTP session
|
static WGA |
get(TMLContextEnvironment env) |
static WGA |
get(WGAContext context)
Returns a WGA instance using the given
WGAContext object for a context. |
static WGA |
get(WGACore core)
Returns a WGA instance using the given
WGACore object for a context. |
WGACore |
getCore()
Returns the WGACore object in context
|
java.text.DateFormat |
getDateFormat(java.lang.String pattern,
java.util.Locale locale)
Returns an OpenWGA date format
|
org.apache.log4j.Logger |
getLog()
Returns a logging facility appropriate for the current WGA environment
|
java.text.NumberFormat |
getNumberFormat(java.lang.String pattern,
java.util.Locale locale)
Returns an OpenWGA number format
|
javax.servlet.http.HttpServletRequest |
getRequest()
Returns the Java object for the HTTP servlet request of the environment
Will only work if the environment runs on behalf of a request
|
java.lang.String |
getRequestURL()
Returns the URL by which this request was called
This is the original URL which was used to call the current WebTML request.
|
javax.servlet.http.HttpServletResponse |
getResponse()
Returns the Java object for the HTTP servlet response of the environment
Will only work if the environment runs on behalf of a request
|
de.innovationgate.webgate.api.WGHierarchicalDatabase |
hdb(java.lang.String dbKey)
Returns a WGAPI HDB object for an application
The HDB database object is a tool to use a OpenWGA content store as a simple hierarchical database for data storage.
|
Html |
html()
Returns a subobject "Html" which collects functionalities to load and parse Html documents.
|
<T> T |
instantiateService(java.lang.Class<?> implementationClass)
Instantiates a specific service API implementation
|
<T> T |
instantiateService(de.innovationgate.wga.modules.ModuleDefinition implDef)
Instantiates a specific service API implementation
|
boolean |
isIsolated()
Returns if this WGA object is isolated, i.e. does not provide direct access to environment-dependent
resources like calls or sessions.
|
WGA |
isolate()
Returns an isolated version of this WGA instance, which is prevented from accessing any optional environment data.
|
boolean |
isRequestAvailable()
Returns if the environment runs on behalf of a request and a request object is available
|
boolean |
isResponseAvailable()
Returns if the environment runs on behalf of a request and a response object is available
|
boolean |
isTMLContextAvailable()
Returns if a WebTML/TMLScript environment is available
|
Jobs |
jobs()
Returns a subobject "Jobs" providing services regarding OpenWGA Jobs
|
Lucene |
lucene(Context context)
Returns a Lucene object providing functionalities related to fulltext search
|
java.util.Date |
modifyDate(java.util.Date date,
java.lang.String unit,
int amount)
Modifies a date by adding/substracting a certain timespan
This is a utility method for simple modifications to dates without the use of
Calendar objects. it returns a new Date object which represents the date of the parameter "date" plus/minus a given timespan. |
WGA |
narrow()
In TMLScript creates a narrowed down version of the WGA object with fixed environment
|
Nav |
nav()
Returns a Nav object for the current WebTML context
|
Nav |
nav(Context context)
Returns a Nav Object for the given WebTML context
|
Nav |
nav(java.lang.String expression) |
boolean |
openDatabase(de.innovationgate.webgate.api.WGDatabase db)
Opens an WGAPI database object with the credentials available in the current environment.
|
java.util.Date |
parseDate(java.lang.String date,
java.lang.String format)
Converts a string containing date/time information to a
Date object
This method parses the given string based on a custom date format and return it as date object. |
java.util.Date |
parseDate(java.lang.String date,
java.lang.String format,
java.lang.String language)
Converts a string containing date/time information to a
Date object
This method parses the given string based on a custom date format and return it as date object. |
java.lang.Number |
parseNumber(java.lang.String number,
java.lang.String format)
Converts a string containing numeric information into a Number object
This method parses the given string based on a custom number format and return it as
Number object. |
java.lang.Number |
parseNumber(java.lang.String number,
java.lang.String format,
java.lang.String language)
Converts a string containing numeric information into a Number object
This method parses the given string based on a custom number format and return it as
Number object. |
Plugin |
plugin() |
Plugin |
plugin(java.lang.String uniqueName)
Returns a Plugin object for any OpenWGA plugin of the given unique nam.
|
Plugin |
plugin(de.innovationgate.webgate.api.WGDatabase db)
Returns a Plugin object for the WGAPI database object.
|
void |
redirectTo(java.lang.String url)
Redirects the users browser to a different URL
This method is only valid in WebTML environments and is only effective on a request if no content has yet been sent back to the browser.
|
void |
reopenSessions()
Reopens all currently open database sessions
|
java.lang.String |
scoped(java.lang.String str)
Qualifies the given text with the current WebTML scope
This is the WGA Server API pendant to the dynamic WebTML attribute function "{scoped:text}".
|
java.lang.String |
scoped(java.lang.String str,
java.lang.String scope)
Qualifies the given text with either a given or the current WebTML scope
This is the WGA Server API pendant to the dynamic WebTML attribute function "{scoped:text}".
|
de.innovationgate.webgate.api.WGFileDerivateMetaData |
selectDerivate(Context cx,
java.lang.String fileName,
java.lang.String derivateQueryStr)
Selects a file derivate of a file attachment which is the best match for a derivate query
|
de.innovationgate.webgate.api.WGFileDerivateMetaData |
selectDerivate(java.lang.String fileName,
java.lang.String derivateQuery)
Selects a file derivate of a file attachment which is the best match for a derivate query.
|
java.lang.String |
serializeObject(java.lang.Object obj)
Serializes an object to an encrypted string
The resulting string is a representation of the given object as string which is compressed as well as encrypted.
|
Server |
server()
Returns a subobject "Server" providing information and services regarding the OpenWGA server runtime and installation
|
<T> T |
service(java.lang.Class<T> serviceClass)
Returns a service implementation for the given service API class/interface
|
java.util.List<java.lang.Class<?>> |
serviceClasses()
Returns classes and interfaces of service APIs currently registered for this WGA runtime
|
Session |
session()
Returns an object providing information about the current HTTP user session, if available.
|
java.util.List<java.lang.Object> |
sortList(java.lang.Object listObj,
java.lang.Object comparatorObj,
int sortDir)
Sorts a List, either by a
Comparator or, if the list contains WGDocument instances, by one or more metadata fields. |
java.util.Date |
timeOnly(java.util.Date date)
Removes all day information from a date
This method returns a new date which represents the date give but has day, month and day information set to 0.
|
Context |
tmlcontext()
Returns the WebTML context of the environment
Will only work in those environments that run on behalf of WebTML functionalties, like WebTML elements etc.
|
TMLPage |
tmlPage()
Returns a subobject "TMLPage" providing operations regarding the current output of WebTML page
|
TMLScript |
tmlscript()
Returns a subobject "TMLScript" for executing TMLScript expressions
|
java.util.List<java.lang.Object> |
toList(java.lang.Object... values)
Converts any value(s) into list form
This method does the same list conversion known from itemList() or metaList() in TMLScript on the given values.
|
URLBuilder |
urlBuilder()
Creates a WGAPI URLBuilder object to contruct and modify URLs, using the current request URL
|
URLBuilder |
urlBuilder(Context context)
Creates a WGAPI URLBuilder object to contruct and modify URLs, using the current request URL
|
URLBuilder |
urlBuilder(Context context,
java.lang.String urlStr)
Creates a WGAPI URLBuilder object to contruct and modify URLs
|
URLBuilder |
urlBuilder(java.lang.String urlStr)
Creates a WGAPI URLBuilder object to contruct and modify URLs.
|
Validate |
validate()
Returns a subobject "Validate" offering comfortable functions to validate data in common ways, prominently in WebTML form validations.
|
Xml |
xml()
Returns a subobject "Xml" which collects functionalities to load and parse Xml documents.
|
public static WGA get() throws de.innovationgate.webgate.api.WGException
java.lang.IllegalStateException
de.innovationgate.webgate.api.WGException
public static WGA get(WGAContext context)
WGAContext
object for a context.
The service provided depends on the context known by the WGAContext object.context
- A WGA context objectpublic static WGA get(TMLContextEnvironment env)
public static WGA get(Context context)
context
- A TMLContext objectpublic static WGA get(javax.servlet.ServletContext servletContext)
servletContext
- The servlet contextpublic static WGA get(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, javax.servlet.ServletContext servletContext)
request
- A HTTP request objectresponse
- A HTTP response objectservletContext
- A servlet context objectpublic static WGA get(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, WGACore core)
request
- A HTTP request objectresponse
- A HTTP response objectcore
- The internal OpenWGA core objectpublic static WGA get(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, javax.servlet.http.HttpSession session, WGACore core)
request
- A HTTP request objectresponse
- A HTTP response objectsession
- A HTTP session objectcore
- The internal OpenWGA core objectpublic static WGA get(JobContext jobContext)
JobContext
for a context, for use within WGA job tasks
The instance provided may have no WebTML/TMLScript/Request specific functionalities available.jobContext
- A job contextpublic static WGA get(WGACore core)
WGACore
object for a context.
The instance provided may have no WebTML/TMLScript/Request specific functionalities available.core
- WGA core objectpublic static WGA get(JspHelper jspHelper)
JspHelper
as contextjspHelper
- public static WGA get(javax.websocket.Session wsSession)
wsSession
- The sessionpublic static WGA get(javax.servlet.http.HttpSession session)
wsSession
- The sessionpublic static WGA get(javax.websocket.Session wsSession, javax.servlet.http.HttpSession httpSession)
wsSession
- The sessionpublic WGACore getCore()
public java.lang.String format(java.lang.Object toBeFormatted, java.lang.String formatString, java.lang.String language) throws de.innovationgate.webgate.api.WGException
Date
object or a formatted number string from a Number
objecttoBeFormatted
- Either a Date
or a Number
formatString
- The format pattern, just like known from SimpleDateFormat
or DecimalFormat
language
- A language string determining the language for language dependent formattingsUnavailableResourceException
de.innovationgate.webgate.api.WGException
public java.lang.String format(java.lang.Object toBeFormatted, java.lang.String formatString) throws de.innovationgate.webgate.api.WGException
Date
object or a formatted number string from a Number
objecttoBeFormatted
- Either a Date
or a Number
formatString
- The format pattern, just like known from SimpleDateFormat
or DecimalFormat
UnavailableResourceException
de.innovationgate.webgate.api.WGException
public java.util.List<java.lang.Object> sortList(java.lang.Object listObj, java.lang.Object comparatorObj, int sortDir) throws de.innovationgate.webgate.api.WGException
Comparator
or, if the list contains WGDocument
instances, by one or more metadata fields.
The sorting is done in place, i.e. the given list object is sorted.listObj
- The list to be sortedcomparatorObj
- Comparator object, either a List
of metadata names, or a String
containing a metadata name, or a Comparator
sortDir
- Sort direction, either "up" or "down".UnavailableResourceException
de.innovationgate.webgate.api.WGException
public java.util.List<java.lang.Object> deleteDoublets(java.util.List<java.lang.Object> lObj)
Set
s can be used for the same thing.lObj
- The listpublic java.lang.Object callAction(Context context, java.lang.String actionID, java.util.List<java.lang.Object> actionArgs, DesignResourceReference baseReference, GlobalExpressionScope globalScope) throws de.innovationgate.webgate.api.WGException
context
- TMLContext ot execute the action on. Specify null to use one from WGA object context.actionID
- ID of the action to call. This may be the ID of a actionArgs
- Parameters for the action, available as "tmlparam1" (index 0) to "tmlparam5" (index 4)baseReference
- The base reference from which to resolve the action id.globalScope
- The global expression scope under which to execute the action. Specify null to have none.WGAServerException
de.innovationgate.webgate.api.WGException
public java.lang.Object callAction(java.lang.String actionID, java.util.List<java.lang.Object> actionArgs, DesignResourceReference baseReference, GlobalExpressionScope globalScope) throws de.innovationgate.webgate.api.WGException
actionID
- ID of the action to call. This may be the ID of a actionArgs
- Parameters for the action, available as "tmlparam1" (index 0) to "tmlparam5" (index 4)baseReference
- The base reference from which to resolve the action id.globalScope
- The global expression scope under which to execute the action. Specify null to have none.WGAServerException
de.innovationgate.webgate.api.WGException
public java.lang.String serializeObject(java.lang.Object obj) throws de.innovationgate.webgate.api.WGException
String
, Number
, Boolean
or Date
, also with List
, Map
or JavaBeans containing those type of objects.
Uses this function to either use complex objects on places that only allow strings (for example on WebTML action parameters) or to prevent any data from being manipulated by the browser user when it needs to be transported to and returned from the browser.
Use deserializeObject(String)
to convert the string back to the originating object.obj
- Object to serializede.innovationgate.webgate.api.WGException
public java.lang.Object deserializeObject(java.lang.String encrypted) throws de.innovationgate.webgate.api.WGException
serializeObject(Object)
back to the original object.
The object returned by this method is in fact an exact copy of the object that was used on serializeObject() with the exact same data. So in terms of object equality and identity it is "equal" but not "the same".encrypted
- Serialized objectde.innovationgate.webgate.api.WGException
public java.lang.String scoped(java.lang.String str, java.lang.String scope) throws de.innovationgate.webgate.api.WGException
str
- The string to scope.scope
- The scope. Specify null to use scope from current WebTML contextUnavailableResourceException
de.innovationgate.webgate.api.WGException
public java.lang.String scoped(java.lang.String str) throws de.innovationgate.webgate.api.WGException
str
- The string to scope.UnavailableResourceException
de.innovationgate.webgate.api.WGException
public Plugin plugin() throws de.innovationgate.webgate.api.WGException
de.innovationgate.webgate.api.WGException
public Plugin plugin(java.lang.String uniqueName) throws de.innovationgate.webgate.api.WGException
uniqueName
- Plugin unique namede.innovationgate.webgate.api.WGAPIException
de.innovationgate.webgate.api.WGException
public Plugin plugin(de.innovationgate.webgate.api.WGDatabase db) throws de.innovationgate.webgate.api.WGException
db
- The WGAPI database objectde.innovationgate.webgate.api.WGAPIException
de.innovationgate.webgate.api.WGException
public Lucene lucene(Context context) throws de.innovationgate.webgate.api.WGException
context
- WebTML context for the lucene object.WGAServerException
de.innovationgate.webgate.api.WGException
public java.util.Date parseDate(java.lang.String date, java.lang.String format, java.lang.String language) throws de.innovationgate.webgate.api.WGException, java.text.ParseException
Date
object
This method parses the given string based on a custom date format and return it as date object. Use date format strings known from SimpleDateFormat
date
- The date stringformat
- The format stringlanguage
- The language string of the language to use for parsing language dependent date partsde.innovationgate.webgate.api.WGException
java.text.ParseException
- If the string is unparseable for the given date formatpublic java.util.Date parseDate(java.lang.String date, java.lang.String format) throws de.innovationgate.webgate.api.WGException, java.text.ParseException
Date
object
This method parses the given string based on a custom date format and return it as date object. Use date format strings known from SimpleDateFormat
date
- The date stringformat
- The format stringde.innovationgate.webgate.api.WGException
java.text.ParseException
- If the string is unparseable for the given date formatpublic java.util.Date createDate(boolean includeMillis) throws de.innovationgate.webgate.api.WGException
Date
object for the current time.
This method is provided for TMLScript. In Java one can simply construct a Date
object.includeMillis
- true ot include milliseconds in timede.innovationgate.webgate.api.WGException
public java.util.Date modifyDate(java.util.Date date, java.lang.String unit, int amount) throws de.innovationgate.webgate.api.WGException
Calendar
objects. it returns a new Date
object which represents the date of the parameter "date" plus/minus a given timespan.
In order to add a timespan one is first to choose which time unit to use via argument "unit" and then the amount of units to add via argument "amount". In order to substract a timespan from the date a negative amount value is to be used.
The unit is determined by the date string character that would be used by SimpleDateFormat
for the time unit:
date
- Date to modifyunit
- Modify unit. See table above.amount
- Amount of date units to add to the date. Specify negative amounts to substract.WGAServerException
de.innovationgate.webgate.api.WGException
public Form createForm(FormInfo formInfo) throws de.innovationgate.webgate.api.WGException
formInfo
- Form info objectde.innovationgate.webgate.api.WGException
public FormInfo createFormInfo(java.lang.String id, boolean htmlInput, boolean persistent) throws de.innovationgate.webgate.api.WGException
createForm(FormInfo)
to finally create a TMLForm object.
This method creates form info objects that belong to the design of the current WebTML context and behave according to its settings.id
- Form idhtmlInput
- Determines if the form will accept plain HTML inputspersistent
- Determines if the form will be persistentde.innovationgate.webgate.api.WGException
public de.innovationgate.utils.ImageScaler createImageScaler(java.io.File file) throws de.innovationgate.webgate.api.WGException, java.io.IOException
file
- The file to scalede.innovationgate.webgate.api.WGException
de.innovationgate.wga.modules.ModuleInstantiationException
java.io.IOException
public de.innovationgate.utils.ImageScaler createImageScaler(java.io.InputStream in) throws de.innovationgate.webgate.api.WGException, java.io.IOException
in
- Stream providing image datade.innovationgate.webgate.api.WGException
de.innovationgate.wga.modules.ModuleInstantiationException
java.io.IOException
public java.util.List<java.lang.Object> createList()
ArrayList
or other list variants.public java.util.List<java.lang.Object> createList(java.lang.Object[] array)
Arrays.asList(Object...)
.public java.util.List<java.lang.String> createList(java.lang.String collection, java.lang.String delimiter)
WGUtils.deserializeCollection(String, String)
and variants.collection
- delimiter
- public java.util.Map<java.lang.Object,java.lang.Object> createLookupTable(java.util.Map<java.lang.Object,java.lang.Object> map)
HashMap
or other map variants.map
- Map providing entriespublic java.util.Map<java.lang.Object,java.lang.Object> createLookupTable()
HashMap
or other map variants.public SmtpMail createMail() throws java.io.UnsupportedEncodingException, de.innovationgate.webgate.api.WGException
java.io.UnsupportedEncodingException
UnavailableResourceException
de.innovationgate.webgate.api.WGException
public SmtpMail createMail(java.lang.String smtpHost, java.lang.String username, java.lang.String password) throws de.innovationgate.webgate.api.WGException, java.io.UnsupportedEncodingException
smtpHost
- The host nameusername
- The user name of the accountpassword
- The password of the accountjava.io.UnsupportedEncodingException
de.innovationgate.webgate.api.WGException
public java.lang.Number parseNumber(java.lang.String number, java.lang.String format, java.lang.String language) throws java.text.ParseException, de.innovationgate.webgate.api.WGException
Number
object. You must specify the number format that the string contains in parameter "format" using the syntax known from DecimalFormat
.format
- The number format stringnumber
- The number stringlanguage
- Language string of language to use for language-dependent parts of the number string.java.text.ParseException
- If the string is unparseable for the given number formatUnavailableResourceException
de.innovationgate.webgate.api.WGException
public java.lang.Number parseNumber(java.lang.String number, java.lang.String format) throws java.text.ParseException, de.innovationgate.webgate.api.WGException
Number
object. You must specify the number format that the string contains in parameter "format" using the syntax known from DecimalFormat
.format
- The date format stringnumber
- The number stringjava.text.ParseException
- If the string is unparseable for the given number formatUnavailableResourceException
de.innovationgate.webgate.api.WGException
public de.innovationgate.webgate.api.WGDatabase db(java.lang.String dbKey) throws de.innovationgate.webgate.api.WGException
WGDatabase.isSessionOpen()
The method may return OpenWGA content stores as well as data sources.
The method returns null if no database of the given dbkey is connected.dbKey
- Database keyUnavailableResourceException
de.innovationgate.webgate.api.WGAPIException
de.innovationgate.webgate.api.WGException
public de.innovationgate.webgate.api.WGDatabase db(java.lang.String dbKey, boolean open) throws de.innovationgate.webgate.api.WGException
WGDatabase.isSessionOpen()
The method may return OpenWGA content stores as well as data sources.
The method returns null if no database of the given dbkey is connected.dbKey
- Database keyopen
- Whether a session should be opened on the database using the environments authentication informationUnavailableResourceException
de.innovationgate.webgate.api.WGAPIException
de.innovationgate.webgate.api.WGException
public boolean openDatabase(de.innovationgate.webgate.api.WGDatabase db) throws de.innovationgate.webgate.api.WGException
db
- The database to open.de.innovationgate.webgate.api.WGException
UnavailableResourceException
de.innovationgate.webgate.api.WGAPIException
public de.innovationgate.webgate.api.WGHierarchicalDatabase hdb(java.lang.String dbKey) throws de.innovationgate.webgate.api.WGException
HDBModel
, which builds upon this interface instead of directly using the HDB object.dbKey
- Database key of the applicationde.innovationgate.webgate.api.WGException
public java.lang.String encode(java.lang.String encoding, java.lang.Object obj) throws de.innovationgate.webgate.api.WGException, de.innovationgate.utils.FormattingException
encoding
- Name of the encoding, f.e. "html", "rtf"obj
- The text to encode. Non strings will internally be converted to strings.de.innovationgate.utils.FormattingException
de.innovationgate.webgate.api.WGException
public java.lang.String encode(java.lang.String encoding, java.lang.Object obj, TMLContext ctx) throws de.innovationgate.webgate.api.WGException, de.innovationgate.utils.FormattingException
de.innovationgate.webgate.api.WGException
de.innovationgate.utils.FormattingException
public URLBuilder urlBuilder(Context context, java.lang.String urlStr) throws de.innovationgate.webgate.api.WGException
context
- A WebTML context which is used as application context for the URL to generate (for example to retrieve configurations about protocol ports to use). Specify null to use implicit environment context.urlStr
- Some URL that you want the URLBuilder to modify. It may be an absolute URL or a relative one that will be complemented with the URL of the current request.de.innovationgate.webgate.api.WGException
public java.lang.String getRequestURL() throws de.innovationgate.webgate.api.WGException
UnavailableResourceException
de.innovationgate.webgate.api.WGException
public URLBuilder urlBuilder(Context context) throws de.innovationgate.webgate.api.WGException
context
- A WebTML context which is used as application context for the URL to generate (for example to retrieve configurations about protocol ports to use). Specify null to use implicit environment context.de.innovationgate.webgate.api.WGException
public URLBuilder urlBuilder(java.lang.String urlStr) throws de.innovationgate.webgate.api.WGException
urlStr
- Some URL that you want the URLBuilder to modify. It may be an absolute URL or a relative one that will be complemented with the URL of the current request.
This variant uses an implicit TMLContext for application context.de.innovationgate.webgate.api.WGException
public URLBuilder urlBuilder() throws de.innovationgate.webgate.api.WGException
de.innovationgate.webgate.api.WGException
public void redirectTo(java.lang.String url) throws de.innovationgate.webgate.api.WGException, java.io.IOException
url
- The URL to redirect toUnavailableResourceException
java.io.IOException
de.innovationgate.webgate.api.WGException
public java.util.List<java.lang.String> buildOptions(java.lang.Iterable<de.innovationgate.webgate.api.WGContent> contents, java.lang.String titleExpr, java.lang.String emptyTitle) throws de.innovationgate.webgate.api.WGException
contents
- List of WGAPI content objects that should be used to calculate the optionstitleExpr
- A TMLScript expression that is evaluated against the individual contents to form the title of the options. Omit it to simply use the content titles as option titles.emptyTitle
- A title that is used for an entry that represents an empty value. Omit it to have no empty value entry.de.innovationgate.webgate.api.WGAPIException
UnavailableResourceException
de.innovationgate.webgate.api.WGException
public java.util.Date dateOnly(java.util.Date date) throws de.innovationgate.webgate.api.WGException
date
- The datede.innovationgate.webgate.api.WGException
public java.util.Date timeOnly(java.util.Date date) throws de.innovationgate.webgate.api.WGException
date
- The datede.innovationgate.webgate.api.WGException
public java.util.Calendar createCalendar(java.util.Date date) throws de.innovationgate.webgate.api.WGException
GregorianCalendar
.date
- The date to representde.innovationgate.webgate.api.WGException
public java.util.Calendar createCalendar() throws de.innovationgate.webgate.api.WGException
GregorianCalendar
.de.innovationgate.webgate.api.WGException
public Design design(de.innovationgate.webgate.api.WGDatabase db) throws de.innovationgate.webgate.api.WGException
db
- The databaseUnavailableResourceException
de.innovationgate.webgate.api.WGException
public Design design(Design otherDesign) throws de.innovationgate.webgate.api.WGException
otherDesign
- Other designde.innovationgate.webgate.api.WGException
public Design design() throws de.innovationgate.webgate.api.WGException
UnavailableResourceException
de.innovationgate.webgate.api.WGException
public Design design(java.lang.String dbKey) throws de.innovationgate.webgate.api.WGException
dbKey
- The database keyUnavailableResourceException
de.innovationgate.webgate.api.WGException
public Design design(DesignResourceReference ref) throws de.innovationgate.webgate.api.WGException
ref
- The referencede.innovationgate.webgate.api.WGException
public Design design(TMLDesignContext designContext) throws de.innovationgate.webgate.api.WGException
designContext
- The WebTML design contextUnavailableResourceException
de.innovationgate.webgate.api.WGException
public App app() throws de.innovationgate.webgate.api.WGException
WGAServerException
de.innovationgate.webgate.api.WGException
public App app(de.innovationgate.webgate.api.WGDatabase db) throws de.innovationgate.webgate.api.WGException
db
- The databaseWGAServerException
de.innovationgate.webgate.api.WGException
public App app(Context cx) throws de.innovationgate.webgate.api.WGException
cx
- The WebTML contextWGAServerException
de.innovationgate.webgate.api.WGException
public App app(java.lang.String dbKey) throws de.innovationgate.webgate.api.WGException
dbKey
- Key of the databaseWGAServerException
de.innovationgate.webgate.api.WGException
public DataSource dataSource() throws de.innovationgate.webgate.api.WGException
WGAServerException
de.innovationgate.webgate.api.WGException
public DataSource dataSource(de.innovationgate.webgate.api.WGDatabase db) throws de.innovationgate.webgate.api.WGException
db
- The databaseWGAServerException
de.innovationgate.webgate.api.WGException
public DataSource dataSource(Context cx) throws de.innovationgate.webgate.api.WGException
cx
- The WebTML contextWGAServerException
de.innovationgate.webgate.api.WGException
public DataSource dataSource(java.lang.String dbKey) throws de.innovationgate.webgate.api.WGException
dbKey
- Key of the databaseWGAServerException
de.innovationgate.webgate.api.WGException
public Database database() throws de.innovationgate.webgate.api.WGException
App
or DataSource
object, depending on the database typeWGAServerException
de.innovationgate.webgate.api.WGException
public Database database(de.innovationgate.webgate.api.WGDatabase db) throws de.innovationgate.webgate.api.WGException
App
or DataSource
object, depending on the database typedb
- The databaseWGAServerException
de.innovationgate.webgate.api.WGException
public Database database(Context cx) throws de.innovationgate.webgate.api.WGException
App
or DataSource
object, depending on the database typecx
- The WebTML contextWGAServerException
de.innovationgate.webgate.api.WGException
public Database database(java.lang.String dbKey) throws de.innovationgate.webgate.api.WGException
App
or DataSource
object, depending on the database typedbKey
- Key of the databaseWGAServerException
de.innovationgate.webgate.api.WGException
public javax.servlet.http.Cookie createCookie(java.lang.String name, java.lang.String value) throws de.innovationgate.webgate.api.WGException
Cookie
object.name
- Cookie namevalue
- Cookie valuede.innovationgate.webgate.api.WGException
public org.apache.commons.httpclient.HttpClient createHttpClient() throws de.innovationgate.webgate.api.WGException
de.innovationgate.webgate.api.WGException
public Xml xml()
public Auth auth()
Domain.auth()
to get a domain specific authentication object.public Html html()
public Server server()
public TMLPage tmlPage()
public boolean isTMLContextAvailable()
public boolean isIsolated()
public Context tmlcontext() throws de.innovationgate.webgate.api.WGException
UnavailableResourceException
de.innovationgate.webgate.api.WGException
public Context context(java.lang.String expression) throws de.innovationgate.webgate.api.WGException
de.innovationgate.webgate.api.WGException
public Context context(java.lang.String expression, boolean returnContextOnError) throws de.innovationgate.webgate.api.WGException
de.innovationgate.webgate.api.WGException
public Context context(de.innovationgate.webgate.api.WGContent content) throws de.innovationgate.webgate.api.WGException
de.innovationgate.webgate.api.WGException
public javax.servlet.http.HttpServletRequest getRequest() throws de.innovationgate.webgate.api.WGException
UnavailableResourceException
de.innovationgate.webgate.api.WGException
public Call call()
public Session session()
public boolean isRequestAvailable()
public boolean isResponseAvailable()
public javax.servlet.http.HttpServletResponse getResponse() throws de.innovationgate.webgate.api.WGException
UnavailableResourceException
de.innovationgate.webgate.api.WGException
public Context createTMLContext(de.innovationgate.webgate.api.WGDatabase db, Design design) throws de.innovationgate.webgate.api.WGException
db
- The database for which to create the contextdesign
- The design which the context should use for reference on design operations. Specify null to use the design of the database where the content comes from.WGAServerException
de.innovationgate.webgate.api.WGException
public Context createTMLContext(de.innovationgate.webgate.api.WGDatabase db) throws de.innovationgate.webgate.api.WGException
db
- The database for which to create the contextWGAServerException
de.innovationgate.webgate.api.WGException
public Context createTMLContext(de.innovationgate.webgate.api.WGDatabase db, de.innovationgate.webgate.api.WGLanguageChooser chooser, Design design) throws de.innovationgate.webgate.api.WGException
db
- The database for which to create the contextchooser
- A language choosing object, responsible for choosing the language of the context docdesign
- The design which the context should use for reference on design operations. Specify null to use the design of the database where the content comes from.WGAServerException
de.innovationgate.webgate.api.WGException
public Context createTMLContext(de.innovationgate.webgate.api.WGDatabase db, de.innovationgate.webgate.api.WGLanguageChooser chooser) throws de.innovationgate.webgate.api.WGException
db
- The database for which to create the contextchooser
- A language choosing object, responsible for choosing the language of the context docWGAServerException
de.innovationgate.webgate.api.WGException
public Context createTMLContext(de.innovationgate.webgate.api.WGContent content, Design design) throws de.innovationgate.webgate.api.WGException
content
- The content document which should be in contextdesign
- The design which the context should use for reference on design operations. Specify null to use the design of the database where the content comes from.WGAServerException
de.innovationgate.webgate.api.WGException
public Context createTMLContext(de.innovationgate.webgate.api.WGContent content) throws de.innovationgate.webgate.api.WGException
content
- The content document which should be in contextWGAServerException
de.innovationgate.webgate.api.WGException
public Domain domain(java.lang.String name) throws de.innovationgate.webgate.api.WGException
WGAServerException
de.innovationgate.webgate.api.WGException
public TMLScript tmlscript() throws de.innovationgate.webgate.api.WGException
de.innovationgate.webgate.api.WGException
public Jobs jobs()
public Validate validate()
public void reopenSessions() throws de.innovationgate.webgate.api.WGException
WGAServerException
de.innovationgate.webgate.api.WGException
public WGARequestInformation accessLogging() throws de.innovationgate.webgate.api.WGException
UnavailableResourceException
de.innovationgate.webgate.api.WGException
public java.util.List<java.lang.Object> toList(java.lang.Object... values) throws de.innovationgate.webgate.api.WGException
values
- Values that are either objects representing a list or elements to go into the listde.innovationgate.webgate.api.WGException
public java.util.List<java.lang.Class<?>> serviceClasses() throws de.innovationgate.webgate.api.WGException
de.innovationgate.webgate.api.WGException
public <T> T service(java.lang.Class<T> serviceClass) throws de.innovationgate.webgate.api.WGException
serviceClass
- The service API class or interfacede.innovationgate.webgate.api.WGException
public <T> T instantiateService(java.lang.Class<?> implementationClass) throws de.innovationgate.webgate.api.WGException
implementationClass
- The service API implementation classde.innovationgate.webgate.api.WGException
public <T> T instantiateService(de.innovationgate.wga.modules.ModuleDefinition implDef) throws de.innovationgate.webgate.api.WGException
implDef
- The module definition of the implementationde.innovationgate.webgate.api.WGException
public de.innovationgate.webgate.api.WGFileDerivateMetaData selectDerivate(Context cx, java.lang.String fileName, java.lang.String derivateQueryStr) throws de.innovationgate.webgate.api.WGException
cx
- Context of the content holding the attachmentfileName
- Name of the attachmentderivateQueryStr
- The derivate queryde.innovationgate.webgate.api.WGException
public de.innovationgate.webgate.api.WGFileDerivateMetaData selectDerivate(java.lang.String fileName, java.lang.String derivateQuery) throws de.innovationgate.webgate.api.WGException
fileName
- Name of the attachmentderivateQuery
- The derivate queryde.innovationgate.webgate.api.WGException
public java.lang.String alias(java.lang.String str, java.lang.String aliasesStr)
str
- The string valuealiasesStr
- The aliases stringpublic java.lang.String alias(java.lang.String str, java.util.List<java.lang.String> aliases)
str
- The string valuealiases
- The list of aliasespublic org.apache.log4j.Logger getLog()
public java.text.DateFormat getDateFormat(java.lang.String pattern, java.util.Locale locale) throws de.innovationgate.webgate.api.WGException
pattern
- The date format patternlocale
- A locale to use for locale-dependent date parts. Specify null to let the current WebTML context choose the locale.de.innovationgate.webgate.api.WGException
public java.text.NumberFormat getNumberFormat(java.lang.String pattern, java.util.Locale locale) throws de.innovationgate.webgate.api.WGException
pattern
- The number format patternlocale
- A locale to use for locale-dependent number parts. Specify null to let the current WebTML context choose the locale.de.innovationgate.webgate.api.WGException
public Nav nav() throws de.innovationgate.webgate.api.WGException
de.innovationgate.webgate.api.WGException
public Nav nav(Context context) throws de.innovationgate.webgate.api.WGException
context
- de.innovationgate.webgate.api.WGException
public Nav nav(java.lang.String expression) throws de.innovationgate.webgate.api.WGException
de.innovationgate.webgate.api.WGException
public WGA isolate()
public WGA narrow()