Class Ivy
- Direct Known Subclasses:
IvyJSP
Access to some features (e.g. cms()
or cms
) are only possible within a certain scope
(e.g. process request, etc.).
If this scope is not available a EnvironmentNotAvailableException
is thrown.
Some methods are only available depending on the request kind. If they are
not available, they will return null
.
In such a case a method call on one of these fields will throw an
IllegalStateException
.
Newer features, like ivy.casemap, are not directly available by corresponding methods. Instead
the methods get(String)
and get(Class)
can be used. E.g. Ivy.get(ICaseMapService.class)
.
All environment interfaces have also a static current method to get the current instance of them. E.g. IContentManagementSystem#current()
- API:
- This is a public API.
-
Field Summary
Modifier and TypeFieldDescriptionfinal IDefaultBusinessCalendar
final ContentManagement
Provides access to thecontent management
final IContentManagementSystem
Provides access to thecontent management system
of the currently active project (process model version).final IDataCacheContext
Provides access todata cache context
to manage application (global) and session (user-specific) data caches.final IExtensions
Provides access to anyextensions
that are installed on the ivy server.final IHtmlDialogContext
Provides access to the currentHTML dialog context
.final ILogger
Provides access to the ivy logging subsystem.final IPersistenceContext
Access to theIPersistenceContext
of the current process model version.final BusinessDataRepository
Provides access to theBusinessDataRepository
.The currently executed processrequest
.final IResponse
Theresponse
for the currently executed request.final IRestClientContext
Access torest clients
.final ISecurity
Provides access to runtime information of thesecurity subsystem
(with respect to the current session).final IWorkflowSession
Provides information about the currently activesession
.final IGlobalVariableContext
Access tovariable context
to manage variables.final IWorkflowContext
Provides access to runtime information of theworkflow subsystem
(with respect to the current session).final ICase
The currently executedcase
.final ITask
The currently executedtask
. -
Method Summary
Modifier and TypeMethodDescriptionstatic IDefaultBusinessCalendar
cal()
Returns the default business calendar.static ContentManagement
cm()
Returns the content management.static IContentManagementSystem
cms()
Returns thecontent management system
of the currently active project (process model version).static IDataCacheContext
Provides access todata cache context
to manage application (global) and session (user-specific) data caches.static IExtensions
Gets access to anyextensions
that are installed on the ivy server.static <T> T
Provides access to the ivy variable member that is an instance of the given typestatic <T> T
Provides access to the ivy variable member with the given name.static Ivy
Returns the singleton ofIvy
.static IHtmlDialogContext
html()
Returns the currently runningHTML dialog context
.static Logger
log()
Gets the runtime log from the environment.static IPersistenceContext
Returns thepersistence context
of the current process model version.static BusinessDataRepository
repo()
Provides access to theBusinessDataRepository
.static IProcessModelVersionRequest
request()
Returns the currently executed processrequest
.static IResponse
response()
Returns theresponse
for the currently executed request.static IRestClientContext
rest()
Access torest clients
.static ISecurity
security()
Returns thesecurity context
(with respect to the current session) to access runtime information of the security subsystem.static IWorkflowSession
session()
Returns the currently activesession
.static IGlobalVariableContext
var()
Access tovariable context
to manage variables (constants).static IWorkflowContext
wf()
Returns theworkflow context
(with respect to the current session) to access runtime information of the workflow subsystem.static ICase
wfCase()
Returns the currently executedcase
.static ITask
wfTask()
Returns the currently executedtask
.
-
Field Details
-
cal
- API:
- This public API is available in Java.
-
request
The currently executed processrequest
.- API:
- This public API is available in Java.
-
response
Theresponse
for the currently executed request.- API:
- This public API is available in Java.
-
wf
Provides access to runtime information of theworkflow subsystem
(with respect to the current session).- API:
- This public API is available in Java.
-
session
Provides information about the currently activesession
.- API:
- This public API is available in Java.
-
wfCase
The currently executedcase
.
If thecase
is not available (e.g. on a static HTML page), anIllegalStateException
will be thrown on method invocation.- API:
- This public API is available in Java.
-
wfTask
The currently executedtask
.
If thetask
is not available (e.g. on a static HTML page), anIllegalStateException
will be thrown on method invocation.- API:
- This public API is available in Java.
-
security
Provides access to runtime information of thesecurity subsystem
(with respect to the current session).- Since:
- 9.3
- API:
- This public API is available in Java.
-
cms
Provides access to thecontent management system
of the currently active project (process model version).- API:
- This public API is available in Java.
-
cm
Provides access to thecontent management
- API:
- This public API is available in Java.
-
html
Provides access to the currentHTML dialog context
.- API:
- This public API is available in Java.
-
log
Provides access to the ivy logging subsystem. Log entries are written to the categoryRuntimeLogCategory.USER
.- API:
- This public API is available in Java.
-
extensions
Provides access to anyextensions
that are installed on the ivy server.- API:
- This public API is available in Java.
-
datacache
Provides access todata cache context
to manage application (global) and session (user-specific) data caches.- API:
- This public API is available in Java.
-
persistence
Access to theIPersistenceContext
of the current process model version.- API:
- This public API is available in Java.
-
var
Access tovariable context
to manage variables. The exact values depend on the currently active environment.- API:
- This public API is available in Java.
-
rest
Access to
rest clients
.Example:
Ivy ivy = Ivy.getInstance(); String response = ivy.rest.client("myRestClient").request().get().readEntity(String.class);
- API:
- This public API is available in Java.
-
repo
Provides access to the
BusinessDataRepository
.- API:
- This public API is available in Java.
-
-
Method Details
-
getInstance
Returns the singleton ofIvy
. Useful for access to the ivy fields in the same way as in IvyScript. So it possible to copy/paste code snippets forth and back from IvyScript to Java and vice versa.Example:
Ivy ivy = Ivy.getInstance(); ivy.cms.co("/Project/Banner");
- Returns:
- the singleton of
Ivy
. - API:
- This public API is available in Java.
-
cal
Returns the default business calendar.- Returns:
- The default business calendar.
- API:
- This public API is available in Java.
-
request
Returns the currently executed processrequest
. Returnsnull
if not available.- Returns:
- the currently executed process
request
ornull
, if not available - Throws:
ch.ivyteam.ivy.environment.EnvironmentNotAvailableException
- if accessing this method outside a request thread- API:
- This public API is available in Java.
-
response
- Returns:
IResponse
instance ornull
if not available.- Throws:
ch.ivyteam.ivy.environment.EnvironmentNotAvailableException
- if accessing this method outside a request thread- API:
- This public API is available in Java.
-
persistence
Returns thepersistence context
of the current process model version. Returnsnull
if not available.- Returns:
- the
IPersistenceContext
of the current process model version ornull
if not available. - Throws:
ch.ivyteam.ivy.environment.EnvironmentNotAvailableException
- if accessing this method outside a request thread- API:
- This public API is available in Java.
-
var
Access tovariable context
to manage variables (constants). The exact values depend on the currently active environment.- Returns:
variable context
with defined variables.- Throws:
ch.ivyteam.ivy.environment.EnvironmentNotAvailableException
- if accessing this method outside a request thread- API:
- This public API is available in Java.
-
rest
Access to
rest clients
.Example:
String response = Ivy.rest().client("myRestClient").request().get().readEntity(String.class);
- Returns:
- rest clients
- Throws:
ch.ivyteam.ivy.environment.EnvironmentNotAvailableException
- API:
- This public API is available in Java.
-
repo
Provides access to the
BusinessDataRepository
.- Returns:
- the Business Data Repository
- Throws:
ch.ivyteam.ivy.environment.EnvironmentNotAvailableException
- API:
- This public API is available in Java.
-
html
Returns the currently runningHTML dialog context
. Returnsnull
if not available- Returns:
IHtmlDialogContext
instance ornull
- Throws:
ch.ivyteam.ivy.environment.EnvironmentNotAvailableException
- if accessing this method outside a request thread- API:
- This public API is available in Java.
-
cms
Returns thecontent management system
of the currently active project (process model version).- Returns:
- the
content management system
of the currently active project (i.e. process model version). - Throws:
ch.ivyteam.ivy.environment.EnvironmentNotAvailableException
- if accessing this method outside a request thread- API:
- This public API is available in Java.
-
cm
Returns the content management.- Returns:
- content management
- API:
- This public API is available in Java.
-
session
Returns the currently activesession
.- Returns:
- the currently active
session
. - Throws:
ch.ivyteam.ivy.environment.EnvironmentNotAvailableException
- if accessing this method outside a request thread- API:
- This public API is available in Java.
-
wf
Returns theworkflow context
(with respect to the current session) to access runtime information of the workflow subsystem.- Returns:
IWorkflowContext
instance- Throws:
ch.ivyteam.ivy.environment.EnvironmentNotAvailableException
- if accessing this method outside a request thread- API:
- This public API is available in Java.
-
security
Returns thesecurity context
(with respect to the current session) to access runtime information of the security subsystem.- Returns:
ISecurityContext
instance- Throws:
ch.ivyteam.ivy.environment.EnvironmentNotAvailableException
- if accessing this method outside a request thread- Since:
- 9.3
- API:
- This public API is available in Java.
-
wfCase
Returns the currently executedcase
.- Returns:
- the currently executed
case
ornull
, if not available (e.g. on a static HTML page) - Throws:
ch.ivyteam.ivy.environment.EnvironmentNotAvailableException
- if accessing this method outside a request thread- API:
- This public API is available in Java.
-
wfTask
Returns the currently executedtask
.- Returns:
- the currently executed
task
. ornull
, if not available (e.g. on a static HTML page) - Throws:
ch.ivyteam.ivy.environment.EnvironmentNotAvailableException
- if accessing this method outside a request thread- API:
- This public API is available in Java.
-
log
Gets the runtime log from the environment. Log entries are written to the categoryRuntimeLogCategory.USER
.- Returns:
- the ivy runtime log instance for the category
RuntimeLogCategory.USER
- Throws:
ch.ivyteam.ivy.environment.EnvironmentNotAvailableException
- if accessing this method outside a request thread- API:
- This public API is available in Java.
-
extensions
Gets access to anyextensions
that are installed on the ivy server.- Returns:
- interface to access ivy extensions
- Throws:
ch.ivyteam.ivy.environment.EnvironmentNotAvailableException
- if environment is not available- API:
- This public API is available in Java.
-
datacache
Provides access todata cache context
to manage application (global) and session (user-specific) data caches.- Returns:
- the
data cache context
to access data caches - Throws:
ch.ivyteam.ivy.environment.EnvironmentNotAvailableException
- if environment is not available- API:
- This public API is available in Java.
-
get
Provides access to the ivy variable member with the given name.
Example:
import ch.ivyteam.ivy.globalvars.IGlobalVariableContext; IGlobalVariableContext var = Ivy.get("var");
- Parameters:
memberName
- name of the member of the ivy variable- Returns:
- value of the member or null if member does not exist
- API:
- This public API is available in Java.
-
get
Provides access to the ivy variable member that is an instance of the given type
Example:
import ch.ivyteam.ivy.globalvars.IGlobalVariableContext; IGlobalVariableContext var = Ivy.get(IGlobalVariableContext.class);
- Parameters:
type
- the type of the member of the ivy variable- Returns:
- value of the member or null if member does not exist
- API:
- This public API is available in Java.
-