public class CmsLocaleGroup extends java.lang.Object
Constructor and Description |
---|
CmsLocaleGroup(CmsObject cms,
CmsResource primaryResource,
java.util.List<CmsResource> secondaryResources)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
java.util.List<CmsResource> |
getAllResources()
Gets the list of all resources of this group (primary and secondary).
|
java.util.Locale |
getMainLocale()
Gets the main locale (i.e. the locale of the primary resource of this group).
|
CmsResource |
getPrimaryResource()
Gets the primary resource.
|
java.util.Map<java.util.Locale,CmsResource> |
getResourcesByLocale()
Gets a map which contains the resources of the locale group as keys, indexed by their locale.
|
java.util.Collection<CmsResource> |
getResourcesForLocale(java.util.Locale locale)
Gets the resources of this group which have the given locale.
|
java.util.Set<CmsResource> |
getSecondaryResources()
Gets the secondary resources of this group.
|
boolean |
hasLocale(java.util.Locale locale)
Checks if this group has a resource with the given locale.
|
boolean |
isMarkedNoTranslation(java.util.Locale locale)
Checks if the locale group is marked as not translatable for the given locale.
|
boolean |
isMarkedNoTranslation(java.util.Set<java.util.Locale> locales)
Checks if the locale group is marked as not translatable for any of the given locales.
|
boolean |
isPotentialGroupHead()
Returns true if this is a potential group head, i.e. the locale of the primary resource is the main translation locale configured for the site
in which it is located.
|
boolean |
isRealGroup()
Checks if this group is a real group, i.e. consists of more than one resource.
|
boolean |
isRealGroupOrPotentialGroupHead()
Checks if this is either a real group or a potential group head (i.e. a potential primary resource).
|
public CmsLocaleGroup(CmsObject cms, CmsResource primaryResource, java.util.List<CmsResource> secondaryResources)
cms
- the CMS context to useprimaryResource
- the primary resourcesecondaryResources
- the secondary resourcespublic java.util.List<CmsResource> getAllResources()
public java.util.Locale getMainLocale()
public CmsResource getPrimaryResource()
public java.util.Map<java.util.Locale,CmsResource> getResourcesByLocale()
If the locale group contains more than one resource from the same locale,, which one is used a map value is undefined.
public java.util.Collection<CmsResource> getResourcesForLocale(java.util.Locale locale)
locale
- a localepublic java.util.Set<CmsResource> getSecondaryResources()
public boolean hasLocale(java.util.Locale locale)
locale
- the localepublic boolean isMarkedNoTranslation(java.util.Locale locale)
locale
- a localepublic boolean isMarkedNoTranslation(java.util.Set<java.util.Locale> locales)
locales
- a set of localespublic boolean isPotentialGroupHead()
public boolean isRealGroup()
public boolean isRealGroupOrPotentialGroupHead()