diff --git a/OpenCast.class.php b/OpenCast.class.php index f6598ba47..bf5f01f87 100644 --- a/OpenCast.class.php +++ b/OpenCast.class.php @@ -53,7 +53,7 @@ public function __construct() $videos = new Navigation($this->_('Videos/Opencast')); $videos->setDescription($this->_('Opencast Aufzeichnungen')); $videos->setImage(Icon::create($this->assetsUrl . '/images/opencast-courseware.svg')); - $videos->setURL(PluginEngine::getURL($this, [], 'contents/index')); + $videos->setURL(PluginEngine::getURL($this, [], 'contents/index#/contents/videos')); // use correct navigation for Stud.IP Versions below 5 VersionHelper::get()->addMainNavigation($videos); @@ -129,7 +129,7 @@ public function getIconNavigation($course_id, $last_visit, $user_id = null) { $navigation = new Navigation( $this->_('Videos/Opencast'), - PluginEngine::getURL($this, [], 'course') + PluginEngine::getURL($this, [], 'course/#/course/videos') ); $navigation->setImage(Icon::create('video2')); @@ -169,7 +169,7 @@ public function getTabNavigation($course_id) $main = new Navigation( $this->_($title), - PluginEngine::getURL($this, [], 'course') + PluginEngine::getURL($this, [], 'course#/course/videos') ); $main->setImage(Icon::create('video2')); diff --git a/bootstrap.php b/bootstrap.php index 50ed81a58..202748521 100644 --- a/bootstrap.php +++ b/bootstrap.php @@ -22,5 +22,5 @@ // adding observer NotificationCenter::addObserver('Opencast\Models\Videos', 'parseEvent', 'OpencastVideoSync'); NotificationCenter::addObserver('Opencast\Models\Videos', 'checkEventACL', 'OpencastVideoSync'); +NotificationCenter::addObserver('Opencast\Models\Videos', 'addToCoursePlaylist', 'OpencastVideoSync'); NotificationCenter::addObserver('Opencast\Models\VideosUserPerms', 'setPermissions', 'OpencastVideoSync'); -NotificationCenter::addObserver('Opencast\Models\VideoSeminars', 'videoSeminarEntry', 'OpencastVideoSync'); diff --git a/docs/studip_opencast_routes.html b/docs/studip_opencast_routes.html index c0edf0292..b3fba0373 100644 --- a/docs/studip_opencast_routes.html +++ b/docs/studip_opencast_routes.html @@ -2181,7 +2181,7 @@ -
path Parameters
token
required
string

ID of the video

Request Body schema: application/json

Video object to be updated

description
string

Responses

Request samples

Content type
application/json
{
  • "description": "string"
}

Response samples

Content type
application/json
{
  • "message": "string"
}

Set course link

Set course links for the video with the passed token, clearing out all not passed course links

+

Request samples

Content type
application/json
{
  • "description": "string"
}

Response samples

Content type
application/json
{
  • "message": "string"
}

Set playlist link

Set playlist links for the video with the passed token, clearing out all not passed playlist links.

path Parameters
token
required
string

ID of the video

Request Body schema: application/json

List of courses to link to

Array of objects

Responses

Request samples

Content type
application/json
{
  • "courses": [
    ]
}

Response samples

Content type
application/json
{
  • "message": "string"
}

playlists

Get the playlists for the session user

query Parameters
offset
integer >= 0
Default: 0

The number of items to skip before starting to collect the result set

+

Request samples

Content type
application/json
{
  • "courses": [
    ]
}

Response samples

Content type
application/json
{
  • "message": "string"
}

Set playlist link

Set playlist links for the video with the passed token, clearing out all not passed playlist links.

+
path Parameters
token
required
string

ID of the video

+

Responses

Response samples

Content type
application/json
{
  • "perms": {
    },
  • "shares": {
    }
}

Set playlist link

Set playlist links for the video with the passed token, clearing out all not passed playlist links.

+
path Parameters
token
required
string

ID of the video

+
Request Body schema: application/json

List of courses to link to

+
Array of objects

Responses

Request samples

Content type
application/json
{
  • "courses": [
    ]
}

Response samples

Content type
application/json
{
  • "perms": {
    },
  • "shares": {
    }
}

Connect all playlists for the ourse in the path to the courses posted in the body

path Parameters
course_id
required
string

ID of the course to copy from

