can client-side code insert into the mothership schema?

LabKey Support Forum (Inactive)
can client-side code insert into the mothership schema? Ben Bimber  2011-03-09 08:23
Status: Closed
 
The EHR has complex client-side code. In order to capture errors, most EHR API calls use a standard error callback (EHR.utils.onError). This inserts a row into the table ehr.client_errors. It stores the page, exception, user, etc. Pretty simple idea.

However, there's already something in labkey that does this: the mothership schema. Any chance it's possible to directly insert these records there? As a general rule, I'm trying to have as few EHR-specific things as we can.

Thanks in advance.
 
 
jeckels responded:  2011-03-10 09:56
Hi Ben,

This is possible. However, we don't have any client API bindings for it and the report is required to include some information like a GUID for the server session (a unique ID generated each time the web server starts up), the server's GUID (a unique ID for a particular installation), etc. For your scenario, I think you could hard-code GUIDs for those fields. The exception reports are just POSTed to a particular URL. We'd need to get the mothership module deployed on your server to receive those requests.

Take a look at the Java class org.labkey.mothership.MothershipController.ReportExceptionAction, which is the class that receives the exception report. Also, take a look at org.labkey.api.util.MothershipReport, which is the JAva client code that submits the reports.

Thanks,
Josh