Getting started

Daniel Ebbert

2019-11-04

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: 2019-11-04 11:21
#>   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
91708b2e-285e-4f08-855d-2ad882c42002 System User Durian Open Movie Team 2019-11-04T01:06:00Z a1b6787e-1cfa-49e7-85ce-09d36677b92e list() 2019-11-04T01:06:19Z 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
ab92cc10-c422-4d54-99db-055563658897 System User Lars Kiesow 2019-11-04T01:05:00Z list() 2019-11-04T01:05:53Z 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
869a0e15-4a65-4363-8f40-971b40e6bc05 System User Blender Foundation 2019-11-04T01:05:00Z a1b6787e-1cfa-49e7-85ce-09d36677b92e list() 2019-11-04T01:06:06Z Tears of Steel SUCCEEDED 1 list() Blender Foundation Productions TRUE c(“internal”, “engage-player”, “oaipmh-default”) EVENTS.EVENTS.STATUS.PROCESSED
a05cd45a-606c-4076-a60f-44f1cf0a38f1 System User Blender Foundation 2019-11-04T01:06:00Z a1b6787e-1cfa-49e7-85ce-09d36677b92e list() 2019-11-04T01:06:19Z Tears of Steel (Dualstream) SUCCEEDED 1 list() Blender Foundation Productions TRUE c(“internal”, “engage-player”, “oaipmh-default”) EVENTS.EVENTS.STATUS.PROCESSED
cfa2d07e-389a-4785-aa4d-49e0c2073f13 Opencast Project Administrator Olaf Schulte 2019-11-04T01:05:00Z list() 2019-11-04T01:05:52Z About Opencast SUCCEEDED 2 list() FALSE character(0) EVENTS.EVENTS.STATUS.PROCESSED