+
Request Body schema: */*

List of courses to connect the playlists to

+
Array of objects

Responses

Response samples

Content type
application/json
{ }

playlists

Get the playlists for the session user

query Parameters
offset
integer >= 0
Default: 0

The number of items to skip before starting to collect the result set

limit
integer >= 20
Default: 20

The numbers of items to return

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Add a new playlist for the current user

Request Body schema: */*

Playlist object to be added for the current user

+

Response samples

Content type
application/json
[
  • {
    }
]

Add a new playlist for the current user

Request Body schema: */*

Playlist object to be added for the current user

title
required
string
description
string
visibility
string
Enum: "internal" "free" "public"
mkdate
string <date-time>
chdate
string <date-time>
Array of objects (PlaylistReference)

Responses

Response samples

Content type
application/json
{ }

Get the playlist with the passed id

path Parameters
token
required
string

ID of the playlist

+

Response samples

Content type
application/json
{ }

Get the playlist with the passed id

path Parameters
token
required
string

ID of the playlist

Responses

Response samples

Content type
application/json
{ }

Update the playlist with the passed id

path Parameters
token
required
string

ID of the playlist

+

Response samples

Content type
application/json
{ }

Update the playlist with the passed id

path Parameters
token
required
string

ID of the playlist

Request Body schema: */*

Playlist object to be updated

title
required
string
description
string
visibility
string
Enum: "internal" "free" "public"
mkdate
string <date-time>
chdate
string <date-time>
Array of objects (PlaylistReference)

Responses

Response samples

Content type
application/json
{ }

Delete the playlist with the passed id (if current user has permissions to do so)

path Parameters
token
required
string

ID of the playlist

+

Response samples

Content type
application/json
{ }

Delete the playlist with the passed id (if current user has permissions to do so)

path Parameters
token
required
string

ID of the playlist

Responses

Add video to playlist

path Parameters
token
required
string

token reference for playlist or video

Responses

Response samples

Content type
application/json
{ }

Delete video from playlist

path Parameters
token
required
string

token reference for playlist or video

+

Response samples

Content type
application/json
{ }

Delete video from playlist

path Parameters
token
required
string

token reference for playlist or video

Responses

Add user with perms to playlist

path Parameters
token
required
string

ID of the playlist

Request Body schema: application/x-www-form-urlencoded
username
required
string

User to add/modify perms for the playlist

@@ -2246,42 +2256,42 @@

Get videos for the passed playlist

path Parameters
token
required
string

ID of the playlist

query Parameters
cid
string

Course ID as context for the playlist

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get courses associated with the passed playlist

path Parameters
token
required
string

ID of the playlist

+

Response samples

Content type
application/json
[
  • {
    }
]

Get courses associated with the passed playlist

path Parameters
token
required
string

ID of the playlist

Responses

Response samples

Content type
application/json
{ }

Set course link

Set course links for the playlist with the passed token, clearing out all not passed course links

+

Response samples

Content type
application/json
{ }

Set course link

Set course links for the playlist with the passed token, clearing out all not passed course links

path Parameters
token
required
string

ID of the video

Request Body schema: application/json

List of courses to link to

Array of objects

Responses

Request samples

Content type
application/json
{
  • "courses": [
    ]
}

Response samples

Content type
application/json
{
  • "message": "string"
}

Remove perms for user from playlist

path Parameters
token
required
string

ID of the playlist

+

Request samples

Content type
application/json
{
  • "courses": [
    ]
}

Response samples

Content type
application/json
{
  • "message": "string"
}

Remove perms for user from playlist

path Parameters
token
required
string

ID of the playlist

username
required
string

Username of the user

Responses

Set order of videos

Set order of videos for the playlist with the passed token, giving each video a defined position

path Parameters
token
required
string

ID of the video

Request Body schema: application/json

List of courses to link to

Array
string

Responses

Request samples

Content type
application/json
[
  • "video_token_1",
  • "video_token_2"
]

Response samples

Content type
application/json
{
  • "message": "string"
}

courses

returns a list of all courses the current user has tutor perms for or higher

Responses

Response samples

Content type
application/json
{
  • "S12345678": {
    }
}

Returns videos directly associated to this course

path Parameters
course_id
required
string

ID of course

+

Request samples

Content type
application/json
[
  • "video_token_1",
  • "video_token_2"
]

Response samples

Content type
application/json
{
  • "message": "string"
}

courses

returns a list of all courses the current user has tutor perms for or higher

Responses

Response samples

Content type
application/json
{
  • "S12345678": {
    }
}

Returns videos directly associated to this course

path Parameters
course_id
required
string

ID of course

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Returns the config settings for this course, like series and configured workflow

