Package org.opencms.gwt.client.util
Class CmsEmbeddedDialogHandler
java.lang.Object
org.opencms.gwt.client.util.CmsEmbeddedDialogHandler
- All Implemented Interfaces:
I_CmsHasInit
,I_CmsEmbeddedDialogHandlerJsCallbacks
public class CmsEmbeddedDialogHandler
extends Object
implements I_CmsHasInit, I_CmsEmbeddedDialogHandlerJsCallbacks
Handler for embedded VAADIN dialogs.
-
Constructor Summary
ConstructorDescriptionConstructor.Constructor. -
Method Summary
Modifier and TypeMethodDescriptionstatic String
encodeParam
(String str) Encodes a parameter value for use in a query string.static void
Exports native JS function cmsOpenEmbeddedDialog.void
Called on dialog close.void
finishForProjectOrSiteChange
(String sitePath, String serverLink) Called when site and or project have been changed.static void
Called on load, exports native functions.void
Navigates to the given URI.void
openDialog
(String dialogId, String contextType, List<org.opencms.util.CmsUUID> resources) Opens the dialog with the given id.void
openDialog
(String dialogId, String contextType, List<org.opencms.util.CmsUUID> resources, Map<String, String> params) Opens the dialog with the given id.static void
openDialog
(String dialogId, List<org.opencms.util.CmsUUID> structureIds, Consumer<org.opencms.util.CmsUUID> finishCallback) Opens the given dialog in an iframe.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.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.protected List<org.opencms.util.CmsUUID>
parseResources
(String resources) Parses the resources string.void
reload()
Reloads the current page.void
selectString
(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.
-
Constructor Details
-
CmsEmbeddedDialogHandler
public CmsEmbeddedDialogHandler()Constructor.
-
-
Method Details
-
encodeParam
Encodes a parameter value for use in a query string.- Parameters:
str
- the string to encode- Returns:
- the encoded string
-
exportNativeFunctions
Exports native JS function cmsOpenEmbeddedDialog. -
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 classstructureIds
- the structure ids for the actionfinishCallback
- 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 classstructureIds
- the structure ids for the actionparams
- additional parameters to passfinishCallback
- 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 dialogcallback
- the onClose callbackstructureIds
- the structure idsparams
- the parameters
-
finish
Description copied from interface:I_CmsEmbeddedDialogHandlerJsCallbacks
Called on dialog close.- Specified by:
finish
in interfaceI_CmsEmbeddedDialogHandlerJsCallbacks
- Parameters:
resources
- the resource ids to update as a ';' separated string.- See Also:
-
finishForProjectOrSiteChange
Called when site and or project have been changed.- Specified by:
finishForProjectOrSiteChange
in interfaceI_CmsEmbeddedDialogHandlerJsCallbacks
- Parameters:
sitePath
- the site path to the resource to displayserverLink
- the server link to the resource to display
-
leavePage
Navigates to the given URI.- Specified by:
leavePage
in interfaceI_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 idcontextType
- the context type, used to check the action visibilityresources
- 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 idcontextType
- the context type, used to check the action visibilityresources
- the resource to handleparams
- additional set of parameters
-
reload
Reloads the current page.- Specified by:
reload
in interfaceI_CmsEmbeddedDialogHandlerJsCallbacks
-
selectString
Calls the principle select handler and closes the dialog frame.- Specified by:
selectString
in interfaceI_CmsEmbeddedDialogHandlerJsCallbacks
- Parameters:
principle
- the principle to select
-
setOnCloseCommand
Sets the on close command.- Parameters:
onCloseCommand
- the on close command
-
parseResources
Parses the resources string.- Parameters:
resources
- the resources- Returns:
- the list of resource ids
-