Class BulkUpdateUtil

java.lang.Object
org.opencastproject.adminui.util.BulkUpdateUtil

public final class BulkUpdateUtil extends Object
This class holds utility functions which are related to the bulk update feature for events.
  • Method Details

    • getEvent

      public static Optional<Event> getEvent(IndexService indexSvc, ElasticsearchIndex index, String id)
      Wraps the IndexService.getEvent() method to convert SearchIndexExceptions into RuntimeExceptions. Useful when using Java's functional programming features.
      Parameters:
      indexSvc - The IndexService instance.
      index - The index to get the event from.
      id - The id of the event to get.
      Returns:
      An optional holding the event or nothing, if not found.
    • addSchedulingDates

      public static org.json.simple.JSONObject addSchedulingDates(Event event, org.json.simple.JSONObject scheduling)
      Takes the given scheduling information and completes the event start and end dates as well as the duration for the given event. If the weekday shall be changed, the start and end dates are adjusted accordingly.
      Parameters:
      event - The event to complete the scheduling information for.
      scheduling - The (yet incomplete) scheduling information to complete.
      Returns:
      The completed scheduling information, adjusted for the given event.
    • toNonTechnicalMetadataJson

      public static org.json.simple.JSONObject toNonTechnicalMetadataJson(org.json.simple.JSONObject scheduling)
      Creates a json object containing meta data based on the given scheduling information.
      Parameters:
      scheduling - The scheduling information to extract meta data from.
      Returns:
      The meta data, consisting of location, startDate, and duration.
    • mergeMetadataFields

      public static org.json.simple.JSONObject mergeMetadataFields(org.json.simple.JSONObject first, org.json.simple.JSONObject second)
      Merges all fields of the given meta data json objects into one object.
      Parameters:
      first - The first meta data json object.
      second - The second meta data json object.
      Returns:
      A new json meta data object, containing the field of both input objects.