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 java.lang.Object implements I_CmsHasInit, I_CmsEmbeddedDialogHandlerJsCallbacks
Handler for embedded VAADIN dialogs.
-
-
Constructor Summary
Constructors Constructor Description CmsEmbeddedDialogHandler()
Constructor.CmsEmbeddedDialogHandler(I_CmsActionHandler handler)
Constructor.
-
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.void
finishForProjectOrSiteChange(java.lang.String sitePath, java.lang.String serverLink)
Called when site and or project have been changed.static void
initClass()
Called on load, exports native functions.void
leavePage(java.lang.String targetUri)
Navigates to the given URI.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> params)
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.
-
-
-
Constructor Detail
-
CmsEmbeddedDialogHandler
public CmsEmbeddedDialogHandler()
Constructor.
-
CmsEmbeddedDialogHandler
public CmsEmbeddedDialogHandler(I_CmsActionHandler handler)
Constructor.- Parameters:
handler
- the context handler
-
-
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 classstructureIds
- the structure ids for the actionfinishCallback
- 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 classstructureIds
- the structure ids for the actionparams
- additional parameters to passfinishCallback
- 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 dialogcallback
- the onClose callbackstructureIds
- the structure idsparams
- the parameters
-
finish
public void finish(java.lang.String resources)
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:
I_CmsEmbeddedDialogHandlerJsCallbacks.finish(java.lang.String)
-
finishForProjectOrSiteChange
public void finishForProjectOrSiteChange(java.lang.String sitePath, java.lang.String serverLink)
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
public void leavePage(java.lang.String targetUri)
Navigates to the given URI.- Specified by:
leavePage
in interfaceI_CmsEmbeddedDialogHandlerJsCallbacks
- Parameters:
targetUri
- the target URI
-
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 idcontextType
- the context type, used to check the action visibilityresources
- 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> 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
public void reload()
Reloads the current page.- Specified by:
reload
in interfaceI_CmsEmbeddedDialogHandlerJsCallbacks
-
selectString
public void selectString(java.lang.String principle)
Calls the principle select handler and closes the dialog frame.- Specified by:
selectString
in interfaceI_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 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
-
-