Virtual GG-CE Dataviews
GG-CE includes support for the Curator Tool with existing Dataviews provided by legacy GG installation. In this ticket we extend the list of dataviews with Virtual Dataviews generated by GG-CE.
getData()
and saveData()
will test if the requested dataview name begins with ggce_
and will delegate to another service VirtualDataviewServiceImpl
.
A Virtual Dataview represents a GG-CE entity as SysDataview
. It uses ggce_${entity.class.simpleName}
naming convention (e.g. ggce_AccessionAction
).
Providing Virtual Dataviews to the Client
The SOAP client (Curator Tool) obtains a list of Dataviews available in GG by querying the get_dataview_list
dataview
SELECT sd.sys_dataview_id,
sd.dataview_name AS dataview_name,
COALESCE(sdl.title, sd.dataview_name) AS title,
COALESCE(sdl.description, sd.dataview_name) AS description,
sd.is_enabled AS is_enabled,
sd.is_readonly AS is_readonly,
COALESCE(ccl.title, sd.category_code) AS category_code,
COALESCE(dacl.title, sd.database_area_code) AS database_area_code,
sd.database_area_code_sort_order,
stf.field_name AS primary_key
FROM sys_dataview sd
...
WHERE is_enabled != 'N' AND (sd.category_code IN ('Client','Reports') OR sd.category_code LIKE 'Site%')
We need to "inject" our Virtual Dataviews into this response to expose them to the client.
Another dataview get_dataview_parameters
is used to return the list of Dataview parameters:
select
sdp.param_name,
sdp.param_type,
sdp.sort_order
from
sys_dataview_param sdp inner join sys_dataview sd
on sdp.sys_dataview_id = sd.sys_dataview_id
where
sd.dataview_name = :dataview
order by
sdp.sort_order
We need to check if the client is requesting information about one of our Virtual Dataviews with ggce_
prefix and generate the response (see below about parameters).
DataviewServiceImpl#getData()
implementation
SOAP Dataviews in GG are SQL SELECT
queries that may include joined tables. GG-CE Virtual Dataviews are a simple JPA entity queries (select a from Accession a
).
Dataviews declare a list of parameters that are of type Set<Long>
and the first parameter is for the ID field of the entity: :acccessionid
for Accession
or :cooperatorid
for Cooperator
.
The response needs to be annotated with SysDataviewFields
-- basically friendly names for columns. See DataviewServiceImpl#annotateDataview
for details. For Virtual dataviews, we will rely on our generated SysTableFields
described in #268 (closed) .
saveData()
implementation
SOAP saveData()
in VirtualDataviewServiceImpl
will not be that much different from the one in DataviewServiceImpl
-- since it already uses object access to set field values.