use of org.exist.security.EXistSchemaType in project exist by eXist-db.
the class GetPrincipalMetadataFunction method getPrincipalMetadata.
private Sequence getPrincipalMetadata(final Principal principal, final String metadataAttributeNamespace) {
final AXSchemaType axSchemaType = AXSchemaType.valueOfNamespace(metadataAttributeNamespace);
String metadataValue = null;
if (axSchemaType != null) {
metadataValue = principal.getMetadataValue(axSchemaType);
} else {
final EXistSchemaType exSchemaType = EXistSchemaType.valueOfNamespace(metadataAttributeNamespace);
if (exSchemaType != null) {
metadataValue = principal.getMetadataValue(exSchemaType);
}
}
if (metadataValue == null || metadataValue.isEmpty()) {
return Sequence.EMPTY_SEQUENCE;
} else {
return new StringValue(metadataValue);
}
}
Aggregations