Class CmsEmbeddedDialogHandler

java.lang.Object
org.opencms.gwt.client.util.CmsEmbeddedDialogHandler
All Implemented Interfaces:
I_CmsHasInit, I_CmsEmbeddedDialogHandlerJsCallbacks

Handler for embedded VAADIN dialogs.

  • Constructor Details

  • Method Details

    • encodeParam

      public static String encodeParam(String str)
      Encodes a parameter value for use in a query string.
      Parameters:
      str - the string to encode
      Returns:
      the encoded string
    • exportNativeFunctions

      public static void exportNativeFunctions()
      Exports native JS function cmsOpenEmbeddedDialog.
    • initClass

      public static void initClass()
      Called on load, exports native functions.
    • openDialog

      public static void openDialog(String dialogId, List<org.opencms.util.CmsUUID> structureIds, Consumer<org.opencms.util.CmsUUID> finishCallback)
      Opens the given dialog in an iframe.
      Parameters:
      dialogId - the action class
      structureIds - the structure ids for the action
      finishCallback - the callback to call after the dialog closes
    • openDialog

      public static void openDialog(String dialogId, List<org.opencms.util.CmsUUID> structureIds, Map<String,String> params, Consumer<org.opencms.util.CmsUUID> finishCallback)
      Opens the given dialog in an iframe.
      Parameters:
      dialogId - the action class
      structureIds - the structure ids for the action
      params - additional parameters to pass
      finishCallback - the callback to call after the dialog closes
    • openEmbeddedDialog

      public static void openEmbeddedDialog(String dialogId, com.google.gwt.core.client.JavaScriptObject callback, com.google.gwt.core.client.JsArrayString structureIds, com.google.gwt.core.client.JavaScriptObject params)
      Opens an embedded dialog.
      Parameters:
      dialogId - the dialog
      callback - the onClose callback
      structureIds - the structure ids
      params - the parameters
    • finish

      public void finish(String resources)
      Description copied from interface: I_CmsEmbeddedDialogHandlerJsCallbacks
      Called on dialog close.

      Specified by:
      finish in interface I_CmsEmbeddedDialogHandlerJsCallbacks
      Parameters:
      resources - the resource ids to update as a ';' separated string.

      See Also:
    • finishForProjectOrSiteChange

      public void finishForProjectOrSiteChange(String sitePath, String serverLink)
      Called when site and or project have been changed.

      Specified by:
      finishForProjectOrSiteChange in interface I_CmsEmbeddedDialogHandlerJsCallbacks
      Parameters:
      sitePath - the site path to the resource to display
      serverLink - the server link to the resource to display
    • leavePage

      public void leavePage(String targetUri)
      Navigates to the given URI.

      Specified by:
      leavePage in interface I_CmsEmbeddedDialogHandlerJsCallbacks
      Parameters:
      targetUri - the target URI
    • openDialog

      public void openDialog(String dialogId, String contextType, List<org.opencms.util.CmsUUID> resources)
      Opens the dialog with the given id.

      Parameters:
      dialogId - the dialog id
      contextType - the context type, used to check the action visibility
      resources - the resource to handle
    • openDialog

      public void openDialog(String dialogId, String contextType, List<org.opencms.util.CmsUUID> resources, Map<String,String> params)
      Opens the dialog with the given id.

      Parameters:
      dialogId - the dialog id
      contextType - the context type, used to check the action visibility
      resources - the resource to handle
      params - additional set of parameters
    • reload

      public void reload()
      Reloads the current page.

      Specified by:
      reload in interface I_CmsEmbeddedDialogHandlerJsCallbacks
    • selectString

      public void selectString(String principle)
      Calls the principle select handler and closes the dialog frame.

      Specified by:
      selectString in interface I_CmsEmbeddedDialogHandlerJsCallbacks
      Parameters:
      principle - the principle to select
    • setOnCloseCommand

      public void setOnCloseCommand(com.google.gwt.user.client.Command onCloseCommand)
      Sets the on close command.

      Parameters:
      onCloseCommand - the on close command
    • setStringSelectHandler

      public void setStringSelectHandler(I_CmsStringSelectHandler selectHandler)
      Sets the principle select handler.

      Parameters:
      selectHandler - the principle select handler
    • parseResources

      protected List<org.opencms.util.CmsUUID> parseResources(String resources)
      Parses the resources string.

      Parameters:
      resources - the resources
      Returns:
      the list of resource ids