Package org.opencms.ade.publish
Class CmsPublishRelationFinder
java.lang.Object
org.opencms.ade.publish.CmsPublishRelationFinder
Helper class for finding all related resources for a set of resources to be published, for use with the new ADE publish dialog.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA map from resources to sets of resources, which automtically instantiates an empty set when accessing a key that doesn't exist via get(). -
Constructor Summary
ConstructorsConstructorDescriptionCmsPublishRelationFinder(CmsObject cms, Collection<CmsResource> resources, boolean keepOriginalUnchangedResources, I_CmsPublishRelatedResourceProvider relProvider) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptionGets the related resources in the form of a ResourceMap.voidremoveUnchangedTopLevelResources(CmsPublishRelationFinder.ResourceMap publishRelatedResources, CmsPublishRelationFinder.ResourceMap reachability) Removes unchanged resources from the top level, and if they have children which do not occur anywhere else, moves these children to the top level.
-
Constructor Details
-
CmsPublishRelationFinder
public CmsPublishRelationFinder(CmsObject cms, Collection<CmsResource> resources, boolean keepOriginalUnchangedResources, I_CmsPublishRelatedResourceProvider relProvider) Creates a new instance.- Parameters:
cms- the CMS context to useresources- the resources for which the related resources should be foundkeepOriginalUnchangedResources- true if unchanged resources from the original resource list should be keptrelProvider- provider for additional related resources
-
-
Method Details
-
getPublishRelatedResources
Gets the related resources in the form of a ResourceMap.- Returns:
- a ResourceMap which has resources from the original set of resources as keys, and sets of related resources as values
-
removeUnchangedTopLevelResources
public void removeUnchangedTopLevelResources(CmsPublishRelationFinder.ResourceMap publishRelatedResources, CmsPublishRelationFinder.ResourceMap reachability) Removes unchanged resources from the top level, and if they have children which do not occur anywhere else, moves these children to the top level.- Parameters:
publishRelatedResources- the resource map to modifyreachability- the reachability map
-