Search in sources :

Example 1 with TimelineEventsAndDate

use of com.tyndalehouse.step.core.data.entities.aggregations.TimelineEventsAndDate in project step by STEPBible.

the class TimelineServiceImpl method getEventsFromScripture.

@Override
public TimelineEventsAndDate getEventsFromScripture(final String reference) {
    final TimelineEventsAndDate timelineEventsAndDate = new TimelineEventsAndDate();
    final EntityDoc[] matchingTimelineEvents = lookupEventsMatchingReference(reference);
    timelineEventsAndDate.setEvents(matchingTimelineEvents);
    timelineEventsAndDate.setDateTime(getDateForEvents(matchingTimelineEvents));
    return timelineEventsAndDate;
}
Also used : EntityDoc(com.tyndalehouse.step.core.data.EntityDoc) TimelineEventsAndDate(com.tyndalehouse.step.core.data.entities.aggregations.TimelineEventsAndDate)

Example 2 with TimelineEventsAndDate

use of com.tyndalehouse.step.core.data.entities.aggregations.TimelineEventsAndDate in project step by STEPBible.

the class TimelineController method getEventsFromReference.

/**
 * Retrieves events based on a biblical reference. This method also needs to return an origin and a scale for the
 * timeline to be displayed properly as it might well be that the UI has carried out a different search
 *
 * @param bibleReference the bible reference that might have a set of events related to it
 * @return a list of events to be shown on a timeline, including the origin of the timeline and the scale of the
 * timeline
 */
public DigestableTimeline getEventsFromReference(final String bibleReference) {
    LOGGER.debug("Getting events for scripture [{}]", bibleReference);
    final TimelineEventsAndDate eventsFromScripture = this.timelineService.getEventsFromScripture(bibleReference);
    return this.translator.toDigestableForm(eventsFromScripture.getEvents(), eventsFromScripture.getDateTime());
}
Also used : TimelineEventsAndDate(com.tyndalehouse.step.core.data.entities.aggregations.TimelineEventsAndDate)

Aggregations

TimelineEventsAndDate (com.tyndalehouse.step.core.data.entities.aggregations.TimelineEventsAndDate)2 EntityDoc (com.tyndalehouse.step.core.data.EntityDoc)1