dealing with non-existent records

0 views
Skip to first unread message

Emily Greenfest-Alleen

unread,
Jul 12, 2011, 2:10:19 PM7/12/11
to strategies...@googlegroups.com
Hi all-

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)

Emily Greenfest-Allen

unread,
Jul 25, 2011, 6:22:14 AM7/25/11
to strategies...@googlegroups.com
Hi all-

I would greatly appreciate it if someone could assist me with the below inquiry re:catching wdk errors in the jsp and displaying more meaningful error messages to the user.

If possible we would like to fix this problem for our next release, which is in little over a week.

Thank you,

Emily

Jerric Gao

unread,
Jul 25, 2011, 10:14:00 AM7/25/11
to strategies...@googlegroups.com

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

Emily Greenfest-Allen

unread,
Jul 25, 2011, 10:23:23 AM7/25/11
to strategies...@googlegroups.com
Jerric-

Thanks for the response; we are using version 1-28.

The trunk and version 2.1 incorporate span logic, do they not?

As discussed we hope to migrate to that for our next release but can't do it now (we have a data-release in a week). 

However, I will look at the 2.1 code and see if I can trace how the error message is produced.

Thanks or the pointer,

Emily

Emily Greenfest-Allen

unread,
Jul 25, 2011, 12:14:26 PM7/25/11
to Cristina Aurrecoechea, Jerric Gao, strategies...@googlegroups.com
Christina-

yes this actually is addressing my question; thank you for cc'ing me on the correspondence.  I'm going to copy it back to the users group for the record.

It seems to me the key point for me would be the following:

<c:when test="${!wdkRecord.validRecord}">

Along the lines of Cristina's question -- how do we specify the test that validates the record?  I am assuming this done w/the model and a record-specific query (b/c validation might depend on the record type).

Does this feature exist in WDK 1-28? or is in a new feature of the WDK 2?

Thanks,

-Emily


On 7/25/2011 12:00 PM, Cristina Aurrecoechea wrote:
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
Reply all
Reply to author
Forward
0 new messages