Interface QAEventService

All Known Implementing Classes:
QAEventServiceImpl

public interface QAEventService
Service that handles QAEvent.
Author:
Andrea Bollini (andrea.bollini at 4science.it)
  • Method Details

    • findAllTopics

      List<QATopic> findAllTopics(Context context, long offset, long count, String orderField, boolean ascending)
      Find all the event's topics.
      Parameters:
      context - the DSpace context
      offset - the offset to apply
      orderField - the field to order for
      ascending - true if the order should be ascending, false otherwise
      Returns:
      the topics list
    • findAllTopicsBySource

      List<QATopic> findAllTopicsBySource(Context context, String source, long offset, long count, String orderField, boolean ascending)
      Find all the event's topics related to the given source.
      Parameters:
      context - the DSpace context
      source - the source to search for
      offset - the offset to apply
      count - the page size
      orderField - the field to order for
      ascending - true if the order should be ascending, false otherwise
      Returns:
      the topics list
    • findTopicBySourceAndNameAndTarget

      QATopic findTopicBySourceAndNameAndTarget(Context context, String sourceName, String topicName, UUID target)
      Find a specific topic by its name, source and optionally a target.
      Parameters:
      context - the DSpace context
      sourceName - the name of the source
      topicName - the topic name to search for
      target - (nullable) the uuid of the target to focus on
      Returns:
      the topic
    • countTopics

      long countTopics()
      Count all the event's topics.
      Returns:
      the count result
    • countTopicsBySource

      long countTopicsBySource(Context context, String source)
      Count all the event's topics related to the given source.
      Parameters:
      context - the DSpace context
      source - the source to search for
      Returns:
      the count result
    • findEventsByTopic

      List<QAEvent> findEventsByTopic(Context context, String sourceName, String topic, long offset, int size, String orderField, boolean ascending)
      Find all the events by topic.
      Parameters:
      context - the DSpace context
      sourceName - the source name
      topic - the topic to search for
      offset - the offset to apply
      size - the page size
      orderField - the field to order for
      ascending - true if the order should be ascending, false otherwise
      Returns:
      the events
    • countEventsByTopic

      long countEventsByTopic(Context context, String sourceName, String topic)
      Find all the events by topic.
      Parameters:
      context - the DSpace context
      sourceName - the source name
      topic - the topic to search for
      Returns:
      the events count
    • findEventByEventId

      QAEvent findEventByEventId(String id)
      Find an event by the given id. Please note that no security filter are applied by this method.
      Parameters:
      id - the id of the event to search for
      Returns:
      the event
    • store

      void store(Context context, QAEvent event)
      Store the given event.
      Parameters:
      context - the DSpace context
      event - the event to store
    • deleteEventByEventId

      void deleteEventByEventId(String id)
      Delete an event by the given id.
      Parameters:
      id - the id of the event to delete
    • deleteEventsByTargetId

      void deleteEventsByTargetId(UUID targetId)
      Delete events by the given target id.
      Parameters:
      targetId - the id of the target id
    • findTopicByTopicId

      QATopic findTopicByTopicId(String topicId)
      Find a specific topid by the given id.
      Parameters:
      topicId - the topic id to search for
      Returns:
      the topic
    • findSource

      QASource findSource(Context context, String source)
      Find a specific source by the given name.
      Parameters:
      context - the DSpace context
      source - the source name
      Returns:
      the source
    • findSource

      QASource findSource(Context context, String source, UUID target)
      Find a specific source by the given name including the stats focused on the target item.
      Parameters:
      context - the DSpace context
      source - the source name
      target - the uuid of the item target
      Returns:
      the source
    • findAllSources

      List<QASource> findAllSources(Context context, long offset, int pageSize)
      Find all the event's sources.
      Parameters:
      context - the DSpace context
      offset - the offset to apply
      pageSize - the page size
      Returns:
      the sources list
    • countSources

      long countSources(Context context)
      Count all the event's sources.
      Parameters:
      context - the DSpace context
      Returns:
      the count result
    • countSourcesByTarget

      long countSourcesByTarget(Context context, UUID target)
      Count all the event's sources related to a specific item
      Parameters:
      context - the DSpace context
      target - the item uuid
      Returns:
      the count result
    • countTopicsBySourceAndTarget

      long countTopicsBySourceAndTarget(Context context, String source, UUID target)
      Count all the event's topics related to the given source referring to a specific item
      Parameters:
      context - the DSpace context
      target - the item uuid
      source - the source to search for
      Returns:
      the count result
    • isRelatedItemSupported

      boolean isRelatedItemSupported(QAEvent qaevent)
      Check if the given QA event supports a related item.
      Parameters:
      qaevent - the event to be verified
      Returns:
      true if the event supports a related item, false otherwise.
    • findEventsByTopicAndTarget

      List<QAEvent> findEventsByTopicAndTarget(Context context, String source, String topic, UUID target, long offset, int pageSize)
      Find a list of QA events according to the pagination parameters for the specified topic and target sorted by trust descending
      Parameters:
      context - the DSpace context
      source - the source name
      topic - the topic to search for
      offset - the offset to apply
      pageSize - the page size
      target - the uuid of the QA event's target
      Returns:
      the events
    • qaEventsInSource

      boolean qaEventsInSource(Context context, EPerson user, String eventId, String source)
      Check if a qaevent with the provided id is visible to the current user according to the source security
      Parameters:
      context - the DSpace context
      user - the user to consider for the security check
      eventId - the id of the event to check for existence
      source - the qa source name
      Returns:
      true if the event exists
    • countEventsByTopicAndTarget

      long countEventsByTopicAndTarget(Context context, String source, String topic, UUID target)
      Count the QA events related to the specified topic and target
      Parameters:
      context - the DSpace context
      source - the source name
      topic - the topic to search for
      target - the uuid of the QA event's target
      Returns:
      the count result
    • findAllSourcesByTarget

      List<QASource> findAllSourcesByTarget(Context context, UUID target, long offset, int pageSize)
      Find all the event's sources related to a specific item
      Parameters:
      context - the DSpace context
      target - the item referring to
      offset - the offset to apply
      pageSize - the page size
      Returns:
      the source list
    • findAllTopicsBySourceAndTarget

      List<QATopic> findAllTopicsBySourceAndTarget(Context context, String source, UUID target, long offset, long pageSize, String orderField, boolean ascending)
      Find all the event's topics related to the given source for a specific item
      Parameters:
      context - the DSpace context
      source - (not null) the source to search for
      target - the item referring to
      offset - the offset to apply
      pageSize - the page size
      Returns:
      the topics list