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,15 +102,21 @@ public class EntityPublicationCountRequestHandler implements
|
|||
|
||||
Entity entity = queryManager.getQueryResult();
|
||||
|
||||
QueryRunner<Map<String, Set<String>>> queryManagerForsubOrganisationTypes = new EntitySubOrganizationTypesQueryRunner(
|
||||
staffProvidedHighestLevelOrganization, dataSource, log);
|
||||
|
||||
Map<String, Set<String>> subOrganizationTypesResult = queryManagerForsubOrganisationTypes
|
||||
.getQueryResult();
|
||||
|
||||
return prepareStandaloneResponse(vitroRequest, entity, staffProvidedHighestLevelOrganization,
|
||||
subOrganizationTypesResult);
|
||||
|
||||
if(entity.getEntityLabel().equals("no-label")){
|
||||
|
||||
return prepareStandaloneErrorResponse(vitroRequest,staffProvidedHighestLevelOrganization);
|
||||
|
||||
} else {
|
||||
|
||||
QueryRunner<Map<String, Set<String>>> queryManagerForsubOrganisationTypes = new EntitySubOrganizationTypesQueryRunner(
|
||||
staffProvidedHighestLevelOrganization, dataSource, log);
|
||||
|
||||
Map<String, Set<String>> subOrganizationTypesResult = queryManagerForsubOrganisationTypes
|
||||
.getQueryResult();
|
||||
|
||||
return prepareStandaloneResponse(vitroRequest, entity, staffProvidedHighestLevelOrganization,
|
||||
subOrganizationTypesResult);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -147,14 +153,21 @@ public class EntityPublicationCountRequestHandler implements
|
|||
|
||||
Entity entity = queryManager.getQueryResult();
|
||||
|
||||
QueryRunner<Map<String, Set<String>>> queryManagerForsubOrganisationTypes = new EntitySubOrganizationTypesQueryRunner(
|
||||
highestLevelOrgURI, dataSource, log);
|
||||
if(entity.getEntityLabel().equals("no-label")){
|
||||
|
||||
return prepareStandaloneErrorResponse(vitroRequest,highestLevelOrgURI);
|
||||
|
||||
} else {
|
||||
|
||||
Map<String, Set<String>> subOrganizationTypesResult = queryManagerForsubOrganisationTypes
|
||||
.getQueryResult();
|
||||
|
||||
return prepareStandaloneResponse(vitroRequest, entity, highestLevelOrgURI,
|
||||
subOrganizationTypesResult);
|
||||
QueryRunner<Map<String, Set<String>>> queryManagerForsubOrganisationTypes = new EntitySubOrganizationTypesQueryRunner(
|
||||
highestLevelOrgURI, dataSource, log);
|
||||
|
||||
Map<String, Set<String>> subOrganizationTypesResult = queryManagerForsubOrganisationTypes
|
||||
.getQueryResult();
|
||||
|
||||
return prepareStandaloneResponse(vitroRequest, entity, highestLevelOrgURI,
|
||||
subOrganizationTypesResult);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue