On 04/02/2012 11:14 AM, Duncan Mac-Vicar P. wrote:

Hi guys,

I was trying to add a small icon in one errata page, showing if an
errata requires a reboot later.

Ok, I am getting more familiar with the DataSource and SelectMode stuff (what a framework you have in there :-) )

One possible solution is to do it at the SQL level: adding the column as a sub-query. This is not very "portable" across distros but seems to be a good solution:

SELECT DISTINCT E.id,
                                E.advisory_name AS advisory,
                E.update_date AS update_date,
                E.synopsis AS advisory_synopsis,
                E.advisory_type AS advisory_type,
(SELECT CASE WHEN (SELECT TRUE FROM rhnErrataKeyword EK WHERE EK.keyword LIKE '%reboot_suggested%'AND EK.errata_id=E.id) IS NULL THEN FALSE ELSE TRUE END) AS reboot_suggested
  FROM rhnErrata E,
       rhnChannelErrata CE
 WHERE CE.channel_id = cid
   AND CE.errata_id = E.id

Another solution, that is more consistent with the methods like ErrataOverview.isProductEnhancement() would be to have the SQL add a comma joined version of the keywords and then have the logic in ErrataOverview for isRebootSuggested() (I assume it is not possible to have them fetched as a collection into the dto)

I still haven't figured out the "Elaborators" part of the framework, but I would like to hear what sounds a better approach to you.

--
Duncan Mac-Vicar P. - http://www.suse.com/

SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg)
Maxfeldstraße 5, 90409 Nürnberg, Germany

_______________________________________________
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel

Reply via email to