Skip to content

Commit de936d1

Browse files
angepasste Metadatenauswahlliste
1 parent 671c552 commit de936d1

File tree

2 files changed

+28
-5
lines changed

2 files changed

+28
-5
lines changed

classes/ArticleIndexHelper.php

+27-4
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,30 @@ private function buildCollectionArray($sources)
5151
foreach ($collections as $collection) {
5252
$selection = isset($collection['usedBy']);
5353
$prohibited = isset($collection['usageProhibitedBy']);
54+
$accessDenied = false;
55+
$disableCheckbox = false;
56+
if(isset($collection['isRestricted']) && $collection['isRestricted'] == 'http://vocab.ub.uni-leipzig.de/amsl/Yes'){
57+
$accessDenied = true;
58+
$disableCheckbox = true;
59+
}
60+
if($prohibited || $accessDenied){
61+
$disableCheckbox = true;
62+
}
63+
$permitted = false;
64+
if(isset($collection['permittedForLibrary']) && $collection['permittedForLibrary'] == 'http://lobid.org/organisation/DE-15'){
65+
$permitted = true;
66+
}
67+
68+
$usage_note = '';
69+
if($accessDenied && $permitted){
70+
$usage_note = '</br><b> -> you need to contact your admin to select/deselect this collection</b>';
71+
}
5472
$resultArray['children'][] = array(
55-
"title" => isset($collection['label']) ? $collection['label'] : $collection['collection'],
73+
"title" => isset($collection['label']) ? $collection['label'] . $usage_note : $collection['collection'] . $usage_note,
5674
"selected" => $selection,
57-
"hideCheckbox" => $prohibited,
75+
"hideCheckbox" => $disableCheckbox,
76+
"accessDenied" => $accessDenied,
77+
"permitted" => $permitted,
5878
"data" => array("collection" => $collection['collection']));
5979
}
6080
}
@@ -84,15 +104,18 @@ public function queryMetadataCollections($metadataSource)
84104
PREFIX amsl: <http://vocab.ub.uni-leipzig.de/amsl/>
85105
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
86106
87-
// SELECT ?collection ?usedBy ?label ?usageProhibitedBy WHERE {
107+
// SELECT ?collection ?usedBy ?label ?isRestricted ?permittedForLibrary WHERE {
88108
?collection a amsl:MetadataCollection .
89109
?collection amsl:includedInMetadataSource <" . $metadataSource . "> .
90110
?collection rdfs:label ?label
91111
OPTIONAL {
92112
?collection amsl:metadataUsedByLibrary ?usedBy . FILTER (?usedBy = <" . $membership . ">)
93113
}
94114
OPTIONAL {
95-
?collection amsl:metadataUsageProhibited ?usageProhibitedBy . FILTER (?usageProhibitedBy = <" . $membership . ">)
115+
?collection amsl:metadataUsageRestricted ?isRestricted .
116+
}
117+
OPTIONAL {
118+
?collection amsl:metadataUsagePermittedForLibrary ?permittedForLibrary . FILTER (?permittedForLibrary = <" . $membership . ">)
96119
}
97120
}";
98121
$result = $this->_model->sparqlQuery($query);

doap.n3

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
owconfig:config [
2222
a owconfig:Config;
2323
owconfig:id "statements";
24-
:discoveryIndex "http://localhost/OntoWiki/Discovery/";
24+
:discoveryIndex "http://amsl.technology/discovery/metadata-usage/";
2525
] ;
2626
doap:release :v1-0 .
2727
:v1-0 a doap:Version ;

0 commit comments

Comments
 (0)