Class CmsPublishSelectPanel

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected CmsPushButton m_cancelButton
      The button for escaping from the publish dialog.
      protected CmsCheckBox m_checkboxAddContents
      Checkbox for including the contents of folders in the direct publish case.
      protected CmsCheckBox m_checkboxProblems
      The checkbox for the "show problems only" mode.
      protected CmsCheckBox m_checkboxRelated
      The checkbox for including related resources.
      protected CmsCheckBox m_checkboxSiblings
      The checkbox for including sibling resources.
      protected com.google.gwt.user.client.ui.Panel m_groupPanelContainer
      The panel containing the publish groups.
      protected boolean m_loading
      Flag to indicate whether new items are currently being added to the list.
      protected CmsPublishDataModel m_model
      The data model for the publish dialog.
      protected com.google.gwt.user.client.ui.Label m_noResources
      The label which is displayed when there are no resources to publish.
      protected com.google.gwt.user.client.ui.Panel m_problemsPanel
      The panel which shows a message telling the user the number of problems.
      protected CmsSelectBox m_projectSelector
      The project select box.
      protected CmsPublishDialog m_publishDialog
      The publish dialog which contains this panel.
      protected CmsScrollPanel m_scrollPanel
      The scroll panel containing the group panel.
      protected java.util.Map<org.opencms.util.CmsUUID,​org.opencms.ade.publish.client.CmsPublishItemSelectionController> m_selectionControllers
      The global map of selection controllers for all groups.
      protected com.google.gwt.user.client.ui.InlineLabel m_selectorLabel
      The label shown in front of the project selector.
      protected com.google.gwt.user.client.ui.FlowPanel m_selectorPanel
      The panel containing the project selector.
      protected com.google.gwt.user.client.ui.Label m_tooManyResources
      Label which is shown instead of the resource list when the resource list is too long.
      protected com.google.gwt.user.client.ui.Panel m_topBar
      The top button bar.
      protected CmsSelectBox m_workflowSelector
      The workflow selector.
      protected com.google.gwt.user.client.ui.InlineLabel m_workflowsLabel
      The workflow selector label.
      • Fields inherited from class com.google.gwt.user.client.ui.UIObject

        DEBUG_ID_PREFIX
    • Constructor Summary

      Constructors 
      Constructor Description
      CmsPublishSelectPanel​(CmsPublishDialog publishDialog, java.util.List<org.opencms.ade.publish.shared.CmsProjectBean> projects, org.opencms.ade.publish.shared.CmsPublishOptions publishOptions, java.util.Map<java.lang.String,​org.opencms.ade.publish.shared.CmsWorkflow> workflows, java.lang.String selectedWorkflowId, int scrollPanelHeight)
      Creates a new instance.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void addMoreListItems()
      Adds more publish list items to the panel.
      protected boolean addNextItem()
      Tries to add a new publish list item to the panel, and returns false if there aren't any items left.
      boolean checkForProblems​(java.util.Set<org.opencms.util.CmsUUID> resourceIds)
      Check for problems with new/deleted folders in the publish selection.
      protected void executeAction​(org.opencms.ade.publish.shared.CmsWorkflowAction action)
      Executes the given action.
      protected void finishLoading()
      The method to call when the items have finished being loaded into the list.
      static java.lang.String formatResourceCount​(int resourceCount)
      Formats a number of publish resources in a more user-friendly form.
      java.util.List<CmsPushButton> getButtons()
      Returns the buttons of this panel which should be shown as the buttons of the publish dialog.
      java.util.Set<org.opencms.util.CmsUUID> getResourcesToPublish()
      Returns the ids of the resources which should be published.
      java.util.Set<org.opencms.util.CmsUUID> getResourcesToRemove()
      Returns the set of ids of resources which have been selected for removal.
      java.util.Map<org.opencms.util.CmsUUID,​org.opencms.ade.publish.client.CmsPublishItemSelectionController> getSelectionControllers()
      Gets the global map of selection controllers.
      boolean isShowResources()
      Returns if the resource list is being shown.
      protected void onAddContentsClick​(com.google.gwt.event.dom.client.ClickEvent event)
      Event handler for the 'add contents' check box.
      void onChangePublishSelection()
      The method that will be called when the publish resource selection has changed.
      protected void onClickCancel​(com.google.gwt.event.dom.client.ClickEvent e)
      The event handler for the Cancel button.
      protected void onProblemClick​(com.google.gwt.event.dom.client.ClickEvent event)
      Handles the click event for problem resources check box.
      protected void onProjectChange​(com.google.gwt.event.logical.shared.ValueChangeEvent<java.lang.String> event)
      Handling the value change event for the project selector.
      protected void onRelatedClick​(com.google.gwt.event.dom.client.ClickEvent event)
      Handles the click event for related resources check box.
      protected void onSiblingClick​(com.google.gwt.event.dom.client.ClickEvent event)
      Handles the click event for sibling resources check box.
      protected void onWorkflowChange​(com.google.gwt.event.logical.shared.ValueChangeEvent<java.lang.String> event)
      Handling the value change event for the project selector.
      void setGroupList​(org.opencms.ade.publish.shared.CmsPublishGroupList groups, boolean newData, java.lang.String defaultWorkflow)
      Sets the publish groups used by this widget.
      protected void setGroups​(java.util.List<org.opencms.ade.publish.shared.CmsPublishGroup> groups, boolean newData)
      Sets the publish groups.
      protected void setGroups​(java.util.List<org.opencms.ade.publish.shared.CmsPublishGroup> groups, boolean newData, java.lang.String defaultWorkflow)
      Sets the publish groups.
      protected void setProblemMode​(boolean enabled)
      Enables or disables the "only show resources with problems" mode.
      void setShowResources​(boolean showResources, java.lang.String tooManyResourcesMessage)
      Sets the mode to either show resources, or only show a "too many resources" message.
      boolean shouldEnablePublishButton()
      Returns true if the publish button should be enabled.
      protected void startLoading()
      The method which should be called when new items start being inserted into the list.
      void update​(org.opencms.util.CmsUUID id, CmsPublishItemStatus status)
      Processes a status change.
      static CmsPublishSelectPanel.CheckBoxUpdate updateCheckbox​(CmsPublishItemStateSummary states)
      Updates the state of a check box used for selecting/deselecting items.
      void updateDialogTitle()
      Updates the dialog title.
      • Methods inherited from class com.google.gwt.user.client.ui.Composite

        claimElement, getWidget, initializeClaimedElement, initWidget, isAttached, onAttach, onBrowserEvent, onDetach, render, render, resolvePotentialElement, setWidget
      • Methods inherited from class com.google.gwt.user.client.ui.Widget

        addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isOrWasAttached, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents, unsinkEvents
      • Methods inherited from class com.google.gwt.user.client.ui.UIObject

        addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • m_groupPanelContainer

        @UiField
        protected com.google.gwt.user.client.ui.Panel m_groupPanelContainer
        The panel containing the publish groups.
      • m_loading

        protected boolean m_loading
        Flag to indicate whether new items are currently being added to the list.
      • m_noResources

        @UiField
        protected com.google.gwt.user.client.ui.Label m_noResources
        The label which is displayed when there are no resources to publish.
      • m_problemsPanel

        @UiField
        protected com.google.gwt.user.client.ui.Panel m_problemsPanel
        The panel which shows a message telling the user the number of problems.
      • m_selectionControllers

        protected java.util.Map<org.opencms.util.CmsUUID,​org.opencms.ade.publish.client.CmsPublishItemSelectionController> m_selectionControllers
        The global map of selection controllers for all groups.
      • m_selectorLabel

        @UiField
        protected com.google.gwt.user.client.ui.InlineLabel m_selectorLabel
        The label shown in front of the project selector.
      • m_selectorPanel

        @UiField
        protected com.google.gwt.user.client.ui.FlowPanel m_selectorPanel
        The panel containing the project selector.
      • m_tooManyResources

        @UiField
        protected com.google.gwt.user.client.ui.Label m_tooManyResources
        Label which is shown instead of the resource list when the resource list is too long.
      • m_topBar

        @UiField
        protected com.google.gwt.user.client.ui.Panel m_topBar
        The top button bar.
      • m_workflowsLabel

        @UiField
        protected com.google.gwt.user.client.ui.InlineLabel m_workflowsLabel
        The workflow selector label.
    • Constructor Detail

      • CmsPublishSelectPanel

        public CmsPublishSelectPanel​(CmsPublishDialog publishDialog,
                                     java.util.List<org.opencms.ade.publish.shared.CmsProjectBean> projects,
                                     org.opencms.ade.publish.shared.CmsPublishOptions publishOptions,
                                     java.util.Map<java.lang.String,​org.opencms.ade.publish.shared.CmsWorkflow> workflows,
                                     java.lang.String selectedWorkflowId,
                                     int scrollPanelHeight)
        Creates a new instance.

        Parameters:
        publishDialog - the publish dialog to which this panel should belong
        projects - a map of projects, where the keys are the project ids and the values are the names of the projects
        publishOptions - the initial publish options
        workflows - the available workflows
        selectedWorkflowId - the selected workflow id
        scrollPanelHeight - the available scroll panel height
    • Method Detail

      • formatResourceCount

        public static java.lang.String formatResourceCount​(int resourceCount)
        Formats a number of publish resources in a more user-friendly form.

        Parameters:
        resourceCount - a number of resources
        Returns:
        the formatted number of resources
      • checkForProblems

        public boolean checkForProblems​(java.util.Set<org.opencms.util.CmsUUID> resourceIds)
        Check for problems with new/deleted folders in the publish selection.

        Parameters:
        resourceIds - the ids of the resources selected for publishing
        Returns:
        true if there are problems with nested
      • getButtons

        public java.util.List<CmsPushButtongetButtons()
        Returns the buttons of this panel which should be shown as the buttons of the publish dialog.

        Returns:
        a list of buttons
      • getResourcesToPublish

        public java.util.Set<org.opencms.util.CmsUUID> getResourcesToPublish()
        Returns the ids of the resources which should be published.

        Returns:
        a set of id strings
      • getResourcesToRemove

        public java.util.Set<org.opencms.util.CmsUUID> getResourcesToRemove()
        Returns the set of ids of resources which have been selected for removal.

        Returns:
        a set of id strings
      • getSelectionControllers

        public java.util.Map<org.opencms.util.CmsUUID,​org.opencms.ade.publish.client.CmsPublishItemSelectionController> getSelectionControllers()
        Gets the global map of selection controllers.

        Returns:
        the map of selection controller
      • isShowResources

        public boolean isShowResources()
        Returns if the resource list is being shown.

        The resource list is now shown if it is too long.

        Returns:
        true if the resource list is being shown
      • setGroupList

        public void setGroupList​(org.opencms.ade.publish.shared.CmsPublishGroupList groups,
                                 boolean newData,
                                 java.lang.String defaultWorkflow)
        Sets the publish groups used by this widget.

        Parameters:
        groups - the new publish groups
        newData - true if the groups are new data which has been loaded
        defaultWorkflow - if not null, selects the given workflow
      • setShowResources

        public void setShowResources​(boolean showResources,
                                     java.lang.String tooManyResourcesMessage)
        Sets the mode to either show resources, or only show a "too many resources" message.

        In the latter case, the check boxes for the siblings/related resources will be deactivated.

        Parameters:
        showResources - true if the resource list should be shown, false if only the given message should be shown
        tooManyResourcesMessage - the message to show if there are too many resources to display
      • shouldEnablePublishButton

        public boolean shouldEnablePublishButton()
        Returns true if the publish button should be enabled.

        Returns:
        true if the publish button should be enabled
      • addMoreListItems

        protected void addMoreListItems()
        Adds more publish list items to the panel.

      • addNextItem

        protected boolean addNextItem()
        Tries to add a new publish list item to the panel, and returns false if there aren't any items left.

        Returns:
        true if an item could be added, false if no items are left
      • executeAction

        protected void executeAction​(org.opencms.ade.publish.shared.CmsWorkflowAction action)
        Executes the given action.

        Parameters:
        action - the action to execute on the selected resources
      • finishLoading

        protected void finishLoading()
        The method to call when the items have finished being loaded into the list.

      • onAddContentsClick

        @UiHandler("m_checkboxAddContents")
        protected void onAddContentsClick​(com.google.gwt.event.dom.client.ClickEvent event)
        Event handler for the 'add contents' check box.

        Parameters:
        event - the click event
      • onClickCancel

        @UiHandler("m_cancelButton")
        protected void onClickCancel​(com.google.gwt.event.dom.client.ClickEvent e)
        The event handler for the Cancel button.

        Parameters:
        e - the event
      • onProblemClick

        @UiHandler("m_checkboxProblems")
        protected void onProblemClick​(com.google.gwt.event.dom.client.ClickEvent event)
        Handles the click event for problem resources check box.

        Parameters:
        event - the click event
        See Also:
        ClickHandler.onClick(com.google.gwt.event.dom.client.ClickEvent)
      • onProjectChange

        @UiHandler("m_projectSelector")
        protected void onProjectChange​(com.google.gwt.event.logical.shared.ValueChangeEvent<java.lang.String> event)
        Handling the value change event for the project selector.

        Parameters:
        event - the change event
        See Also:
        ValueChangeHandler.onValueChange(ValueChangeEvent)
      • onRelatedClick

        @UiHandler("m_checkboxRelated")
        protected void onRelatedClick​(com.google.gwt.event.dom.client.ClickEvent event)
        Handles the click event for related resources check box.

        Parameters:
        event - the click event
        See Also:
        ClickHandler.onClick(com.google.gwt.event.dom.client.ClickEvent)
      • onSiblingClick

        @UiHandler("m_checkboxSiblings")
        protected void onSiblingClick​(com.google.gwt.event.dom.client.ClickEvent event)
        Handles the click event for sibling resources check box.

        Parameters:
        event - the click event
        See Also:
        ClickHandler.onClick(com.google.gwt.event.dom.client.ClickEvent)
      • onWorkflowChange

        @UiHandler("m_workflowSelector")
        protected void onWorkflowChange​(com.google.gwt.event.logical.shared.ValueChangeEvent<java.lang.String> event)
        Handling the value change event for the project selector.

        Parameters:
        event - the change event
        See Also:
        ValueChangeHandler.onValueChange(ValueChangeEvent)
      • setGroups

        protected void setGroups​(java.util.List<org.opencms.ade.publish.shared.CmsPublishGroup> groups,
                                 boolean newData)
        Sets the publish groups.

        Parameters:
        groups - the list of publish groups
        newData - true if the data is new
      • setGroups

        protected void setGroups​(java.util.List<org.opencms.ade.publish.shared.CmsPublishGroup> groups,
                                 boolean newData,
                                 java.lang.String defaultWorkflow)
        Sets the publish groups.

        Parameters:
        groups - the list of publish groups
        newData - true if the data is new
        defaultWorkflow - the default workflow id
      • setProblemMode

        protected void setProblemMode​(boolean enabled)
        Enables or disables the "only show resources with problems" mode.

        Parameters:
        enabled - if true, enable the mode, else disable it
      • startLoading

        protected void startLoading()
        The method which should be called when new items start being inserted into the list.