Class EventHttpServletRequest
java.lang.Object
org.opencastproject.index.service.impl.util.EventHttpServletRequest
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic EventHttpServletRequestcreateFromHttpServletRequest(javax.servlet.http.HttpServletRequest request, org.opencastproject.ingest.api.IngestService ingestService, List<org.opencastproject.metadata.dublincore.EventCatalogUIAdapter> eventCatalogUIAdapters, String startDatePattern, String startTimePattern) protected static org.opencastproject.security.api.AccessControlListdeserializeJsonToAcl(String json, boolean assumeAllow) De-serialize an JSON into anAccessControlList.protected static org.opencastproject.metadata.dublincore.MetadataListdeserializeMetadataList(String json, List<org.opencastproject.metadata.dublincore.EventCatalogUIAdapter> catalogAdapters, String startDatePattern, String startTimePattern) Change the simplified fields of key values provided to the external api into aMetadataList.com.entwinemedia.fn.data.Opt<org.opencastproject.security.api.AccessControlList> getAcl()com.entwinemedia.fn.data.Opt<org.opencastproject.mediapackage.MediaPackage> com.entwinemedia.fn.data.Opt<org.opencastproject.metadata.dublincore.MetadataList> com.entwinemedia.fn.data.Opt<org.json.simple.JSONObject> com.entwinemedia.fn.data.Opt<org.json.simple.JSONObject> com.entwinemedia.fn.data.Opt<org.json.simple.JSONObject> voidsetAcl(org.opencastproject.security.api.AccessControlList acl) voidsetMediaPackage(org.opencastproject.mediapackage.MediaPackage mediaPackage) voidsetMetadataList(org.opencastproject.metadata.dublincore.MetadataList metadataList) voidsetProcessing(org.json.simple.JSONObject processing) voidsetScheduling(org.json.simple.JSONObject scheduling) voidsetSource(org.json.simple.JSONObject source) static EventHttpServletRequestupdateFromHttpServletRequest(org.opencastproject.elasticsearch.index.objects.event.Event event, javax.servlet.http.HttpServletRequest request, List<org.opencastproject.metadata.dublincore.EventCatalogUIAdapter> eventCatalogUIAdapters, String startDatePattern, String startTimePattern) Load the details of updating an event.
-
Constructor Details
-
EventHttpServletRequest
public EventHttpServletRequest()
-
-
Method Details
-
setAcl
public void setAcl(org.opencastproject.security.api.AccessControlList acl) -
setMediaPackage
public void setMediaPackage(org.opencastproject.mediapackage.MediaPackage mediaPackage) -
setMetadataList
public void setMetadataList(org.opencastproject.metadata.dublincore.MetadataList metadataList) -
setProcessing
public void setProcessing(org.json.simple.JSONObject processing) -
setScheduling
public void setScheduling(org.json.simple.JSONObject scheduling) -
setSource
public void setSource(org.json.simple.JSONObject source) -
getAcl
public com.entwinemedia.fn.data.Opt<org.opencastproject.security.api.AccessControlList> getAcl() -
getMediaPackage
public com.entwinemedia.fn.data.Opt<org.opencastproject.mediapackage.MediaPackage> getMediaPackage() -
getMetadataList
public com.entwinemedia.fn.data.Opt<org.opencastproject.metadata.dublincore.MetadataList> getMetadataList() -
getProcessing
public com.entwinemedia.fn.data.Opt<org.json.simple.JSONObject> getProcessing() -
getScheduling
public com.entwinemedia.fn.data.Opt<org.json.simple.JSONObject> getScheduling() -
getSource
public com.entwinemedia.fn.data.Opt<org.json.simple.JSONObject> getSource() -
createFromHttpServletRequest
public static EventHttpServletRequest createFromHttpServletRequest(javax.servlet.http.HttpServletRequest request, org.opencastproject.ingest.api.IngestService ingestService, List<org.opencastproject.metadata.dublincore.EventCatalogUIAdapter> eventCatalogUIAdapters, String startDatePattern, String startTimePattern) throws IndexServiceException - Parameters:
request- The multipart request that should result in a newEventingestService- TheIngestServiceto use to ingestEventmedia.eventCatalogUIAdapters- The catalog ui adapters to use for getting the event metadata.startDatePattern- The pattern to use to parse the start date from the request.startTimePattern- The pattern to use to parse the start time from the request.- Returns:
- An
EventHttpServletRequestpopulated from the request. - Throws:
IndexServiceException- Thrown if unable to create the event for an internal reason.IllegalArgumentException- Thrown if the multi part request doesn't have the necessary data.
-
updateFromHttpServletRequest
public static EventHttpServletRequest updateFromHttpServletRequest(org.opencastproject.elasticsearch.index.objects.event.Event event, javax.servlet.http.HttpServletRequest request, List<org.opencastproject.metadata.dublincore.EventCatalogUIAdapter> eventCatalogUIAdapters, String startDatePattern, String startTimePattern) throws IllegalArgumentException, IndexServiceException, org.opencastproject.util.NotFoundException Load the details of updating an event.- Parameters:
event- The event to update.request- The multipart request that has the data to load the updated event.eventCatalogUIAdapters- The list of catalog ui adapters to use to load the event metadata.startDatePattern- The pattern to use to parse the start date from the request.startTimePattern- The pattern to use to parse the start time from the request.- Returns:
- The data for the event update
- Throws:
IllegalArgumentException- Thrown if the request to update the event is malformed.IndexServiceException- Thrown if something is unable to load the event data.org.opencastproject.util.NotFoundException- Thrown if unable to find a metadata catalog or field that matches an input catalog or field.
-
deserializeJsonToAcl
protected static org.opencastproject.security.api.AccessControlList deserializeJsonToAcl(String json, boolean assumeAllow) throws org.json.simple.parser.ParseException De-serialize an JSON into anAccessControlList.- Parameters:
json- TheAccessControlListto serialize.assumeAllow- Assume that all entries are allows.- Returns:
- An
AccessControlListrepresentation of the Json - Throws:
org.json.simple.parser.ParseException
-
deserializeMetadataList
protected static org.opencastproject.metadata.dublincore.MetadataList deserializeMetadataList(String json, List<org.opencastproject.metadata.dublincore.EventCatalogUIAdapter> catalogAdapters, String startDatePattern, String startTimePattern) throws org.json.simple.parser.ParseException, org.opencastproject.util.NotFoundException, ParseException Change the simplified fields of key values provided to the external api into aMetadataList.- Parameters:
json- The json string that contains an array of metadata field lists for the different catalogs.startDatePattern- The pattern to use to parse the start date from the json payload.startTimePattern- The pattern to use to parse the start time from the json payload.- Returns:
- A
MetadataListwith the fields populated with the values provided. - Throws:
org.json.simple.parser.ParseException- Thrown if unable to parse the json string.org.opencastproject.util.NotFoundException- Thrown if unable to find the catalog or field that the json refers to.ParseException
-