|
6 | 6 |
|
7 | 7 | class Config
|
8 | 8 | {
|
| 9 | + const SERVICES = [ |
| 10 | + 'org.opencastproject.external.events' => 'apievents', |
| 11 | + 'org.opencastproject.external' => 'apiseries', |
| 12 | + 'org.opencastproject.external.workflows.instances' => 'apiworkflows', |
| 13 | + 'org.opencastproject.external.playlists' => 'apiplaylists', |
| 14 | + 'org.opencastproject.capture.admin' => 'capture-admin', |
| 15 | + 'org.opencastproject.ingest' => 'ingest', |
| 16 | + 'org.opencastproject.scheduler' => 'recordings', |
| 17 | + 'org.opencastproject.engage.ui.player.redirect' => 'play', // ausser hier: engage-node |
| 18 | + 'org.opencastproject.search' => 'search', // ausser hier: engage-node |
| 19 | + 'org.opencastproject.series' => 'series', |
| 20 | + 'org.opencastproject.serviceregistry' => 'services', |
| 21 | + 'org.opencastproject.fileupload' => 'upload', |
| 22 | + 'org.opencastproject.workflow' => 'workflow', |
| 23 | + ]; |
| 24 | + |
9 | 25 | /**
|
10 | 26 | * Get the connected opencast instance version
|
11 | 27 | *
|
@@ -39,14 +55,26 @@ public static function getOCBaseVersion($config_id)
|
39 | 55 |
|
40 | 56 | public static function retrieveRESTservices($components, $match_protocol)
|
41 | 57 | {
|
42 |
| - $services = array(); |
| 58 | + $oc_services = self::SERVICES; |
| 59 | + $services = []; |
| 60 | + |
43 | 61 | foreach ($components as $service) {
|
44 |
| - if (!preg_match('/remote/', $service->type) |
45 |
| - && !preg_match('#https?://localhost.*#', $service->host) |
| 62 | + if (!preg_match('#https?://localhost.*#', $service->host) |
46 | 63 | && mb_strpos($service->host, $match_protocol) === 0
|
47 | 64 | ) {
|
48 |
| - $services[preg_replace(array("/\/docs/"), array(''), $service->host.$service->path)] |
49 |
| - = preg_replace("/\//", '', $service->path); |
| 65 | + // check if service is wanted, active and online |
| 66 | + if (isset($oc_services[$service->type]) |
| 67 | + && $service->online && $service->active |
| 68 | + ) { |
| 69 | + // TODO: check duplicate entries for same service-type |
| 70 | + $services[$service->host . $service->path] |
| 71 | + = $oc_services[$service->type]; |
| 72 | + } |
| 73 | + |
| 74 | + if ($service->path == '/admin-ng/event') { |
| 75 | + $services[$service->host . $service->path] |
| 76 | + = 'adming-ngevent'; |
| 77 | + } |
50 | 78 | }
|
51 | 79 | }
|
52 | 80 |
|
|
0 commit comments