diff options
author | Jarle Bjørgeengen <jarle@bjorgeengen.net> | 2010-01-05 21:12:58 +0000 |
---|---|---|
committer | Jarle Bjørgeengen <jarle@bjorgeengen.net> | 2010-01-05 21:12:58 +0000 |
commit | d37cce5a72832aaa6f23e3613b35431af7fa9eb8 (patch) | |
tree | 4867c094648df09e6aefca3977360e8b15d04a0b | |
parent | 159a033f82d558d94c5b5ccc3c0179389247ae74 (diff) |
Added ability to get videolist based on organization
-rwxr-xr-x | frikanalen/cgi-bin/frontpage.cgi | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/frikanalen/cgi-bin/frontpage.cgi b/frikanalen/cgi-bin/frontpage.cgi index 9935145..70d3a2e 100755 --- a/frikanalen/cgi-bin/frontpage.cgi +++ b/frikanalen/cgi-bin/frontpage.cgi @@ -23,6 +23,7 @@ my $query = new CGI; my $nuug_frikanalen_url = 'http://www.nuug.no/pub/video/frikanalen/'; my $scripturl = url(); my $category = $query->param("category"); +my $organization = $query->param("organization"); my $cat = $category ? "category=$category" : ""; my $sort = $query->param("sort"); my $sor = $sort ? "sort=$sort" : ""; @@ -79,13 +80,15 @@ sub get_categories { sub searchvids { # Returnerer referanse med "array of hashrefs". Hashref inneholder metadata og urler # til videoer. Bruk Dumper til å titte på. + my $category = shift; + my $organization = shift; my $returndata ; my $res; my $obj; my $soap = new SOAP::Lite -> uri('http://localhost/CommunitySiteService') -> proxy('http://communitysite1.frikanalen.tv/CommunitySiteFacade/CommunitySiteService.asmx'); - if ($category) { + if ($category ) { $obj = $soap->SearchVideos( SOAP::Data->name('searcher' => { 'PredefinedSearchType' => $searchtype, @@ -94,6 +97,14 @@ sub searchvids { } ) ); + } elsif ($organization) { + $obj = $soap->SearchVideos( + SOAP::Data->name('searcher' => { + 'Organization' => $organization, + 'Take' => 10000, + } + ) + ); } else { $obj = $soap->SearchVideos( SOAP::Data->name('searcher' => { @@ -187,7 +198,7 @@ EOF sub printbody { # Returnerer kroppen til htmltabellen. Innholdet er avhengig av $category - my $videos = &searchvids($category); + my $videos = &searchvids($category,$organization); $video_count = (@{$videos}); # print Dumper($videos); print "<div id=\"videos\">\n"; @@ -284,7 +295,7 @@ sub videosort { sub generate_rss { print_rss_header(); - my $videos = &searchvids($category); + my $videos = &searchvids($category,$organization); foreach my $video ( sort videosort @{$videos} ) { my $id = $video->{'MetaDataVideoId'}; |