|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opencms.ade.publish.CmsPublishGroupHelper
public class CmsPublishGroupHelper
Helper class for splitting a publish list into publish groups.
Nested Class Summary | |
---|---|
static class |
CmsPublishGroupHelper.GroupAge
An enum representing the age of a publish list resource. |
Field Summary | |
---|---|
protected static int |
GROUP_SESSIONS_GAP
The gap between session groups. |
Constructor Summary | |
---|---|
CmsPublishGroupHelper(Locale locale)
Creates a new publish group helper for a given locale. |
Method Summary | |
---|---|
Map<Long,Integer> |
computeDays(List<Long> sortedDates)
Given a descending list of dates represented as longs, this method computes a map from the dates to their age in (local) days. |
Map<Long,Integer> |
computeDaysForResources(List<CmsResource> resources)
Computes a map from modification date to number of (local) days since the modification date. |
int |
getDayDifference(long first,
long second)
Gets the difference in days between to dates given as longs. |
List<Long> |
getModificationDates(List<CmsResource> resources)
Given a list of resources, this method returns a list of their modification dates. |
String |
getPublishGroupName(List<CmsResource> resources,
CmsPublishGroupHelper.GroupAge age)
Returns the localized name for a given publish group based on its age. |
Calendar |
getStartOfDay(long time)
Returns a calendar object representing the start of the day in which a given time lies. |
List<List<CmsResource>> |
partitionMediumResources(List<CmsResource> resources,
Map<Long,Integer> days)
Computes publish groups for a list of resources with age "medium". |
Map<CmsPublishGroupHelper.GroupAge,List<CmsResource>> |
partitionPublishResourcesByAge(List<CmsResource> resources,
Map<Long,Integer> days)
Partitions a list of resources by their age in (local) days since the last modification. |
List<List<CmsResource>> |
partitionYoungResources(List<CmsResource> resources)
Partitions the list of young resources into publish groups. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final int GROUP_SESSIONS_GAP
Constructor Detail |
---|
public CmsPublishGroupHelper(Locale locale)
locale
- the locale to useMethod Detail |
---|
public Map<Long,Integer> computeDays(List<Long> sortedDates)
sortedDates
- a descending list of dates represented as longs
public Map<Long,Integer> computeDaysForResources(List<CmsResource> resources)
resources
- a list of resources
public int getDayDifference(long first, long second)
The first date must be later than the second date.
first
- the first datesecond
- the second date
public List<Long> getModificationDates(List<CmsResource> resources)
resources
- a list of resources
public String getPublishGroupName(List<CmsResource> resources, CmsPublishGroupHelper.GroupAge age)
resources
- the resources of the publish groupage
- the age of the publish group
public Calendar getStartOfDay(long time)
time
- a long representing a time
public List<List<CmsResource>> partitionMediumResources(List<CmsResource> resources, Map<Long,Integer> days)
resources
- the list of resourcesdays
- a map from modification dates to the number of days since the modification
public Map<CmsPublishGroupHelper.GroupAge,List<CmsResource>> partitionPublishResourcesByAge(List<CmsResource> resources, Map<Long,Integer> days)
resources
- the list of resources to partitiondays
- the map from modification dates to the number of (local) days since the modification
public List<List<CmsResource>> partitionYoungResources(List<CmsResource> resources)
resources
- the list of resources to partition
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |