Issue 10532

registry-service Manager should filter out by type of Agent

10532
Reporter: jcuadra
Assignee: kbraak
Type: Improvement
Summary: registry-service Manager should filter out by type of Agent
Priority: Minor
Resolution: Fixed
Status: Closed
Created: 2011-12-14 14:46:01.989
Updated: 2013-12-16 17:50:36.31
Resolved: 2012-01-04 17:27:05.478
        
Description: the registry-service Managers are using the AgentManager to get their respective entities. But AgentManager sometimes returns unfiltered agents, which might be exposed to the web service layer in case of erroneous data.

Example:

NodeService (registry-service) calls agentManager.listRelatedAgents() which returns all relationships of a given type (in this case, should return organizations endorsed by a given nodeKey). But nowhere in the mappers or the service methods we make sure the entities returned are in fact Organizations (agent_type=2). We should check this in the registry-service's service methods. ]]>
    


Author: kbraak@gbif.org
Comment: This changeset actually relates to this issue: http://dev.gbif.org/code/changelog/gbif-registry?cs=1932
Created: 2012-01-03 14:59:08.514
Updated: 2012-01-03 14:59:08.514


Author: kbraak@gbif.org
Created: 2012-01-04 10:43:43.714
Updated: 2012-01-04 10:43:43.714
        
The latest work adds functionality to each of the dataset, organization, and node factories to filter by the type of agent.

Now, what I am working on is on ensuring not found exceptions are handled properly by the ws and ws-client. 
    


Author: kbraak@gbif.org
Created: 2012-01-04 17:24:27.804
Updated: 2012-01-04 17:24:27.804
        
Not found exceptions returned by the ws are intercepted by the ws-client, converted to null, checked-for in the portal, and if encountered thrown as a NotFoundException which results in a pleasant Page Not Found message. This is working, try this URL with the UUID of a valid agent (organization)

http://localhost:9999/dataset/7879e569-4a13-4643-b833-d1a564675b86




    


Author: kbraak@gbif.org
Comment: Filters agent type, ensures 404s are properly handled also by ws and ws-client for dataset, organization, and node services. Resolved. 
Created: 2012-01-04 17:27:05.499
Updated: 2012-01-04 17:27:05.499