Class CmsEmbeddedDialogHandler

    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String encodeParam​(java.lang.String str)
      Encodes a parameter value for use in a query string.
      static void exportNativeFunctions()
      Exports native JS function cmsOpenEmbeddedDialog.
      void finish​(java.lang.String resources)
      Called on dialog close.
      boolean hasDialogFrame()
      Returns if the dialog iframe is attached.
      static void initClass()
      Called on load, exports native functions.
      void leavePage​(java.lang.String targetUri)
      Navigates to the given URI.
      void onSiteOrProjectChange​(java.lang.String sitePath, java.lang.String serverLink)
      Called when site and or project have been changed.
      void openDialog​(java.lang.String dialogId, java.lang.String contextType, java.util.List<org.opencms.util.CmsUUID> resources)
      Opens the dialog with the given id.
      void openDialog​(java.lang.String dialogId, java.lang.String contextType, java.util.List<org.opencms.util.CmsUUID> resources, java.util.Map<java.lang.String,​java.lang.String> rawParams)
      Opens the dialog with the given id.
      static void openDialog​(java.lang.String dialogId, java.util.List<org.opencms.util.CmsUUID> structureIds, java.util.function.Consumer<org.opencms.util.CmsUUID> finishCallback)
      Opens the given dialog in an iframe.
      static void openDialog​(java.lang.String dialogId, java.util.List<org.opencms.util.CmsUUID> structureIds, java.util.Map<java.lang.String,​java.lang.String> params, java.util.function.Consumer<org.opencms.util.CmsUUID> finishCallback)
      Opens the given dialog in an iframe.
      static void openEmbeddedDialog​(java.lang.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.
      protected java.util.List<org.opencms.util.CmsUUID> parseResources​(java.lang.String resources)
      Parses the resources string.
      void reload()
      Reloads the current page.
      void selectString​(java.lang.String principle)
      Calls the principle select handler and closes the dialog frame.
      void setOnCloseCommand​(com.google.gwt.user.client.Command onCloseCommand)
      Sets the on close command.
      void setStringSelectHandler​(I_CmsStringSelectHandler selectHandler)
      Sets the principle select handler.
      • Methods inherited from class java.lang.Object

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

      • encodeParam

        public static java.lang.String encodeParam​(java.lang.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​(java.lang.String dialogId,
                                      java.util.List<org.opencms.util.CmsUUID> structureIds,
                                      java.util.function.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​(java.lang.String dialogId,
                                      java.util.List<org.opencms.util.CmsUUID> structureIds,
                                      java.util.Map<java.lang.String,​java.lang.String> params,
                                      java.util.function.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​(java.lang.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​(java.lang.String resources)
        Called on dialog close.

        Parameters:
        resources - the resource ids to update as a ';' separated string.

      • hasDialogFrame

        public boolean hasDialogFrame()
        Returns if the dialog iframe is attached.

        Returns:
        true if the dialog iframe is attached
      • leavePage

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

        Parameters:
        targetUri - the target URI
      • onSiteOrProjectChange

        public void onSiteOrProjectChange​(java.lang.String sitePath,
                                          java.lang.String serverLink)
        Called when site and or project have been changed.

        Parameters:
        sitePath - the site path to the resource to display
        serverLink - the server link to the resource to display
      • openDialog

        public void openDialog​(java.lang.String dialogId,
                               java.lang.String contextType,
                               java.util.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​(java.lang.String dialogId,
                               java.lang.String contextType,
                               java.util.List<org.opencms.util.CmsUUID> resources,
                               java.util.Map<java.lang.String,​java.lang.String> rawParams)
        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
        rawParams - additional set of parameters to append to the query string (will not be escaped, therefore 'raw')
      • reload

        public void reload()
        Reloads the current page.

      • selectString

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

        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
      • parseResources

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

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