Package org.opencms.ade.publish.client
Class CmsPublishDialog
- java.lang.Object
-
- com.google.gwt.user.client.ui.UIObject
-
- com.google.gwt.user.client.ui.Widget
-
- com.google.gwt.user.client.ui.Panel
-
- com.google.gwt.user.client.ui.SimplePanel
-
- com.google.gwt.user.client.ui.PopupPanel
-
- org.opencms.gwt.client.ui.CmsPopup
-
- org.opencms.ade.publish.client.CmsPublishDialog
-
- All Implemented Interfaces:
com.google.gwt.event.logical.shared.HasAttachHandlers
,com.google.gwt.event.logical.shared.HasCloseHandlers<com.google.gwt.user.client.ui.PopupPanel>
,com.google.gwt.event.shared.HasHandlers
,com.google.gwt.user.client.EventListener
,com.google.gwt.user.client.EventPreview
,com.google.gwt.user.client.ui.AcceptsOneWidget
,com.google.gwt.user.client.ui.HasAnimation
,com.google.gwt.user.client.ui.HasOneWidget
,com.google.gwt.user.client.ui.HasVisibility
,com.google.gwt.user.client.ui.HasWidgets
,com.google.gwt.user.client.ui.HasWidgets.ForIsWidget
,com.google.gwt.user.client.ui.IsWidget
,com.google.gwt.user.client.ui.SourcesPopupEvents
,java.lang.Iterable<com.google.gwt.user.client.ui.Widget>
,I_CmsAutoHider
public class CmsPublishDialog extends CmsPopup
Main class for the publish dialog.This class is mostly responsible for the control flow and RPC calls of the publish dialog. It delegates most of the actual GUI work to the
CmsPublishSelectPanel
andCmsBrokenLinksPanel
classes.- Since:
- 8.0.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CmsPublishDialog.State
A type which represents the state of a publish action.-
Nested classes/interfaces inherited from class org.opencms.gwt.client.ui.CmsPopup
CmsPopup.HistoryHandler
-
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.PopupPanel
com.google.gwt.user.client.ui.PopupPanel.AnimationType, com.google.gwt.user.client.ui.PopupPanel.PositionCallback
-
-
Field Summary
Fields Modifier and Type Field Description static int
DIALOG_WIDTH
The dialog width in pixels.protected CmsPublishSelectPanel
m_publishSelectPanel
The panel for selecting the resources to publish or remove from the publish list.static java.util.Map<java.lang.String,java.lang.String>
m_staticProjects
The project map used by showPublishDialog.static int
PANEL_BROKEN_LINKS
The index of the "broken links" panel.static int
PANEL_SELECT
The index of the publish selection panel.-
Fields inherited from class org.opencms.gwt.client.ui.CmsPopup
DEFAULT_WIDTH, m_closeCommand, m_notificationWidgetInstalled, m_windowWidth, WIDE_WIDTH
-
-
Constructor Summary
Constructors Constructor Description CmsPublishDialog(org.opencms.ade.publish.shared.CmsPublishData initData, java.lang.Runnable refreshAction, I_CmsContentEditorHandler editorHandler)
Constructs a new publish dialog.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
executeAction(org.opencms.ade.publish.shared.CmsWorkflowAction actionKey)
Executes the specified action for the selected resources.CmsContextMenuHandler
getContextMenuHandler()
Gets the context menu handler.I_CmsContentEditorHandler
getEditorHandler()
Returns the content editor handler.java.lang.String
getFailureMessage()
Gets the failure message.org.opencms.ade.publish.shared.CmsWorkflowAction
getLastAction()
Gets the last workflow action.CmsContextMenuHandler
getMenuHandler()
Gets the context menu handler.org.opencms.ade.publish.shared.CmsPublishOptions
getPublishOptions()
Returns the current publish options.protected org.opencms.ade.publish.shared.CmsWorkflow
getSelectedWorkflow()
Returns the selected workflow.protected static org.opencms.ade.publish.shared.rpc.I_CmsPublishServiceAsync
getService()
Returns the publish service instance.CmsPublishDialog.State
getState()
Gets the publish dialog state.protected org.opencms.ade.publish.shared.CmsWorkflowActionParams
getWorkflowActionParams()
Gets the workflow action parameters to which the workflow action should be applied.boolean
hasFailed()
Checks whether the publish dialog has failed.boolean
hasSucceeded()
Checks whether the publish dialog has succeeded.void
onCancel()
Method which is called when the cancel button is pressed.void
onGoBack()
Method which is called when the back button is pressed.void
onReceivePublishList(org.opencms.ade.publish.shared.CmsPublishGroupList groups)
Method which is called after the publish list has been received from the server.void
onReceiveStatus(org.opencms.ade.publish.shared.CmsWorkflowResponse brokenResources)
Method which is called after the status from a publish action has arrived.void
setIncludeRelated(boolean includeRelated)
Sets the include related resources option.void
setIncludeSiblings(boolean includeSiblings)
Sets the include sibling resources option.protected void
setLastAction(org.opencms.ade.publish.shared.CmsWorkflowAction action)
Sets the last workflow action.void
setPanel(int panelId)
Changes the currently active panel.void
setProjectChanged()
This is called when the user just changed the project.void
setProjectId(org.opencms.util.CmsUUID projectId)
Sets the selected project id.void
setWorkflowId(java.lang.String workflowId)
Sets the selected workflow id.static void
showPublishDialog(java.lang.Runnable refreshAction)
Convenience method which opens a publish dialog.static void
showPublishDialog(java.util.HashMap<java.lang.String,java.lang.String> params, com.google.gwt.event.logical.shared.CloseHandler<com.google.gwt.user.client.ui.PopupPanel> handler, java.lang.Runnable refreshAction, I_CmsContentEditorHandler editorHandler)
Convenience method which opens a publish dialog.static void
showPublishDialog(org.opencms.ade.publish.shared.CmsPublishData result, com.google.gwt.event.logical.shared.CloseHandler<com.google.gwt.user.client.ui.PopupPanel> handler, java.lang.Runnable refreshAction, I_CmsContentEditorHandler editorHandler)
Shows the publish dialog.void
succeed()
Sets the publish dialog state to 'success'.void
updateResourceList()
Method which is called when the publish options are changed.-
Methods inherited from class org.opencms.gwt.client.ui.CmsPopup
add, add, addButton, addButton, addDialogClose, adjustIndex, beginDragging, catchNotifications, center, centerHorizontally, checkIndexBoundsForAccess, checkIndexBoundsForInsertion, clear, continueDragging, createDialogNotificationWidget, doAttachChildren, doDetachChildren, endDragging, getAvailableHeight, getCaption, getChildren, getContainerElement, getWidget, getWidgetCount, getWidgetIndex, getWidgetIndex, getWidth, hasCaption, hide, hide, insert, insert, insertFront, installNotificationWidget, iterator, onBrowserEvent, onDetach, onPreviewNativeEvent, remove, remove, removeAllButtons, removeButton, removePadding, setBackgroundColor, setCaption, setHeight, setHeight, setMainContent, setPixelSize, setPositionFixed, setSize, setSpecialBackgroundClass, setUseAnimation, setWidget, setWidth, setWidth, show, showArrow, wrapWithBorderPadding
-
Methods inherited from class com.google.gwt.user.client.ui.PopupPanel
addAutoHidePartner, addCloseHandler, addPopupListener, getAnimationType, getGlassElement, getGlassStyleName, getOffsetHeight, getOffsetWidth, getPopupLeft, getPopupTop, getStyleElement, getTitle, isAnimationEnabled, isAutoHideEnabled, isAutoHideOnHistoryEventsEnabled, isGlassEnabled, isModal, isPreviewingAllNativeEvents, isShowing, isVisible, onEventPreview, onKeyDownPreview, onKeyPressPreview, onKeyUpPreview, onUnload, removeAutoHidePartner, removePopupListener, setAnimationEnabled, setAnimationType, setAutoHideEnabled, setAutoHideOnHistoryEventsEnabled, setGlassEnabled, setGlassStyleName, setModal, setPopupPosition, setPopupPositionAndShow, setPreviewingAllNativeEvents, setTitle, setVisible, showRelativeTo
-
Methods inherited from class com.google.gwt.user.client.ui.Widget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, onAttach, onLoad, removeFromParent, setLayoutData, sinkEvents, unsinkEvents
-
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, resolvePotentialElement, setElement, setElement, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setVisible, sinkBitlessEvent, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.opencms.gwt.client.ui.I_CmsAutoHider
addAutoHidePartner, isAutoHideEnabled, isAutoHideOnHistoryEventsEnabled, removeAutoHidePartner, setAutoHideEnabled, setAutoHideOnHistoryEventsEnabled
-
-
-
-
Field Detail
-
DIALOG_WIDTH
public static final int DIALOG_WIDTH
The dialog width in pixels.- See Also:
- Constant Field Values
-
m_staticProjects
public static java.util.Map<java.lang.String,java.lang.String> m_staticProjects
The project map used by showPublishDialog.
-
PANEL_BROKEN_LINKS
public static final int PANEL_BROKEN_LINKS
The index of the "broken links" panel.- See Also:
- Constant Field Values
-
PANEL_SELECT
public static final int PANEL_SELECT
The index of the publish selection panel.- See Also:
- Constant Field Values
-
m_publishSelectPanel
protected CmsPublishSelectPanel m_publishSelectPanel
The panel for selecting the resources to publish or remove from the publish list.
-
-
Constructor Detail
-
CmsPublishDialog
public CmsPublishDialog(org.opencms.ade.publish.shared.CmsPublishData initData, java.lang.Runnable refreshAction, I_CmsContentEditorHandler editorHandler)
Constructs a new publish dialog.- Parameters:
initData
- the initial datarefreshAction
- the action to perform on a context menu triggered refresheditorHandler
- the content editor handler
-
-
Method Detail
-
showPublishDialog
public static void showPublishDialog(org.opencms.ade.publish.shared.CmsPublishData result, com.google.gwt.event.logical.shared.CloseHandler<com.google.gwt.user.client.ui.PopupPanel> handler, java.lang.Runnable refreshAction, I_CmsContentEditorHandler editorHandler)
Shows the publish dialog.- Parameters:
result
- the publish datahandler
- the dialog close handler (may be null)refreshAction
- the action to execute on a context menu triggered refresheditorHandler
- the content editor handler (may be null)
-
showPublishDialog
public static void showPublishDialog(java.util.HashMap<java.lang.String,java.lang.String> params, com.google.gwt.event.logical.shared.CloseHandler<com.google.gwt.user.client.ui.PopupPanel> handler, java.lang.Runnable refreshAction, I_CmsContentEditorHandler editorHandler)
Convenience method which opens a publish dialog.- Parameters:
handler
- the close handlerparams
- the additional publish dialog parametersrefreshAction
- the action to execute after a context menu triggered refresheditorHandler
- the content editor handler
-
showPublishDialog
public static void showPublishDialog(java.lang.Runnable refreshAction)
Convenience method which opens a publish dialog.- Parameters:
refreshAction
- the action to execute after a context menu triggered refresh
-
getService
protected static org.opencms.ade.publish.shared.rpc.I_CmsPublishServiceAsync getService()
Returns the publish service instance.- Returns:
- the publish service instance
-
executeAction
public void executeAction(org.opencms.ade.publish.shared.CmsWorkflowAction actionKey)
Executes the specified action for the selected resources.- Parameters:
actionKey
- the workflow action
-
getContextMenuHandler
public CmsContextMenuHandler getContextMenuHandler()
Gets the context menu handler.- Returns:
- the context menu handler
-
getEditorHandler
public I_CmsContentEditorHandler getEditorHandler()
Returns the content editor handler.- Returns:
- the content editor handler
-
getFailureMessage
public java.lang.String getFailureMessage()
Gets the failure message.- Returns:
- the failure message
-
getLastAction
public org.opencms.ade.publish.shared.CmsWorkflowAction getLastAction()
Gets the last workflow action.- Returns:
- the last workflow action
-
getMenuHandler
public CmsContextMenuHandler getMenuHandler()
Gets the context menu handler.
-
getPublishOptions
public org.opencms.ade.publish.shared.CmsPublishOptions getPublishOptions()
Returns the current publish options.- Returns:
- a publish options bean
-
getState
public CmsPublishDialog.State getState()
Gets the publish dialog state.- Returns:
- the publish dialog state
-
hasFailed
public boolean hasFailed()
Checks whether the publish dialog has failed.- Returns:
- checks whether the publish dialog has succeeded
-
hasSucceeded
public boolean hasSucceeded()
Checks whether the publish dialog has succeeded.- Returns:
- true if the publish dialog has succeeded
-
onCancel
public void onCancel()
Method which is called when the cancel button is pressed.
-
onGoBack
public void onGoBack()
Method which is called when the back button is pressed.
-
onReceivePublishList
public void onReceivePublishList(org.opencms.ade.publish.shared.CmsPublishGroupList groups)
Method which is called after the publish list has been received from the server.- Parameters:
groups
- the groups of the publish list
-
onReceiveStatus
public void onReceiveStatus(org.opencms.ade.publish.shared.CmsWorkflowResponse brokenResources)
Method which is called after the status from a publish action has arrived.- Parameters:
brokenResources
- the list of broken resources
-
setIncludeRelated
public void setIncludeRelated(boolean includeRelated)
Sets the include related resources option.- Parameters:
includeRelated
- the include related option
-
setIncludeSiblings
public void setIncludeSiblings(boolean includeSiblings)
Sets the include sibling resources option.- Parameters:
includeSiblings
- the include siblings option
-
setPanel
public void setPanel(int panelId)
Changes the currently active panel.- Parameters:
panelId
- the number of the panel to show
-
setProjectChanged
public void setProjectChanged()
This is called when the user just changed the project.
-
setProjectId
public void setProjectId(org.opencms.util.CmsUUID projectId)
Sets the selected project id.- Parameters:
projectId
- the project id
-
setWorkflowId
public void setWorkflowId(java.lang.String workflowId)
Sets the selected workflow id.- Parameters:
workflowId
- the workflow id
-
succeed
public void succeed()
Sets the publish dialog state to 'success'.
-
updateResourceList
public void updateResourceList()
Method which is called when the publish options are changed.
-
getSelectedWorkflow
protected org.opencms.ade.publish.shared.CmsWorkflow getSelectedWorkflow()
Returns the selected workflow.- Returns:
- the selected workflow
-
getWorkflowActionParams
protected org.opencms.ade.publish.shared.CmsWorkflowActionParams getWorkflowActionParams()
Gets the workflow action parameters to which the workflow action should be applied.- Returns:
- the workflow action parameters
-
setLastAction
protected void setLastAction(org.opencms.ade.publish.shared.CmsWorkflowAction action)
Sets the last workflow action.- Parameters:
action
- a workflow action
-
-