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
ConstructorsConstructorDescriptionConstructor.Constructor. -
Method Summary
Modifier and TypeMethodDescriptionstatic StringencodeParam(String str) Encodes a parameter value for use in a query string.static voidExports native JS function cmsOpenEmbeddedDialog.voidCalled on dialog close.voidfinishForProjectOrSiteChange(String sitePath, String serverLink) Called when site and or project have been changed.static voidCalled on load, exports native functions.voidNavigates to the given URI.voidopenDialog(String dialogId, String contextType, List<org.opencms.util.CmsUUID> resources) Opens the dialog with the given id.voidopenDialog(String dialogId, String contextType, List<org.opencms.util.CmsUUID> resources, Map<String, String> params) Opens the dialog with the given id.static voidopenDialog(String dialogId, List<org.opencms.util.CmsUUID> structureIds, Consumer<org.opencms.util.CmsUUID> finishCallback) Opens the given dialog in an iframe.static voidopenDialog(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 voidopenEmbeddedDialog(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.voidreload()Reloads the current page.voidselectString(String principle) Calls the principle select handler and closes the dialog frame.voidsendNotification(boolean error, String notification) Displays a notification.voidsetOnCloseCommand(com.google.gwt.user.client.Command onCloseCommand) Sets the on close command.voidsetStringSelectHandler(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_CmsEmbeddedDialogHandlerJsCallbacksCalled on dialog close.- Specified by:
finishin 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:
finishForProjectOrSiteChangein 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:
leavePagein 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:
reloadin interfaceI_CmsEmbeddedDialogHandlerJsCallbacks
-
selectString
Calls the principle select handler and closes the dialog frame.- Specified by:
selectStringin interfaceI_CmsEmbeddedDialogHandlerJsCallbacks- Parameters:
principle- the principle to select
-
sendNotification
Description copied from interface:I_CmsEmbeddedDialogHandlerJsCallbacksDisplays a notification.- Specified by:
sendNotificationin interfaceI_CmsEmbeddedDialogHandlerJsCallbacks- Parameters:
error- true if it's an errornotification- the notification HTML- See Also:
-
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
-