Class UserServiceUtils

java.lang.Object
com.apgar.common.lib.utils.UserServiceUtils

public class UserServiceUtils extends Object
Utility class providing methods for displaying loading indicators, error messages, and managing user service interactions in a web interface.
Author:
Apgar Consulting
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    displayIframeDivAndRefreshOnButtonClick(com.orchestranetworks.userservice.UserServiceWriter writer, String buttonId, String divId)
    Displays a specific div element and refreshes its content when a button is clicked.
    static void
    hideMainDivAndShowWaitOnClick(com.orchestranetworks.userservice.UserServicePaneWriter writer, String submitButtonId, String waitDivId, String mainDivId)
    Shows a loading screen and hides a specific div when the user clicks a designated button.
    static void
    setInputEventListenerJS(com.orchestranetworks.userservice.UserServicePaneWriter aWriter, String inputElementId, String functionToTrigger)
    Sets an event listener for an input element to trigger a specified function on Enter key press.
    static void
    syncIframeHeightWithParent(com.orchestranetworks.userservice.UserServiceWriter writer)
    Synchronizes the height of an iframe with its parent window.
    static void
    writeDisplayWaitJs(com.orchestranetworks.userservice.UserServiceWriter writer, String divId)
    Displays the loading div element in the user interface using JavaScript.
    static void
    writeError(com.orchestranetworks.userservice.UserServicePaneWriter writer, String divId, String message)
    Displays an error message in the center of the screen.
    static void
    writeExportValidationWait(com.orchestranetworks.userservice.UserServicePaneWriter writer, String divId, String message)
    Displays a loading sign during the export validation process with a custom message.
    static void
    writeHideDivJs(com.orchestranetworks.userservice.UserServiceWriter writer, String divId)
    Hides the specified div element using JavaScript.
    static void
    writeHideWaitJsIFrame(com.orchestranetworks.userservice.UserServiceWriter writer, String divId)
    Hides the loading div element in an iframe context, depending on the current user session.
    static void
    writeHideWaitJsWsIFrame(com.orchestranetworks.userservice.UserServiceWriter writer, String divId)
    Hides the loading div element in a specific iframe context.
    static void
    writeWait(com.orchestranetworks.userservice.UserServicePaneWriter writer, String divId)
    Displays a loading sign in the center of the screen.
    static void
    writeWait(com.orchestranetworks.userservice.UserServicePaneWriter writer, String divId, String message)
    Displays a loading sign in the center of the screen with a custom message.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • writeWait

      public static void writeWait(com.orchestranetworks.userservice.UserServicePaneWriter writer, String divId)
      Displays a loading sign in the center of the screen.
      Parameters:
      writer - the UserServicePaneWriter used to write the loading sign
      divId - the ID of the div element where the loading sign will be displayed
    • writeWait

      public static void writeWait(com.orchestranetworks.userservice.UserServicePaneWriter writer, String divId, String message)
      Displays a loading sign in the center of the screen with a custom message.
      Parameters:
      writer - the UserServicePaneWriter used to write the loading sign
      divId - the ID of the div element where the loading sign will be displayed
      message - the message to display alongside the loading sign
    • writeExportValidationWait

      public static void writeExportValidationWait(com.orchestranetworks.userservice.UserServicePaneWriter writer, String divId, String message)
      Displays a loading sign during the export validation process with a custom message.
      Parameters:
      writer - the UserServicePaneWriter used to write the loading sign
      divId - the ID of the div element where the loading sign will be displayed
      message - the message to display alongside the loading sign
    • writeError

      public static void writeError(com.orchestranetworks.userservice.UserServicePaneWriter writer, String divId, String message)
      Displays an error message in the center of the screen.
      Parameters:
      writer - the UserServicePaneWriter used to write the error message
      divId - the ID of the div element where the error message will be displayed
      message - the error message to display
    • writeDisplayWaitJs

      public static void writeDisplayWaitJs(com.orchestranetworks.userservice.UserServiceWriter writer, String divId)
      Displays the loading div element in the user interface using JavaScript.
      Parameters:
      writer - the UserServiceWriter used to add JavaScript code
      divId - the ID of the div element to display
    • writeHideDivJs

      public static void writeHideDivJs(com.orchestranetworks.userservice.UserServiceWriter writer, String divId)
      Hides the specified div element using JavaScript.
      Parameters:
      writer - the UserServiceWriter used to add JavaScript code
      divId - the ID of the div element to hide
    • writeHideWaitJsIFrame

      public static void writeHideWaitJsIFrame(com.orchestranetworks.userservice.UserServiceWriter writer, String divId)
      Hides the loading div element in an iframe context, depending on the current user session.
      Parameters:
      writer - the UserServiceWriter used to add JavaScript code
      divId - the ID of the div element to hide
    • writeHideWaitJsWsIFrame

      public static void writeHideWaitJsWsIFrame(com.orchestranetworks.userservice.UserServiceWriter writer, String divId)
      Hides the loading div element in a specific iframe context.
      Parameters:
      writer - the UserServiceWriter used to add JavaScript code
      divId - the ID of the div element to hide
    • syncIframeHeightWithParent

      public static void syncIframeHeightWithParent(com.orchestranetworks.userservice.UserServiceWriter writer)
      Synchronizes the height of an iframe with its parent window.
      Parameters:
      writer - the UserServiceWriter used to add JavaScript code
    • displayIframeDivAndRefreshOnButtonClick

      public static void displayIframeDivAndRefreshOnButtonClick(com.orchestranetworks.userservice.UserServiceWriter writer, String buttonId, String divId)
      Displays a specific div element and refreshes its content when a button is clicked.
      Parameters:
      writer - the UserServiceWriter used to add JavaScript code
      buttonId - the ID of the button that triggers the display and refresh
      divId - the ID of the div element to display
    • hideMainDivAndShowWaitOnClick

      public static void hideMainDivAndShowWaitOnClick(com.orchestranetworks.userservice.UserServicePaneWriter writer, String submitButtonId, String waitDivId, String mainDivId)
      Shows a loading screen and hides a specific div when the user clicks a designated button.
      Parameters:
      writer - the UserServicePaneWriter used to add JavaScript code
      submitButtonId - the ID of the submit button
      waitDivId - the ID of the waiting div to display
      mainDivId - the ID of the main div to hide
    • setInputEventListenerJS

      public static void setInputEventListenerJS(com.orchestranetworks.userservice.UserServicePaneWriter aWriter, String inputElementId, String functionToTrigger)
      Sets an event listener for an input element to trigger a specified function on Enter key press.
      Parameters:
      aWriter - the UserServicePaneWriter used to add JavaScript code
      inputElementId - the ID of the input element to listen for events
      functionToTrigger - the JavaScript function to call when Enter is pressed