├── .github
└── workflows
│ ├── config.json
│ ├── config_all.json
│ ├── moodle-ci.yml
│ └── moodle-release.yml
├── CHANGELOG.md
├── README.md
├── addactivity.php
├── addactivityepisode.php
├── addlti.php
├── addltiepisode.php
├── addtranscription.php
├── addvideo.php
├── amd
├── build
│ ├── block_delete_handler.min.js
│ ├── block_delete_handler.min.js.map
│ ├── block_form_handler.min.js
│ ├── block_form_handler.min.js.map
│ ├── block_index.min.js
│ ├── block_index.min.js.map
│ ├── block_lti_form_handler.min.js
│ ├── block_lti_form_handler.min.js.map
│ ├── block_manage_series.min.js
│ ├── block_manage_series.min.js.map
│ ├── block_massaction.min.js
│ ├── block_massaction.min.js.map
│ ├── block_settings.min.js
│ ├── block_settings.min.js.map
│ ├── tabulator.min.js
│ └── tabulator.min.js.map
└── src
│ ├── block_delete_handler.js
│ ├── block_form_handler.js
│ ├── block_index.js
│ ├── block_lti_form_handler.js
│ ├── block_manage_series.js
│ ├── block_massaction.js
│ ├── block_settings.js
│ └── tabulator.js
├── backup
└── moodle2
│ ├── backup_opencast_block_task.class.php
│ ├── backup_opencast_stepslib.php
│ ├── restore_opencast_block_task.class.php
│ ├── restore_opencast_stepslib.php
│ └── settings
│ ├── block_backup_setting.class.php
│ └── block_restore_setting.class.php
├── batchupload.php
├── block_opencast.php
├── changeowner.php
├── changescheduledvisibility.php
├── changevisibility.php
├── changevisibility_massaction.php
├── classes
├── admin_setting_configeditabletable.php
├── admin_setting_configtextvalidate.php
├── admin_setting_hiddenhelpbtn.php
├── enrolled_user_selector.php
├── event
│ ├── upload_failed.php
│ └── upload_succeeded.php
├── external.php
├── groupaccess.php
├── local
│ ├── activitymodulemanager.php
│ ├── addactivity_form.php
│ ├── addactivityepisode_form.php
│ ├── addlti_form.php
│ ├── addltiepisode_form.php
│ ├── addtranscription_form.php
│ ├── addvideo_form.php
│ ├── apibridge.php
│ ├── attachment_helper.php
│ ├── autocomplete_suggestion_helper.php
│ ├── batchupload_form.php
│ ├── changeowner_form.php
│ ├── event.php
│ ├── eventstatus_notification_helper.php
│ ├── file_deletionmanager.php
│ ├── file_system_filedir.php
│ ├── flexible_table.php
│ ├── importvideos_coursesearch.php
│ ├── importvideos_select_series_form.php
│ ├── importvideos_step1_form.php
│ ├── importvideos_step2_form.php
│ ├── importvideos_step3_form.php
│ ├── importvideos_step3_form_acl.php
│ ├── importvideos_step4_form.php
│ ├── importvideosmanager.php
│ ├── ingest_uploader.php
│ ├── liveupdate_helper.php
│ ├── lti_helper.php
│ ├── ltimodulemanager.php
│ ├── managedefaults_form.php
│ ├── massaction_helper.php
│ ├── notifications.php
│ ├── scheduledvisibility_form.php
│ ├── series_form.php
│ ├── updatemetadata_form.php
│ ├── updatemetadata_form_massaction.php
│ ├── upload_helper.php
│ ├── visibility_form.php
│ ├── visibility_form_massaction.php
│ ├── visibility_helper.php
│ └── workflowconfiguration_helper.php
├── opencast_state_exception.php
├── output
│ └── importvideos
│ │ └── renderer.php
├── privacy
│ └── provider.php
├── setting_default_manager.php
├── setting_helper.php
└── task
│ ├── cleanup_imported_episodes_cron.php
│ ├── cleanup_lti_module_cron.php
│ ├── process_attachment_cron.php
│ ├── process_delete_cron.php
│ ├── process_delete_notification_cron.php
│ ├── process_duplicate_event.php
│ ├── process_duplicated_event_module_fix.php
│ ├── process_duplicated_event_visibility_change.php
│ ├── process_notification_cron.php
│ ├── process_upload_cron.php
│ └── process_visibility_cron.php
├── css
├── tabulator.min.css
└── tabulator_bootstrap4.min.css
├── db
├── access.php
├── caches.php
├── install.xml
├── messages.php
├── services.php
├── tasks.php
└── upgrade.php
├── deleteaclgroup.php
├── deletedraft.php
├── deleteevent.php
├── deleteevent_massaction.php
├── deletetranscription.php
├── directaccess.php
├── downloadtranscription.php
├── downloadvideo.php
├── engageredirect.php
├── importvideos.php
├── index.php
├── lang
└── en
│ ├── block_opencast.php
│ └── deprecated.txt
├── lib.php
├── managedefaults.php
├── manageseries.php
├── managetranscriptions.php
├── overview.php
├── overview_videos.php
├── pix
├── Thumbs.db
├── caption.svg
├── capturing.gif
├── failed.png
├── monologo.svg
├── play.png
├── play.svg
├── processing.png
├── share.png
├── share.svg
└── succeeded.png
├── recordvideo.php
├── renderer.php
├── reportproblem.php
├── serveworkflowconfigpanel.php
├── settings.php
├── startworkflow.php
├── startworkflow_massaction.php
├── styles.css
├── templates
├── defaults_settings_actions.mustache
├── delete_block_modal.mustache
├── series_settings_actions.mustache
├── series_table.mustache
├── table_legend_details.mustache
├── table_legend_help_icon.mustache
├── transcriptions_table.mustache
└── workflow_settings_opencast.mustache
├── tests
├── backup_test.php
├── behat
│ ├── behat_block_opencast.php
│ ├── block_opencast.feature
│ ├── block_opencast_addactivity.feature
│ ├── block_opencast_addactivityepisode.feature
│ ├── block_opencast_addlti.feature
│ ├── block_opencast_addvideo.feature
│ ├── block_opencast_addvideosbatch.feature
│ ├── block_opencast_autocomplete_metadata.feature
│ ├── block_opencast_changevisibility.feature
│ ├── block_opencast_cleanup_backup.feature
│ ├── block_opencast_cleanup_lti_modules.feature.disabled
│ ├── block_opencast_deletedraft.feature
│ ├── block_opencast_deleteevent.feature
│ ├── block_opencast_directaccess.feature.disabled
│ ├── block_opencast_importvideos.feature
│ ├── block_opencast_manageseries.feature
│ ├── block_opencast_massactions.feature
│ ├── block_opencast_reportproblem.feature
│ ├── block_opencast_startworkflow.feature
│ └── block_opencast_updatemetadata.feature
├── delete_file_test.php
├── fixtures
│ ├── api_calls
│ │ ├── delete
│ │ │ └── api_events_delete.json
│ │ ├── get
│ │ │ ├── api_events_acl.json
│ │ │ ├── api_events_byseries_1.json
│ │ │ ├── api_events_byseries_1_nolimit.json
│ │ │ ├── api_events_byseries_2.json
│ │ │ ├── api_events_byseries_changevisibility.json
│ │ │ ├── api_events_byseries_importvideo.json
│ │ │ ├── api_events_byseries_importvideo_2.json
│ │ │ ├── api_events_filter_newseries_importvideos.json
│ │ │ ├── api_events_filter_newseries_importvideos_nolimit.json
│ │ │ ├── api_events_get_single_changevisibility.json
│ │ │ ├── api_events_metadata.json
│ │ │ ├── api_events_single_event.json
│ │ │ ├── api_events_single_event_duplicated.json
│ │ │ ├── api_events_single_event_duplicated2.json
│ │ │ ├── api_series_acl.json
│ │ │ ├── api_series_acl2.json
│ │ │ ├── api_series_default_with_no_acl.json
│ │ │ ├── api_series_filter.json
│ │ │ ├── api_series_metadata.json
│ │ │ ├── api_series_three_noacl.json
│ │ │ ├── api_series_three_withacl.json
│ │ │ ├── api_series_two_noacl.json
│ │ │ ├── api_series_two_withacl.json
│ │ │ ├── api_series_withacl.json
│ │ │ ├── api_workflow_definitions_all.json
│ │ │ ├── api_workflow_definitions_api.json
│ │ │ ├── api_workflow_definitions_archive.json
│ │ │ ├── api_workflow_definitions_delete.json
│ │ │ ├── api_workflow_definitions_upload.json
│ │ │ ├── api_workflow_import_duplicate_with_workflowid.json
│ │ │ └── init_api_workflow_definitions_duplicate_event.json
│ │ ├── post
│ │ │ ├── api_series_createseries.json
│ │ │ ├── api_workflows_changevisivbility_startworkflow.json
│ │ │ ├── api_workflows_startworkflow.json
│ │ │ ├── api_workflows_updatemetadata.json
│ │ │ ├── api_workflows_updatemetadata_import.json
│ │ │ └── api_workflows_updatemetadata_import_change_visibility.json
│ │ └── put
│ │ │ ├── api_events_acl_2.json
│ │ │ ├── api_events_acl_import_change_visibility.json
│ │ │ ├── api_events_metadata_episode.json
│ │ │ ├── api_series_acl.json
│ │ │ ├── api_series_acl_2.json
│ │ │ └── api_series_metadata.json
│ ├── get_course_videos.js
│ ├── get_opencast_video.js
│ ├── get_series_by_identifier.js
│ ├── get_series_videos.js
│ └── test.mp4
├── generator
│ └── lib.php
├── helper
│ └── apibridge_testable.php
├── privacy_test.php
├── upload_ingest_with_configpanel_test.php
└── upload_test.php
├── thirdpartylibs.xml
├── updatemetadata.php
├── updatemetadata_massaction.php
├── version.php
└── videoeditor.php
/.github/workflows/config.json:
--------------------------------------------------------------------------------
1 | {
2 | "main-moodle": "MOODLE_405_STABLE",
3 | "main-php": "8.3",
4 | "main-oc": "16.7",
5 | "ocs": [],
6 | "main-db": "mariadb",
7 | "moodle-php": {
8 | "MOODLE_405_STABLE": ["8.1", "8.2"]
9 | },
10 | "moodle-plugin-ci": "4.4.5"
11 | }
12 |
--------------------------------------------------------------------------------
/.github/workflows/config_all.json:
--------------------------------------------------------------------------------
1 | {
2 | "main-moodle": "MOODLE_405_STABLE",
3 | "main-php": "8.3",
4 | "main-oc": "16.7",
5 | "ocs": [],
6 | "main-db": "mariadb",
7 | "moodle-php": {
8 | "MOODLE_401_STABLE": ["7.4", "8.0", "8.1"],
9 | "MOODLE_402_STABLE": ["8.0", "8.1", "8.2"],
10 | "MOODLE_403_STABLE": ["8.0", "8.1", "8.2"],
11 | "MOODLE_404_STABLE": ["8.1", "8.2", "8.3"],
12 | "MOODLE_405_STABLE": ["8.1", "8.2", "8.3"]
13 | },
14 | "moodle-plugin-ci": "4.4.5"
15 | }
16 |
--------------------------------------------------------------------------------
/.github/workflows/moodle-ci.yml:
--------------------------------------------------------------------------------
1 | name: Moodle Plugin CI
2 |
3 | ########################################################################################################################
4 |
5 | on: [ push, pull_request ]
6 |
7 | ########################################################################################################################
8 |
9 | jobs:
10 | call-moodle-ci-workflow:
11 | uses: Opencast-Moodle/moodle-workflows-opencast/.github/workflows/moodle-ci.yml@main
12 | with:
13 | requires-tool-plugin: true
14 | requires-mod-plugin: true
15 | branch-tool-plugin: main
16 | branch-mod-plugin: main
17 | branch-opencast-docker-default: 16.7
18 |
--------------------------------------------------------------------------------
/.github/workflows/moodle-release.yml:
--------------------------------------------------------------------------------
1 | name: Moodle Plugin Release
2 |
3 | ########################################################################################################################
4 |
5 | on:
6 | release:
7 | types: [ published ]
8 |
9 | ########################################################################################################################
10 |
11 | jobs:
12 | call-moodle-release-workflow:
13 | uses: Opencast-Moodle/moodle-workflows-opencast/.github/workflows/moodle-release.yml@main
14 | with:
15 | plugin-name: 'block_opencast'
16 | secrets: inherit
17 |
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | CHANGELOG
2 | =========
3 |
4 | 4.5.3 (2025-01-16)
5 | ------------------
6 | * [FIX] #413 Capability check for user before importing series
7 | * [FEATURE] #412 Settings link in Plugins overview and Manage blocks
8 | * [FEATURE] #411 Toggle Add Video(s) buttons during upload when using Chunkuploader
9 | * [FEATURE] #410 New events metadata field location
10 | * [FEATURE] #409 Dynamic video size limitation for chunkuploader setting
11 | * [FEATURE] #405 Use new opencast api exceptions from API plugin
12 |
13 |
14 | 4.5.2 aka 4.5.1 (2024-12-03)
15 | ------------------
16 | * [FIX] #404 Mass Action list - fixes
17 | * [FIX] #400 Applying correct default completion while building LTI module
18 | * [FIX] #399 Series Management UI/UX Improvements
19 | * [FIX] #386 Failed upload job limiter
20 | * [FEATURE] #398 Mass Action Support for Video List Tables
21 | * [FEATURE] #390 Workflow configuration panel during upload
22 | * [FEATURE] #373 Support for new transcription management (subtitles) in Opencast 15
23 |
24 |
25 | 4.5.0 (2024-11-12)
26 | ------------------
27 | * [FEATURE] #387 Language file ordering
28 | * [FEATURE] #383 Some basic codestyling things
29 | * [FIX] #372 Hidden duplicated videos end up having empty ACLs
30 | Moodle 4.5 compatible version
31 |
32 |
--------------------------------------------------------------------------------
/amd/build/block_delete_handler.min.js:
--------------------------------------------------------------------------------
1 | define("block_opencast/block_delete_handler",["exports","core/modal_factory","core/ajax","core/templates","core/prefetch","core/str","core/notification"],(function(_exports,_modal_factory,_ajax,_templates,_prefetch,_str,_notification){function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}
2 | /**
3 | * Javascript to add a custom block_delete handler
4 | *
5 | * @module block_opencast/block_delete_handler
6 | * @copyright 2024 Justus Dieckmann, University of Münster
7 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
8 | */Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.init=void 0,_modal_factory=_interopRequireDefault(_modal_factory),_ajax=_interopRequireDefault(_ajax),_templates=_interopRequireDefault(_templates),_prefetch=_interopRequireDefault(_prefetch),_notification=_interopRequireDefault(_notification);_exports.init=(contextid,deleteurl)=>{_prefetch.default.prefetchTemplate("block_opencast/delete_block_modal"),_prefetch.default.prefetchString("block_opencast","deletecheck_title_modal");document.querySelector(".block_opencast a.dropdown-item.block_opencast_delete").onclick=async e=>{e.preventDefault();const html=await _templates.default.render("block_opencast/delete_block_modal",{deleteblockurl:deleteurl}),modal=await _modal_factory.default.create({type:_modal_factory.default.types.CANCEL,body:html,title:await(0,_str.get_string)("deletecheck_title_modal","block_opencast"),large:!0});await modal.show(),modal.body[0].querySelector(".block_opencast-delete-mapping").onclick=async()=>{try{await _ajax.default.call([{methodname:"block_opencast_unlink_series",args:{contextid:contextid,ocinstanceid:-1,seriesid:"all"}}])[0],window.location=deleteurl}catch(e){_notification.default.exception(e)}}}}}));
9 |
10 | //# sourceMappingURL=block_delete_handler.min.js.map
--------------------------------------------------------------------------------
/amd/build/block_delete_handler.min.js.map:
--------------------------------------------------------------------------------
1 | {"version":3,"file":"block_delete_handler.min.js","sources":["../src/block_delete_handler.js"],"sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Javascript to add a custom block_delete handler\n *\n * @module block_opencast/block_delete_handler\n * @copyright 2024 Justus Dieckmann, University of Münster\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport ModalFactory from 'core/modal_factory';\nimport Ajax from 'core/ajax';\nimport Templates from 'core/templates';\nimport Prefetch from \"core/prefetch\";\nimport {get_string} from 'core/str';\nimport Notification from \"core/notification\";\n\nexport const init = (contextid, deleteurl) => {\n Prefetch.prefetchTemplate('block_opencast/delete_block_modal');\n Prefetch.prefetchString('block_opencast', 'deletecheck_title_modal');\n const deleteButton = document.querySelector('.block_opencast a.dropdown-item.block_opencast_delete');\n deleteButton.onclick = async(e) => {\n e.preventDefault();\n\n const html = await Templates.render('block_opencast/delete_block_modal', {\n deleteblockurl: deleteurl\n });\n\n const modal = await ModalFactory.create({\n type: ModalFactory.types.CANCEL,\n body: html,\n title: await get_string('deletecheck_title_modal', 'block_opencast'),\n large: true\n });\n await modal.show();\n modal.body[0].querySelector('.block_opencast-delete-mapping').onclick = async() => {\n try {\n await Ajax.call([{\n methodname: 'block_opencast_unlink_series',\n args: {contextid: contextid, ocinstanceid: -1, seriesid: 'all'}\n }])[0];\n window.location = deleteurl;\n } catch (e) {\n Notification.exception(e);\n }\n };\n };\n};\n"],"names":["contextid","deleteurl","prefetchTemplate","prefetchString","document","querySelector","onclick","async","e","preventDefault","html","Templates","render","deleteblockurl","modal","ModalFactory","create","type","types","CANCEL","body","title","large","show","Ajax","call","methodname","args","ocinstanceid","seriesid","window","location","exception"],"mappings":";;;;;;;wUA8BoB,CAACA,UAAWC,+BACnBC,iBAAiB,uDACjBC,eAAe,iBAAkB,2BACrBC,SAASC,cAAc,yDAC/BC,QAAUC,MAAAA,IACnBC,EAAEC,uBAEIC,WAAaC,mBAAUC,OAAO,oCAAqC,CACrEC,eAAgBZ,YAGda,YAAcC,uBAAaC,OAAO,CACpCC,KAAMF,uBAAaG,MAAMC,OACzBC,KAAMV,KACNW,YAAa,mBAAW,0BAA2B,kBACnDC,OAAO,UAELR,MAAMS,OACZT,MAAMM,KAAK,GAAGf,cAAc,kCAAkCC,QAAUC,oBAE1DiB,cAAKC,KAAK,CAAC,CACbC,WAAY,+BACZC,KAAM,CAAC3B,UAAWA,UAAW4B,cAAe,EAAGC,SAAU,UACzD,GACJC,OAAOC,SAAW9B,UACpB,MAAOO,yBACQwB,UAAUxB"}
--------------------------------------------------------------------------------
/amd/build/block_form_handler.min.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Javascript to initialise the opencast block.
3 | *
4 | * @module block_opencast
5 | * @copyright 2019 Farbod Zamani (zamani@elan-ev.de)
6 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
7 | */
8 | define("block_opencast/block_form_handler",["jquery"],(function($){function afterUpload(){window.presentationRun||window.presenterRun||(clearInterval(window.presentationIntervalHandle),clearInterval(window.presenterIntervalHandle),$('[name="submitbutton"]').removeAttr("disabled"))}function autocompletePrettifier(){$('div[data-fieldtype="autocomplete"]').each((function(i,elm){var input=$(elm).find("input");input.hasClass("form-control")||input.addClass("form-control")}))}function setDefaultTitle(filename){if(!$('input[name="title"]').val()&&filename){let filenameArray=filename.split(".");filenameArray.length>1&&filenameArray.pop(),filename=filenameArray.join("."),$('input[name="title"]').val(filename)}}function getFilenameFromFilelist(filelist){var filename="";if(filelist.length){var filelinks=filelist.find(".filepicker-filename > a");filename=filelinks.length?$(filelinks[0]).text():""}return filename}window.presenterIntervalHandle=null,window.presentationIntervalHandle=null,window.presenterRun=!1,window.presentationRun=!1;return{init:function(){$("#termsofuse").hide(),$("#termsofuse_toggle").on("click",(function(e){$("#termsofuse").toggle(),e.preventDefault()})),$('.local_chunkupload input[type="file"]').on("change",(function(e){setTimeout((function(){var span=$(e.currentTarget).siblings("label.chunkupload-label").find(".chunkupload-filename");span.length&&setDefaultTitle($(span[0]).text())}),500);var parent=e.currentTarget.closest(".local_chunkupload"),progressbar=parent?parent.querySelector(".chunkupload-progress"):null;if(progressbar){var videoIdentifier=e.currentTarget.getAttribute("id");["id_video_presenter_chunk_file","id_video_presentation_chunk_file"].includes(videoIdentifier)&&(document.querySelector('[name="submitbutton"]').disabled=!0),"id_video_presenter_chunk_file"==videoIdentifier?window.presenterIntervalHandle=setInterval((()=>{window.presenterRun=!0,0==progressbar.offsetWidth&&(window.presenterRun=!1,afterUpload())}),500):"id_video_presentation_chunk_file"==videoIdentifier&&(window.presenterIntervalHandle=setInterval((()=>{window.presentationRun=!0,0==progressbar.offsetWidth&&(window.presentationRun=!1,afterUpload())}),500))}})),$(".filepickerhidden").on("change",(function(e){setTimeout((function(){setDefaultTitle(getFilenameFromFilelist($(e.currentTarget).parent().find(".filepicker-filelist")))}),500)})),$(".filepicker-filelist").on("drop",(function(e){var filelist=e.currentTarget,videoIdentifier=$(filelist).parent().siblings(".filepickerhidden").attr("name");$('[name="submitbutton"]').attr("disabled","disabled"),"video_presenter"==videoIdentifier?($(filelist).addClass("presenter-uploading"),window.presenterIntervalHandle=setInterval((function(){window.presenterRun=!0,$(".presenter-uploading").hasClass("dndupload-inprogress")||(window.presenterRun=!1,afterUpload())}),500)):($(filelist).addClass("presentation-uploading"),window.presenterIntervalHandle=setInterval((function(){window.presentationRun=!0,$(".presentation-uploading").hasClass("dndupload-inprogress")||(window.presentationRun=!1,afterUpload())}),500)),setTimeout((function(){setDefaultTitle(getFilenameFromFilelist(filelist))}),500)})),setTimeout((function(){autocompletePrettifier(),$(".moreless-actions").on("click",(function(){autocompletePrettifier()}))}),1e3)}}}));
9 |
10 | //# sourceMappingURL=block_form_handler.min.js.map
--------------------------------------------------------------------------------
/amd/build/block_lti_form_handler.min.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Ajax functions for opencast
3 | *
4 | * @module block/opencast
5 | * @copyright 2020 Farbod Zamani (zamani@elan-ev.de)
6 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
7 | */
8 | define("block_opencast/block_lti_form_handler",["jquery"],(function($){return{init:function(){let waitseconds=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;setTimeout((()=>$("#ltiLaunchForm").submit()),1e3*waitseconds)}}}));
9 |
10 | //# sourceMappingURL=block_lti_form_handler.min.js.map
--------------------------------------------------------------------------------
/amd/build/block_lti_form_handler.min.js.map:
--------------------------------------------------------------------------------
1 | {"version":3,"file":"block_lti_form_handler.min.js","sources":["../src/block_lti_form_handler.js"],"sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Ajax functions for opencast\n *\n * @module block/opencast\n * @copyright 2020 Farbod Zamani (zamani@elan-ev.de)\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine(['jquery'], function($) {\n\n /**\n * Submits lti form.\n *\n * @param {int} waitseconds The optional waiting time in seconds.\n */\n var init = function(waitseconds = 0) {\n setTimeout(() => $('#ltiLaunchForm').submit(), waitseconds * 1000);\n };\n return {\n init: init\n };\n});\n"],"names":["define","$","init","waitseconds","setTimeout","submit"],"mappings":";;;;;;;AAsBAA,+CAAO,CAAC,WAAW,SAASC,SAUjB,CACHC,KAJO,eAASC,mEAAc,EAC9BC,YAAW,IAAMH,EAAE,kBAAkBI,UAAwB,IAAdF"}
--------------------------------------------------------------------------------
/amd/src/block_delete_handler.js:
--------------------------------------------------------------------------------
1 | // This file is part of Moodle - http://moodle.org/
2 | //
3 | // Moodle is free software: you can redistribute it and/or modify
4 | // it under the terms of the GNU General Public License as published by
5 | // the Free Software Foundation, either version 3 of the License, or
6 | // (at your option) any later version.
7 | //
8 | // Moodle is distributed in the hope that it will be useful,
9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | // GNU General Public License for more details.
12 | //
13 | // You should have received a copy of the GNU General Public License
14 | // along with Moodle. If not, see .
15 |
16 | /**
17 | * Javascript to add a custom block_delete handler
18 | *
19 | * @module block_opencast/block_delete_handler
20 | * @copyright 2024 Justus Dieckmann, University of Münster
21 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
22 | */
23 |
24 | import ModalFactory from 'core/modal_factory';
25 | import Ajax from 'core/ajax';
26 | import Templates from 'core/templates';
27 | import Prefetch from "core/prefetch";
28 | import {get_string} from 'core/str';
29 | import Notification from "core/notification";
30 |
31 | export const init = (contextid, deleteurl) => {
32 | Prefetch.prefetchTemplate('block_opencast/delete_block_modal');
33 | Prefetch.prefetchString('block_opencast', 'deletecheck_title_modal');
34 | const deleteButton = document.querySelector('.block_opencast a.dropdown-item.block_opencast_delete');
35 | deleteButton.onclick = async(e) => {
36 | e.preventDefault();
37 |
38 | const html = await Templates.render('block_opencast/delete_block_modal', {
39 | deleteblockurl: deleteurl
40 | });
41 |
42 | const modal = await ModalFactory.create({
43 | type: ModalFactory.types.CANCEL,
44 | body: html,
45 | title: await get_string('deletecheck_title_modal', 'block_opencast'),
46 | large: true
47 | });
48 | await modal.show();
49 | modal.body[0].querySelector('.block_opencast-delete-mapping').onclick = async() => {
50 | try {
51 | await Ajax.call([{
52 | methodname: 'block_opencast_unlink_series',
53 | args: {contextid: contextid, ocinstanceid: -1, seriesid: 'all'}
54 | }])[0];
55 | window.location = deleteurl;
56 | } catch (e) {
57 | Notification.exception(e);
58 | }
59 | };
60 | };
61 | };
62 |
--------------------------------------------------------------------------------
/amd/src/block_lti_form_handler.js:
--------------------------------------------------------------------------------
1 | // This file is part of Moodle - http://moodle.org/
2 | //
3 | // Moodle is free software: you can redistribute it and/or modify
4 | // it under the terms of the GNU General Public License as published by
5 | // the Free Software Foundation, either version 3 of the License, or
6 | // (at your option) any later version.
7 | //
8 | // Moodle is distributed in the hope that it will be useful,
9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | // GNU General Public License for more details.
12 | //
13 | // You should have received a copy of the GNU General Public License
14 | // along with Moodle. If not, see .
15 |
16 | /**
17 | * Ajax functions for opencast
18 | *
19 | * @module block/opencast
20 | * @copyright 2020 Farbod Zamani (zamani@elan-ev.de)
21 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
22 | */
23 | define(['jquery'], function($) {
24 |
25 | /**
26 | * Submits lti form.
27 | *
28 | * @param {int} waitseconds The optional waiting time in seconds.
29 | */
30 | var init = function(waitseconds = 0) {
31 | setTimeout(() => $('#ltiLaunchForm').submit(), waitseconds * 1000);
32 | };
33 | return {
34 | init: init
35 | };
36 | });
37 |
--------------------------------------------------------------------------------
/backup/moodle2/settings/block_backup_setting.class.php:
--------------------------------------------------------------------------------
1 | .
16 |
17 | /**
18 | * Extends the backup settings class to control layout of checkbox.
19 | *
20 | * @package block_opencast
21 | * @copyright 2018 Andreas Wagner, SYNERGY LEARNING
22 | * @author Andreas Wagner
23 | * @author Farbod Zamani Boroujeni (2024)
24 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
25 | */
26 |
27 | /**
28 | * Extends the backup settings class to control layout of checkbox.
29 | *
30 | * @package block_opencast
31 | * @copyright 2018 Andreas Wagner, SYNERGY LEARNING
32 | * @author Andreas Wagner
33 | * @author Farbod Zamani Boroujeni (2024)
34 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
35 | */
36 | class backup_block_opencast_setting extends backup_setting {
37 |
38 |
39 | /**
40 | * Create an instance of this class. Note that this is used to control level and layout of this setting.
41 | *
42 | * @param string $name Name of the setting
43 | * @param string $vtype Type of the setting
44 | * @param mixed $value Value of the setting
45 | * @param int $level Level of the setting
46 | * @param bool $visibility Is the setting visible in the UI
47 | * @param int $status Status of the setting with regards to the locking
48 | * @param array $attributes The arrtibutes of uisetting element
49 | */
50 | public function __construct($name, $vtype, $value = null, $level = self::COURSE_LEVEL, $visibility = self::VISIBLE,
51 | $status = self::NOT_LOCKED, $attributes = null) {
52 |
53 | // Set level.
54 | $this->level = $level;
55 |
56 | // In case attributes is empty, we set the default.
57 | if (empty($attributes)) {
58 | $attributes = [
59 | 'class' => 'block-opencast-include',
60 | ];
61 | }
62 |
63 | // Parent construction.
64 | parent::__construct($name, $vtype, $value, $visibility, $status);
65 |
66 | // Making setting ui component (checkbox).
67 | $uisetting = new backup_setting_ui_checkbox(
68 | $this,
69 | $name,
70 | null,
71 | $attributes
72 | );
73 | // Set the icon to make the setting option more recognizable.
74 | $uisetting->set_icon(
75 | new image_icon(
76 | 'monologo',
77 | get_string('pluginname', 'block_opencast'),
78 | 'block_opencast',
79 | ['class' => 'iconlarge icon-post ml-1']
80 | )
81 | );
82 |
83 | // Set the setting ui component.
84 | $this->uisetting = $uisetting;
85 | }
86 | }
87 |
--------------------------------------------------------------------------------
/backup/moodle2/settings/block_restore_setting.class.php:
--------------------------------------------------------------------------------
1 | .
16 |
17 | /**
18 | * Extends the restore settings class to control layout of the checkbox.
19 | *
20 | * @package block_opencast
21 | * @copyright 2018 Andreas Wagner, SYNERGY LEARNING
22 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
23 | */
24 | defined('MOODLE_INTERNAL') || die();
25 |
26 | global $CFG;
27 |
28 | require_once($CFG->dirroot . '/blocks/opencast/backup/moodle2/settings/block_backup_setting.class.php');
29 |
30 | /**
31 | * Extends the restore settings class.
32 | *
33 | * @package block_opencast
34 | * @copyright 2018 Andreas Wagner, SYNERGY LEARNING
35 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
36 | */
37 | class restore_block_opencast_setting extends backup_block_opencast_setting {
38 |
39 | }
40 |
--------------------------------------------------------------------------------
/classes/admin_setting_configeditabletable.php:
--------------------------------------------------------------------------------
1 | .
16 |
17 | /**
18 | * Admin setting class which is used to create an editable table.
19 | *
20 | * @package block_opencast
21 | * @copyright 2021 Tamara Gunkel, University of Münster
22 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
23 | */
24 |
25 | namespace block_opencast;
26 |
27 | use admin_setting;
28 |
29 | /**
30 | * Admin setting class which is used to create an editable table.
31 | *
32 | * @package block_opencast
33 | * @copyright 2021 Tamara Gunkel, University of Münster
34 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
35 | */
36 | class admin_setting_configeditabletable extends admin_setting {
37 |
38 | /** @var string Id of the div tag */
39 | private $divid;
40 | /** @var string Text for add button */
41 | private $buttontext;
42 |
43 | /**
44 | * Not a setting, just an editable table.
45 | * @param string $name Setting name
46 | * @param string $divid Id of the div tag
47 | * @param string $buttontext Text of "Add row" button
48 | */
49 | public function __construct($name, $divid, $buttontext) {
50 | $this->nosave = true;
51 | $this->divid = $divid;
52 | $this->buttontext = $buttontext;
53 | parent::__construct($name, '', '', '');
54 | }
55 |
56 | /**
57 | * Always returns true
58 | *
59 | * @return bool Always returns true
60 | */
61 | public function get_setting() {
62 | return true;
63 | }
64 |
65 | /**
66 | * Always returns true
67 | *
68 | * @return bool Always returns true
69 | */
70 | public function get_defaultsetting() {
71 | return true;
72 | }
73 |
74 | /**
75 | * Never write settings
76 | *
77 | * @param mixed $data Gets converted to str for comparison against yes value
78 | * @return string Always returns an empty string
79 | */
80 | public function write_setting($data) {
81 | // Do not write any setting.
82 | return '';
83 | }
84 |
85 | /**
86 | * Returns an HTML string
87 | *
88 | * @param string $data
89 | * @param string $query
90 | * @return string Returns an HTML string
91 | */
92 | public function output_html($data, $query = '') {
93 | return '
' . $this->buttontext . '
';
96 | }
97 | }
98 |
--------------------------------------------------------------------------------
/classes/admin_setting_configtextvalidate.php:
--------------------------------------------------------------------------------
1 | .
16 |
17 | /**
18 | * Admin setting class which provides a configtext with custom validation function.
19 | *
20 | * @package block_opencast
21 | * @copyright 2022 Tamara Gunkel, University of Münster
22 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
23 | */
24 |
25 | namespace block_opencast;
26 |
27 | use admin_setting_configtext;
28 |
29 | /**
30 | * Admin setting class which provides a configtext with custom validation function.
31 | *
32 | * @package block_opencast
33 | * @copyright 2022 Tamara Gunkel, University of Münster
34 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
35 | */
36 | class admin_setting_configtextvalidate extends admin_setting_configtext {
37 |
38 | /** @var callable|null Validation function */
39 | protected $validatefunction = null;
40 |
41 | /**
42 | * Sets a validate function.
43 | *
44 | * The callback will be passed one parameter, the new setting value, and should return either
45 | * true if the value is OK, or an error message if not.
46 | *
47 | * @param callable|null $validatefunction Validate function or null to clear
48 | */
49 | public function set_validate_function(?callable $validatefunction = null) {
50 | $this->validatefunction = $validatefunction;
51 | }
52 |
53 | /**
54 | * Validate data before storage
55 | * @param string $data New setting data
56 | * @return mixed true if ok string if error found
57 | */
58 | public function validate($data) {
59 | $valid = parent::validate($data);
60 | if ($valid === true) {
61 | // Parent validation was successful.
62 | // If validation function is specified, call it now.
63 | if ($this->validatefunction) {
64 | return call_user_func($this->validatefunction, $data);
65 | } else {
66 | return true;
67 | }
68 | } else {
69 | return $valid;
70 | }
71 | }
72 | }
73 |
--------------------------------------------------------------------------------
/classes/admin_setting_hiddenhelpbtn.php:
--------------------------------------------------------------------------------
1 | .
16 |
17 | /**
18 | * Admin setting class which is used to create a hidden help button.
19 | *
20 | * @package block_opencast
21 | * @copyright 2021 Tamara Gunkel, University of Münster
22 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
23 | */
24 |
25 | namespace block_opencast;
26 |
27 | use admin_setting;
28 |
29 | /**
30 | * Admin setting class which is used to create a hidden help button.
31 | *
32 | * @package block_opencast
33 | * @copyright 2021 Tamara Gunkel, University of Münster
34 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
35 | */
36 | class admin_setting_hiddenhelpbtn extends admin_setting {
37 |
38 | /** @var string Id of the div tag */
39 | private $divid;
40 |
41 | /** @var string Name for help icon creation */
42 | private $iconname;
43 |
44 | /** @var string Component */
45 | private $component;
46 |
47 | /**
48 | * Not a setting, just an editable table.
49 | * @param string $name Setting name
50 | * @param string $divid Id of the div tag
51 | * @param string $iconname Icon that is displayed as help button
52 | * @param string $component Component
53 | */
54 | public function __construct($name, $divid, $iconname, $component) {
55 | $this->nosave = true;
56 | $this->divid = $divid;
57 | $this->iconname = $iconname;
58 | $this->component = $component;
59 | parent::__construct($name, '', '', '');
60 | }
61 |
62 | /**
63 | * Always returns true
64 | *
65 | * @return bool Always returns true
66 | */
67 | public function get_setting() {
68 | return true;
69 | }
70 |
71 | /**
72 | * Always returns true
73 | *
74 | * @return bool Always returns true
75 | */
76 | public function get_defaultsetting() {
77 | return true;
78 | }
79 |
80 | /**
81 | * Never write settings
82 | *
83 | * @param mixed $data Gets converted to str for comparison against yes value
84 | * @return string Always returns an empty string
85 | */
86 | public function write_setting($data) {
87 | // Do not write any setting.
88 | return '';
89 | }
90 |
91 | /**
92 | * Returns an HTML string
93 | *
94 | * @param string $data
95 | * @param string $query
96 | * @return string Returns an HTML string
97 | */
98 | public function output_html($data, $query = '') {
99 | global $OUTPUT;
100 | return '' .
101 | $OUTPUT->help_icon($this->iconname, $this->component) .
102 | '
';
103 | }
104 | }
105 |
--------------------------------------------------------------------------------
/classes/enrolled_user_selector.php:
--------------------------------------------------------------------------------
1 | .
16 |
17 | /**
18 | * User selector for change user dialog.
19 | *
20 | * @package block_opencast
21 | * @copyright 2022 Tamara Gunkel, WWU
22 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
23 | */
24 |
25 | defined('MOODLE_INTERNAL') || die();
26 |
27 | require_once($CFG->dirroot . '/user/selector/lib.php');
28 |
29 | /**
30 | * User selector for change user dialog.
31 | *
32 | * @package block_opencast
33 | * @copyright 2022 Tamara Gunkel, WWU
34 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
35 | */
36 | class block_opencast_enrolled_user_selector extends user_selector_base {
37 |
38 | /** @var bool|context|context_system|mixed|null Moodle context, usually course */
39 | protected $context;
40 |
41 | /**
42 | * Creates the selector.
43 | * @param string $name control name
44 | * @param array $options should have two elements with keys groupid and courseid.
45 | */
46 | public function __construct($name, $options) {
47 | if (isset($options['context'])) {
48 | $this->context = $options['context'];
49 | } else {
50 | $this->context = context::instance_by_id($options['contextid']);
51 | }
52 | parent::__construct($name, $options);
53 | }
54 |
55 | /**
56 | * Get options supported by the selector.
57 | * @return array
58 | */
59 | protected function get_options() {
60 | $options = parent::get_options();
61 | $options['contextid'] = $this->context->id;
62 | return $options;
63 | }
64 |
65 | /**
66 | * Returns enrolled users in a course.
67 | * @param string $search Search conditions
68 | * @return array|array[] Users
69 | * @throws coding_exception
70 | * @throws dml_exception
71 | */
72 | public function find_users($search) {
73 | global $DB;
74 |
75 | list($enrolsql, $eparams) = get_enrolled_sql($this->context);
76 |
77 | list($wherecondition, $params) = $this->search_sql($search, 'u');
78 | $params = array_merge($params, $eparams);
79 |
80 | $fields = 'SELECT ' . $this->required_fields_sql('u');
81 | $countfields = 'SELECT COUNT(u.id)';
82 |
83 | $sql = " FROM ($enrolsql) enrolled_users_view
84 | JOIN {user} u ON u.id = enrolled_users_view.id
85 | WHERE $wherecondition";
86 | $params['contextid'] = $this->context->id;
87 |
88 | list($sort, $sortparams) = users_order_by_sql('u', $search, $this->accesscontext);
89 | $order = ' ORDER BY ' . $sort;
90 |
91 | if (!$this->is_validating()) {
92 | $potentialmemberscount = $DB->count_records_sql($countfields . $sql, $params);
93 | if ($potentialmemberscount > $this->maxusersperpage) {
94 | return $this->too_many_results($search, $potentialmemberscount);
95 | }
96 | }
97 |
98 | $availableusers = $DB->get_records_sql($fields . $sql . $order, array_merge($params, $sortparams));
99 |
100 | if (empty($availableusers)) {
101 | return [];
102 | }
103 |
104 | if ($search) {
105 | $groupname = get_string('potusersmatching', 'core_role', $search);
106 | } else {
107 | $groupname = get_string('potusers', 'core_role');
108 | }
109 |
110 | return [$groupname => $availableusers];
111 | }
112 | }
113 |
--------------------------------------------------------------------------------
/classes/event/upload_failed.php:
--------------------------------------------------------------------------------
1 | .
16 |
17 | /**
18 | * Event of block opencast for failing uploads.
19 | *
20 | * @package block_opencast
21 | * @copyright 2017 Andreas Wagner, SYNERGY LEARNING
22 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
23 | */
24 |
25 | namespace block_opencast\event;
26 |
27 | use core\event\base;
28 | use moodle_url;
29 |
30 | /**
31 | * Event of block opencast for failing uploads.
32 | *
33 | * @package block_opencast
34 | * @copyright 2017 Andreas Wagner, SYNERGY LEARNING
35 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
36 | */
37 | class upload_failed extends base {
38 |
39 |
40 | /**
41 | * Init method.
42 | *
43 | * @return void
44 | */
45 | protected function init() {
46 | $this->data['crud'] = 'c';
47 | $this->data['edulevel'] = self::LEVEL_OTHER;
48 | $this->data['objecttable'] = 'block_opencast_uploadjob';
49 | }
50 |
51 | /**
52 | * Return localised event name.
53 | *
54 | * @return string
55 | */
56 | public static function get_name() {
57 | return get_string('eventuploadfailed', 'block_opencast');
58 | }
59 |
60 | /**
61 | * Returns description of what happened.
62 | *
63 | * @return string
64 | */
65 | public function get_description() {
66 | $archived = "";
67 | if (isset($this->data['other']['archived']) && $this->data['other']['archived'] === true) {
68 | $archived = " the upload job has now been archived, ";
69 | }
70 | return "The upload of {$this->data['other']['filename']} (Course: {$this->data['courseid']}) " .
71 | "to opencast instance {$this->data['ocinstanceid']} failed {$this->data['other']['countfailed']} times, " .
72 | $archived .
73 | "Reason: {$this->data['other']['errormessage']}";
74 | }
75 |
76 | /**
77 | * Get URL related to the action.
78 | *
79 | * @return moodle_url
80 | */
81 | public function get_url() {
82 | return new moodle_url('/blocks/opencast/index.php',
83 | ['courseid' => $this->data['courseid'], 'ocinstanceid' => $this->data['ocinstanceid']]);
84 | }
85 |
86 | }
87 |
--------------------------------------------------------------------------------
/classes/event/upload_succeeded.php:
--------------------------------------------------------------------------------
1 | .
16 |
17 | /**
18 | * Event of block opencast for succeeding uploads.
19 | *
20 | * @package block_opencast
21 | * @copyright 2017 Andreas Wagner, SYNERGY LEARNING
22 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
23 | */
24 |
25 | namespace block_opencast\event;
26 |
27 | use core\event\base;
28 | use moodle_url;
29 |
30 | /**
31 | * Event of block opencast for succeeding uploads.
32 | *
33 | * @package block_opencast
34 | * @copyright 2017 Andreas Wagner, SYNERGY LEARNING
35 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
36 | */
37 | class upload_succeeded extends base {
38 |
39 |
40 | /**
41 | * Init method.
42 | *
43 | * @return void
44 | */
45 | protected function init() {
46 | $this->data['crud'] = 'c';
47 | $this->data['edulevel'] = self::LEVEL_OTHER;
48 | $this->data['objecttable'] = 'block_opencast_uploadjob';
49 | }
50 |
51 | /**
52 | * Return localised event name.
53 | *
54 | * @return string
55 | */
56 | public static function get_name() {
57 | return get_string('eventuploadsucceeded', 'block_opencast');
58 | }
59 |
60 | /**
61 | * Returns description of what happened.
62 | *
63 | * @return string
64 | */
65 | public function get_description() {
66 | return "the upload of {$this->data['other']['filename']} (Course: {$this->data['courseid']}) " .
67 | "to opencast instance {$this->data['other']['ocinstanceid']} was successful.";
68 | }
69 |
70 | /**
71 | * Get URL related to the action.
72 | *
73 | * @return moodle_url
74 | */
75 | public function get_url() {
76 | return new moodle_url('/blocks/opencast/index.php',
77 | ['courseid' => $this->data['courseid'], 'ocinstanceid' => $this->data['other']['ocinstanceid']]);
78 | }
79 |
80 | }
81 |
--------------------------------------------------------------------------------
/classes/groupaccess.php:
--------------------------------------------------------------------------------
1 | .
16 |
17 | /**
18 | * Persistent table of groupaccess
19 | *
20 | * @package block_opencast
21 | * @copyright 2018 Tobias Reischmann WWU
22 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
23 | */
24 |
25 | namespace block_opencast;
26 |
27 | use core\persistent;
28 |
29 | /**
30 | * Persistent table of groupaccess
31 | *
32 | * @package block_opencast
33 | * @copyright 2018 Tobias Reischmann WWU
34 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
35 | */
36 | class groupaccess extends persistent {
37 |
38 |
39 | /** Table name for the persistent. */
40 | const TABLE = 'block_opencast_groupaccess';
41 |
42 | /**
43 | * Return the definition of the properties of this model.
44 | *
45 | * @return array
46 | */
47 | protected static function define_properties() {
48 | return [
49 | 'id' => [
50 | 'type' => PARAM_INT,
51 | ],
52 | 'ocinstanceid' => [
53 | 'type' => PARAM_INT,
54 | ],
55 | 'opencasteventid' => [
56 | 'type' => PARAM_ALPHANUMEXT,
57 | ],
58 | 'moodlegroups' => [
59 | 'type' => PARAM_SEQUENCE,
60 | ],
61 | ];
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/classes/local/changeowner_form.php:
--------------------------------------------------------------------------------
1 | .
16 |
17 | /**
18 | * Form for changing the owner of a video.
19 | *
20 | * @package block_opencast
21 | * @copyright 2022 Tamara Gunkel, University of Münster
22 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
23 | */
24 |
25 | namespace block_opencast\local;
26 |
27 | use moodleform;
28 |
29 | defined('MOODLE_INTERNAL') || die();
30 |
31 | require_once($CFG->dirroot . '/lib/formslib.php');
32 |
33 | /**
34 | * Form for changing the owner of a video.
35 | *
36 | * @package block_opencast
37 | * @copyright 2022 Tamara Gunkel, University of Münster
38 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
39 | */
40 | class changeowner_form extends moodleform {
41 |
42 |
43 | /**
44 | * Form definition.
45 | */
46 | public function definition() {
47 | global $PAGE;
48 |
49 | // Define mform.
50 | $mform = $this->_form;
51 | $ocinstanceid = $this->_customdata['ocinstanceid'];
52 | $identifier = $this->_customdata['identifier'];
53 |
54 | // Get renderer.
55 | $renderer = $PAGE->get_renderer('block_opencast', 'importvideos');
56 |
57 | // Add hidden fields for transferring the wizard results and for wizard step processing.
58 | $mform->addElement('hidden', 'courseid', $this->_customdata['courseid']);
59 | $mform->setType('courseid', PARAM_INT);
60 | $mform->addElement('hidden', 'ocinstanceid', $ocinstanceid);
61 | $mform->setType('ocinstanceid', PARAM_INT);
62 | $mform->addElement('hidden', 'identifier', $identifier);
63 | $mform->setType('identifier', PARAM_INT);
64 | $mform->addElement('hidden', 'isseries', $this->_customdata['isseries']);
65 | $mform->setType('isseries', PARAM_BOOL);
66 |
67 | if ($this->_customdata['isseries']) {
68 | if ($this->_customdata['noowner']) {
69 | $notification = $renderer->wizard_intro_notification(
70 | get_string('claimownerseries_explanation', 'block_opencast', $this->_customdata['title']));
71 | } else {
72 | $notification = $renderer->wizard_intro_notification(
73 | get_string('changeownerseries_explanation', 'block_opencast', $this->_customdata['title']));
74 | }
75 | } else {
76 | if ($this->_customdata['noowner']) {
77 | $notification = $renderer->wizard_intro_notification(
78 | get_string('claimowner_explanation', 'block_opencast', $this->_customdata['title']));
79 | } else {
80 | $notification = $renderer->wizard_intro_notification(
81 | get_string('changeowner_explanation', 'block_opencast', $this->_customdata['title']));
82 | }
83 | }
84 |
85 | $mform->addElement('html', $notification);
86 | $mform->addElement('html', $this->_customdata['userselector']->display(true));
87 |
88 | // Add action buttons.
89 | $this->add_action_buttons(true, get_string('changeowner', 'block_opencast'));
90 | }
91 | }
92 |
--------------------------------------------------------------------------------
/classes/local/file_system_filedir.php:
--------------------------------------------------------------------------------
1 | .
16 |
17 | /**
18 | * Subclass of the file_system_filedir class to delete one single file from trashdir.
19 | *
20 | * @package block_opencast
21 | * @copyright 2018 Andreas Wagner, Synergy Learning
22 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
23 | */
24 |
25 | namespace block_opencast\local;
26 |
27 | defined('MOODLE_INTERNAL') || die();
28 |
29 | require_once($CFG->dirroot . '/lib/filestorage/file_system_filedir.php');
30 |
31 | /**
32 | * Subclass of the file_system_filedir class to delete one single file from trashdir.
33 | *
34 | * @package block_opencast
35 | * @copyright 2018 Andreas Wagner, Synergy Learning
36 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
37 | */
38 | class file_system_filedir extends \file_system_filedir {
39 |
40 |
41 | /**
42 | * Unlink one file in the trashdir by contenthash
43 | *
44 | * @param string $contenthash
45 | * @return boolean true if succeeded
46 | */
47 | public function delete_file_from_trashdir($contenthash) {
48 |
49 | if (!$this->file_exists_in_trashdir($contenthash)) {
50 | return false;
51 | }
52 |
53 | $filepath = $this->get_trash_fullpath_from_hash($contenthash);
54 | return unlink($filepath);
55 | }
56 |
57 | /**
58 | * Check, if a file exists in trashdir.
59 | *
60 | * @param string $contenthash
61 | * @return boolean true, if the file exists in trashdir.
62 | */
63 | public function file_exists_in_trashdir($contenthash) {
64 | $filepath = $this->get_trash_fullpath_from_hash($contenthash);
65 | return file_exists($filepath);
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/classes/local/flexible_table.php:
--------------------------------------------------------------------------------
1 | .
16 |
17 | /**
18 | * Subclass of the flexible_table class to override methods.
19 | *
20 | * @package block_opencast
21 | * @copyright 2018 Andreas Wagner, Synergy Learning
22 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
23 | */
24 |
25 | namespace block_opencast\local;
26 |
27 | use html_writer;
28 |
29 | defined('MOODLE_INTERNAL') || die();
30 |
31 | require_once($CFG->dirroot . '/lib/tablelib.php');
32 |
33 | /**
34 | * Subclass of the flexible_table class to override methods.
35 | *
36 | * @package block_opencast
37 | * @copyright 2018 Andreas Wagner, Synergy Learning
38 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
39 | */
40 | class flexible_table extends \flexible_table {
41 |
42 |
43 | /**
44 | * Overridden method to change content and format of display notification.
45 | */
46 | public function print_nothing_to_display() {
47 |
48 | // Render button to allow user to reset table preferences.
49 | echo $this->render_reset_button();
50 |
51 | $this->print_initials_bar();
52 |
53 | // SYNERGY LEARNING: change format and content of display.
54 | echo html_writer::tag('p', (get_string('nothingtodisplay', 'block_opencast')));
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/classes/local/importvideos_coursesearch.php:
--------------------------------------------------------------------------------
1 | .
16 |
17 | /**
18 | * Import videos course search component for block_opencast.
19 | *
20 | * @package block_opencast
21 | * @copyright 2020 Alexander Bias, Ulm University
22 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
23 | */
24 |
25 | namespace block_opencast\local;
26 |
27 | use import_course_search;
28 |
29 | defined('MOODLE_INTERNAL') || die();
30 |
31 | require_once($CFG->dirroot . '/backup/util/includes/backup_includes.php');
32 | require_once($CFG->dirroot . '/backup/util/includes/restore_includes.php');
33 | require_once($CFG->dirroot . '/backup/util/ui/import_extensions.php');
34 |
35 | /**
36 | * Import videos course search component for block_opencast.
37 | *
38 | * @package block_opencast
39 | * @copyright 2020 Alexander Bias, Ulm University
40 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
41 | */
42 | class importvideos_coursesearch extends import_course_search {
43 |
44 |
45 | /**
46 | * Sets up the access restrictions for the courses to be displayed in the search.
47 | */
48 | protected function setup_restrictions() {
49 | $this->require_capability('block/opencast:manualimportsource');
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/classes/local/importvideos_select_series_form.php:
--------------------------------------------------------------------------------
1 | .
16 |
17 | /**
18 | * Manual import videos form (Step 2: Select videos).
19 | *
20 | * @package block_opencast
21 | * @copyright 2020 Alexander Bias, Ulm University
22 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
23 | */
24 |
25 | namespace block_opencast\local;
26 |
27 | use moodleform;
28 |
29 | defined('MOODLE_INTERNAL') || die();
30 |
31 | require_once($CFG->dirroot . '/lib/formslib.php');
32 |
33 | /**
34 | * Manual import videos form (Step 2: Select videos).
35 | *
36 | * @package block_opencast
37 | * @copyright 2020 Alexander Bias, Ulm University
38 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
39 | */
40 | class importvideos_select_series_form extends moodleform {
41 |
42 |
43 | /**
44 | * Form definition.
45 | */
46 | public function definition() {
47 | global $PAGE;
48 |
49 | // Define mform.
50 | $mform = $this->_form;
51 |
52 | // Get renderer.
53 | $renderer = $PAGE->get_renderer('block_opencast', 'importvideos');
54 |
55 | // Add hidden fields for transferring the wizard results and for wizard step processing.
56 | $mform->addElement('hidden', 'courseid', $this->_customdata['courseid']);
57 | $mform->setType('courseid', PARAM_INT);
58 | $mform->addElement('hidden', 'step', 2);
59 | $mform->setType('step', PARAM_INT);
60 | $mform->addElement('hidden', 'sourcecourseid', $this->_customdata['sourcecourseid']);
61 | $mform->setType('sourcecourseid', PARAM_INT);
62 | $mform->addElement('hidden', 'ocinstanceid', $this->_customdata['ocinstanceid']);
63 | $mform->setType('ocinstanceid', PARAM_INT);
64 |
65 | // Get list of available series.
66 | $courseseries = $this->_customdata['series'];
67 |
68 | // Add intro.
69 | $notification = $renderer->wizard_intro_notification(
70 | get_string('importvideos_wizardstep2aclintro', 'block_opencast'));
71 | $mform->addElement('html', $notification);
72 |
73 | // Add one single empty static element.
74 | // This is just there to let us attach an validation error message as this can't be attached to the checkbox group.
75 | $mform->addElement('static', 'coursevideosvalidation', '', '');
76 |
77 | $radioarray = [];
78 | foreach ($courseseries as $id => $title) {
79 | $radioarray[] = $mform->createElement('radio', 'series', '', $title, $id, []);
80 | }
81 | $mform->addGroup($radioarray, 'series',
82 | get_string('importvideos_wizard_availableseries', 'block_opencast',
83 | get_course($this->_customdata['sourcecourseid'])->fullname), [' '], false);
84 |
85 | // Add action buttons.
86 | $this->add_action_buttons(true, get_string('importvideos_wizardstepbuttontitlecontinue', 'block_opencast'));
87 | }
88 | }
89 |
--------------------------------------------------------------------------------
/classes/local/importvideos_step1_form.php:
--------------------------------------------------------------------------------
1 | .
16 |
17 | /**
18 | * Manual import videos form (Step 1: Select source course).
19 | *
20 | * @package block_opencast
21 | * @copyright 2020 Alexander Bias, Ulm University
22 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
23 | */
24 |
25 | namespace block_opencast\local;
26 |
27 | use moodleform;
28 |
29 | defined('MOODLE_INTERNAL') || die();
30 |
31 | require_once($CFG->dirroot . '/lib/formslib.php');
32 |
33 | /**
34 | * Manual import videos form (Step 1: Select source course - only used in dead end situations).
35 | *
36 | * @package block_opencast
37 | * @copyright 2020 Alexander Bias, Ulm University
38 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
39 | */
40 | class importvideos_step1_form extends moodleform {
41 |
42 |
43 | /**
44 | * Form definition.
45 | */
46 | public function definition() {
47 | global $PAGE;
48 |
49 | // Define mform.
50 | $mform = $this->_form;
51 |
52 | // Get renderer.
53 | $renderer = $PAGE->get_renderer('block_opencast', 'importvideos');
54 |
55 | // Add hidden fields for transferring the wizard results and for wizard step processing.
56 | $mform->addElement('hidden', 'courseid', $this->_customdata['courseid']);
57 | $mform->setType('courseid', PARAM_INT);
58 | $mform->addElement('hidden', 'step', 1);
59 | $mform->setType('step', PARAM_INT);
60 |
61 | // We are in a dead end situation, no chance to add anything.
62 | $notification = $renderer->wizard_error_notification(
63 | get_string('importvideos_wizardstep1sourcecoursenone', 'block_opencast'));
64 | $mform->addElement('html', $notification);
65 | $mform->addElement('cancel');
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/classes/opencast_state_exception.php:
--------------------------------------------------------------------------------
1 | .
16 |
17 | /**
18 | * Exception thrown when opencast has not yet processed the current step. Then the job is postponed until the next cron run.
19 | * @package block_opencast
20 | * @copyright 2017 Tobias Reischmann WWU
21 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
22 | */
23 |
24 | namespace block_opencast;
25 |
26 | use moodle_exception;
27 |
28 | /**
29 | * Exception thrown when opencast has not yet processed the current step. Then the job is postponed until the next cron run.
30 | *
31 | * @package block_opencast
32 | * @copyright 2017 Tobias Reischmann WWU
33 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
34 | */
35 | class opencast_state_exception extends moodle_exception {
36 |
37 |
38 | }
39 |
--------------------------------------------------------------------------------
/classes/task/cleanup_lti_module_cron.php:
--------------------------------------------------------------------------------
1 | .
16 |
17 | /**
18 | * Scheduled task to clean up Opencast Video LTI episode modules
19 | *
20 | * @package block_opencast
21 | * @copyright 2023 Farbod Zamani Boroujeni, ELAN e.V.
22 | * @author Farbod Zamani Boroujeni
23 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
24 | */
25 |
26 | namespace block_opencast\task;
27 |
28 | use block_opencast\local\apibridge;
29 | use block_opencast\local\ltimodulemanager;
30 | use core\task\scheduled_task;
31 | use moodle_exception;
32 | use tool_opencast\local\settings_api;
33 |
34 | /**
35 | * Scheduled task to clean up Opencast Video LTI episode modules
36 | *
37 | * @package block_opencast
38 | * @copyright 2023 Farbod Zamani Boroujeni, ELAN e.V.
39 | * @author Farbod Zamani Boroujeni
40 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
41 | */
42 | class cleanup_lti_module_cron extends scheduled_task {
43 |
44 |
45 | /**
46 | * Get the task name.
47 | * @return string description.
48 | */
49 | public function get_name() {
50 | return get_string('processltimodulecleanup', 'block_opencast');
51 | }
52 |
53 | /**
54 | * Execute the task.
55 | */
56 | public function execute() {
57 | try {
58 | // 1. Update the existing records of LTI Modules.
59 | mtrace('Step 1: Updating existing LTI modules...');
60 | $updatedmodulesnum = ltimodulemanager::update_existing_lti_modules();
61 | mtrace("... ($updatedmodulesnum) modules updated.");
62 |
63 | // 2. Evaluate and cleanup the existing lti module entries.
64 | // This step is to cleaup existing LTI modules after update.
65 | mtrace('Step 2: Cleaning up existing LTI modules...');
66 | $deletemodulesnum = ltimodulemanager::cleanup_lti_module_entries();
67 | mtrace("... ($deletemodulesnum) modules deleted after update.");
68 |
69 | // 3. Sync manually added LTI modules and add their enterie.
70 | mtrace('Step 2: Looking for manually added LTI modules...');
71 | $unrecordedmodulesnum = ltimodulemanager::record_manually_added_lti_modules();
72 | mtrace("... ($unrecordedmodulesnum) modules found and captured.");
73 |
74 | // 3. Evaluate and cleanup the added lti module entries.
75 | // This step is to cleaup added LTI modules.
76 | mtrace('Step 4: Final cleanup for the added LTI modules...');
77 | $deletemodulesnum = ltimodulemanager::cleanup_lti_module_entries();
78 | mtrace("... ($deletemodulesnum) modules deleted during final cleanup.");
79 |
80 | } catch (moodle_exception $e) {
81 | mtrace('... cleanup process failed:');
82 | mtrace($e->getMessage());
83 | }
84 | }
85 | }
86 |
--------------------------------------------------------------------------------
/classes/task/process_attachment_cron.php:
--------------------------------------------------------------------------------
1 | .
16 |
17 | /**
18 | * Task for processing event's attachment upload jobs.
19 | * @package block_opencast
20 | * @copyright 2022 Farbod Zamani Boroujeni, ELAN e.V.
21 | * @author Farbod Zamani Boroujeni
22 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
23 | */
24 |
25 | namespace block_opencast\task;
26 |
27 | use block_opencast\local\attachment_helper;
28 | use coding_exception;
29 | use core\task\scheduled_task;
30 | use dml_exception;
31 | use lang_string;
32 |
33 | /**
34 | * Task for processing event's attachment upload jobs.
35 | * @package block_opencast
36 | */
37 | class process_attachment_cron extends scheduled_task {
38 |
39 |
40 | /**
41 | * Get the name of the task.
42 | * @return lang_string|string
43 | * @throws coding_exception
44 | */
45 | public function get_name() {
46 | return get_string('processattachment', 'block_opencast');
47 | }
48 |
49 | /**
50 | * Executes the task.
51 | * @throws dml_exception
52 | */
53 | public function execute() {
54 | $attachmenthelper = new attachment_helper();
55 | $attachmenthelper->cron();
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/classes/task/process_delete_cron.php:
--------------------------------------------------------------------------------
1 | .
16 |
17 | /**
18 | * Processes the videos marked as deleted.
19 | * @package block_opencast
20 | * @copyright 2018 Tobias Reischmann, WWU
21 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
22 | */
23 |
24 | namespace block_opencast\task;
25 |
26 | use block_opencast\local\apibridge;
27 | use coding_exception;
28 | use core\task\scheduled_task;
29 | use dml_exception;
30 | use lang_string;
31 | use moodle_exception;
32 |
33 | /**
34 | * Processes the videos marked as deleted.
35 | * @package block_opencast
36 | * @copyright 2018 Tobias Reischmann, WWU
37 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
38 | */
39 | class process_delete_cron extends scheduled_task {
40 |
41 |
42 | /**
43 | * Get the name of the task.
44 | * @return lang_string|string
45 | * @throws coding_exception
46 | */
47 | public function get_name() {
48 | return get_string('processdelete', 'block_opencast');
49 | }
50 |
51 | /**
52 | * Executes the task.
53 | * @throws dml_exception
54 | */
55 | public function execute() {
56 | global $DB;
57 |
58 | // Get all delete jobs.
59 | $sql = "SELECT * FROM {block_opencast_deletejob}";
60 |
61 | $jobs = $DB->get_records_sql($sql);
62 |
63 | if (!$jobs) {
64 | mtrace('...no jobs to proceed');
65 | }
66 |
67 | foreach ($jobs as $job) {
68 | mtrace('proceed: ' . $job->id);
69 | try {
70 | $apibridge = apibridge::get_instance($job->ocinstanceid);
71 | $event = $apibridge->get_opencast_video($job->opencasteventid);
72 | // If job failed previously and event does no longer exist, remove the delete job.
73 | if ($event->error == 404 & $job->failed) {
74 | $DB->delete_records("block_opencast_deletejob", ['id' => $job->id]);
75 | mtrace('failed job ' . $job->id . ' removed');
76 | }
77 | // If deletion workflow finished, remove the video.
78 | if ($event->error == 0 &&
79 | ($event->video->processing_state === "SUCCEEDED" ||
80 | $event->video->processing_state === "PLANNED")) {
81 | $apibridge->delete_event($job->opencasteventid);
82 | $DB->delete_records("block_opencast_deletejob", ['id' => $job->id]);
83 | mtrace('event ' . $job->opencasteventid . ' removed');
84 | }
85 | // Mark delete job as failed.
86 | if ($event->error !== 0) {
87 | $job->failed = true;
88 | $job->timemodified = time();
89 | $DB->update_record("block_opencast_deletejob", $job);
90 | mtrace('deletion of event ' . $job->opencasteventid . ' failed');
91 | }
92 | } catch (moodle_exception $e) {
93 | mtrace('Job failed due to: ' . $e);
94 | $this->upload_failed($job, $e->getMessage());
95 | }
96 | }
97 | }
98 | }
99 |
--------------------------------------------------------------------------------
/classes/task/process_notification_cron.php:
--------------------------------------------------------------------------------
1 | .
16 |
17 | /**
18 | * Task for processing the event status notification jobs.
19 | * @package block_opencast
20 | * @copyright 2021 Farbod Zamani Boroujeni, ELAN e.V.
21 | * @author Farbod Zamani Boroujeni
22 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
23 | */
24 |
25 | namespace block_opencast\task;
26 |
27 | use block_opencast\local\eventstatus_notification_helper;
28 | use coding_exception;
29 | use core\task\scheduled_task;
30 | use dml_exception;
31 | use lang_string;
32 |
33 | /**
34 | * Task for processing the event status notification jobs.
35 | * @package block_opencast
36 | */
37 | class process_notification_cron extends scheduled_task {
38 |
39 |
40 | /**
41 | * Get the name of the task.
42 | * @return lang_string|string
43 | * @throws coding_exception
44 | */
45 | public function get_name() {
46 | return get_string('processnotification', 'block_opencast');
47 | }
48 |
49 | /**
50 | * Executes the task.
51 | * @throws dml_exception
52 | */
53 | public function execute() {
54 | $notificationhelper = new eventstatus_notification_helper();
55 | $notificationhelper->cron();
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/classes/task/process_upload_cron.php:
--------------------------------------------------------------------------------
1 | .
16 |
17 | /**
18 | * Task for processing the upload jobs.
19 | * @package block_opencast
20 | * @copyright 2017 Andreas Wagner, Synergy Learning
21 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
22 | */
23 |
24 | namespace block_opencast\task;
25 |
26 | use block_opencast\local\upload_helper;
27 | use coding_exception;
28 | use core\task\scheduled_task;
29 | use dml_exception;
30 | use lang_string;
31 |
32 | /**
33 | * Task for processing the upload jobs.
34 | * @package block_opencast
35 | */
36 | class process_upload_cron extends scheduled_task {
37 |
38 |
39 | /**
40 | * Get the name of the task.
41 | * @return lang_string|string
42 | * @throws coding_exception
43 | */
44 | public function get_name() {
45 | return get_string('processupload', 'block_opencast');
46 | }
47 |
48 | /**
49 | * Executes the task.
50 | * @throws dml_exception
51 | */
52 | public function execute() {
53 | $ulpoadhelper = new upload_helper();
54 | $ulpoadhelper->cron();
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/classes/task/process_visibility_cron.php:
--------------------------------------------------------------------------------
1 | .
16 |
17 | /**
18 | * Task for processing the scheduled visibility change jobs.
19 | * @package block_opencast
20 | * @copyright 2022 Farbod Zamani Boroujeni, ELAN e.V.
21 | * @author Farbod Zamani Boroujeni
22 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
23 | */
24 |
25 | namespace block_opencast\task;
26 |
27 | use block_opencast\local\visibility_helper;
28 | use coding_exception;
29 | use core\task\scheduled_task;
30 | use dml_exception;
31 | use lang_string;
32 |
33 | /**
34 | * Task for processing the scheduled visibility change jobs.
35 | * @package block_opencast
36 | */
37 | class process_visibility_cron extends scheduled_task {
38 |
39 |
40 | /**
41 | * Get the name of the task.
42 | * @return lang_string|string
43 | * @throws coding_exception
44 | */
45 | public function get_name() {
46 | return get_string('processvisibility', 'block_opencast');
47 | }
48 |
49 | /**
50 | * Executes the task.
51 | * @throws dml_exception
52 | */
53 | public function execute() {
54 | $visibilityhelper = new visibility_helper();
55 | $visibilityhelper->cron();
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/db/caches.php:
--------------------------------------------------------------------------------
1 | .
16 |
17 | /**
18 | * Defines the caches used by the block.
19 | * @package block_opencast
20 | * @copyright 2020 Justus Dieckmann, WWU
21 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
22 | */
23 |
24 | defined('MOODLE_INTERNAL') || die();
25 |
26 | $definitions = [
27 | 'videodata' => [
28 | 'mode' => cache_store::MODE_APPLICATION,
29 | 'invalidationevents' => ['viewopencastvideolist'],
30 | ],
31 | ];
32 |
--------------------------------------------------------------------------------
/db/messages.php:
--------------------------------------------------------------------------------
1 | .
16 |
17 | /**
18 | * Message providers for block opencast.
19 | *
20 | * @package block_opencast
21 | * @copyright 2018 Andreas Wagner, Synergy Learning
22 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
23 | */
24 | defined('MOODLE_INTERNAL') || die();
25 | global $CFG;
26 | if ($CFG->version <= 2021051718) {
27 | define('MESSAGE_DEFAULT_ENABLED', 0x01); // 0001.
28 | }
29 | $messageproviders = [
30 | 'error' => [
31 | 'defaults' => [
32 | 'popup' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED,
33 | 'email' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED,
34 | ],
35 | ],
36 | 'reportproblem_confirmation' => [
37 | 'defaults' => [
38 | 'email' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED + MESSAGE_DEFAULT_ENABLED,
39 | ],
40 | ],
41 | 'opencasteventstatus_notification' => [
42 | 'defaults' => [
43 | 'popup' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED,
44 | 'email' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED,
45 | ],
46 | ],
47 | ];
48 |
--------------------------------------------------------------------------------
/db/services.php:
--------------------------------------------------------------------------------
1 | .
16 |
17 | /**
18 | * External functions definitions.
19 | *
20 | * @package block_opencast
21 | * @copyright 2021 Tamara Gunkel
22 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
23 | */
24 |
25 | defined('MOODLE_INTERNAL') || die();
26 |
27 | $functions = [
28 | 'block_opencast_submit_series_form' => [
29 | 'classname' => 'block_opencast_external',
30 | 'methodname' => 'submit_series_form',
31 | 'classpath' => 'block/opencast/classes/external.php',
32 | 'description' => 'Creates/Modifies a series',
33 | 'type' => 'write',
34 | 'ajax' => true,
35 | 'capabilities' => 'block/opencast:createseriesforcourse',
36 | ],
37 | 'block_opencast_get_series_titles' => [
38 | 'classname' => 'block_opencast_external',
39 | 'methodname' => 'get_series_titles',
40 | 'classpath' => 'block/opencast/classes/external.php',
41 | 'description' => 'Retrieves series titles',
42 | 'type' => 'read',
43 | 'ajax' => true,
44 | 'capabilities' => 'block/opencast:manageseriesforcourse',
45 | ],
46 | 'block_opencast_import_series' => [
47 | 'classname' => 'block_opencast_external',
48 | 'methodname' => 'import_series',
49 | 'classpath' => 'block/opencast/classes/external.php',
50 | 'description' => 'Imports a series into a course',
51 | 'type' => 'read',
52 | 'ajax' => true,
53 | 'capabilities' => 'block/opencast:importseriesintocourse',
54 | ],
55 | 'block_opencast_unlink_series' => [
56 | 'classname' => 'block_opencast_external',
57 | 'methodname' => 'unlink_series',
58 | 'classpath' => 'block/opencast/classes/external.php',
59 | 'description' => 'Removes a series from a course',
60 | 'type' => 'read',
61 | 'ajax' => true,
62 | 'capabilities' => 'block/opencast:manageseriesforcourse',
63 | ],
64 | 'block_opencast_set_default_series' => [
65 | 'classname' => 'block_opencast_external',
66 | 'methodname' => 'set_default_series',
67 | 'classpath' => 'block/opencast/classes/external.php',
68 | 'description' => 'Sets a new default series for a course',
69 | 'type' => 'read',
70 | 'ajax' => true,
71 | 'capabilities' => 'block/opencast:manageseriesforcourse',
72 | ],
73 | 'block_opencast_get_liveupdate_info' => [
74 | 'classname' => 'block_opencast_external',
75 | 'methodname' => 'get_liveupdate_info',
76 | 'classpath' => 'block/opencast/classes/external.php',
77 | 'description' => 'Gets the latest live update information.',
78 | 'type' => 'read',
79 | 'ajax' => true,
80 | 'capabilities' => 'block/opencast:viewunpublishedvideos',
81 | ],
82 | 'block_opencast_unarchive_uploadjob' => [
83 | 'classname' => 'block_opencast_external',
84 | 'methodname' => 'unarchive_uploadjob',
85 | 'classpath' => 'block/opencast/classes/external.php',
86 | 'description' => 'Perform unarchiving an upload job',
87 | 'type' => 'write',
88 | 'ajax' => true,
89 | 'capabilities' => 'block/opencast:addvideo',
90 | ],
91 | ];
92 |
--------------------------------------------------------------------------------
/db/tasks.php:
--------------------------------------------------------------------------------
1 | .
16 |
17 | /**
18 | * Scheduled tasks of block opencast.
19 | *
20 | * @package block_opencast
21 | * @copyright 2017 Andreas Wagner, SYNERGY LEARNING
22 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
23 | */
24 | defined('MOODLE_INTERNAL') || die();
25 |
26 | $tasks = [
27 | [
28 | 'classname' => 'block_opencast\task\process_upload_cron',
29 | 'blocking' => 0,
30 | 'minute' => '*',
31 | 'hour' => '*',
32 | 'day' => '*',
33 | 'dayofweek' => '*',
34 | 'month' => '*',
35 | ],
36 | [
37 | 'classname' => 'block_opencast\task\process_delete_cron',
38 | 'blocking' => 0,
39 | 'minute' => '*',
40 | 'hour' => '*',
41 | 'day' => '*',
42 | 'dayofweek' => '*',
43 | 'month' => '*',
44 | ],
45 | [
46 | 'classname' => 'block_opencast\task\cleanup_imported_episodes_cron',
47 | 'blocking' => 0,
48 | 'minute' => '*',
49 | 'hour' => '*',
50 | 'day' => '*',
51 | 'dayofweek' => '*',
52 | 'month' => '*',
53 | ],
54 | [
55 | 'classname' => 'block_opencast\task\process_notification_cron',
56 | 'blocking' => 0,
57 | 'minute' => '*',
58 | 'hour' => '*',
59 | 'day' => '*',
60 | 'dayofweek' => '*',
61 | 'month' => '*',
62 | ],
63 | [
64 | 'classname' => 'block_opencast\task\process_delete_notification_cron',
65 | 'blocking' => 0,
66 | 'minute' => '59',
67 | 'hour' => '23',
68 | 'day' => '*',
69 | 'dayofweek' => '*',
70 | 'month' => '*',
71 | ],
72 | [
73 | 'classname' => 'block_opencast\task\process_visibility_cron',
74 | 'blocking' => 0,
75 | 'minute' => '*',
76 | 'hour' => '*',
77 | 'day' => '*',
78 | 'dayofweek' => '*',
79 | 'month' => '*',
80 | ],
81 | [
82 | 'classname' => 'block_opencast\task\process_attachment_cron',
83 | 'blocking' => 0,
84 | 'minute' => '*',
85 | 'hour' => '*',
86 | 'day' => '*',
87 | 'dayofweek' => '*',
88 | 'month' => '*',
89 | ],
90 | [
91 | 'classname' => 'block_opencast\task\cleanup_lti_module_cron',
92 | 'blocking' => 0,
93 | 'minute' => '59',
94 | 'hour' => '23',
95 | 'day' => '*',
96 | 'dayofweek' => '*',
97 | 'month' => '*',
98 | ],
99 | ];
100 |
--------------------------------------------------------------------------------
/deleteaclgroup.php:
--------------------------------------------------------------------------------
1 | .
16 |
17 | /**
18 | * Page overview.
19 | *
20 | * @package block_opencast
21 | * @copyright 2017 Andreas Wagner, SYNERGY LEARNING
22 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
23 | */
24 |
25 | use block_opencast\local\apibridge;
26 | use block_opencast\local\upload_helper;
27 | use tool_opencast\local\settings_api;
28 | require_once('../../config.php');
29 |
30 | global $PAGE, $OUTPUT, $CFG;
31 |
32 | $identifier = required_param('identifier', PARAM_ALPHANUMEXT);
33 | $courseid = required_param('courseid', PARAM_INT);
34 | $action = optional_param('action', '', PARAM_ALPHA);
35 | $ocinstanceid = optional_param('ocinstanceid', settings_api::get_default_ocinstance()->id, PARAM_INT);
36 |
37 | $baseurl = new moodle_url('/blocks/opencast/deleteaclgroup.php',
38 | ['identifier' => $identifier, 'courseid' => $courseid, 'ocinstanceid' => $ocinstanceid]);
39 | $PAGE->set_url($baseurl);
40 |
41 | require_login($courseid, false);
42 |
43 | $PAGE->set_pagelayout('incourse');
44 | $PAGE->set_title(get_string('pluginname', 'block_opencast'));
45 | $PAGE->set_heading(get_string('pluginname', 'block_opencast'));
46 |
47 | $redirecturl = new moodle_url('/blocks/opencast/index.php', ['courseid' => $courseid, 'ocinstanceid' => $ocinstanceid]);
48 | $PAGE->navbar->add(get_string('pluginname', 'block_opencast'), $redirecturl);
49 | $PAGE->navbar->add(get_string('deleteaclgroup', 'block_opencast'), $baseurl);
50 |
51 | // Capability check.
52 | $coursecontext = context_course::instance($courseid);
53 | require_capability('block/opencast:addvideo', $coursecontext);
54 |
55 | $opencast = apibridge::get_instance($ocinstanceid);
56 | $video = $opencast->get_opencast_video($identifier);
57 |
58 | if (($action == 'delete') && confirm_sesskey()) {
59 | // Do action.
60 | if ($video->video) {
61 | $opencast->delete_acl_group_assigned($video->video->identifier, $courseid);
62 | $message = get_string('aclgroupdeleted', 'block_opencast', $video->video);
63 | redirect($redirecturl, $message);
64 | }
65 |
66 | $message = get_string('videonotfound', 'block_opencast');
67 | redirect($redirecturl, $message);
68 | }
69 |
70 | $renderer = $PAGE->get_renderer('block_opencast');
71 |
72 | echo $OUTPUT->header();
73 | echo $OUTPUT->heading(get_string('deleteaclgroup', 'block_opencast'));
74 | echo $renderer->render_video_info($ocinstanceid, $courseid, $video->video);
75 | echo $OUTPUT->footer();
76 |
--------------------------------------------------------------------------------
/deleteevent.php:
--------------------------------------------------------------------------------
1 | .
16 |
17 | /**
18 | * Page overview.
19 | *
20 | * @package block_opencast
21 | * @copyright 2017 Andreas Wagner, SYNERGY LEARNING
22 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
23 | */
24 |
25 | use block_opencast\local\apibridge;
26 | use block_opencast\local\upload_helper;
27 | use tool_opencast\local\settings_api;
28 | require_once('../../config.php');
29 |
30 | global $PAGE, $OUTPUT, $CFG, $SITE;
31 |
32 | $identifier = required_param('identifier', PARAM_ALPHANUMEXT);
33 | $courseid = required_param('courseid', PARAM_INT);
34 | $action = optional_param('action', '', PARAM_ALPHA);
35 | $ocinstanceid = optional_param('ocinstanceid', settings_api::get_default_ocinstance()->id, PARAM_INT);
36 | $redirectpage = optional_param('redirectpage', null, PARAM_ALPHA);
37 | $series = optional_param('series', null, PARAM_ALPHANUMEXT);
38 |
39 | $baseurl = new moodle_url('/blocks/opencast/deleteevent.php',
40 | ['identifier' => $identifier, 'courseid' => $courseid, 'ocinstanceid' => $ocinstanceid,
41 | 'redirectpage' => $redirectpage, 'series' => $series, ]);
42 | $PAGE->set_url($baseurl);
43 |
44 | require_login($courseid, false);
45 |
46 | $PAGE->set_pagelayout('incourse');
47 | $PAGE->set_title(get_string('pluginname', 'block_opencast'));
48 | $PAGE->set_heading(get_string('pluginname', 'block_opencast'));
49 |
50 | if ($redirectpage == 'overviewvideos') {
51 | $redirecturl = new moodle_url('/blocks/opencast/overview_videos.php', ['ocinstanceid' => $ocinstanceid,
52 | 'series' => $series, ]);
53 | } else if ($redirectpage == 'overview') {
54 | $redirecturl = new moodle_url('/blocks/opencast/overview.php', ['ocinstanceid' => $ocinstanceid]);
55 | } else {
56 | $redirecturl = new moodle_url('/blocks/opencast/index.php', ['courseid' => $courseid, 'ocinstanceid' => $ocinstanceid]);
57 | }
58 |
59 | $PAGE->navbar->add(get_string('pluginname', 'block_opencast'), $redirecturl);
60 | $PAGE->navbar->add(get_string('deleteevent', 'block_opencast'), $baseurl);
61 |
62 | // Capability check.
63 | $coursecontext = context_course::instance($courseid);
64 | require_capability('block/opencast:deleteevent', $coursecontext);
65 |
66 | $opencast = apibridge::get_instance($ocinstanceid);
67 | $video = $opencast->get_opencast_video($identifier);
68 |
69 | if (($action == 'delete') && confirm_sesskey()) {
70 | // Do action.
71 | if ($video->video) {
72 | if ($opencast->trigger_delete_event($video->video->identifier)) {
73 | $message = get_string('eventdeletionstarted', 'block_opencast', $video->video);
74 | redirect($redirecturl, $message);
75 | } else {
76 | $message = get_string('eventdeletedfailed', 'block_opencast', $video->video);
77 | redirect($redirecturl, $message);
78 | }
79 | }
80 |
81 | $message = get_string('videonotfound', 'block_opencast');
82 | redirect($redirecturl, $message);
83 | }
84 |
85 | $renderer = $PAGE->get_renderer('block_opencast');
86 |
87 | echo $OUTPUT->header();
88 | echo $OUTPUT->heading(get_string('deleteevent', 'block_opencast'));
89 | echo $renderer->render_video_deletion_info($ocinstanceid, $courseid, $video->video, $redirectpage, $series);
90 | echo $OUTPUT->footer();
91 |
--------------------------------------------------------------------------------
/engageredirect.php:
--------------------------------------------------------------------------------
1 | .
16 |
17 | /**
18 | * Redirects users to the engage player and authenticates them using LTI.
19 | * @package block_opencast
20 | * @copyright 2022 Tamara Gunkel, WWU
21 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
22 | */
23 |
24 | use block_opencast\local\apibridge;
25 | use block_opencast\local\lti_helper;
26 | use tool_opencast\local\settings_api;
27 |
28 | require_once('../../config.php');
29 | require_once($CFG->dirroot . '/mod/lti/locallib.php');
30 | require_once($CFG->dirroot . '/lib/oauthlib.php');
31 |
32 | global $PAGE, $OUTPUT, $CFG, $USER;
33 |
34 | // Get all the params from the get call.
35 | $identifier = required_param('identifier', PARAM_ALPHANUMEXT);
36 | $courseid = required_param('courseid', PARAM_INT);
37 | $ocinstanceid = optional_param('ocinstanceid', settings_api::get_default_ocinstance()->id, PARAM_INT);
38 |
39 | // Preparing the urls for the page.
40 | $redirecturl = new moodle_url('/blocks/opencast/index.php', ['courseid' => $courseid, 'ocinstanceid' => $ocinstanceid]);
41 | $baseurl = new moodle_url('/blocks/opencast/engageredirect.php',
42 | ['identifier' => $identifier, 'courseid' => $courseid, 'ocinstanceid' => $ocinstanceid]);
43 | $PAGE->set_url($baseurl);
44 |
45 | // Check if the user is logged in.
46 | require_login($courseid, false);
47 |
48 | $context = context_course::instance($courseid);
49 | $PAGE->set_context($context);
50 | $PAGE->set_pagelayout('incourse');
51 | $PAGE->set_title(get_string('engageredirect', 'block_opencast'));
52 | $PAGE->set_heading(get_string('pluginname', 'block_opencast'));
53 |
54 | $endpoint = get_config('block_opencast', 'engageurl_' . $ocinstanceid);
55 |
56 | // Make sure the endpoint is correct.
57 | if (strpos($endpoint, 'http') !== 0) {
58 | $endpoint = 'http://' . $endpoint;
59 | }
60 |
61 | $url = $endpoint . '/play/' . $identifier;
62 |
63 | $opencast = apibridge::get_instance($ocinstanceid);
64 |
65 | $consumerkey = $opencast->get_lti_consumerkey();
66 | $consumersecret = $opencast->get_lti_consumersecret();
67 |
68 | if (empty($consumerkey)) {
69 | redirect($url);
70 | }
71 |
72 | $ltiendpoint = rtrim($endpoint, '/') . '/lti';
73 |
74 | // Create parameters.
75 | $params = lti_helper::create_lti_parameters($consumerkey, $consumersecret, $ltiendpoint, $url);
76 |
77 | $renderer = $PAGE->get_renderer('block_opencast');
78 |
79 | echo $OUTPUT->header();
80 | echo $OUTPUT->heading(get_string('engageredirect', 'block_opencast'));
81 | echo $renderer->render_lti_form($ltiendpoint, $params);
82 |
83 | $PAGE->requires->js_call_amd('block_opencast/block_lti_form_handler', 'init');
84 | echo $OUTPUT->footer();
85 |
--------------------------------------------------------------------------------
/lang/en/deprecated.txt:
--------------------------------------------------------------------------------
1 | video_already_uploaded,block_opencast
2 |
--------------------------------------------------------------------------------
/manageseries.php:
--------------------------------------------------------------------------------
1 | .
16 |
17 | /**
18 | * Manage the series of a course.
19 | * @package block_opencast
20 | * @copyright 2018 Tamara Gunkel
21 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
22 | */
23 |
24 | use block_opencast\local\apibridge;
25 | use core\persistent;
26 | use tool_opencast\local\settings_api;
27 | use tool_opencast\seriesmapping;
28 |
29 | require_once('../../config.php');
30 |
31 | global $PAGE, $OUTPUT, $CFG, $USER, $DB;
32 |
33 | require_once($CFG->dirroot . '/repository/lib.php');
34 |
35 | $courseid = required_param('courseid', PARAM_INT);
36 | $coursecontext = context_course::instance($courseid);
37 | $ocinstanceid = optional_param('ocinstanceid', settings_api::get_default_ocinstance()->id, PARAM_INT);
38 | // Passing optional param createseries to perform click on Create new series button.
39 | $createseries = optional_param('createseries', 0, PARAM_INT);
40 |
41 | $baseurl = new moodle_url('/blocks/opencast/manageseries.php', ['courseid' => $courseid, 'ocinstanceid' => $ocinstanceid]);
42 | $PAGE->set_url($baseurl);
43 |
44 | $series = $DB->get_records('tool_opencast_series', ['ocinstanceid' => $ocinstanceid, 'courseid' => $courseid]);
45 | // Transform isdefault to int.
46 | array_walk($series, function ($item) {
47 | $item->isdefault = intval($item->isdefault);
48 | });
49 | $series = array_values($series);
50 | $numseriesallowed = get_config('block_opencast', 'maxseries_' . $ocinstanceid);
51 |
52 | $PAGE->requires->js_call_amd('block_opencast/block_manage_series', 'init',
53 | [$coursecontext->id, $ocinstanceid, $createseries, $series, $numseriesallowed]);
54 | $PAGE->requires->css('/blocks/opencast/css/tabulator.min.css');
55 | $PAGE->requires->css('/blocks/opencast/css/tabulator_bootstrap4.min.css');
56 |
57 | $redirecturl = new moodle_url('/blocks/opencast/index.php', ['courseid' => $courseid, 'ocinstanceid' => $ocinstanceid]);
58 |
59 | require_login($courseid, false);
60 |
61 | $PAGE->set_pagelayout('incourse');
62 | $PAGE->set_title(get_string('pluginname', 'block_opencast'));
63 | if (settings_api::num_ocinstances() > 1) {
64 | $PAGE->set_heading(get_string('pluginname', 'block_opencast') . ': ' . settings_api::get_ocinstance($ocinstanceid)->name);
65 | } else {
66 | $PAGE->set_heading(get_string('pluginname', 'block_opencast'));
67 | }
68 | $PAGE->navbar->add(get_string('pluginname', 'block_opencast'), $redirecturl);
69 | $PAGE->navbar->add(get_string('manageseriesforcourse', 'block_opencast'), $baseurl);
70 |
71 | // Capability check.
72 | require_capability('block/opencast:manageseriesforcourse', $coursecontext);
73 |
74 | $apibridge = apibridge::get_instance($ocinstanceid);
75 |
76 |
77 | /** @var block_opencast_renderer $renderer */
78 | $renderer = $PAGE->get_renderer('block_opencast');
79 |
80 | echo $OUTPUT->header();
81 | echo $OUTPUT->heading(get_string('manageseriesforcourse', 'block_opencast'));
82 |
83 | echo $renderer->render_manage_series_table($ocinstanceid, $courseid);
84 | echo $OUTPUT->footer();
85 |
--------------------------------------------------------------------------------
/pix/Thumbs.db:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Opencast-Moodle/moodle-block_opencast/fe850533b78be8e96d0c591dc0990e5dc2f3e83b/pix/Thumbs.db
--------------------------------------------------------------------------------
/pix/caption.svg:
--------------------------------------------------------------------------------
1 |
3 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/pix/capturing.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Opencast-Moodle/moodle-block_opencast/fe850533b78be8e96d0c591dc0990e5dc2f3e83b/pix/capturing.gif
--------------------------------------------------------------------------------
/pix/failed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Opencast-Moodle/moodle-block_opencast/fe850533b78be8e96d0c591dc0990e5dc2f3e83b/pix/failed.png
--------------------------------------------------------------------------------
/pix/monologo.svg:
--------------------------------------------------------------------------------
1 |
2 |
13 |
15 |
23 |
27 |
32 |
36 |
37 |
45 |
49 |
54 |
58 |
59 |
60 |
79 |
83 |
87 |
88 |
--------------------------------------------------------------------------------
/pix/play.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Opencast-Moodle/moodle-block_opencast/fe850533b78be8e96d0c591dc0990e5dc2f3e83b/pix/play.png
--------------------------------------------------------------------------------
/pix/play.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
--------------------------------------------------------------------------------
/pix/processing.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Opencast-Moodle/moodle-block_opencast/fe850533b78be8e96d0c591dc0990e5dc2f3e83b/pix/processing.png
--------------------------------------------------------------------------------
/pix/share.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Opencast-Moodle/moodle-block_opencast/fe850533b78be8e96d0c591dc0990e5dc2f3e83b/pix/share.png
--------------------------------------------------------------------------------
/pix/share.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
6 |
--------------------------------------------------------------------------------
/pix/succeeded.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Opencast-Moodle/moodle-block_opencast/fe850533b78be8e96d0c591dc0990e5dc2f3e83b/pix/succeeded.png
--------------------------------------------------------------------------------
/recordvideo.php:
--------------------------------------------------------------------------------
1 | .
16 |
17 | /**
18 | * Redirects users to Opencast Studio for recording videos.
19 | * @package block_opencast
20 | * @copyright 2020 Farbod Zamani Boroujeni - ELAN e.V.
21 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
22 | */
23 |
24 | use block_opencast\local\apibridge;
25 | use block_opencast\local\lti_helper;
26 | use tool_opencast\local\settings_api;
27 |
28 | require_once('../../config.php');
29 | require_once($CFG->dirroot . '/mod/lti/locallib.php');
30 | require_once($CFG->dirroot . '/lib/oauthlib.php');
31 |
32 | global $PAGE, $OUTPUT, $CFG, $USER, $SITE;
33 |
34 | require_once($CFG->dirroot . '/repository/lib.php');
35 |
36 | $courseid = required_param('courseid', PARAM_INT);
37 | $ocinstanceid = optional_param('ocinstanceid', settings_api::get_default_ocinstance()->id, PARAM_INT);
38 |
39 | $baseurl = new moodle_url('/blocks/opencast/recordvideo.php', ['courseid' => $courseid, 'ocinstanceid' => $ocinstanceid]);
40 | $PAGE->set_url($baseurl);
41 |
42 | require_login($courseid, false);
43 |
44 | // Capability check.
45 | $context = context_course::instance($courseid);
46 | require_capability('block/opencast:addvideo', $context);
47 |
48 | $PAGE->set_context($context);
49 |
50 | $PAGE->set_pagelayout('incourse');
51 | $PAGE->set_title(get_string('recordvideo', 'block_opencast'));
52 | $PAGE->set_heading(get_string('pluginname', 'block_opencast'));
53 |
54 | $endpoint = settings_api::get_apiurl($ocinstanceid);
55 |
56 | if (!empty(get_config('block_opencast', 'opencast_studio_baseurl_' . $ocinstanceid))) {
57 | $endpoint = get_config('block_opencast', 'opencast_studio_baseurl_' . $ocinstanceid);
58 | }
59 |
60 | if (strpos($endpoint, 'http') !== 0) {
61 | $endpoint = 'http://' . $endpoint;
62 | }
63 |
64 | $ltiendpoint = rtrim($endpoint, '/') . '/lti';
65 |
66 | $apibridge = apibridge::get_instance($ocinstanceid);
67 |
68 | // Get series ID, create a new one if necessary.
69 | $seriesid = $apibridge->get_stored_seriesid($courseid, true, $USER->id);
70 |
71 | // Get Studio url path to insert as customtool.
72 | $customtool = $apibridge->generate_studio_url_path($courseid, $seriesid);
73 |
74 | // Create parameters.
75 | $consumerkey = $apibridge->get_lti_consumerkey();
76 | $consumersecret = $apibridge->get_lti_consumersecret();
77 | $params = lti_helper::create_lti_parameters($consumerkey, $consumersecret, $ltiendpoint, $customtool);
78 |
79 | $renderer = $PAGE->get_renderer('block_opencast');
80 |
81 | echo $OUTPUT->header();
82 | echo $OUTPUT->heading(get_string('recordvideo', 'block_opencast'));
83 | echo $renderer->render_lti_form($ltiendpoint, $params);
84 |
85 | $PAGE->requires->js_call_amd('block_opencast/block_lti_form_handler', 'init');
86 | echo $OUTPUT->footer();
87 |
--------------------------------------------------------------------------------
/serveworkflowconfigpanel.php:
--------------------------------------------------------------------------------
1 | .
16 |
17 | /**
18 | * Settings for the opencast block
19 | *
20 | * @package block_opencast
21 | * @copyright 2021 Tamara Gunkel, University of Münster
22 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
23 | */
24 |
25 | use block_opencast\local\apibridge;
26 | use tool_opencast\local\settings_api;
27 |
28 | require_once(__DIR__ . '/../../config.php');
29 | global $PAGE, $OUTPUT, $CFG, $DB;
30 | require_once($CFG->libdir . '/adminlib.php');
31 |
32 | $courseid = required_param('courseid', PARAM_INT);
33 | $workflowid = required_param('workflowid', PARAM_ALPHANUMEXT);
34 | $ocinstanceid = optional_param('ocinstanceid', settings_api::get_default_ocinstance()->id, PARAM_INT);
35 |
36 | require_login($courseid, false);
37 |
38 | $coursecontext = context_course::instance($courseid);
39 | require_capability('block/opencast:startworkflow', $coursecontext);
40 |
41 | $apibridge = apibridge::get_instance($ocinstanceid);
42 | $workflow = $apibridge->get_workflow_definition($workflowid);
43 | /** @var block_opencast_renderer $renderer */
44 | $renderer = $PAGE->get_renderer('block_opencast');
45 | if ($workflow) {
46 | // Display form.
47 | $context = new stdClass();
48 | $context->language = $CFG->lang;
49 | $context->has_config_panel = !empty($workflow->configuration_panel);
50 | $context->config_panel = $renderer->close_tags_in_html_string($workflow->configuration_panel);
51 | $context->parent_url = (new moodle_url('/blocks/opencast/workflowsettings.php'))->out();
52 | $context->parent_origin = $CFG->wwwroot;
53 |
54 | echo $OUTPUT->render_from_template('block_opencast/workflow_settings_opencast', $context);
55 | }
56 |
--------------------------------------------------------------------------------
/startworkflow.php:
--------------------------------------------------------------------------------
1 | .
16 |
17 | /**
18 | * Start a workflow for a video.
19 | *
20 | * @package block_opencast
21 | * @copyright 2021 Tamara Gunkel, University of Münster
22 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
23 | */
24 |
25 | use block_opencast\local\apibridge;
26 | use core\output\notification;
27 | use tool_opencast\local\settings_api;
28 | require_once('../../config.php');
29 |
30 | global $PAGE, $OUTPUT, $CFG, $USER, $COURSE, $DB;
31 |
32 | $courseid = required_param('courseid', PARAM_INT);
33 | $videoid = required_param('videoid', PARAM_ALPHANUMEXT);
34 | $workflow = required_param('workflow', PARAM_ALPHANUMEXT);
35 | $configparams = required_param('configparams', PARAM_RAW);
36 | $ocinstanceid = optional_param('ocinstanceid', settings_api::get_default_ocinstance()->id, PARAM_INT);
37 |
38 | $redirecturl = new moodle_url('/blocks/opencast/index.php', ['courseid' => $courseid, 'ocinstanceid' => $ocinstanceid]);
39 |
40 | require_login($courseid, false);
41 |
42 | // Capability check.
43 | $coursecontext = context_course::instance($courseid);
44 | require_capability('block/opencast:startworkflow', $coursecontext);
45 |
46 | $apibridge = apibridge::get_instance($ocinstanceid);
47 |
48 | // Check that video is in opencast series.
49 | $video = $apibridge->get_opencast_video($videoid);
50 | $seriesid = $apibridge->get_default_course_series($courseid);
51 | if ($seriesid->identifier != $video->video->is_part_of) {
52 | redirect($redirecturl,
53 | get_string('video_notallowed', 'block_opencast'),
54 | null,
55 | notification::NOTIFY_ERROR);
56 | }
57 |
58 | $apiworkflow = $apibridge->get_workflow_definition($workflow);
59 | // Apply multiple tags.
60 | $workflowtags = [];
61 | $workflowtagsconfig = get_config('block_opencast', 'workflow_tags_' . $ocinstanceid);
62 | if (!empty($workflowtagsconfig)) {
63 | $workflowtags = explode(',', $workflowtagsconfig);
64 | $workflowtags = array_map('trim', $workflowtags);
65 | }
66 | if (!$apiworkflow || empty(array_intersect($apiworkflow->tags, $workflowtags))) {
67 | redirect($redirecturl,
68 | get_string('workflow_opencast_invalid', 'block_opencast'),
69 | null,
70 | notification::NOTIFY_ERROR);
71 | }
72 |
73 | $result = $apibridge->start_workflow($videoid, $workflow, ['configuration' => $configparams]);
74 |
75 | if ($result) {
76 | // Redirect with success message.
77 | redirect($redirecturl,
78 | get_string('workflow_started_success', 'block_opencast'),
79 | null,
80 | notification::NOTIFY_SUCCESS);
81 | } else {
82 | redirect($redirecturl,
83 | get_string('workflow_started_failure', 'block_opencast'),
84 | null,
85 | notification::NOTIFY_ERROR);
86 | }
87 |
--------------------------------------------------------------------------------
/styles.css:
--------------------------------------------------------------------------------
1 | /* Styles for the buttons in the block view */
2 | .opencast-addvideo-wrap.overview {
3 | text-align: center;
4 | }
5 |
6 | .opencast-batchupload-wrap.overview {
7 | text-align: center;
8 | }
9 |
10 | .opencast-recordvideo-wrap.overview {
11 | text-align: center;
12 | }
13 |
14 | /* Styles for the buttons on the overview page */
15 | .opencast-recordvideo-wrap {
16 | margin: 10px 0;
17 | }
18 |
19 | .opencast-batchupload-wrap {
20 | margin: 10px 0;
21 | }
22 |
23 | /* Styles for the recordings list in the block view */
24 | .opencast-vlist {
25 | margin-left: 0;
26 | list-style: none;
27 | border-top: 1px solid #dedede;
28 | border-bottom: 1px solid #dedede;
29 | padding: 10px 0;
30 | }
31 |
32 | .opencast-vlist .smallicon {
33 | margin-right: 5px;
34 | }
35 |
36 | .opencast-more-wrap {
37 | text-align: right;
38 | }
39 |
40 | /* Styles for the overview page */
41 | #page-blocks-opencast-index h2 ~ .resettable {
42 | display: none;
43 | }
44 |
45 | #page-blocks-opencast-index #region-main h2 {
46 | margin-top: 50px;
47 | }
48 |
49 | #page-blocks-opencast-index #region-main h2:first-of-type {
50 | margin-top: inherit;
51 | }
52 |
53 | /* Styles for the admin settings page */
54 | #page-admin-blocks-opencast-adminsettings #roles_table .fitemtitle {
55 | width: 0;
56 | }
57 |
58 | #page-admin-blocks-opencast-adminsettings #roles_table .felement {
59 | margin-left: 0;
60 | }
61 |
62 | /* Styles for the add video page */
63 | #page-blocks-opencast-addvideo .form-filetypes-descriptions ul {
64 | margin-bottom: 0;
65 | }
66 |
67 | #page-blocks-opencast-addvideo .form-filetypes-descriptions li {
68 | font-size: 0;
69 | display: inline-block;
70 | }
71 |
72 | #page-blocks-opencast-addvideo .form-filetypes-descriptions li .text-dark {
73 | font-size: 12px;
74 | }
75 |
76 | #page-blocks-opencast-addvideo #fitem_id_video_presenter p,
77 | #page-blocks-opencast-addvideo #fitem_id_video_presenter_chunk p,
78 | #page-blocks-opencast-addvideo #fitem_id_video_presentation p,
79 | #page-blocks-opencast-addvideo #fitem_id_video_presentation_chunk p {
80 | margin-top: 0.5rem;
81 | margin-bottom: 0;
82 | }
83 |
84 | #page-blocks-opencast-addvideo .form-filetypes-descriptions ul {
85 | margin-bottom: 0;
86 | }
87 |
88 | /* Hide empty label columns in tables on admin settings page. */
89 | #page-admin-blocks-opencast-adminsettings .generaltable .col-md-3 {
90 | display: none;
91 | }
92 |
93 | .inline-action-menu .menubar,
94 | .download-action-menu .menubar {
95 | display: inline-flex !important; /* stylelint-disable-line */
96 | }
97 |
98 | .download-action-menu .dropdown-menu i {
99 | display: none;
100 | }
101 |
102 | /* Video Table Styles */
103 | table.opencast-videos-table.generaltable thead th {
104 | vertical-align: middle !important; /* stylelint-disable-line */
105 | }
106 |
107 | table.opencast-videos-table.generaltable thead th.oc-sortable-alignment {
108 | overflow: hidden;
109 | }
110 |
111 | table.opencast-videos-table.generaltable thead th.oc-sortable-alignment a {
112 | float: left;
113 | white-space: nowrap;
114 | margin-bottom: 1px;
115 | }
116 |
117 | table.opencast-videos-table.generaltable thead th.oc-sortable-alignment > i {
118 | float: left;
119 | margin: 4px 0 1px 3px;
120 | }
121 |
122 | /* Styles for Series Table */
123 | #seriestable .tabulator-row .tabulator-cell {
124 | cursor: default !important; /* stylelint-disable-line */
125 | }
126 |
127 | #seriestable .tabulator-row .tabulator-cell input[type="radio"]:not(:checked) {
128 | cursor: pointer !important; /* stylelint-disable-line */
129 | }
130 |
--------------------------------------------------------------------------------
/templates/defaults_settings_actions.mustache:
--------------------------------------------------------------------------------
1 | {{!
2 | This file is part of Moodle - http://moodle.org/
3 |
4 | Moodle is free software: you can redistribute it and/or modify
5 | it under the terms of the GNU General Public License as published by
6 | the Free Software Foundation, either version 3 of the License, or
7 | (at your option) any later version.
8 |
9 | Moodle is distributed in the hope that it will be useful,
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | GNU General Public License for more details.
13 |
14 | You should have received a copy of the GNU General Public License
15 | along with Moodle. If not, see .
16 | }}
17 | {{!
18 | @template block_opencast/defaults_settings_actions
19 |
20 | This template renders a link that redirects to a page which manages the course's default values.
21 |
22 | Example context (json):
23 | {
24 | "hasanyactions": true,
25 | "managedefaultsurl": "https://moodle.local/blocks/opencast/managedefaults.php?courseid=3&ocinstanceid=1"
26 | }
27 | }}
28 | {{#hasanyactions}}
29 |
30 | {{#managedefaultsurl}}
31 |
38 | {{/managedefaultsurl}}
39 |
40 | {{/hasanyactions}}
41 |
--------------------------------------------------------------------------------
/templates/delete_block_modal.mustache:
--------------------------------------------------------------------------------
1 | {{!
2 | This file is part of Moodle - http://moodle.org/
3 |
4 | Moodle is free software: you can redistribute it and/or modify
5 | it under the terms of the GNU General Public License as published by
6 | the Free Software Foundation, either version 3 of the License, or
7 | (at your option) any later version.
8 |
9 | Moodle is distributed in the hope that it will be useful,
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | GNU General Public License for more details.
13 |
14 | You should have received a copy of the GNU General Public License
15 | along with Moodle. If not, see .
16 | }}
17 | {{!
18 | @template block_opencast/delete_block_modal
19 |
20 | This template renders the delete modal
21 |
22 | Example context (json):
23 | {
24 | "deleteblockurl": "https://moodle.local/blocks/opencast/managedefaults.php?courseid=3&ocinstanceid=1"
25 | }
26 | }}
27 | {{#str}} delete_mapping_explanation, block_opencast {{/str}}
28 |
29 |
30 | {{#str}} delete_block_and_mapping, block_opencast {{/str}}
31 |
32 |
33 | {{#str}} only_delete_block, block_opencast {{/str}}
34 |
35 |
36 |
--------------------------------------------------------------------------------
/templates/series_settings_actions.mustache:
--------------------------------------------------------------------------------
1 | {{!
2 | This file is part of Moodle - http://moodle.org/
3 |
4 | Moodle is free software: you can redistribute it and/or modify
5 | it under the terms of the GNU General Public License as published by
6 | the Free Software Foundation, either version 3 of the License, or
7 | (at your option) any later version.
8 |
9 | Moodle is distributed in the hope that it will be useful,
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | GNU General Public License for more details.
13 |
14 | You should have received a copy of the GNU General Public License
15 | along with Moodle. If not, see .
16 | }}
17 | {{!
18 | @template block_opencast/series_settings_actions
19 |
20 | This template renders the list of series-related settings.
21 |
22 | Example context (json):
23 | {
24 | "hasanyactions": true,
25 | "manageseriesurl": "https://moodle.local/blocks/opencast/manageseries.php?courseid=3&ocinstanceid=1"
26 | }
27 | }}
28 | {{#hasanyactions}}
29 |
30 | {{#manageseriesurl}}
31 |
38 | {{/manageseriesurl}}
39 |
40 | {{/hasanyactions}}
41 |
--------------------------------------------------------------------------------
/templates/series_table.mustache:
--------------------------------------------------------------------------------
1 | {{!
2 | This file is part of Moodle - http://moodle.org/
3 |
4 | Moodle is free software: you can redistribute it and/or modify
5 | it under the terms of the GNU General Public License as published by
6 | the Free Software Foundation, either version 3 of the License, or
7 | (at your option) any later version.
8 |
9 | Moodle is distributed in the hope that it will be useful,
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | GNU General Public License for more details.
13 |
14 | You should have received a copy of the GNU General Public License
15 | along with Moodle. If not, see .
16 | }}
17 | {{!
18 | @template block_opencast/series_table
19 |
20 | This template renders the series table.
21 |
22 | Example context (json):
23 | {
24 | "cancreateseries": true,
25 | "canimportseries": false,
26 | "maxseriesreached": false
27 | }
28 | }}
29 |
30 |
31 | {{#cancreateseries}}
32 |
33 | {{# str}}createseriesforcourse, block_opencast {{/ str}}
34 |
35 | {{/cancreateseries}}
36 | {{#canimportseries}}
37 |
38 | {{# str}}importseries, block_opencast {{/ str}}
39 |
40 | {{/canimportseries}}
41 |
--------------------------------------------------------------------------------
/templates/table_legend_help_icon.mustache:
--------------------------------------------------------------------------------
1 | {{!
2 | This file is part of Moodle - http://moodle.org/
3 |
4 | Moodle is free software: you can redistribute it and/or modify
5 | it under the terms of the GNU General Public License as published by
6 | the Free Software Foundation, either version 3 of the License, or
7 | (at your option) any later version.
8 |
9 | Moodle is distributed in the hope that it will be useful,
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | GNU General Public License for more details.
13 |
14 | You should have received a copy of the GNU General Public License
15 | along with Moodle. If not, see .
16 | }}
17 | {{!
18 | @template block_opencast/table_legend_help_icon
19 |
20 | This template renders the table legend help icon to show in overview page as a help icon for each header.
21 |
22 | Example context (json):
23 | {
24 | "statushelpicon": true,
25 | "visibilityhelpicon": false
26 | }
27 | }}
28 |
29 | {{#pix}}help, core, {{#str}}legendalt, block_opencast{{/str}}{{/pix}}
30 |
31 | {{#js}}
32 | require([
33 | 'jquery',
34 | 'core/str',
35 | 'core/modal_factory',
36 | 'core/templates',
37 | 'core/notification'], function($, Str, ModalFactory, Templates, Notification) {
38 |
39 | $("#{{uniqid}}-legend-icon").click(function(e) {
40 | e.preventDefault();
41 |
42 | var titlePromise = Str.get_string('legendtitle', 'block_opencast');
43 | var modalPromise = ModalFactory.create({type: ModalFactory.types.CANCEL});
44 | var bodyPromise = Templates.render('block_opencast/table_legend_details', {
45 | {{#statushelpicon}}
46 | "showstatusdetails": "true"
47 | {{/statushelpicon}}
48 | {{#visibilityhelpicon}}
49 | "showvisibilitydetails": "true"
50 | {{/visibilityhelpicon}}
51 | });
52 | $.when(titlePromise, modalPromise).then(function(title, modal) {
53 | modal.setTitle(title);
54 | modal.setBody(bodyPromise);
55 |
56 | modal.show();
57 | return modal;
58 | }).catch(Notification.exception);
59 | });
60 | });
61 | {{/js}}
62 |
--------------------------------------------------------------------------------
/templates/transcriptions_table.mustache:
--------------------------------------------------------------------------------
1 | {{!
2 | This file is part of Moodle - http://moodle.org/
3 |
4 | Moodle is free software: you can redistribute it and/or modify
5 | it under the terms of the GNU General Public License as published by
6 | the Free Software Foundation, either version 3 of the License, or
7 | (at your option) any later version.
8 |
9 | Moodle is distributed in the hope that it will be useful,
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | GNU General Public License for more details.
13 |
14 | You should have received a copy of the GNU General Public License
15 | along with Moodle. If not, see .
16 | }}
17 | {{!
18 | @template block_opencast/transcriptions_table
19 |
20 | This template renders the transcriptions table.
21 |
22 | Example context (json):
23 | {
24 | "list": null,
25 | "listhascontent": false
26 | }
27 | }}
28 |
29 | {{#listhascontent}}
30 |
31 |
32 |
33 |
34 | {{# str}}transcriptionflavor_thead, block_opencast {{/ str}}
35 |
36 | {{#hasactions}}
37 |
38 | {{# str}}transcriptionaction_thead, block_opencast {{/ str}}
39 |
40 | {{/hasactions}}
41 |
42 |
43 |
44 | {{#list}}
45 |
46 |
47 | {{title}}
48 |
49 | {{#hasactions}}
50 |
51 | {{#allowdownload}}
52 |
55 | {{#pix}} i/down, core{{/pix}}
56 |
57 | {{/allowdownload}}
58 | {{#candelete}}
59 |
61 | {{#pix}} i/delete, core{{/pix}}
62 |
63 | {{/candelete}}
64 |
65 | {{/hasactions}}
66 |
67 | {{/list}}
68 |
69 |
70 | {{/listhascontent}}
71 | {{^listhascontent}}
72 | {{# str}}notranscription, block_opencast {{/ str}}
73 | {{/listhascontent}}
74 |
75 | {{#addnewurl}}
76 |
77 | {{# str}}addnewtranscription, block_opencast {{/ str}}
78 |
79 | {{/addnewurl}}
80 |
--------------------------------------------------------------------------------
/templates/workflow_settings_opencast.mustache:
--------------------------------------------------------------------------------
1 | {{!
2 | This file is part of Moodle - http://moodle.org/
3 |
4 | Moodle is free software: you can redistribute it and/or modify
5 | it under the terms of the GNU General Public License as published by
6 | the Free Software Foundation, either version 3 of the License, or
7 | (at your option) any later version.
8 |
9 | Moodle is distributed in the hope that it will be useful,
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | GNU General Public License for more details.
13 |
14 | You should have received a copy of the GNU General Public License
15 | along with Moodle. If not, see .
16 | }}
17 | {{!
18 | @template block_opencast/workflow_settings_opencast
19 |
20 | This template renders a the configuration panels of Opencast workflows.
21 |
22 | Example context (json):
23 | {
24 | "has_config_panel": true,
25 | "config_panel": "...
",
26 | "parent_url": "http://mymoodle.de/blocks/opencast/workflowsettings.php",
27 | "parent_origin": "http://mymoodle.de",
28 | "language": "en"
29 | }
30 | }}
31 | {{#has_config_panel}}
32 |
33 |
34 |
35 |
36 | {{#str}}workflow_settings_opencast, block_opencast{{/str}}
37 |
38 |
39 |
40 |
42 |
43 | {{{config_panel}}}
44 |
45 |
70 |
71 |
72 | {{/has_config_panel}}
73 |
--------------------------------------------------------------------------------
/tests/behat/block_opencast.feature:
--------------------------------------------------------------------------------
1 | @block @block_opencast
2 | Feature: Add Opencast block as Teacher
3 | Overview and Add video / Edit upload tasks Page exists
4 |
5 | Background:
6 | Given the following "users" exist:
7 | | username | firstname | lastname | email | idnumber |
8 | | teacher1 | Teacher | 1 | teacher1@example.com | T1 |
9 | And the following "courses" exist:
10 | | fullname | shortname | category |
11 | | Course 1 | C1 | 0 |
12 | And the following "course enrolments" exist:
13 | | user | course | role |
14 | | teacher1 | C1 | editingteacher |
15 | And I setup the default settigns for opencast plugins
16 | And the following config values are set as admin:
17 | | config | value | plugin |
18 | | apiurl_1 | http://172.17.0.1:8080 | tool_opencast |
19 | | apipassword_1 | opencast | tool_opencast |
20 | | apiusername_1 | admin | tool_opencast |
21 | | ocinstances | [{"id":1,"name":"Default","isvisible":true,"isdefault":true}] | tool_opencast |
22 | | limituploadjobs_1 | 0 | block_opencast |
23 | | group_creation_1 | 0 | block_opencast |
24 | | group_name_1 | Moodle_course_[COURSEID] | block_opencast |
25 | | series_name_1 | Course_Series_[COURSEID] | block_opencast |
26 | | enablechunkupload_1 | 0 | block_opencast |
27 | And I log in as "admin"
28 | And I am on "Course 1" course homepage with editing mode on
29 | And I add the "Opencast Videos" block
30 |
31 | Scenario: The Opencast Videos block is Added
32 | Then I should see "No videos available"
33 |
34 | Scenario: Opencast Overview page implemented
35 | When I click on "Go to overview..." "link"
36 | Then I should not see "Videos scheduled to be transferred to Opencast"
37 | And I should see "Videos available in this course"
38 | And I should see "Currently, no videos have been uploaded to this course yet."
39 |
--------------------------------------------------------------------------------
/tests/behat/block_opencast_addactivityepisode.feature:
--------------------------------------------------------------------------------
1 | @block @block_opencast
2 | Feature: Add Opencast Video Provider episode module as Teacher
3 | In order to provide the uploaded videos to my students
4 | As teacher
5 | I need to be able to add an Opencast episode module to my course
6 |
7 | Background:
8 | Given the following "users" exist:
9 | | username | firstname | lastname | email | idnumber |
10 | | teacher1 | Teacher | 1 | teacher1@example.com | T1 |
11 | And the following "courses" exist:
12 | | fullname | shortname | format | category | id |
13 | | Course 1 | C1 | topics | 0 | 123 |
14 | And the following "course enrolments" exist:
15 | | user | course | role |
16 | | teacher1 | C1 | editingteacher |
17 | And I setup the default settigns for opencast plugins
18 | And the following config values are set as admin:
19 | | config | value | plugin |
20 | | apiurl_1 | http://testapi:8080 | tool_opencast |
21 | | apipassword_1 | opencast | tool_opencast |
22 | | apiusername_1 | admin | tool_opencast |
23 | | ocinstances | [{"id":1,"name":"Default","isvisible":true,"isdefault":true}] | tool_opencast |
24 | | limituploadjobs_1 | 0 | block_opencast |
25 | | limitvideos_1 | 5 | block_opencast |
26 | | group_creation_1 | 0 | block_opencast |
27 | | group_name_1 | Moodle_course_[COURSEID] | block_opencast |
28 | | series_name_1 | Course_Series_[COURSEID] | block_opencast |
29 | | addactivityepisodeenabled_1 | 1 | block_opencast |
30 | | addactivityepisodeintro_1 | 1 | block_opencast |
31 | | addactivityepisodesection_1 | 1 | block_opencast |
32 | | addactivityepisodeavailability_1 | 1 | block_opencast |
33 | And I setup the opencast test api
34 | And I upload a testvideo
35 | And I log in as "admin"
36 | And I am on "Course 1" course homepage with editing mode on
37 | And I add the "Opencast Videos" block
38 | And I log out
39 |
40 | Scenario: When the feature is enabled and working, editing teachers are able to add the LTI module to the course
41 | Given I log in as "teacher1"
42 | And I am on "Course 1" course homepage
43 | And I click on "Go to overview..." "link"
44 | And I click on "Add Opencast episode module to course" "link"
45 | And I click on "Add module and return to course" "button"
46 | And I should see "The 'Test video' episode module has been added to this course."
47 | And I should see "Test video" in the "li.activity" "css_element"
48 | When I click on "Go to overview..." "link"
49 | Then "View Opencast episode module in course" "link" should exist
50 | And "Add Opencast episode module to course" "link" should not exist
51 |
--------------------------------------------------------------------------------
/tests/behat/block_opencast_addvideo.feature:
--------------------------------------------------------------------------------
1 | @block @block_opencast
2 | Feature: Add videos as Teacher
3 | In order to upload videos to Opencast
4 | As teacher
5 | I need to be able to select video files and upload them to Opencast
6 |
7 | Background:
8 | Given the following "users" exist:
9 | | username | firstname | lastname | email | idnumber |
10 | | teacher1 | Teacher | 1 | teacher1@example.com | T1 |
11 | And the following "courses" exist:
12 | | fullname | shortname | category |
13 | | Course 1 | C1 | 0 |
14 | And the following "course enrolments" exist:
15 | | user | course | role |
16 | | teacher1 | C1 | editingteacher |
17 | And I setup the default settigns for opencast plugins
18 | And the following config values are set as admin:
19 | | config | value | plugin |
20 | | apiurl_1 | http://172.17.0.1:8080 | tool_opencast |
21 | | apipassword_1 | opencast | tool_opencast |
22 | | apiusername_1 | admin | tool_opencast |
23 | | apiversion_1 | v1.10.0 | tool_opencast |
24 | | ocinstances | [{"id":1,"name":"Default","isvisible":true,"isdefault":true}] | tool_opencast |
25 | | limituploadjobs_1 | 0 | block_opencast |
26 | | group_creation_1 | 0 | block_opencast |
27 | | group_name_1 | Moodle_course_[COURSEID] | block_opencast |
28 | | series_name_1 | Course_Series_[COURSEID] | block_opencast |
29 | | enablechunkupload_1 | 0 | block_opencast |
30 | | uploadworkflow_1 | schedule-and-upload | block_opencast |
31 | | enableuploadwfconfigpanel_1 | 1 | block_opencast |
32 | | alloweduploadwfconfigs_1 | straightToPublishing | block_opencast |
33 | And I log in as "admin"
34 | And I am on "Course 1" course homepage with editing mode on
35 | And I add the "Opencast Videos" block
36 |
37 | Scenario: Opencast Add video page implemented with configuration panel
38 | Given I click on "Go to overview..." "link"
39 | When I click on "Add video" "button"
40 | Then I should see "You can drag and drop files here to add them."
41 | And I should see "Processing Settings"
42 | And I should see "Straight to publishing"
43 |
44 | @_file_upload @javascript
45 | Scenario: Opencast Upload Video
46 | Given I click on "Go to overview..." "link"
47 | And I click on "Add video" "button"
48 | And I set the field "Title" to "Test"
49 | And I upload "blocks/opencast/tests/fixtures/test.mp4" file to "Presenter video" filemanager
50 | And I click on "Add video" "button"
51 | Then I should see "Test"
52 | And I should see "test.mp4"
53 | And I should see "Ready for transfer"
54 |
--------------------------------------------------------------------------------
/tests/behat/block_opencast_addvideosbatch.feature:
--------------------------------------------------------------------------------
1 | @block @block_opencast @block_opencast_addvideosbatch
2 | Feature: Add videos batch as Teacher
3 | In order to upload videos in batch to Opencast
4 | As teacher
5 | I need to be able to select video multiple files and upload them to Opencast all at once
6 |
7 | Background:
8 | Given the following "users" exist:
9 | | username | firstname | lastname | email | idnumber |
10 | | teacher1 | Teacher | 1 | teacher1@example.com | T1 |
11 | And the following "courses" exist:
12 | | fullname | shortname | category |
13 | | Course 1 | C1 | 0 |
14 | And the following "course enrolments" exist:
15 | | user | course | role |
16 | | teacher1 | C1 | editingteacher |
17 | And I setup the default settigns for opencast plugins
18 | And the following config values are set as admin:
19 | | config | value | plugin |
20 | | apiurl_1 | http://172.17.0.1:8080 | tool_opencast |
21 | | apipassword_1 | opencast | tool_opencast |
22 | | apiusername_1 | admin | tool_opencast |
23 | | apiversion_1 | v1.10.0 | tool_opencast |
24 | | ocinstances | [{"id":1,"name":"Default","isvisible":true,"isdefault":true}] | tool_opencast |
25 | | limituploadjobs_1 | 0 | block_opencast |
26 | | group_creation_1 | 0 | block_opencast |
27 | | group_name_1 | Moodle_course_[COURSEID] | block_opencast |
28 | | series_name_1 | Course_Series_[COURSEID] | block_opencast |
29 | | enablechunkupload_1 | 0 | block_opencast |
30 | | batchuploadenabled_1 | 1 | block_opencast |
31 | | uploadworkflow_1 | schedule-and-upload | block_opencast |
32 | | enableuploadwfconfigpanel_1 | 1 | block_opencast |
33 | | alloweduploadwfconfigs_1 | straightToPublishing | block_opencast |
34 | And I log in as "admin"
35 | And I am on "Course 1" course homepage with editing mode on
36 | And I add the "Opencast Videos" block
37 |
38 | Scenario: Opencast Add videos (batch) page implemented with configuration panel
39 | Given I click on "Go to overview..." "link"
40 | When I click on "Add videos (batch)" "button"
41 | Then I should see "You can drag and drop files here to add them."
42 | And I should see "Processing Settings"
43 | And I should see "Straight to publishing"
44 |
45 | @_file_upload @javascript
46 | Scenario: Opencast Batch Upload Video
47 | Given I click on "Go to overview..." "link"
48 | And I click on "Add videos (batch)" "button"
49 | And I upload "blocks/opencast/tests/fixtures/test.mp4" file to "Presenter videos" filemanager as:
50 | | Save as | Test1.mp4 |
51 | And I upload "blocks/opencast/tests/fixtures/test.mp4" file to "Presenter videos" filemanager as:
52 | | Save as | Test2.mp4 |
53 | And I click on "Add videos (batch)" "button"
54 | Then I should see "Test1"
55 | And I should see "Test2"
56 | And I should see "Ready for transfer"
57 |
--------------------------------------------------------------------------------
/tests/behat/block_opencast_changevisibility.feature:
--------------------------------------------------------------------------------
1 | @block @block_opencast
2 | Feature: Change visibility
3 | In order to hide/show videos to students
4 | As admins
5 | Teachers need to be able to control the visibility of videos
6 |
7 | Background:
8 | Given the following "users" exist:
9 | | username | firstname | lastname | email | idnumber |
10 | | teacher1 | Teacher | 1 | teacher1@example.com | T1 |
11 | And the following "courses" exist:
12 | | fullname | shortname | category |
13 | | Course 1 | C1 | 0 |
14 | And the following "course enrolments" exist:
15 | | user | course | role |
16 | | teacher1 | C1 | editingteacher |
17 | And I setup the default settigns for opencast plugins
18 | And the following config values are set as admin:
19 | | config | value | plugin |
20 | | apiurl_1 | http://testapi:8080 | tool_opencast |
21 | | apipassword_1 | opencast | tool_opencast |
22 | | apiusername_1 | admin | tool_opencast |
23 | | ocinstances | [{"id":1,"name":"Default","isvisible":true,"isdefault":true}] | tool_opencast |
24 | | limituploadjobs_1 | 0 | block_opencast |
25 | | group_creation_1 | 0 | block_opencast |
26 | | group_name_1 | Moodle_course_[COURSEID] | block_opencast |
27 | | series_name_1 | Course_Series_[COURSEID] | block_opencast |
28 | | enablechunkupload_1 | 0 | block_opencast |
29 | | workflow_roles_1 | republish-metadata | block_opencast |
30 | | aclcontrolafter_1 | 1 | block_opencast |
31 | And I setup the opencast test api
32 | And I upload a testvideo
33 | And I log in as "admin"
34 | And I am on "Course 1" course homepage with editing mode on
35 | And I add the "Opencast Videos" block
36 |
37 | @javascript
38 | Scenario: Change the visibility from "invsible" to "visible"
39 | Given I click on "Go to overview..." "link"
40 | And I click on "#opencast-videos-table-1234-1234-1234-1234-1234_r0 i.fa-eye-slash" "css_element"
41 | And I click on "#id_visibility_1" "css_element"
42 | And I click on "Save changes" "button"
43 | Then I should not see "Error"
44 | And I should see "The change of visibility has been triggered to allow all students of the course to access the video"
45 |
--------------------------------------------------------------------------------
/tests/behat/block_opencast_deletedraft.feature:
--------------------------------------------------------------------------------
1 | @block @block_opencast
2 | Feature: Delete draft
3 | In order to stop upload jobs
4 | As admins
5 | Teachers need to be able to delete upload jobs before uploading videos to Opencast
6 |
7 | Background:
8 | Given the following "users" exist:
9 | | username | firstname | lastname | email | idnumber |
10 | | teacher1 | Teacher | 1 | teacher1@example.com | T1 |
11 | And the following "courses" exist:
12 | | fullname | shortname | category |
13 | | Course 1 | C1 | 0 |
14 | And the following "course enrolments" exist:
15 | | user | course | role |
16 | | teacher1 | C1 | editingteacher |
17 | And I setup the default settigns for opencast plugins
18 | And the following config values are set as admin:
19 | | config | value | plugin |
20 | | apiurl_1 | http://172.17.0.1:8080 | tool_opencast |
21 | | apipassword_1 | opencast | tool_opencast |
22 | | apiusername_1 | admin | tool_opencast |
23 | | ocinstances | [{"id":1,"name":"Default","isvisible":true,"isdefault":true}] | tool_opencast |
24 | | limituploadjobs_1 | 0 | block_opencast |
25 | | group_creation_1 | 0 | block_opencast |
26 | | group_name_1 | Moodle_course_[COURSEID] | block_opencast |
27 | | series_name_1 | Course_Series_[COURSEID] | block_opencast |
28 | | enablechunkupload_1 | 0 | block_opencast |
29 | And I log in as "admin"
30 | And I am on "Course 1" course homepage with editing mode on
31 | And I add the "Opencast Videos" block
32 |
33 | @_file_upload @javascript
34 | Scenario: Delete a video draft
35 | Given I click on "Go to overview..." "link"
36 | And I click on "Add video" "button"
37 | And I set the field "Title" to "Test"
38 | And I upload "blocks/opencast/tests/fixtures/test.mp4" file to "Presenter video" filemanager
39 | And I click on "Add video" "button"
40 | Then I should see "test.mp4"
41 | When I click on ".generaltable i.fa-trash-can" "css_element"
42 | Then I should see "Delete video before transfer to Opencast"
43 | And I click on "Continue" "button"
44 | Then I should see "The video is deleted successfully"
45 | And I should not see "test.mp4"
46 |
--------------------------------------------------------------------------------
/tests/behat/block_opencast_deleteevent.feature:
--------------------------------------------------------------------------------
1 | @block @block_opencast
2 | Feature: Delete videos
3 |
4 | Background:
5 | Given the following "users" exist:
6 | | username | firstname | lastname | email | idnumber |
7 | | teacher1 | Teacher | 1 | teacher1@example.com | T1 |
8 | And the following "courses" exist:
9 | | fullname | shortname | category |
10 | | Course 1 | C1 | 0 |
11 | And the following "course enrolments" exist:
12 | | user | course | role |
13 | | teacher1 | C1 | editingteacher |
14 | And I setup the default settigns for opencast plugins
15 | And the following config values are set as admin:
16 | | config | value | plugin |
17 | | apiurl_1 | http://testapi:8080 | tool_opencast |
18 | | apipassword_1 | opencast | tool_opencast |
19 | | apiusername_1 | admin | tool_opencast |
20 | | ocinstances | [{"id":1,"name":"Default","isvisible":true,"isdefault":true}] | tool_opencast |
21 | | limituploadjobs_1 | 0 | block_opencast |
22 | | group_creation_1 | 0 | block_opencast |
23 | | group_name_1 | Moodle_course_[COURSEID] | block_opencast |
24 | | series_name_1 | Course_Series_[COURSEID] | block_opencast |
25 | | enablechunkupload_1 | 0 | block_opencast |
26 | | support_email_1 | test@test.de | block_opencast |
27 | And I setup the opencast test api
28 | And I upload a testvideo
29 | And I log in as "admin"
30 | And I am on "Course 1" course homepage with editing mode on
31 | And I add the "Opencast Videos" block
32 |
33 | @javascript
34 | Scenario: A teacher should be able to delete a video
35 | When I click on "Go to overview..." "link"
36 | And I click on "#opencast-videos-table-1234-1234-1234-1234-1234_r0 i.fa-trash-can" "css_element"
37 | And I click on "Delete video permanently" "button"
38 | Then I should see "The video will be deleted shortly"
39 |
40 | @javascript
41 | Scenario: A teacher should be able to delete a video when a workflow must be executed before deletion
42 | Given the following config values are set as admin:
43 | | config | value | plugin |
44 | | deleteworkflow_1 | delete | block_opencast |
45 | When I click on "Go to overview..." "link"
46 | And I click on "#opencast-videos-table-1234-1234-1234-1234-1234_r0 i.fa-trash-can" "css_element"
47 | And I click on "Delete video permanently" "button"
48 | Then I should see "The video will be deleted shortly"
49 |
--------------------------------------------------------------------------------
/tests/behat/block_opencast_reportproblem.feature:
--------------------------------------------------------------------------------
1 | @block @block_opencast
2 | Feature: Report problems
3 | In order to fix video issues
4 | As admins
5 | Teachers need to be able to report problems to the support team
6 |
7 | Background:
8 | Given the following "users" exist:
9 | | username | firstname | lastname | email | idnumber |
10 | | teacher1 | Teacher | 1 | teacher1@example.com | T1 |
11 | And the following "courses" exist:
12 | | fullname | shortname | category |
13 | | Course 1 | C1 | 0 |
14 | And the following "course enrolments" exist:
15 | | user | course | role |
16 | | teacher1 | C1 | editingteacher |
17 | And I setup the default settigns for opencast plugins
18 | And the following config values are set as admin:
19 | | config | value | plugin |
20 | | apiurl_1 | http://testapi:8080 | tool_opencast |
21 | | apipassword_1 | opencast | tool_opencast |
22 | | apiusername_1 | admin | tool_opencast |
23 | | ocinstances | [{"id":1,"name":"Default","isvisible":true,"isdefault":true}] | tool_opencast |
24 | | limituploadjobs_1 | 0 | block_opencast |
25 | | group_creation_1 | 0 | block_opencast |
26 | | group_name_1 | Moodle_course_[COURSEID] | block_opencast |
27 | | series_name_1 | Course_Series_[COURSEID] | block_opencast |
28 | | enablechunkupload_1 | 0 | block_opencast |
29 | | support_email_1 | test@test.de | block_opencast |
30 | And I setup the opencast test api
31 | And I upload a testvideo
32 | And I log in as "admin"
33 | And I am on "Course 1" course homepage with editing mode on
34 | And I add the "Opencast Videos" block
35 |
36 | @javascript
37 | Scenario: When the update metadata form is loaded, the video metadata are loaded in the form
38 | When I click on "Go to overview..." "link"
39 | And I click on "#opencast-videos-table-1234-1234-1234-1234-1234_r0 .cell a.report-problem" "css_element"
40 | And I set the field "inputMessage" to "This is a message."
41 | And I click on "Report problem" "button"
42 | Then I should see "The email was successfully sent to the support team"
43 |
--------------------------------------------------------------------------------
/tests/behat/block_opencast_startworkflow.feature:
--------------------------------------------------------------------------------
1 | @block @block_opencast @block_opencast_startworkflow
2 | Feature: Start workflows for a video as Teacher
3 |
4 | Background:
5 | Given the following "users" exist:
6 | | username | firstname | lastname | email | idnumber |
7 | | teacher1 | Teacher | 1 | teacher1@example.com | T1 |
8 | And the following "courses" exist:
9 | | fullname | shortname | category |
10 | | Course 1 | C1 | 0 |
11 | And the following "course enrolments" exist:
12 | | user | course | role |
13 | | teacher1 | C1 | editingteacher |
14 | And I setup the default settigns for opencast plugins
15 | And the following config values are set as admin:
16 | | config | value | plugin |
17 | | apiurl_1 | http://testapi:8080 | tool_opencast |
18 | | apipassword_1 | opencast | tool_opencast |
19 | | apiusername_1 | admin | tool_opencast |
20 | | ocinstances | [{"id":1,"name":"Default","isvisible":true,"isdefault":true}] | tool_opencast |
21 | | limituploadjobs_1 | 0 | block_opencast |
22 | | group_creation_1 | 0 | block_opencast |
23 | | group_name_1 | Moodle_course_[COURSEID] | block_opencast |
24 | | series_name_1 | Course_Series_[COURSEID] | block_opencast |
25 | | enablechunkupload_1 | 0 | block_opencast |
26 | | workflow_tags_1 | archive | block_opencast |
27 | | swprivacynoticeinfotext_1 | Privacy Notice Info Text | block_opencast |
28 | | swprivacynoticewfds_1 | duplicate-event | block_opencast |
29 | | swprivacynoticetitle_1 | Privacy Notice | block_opencast |
30 | And I setup the opencast test api
31 | And I upload a testvideo
32 | And I log in as "admin"
33 | And I am on "Course 1" course homepage with editing mode on
34 | And I add the "Opencast Videos" block
35 |
36 | @javascript
37 | Scenario: When the update metadata form is loaded, the video metadata are loaded in the form
38 | When I click on "Go to overview..." "link"
39 | And I click on "#opencast-videos-table-1234-1234-1234-1234-1234_r0 .cell .action-menu a" "css_element"
40 | And I click on "Start workflow" "link"
41 | Then I should see "Choose the workflow you want to start"
42 | And I wait "1" seconds
43 | When I set the field "workflow" to "duplicate-event"
44 | And I wait "2" seconds
45 | Then I should see "Privacy Notice"
46 | And I should see "Privacy Notice Info Text"
47 | When I click on "Start workflow" "button"
48 | And I wait "2" seconds
49 | Then I should see "Workflow successfully started"
50 |
--------------------------------------------------------------------------------
/tests/behat/block_opencast_updatemetadata.feature:
--------------------------------------------------------------------------------
1 | @block @block_opencast @block_opencast_updatemetadata
2 | Feature: Update video metadata as Teacher
3 | In order to update video metadata
4 | As teacher
5 | I need to be able to view and modify the metadata of a video
6 |
7 | Background:
8 | Given the following "users" exist:
9 | | username | firstname | lastname | email | idnumber |
10 | | teacher1 | Teacher | 1 | teacher1@example.com | T1 |
11 | And the following "courses" exist:
12 | | fullname | shortname | category |
13 | | Course 1 | C1 | 0 |
14 | And the following "course enrolments" exist:
15 | | user | course | role |
16 | | teacher1 | C1 | editingteacher |
17 | And I setup the default settigns for opencast plugins
18 | And the following config values are set as admin:
19 | | config | value | plugin |
20 | | apiurl_1 | http://testapi:8080 | tool_opencast |
21 | | apipassword_1 | opencast | tool_opencast |
22 | | apiusername_1 | admin | tool_opencast |
23 | | ocinstances | [{"id":1,"name":"Default","isvisible":true,"isdefault":true}] | tool_opencast |
24 | | limituploadjobs_1 | 0 | block_opencast |
25 | | group_creation_1 | 0 | block_opencast |
26 | | group_name_1 | Moodle_course_[COURSEID] | block_opencast |
27 | | series_name_1 | Course_Series_[COURSEID] | block_opencast |
28 | | enablechunkupload_1 | 0 | block_opencast |
29 | | workflow_roles_1 | republish-metadata | block_opencast |
30 | | metadata_1 | [{"name":"title","datatype":"text","required":1,"readonly":0,"param_json":null}] | block_opencast |
31 | And I setup the opencast test api
32 | And I upload a testvideo
33 | And I log in as "admin"
34 | And I am on "Course 1" course homepage with editing mode on
35 | And I add the "Opencast Videos" block
36 |
37 | @javascript
38 | Scenario: When the update metadata form is loaded, the video metadata are loaded in the form
39 | When I click on "Go to overview..." "link"
40 | And I click on "#opencast-videos-table-1234-1234-1234-1234-1234_r0 .cell .action-menu a" "css_element"
41 | And I click on "Update metadata" "link"
42 | Then I should see "Update metadata"
43 | And the field "Title" matches value "Test video"
44 | When I set the field "Title" to "New title"
45 | And I click on "Save changes" "button"
46 | Then I should see "Metadata is saved"
47 |
--------------------------------------------------------------------------------
/tests/fixtures/api_calls/delete/api_events_delete.json:
--------------------------------------------------------------------------------
1 | {
2 | "resource": "/api/events/abcd-abcd-abcd-abcd",
3 | "status": 200
4 | }
--------------------------------------------------------------------------------
/tests/fixtures/api_calls/get/api_events_acl.json:
--------------------------------------------------------------------------------
1 | {
2 | "resource": "/api/events/abcd-abcd-abcd-abcd/acl",
3 | "status": 200,
4 | "body": [
5 | {
6 | "allow": true,
7 | "role": "ROLE_ADMIN",
8 | "action": "read"
9 | },
10 | {
11 | "allow": true,
12 | "role": "ROLE_ADMIN",
13 | "action": "write"
14 | },
15 | {
16 | "allow": true,
17 | "role": "1_Instructor",
18 | "action": "read"
19 | },
20 | {
21 | "allow": true,
22 | "role": "1_Instructor",
23 | "action": "write"
24 | },
25 | {
26 | "allow": true,
27 | "role": "1_Learner",
28 | "action": "read"
29 | },
30 | {
31 | "allow": true,
32 | "role": "ROLE_GROUP_MH_DEFAULT_ORG_EXTERNAL_APPLICATIONS",
33 | "action": "read"
34 | },
35 | {
36 | "allow": true,
37 | "role": "ROLE_GROUP_MH_DEFAULT_ORG_EXTERNAL_APPLICATIONS",
38 | "action": "write"
39 | }
40 | ]
41 | }
--------------------------------------------------------------------------------
/tests/fixtures/api_calls/get/api_events_filter_newseries_importvideos.json:
--------------------------------------------------------------------------------
1 | {
2 | "resource": "/api/events?filter=is_part_of:84bab8de-5688-46a1-9af0-5ce9122eeb6a&sort=start_date:DESC&sign=true&withacl=true&withmetadata=true&withpublications=true",
3 | "status": 200,
4 | "body": [
5 | ]
6 | }
--------------------------------------------------------------------------------
/tests/fixtures/api_calls/get/api_events_filter_newseries_importvideos_nolimit.json:
--------------------------------------------------------------------------------
1 | {
2 | "resource": "/api/events?filter=is_part_of:84bab8de-5688-46a1-9af0-5ce9122eeb6a&sort=start_date:DESC&sign=true&withacl=true&withmetadata=true&withpublications=true&limit=6",
3 | "status": 200,
4 | "body": [
5 | ]
6 | }
--------------------------------------------------------------------------------
/tests/fixtures/api_calls/get/api_events_get_single_changevisibility.json:
--------------------------------------------------------------------------------
1 | {
2 | "resource": "/api/events/abcd-abcd-abcd-abcd?withacl=false&withpublications=false",
3 | "status": 200,
4 | "body": {
5 | "identifier": "abcd-abcd-abcd-abcd",
6 | "creator": "",
7 | "presenter": [],
8 | "created": "2021-08-11T09:32:00Z",
9 | "is_part_of": "1234-1234-1234-1234-1234",
10 | "subjects": [],
11 | "start": "2021-08-11T09:32:00Z",
12 | "description": "",
13 | "language": "",
14 | "source": "",
15 | "title": "Test video",
16 | "processing_state": "SUCCEEDED",
17 | "duration": 0,
18 | "license": "",
19 | "archive_version": 4,
20 | "contributor": [],
21 | "series": "Test series",
22 | "has_previews": false,
23 | "location": "",
24 | "rightsholder": "",
25 | "publication_status": [
26 | "engage-player",
27 | "api",
28 | "annotation"
29 | ],
30 | "status": "EVENTS.EVENTS.STATUS.PROCESSED"
31 | }
32 | }
--------------------------------------------------------------------------------
/tests/fixtures/api_calls/get/api_events_metadata.json:
--------------------------------------------------------------------------------
1 | {
2 | "resource": "/api/events/abcd-abcd-abcd-abcd/metadata?type=dublincore/episode",
3 | "status": 200,
4 | "body": [
5 | {
6 | "readOnly": false,
7 | "id": "title",
8 | "label": "EVENTS.EVENTS.DETAILS.METADATA.TITLE",
9 | "type": "text",
10 | "value": "Test video",
11 | "required": true
12 | },
13 | {
14 | "readOnly": false,
15 | "id": "subjects",
16 | "label": "EVENTS.EVENTS.DETAILS.METADATA.SUBJECT",
17 | "type": "text",
18 | "value": [],
19 | "required": false
20 | },
21 | {
22 | "readOnly": false,
23 | "id": "description",
24 | "label": "EVENTS.EVENTS.DETAILS.METADATA.DESCRIPTION",
25 | "type": "text_long",
26 | "value": "",
27 | "required": false
28 | },
29 | {
30 | "translatable": true,
31 | "readOnly": false,
32 | "id": "language",
33 | "label": "EVENTS.EVENTS.DETAILS.METADATA.LANGUAGE",
34 | "type": "text",
35 | "value": "",
36 | "required": false
37 | },
38 | {
39 | "readOnly": false,
40 | "id": "rightsHolder",
41 | "label": "EVENTS.EVENTS.DETAILS.METADATA.RIGHTS",
42 | "type": "text",
43 | "value": "",
44 | "required": false
45 | },
46 | {
47 | "translatable": false,
48 | "readOnly": false,
49 | "id": "license",
50 | "label": "EVENTS.EVENTS.DETAILS.METADATA.LICENSE",
51 | "type": "text",
52 | "value": "",
53 | "required": false
54 | },
55 | {
56 | "translatable": false,
57 | "readOnly": false,
58 | "id": "isPartOf",
59 | "label": "EVENTS.EVENTS.DETAILS.METADATA.SERIES",
60 | "type": "text",
61 | "value": "1234-1234-1234-1234-1234",
62 | "required": true
63 | },
64 | {
65 | "translatable": false,
66 | "readOnly": false,
67 | "id": "creator",
68 | "label": "EVENTS.EVENTS.DETAILS.METADATA.PRESENTERS",
69 | "type": "mixed_text",
70 | "value": [],
71 | "required": false
72 | },
73 | {
74 | "translatable": false,
75 | "readOnly": false,
76 | "id": "contributor",
77 | "label": "EVENTS.EVENTS.DETAILS.METADATA.CONTRIBUTORS",
78 | "type": "mixed_text",
79 | "value": [],
80 | "required": false
81 | },
82 | {
83 | "readOnly": false,
84 | "id": "startDate",
85 | "label": "EVENTS.EVENTS.DETAILS.METADATA.START_DATE",
86 | "type": "date",
87 | "value": "2021-08-11",
88 | "required": false
89 | },
90 | {
91 | "readOnly": false,
92 | "id": "startTime",
93 | "label": "EVENTS.EVENTS.DETAILS.METADATA.START_TIME",
94 | "type": "time",
95 | "value": "09:32",
96 | "required": false
97 | },
98 | {
99 | "readOnly": false,
100 | "id": "duration",
101 | "label": "EVENTS.EVENTS.DETAILS.METADATA.DURATION",
102 | "type": "text",
103 | "value": "00:00:00",
104 | "required": false
105 | },
106 | {
107 | "readOnly": false,
108 | "id": "location",
109 | "label": "EVENTS.EVENTS.DETAILS.METADATA.LOCATION",
110 | "type": "text",
111 | "value": "",
112 | "required": false
113 | },
114 | {
115 | "readOnly": false,
116 | "id": "source",
117 | "label": "EVENTS.EVENTS.DETAILS.METADATA.SOURCE",
118 | "type": "text",
119 | "value": "",
120 | "required": false
121 | },
122 | {
123 | "readOnly": true,
124 | "id": "created",
125 | "label": "EVENTS.EVENTS.DETAILS.METADATA.CREATED",
126 | "type": "date",
127 | "value": "2021-08-11T09:32:00.000Z",
128 | "required": false
129 | },
130 | {
131 | "readOnly": true,
132 | "id": "publisher",
133 | "label": "EVENTS.EVENTS.DETAILS.METADATA.PUBLISHER",
134 | "type": "text",
135 | "value": "",
136 | "required": false
137 | },
138 | {
139 | "readOnly": true,
140 | "id": "identifier",
141 | "label": "EVENTS.EVENTS.DETAILS.METADATA.ID",
142 | "type": "text",
143 | "value": "abcd-abcd-abcd-abcd",
144 | "required": false
145 | }
146 | ]
147 | }
--------------------------------------------------------------------------------
/tests/fixtures/api_calls/get/api_events_single_event.json:
--------------------------------------------------------------------------------
1 | {
2 | "resource": "/api/events/abcd-abcd-abcd-abcd",
3 | "status": 200,
4 | "body": {
5 | "identifier": "abcd-abcd-abcd-abcd",
6 | "creator": "",
7 | "presenter": [],
8 | "created": "2021-08-11T09:32:00Z",
9 | "is_part_of": "1234-1234-1234-1234-1234",
10 | "subjects": [],
11 | "start": "2021-08-11T09:32:00Z",
12 | "description": "",
13 | "language": "",
14 | "source": "",
15 | "title": "Test video",
16 | "processing_state": "SUCCEEDED",
17 | "duration": 0,
18 | "license": "",
19 | "archive_version": 5,
20 | "contributor": [],
21 | "series": "Test series",
22 | "has_previews": false,
23 | "location": "",
24 | "rightsholder": "",
25 | "publication_status": [
26 | "engage-player",
27 | "api",
28 | "annotation"
29 | ],
30 | "status": "EVENTS.EVENTS.STATUS.PROCESSED"
31 | }
32 | }
--------------------------------------------------------------------------------
/tests/fixtures/api_calls/get/api_events_single_event_duplicated.json:
--------------------------------------------------------------------------------
1 | {
2 | "resource": "/api/events/45fca7d0-c1e2-4601-bf12-6ccb3376a5f6?withpublications=false&withacl=false",
3 | "body": {
4 | "identifier": "45fca7d0-c1e2-4601-bf12-6ccb3376a5f6",
5 | "creator": "",
6 | "presenter": [],
7 | "created": "2021-08-11T09:32:00Z",
8 | "is_part_of": "84bab8de-5688-46a1-9af0-5ce9122eeb6a",
9 | "subjects": [],
10 | "start": "2021-08-11T09:32:00Z",
11 | "description": "",
12 | "language": "",
13 | "source": "",
14 | "title": "Test video (copy 1)",
15 | "processing_state": "SUCCEEDED",
16 | "duration": 0,
17 | "license": "",
18 | "archive_version": 5,
19 | "contributor": [],
20 | "series": "Series for import",
21 | "has_previews": false,
22 | "location": "",
23 | "rightsholder": "",
24 | "publication_status": [
25 | "engage-player",
26 | "api",
27 | "annotation"
28 | ],
29 | "status": "EVENTS.EVENTS.STATUS.PROCESSED",
30 | "acl": [
31 | {
32 | "allow": true,
33 | "role": "ROLE_ADMIN",
34 | "action": "read"
35 | },
36 | {
37 | "allow": true,
38 | "role": "ROLE_ADMIN",
39 | "action": "write"
40 | },
41 | {
42 | "allow": true,
43 | "role": "206001_Instructor",
44 | "action": "read"
45 | },
46 | {
47 | "allow": true,
48 | "role": "206001_Instructor",
49 | "action": "write"
50 | },
51 | {
52 | "allow": false,
53 | "role": "206001_Learner",
54 | "action": "read"
55 | },
56 | {
57 | "allow": true,
58 | "role": "ROLE_GROUP_MH_DEFAULT_ORG_EXTERNAL_APPLICATIONS",
59 | "action": "read"
60 | },
61 | {
62 | "allow": true,
63 | "role": "ROLE_GROUP_MH_DEFAULT_ORG_EXTERNAL_APPLICATIONS",
64 | "action": "write"
65 | }
66 | ]
67 | }
68 | }
--------------------------------------------------------------------------------
/tests/fixtures/api_calls/get/api_events_single_event_duplicated2.json:
--------------------------------------------------------------------------------
1 | {
2 | "resource": "/api/events/45fca7d0-c1e2-4601-bf12-6ccb3376a5f6",
3 | "body": {
4 | "identifier": "45fca7d0-c1e2-4601-bf12-6ccb3376a5f6",
5 | "creator": "",
6 | "presenter": [],
7 | "created": "2021-08-11T09:32:00Z",
8 | "is_part_of": "84bab8de-5688-46a1-9af0-5ce9122eeb6a",
9 | "subjects": [],
10 | "start": "2021-08-11T09:32:00Z",
11 | "description": "",
12 | "language": "",
13 | "source": "",
14 | "title": "Test video (copy 1)",
15 | "processing_state": "SUCCEEDED",
16 | "duration": 0,
17 | "license": "",
18 | "archive_version": 5,
19 | "contributor": [],
20 | "series": "Series for import",
21 | "has_previews": false,
22 | "location": "",
23 | "rightsholder": "",
24 | "publication_status": [
25 | "engage-player",
26 | "api",
27 | "annotation"
28 | ],
29 | "status": "EVENTS.EVENTS.STATUS.PROCESSED",
30 | "acl": [
31 | {
32 | "allow": true,
33 | "role": "ROLE_ADMIN",
34 | "action": "read"
35 | },
36 | {
37 | "allow": true,
38 | "role": "ROLE_ADMIN",
39 | "action": "write"
40 | },
41 | {
42 | "allow": true,
43 | "role": "206001_Instructor",
44 | "action": "read"
45 | },
46 | {
47 | "allow": true,
48 | "role": "206001_Instructor",
49 | "action": "write"
50 | },
51 | {
52 | "allow": false,
53 | "role": "206001_Learner",
54 | "action": "read"
55 | },
56 | {
57 | "allow": true,
58 | "role": "ROLE_GROUP_MH_DEFAULT_ORG_EXTERNAL_APPLICATIONS",
59 | "action": "read"
60 | },
61 | {
62 | "allow": true,
63 | "role": "ROLE_GROUP_MH_DEFAULT_ORG_EXTERNAL_APPLICATIONS",
64 | "action": "write"
65 | }
66 | ]
67 | }
68 | }
--------------------------------------------------------------------------------
/tests/fixtures/api_calls/get/api_series_acl.json:
--------------------------------------------------------------------------------
1 | {
2 | "resource": "/api/series/1111-1111-1111-1111-1111/acl",
3 | "status": 200,
4 | "body": [
5 | {
6 | "allow": true,
7 | "role": "ROLE_ADMIN",
8 | "action": "write"
9 | },
10 | {
11 | "allow": true,
12 | "role": "ROLE_ADMIN",
13 | "action": "read"
14 | },
15 | {
16 | "allow": true,
17 | "role": "ROLE_GROUP_MH_DEFAULT_ORG_EXTERNAL_APPLICATIONS",
18 | "action": "write"
19 | },
20 | {
21 | "allow": true,
22 | "role": "ROLE_GROUP_MH_DEFAULT_ORG_EXTERNAL_APPLICATIONS",
23 | "action": "read"
24 | },
25 | {
26 | "allow": true,
27 | "role": "2_Instructor",
28 | "action": "write"
29 | },
30 | {
31 | "allow": true,
32 | "role": "2_Instructor",
33 | "action": "read"
34 | },
35 | {
36 | "allow": true,
37 | "role": "2_Learner",
38 | "action": "read"
39 | }
40 | ]
41 | }
--------------------------------------------------------------------------------
/tests/fixtures/api_calls/get/api_series_acl2.json:
--------------------------------------------------------------------------------
1 | {
2 | "resource": "/api/series/1234-1234-1234-1234-1234/acl",
3 | "status": 200,
4 | "body": [
5 | {
6 | "allow": true,
7 | "role": "ROLE_ADMIN",
8 | "action": "write"
9 | },
10 | {
11 | "allow": true,
12 | "role": "ROLE_ADMIN",
13 | "action": "read"
14 | },
15 | {
16 | "allow": true,
17 | "role": "ROLE_GROUP_MH_DEFAULT_ORG_EXTERNAL_APPLICATIONS",
18 | "action": "write"
19 | },
20 | {
21 | "allow": true,
22 | "role": "ROLE_GROUP_MH_DEFAULT_ORG_EXTERNAL_APPLICATIONS",
23 | "action": "read"
24 | },
25 | {
26 | "allow": true,
27 | "role": "2_Instructor",
28 | "action": "write"
29 | },
30 | {
31 | "allow": true,
32 | "role": "2_Instructor",
33 | "action": "read"
34 | },
35 | {
36 | "allow": true,
37 | "role": "2_Learner",
38 | "action": "read"
39 | }
40 | ]
41 | }
--------------------------------------------------------------------------------
/tests/fixtures/api_calls/get/api_series_default_with_no_acl.json:
--------------------------------------------------------------------------------
1 | {
2 | "resource": "/api/series/1234-1234-1234-1234-1234?withacl=false",
3 | "status": 200,
4 | "body": {
5 | "identifier": "1234-1234-1234-1234-1234",
6 | "creator": "",
7 | "opt_out": false,
8 | "created": "2021-07-28T08:16:35Z",
9 | "subjects": [],
10 | "description": "",
11 | "language": "",
12 | "title": "Test series",
13 | "license": "",
14 | "organization": "mh_default_org",
15 | "organizers": [],
16 | "publishers": [],
17 | "contributors": [],
18 | "rightsholder": ""
19 | }
20 | }
--------------------------------------------------------------------------------
/tests/fixtures/api_calls/get/api_series_filter.json:
--------------------------------------------------------------------------------
1 | {
2 | "resource": "/api/series?filter=identifier:1234-1234-1234-1234-1234",
3 | "status": 200,
4 | "body": [
5 | {
6 | "identifier": "1234-1234-1234-1234-1234",
7 | "license": "",
8 | "creator": "",
9 | "created": "2021-07-28T08:16:35Z",
10 | "subjects": [],
11 | "organizers": [],
12 | "description": "",
13 | "publishers": [],
14 | "language": "",
15 | "contributors": [],
16 | "title": "Test series",
17 | "rightsholder": ""
18 | }
19 | ]
20 | }
--------------------------------------------------------------------------------
/tests/fixtures/api_calls/get/api_series_metadata.json:
--------------------------------------------------------------------------------
1 | {
2 | "resource": "/api/series/1234-1234-1234-1234-1234/metadata?type=dublincore/series",
3 | "status": 200,
4 | "body": [
5 | {
6 | "readOnly": false,
7 | "id": "title",
8 | "label": "EVENTS.SERIES.DETAILS.METADATA.TITLE",
9 | "type": "text",
10 | "value": "Test series",
11 | "required": true
12 | },
13 | {
14 | "readOnly": false,
15 | "id": "subjects",
16 | "label": "EVENTS.SERIES.DETAILS.METADATA.SUBJECT",
17 | "type": "text",
18 | "value": [],
19 | "required": false
20 | },
21 | {
22 | "readOnly": false,
23 | "id": "description",
24 | "label": "EVENTS.SERIES.DETAILS.METADATA.DESCRIPTION",
25 | "type": "text",
26 | "value": "",
27 | "required": false
28 | },
29 | {
30 | "translatable": true,
31 | "readOnly": false,
32 | "id": "language",
33 | "label": "EVENTS.SERIES.DETAILS.METADATA.LANGUAGE",
34 | "type": "text",
35 | "value": "",
36 | "required": false
37 | },
38 | {
39 | "readOnly": false,
40 | "id": "rightsHolder",
41 | "label": "EVENTS.SERIES.DETAILS.METADATA.RIGHTS",
42 | "type": "text",
43 | "value": "",
44 | "required": false
45 | },
46 | {
47 | "translatable": true,
48 | "readOnly": false,
49 | "id": "license",
50 | "label": "EVENTS.SERIES.DETAILS.METADATA.LICENSE",
51 | "type": "text",
52 | "value": "",
53 | "required": false
54 | },
55 | {
56 | "translatable": false,
57 | "readOnly": false,
58 | "id": "creator",
59 | "label": "EVENTS.SERIES.DETAILS.METADATA.ORGANIZERS",
60 | "type": "mixed_text",
61 | "value": [],
62 | "required": false
63 | },
64 | {
65 | "translatable": false,
66 | "readOnly": false,
67 | "id": "contributor",
68 | "label": "EVENTS.SERIES.DETAILS.METADATA.CONTRIBUTORS",
69 | "type": "mixed_text",
70 | "value": [],
71 | "required": false
72 | },
73 | {
74 | "translatable": false,
75 | "readOnly": false,
76 | "id": "publisher",
77 | "label": "EVENTS.SERIES.DETAILS.METADATA.PUBLISHERS",
78 | "type": "mixed_text",
79 | "value": [],
80 | "required": false
81 | },
82 | {
83 | "readOnly": true,
84 | "id": "createdBy",
85 | "label": "EVENTS.SERIES.DETAILS.METADATA.CREATED_BY",
86 | "type": "text",
87 | "value": "",
88 | "required": false
89 | },
90 | {
91 | "readOnly": true,
92 | "id": "identifier",
93 | "label": "EVENTS.SERIES.DETAILS.METADATA.ID",
94 | "type": "text",
95 | "value": "1234-1234-1234-1234-1234",
96 | "required": false
97 | }
98 | ]
99 | }
--------------------------------------------------------------------------------
/tests/fixtures/api_calls/get/api_series_three_noacl.json:
--------------------------------------------------------------------------------
1 | {
2 | "resource": "/api/series/84bab8de-5688-46a1-9af0-5ce9122eeb6a?withacl=false",
3 | "status": 200,
4 | "body": {
5 | "identifier": "84bab8de-5688-46a1-9af0-5ce9122eeb6a",
6 | "creator": "",
7 | "opt_out": false,
8 | "created": "2021-07-28T08:16:35Z",
9 | "subjects": [],
10 | "description": "",
11 | "language": "",
12 | "title": "Series for import",
13 | "license": "",
14 | "organization": "mh_default_org",
15 | "organizers": [],
16 | "publishers": [],
17 | "contributors": [],
18 | "rightsholder": ""
19 | }
20 | }
--------------------------------------------------------------------------------
/tests/fixtures/api_calls/get/api_series_three_withacl.json:
--------------------------------------------------------------------------------
1 | {
2 | "resource": "/api/series/84bab8de-5688-46a1-9af0-5ce9122eeb6a?withacl=true",
3 | "status": 200,
4 | "body": {
5 | "identifier": "84bab8de-5688-46a1-9af0-5ce9122eeb6a",
6 | "creator": "",
7 | "opt_out": false,
8 | "created": "2021-07-28T08:16:35Z",
9 | "subjects": [],
10 | "description": "",
11 | "language": "",
12 | "title": "Series for import",
13 | "license": "",
14 | "acl": [
15 | {
16 | "allow": true,
17 | "role": "ROLE_ANONYMOUS",
18 | "action": "read"
19 | }
20 | ],
21 | "organization": "mh_default_org",
22 | "organizers": [],
23 | "publishers": [],
24 | "contributors": [],
25 | "rightsholder": ""
26 | }
27 | }
--------------------------------------------------------------------------------
/tests/fixtures/api_calls/get/api_series_two_noacl.json:
--------------------------------------------------------------------------------
1 | {
2 | "resource": "/api/series/1111-1111-1111-1111-1111?withacl=false",
3 | "status": 200,
4 | "body": {
5 | "identifier": "1111-1111-1111-1111-1111",
6 | "creator": "",
7 | "opt_out": false,
8 | "created": "2021-07-28T08:16:35Z",
9 | "subjects": [],
10 | "description": "",
11 | "language": "",
12 | "title": "Another series",
13 | "license": "",
14 | "acl": [
15 | {
16 | "allow": true,
17 | "role": "ROLE_ANONYMOUS",
18 | "action": "read"
19 | }
20 | ],
21 | "organization": "mh_default_org",
22 | "organizers": [],
23 | "publishers": [],
24 | "contributors": [],
25 | "rightsholder": ""
26 | }
27 | }
--------------------------------------------------------------------------------
/tests/fixtures/api_calls/get/api_series_two_withacl.json:
--------------------------------------------------------------------------------
1 | {
2 | "resource": "/api/series/1111-1111-1111-1111-1111?withacl=true",
3 | "status": 200,
4 | "body": {
5 | "identifier": "1111-1111-1111-1111-1111",
6 | "creator": "",
7 | "opt_out": false,
8 | "created": "2021-07-28T08:16:35Z",
9 | "subjects": [],
10 | "description": "",
11 | "language": "",
12 | "title": "Another series",
13 | "license": "",
14 | "acl": [
15 | {
16 | "allow": true,
17 | "role": "ROLE_ANONYMOUS",
18 | "action": "read"
19 | }
20 | ],
21 | "organization": "mh_default_org",
22 | "organizers": [],
23 | "publishers": [],
24 | "contributors": [],
25 | "rightsholder": ""
26 | }
27 | }
--------------------------------------------------------------------------------
/tests/fixtures/api_calls/get/api_series_withacl.json:
--------------------------------------------------------------------------------
1 | {
2 | "resource": "/api/series/1234-1234-1234-1234-1234?withacl=true",
3 | "status": 200,
4 | "body": {
5 | "identifier": "1234-1234-1234-1234-1234",
6 | "creator": "",
7 | "opt_out": false,
8 | "created": "2021-07-28T08:16:35Z",
9 | "subjects": [],
10 | "description": "",
11 | "language": "",
12 | "title": "Test series",
13 | "license": "",
14 | "acl": [
15 | {
16 | "allow": true,
17 | "role": "ROLE_ANONYMOUS",
18 | "action": "read"
19 | }
20 | ],
21 | "organization": "mh_default_org",
22 | "organizers": [],
23 | "publishers": [],
24 | "contributors": [],
25 | "rightsholder": ""
26 | }
27 | }
--------------------------------------------------------------------------------
/tests/fixtures/api_calls/get/api_workflow_definitions_all.json:
--------------------------------------------------------------------------------
1 | {
2 | "resource": "/api/workflow-definitions?filter=tag:",
3 | "status": 200,
4 | "body": [
5 | {
6 | "identifier": "delete",
7 | "description": "This workflow is used by the Admin UI to retract all publications of an event upon deletion",
8 | "title": "Delete",
9 | "tags": [
10 | "delete"
11 | ]
12 | },
13 | {
14 | "identifier": "placeholdervideo",
15 | "description": "\n Delete all media related to this event, keeping the metadata and publishing a placeholder video instead.\n The original media will be unrecoverable.\n ",
16 | "title": "Delete event, publish a placeholder instead",
17 | "tags": [
18 | "archive",
19 | "editor"
20 | ]
21 | },
22 | {
23 | "identifier": "duplicate-event",
24 | "description": "",
25 | "title": "Duplicate Event",
26 | "tags": [
27 | "archive"
28 | ]
29 | },
30 | {
31 | "identifier": "fasthls",
32 | "description": "\n A minimal workflow that transcodes the media into serverless HLS distribution formats, then\n sends the resulting distribution files, along with their associated metadata,\n to the distribution channels.\n ",
33 | "title": "Fast HLS Testing Workflow",
34 | "tags": [
35 | "schedule",
36 | "upload"
37 | ]
38 | },
39 | {
40 | "identifier": "fast",
41 | "description": "\n A minimal workflow that transcodes the media into distribution formats, then\n sends the resulting distribution files, along with their associated metadata,\n to the distribution channels.\n ",
42 | "title": "Fast Testing Workflow",
43 | "tags": [
44 | "schedule",
45 | "upload"
46 | ]
47 | },
48 | {
49 | "identifier": "import",
50 | "description": "\n A minimal Workflow that only publishes a Mediapackage\n ",
51 | "title": "Import Mediapackage and Publish without reencode",
52 | "tags": []
53 | },
54 | {
55 | "identifier": "schedule-and-upload",
56 | "description": "\n A complex workflow, showcasing most of Opencast's features.\n ",
57 | "title": "Process upon upload and schedule",
58 | "tags": [
59 | "schedule",
60 | "upload"
61 | ]
62 | },
63 | {
64 | "identifier": "publish",
65 | "description": "",
66 | "title": "Publish",
67 | "tags": [
68 | "archive"
69 | ]
70 | },
71 | {
72 | "identifier": "publish-after-cutting",
73 | "description": "\n Process and publish media.\n ",
74 | "title": "Publish",
75 | "tags": [
76 | "editor"
77 | ]
78 | },
79 | {
80 | "identifier": "publish-uploaded-assets",
81 | "description": "Publish uploaded assets",
82 | "title": "Publish uploaded assets",
83 | "tags": []
84 | },
85 | {
86 | "identifier": "republish-metadata",
87 | "description": "",
88 | "title": "Republish metadata",
89 | "tags": [
90 | "archive"
91 | ]
92 | },
93 | {
94 | "identifier": "retract",
95 | "description": "Retract a recording",
96 | "title": "Retract",
97 | "tags": [
98 | "archive"
99 | ]
100 | },
101 | {
102 | "identifier": "studio-upload",
103 | "description": "\n A simple and fast workflow for publishing videos created by Opencast Studio.\n ",
104 | "title": "Studio Upload",
105 | "tags": [
106 | "archive",
107 | "upload"
108 | ]
109 | },
110 | {
111 | "identifier": "update-previews",
112 | "description": "\n Update or create the preview video, the waveforms and the thumbnails\n on the internal publication channel for use by the video editor.\n ",
113 | "title": "Update editor previews",
114 | "tags": [
115 | "archive"
116 | ]
117 | }
118 | ]
119 | }
--------------------------------------------------------------------------------
/tests/fixtures/api_calls/get/api_workflow_definitions_api.json:
--------------------------------------------------------------------------------
1 | {
2 | "resource": "/api/workflow-definitions?filter=tag:api",
3 | "status": 200,
4 | "body": [
5 | {
6 | "identifier": "republish-metadata-and-captions",
7 | "operations": [
8 | {
9 | "configuration": {
10 | "source-tags": "archive"
11 | },
12 | "unless": "",
13 | "max_attempts": 1,
14 | "description": "Archive current captions",
15 | "operation": "snapshot",
16 | "if": "",
17 | "fail_workflow_on_error": true,
18 | "retry_strategy": "none",
19 | "error_handler_workflow": ""
20 | },
21 | {
22 | "configuration": {
23 | "source-flavors": "captions/*",
24 | "target-tags": "+archive"
25 | },
26 | "unless": "",
27 | "max_attempts": 1,
28 | "description": "Tagging Captions",
29 | "operation": "tag",
30 | "if": "",
31 | "fail_workflow_on_error": true,
32 | "retry_strategy": "none",
33 | "error_handler_workflow": ""
34 | },
35 | {
36 | "configuration": {
37 | "source-tags": "archive"
38 | },
39 | "unless": "",
40 | "max_attempts": 1,
41 | "description": "Archive current captions",
42 | "operation": "snapshot",
43 | "if": "",
44 | "fail_workflow_on_error": true,
45 | "retry_strategy": "none",
46 | "error_handler_workflow": ""
47 | },
48 | {
49 | "configuration": {
50 | "merge-force-flavors": "dublincore/*,security/*,captions/*",
51 | "strategy": "merge",
52 | "download-source-flavors": "dublincore/*,security/*,captions/*",
53 | "check-availability": "false"
54 | },
55 | "unless": "",
56 | "max_attempts": 1,
57 | "description": "Update recording in Opencast Media Module",
58 | "operation": "publish-engage",
59 | "if": "",
60 | "fail_workflow_on_error": true,
61 | "retry_strategy": "none",
62 | "error_handler_workflow": "partial-error"
63 | },
64 | {
65 | "configuration": {
66 | "preserve-flavors": "security/*",
67 | "delete-external": "true"
68 | },
69 | "unless": "",
70 | "max_attempts": 1,
71 | "description": "Remove temporary processing artifacts",
72 | "operation": "cleanup",
73 | "if": "",
74 | "fail_workflow_on_error": false,
75 | "retry_strategy": "none",
76 | "error_handler_workflow": ""
77 | }
78 | ],
79 | "configuration_panel": "",
80 | "description": "",
81 | "title": "Republish metadata and captions",
82 | "tags": [
83 | "api"
84 | ]
85 | }
86 | ]
87 | }
--------------------------------------------------------------------------------
/tests/fixtures/api_calls/get/api_workflow_definitions_archive.json:
--------------------------------------------------------------------------------
1 | {
2 | "resource": "/api/workflow-definitions?filter=tag:archive",
3 | "status": 200,
4 | "body": [
5 | {
6 | "identifier": "duplicate-event",
7 | "description": "",
8 | "title": "Duplicate Event",
9 | "tags": [
10 | "archive"
11 | ]
12 | },
13 | {
14 | "identifier": "publish",
15 | "description": "",
16 | "title": "Publish",
17 | "tags": [
18 | "archive"
19 | ]
20 | },
21 | {
22 | "identifier": "republish-metadata",
23 | "description": "",
24 | "title": "Republish metadata",
25 | "tags": [
26 | "archive"
27 | ]
28 | },
29 | {
30 | "identifier": "retract",
31 | "description": "Retract a recording",
32 | "title": "Retract",
33 | "tags": [
34 | "archive"
35 | ]
36 | }
37 | ]
38 | }
--------------------------------------------------------------------------------
/tests/fixtures/api_calls/get/api_workflow_definitions_delete.json:
--------------------------------------------------------------------------------
1 | {
2 | "resource": "/api/workflow-definitions?filter=tag:delete",
3 | "status": 200,
4 | "body": [
5 | {
6 | "identifier": "delete",
7 | "description": "This workflow is used by the Admin UI to retract all publications of an event upon deletion",
8 | "title": "Delete",
9 | "tags": [
10 | "delete"
11 | ]
12 | }
13 | ]
14 | }
--------------------------------------------------------------------------------
/tests/fixtures/api_calls/get/api_workflow_definitions_upload.json:
--------------------------------------------------------------------------------
1 | {
2 | "resource": "/api/workflow-definitions?filter=tag:upload",
3 | "status": 200,
4 | "body": [
5 | {
6 | "identifier": "fasthls",
7 | "description": "\n A minimal workflow that transcodes the media into serverless HLS distribution formats, then\n sends the resulting distribution files, along with their associated metadata,\n to the distribution channels.\n ",
8 | "title": "Fast HLS Testing Workflow",
9 | "tags": [
10 | "schedule",
11 | "upload"
12 | ]
13 | },
14 | {
15 | "identifier": "fast",
16 | "description": "\n A minimal workflow that transcodes the media into distribution formats, then\n sends the resulting distribution files, along with their associated metadata,\n to the distribution channels.\n ",
17 | "title": "Fast Testing Workflow",
18 | "tags": [
19 | "schedule",
20 | "upload"
21 | ]
22 | },
23 | {
24 | "identifier": "schedule-and-upload",
25 | "description": "\n A complex workflow, showcasing most of Opencast's features.\n ",
26 | "title": "Process upon upload and schedule",
27 | "tags": [
28 | "schedule",
29 | "upload"
30 | ]
31 | },
32 | {
33 | "identifier": "studio-upload",
34 | "description": "\n A simple and fast workflow for publishing videos created by Opencast Studio.\n ",
35 | "title": "Studio Upload",
36 | "tags": [
37 | "archive",
38 | "upload"
39 | ]
40 | }
41 | ]
42 | }
--------------------------------------------------------------------------------
/tests/fixtures/api_calls/get/api_workflow_import_duplicate_with_workflowid.json:
--------------------------------------------------------------------------------
1 | {
2 | "resource": "/api/workflows/1119?withoperations=false&withconfiguration=true",
3 | "body": {
4 | "workflow_definition_identifier": "duplicate-event",
5 | "identifier": 1119,
6 | "creator": "admin",
7 | "configuration": {
8 | "mpTitle": "Test video",
9 | "startDateTime": "2023-04-24T10:55:31Z",
10 | "duplicate_media_package_1_id": "45fca7d0-c1e2-4601-bf12-6ccb3376a5f6",
11 | "noCopySuffix": "false",
12 | "duplicate_media_package_ids": "45fca7d0-c1e2-4601-bf12-6ccb3376a5f6",
13 | "seriesId": "84bab8de-5688-46a1-9af0-5ce9122eeb6a",
14 | "numberOfEvents": "1"
15 | },
16 | "description": "",
17 | "state": "running",
18 | "title": "Duplicate Event",
19 | "event_identifier": "45fca7d0-c1e2-4601-bf12-6ccb3376a5f6"
20 | }
21 | }
--------------------------------------------------------------------------------
/tests/fixtures/api_calls/get/init_api_workflow_definitions_duplicate_event.json:
--------------------------------------------------------------------------------
1 | {
2 | "resource": "/api/workflow-definitions/duplicate-event?withoperations=false&withconfigurationpanel=true&withconfigurationpaneljson=false",
3 | "status": 200,
4 | "body": {
5 | "identifier": "duplicate-event",
6 | "configuration_panel": "\n \n \n
\n 47\"\n oninput=\"checkValueInBounds()\"\n min=\"1\"\n value=\"1\"\n max=\"25\"\n \/>\n Number of Events<\/label>\n <\/fieldset>\n <\/div>\n\n