Class CmsPublishDataModel

java.lang.Object
org.opencms.ade.publish.client.CmsPublishDataModel

public class CmsPublishDataModel extends Object
This class contains the data for the publish resources which are displayed in the publish dialog.

Since:
8.0.0
  • Constructor Details

    • CmsPublishDataModel

      public CmsPublishDataModel(List<org.opencms.ade.publish.shared.CmsPublishGroup> publishGroups, I_CmsPublishItemStatusUpdateHandler handler)
      Creates and initializes a new publish resource data model from a list of publish groups.

      Parameters:
      publishGroups - the original publish groups
      handler - the handler which should be notified of state changes
  • Method Details

    • hasProblems

      public static boolean hasProblems(org.opencms.ade.publish.shared.CmsPublishResource publishResource)
      Returns if the given publish resource has problems preventing it from being published.

      Parameters:
      publishResource - the publish resource
      Returns:
      true if the publish resource has problems
    • computeGroupSelectionStates

      Collects group selection states.

      Returns:
      the group selection states
    • countProblems

      public int countProblems()
      Counts the resources which have problems.

      Returns:
      the number of resources which have problems
    • countResources

      Counts the resources which pass a given check.

      Parameters:
      check - the check to apply
      Returns:
      the number of resources which passed the check
    • countResourcesInGroup

      public int countResourcesInGroup(CmsPublishDataModel.I_CmsPublishResourceCheck check, List<org.opencms.ade.publish.shared.CmsPublishResource> group)
      Counts the resources of a group which pass a given check.

      Parameters:
      check - the check to apply
      group - the group of publish resources
      Returns:
      the number of resources in that group which passed the check
    • getGroups

      public List<org.opencms.ade.publish.shared.CmsPublishGroup> getGroups()
      Gets the list of publish groups.

      Returns:
      the list of publish groups
    • getIdsForGroup

      public List<org.opencms.util.CmsUUID> getIdsForGroup(int groupNum)
      Gets the ids for a given publish group.

      Parameters:
      groupNum - the index of the group
      Returns:
      the UUIDs for that group
    • getIdsOfAlreadyPublishedResources

      public List<org.opencms.util.CmsUUID> getIdsOfAlreadyPublishedResources()
      Returns the id's of all already published resources.

      Returns:
      the id's of the already published resources
    • getPublishIds

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

      Returns:
      the ids of publish resources which should be published
    • getPublishResources

      public Map<org.opencms.util.CmsUUID,org.opencms.ade.publish.shared.CmsPublishResource> getPublishResources()
      Returns the list of all publish resources.

      Returns:
      the list of all publish resources
    • getPublishResourcesByPath

      public Map<String,org.opencms.ade.publish.shared.CmsPublishResource> getPublishResourcesByPath()
      Returns the map of publish resources by path.

      Returns:
      the map of publish resources by path
    • getRemoveIds

      public List<org.opencms.util.CmsUUID> getRemoveIds()
      Returns the ids of publish resources which should be removed.

      Returns:
      the ids of publish resources which should be removed
    • getStatus

      public CmsPublishItemStatus getStatus(org.opencms.util.CmsUUID id)
      Returns the status for a given publish resource id.

      Parameters:
      id - the publish resource's structure id
      Returns:
      the status for that publish resource
    • hasSingleGroup

      public boolean hasSingleGroup()
      Checks if there is only a single group of resources.

      Returns:
      true if there is only a single group of resources
    • isEmpty

      public boolean isEmpty()
      Checks if there are any publish resources.

      Returns:
      true if there are no publish resources at all
    • setSelectionChangeAction

      public void setSelectionChangeAction(Runnable action)
      Sets the action which should be executed when the selection changes.

      Parameters:
      action - the action to run when the selection changes
    • signal

      public void signal(org.opencms.ade.publish.client.CmsPublishItemStatus.Signal signal, org.opencms.util.CmsUUID id)
      Sends a signal to a publish item status bean with the given id.

      Parameters:
      signal - the signal
      id - the structure id
    • signalAll

      public void signalAll(org.opencms.ade.publish.client.CmsPublishItemStatus.Signal signal)
      Sends a signal to all publish item status beans.

      Parameters:
      signal - the signal
    • signalGroup

      public void signalGroup(org.opencms.ade.publish.client.CmsPublishItemStatus.Signal signal, int groupNum)
      Sends a signal to all publish items in a given group.

      Parameters:
      signal - the signal to send
      groupNum - the group index