Getting started

Daniel Ebbert

2020-03-19

This vignette describes how to get started using the opencastR package.

Setup

In order to use the opencastR package the hostname of your Opencast server, your username and password need to be set as environment variables. For this example I use the Legacy Opencast Testserver and the default credentials.

library(opencastR)

Sys.setenv(OPENCAST_HOST = "https://legacy.opencast.org")
Sys.setenv(OPENCAST_USERNAME = "admin")
Sys.setenv(OPENCAST_PASSWORD = "opencast")

First call

To check if everything is setup correctly the oc_api function can be used which returns the default api version and the server url.

oc_api()
#> $content
#> $content$version
#> [1] "v1.2.0"
#> 
#> $content$url
#> [1] "http://localhost:8080/api"
#> 
#> 
#> $url
#> [1] "https://legacy.opencast.org/api/"
#> 
#> $response
#> Response [https://legacy.opencast.org/api/]
#>   Date: 2020-03-19 11:47
#>   Status: 200
#>   Content-Type: application/json
#>   Size: 57 B
#> 
#> 
#> attr(,"class")
#> [1] "opencast_api"

The return of this functions shows that a list of the class opencast_api has been returned. This list contains three elements. The content, the url that was called and the full response. So access only the content we can do the following.

api_test <- oc_api()
api_test$content
#> $version
#> [1] "v1.2.0"
#> 
#> $url
#> [1] "http://localhost:8080/api"

Events

To showcase a more useful functions a list of events on the testserver can be retrieved.

events <- oc_list_events()
kable(events$content)
identifier creator presenter created is_part_of subjects start description language source title processing_state license archive_version contributor series has_previews location rightsholder publication_status status
71061353-56cc-4249-8b8c-6ae7e4fa694d Opencast Project Administrator Durian Open Movie Team 2020-03-19T01:04:00Z 706543e3-c731-41de-b6c7-ed28c90b3635 list() 2020-03-19T01:04:06Z Trailer for the Sintel open movie project Sintel Trailer SUCCEEDED 1 list() Blender Foundation Productions TRUE c(“internal”, “engage-player”, “oaipmh-default”) EVENTS.EVENTS.STATUS.PROCESSED
2c028936-6610-4ea2-af4e-bc88eb6ee50a Opencast Project Administrator Lars Kiesow 2020-03-19T01:03:00Z list() 2020-03-19T01:03:39Z Opencast quick Jira ticket and pull request creator, https://github.com/lkiesow/ocpr OCPR Demo SUCCEEDED 1 list() TRUE c(“internal”, “engage-player”, “oaipmh-default”) EVENTS.EVENTS.STATUS.PROCESSED
4bfb829b-fe30-4ca4-8387-b5921781e6af Opencast Project Administrator Olaf Schulte 2020-03-19T01:03:00Z list() 2020-03-19T01:03:39Z About Opencast SUCCEEDED 1 list() TRUE c(“internal”, “engage-player”, “oaipmh-default”) EVENTS.EVENTS.STATUS.PROCESSED
bb69d37c-f842-4818-acf5-1e7a6986e2c1 Opencast Project Administrator Blender Foundation 2020-03-19T01:03:00Z 706543e3-c731-41de-b6c7-ed28c90b3635 list() 2020-03-19T01:03:52Z Tears of Steel SUCCEEDED 1 list() Blender Foundation Productions TRUE c(“internal”, “engage-player”, “oaipmh-default”) EVENTS.EVENTS.STATUS.PROCESSED
5f7b4557-e6c3-4669-a0f1-e7484d66617a Opencast Project Administrator Blender Foundation 2020-03-19T01:03:00Z 706543e3-c731-41de-b6c7-ed28c90b3635 list() 2020-03-19T01:04:06Z Tears of Steel (Dualstream) SUCCEEDED 1 list() Blender Foundation Productions TRUE c(“internal”, “engage-player”, “oaipmh-default”) EVENTS.EVENTS.STATUS.PROCESSED