VIVO-799: only display individuals with rdfs labels in custom form picklists
This commit is contained in:
parent
a086957046
commit
8fc32d28ed
4 changed files with 19 additions and 7 deletions
|
@ -24,6 +24,7 @@ public interface Individual extends ResourceBean, Comparable<Individual> {
|
||||||
* one of the labels will be returned, which one is undefined.
|
* one of the labels will be returned, which one is undefined.
|
||||||
*/
|
*/
|
||||||
String getRdfsLabel();
|
String getRdfsLabel();
|
||||||
|
void setRdfsLabel(String in);
|
||||||
|
|
||||||
String getVClassURI();
|
String getVClassURI();
|
||||||
void setVClassURI(String in);
|
void setVClassURI(String in);
|
||||||
|
|
|
@ -345,6 +345,11 @@ public class IndividualFiltering implements Individual {
|
||||||
_innerIndividual.setName(in);
|
_innerIndividual.setName(in);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setRdfsLabel(String in) {
|
||||||
|
_innerIndividual.setRdfsLabel(in);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setNamespace(String namespace) {
|
public void setNamespace(String namespace) {
|
||||||
_innerIndividual.setNamespace(namespace);
|
_innerIndividual.setNamespace(namespace);
|
||||||
|
|
|
@ -278,6 +278,7 @@ public class IndividualDaoSDB extends IndividualDaoJena {
|
||||||
this.dwf, datasetMode, wadf,
|
this.dwf, datasetMode, wadf,
|
||||||
SKIP_INITIALIZATION);
|
SKIP_INITIALIZATION);
|
||||||
ent.setName(label);
|
ent.setName(label);
|
||||||
|
ent.setRdfsLabel(label);
|
||||||
return ent;
|
return ent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -129,7 +129,11 @@ public class IndividualsViaObjectPropetyOptions implements FieldOptions {
|
||||||
for (Individual ind : individuals) {
|
for (Individual ind : individuals) {
|
||||||
String uri = ind.getURI();
|
String uri = ind.getURI();
|
||||||
if (uri != null) {
|
if (uri != null) {
|
||||||
String label = ind.getName().trim();
|
// The picklist should only display individuals with rdfs labels.
|
||||||
|
// SO changing the following line -- tlw72
|
||||||
|
// String label = ind.getName().trim();
|
||||||
|
String label = ind.getRdfsLabel();
|
||||||
|
if ( label != null ) {
|
||||||
List<String> msTypes = ind.getMostSpecificTypeURIs();
|
List<String> msTypes = ind.getMostSpecificTypeURIs();
|
||||||
if ( hasSubclasses && msTypes.size() > 0 ) {
|
if ( hasSubclasses && msTypes.size() > 0 ) {
|
||||||
label += " (" + getMsTypeLocalName(msTypes.get(0), wDaoFact) + ")";
|
label += " (" + getMsTypeLocalName(msTypes.get(0), wDaoFact) + ")";
|
||||||
|
@ -138,6 +142,7 @@ public class IndividualsViaObjectPropetyOptions implements FieldOptions {
|
||||||
++optionsCount;
|
++optionsCount;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return optionsMap;
|
return optionsMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue