fix creation of faux property with xml literal range value (#363)

Co-authored-by: Georgy Litvinov <georgy.litvinov@tib.eu>
This commit is contained in:
Georgy Litvinov 2023-02-09 16:25:36 +01:00 committed by GitHub
parent 1976185a91
commit 4ce6dc2f8c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -91,6 +91,7 @@ public class FauxPropertyRetryController extends BaseEditController {
private static class EpoPopulator {
private static final String LITERAL = "http://www.w3.org/2000/01/rdf-schema#Literal";
private static final String XML_LITERAL = "http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral";
private final VitroRequest req;
private final ServletContext ctx;
private final WebappDaoFactory wadf;
@ -335,11 +336,22 @@ public class FauxPropertyRetryController extends BaseEditController {
option.setBody("Literal");
option.setSelected(true);
list.add(option);
} else if (rangeUri.equals(XML_LITERAL)) {
Option option = new Option();
option.setValue(rangeUri);
option.setBody("XML Literal");
option.setSelected(true);
list.add(option);
} else {
Datatype dataType = wadf.getDatatypeDao().getDatatypeByURI(rangeUri);
Option option = new Option();
option.setValue(dataType.getUri());
option.setBody(dataType.getName());
if (dataType != null) {
option.setValue(dataType.getUri());
option.setBody(dataType.getName());
} else {
option.setValue(rangeUri);
option.setBody(rangeUri);
}
option.setSelected(true);
list.add(option);
}