diff -r 009efee954f7 -r 17f10b56c079 server/src/app/Models/WebResourceManager.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/server/src/app/Models/WebResourceManager.php Thu Jun 02 18:24:19 2016 +0200 @@ -0,0 +1,35 @@ +getLiteral("dc11:format"); + $format = is_null($formatLit)?null:$formatLit->getValue(); + if(is_null($format)) { + throw new ModelsException("WebResourceManager: No dc:11 format on web resource"); + } + + if(0 === strpos($format, 'audio/') || + 0 === strpos($format, 'video/') || + 0 === strpos($format, 'Sampling:') ) { + return new MediaResource(...$args); + } else if( + 0 === strpos($format, 'application/xml') || + 0 === strpos($format, 'application/pdf') ) { + return new TranscriptResource(...$args); + } + else { + throw new ModelsException("WebResourceManager: unknown format"); + } + + } + +} \ No newline at end of file