Package org.opencms.workflow
Class CmsDefaultPublishResourceFormatter
java.lang.Object
org.opencms.workflow.CmsDefaultPublishResourceFormatter
- All Implemented Interfaces:
I_CmsPublishResourceFormatter
- Direct Known Subclasses:
CmsExtendedPublishResourceFormatter
public class CmsDefaultPublishResourceFormatter
extends Object
implements I_CmsPublishResourceFormatter
Default formatter class for publish resources.
-
Nested Class Summary
Modifier and TypeClassDescriptionclass
Excludes resources which have already been published.class
Validator which checks if resources are locked by someone else.static class
Compares publish resources by their sort date.static interface
Validator which can exclude some resources from publishing and supplies a status object for the excluded resources.class
Validator which excludes resources for which the user has no publish permissions.class
Predicate which checks whether the current user has publish permissions for a resource. -
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected Map<CmsUUID,
CmsPublishResourceInfo> Creates the publish resource warnings.protected CmsPublishResource
createPublishResource
(CmsResource resource) Creates a publish resource bean from a resource.protected Locale
Gets the workplace locale for the currently used CMS context.static String
getOuAwareName
(CmsObject cms, String name) Returns the simple name if the ou is the same as the current user's ou.Gets the publish resource beans created by this formatter.protected com.google.common.base.Predicate<CmsResource>
Gets the resource map filter.Gets the list of publish resource validators.void
initialize
(CmsPublishOptions options, CmsPublishRelationFinder.ResourceMap resources) Initializes the formatter.protected void
sortResult
(List<CmsPublishResource> publishResources) Sorts the result publish resource list.
-
Field Details
-
m_options
The publish options.
-
-
Constructor Details
-
CmsDefaultPublishResourceFormatter
Constructor.- Parameters:
cms
- the CMS context to use
-
-
Method Details
-
getOuAwareName
Returns the simple name if the ou is the same as the current user's ou.- Parameters:
cms
- the CMS contextname
- the fully qualified name to check- Returns:
- the simple name if the ou is the same as the current user's ou
-
getPublishResources
Description copied from interface:I_CmsPublishResourceFormatter
Gets the publish resource beans created by this formatter.- Specified by:
getPublishResources
in interfaceI_CmsPublishResourceFormatter
- Returns:
- the publish resource beans
- See Also:
-
computeWarnings
Creates the publish resource warnings.- Returns:
- a map from structure ids to the warnings for the corresponding resources
-
createPublishResource
Creates a publish resource bean from a resource.- Parameters:
resource
- the resource- Returns:
- the publish resource bean
- Throws:
CmsException
- if something goes wrong
-
getLocale
Gets the workplace locale for the currently used CMS context.- Returns:
- the workplace locale
-
getResourceMapFilter
Gets the resource map filter.This can be used to remove resources which shouldn't be displayed.
- Returns:
- a predicate whose
-
getValidators
Gets the list of publish resource validators.- Returns:
- the list of publish resource validators
-
sortResult
Sorts the result publish resource list.- Parameters:
publishResources
- the list to sort
-