Interface IHtmlDialogContext
The IHtmlDialogContext specifies the interface of the ivy.html
environment variable.
This environment variable / interface provides methods to generate form
controls, build links, format process attributes and many other useful things
for HTML process pages. All these methods will mostly be used as macros
inside process pages
(e.g. <a href="<%=ivy.html.ref("LinkA.ivp")%>">My Link</a>)
Use the HtmlDialogContextFactory
to create a new object that
implements this interface
- Since:
- 15.11.2007
- See Also:
-
HtmlDialogContextFactory
HtmlDialogContext
- API:
- This is a public API.
-
Method Summary
Modifier and TypeMethodDescriptionReturns aWebLink
to the application home.Deprecated.coLink
(ContentObject co) Returns aWebLink
to download the given content object (WebLink.EMPTY
if co isnull
or not downloadable).Returns a WebLink to download the given content object URI (WebLink.EMPTY
if co does not exist or is not downloadable).coref
(ContentObject co) Deprecated.usecoLink(ch.ivyteam.ivy.cm.ContentObject)
insteadDeprecated.usecoLink(String)
insteadstatic IHtmlDialogContext
current()
Gets the current html dialog context.Does format the object with the default format and then escape the characters in aString
using HTML entities.Escapes the characters in aString
using HTML entities.Deprecated.usefileLink(File)
insteadDeprecated.usefileLink(String, boolean)
insteadGets the default formatted and HTML-escaped value of the specified process attribute.Gets the formatted and HTML-escaped value of the specified process attribute.default String
Deprecated, for removal: This API element is subject to removal in a future version.not supported anymore.getFormValue
(String attributeName) Gets the default formatted and HTML-escaped value of the specified process attribute for the use in an HTML form input field.getFormValue
(String attributeName, String format) Gets the formatted and HTML-escaped value of the specified process attribute for the use in an HTML form input.Gets the value object of the specified process attribute.Returns aWebLink
to the login page.loginRef()
Deprecated.useloginLink()
insteadReturns aWebLink
to the process start list.Deprecated.useprocessStartListLink()
insteadDeprecated, for removal: This API element is subject to removal in a future version.WebPage features was removed with 11.2.default String
Deprecated, for removal: This API element is subject to removal in a future version.useref(String)
startInFrameLink
(String startName) Returns aWebLink
to the given process start link.startInFrameRef
(String startName) Returns the url to the specified process link.Returns aWebLink
to the given process start link.Deprecated.usestartRef(String)
which behaves exactly the same wayDeprecated.usestartLink(String)
insteadReturns aWebLink
to the task list.Deprecated.usetaskListLink()
insteadtaskStartInFrameRef
(ITask taskToStart) Deprecated.taskstartref
(ITask taskToStart) Deprecated.taskStartRef
(ITask taskToStart) Deprecated.Returns aWebLink
to the user notification settings page.Creates a link to a file in the static webContent folder of the current project.
-
Method Details
-
get
Gets the default formatted and HTML-escaped value of the specified process attribute. The format depends on the formatting locale of the actual request (IApplicationRequest.getFormattingLocale()
).E.g. english (en) or US (en_US) locale: ivy.html.get("in.date") = "1/31/2000" ivy.html.get("in.time") = "9:01:59" ivy.html.get("in.dateTime") = "1/31/2000 9:01:59" ivy.html.get("in.number") = "123456.789" ivy.html.get("in.notInitialized") = "" ivy.html.get("in.invalid") = ""
E.g. switzerland (de_CH, fr_CH, it_CH) locale: ivy.html.get("in.date") = "31.01.2000" ivy.html.get("in.time") = "09:01:59" ivy.html.get("in.dateTime") = "31.01.2000 09:01:59" ivy.html.get("in.number") = "123456.789" ivy.html.get("in.notInitialized") = "" ivy.html.get("in.invalid") = ""
E.g. UK (en_UK) locale: ivy.html.get("in.date") = "31/01/2000" ivy.html.get("in.time") = "09:01:59" ivy.html.get("in.dateTime") = "31/01/2000 09:01:59" ivy.html.get("in.number") = "123456.789" ivy.html.get("in.notInitialized") = "" ivy.html.get("in.invalid") = ""
E.g. german (de) or germany (de_DE) locale: ivy.html.get("in.date") = "31.01.2000" ivy.html.get("in.time") = "09:01:59" ivy.html.get("in.dateTime") = "31.01.2000 09:01:59" ivy.html.get("in.number") = "123456,789" ivy.html.get("in.notInitialized") = "" ivy.html.get("in.invalid") = ""
- Parameters:
attributeName
- The name of the attribute to get (e.g. 'in.xhrm.employee.name')- Returns:
- default formatted value of the specified process attribute or empty string if there is no value or the value is uninitialized or invalid
- API:
- This public API is available in Java.
-
get
Gets the formatted and HTML-escaped value of the specified process attribute.This method will only work correctly if invoked on a page request (i.e. when rendering a process page).
- Parameters:
attributeName
- the name of the attribute to get (e.g. 'in.xhrm.employee.name')format
- the name of the format config or a pattern to format the attribute with.- Returns:
- formatted value of the specified process attribute or empty string if not on a page
- API:
- This public API is available in Java.
-
getObject
Gets the value object of the specified process attribute.This method will only work correctly if invoked on a page request (i.e. when rendering a process page).
- Parameters:
attributeName
- The name of the attribute to get (e.g. 'in.xhrm.employee.name')- Returns:
- the specified attribute as
Object
ornull
if not on a page - API:
- This public API is available in Java.
-
ref
Deprecated, for removal: This API element is subject to removal in a future version.WebPage features was removed with 11.2. Use HtmlDialog instead.Returns the url to the specified process link.This method will only work correctly if invoked on a page request (i.e. when rendering a process page).
The protocol of the url will be the same as the protocol of the page request (i.e. if the page request uses https the generated url also uses https and if it uses http the generated url also uses http.)
- Parameters:
linkName
- the name of the process link (e.g. 'LinkA.ivp')- Returns:
- encoded URL to the specified process link or empty string if not on a page
- See Also:
- API:
- This public API is available in Java.
-
ref
@Deprecated(since="9.1", forRemoval=true) default String ref(String linkName, boolean useSecureProtocol) Deprecated, for removal: This API element is subject to removal in a future version.useref(String)
Is doing exactly the same likeref(String)
- Parameters:
linkName
- the name of the process link (e.g. 'LinkA.ivp')useSecureProtocol
- HAS NO EFFECT- Returns:
- encoded URL to the specified process link or empty string if not on a page
- See Also:
- API:
- This public API is available in Java.
-
fileref
Deprecated.usefileLink(File)
insteadReturns the url to the specified file for download (empty string if file isnull
).- Parameters:
file
- the file to get an URL for- Returns:
- encoded URL to the specified file or empty string if specified file is null
- API:
- This public API is available in Java.
-
fileref
Deprecated.usefileLink(String, boolean)
insteadReturns the url to the specified file for download (empty string if path isnull
).- Parameters:
path
- the path of the file (relative)isTemporary
- if file is temporary- Returns:
- encoded URL to the specified file or empty string if specified path is null
- API:
- This public API is available in Java.
-
fileLink
- Parameters:
path
- the path of the file (relative)isTemporary
- if file is temporary- Returns:
- a WebLink to download given file,
WebLink.EMPTY
if specified path is null - API:
- This public API is available in Java.
-
taskStartRef
Deprecated.Gets a reference to start the specified task (empty string if task isnull
or not in a startable state).- Parameters:
taskToStart
- the task to get an URL for- Returns:
- encoded URL to start the specified task or empty string if the specified
task is not valid (either
null
or in a state that doesn't allow starting it) - See Also:
- API:
- This public API is available in Java.
-
taskstartref
Deprecated.- Parameters:
taskToStart
- the task to get an URL for- Returns:
- encoded URL to start the specified task or empty string if the specified
task is not valid (either
null
or in a state that doesn't allow starting it) - API:
- This public API is available in Java.
-
taskStartInFrameRef
Deprecated.Gets a reference to start the specified task (empty string if task isnull
or not in a startable state). Start specified task within the Frame of the DefaultFramePage (if supported by the Workflow UI)- Parameters:
taskToStart
- the task to get an URL for- Returns:
- encoded URL to start the specified task in frame or empty string if the specified
task is not valid (either
null
or in a state that doesn't allow starting it) - See Also:
- API:
- This public API is available in Java.
-
startRef
Deprecated.usestartLink(String)
insteadReturns the url to the specified process link.E.g. 'MyProcess/start.ivp' -> 'http://hostname/myapp/pro/MyProcess/1571D80B8D735240/start.ivp'
The search scope is the current case's project or - if not available - the current project of the request and all of it's required projects.
- Parameters:
startName
- name of the process start (Format: ProcessName/startName.ivp) to get an URL for- Returns:
- encoded URL to the process start with the specified name or empty string if no process start with such a name exists
- See Also:
- API:
- This public API is available in Java.
-
startLink
Returns aWebLink
to the given process start link.E.g. 'MyProcess/start.ivp' -> 'http://hostname/myapp/pro/MyProcess/1571D80B8D735240/start.ivp'
The search scope is the current case's project or - if not available - the current project of the request and all of it's required projects.
- Parameters:
startName
- name of the process start (Format: ProcessName/startName.ivp) to get aWebLink
for- Returns:
- a
WebLink
to the process start with the given name,WebLink.EMPTY
if no process start with such a name exists - See Also:
- API:
- This public API is available in Java.
-
startref
Deprecated.usestartRef(String)
which behaves exactly the same way- Parameters:
startName
- name of the process start (Format: ProcessName/startName.ivp) to get an URL for- Returns:
- encoded URL to the process start with the specified name or empty string if no process start with such a name exists
- API:
- This public API is available in Java.
-
startInFrameRef
Returns the url to the specified process link.E.g. 'MyProcess/start.ivp' -> 'http://hostname/myapp/pro/MyProcess/1571D80B8D735240/start.ivp?embedInFrame'
The search scope is the current case's project or - if not available - the current project of the request and all of it's required projects. Start specified process within the Frame of the DefaultFramePage (if supported by the Workflow UI)
- Parameters:
startName
- name of the process start (Format: ProcessName/startName.ivp) to get an URL for- Returns:
- encoded URL to the process start with the specified name or empty string if no process start with such a name exists
- See Also:
- API:
- This public API is available in Java.
-
startInFrameLink
Returns aWebLink
to the given process start link.E.g. 'MyProcess/start.ivp' -> 'http://hostname/myapp/pro/MyProcess/1571D80B8D735240/start.ivp?embedInFrame'
The search scope is the current case's project or - if not available - the current project of the request and all of it's required projects. Start specified process within the Frame of the DefaultFramePage (if supported by the Workflow UI)
- Parameters:
startName
- name of the process start (Format: ProcessName/startName.ivp) to get aWebLink
for- Returns:
- a
WebLink
to the process start with the specified name,WebLink.EMPTY
if no process start with such a name exists - See Also:
- API:
- This public API is available in Java.
-
coref
Deprecated.usecoLink(ch.ivyteam.ivy.cm.ContentObject)
insteadReturns the reference to the specified content object for download (empty string, if co isnull
or not downloadable).- Parameters:
co
- the co to get an URL for- Returns:
- encoded URL to the given content object or empty string if the specified co is null or not downloadable
- API:
- This public API is available in Java.
-
coLink
Returns aWebLink
to download the given content object (WebLink.EMPTY
if co isnull
or not downloadable).- Parameters:
co
- the co to get aWebLink
for- Returns:
- a WebLink to the given content object,
WebLink.EMPTY
if the given co is null or not downloadable - API:
- This public API is available in Java.
-
coref
Deprecated.usecoLink(String)
insteadReturns the reference to the specified content object URI for download (empty string, if co does not exist or is not downloadable).- Parameters:
cmsUri
- the uri of the content object to create an URL for- Returns:
- encoded URL to the given content object or empty string if the specified co is null or not downloadable
- API:
- This public API is available in Java.
-
coLink
Returns a WebLink to download the given content object URI (WebLink.EMPTY
if co does not exist or is not downloadable).- Parameters:
cmsPath
- the path of the content object to create anWebLink
for- Returns:
- a
WebLink
to download the content object with the given path,WebLink.EMPTY
if the specified cmsPath is null the co does not exists or is not downloadable - API:
- This public API is available in Java.
-
wr
Creates a link to a file in the static webContent folder of the current project. This method is useful to refer to e.g. JavaScript extensions or other static web content. For images, banners and labels it is recommended to link to content management system entries.
Only the current project's webContent folder will be searched. The webContent folders of any required projects will not be taken into consideration.
Example: An argument such as
myDir/myStyle.css
will reference.../webContent/myDir/myStyle.css
.Important Note: This method is not really needed. You can address all webContent files of a project with a link that is relative to the current JSP page.
Example: A link
<a href="myDir/myStyle.css">MyLink</a>
on a JSP page will have exactly the same effect as<a href="<%=ivy.html.wr("myDir/myStyle.css")%>">MyLink</a>
. Obviously the version without macro is much simpler and better readable and thus recommended.- Parameters:
relativeWebContentUri
- relative URI to a file in webContent folder, e.g.myDir/myStyle.css
- Returns:
- a valid URL reference to the file in your project's "webContent" folder
- Throws:
PersistencyException
- if anything goes wrong- API:
- This public API is available in Java.
-
getCurrentContentPageUri
Deprecated, for removal: This API element is subject to removal in a future version.not supported anymore. always returns empty string.- API:
- This public API is available in Java.
-
taskListRef
Deprecated.usetaskListLink()
insteadReturns the URL to the task list. The task list contains all tasks on which the currently logged in user can work.
Consult the engine guide to learn how to customize the task list for your application.
- Returns:
- The URL to the task list.
- API:
- This public API is available in Java.
-
taskListLink
WebLink taskListLink()Returns a
WebLink
to the task list. The task list contains all tasks on which the currently logged in user can work.Consult the engine guide to learn how to customize the task list for your application.
- Returns:
- a
WebLink
to the task list. - Since:
- 11.3
- API:
- This public API is available in Java.
-
processStartListRef
Deprecated.useprocessStartListLink()
insteadReturns the URL to the process start list. The process start list contains all processes which the currently logged in user can start.
Consult the engine guide to learn how to customize the process start list for your application.
- Returns:
- The URL to the process start list.
- API:
- This public API is available in Java.
-
processStartListLink
WebLink processStartListLink()Returns a
WebLink
to the process start list. The process start list contains all processes which the currently logged in user can start.Consult the engine guide to learn how to customize the process start list for your application.
- Returns:
- a
WebLink
to the process start list. - Since:
- 11.3
- API:
- This public API is available in Java.
-
applicationHomeRef
Deprecated.useapplicationHomeLink()
insteadReturns the URL to the application home. The application home is the entry point to the application.
Consult the engine guide to learn how to customize the application home page for your application.
- Returns:
- The URL to the application home page.
- API:
- This public API is available in Java.
-
applicationHomeLink
WebLink applicationHomeLink()Returns a
WebLink
to the application home. The application home is the entry point to the application.Consult the engine guide to learn how to customize the application home page for your application.
- Returns:
- a
WebLink
to the application home page. - Since:
- 11.3
- API:
- This public API is available in Java.
-
loginRef
Deprecated.useloginLink()
insteadReturns the URL to the login page. Users can use the login page to authenticate.
Consult the engine guide to learn how to customize the login page for your application.
- Returns:
- The URL to the login page.
- API:
- This public API is available in Java.
-
loginLink
WebLink loginLink()Returns a
WebLink
to the login page. Users can use the login page to authenticate.Consult the engine guide to learn how to customize the login page for your application.
- Returns:
- a
WebLink
to the login page. - Since:
- 11.3
- API:
- This public API is available in Java.
-
userNotificationSettingsLink
WebLink userNotificationSettingsLink()Returns a
WebLink
to the user notification settings page. Users can use the notification settings page to configure their notification subscriptions.Consult the engine guide to learn how to customize the user notification settings page for your application.
- Returns:
- a
WebLink
to the user notification settings page. - Since:
- 11.3
- API:
- This public API is available in Java.
-
escape
Does format the object with the default format and then escape the characters in a
String
using HTML entities.For example:
"bread" & "butter"
"bread" & "butter"
Supports all known HTML 4.0 entities, including funky accents. Note that the commonly used apostrophe escape character (') is not a legal entity and so is not supported).
- Parameters:
obj
- theString
to escape, may be null- Returns:
- a new escaped
String
,null
if null object input - See Also:
-
escape(String)
StringEscapeUtils.escapeHtml4(String)
- API:
- This public API is available in Java.
-
escape
Escapes the characters in a
String
using HTML entities.For example:
"bread" & "butter"
"bread" & "butter"
Supports all known HTML 4.0 entities, including funky accents. Note that the commonly used apostrophe escape character (') is not a legal entity and so is not supported).
- Parameters:
str
- theString
to escape, may be null- Returns:
- a new escaped
String
,null
if null string input - See Also:
-
escape(Object)
StringEscapeUtils.escapeHtml4(String)
- API:
- This public API is available in Java.
-
getFormValue
Gets the default formatted and HTML-escaped value of the specified process attribute for the use in an HTML form input field. Line breaks will not be converted to <br> tags. The format depends on the formatting locale of the current request (
IApplicationRequest.getFormattingLocale()
).Examples of the format can be seen in the documentation of the
get(String)
method. This method will only work correctly if invoked on a page request (i.e. when rendering a process page).- Parameters:
attributeName
- The name of the attribute to get (e.g. 'in.xhrm.employee.name')- Returns:
- Formatted value of the specified process attribute ready for the use in an HTML form input field or empty string if not on page
- API:
- This public API is available in Java.
-
getFormValue
Gets the formatted and HTML-escaped value of the specified process attribute for the use in an HTML form input. It is formatted with the specified format (either the name of a config or a pattern). Line breaks will not be converted to <br> tags.
In case the attribute is a Number and the format uses digit grouping, the thousands separators will be removed to ensure that the number can be parsed back after submitting the form.
The formating depends on the formating locale of the request (
IApplicationRequest.getFormattingLocale()
). This method will only work correctly if invoked on a page request (i.e. when rendering a process page).- Parameters:
attributeName
- The name of the attribute to get (e.g. 'in.xhrm.employee.name')format
- The name of the format config or a pattern to format the attribute with. Ifnull
then the default format will be used.- Returns:
- Formatted value of the specified process attribute ready for the use in an HTML form input field or empty string if not on page
- API:
- This public API is available in Java.
-
current
Gets the current html dialog context.
Will return null if called out of scope. E.g. if called outside of processes
- Returns:
- current html dialog context or null if out of scope
- Since:
- 9.1
- API:
- This public API is available in Java.
-
applicationHomeLink()
instead