path Parameters
course_id
required
string

ID of course

+

Response samples

Content type
application/json
[
  • {
    }
]

Returns the config settings for this course, like series and configured workflow

path Parameters
course_id
required
string

ID of course

Responses

Response samples

Content type
application/json
{
  • "series": {
    },
  • "workflow": "upload"
}

Returns playlists for this course. Videos without explicit playlist in this course are mapped to a virtual playlist which can be accessed via the standard playlist routes

path Parameters
course_id
required
string

ID of course

+

Response samples

Content type
application/json
{
  • "series": {
    },
  • "workflow": "upload"
}

Returns playlists for this course. Videos without explicit playlist in this course are mapped to a virtual playlist which can be accessed via the standard playlist routes

path Parameters
course_id
required
string

ID of course

Responses

Response samples

Content type
application/json
{ }

Add playlist to course

path Parameters
token
required
string

ID of the playlist

+

Response samples

Content type
application/json
{ }

Add playlist to course

path Parameters
token
required
string

ID of the playlist

course_id
required
string

ID of course

Responses

Response samples

Content type
application/json
{
  • "title": "Meine Videos",
  • "description": "string",
  • "visibility": "internal",
  • "mkdate": "2019-08-24T14:15:22Z",
  • "chdate": "2019-08-24T14:15:22Z",
  • "references": [
    ]
}

Remove Playlist from course

path Parameters
token
required
string

ID of the playlist

+

Response samples

Content type
application/json
{
  • "title": "Meine Videos",
  • "description": "string",
  • "visibility": "internal",
  • "mkdate": "2019-08-24T14:15:22Z",
  • "chdate": "2019-08-24T14:15:22Z",
  • "references": [
    ]
}

Remove Playlist from course

path Parameters
token
required
string

ID of the playlist

course_id
required
string

ID of course

Responses

Get list of scheduled events for this course

path Parameters
course_id
required
string

ID of course

semester_filter
required
string

ID of the selected semester filter or 'all'

Responses

Response samples

Content type
application/json
{
  • "id": 0,
  • "resource_id": "ddce269a1e3d054cae349621c198dd52",
  • "date_id": "ddce269a1e3d054cae349621c198dd52",
  • "event_id": "f8c3de3d-1fea-4d7c-a8b0-29f63c4c3454"
}

Set visibility for course tab

Sets, if the course tab is visible for non-privileged users in the passed course

+

Response samples

Content type
application/json
{
  • "id": 0,
  • "resource_id": "ddce269a1e3d054cae349621c198dd52",
  • "date_id": "ddce269a1e3d054cae349621c198dd52",
  • "event_id": "f8c3de3d-1fea-4d7c-a8b0-29f63c4c3454"
}

Set visibility for course tab

Sets, if the course tab is visible for non-privileged users in the passed course

path Parameters
course_id
required
string

ID of course

visibility
required
string
Enum: "free" "public" "internal"

Visibility for the course

Responses

tags

Get all available tags for this user

Responses

Response samples

Content type
application/json
[
  • "string"
]

config

Get opencast configuration with all servers

Responses

Response samples

Content type
application/json
[
  • {
    },
  • {
    },
  • {
    }
]

Update global configuration settings

Request Body schema: application/x-www-form-urlencoded
settings
required
string

User to add/modify perms for the playlist

+

Response samples

Content type
application/json
[
  • "string"
]

config

Get opencast configuration with all servers

Responses

Response samples

Content type
application/json
[
  • {
    },
  • {
    },
  • {
    }
]

Update global configuration settings

Request Body schema: application/x-www-form-urlencoded
settings
required
string

User to add/modify perms for the playlist

Responses

Get opencast configuration for server

path Parameters
config_id
required
integer

ID of the server config

Responses

schedule

Get scheduled event

path Parameters
course_id
required
string

ID of course

termin_id
required
string

ID of scheduled event

Responses

Response samples

Content type
application/json
{
  • "id": 0,
  • "resource_id": "ddce269a1e3d054cae349621c198dd52",
  • "date_id": "ddce269a1e3d054cae349621c198dd52",
  • "event_id": "f8c3de3d-1fea-4d7c-a8b0-29f63c4c3454"
}

Update a scheduled event

path Parameters
course_id
required
string

ID of course

+

Response samples

Content type
application/json
{
  • "id": 0,
  • "resource_id": "ddce269a1e3d054cae349621c198dd52",
  • "date_id": "ddce269a1e3d054cae349621c198dd52",
  • "event_id": "f8c3de3d-1fea-4d7c-a8b0-29f63c4c3454"
}

