* DSpaceValidity object.
*/
public SourceValidity getValidity() {
if (this.validity == null) {
try {
DSpaceValidity validity = new DSpaceValidity();
DSpaceObject scope = getScope();
validity.add(scope);
performSearch(scope);
List<DSpaceObject> results = this.queryResults.getDspaceObjects();
if (results != null) {
validity.add("total:"+this.queryResults.getTotalSearchResults());
validity.add("start:"+this.queryResults.getStart());
validity.add("size:" + results.size());
for (DSpaceObject dso : results) {
validity.add(dso);
}
}
Map<String, List<DiscoverResult.FacetResult>> facetResults = this.queryResults.getFacetResults();
for(String facetField : facetResults.keySet()){
List<DiscoverResult.FacetResult> facetValues = facetResults.get(facetField);
for (DiscoverResult.FacetResult facetResult : facetValues)
{
validity.add(facetField + facetResult.getAsFilterQuery() + facetResult.getCount());
}
}
this.validity = validity.complete();
} catch (RuntimeException re) {
throw re;
}
catch (Exception e) {
this.validity = null;