NIHVIVO-1681 -- Made changes to EntityPubCountRequestHandler for graceful degradation of the vis incase the highest level org contains no pubs/grants.
This commit is contained in:
parent
9b3ce6ecd5
commit
b1f72c276f
1 changed files with 29 additions and 16 deletions
|
@ -102,6 +102,12 @@ public class EntityPublicationCountRequestHandler implements
|
||||||
|
|
||||||
Entity entity = queryManager.getQueryResult();
|
Entity entity = queryManager.getQueryResult();
|
||||||
|
|
||||||
|
if(entity.getEntityLabel().equals("no-label")){
|
||||||
|
|
||||||
|
return prepareStandaloneErrorResponse(vitroRequest,staffProvidedHighestLevelOrganization);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
QueryRunner<Map<String, Set<String>>> queryManagerForsubOrganisationTypes = new EntitySubOrganizationTypesQueryRunner(
|
QueryRunner<Map<String, Set<String>>> queryManagerForsubOrganisationTypes = new EntitySubOrganizationTypesQueryRunner(
|
||||||
staffProvidedHighestLevelOrganization, dataSource, log);
|
staffProvidedHighestLevelOrganization, dataSource, log);
|
||||||
|
|
||||||
|
@ -110,7 +116,7 @@ public class EntityPublicationCountRequestHandler implements
|
||||||
|
|
||||||
return prepareStandaloneResponse(vitroRequest, entity, staffProvidedHighestLevelOrganization,
|
return prepareStandaloneResponse(vitroRequest, entity, staffProvidedHighestLevelOrganization,
|
||||||
subOrganizationTypesResult);
|
subOrganizationTypesResult);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -147,6 +153,12 @@ public class EntityPublicationCountRequestHandler implements
|
||||||
|
|
||||||
Entity entity = queryManager.getQueryResult();
|
Entity entity = queryManager.getQueryResult();
|
||||||
|
|
||||||
|
if(entity.getEntityLabel().equals("no-label")){
|
||||||
|
|
||||||
|
return prepareStandaloneErrorResponse(vitroRequest,highestLevelOrgURI);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
QueryRunner<Map<String, Set<String>>> queryManagerForsubOrganisationTypes = new EntitySubOrganizationTypesQueryRunner(
|
QueryRunner<Map<String, Set<String>>> queryManagerForsubOrganisationTypes = new EntitySubOrganizationTypesQueryRunner(
|
||||||
highestLevelOrgURI, dataSource, log);
|
highestLevelOrgURI, dataSource, log);
|
||||||
|
|
||||||
|
@ -156,6 +168,7 @@ public class EntityPublicationCountRequestHandler implements
|
||||||
return prepareStandaloneResponse(vitroRequest, entity, highestLevelOrgURI,
|
return prepareStandaloneResponse(vitroRequest, entity, highestLevelOrgURI,
|
||||||
subOrganizationTypesResult);
|
subOrganizationTypesResult);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue