Package org.opencms.ade.publish.client
Class CmsPublishDataModel
java.lang.Object
org.opencms.ade.publish.client.CmsPublishDataModel
This class contains the data for the publish resources which are displayed
in the publish dialog.
- Since:
- 8.0.0
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Predicate used to check if a resource has problems.static interface
Predicate for testing properties of publish resources. -
Constructor Summary
ConstructorDescriptionCmsPublishDataModel
(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. -
Method Summary
Modifier and TypeMethodDescriptionCollects group selection states.int
Counts the resources which have problems.int
Counts the resources which pass a given check.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.List<org.opencms.ade.publish.shared.CmsPublishGroup>
Gets the list of publish groups.List<org.opencms.util.CmsUUID>
getIdsForGroup
(int groupNum) Gets the ids for a given publish group.List<org.opencms.util.CmsUUID>
Returns the id's of all already published resources.Set<org.opencms.util.CmsUUID>
Returns the ids of publish resources which should be published.Map<org.opencms.util.CmsUUID,
org.opencms.ade.publish.shared.CmsPublishResource> Returns the list of all publish resources.Returns the map of publish resources by path.List<org.opencms.util.CmsUUID>
Returns the ids of publish resources which should be removed.getStatus
(org.opencms.util.CmsUUID id) Returns the status for a given publish resource id.static boolean
hasProblems
(org.opencms.ade.publish.shared.CmsPublishResource publishResource) Returns if the given publish resource has problems preventing it from being published.boolean
Checks if there is only a single group of resources.boolean
isEmpty()
Checks if there are any publish resources.void
setSelectionChangeAction
(Runnable action) Sets the action which should be executed when the selection changes.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.void
signalAll
(org.opencms.ade.publish.client.CmsPublishItemStatus.Signal signal) Sends a signal to all publish item status beans.void
signalGroup
(org.opencms.ade.publish.client.CmsPublishItemStatus.Signal signal, int groupNum) Sends a signal to all publish items in a given group.
-
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 groupshandler
- the handler which should be notified of state changes
-
-
Method Details
-
computeGroupSelectionStates
Collects group selection states.- Returns:
- the group selection states
-
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 applygroup
- the group of publish resources- Returns:
- the number of resources in that group which passed the check
-
getGroups
Gets the list of publish groups.- Returns:
- the list of publish groups
-
getIdsForGroup
Gets the ids for a given publish group.- Parameters:
groupNum
- the index of the group- Returns:
- the UUIDs for that group
-
getIdsOfAlreadyPublishedResources
Returns the id's of all already published resources.- Returns:
- the id's of the already published resources
-
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
Returns the map of publish resources by path.- Returns:
- the map of publish resources by path
-
getRemoveIds
Returns the ids of publish resources which should be removed.- Returns:
- the ids of publish resources which should be removed
-
getStatus
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
Checks if there is only a single group of resources.- Returns:
- true if there is only a single group of resources
-
isEmpty
Checks if there are any publish resources.- Returns:
- true if there are no publish resources at all
-
setSelectionChangeAction
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 signalid
- the structure id
-
signalAll
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 sendgroupNum
- the group index