Is there a mechanism for catching when a non-existent record primary
key, an empty value, or inappropriate value is passed to the primary
key parameter of the showRecord.do action so that an informative error
message can be displayed? (As opposed to:
http://genomics.betacell.org/gbco-dev/showRecord.do?name=GeneRecordClasses.GeneRecordClass&gene_id=37116236234,
for example).
As an example, in the error log when we pass an empty value, we get the
following error:
gene_id:
The parameter 'gene_id' does not allow empty value
A similar error is recorded in the error log if a text string was passed
instead of the numeric value.
How can I display these error messages (or something similar) on the
custom record page that results from executing the action?
If no mechanism exists, is this something that we can to catch on the
record page directly -- at least for non-existent records? My impression
is that the answer is no b/c the error occurs before the jsp page is loaded:
Jul 12, 2011 1:52:52 PM org.apache.tomcat.util.http.Parameters
processParameters
WARNING: Parameters: Invalid chunk '' ignored.
org.gusdb.wdk.model.WdkUserException:
Attribute query GeneAttributes.CommonAttrs doesn't return any row:
(see full stack trace below)
Is my understanding correct? Thanks,
Thanks,
Emily
Jul 12, 2011 1:52:52 PM org.apache.tomcat.util.http.Parameters
processParameters
WARNING: Parameters: Invalid chunk '' ignored.
org.gusdb.wdk.model.WdkUserException:
Attribute query GeneAttributes.CommonAttrs doesn't return any row:
SELECT f.* FROM (SELECT 'GenomicsBC' || ' ' AS project_id, g.gene_id as
gene_id, g.gene_id as geneId
, CASE WHEN g.name IS NULL OR g.name = '-' THEN
g.description ELSE g.name END AS description
, g.gene_symbol as gene_symbol
, g.source_id as source_id
, tn.name as organism
FROM dots.gene g
, sres.taxonname tn
WHERE g.taxon_id = tn.taxon_id
AND tn.name_class='scientific name'
) f WHERE f.gene_id = '37116236234'
at
org.gusdb.wdk.model.RecordInstance.fillColumnAttributeValues(RecordInstance.java:152)
at
org.gusdb.wdk.model.AttributeValueContainer.getAttributeValue(AttributeValueContainer.java:69)
at
org.gusdb.wdk.model.jspwrap.RecordBean$AttributeValueMap.get(RecordBean.java:298)
at
org.gusdb.wdk.model.jspwrap.RecordBean$AttributeValueMap.get(RecordBean.java:183)
at
org.gusdb.wdk.controller.action.ShowRecordAction.execute(ShowRecordAction.java:96)
at
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:421)
at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:226)
at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164)
at
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:397)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
org.gusdb.wdk.controller.action.BetaCellLoginFilter.doFilter(BetaCellLoginFilter.java:121)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
at
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:619)
Hi Emily,
What version of WDK do you use? With the trunk or latest WDK on EuPath, the record page says something like “The gene ‘x’ was not found”. Maybe you could try the latest 2.1 version?
Jerric
Hi Jerric(not copying the list because I am not sure I am addressing Emily's question)
(Jerric: this is the email I mentioned to you on Friday.... it is about what happens when the URL to access a record page contains an invalid or empty id.
I think what we do is to check if the ID is old and- if there is a new one (via geneid table) we use it- otherwise, if there is no mapping we show a nice message:The gene 'PY0014' was not found.
This message is in the generecordpage.jsp as:<c:choose><c:when test="${!wdkRecord.validRecord}"><site:header title="${wdkModel.displayName} : gene ${id}"divisionName="Gene Record"refer="recordPage"division="queries_tools"/><h2 style="text-align:center;color:#CC0000;">The ${fn:toLowerCase(recordType)} '${id}' was not found.</h2></c:when><c:otherwise>
When do we validate the wdkRecord? in showRecord.do action?
Emily: is this what you were asking?
Cristina
Begin forwarded message:
From: Emily Greenfest-Alleen <all...@pcbi.upenn.edu>
Date: July 12, 2011 2:10:19 PM EDT