Class ScriptHelper


  • public final class ScriptHelper
    extends java.lang.Object
    Provides static helper methods to be used in server-side scripts in masks.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static com.saperion.connector.SaClassicConnector getClassicConnector()
      Provides an instance of the SaClassicConnector.
      static User getCurrentUser()
      Provides the current logged in user object.
      static IntelligentField getFieldByName​(IntelligentFormView form, java.lang.String name)
      Returns the field with the specified name or null, if no field was found.
      static void logDebug​(java.lang.String message)
      Logs a debug-message in the logfile.
      static void logError​(java.lang.String message)
      Logs an error-message in the logfile.
      static void logInfo​(java.lang.String message)
      Logs an info-message in the logfile.
      static void logWarning​(java.lang.String message)
      Logs a warning-message in the logfile.
      static java.util.List<com.saperion.intf.SaDocumentInfo> performQuery​(java.lang.String query)
      Performs a query against the classic Connector.
      static void postQueryEvent​(IntelligentFormView form)
      Posts a query event (onButton-event of type ON_QUERY) to the given form.
      static void showErrorMessage​(java.lang.String error)
      Shows an error message box with the given message to the user.
      static void showInfoMessage​(java.lang.String message)
      Shows an info message box with the given message to the user.
      • Methods inherited from class java.lang.Object

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

      • getFieldByName

        public static IntelligentField getFieldByName​(IntelligentFormView form,
                                                      java.lang.String name)
        Returns the field with the specified name or null, if no field was found.
        Parameters:
        form - parent form
        name - field name
        Returns:
        field or null if not found
      • postQueryEvent

        public static void postQueryEvent​(IntelligentFormView form)
        Posts a query event (onButton-event of type ON_QUERY) to the given form.
        Parameters:
        form - The IntelligentFormView the event should be post to.
      • getCurrentUser

        public static User getCurrentUser()
        Provides the current logged in user object.
        Returns:
      • getClassicConnector

        public static com.saperion.connector.SaClassicConnector getClassicConnector()
        Provides an instance of the SaClassicConnector.
        Returns:
        an instance of the SaClassicConnector.
      • performQuery

        public static java.util.List<com.saperion.intf.SaDocumentInfo> performQuery​(java.lang.String query)
        Performs a query against the classic Connector.
        Parameters:
        query -
        Returns:
      • showInfoMessage

        public static void showInfoMessage​(java.lang.String message)
        Shows an info message box with the given message to the user.
        Parameters:
        message - The message to show.
      • showErrorMessage

        public static void showErrorMessage​(java.lang.String error)
        Shows an error message box with the given message to the user.
        Parameters:
        error - The message to show.
      • logError

        public static void logError​(java.lang.String message)
        Logs an error-message in the logfile.
        Parameters:
        message - the message
      • logWarning

        public static void logWarning​(java.lang.String message)
        Logs a warning-message in the logfile.
        Parameters:
        message - the message
      • logInfo

        public static void logInfo​(java.lang.String message)
        Logs an info-message in the logfile.
        Parameters:
        message - the message
      • logDebug

        public static void logDebug​(java.lang.String message)
        Logs a debug-message in the logfile.
        Parameters:
        message - the message