Interface IHtmlDialogContext


public 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 Details

    • get

      String get(String attributeName)
      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

      String get(String attributeName, String format)
      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

      Object getObject(String attributeName)
      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 or null if not on a page
      API:
      This public API is available in Java.
    • ref

      @Deprecated(since="11.3", forRemoval=true) String ref(String linkName)
      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.
      Is doing exactly the same like ref(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(since="11.3") String fileref(File file)
      Deprecated.
      use fileLink(File) instead
      Returns the url to the specified file for download (empty string if file is null).
      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(since="11.3") String fileref(String path, boolean isTemporary)
      Deprecated.
      Returns the url to the specified file for download (empty string if path is null).
      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

      WebLink fileLink(String path, boolean isTemporary)
      Returns a WebLink to download the file with the given path (WebLink.EMPTY if path is null).
      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(since="9.1") String taskStartRef(ITask taskToStart)
      Deprecated.
      Gets a reference to start the specified task (empty string if task is null 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(since="8.0") String taskstartref(ITask taskToStart)
      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(since="9.1") String taskStartInFrameRef(ITask taskToStart)
      Gets a reference to start the specified task (empty string if task is null 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(since="11.3") String startRef(String startName)
      Deprecated.
      use startLink(String) instead
      Returns 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

      WebLink startLink(String startName)
      Returns a WebLink 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 a WebLink 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(since="8.0") String startref(String startName)
      Deprecated.
      use startRef(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

      String startInFrameRef(String startName)
      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

      WebLink startInFrameLink(String startName)
      Returns a WebLink 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 a WebLink 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

      Returns the reference to the specified content object for download (empty string, if co is null 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

      WebLink coLink(ContentObject co)
      Returns a WebLink to download the given content object (WebLink.EMPTY if co is null or not downloadable).
      Parameters:
      co - the co to get a WebLink 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(since="11.3") String coref(String cmsUri)
      Deprecated.
      use coLink(String) instead
      Returns 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

      WebLink coLink(String cmsPath)
      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 an WebLink 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

      String wr(String relativeWebContentUri)

      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(since="9.4", forRemoval=true) default String 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(since="11.3") String taskListRef()
      Deprecated.
      use taskListLink() instead

      Returns 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(since="11.3") String processStartListRef()
      Deprecated.

      Returns 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(since="11.3") String applicationHomeRef()
      Deprecated.

      Returns 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(since="11.3") String loginRef()
      Deprecated.
      use loginLink() instead

      Returns 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

      String escape(Object obj)

      Does format the object with the default format and then escape the characters in a String using HTML entities.

      For example:

      "bread" & "butter"

      becomes:

      &quot;bread&quot; &amp; &quot;butter&quot;

      Supports all known HTML 4.0 entities, including funky accents. Note that the commonly used apostrophe escape character (&apos;) is not a legal entity and so is not supported).

      Parameters:
      obj - the String to escape, may be null
      Returns:
      a new escaped String, null if null object input
      See Also:
      API:
      This public API is available in Java.
    • escape

      String escape(String str)

      Escapes the characters in a String using HTML entities.

      For example:

      "bread" & "butter"

      becomes:

      &quot;bread&quot; &amp; &quot;butter&quot;

      Supports all known HTML 4.0 entities, including funky accents. Note that the commonly used apostrophe escape character (&apos;) is not a legal entity and so is not supported).

      Parameters:
      str - the String to escape, may be null
      Returns:
      a new escaped String, null if null string input
      See Also:
      API:
      This public API is available in Java.
    • getFormValue

      String 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. 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

      String 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. 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. If null 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

      static IHtmlDialogContext 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.