Genetic Details Page / Deciphering Audit trail

LabKey Support Forum (Inactive)
Genetic Details Page / Deciphering Audit trail Ben Bimber  2011-01-21 06:57
Status: Closed
 
The EHR has datasets, lists and 2 external schemas exposed through the module. The hard tables don't have a default details page and I'd like to make a generic one. Datasets also dont have a default details page, but we've been using detailsQueryRow.view, which is a pretty generic page I think Kevin made.

There are cases where we need to supplement the details page on a dataset with other info. For example, the detail page might show the usual table of the row's values, then load one or more QWPs showing records from other tables.

The other requirement I'd like to add to all our details pages that is not currently present is a link to show the audit history of that record.

Wherever possible, I'd like to take advantage of functionality in the core, rather than write our own. The questions are:

1. I can probably make an HTML page where I make an Ext AJAX request to load detailsQueryRow.view into a DIV, then add other QWPs below. That is the only core labkey functionality I can find to take advantage of to help with the details pages.

2. Is there any sort of central way to obtain an audit trail? I barely see these exposed anywhere in labkey, so if not, could anyone point me to how I might construct the link to provide the audit history for:

-dataset record
-list record
-hard table record (these might not even be audited)

3. is there anything i'm missing that would help this process?

Thanks for the help.
 
 
Ben Bimber responded:  2011-01-21 07:12
one follow up:

detailsQueryRow appears to work on all types of queries; however, different queries have different names for their PK (at least with hard tables). I might suggest that instead of using the name of the PK field in the URL (ie. lsid, rowId, etc), support a generic URL param name like 'pk', 'key', etc. it might allow

would also be useful is this supported a 'viewName' param.

finally, the following code is from queryController.java. it seems to be determining whether to display the 'edit' button. is there any sort of flag that would prevent the edit button from showing up? if i read this correctly, it checks whether the user has permissions, whether and update URL exists, and if both are true, it shows the edit button.


                if (getViewContext().hasPermission(UpdatePermission.class))
                {
                    StringExpression updateExpr = _schema.urlExpr(QueryAction.updateQueryRow, _form.getQueryDef());
                    if (updateExpr != null)
                    {
                        ActionURL updateUrl = new ActionURL(updateExpr.eval(tableForm.getTypedValues()));
                        ActionButton editButton = new ActionButton("Edit", updateUrl);
                        bb.add(editButton);
                    }
                }