Package com.adobe.granite.timeline
Interface Timeline
public interface Timeline
A
Timeline provides a collection of TimelineEvents specific to a Resource. The type of
events provided is dependent on the available TimelineEventProviders registered in the system. By default the
following events are provided: - Versioning Events
- Workflow Events
- Annotation Events
resource.adaptTo(Timeline.class).
Any resource can be adapted. Whether events are provided for a resource is decided by the event providers.-
Method Summary
Modifier and TypeMethodDescriptionReturns aListof allTimelineEvents available for the resource backing the timeline.getEvents(TimelineEventType... types) Returns a subset of events (as provided bygetEvents()), filtered by the giventypes.Returns theResourcefor which this timeline was created.
-
Method Details
-
getResource
Resource getResource()Returns theResourcefor which this timeline was created.- Returns:
- The
Resource.
-
getEvents
List<TimelineEvent> getEvents()Returns aListof allTimelineEvents available for the resource backing the timeline. If no events are found, an empty collection is returned. The list is ordered chronologically (most recent last) as perTimelineEvent.getTime(). In order to trim the result (e.g. for pagination, usegetEvents().subList(start, end).- Returns:
- A
ListofTimelineEvents, or an empty collection if no events were found.
-
getEvents
Returns a subset of events (as provided bygetEvents()), filtered by the giventypes. The types by which to filter are provided as an array ofTimelineEventTypes. TheTimelineAggregatorservice provides access to the available types (seeTimelineAggregator.getTypes(). The list is ordered chronologically (most recent last) as perTimelineEvent.getTime(). In order to trim the result (e.g. for pagination, usegetEvents(type).subList(start, end).- Parameters:
types- The array ofTimelineEventTypes by which to filter events.- Returns:
- A
ListofTimelineEvents filtered by type, or an empty list if no events or none of the given types were found.
-