Package org.opencms.ade.publish
Class CmsPublishRelationFinder
- java.lang.Object
-
- org.opencms.ade.publish.CmsPublishRelationFinder
-
public class CmsPublishRelationFinder extends java.lang.Object
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 Classes Modifier and Type Class Description static class
CmsPublishRelationFinder.ResourceMap
A 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
Constructors Constructor Description CmsPublishRelationFinder(CmsObject cms, java.util.Collection<CmsResource> resources, boolean keepOriginalUnchangedResources, I_CmsPublishRelatedResourceProvider relProvider)
Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CmsPublishRelationFinder.ResourceMap
getPublishRelatedResources()
Gets the related resources in the form of a ResourceMap.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.
-
-
-
Constructor Detail
-
CmsPublishRelationFinder
public CmsPublishRelationFinder(CmsObject cms, java.util.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 Detail
-
getPublishRelatedResources
public CmsPublishRelationFinder.ResourceMap 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
-
-