Update a scheduled event

path Parameters
course_id
required
string

ID of course

termin_id
required
string

ID of scheduled event

Request Body schema: */*

Update an existing scheduled event

id
integer
resource_id
required
string
date_id
required
string
event_id
string

Responses

Response samples

Content type
application/json
{
  • "id": 0,
  • "resource_id": "ddce269a1e3d054cae349621c198dd52",
  • "date_id": "ddce269a1e3d054cae349621c198dd52",
  • "event_id": "f8c3de3d-1fea-4d7c-a8b0-29f63c4c3454"
}

Add a new scheduled event

path Parameters
course_id
required
string

ID of course

+

Response samples

Content type
application/json
{
  • "id": 0,
  • "resource_id": "ddce269a1e3d054cae349621c198dd52",
  • "date_id": "ddce269a1e3d054cae349621c198dd52",
  • "event_id": "f8c3de3d-1fea-4d7c-a8b0-29f63c4c3454"
}

Add a new scheduled event

path Parameters
course_id
required
string

ID of course

termin_id
required
string

ID of scheduled event

Request Body schema: */*

ScheduledEvent object to be added, course is determined by date_id

id
integer
resource_id
required
string
date_id
required
string
event_id
string

Responses

Response samples

Content type
application/json
{ }

Delete a scheduled event

path Parameters
course_id
required
string

ID of course

+

Response samples

Content type
application/json
{ }

Delete a scheduled event

path Parameters
course_id
required
string

ID of course

termin_id
required
string

ID of scheduled event

Responses

Modify multiple scheduled events

Pass a bulk operation type and a list of events to apply the bulk operation to

path Parameters
course_id
required
string

ID of course

Request Body schema: application/json

Schedule events to bulk operate on

action
string
Enum: "schedule" "unschedule" "update" "live"
termin_ids
Array of strings

Responses

Request samples

Content type
application/json
{
  • "action": "schedule",
  • "termin_ids": [
    ]
}

Response samples

Content type
application/json
{ }

opencast

Get user and roles by user name

Returns the user with all necessary role ids

+

Request samples

Content type
application/json
{
  • "action": "schedule",
  • "termin_ids": [
    ]
}

Response samples

Content type
application/json
{ }

opencast

Get user and roles by user name

Returns the user with all necessary role ids

path Parameters
username
required
string

The name that needs to be fetched.

query Parameters
token
required
string

API Key to use for the call

Responses

Response samples

Content type
application/json
{
  • "username": "string",
  • "roles": [
    ]
}

user

Get currently loggend in user

Returns a data structur with details and permissions for the currently authenticated user

+

Response samples

Content type
application/json
{
  • "username": "string",
  • "roles": [
    ]
}

user

Get currently loggend in user

Returns a data structur with details and permissions for the currently authenticated user

Responses

Response samples

Content type
application/json
{
  • "type": "user",
  • "id": "string",
  • "data": {
    }
}

Search for users

Search in users accessible to the currently authenticated user

+

Response samples

Content type
application/json
{
  • "type": "user",
  • "id": "string",
  • "data": {
    }
}

Search for users

Search in users accessible to the currently authenticated user

path Parameters
search_term
required
string

Part of user data to search for

Responses

Response samples

Content type
application/json
[
  • {
    }
]

log

Log an event

Pass details on log event type to create an entry in Stud.IPs log

+

Response samples

Content type
application/json
[
  • {
    }
]

log

Log an event

Pass details on log event type to create an entry in Stud.IPs log

Request Body schema: application/json

Details of the event

object

Responses

Request samples

Content type
application/json
{ }

Response samples

Content type
application/json
{ }
+

Request samples

Content type
application/json
{ }

Response samples

