diff --git a/SIS/clarin/model/centre.xqm b/SIS/clarin/model/centre.xqm index 3d3a9288..cabe66f7 100644 --- a/SIS/clarin/model/centre.xqm +++ b/SIS/clarin/model/centre.xqm @@ -28,3 +28,15 @@ let $flat := return fn:distinct-values($flat) }; + +declare function centre:get-centre-by-research-infrastructure($ri as xs:string, + $status as xs:string){ + for $c in $centre:centres[nodeInfo/ri=$ri] + let $c-status := $c/nodeInfo/ri/@status + return + if (contains($c-status,$status)) + then $c + else () + + +}; diff --git a/SIS/clarin/modules/centre.xql b/SIS/clarin/modules/centre.xql index 7bde75f9..f3a6451e 100644 --- a/SIS/clarin/modules/centre.xql +++ b/SIS/clarin/modules/centre.xql @@ -16,6 +16,23 @@ declare function cm:get-centre($id) { centre:get-centre($id) }; +declare function cm:get-centre-by-research-infrastructure($ri as xs:string, $status as xs:string) { + centre:get-centre-by-research-infrastructure($ri,$status) +}; + +declare function cm:count-number-of-centres-with-recommendations($centres){ + let $centre-with-recommendations := + for $c in $centres + let $recommendations := cm:get-recommendations(data($c/@id)) + let $numOfRecommendations := count($recommendations/formats/format) + return + if ($numOfRecommendations >0) + then 1 + else 0 + + return sum($centre-with-recommendations) +}; + declare function cm:getLastUpdateCommitId($id){ let $recommendation := recommendation:get-recommendations-for-centre($id) let $commitId := $recommendation/header/lastUpdateCommitID/text() diff --git a/SIS/clarin/resources/css/style.css b/SIS/clarin/resources/css/style.css index 94027a20..1d2ea444 100644 --- a/SIS/clarin/resources/css/style.css +++ b/SIS/clarin/resources/css/style.css @@ -6,6 +6,7 @@ body { color:#333; font-family:helvetica,arial,sans-serif; font-size:13px; + line-height:1.4; } div#all { @@ -55,6 +56,10 @@ ul.column { column-gap: 20px; } +li{ + margin-bottom:5px; +} + .button{ margin-top:5px; border: 1px #CCCCCC solid; @@ -262,6 +267,12 @@ th { border-bottom-color:black; } +.column{ + border: 1px solid lightgrey; + padding:5px; + vertical-align:top; +} + .row{ border-bottom:1px solid #DDDDDD; text-align:left; diff --git a/SIS/clarin/views/kpi.xq b/SIS/clarin/views/kpi.xq index f533f6f0..c837fd22 100644 --- a/SIS/clarin/views/kpi.xq +++ b/SIS/clarin/views/kpi.xq @@ -5,96 +5,110 @@ declare option exist:serialize "method=xhtml media-type=text/html indent=yes doc import module namespace menu = "http://clarin.ids-mannheim.de/standards/menu" at "../modules/menu.xql"; import module namespace app = "http://clarin.ids-mannheim.de/standards/app" at "../modules/app.xql"; -import module namespace stm = "http://clarin.ids-mannheim.de/standards/statistics-module" at "../modules/statistics.xql"; -import module namespace format = "http://clarin.ids-mannheim.de/standards/format" at "../model/format.xqm"; -import module namespace domain = "http://clarin.ids-mannheim.de/standards/domain" at "../model/domain.xqm"; import module namespace cm = "http://clarin.ids-mannheim.de/standards/centre-module" at "../modules/centre.xql"; -import module namespace rf = "http://clarin.ids-mannheim.de/standards/recommended-formats" at "../modules/recommended-formats.xql"; (: - @author margaretha + @author margaretha, banski :) -let $reset := request:get-parameter('reset', '') -let $threshold := if ($reset) then (1) else request:get-parameter('threshold', 1) -let $top3 := if ($reset) then () else request:get-parameter('top3', '') -return - +let $B-centres := cm:get-centre-by-research-infrastructure("CLARIN","B-centre") +let $numOfBCentres := fn:count($B-centres) +let $numOfBCentresWithRecommendations := cm:count-number-of-centres-with-recommendations($B-centres) +let $percentage := format-number($numOfBCentresWithRecommendations div $numOfBCentres,'0%') - - - Relevant CLARIN KPIs - -