Content type
application/json
{ }
diff --git a/vueapp/components/Courses/CoursesSidebar.vue b/vueapp/components/Courses/CoursesSidebar.vue index 56356de28..a5535d5a5 100644 --- a/vueapp/components/Courses/CoursesSidebar.vue +++ b/vueapp/components/Courses/CoursesSidebar.vue @@ -31,15 +31,7 @@ Wiedergabelisten @@ -102,12 +102,17 @@
  • - {{ $gettext('Videos/Wiedergabeliste verknüpfen') }} + {{ $gettext('Videos/Wiedergabelisten übertragen') }}
  • + + @@ -115,14 +120,16 @@ import { mapGetters } from "vuex"; import StudipIcon from '@studip/StudipIcon.vue'; +import PlaylistAddCard from '@/components/Playlists/PlaylistAddCard.vue'; + export default { name: 'episodes-action-widget', components: { - StudipIcon + StudipIcon, PlaylistAddCard }, - emits: ['uploadVideo', 'recordVideo'], + emits: ['uploadVideo', 'recordVideo', 'copyAll'], data() { return { @@ -132,7 +139,7 @@ export default { }, computed: { - ...mapGetters(["playlists", "currentView", + ...mapGetters(["playlists", "currentView", 'addPlaylist', "cid", "semester_list", "semester_filter", 'currentUser', 'simple_config_list', 'course_config', 'currentPlaylist']), @@ -185,17 +192,10 @@ export default { this.$store.commit('setCurrentPlaylist', token); this.$store.commit('clearPaging'); - if (token === 'all' || token === null) { - this.$store.dispatch('loadCourseVideos', { - cid: this.cid, - }); - } else { - this.$store.dispatch('loadPlaylistCourseVideos', { - cid: this.cid, - token: token - }); - } - + this.$store.dispatch('loadPlaylistVideos', { + cid: this.cid, + token: token + }); }, getScheduleList() { @@ -207,30 +207,64 @@ export default { setView(page) { this.$store.dispatch('updateView', page); - if (this.currentPlaylist === 'all' || this.currentPlaylist === null) { - this.$store.dispatch('loadCourseVideos', { - cid: this.cid, - }); - } else { - this.$store.dispatch('loadPlaylistCourseVideos', { - cid: this.cid, - token: this.currentPlaylist - }); - } + this.$store.dispatch('loadPlaylistVideos', { + cid: this.cid, + token: this.currentPlaylist + }); + }, async setVisibility(visibility) { await this.$store.dispatch('setVisibility', {'cid': this.cid, 'visibility': visibility}); this.$router.go(); // Reload page to make changes visible in navigation tab + }, + + showCreatePlaylist() { + this.$store.dispatch('addPlaylistUI', true); + }, + + cancelPlaylistAdd() { + this.$store.dispatch('addPlaylistUI', false); + }, + + createPlaylist(playlist) { + this.$store.dispatch('addPlaylist', playlist); + }, + + getDefaultPlaylist() + { + let currentPlaylist = null; + + // set the courses default playlist + for (let id in this.playlists) { + if (this.playlists[id].is_default == '1') { + currentPlaylist = this.playlists[id].token; + } + } + + // if no default is found, use the first playlist + if (this.currentPlaylist == null) { + for (let id in this.playlists) { + currentPlaylist = this.playlists[id].token; + break; + } + } + + return currentPlaylist; } }, mounted() { - this.$store.dispatch('loadPlaylists'); + let view = this; + this.$store.dispatch('loadPlaylists'). + then(() => { + view.$store.commit('setCurrentPlaylist', view.getDefaultPlaylist()); + }) this.$store.dispatch('simpleConfigListRead'); this.$store.dispatch('loadCourseConfig', this.cid); this.semesterFilter = this.semester_filter; + }, watch: { @@ -244,6 +278,10 @@ export default { currentPlaylist(newValue, oldValue) { if (newValue !== oldValue) { + if (newValue === null) { + // use default playlist + newValue = this.getDefaultPlaylist(); + } this.setPlaylist(newValue); } } diff --git a/vueapp/components/UserPlaylistSelectable.vue b/vueapp/components/UserPlaylistSelectable.vue new file mode 100644 index 000000000..ada45b4bd --- /dev/null +++ b/vueapp/components/UserPlaylistSelectable.vue @@ -0,0 +1,100 @@ + + + diff --git a/vueapp/components/Videos/Actions/VideoAddToPlaylist.vue b/vueapp/components/Videos/Actions/VideoAddToPlaylist.vue index e69de29bb..34a94e848 100644 --- a/vueapp/components/Videos/Actions/VideoAddToPlaylist.vue +++ b/vueapp/components/Videos/Actions/VideoAddToPlaylist.vue @@ -0,0 +1,106 @@ + + + \ No newline at end of file diff --git a/vueapp/components/Videos/Actions/VideoCopyToSeminar.vue b/vueapp/components/Videos/Actions/VideoCopyToSeminar.vue index dfb31c84a..420551869 100644 --- a/vueapp/components/Videos/Actions/VideoCopyToSeminar.vue +++ b/vueapp/components/Videos/Actions/VideoCopyToSeminar.vue @@ -1,8 +1,8 @@