Changeset 22681


Ignore:
Timestamp:
03/09/10 11:37:26 (17 months ago)
Author:
rns
Message:

Fix exception with null extra values in LOOKUP constraints.

Location:
branches/mnw21/pathquery_refactor/intermine
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/mnw21/pathquery_refactor/intermine/web/main/src/org/intermine/web/struts/TemplateAction.java

    r22679 r22681  
    262262                                        (String) tf.getAttributeValues(key), 
    263263                                        TemplateValue.ValueType.SIMPLE_VALUE, 
    264                                         tf.getExtraValues(key).toString()); 
     264                                        extraValueToString(tf.getExtraValues(key))); 
    265265                            } else if (tf.getNullConstraint(key) != null) { 
    266266                                if (ConstraintOp.IS_NULL.toString() 
     
    329329        return null; 
    330330    } 
     331     
     332    private String extraValueToString(Object extraValue) { 
     333        if (extraValue == null) { 
     334            return null; 
     335        } 
     336        return extraValue.toString(); 
     337    } 
    331338} 
  • branches/mnw21/pathquery_refactor/intermine/webapp/main/resources/webapp/template.jsp

    r22595 r22681  
    130130              <%-- if null or not null value --%> 
    131131              <c:when test="${dec.nullSelected}"> 
    132                 <html:radio property="nullConstraint(${index})" value="IS NULL"/><fmt:message key="query.constraint.null"/> 
    133                 <html:radio property="nullConstraint(${index})" value="IS NOT NULL"/><fmt:message key="query.constraint.notnull"/> 
     132                <html:radio property="nullConstraint(${index})" value="IS NULL"/><fmt:message key="query.constraint.null"/> 
     133                <html:radio property="nullConstraint(${index})" value="IS NOT NULL"/><fmt:message key="query.constraint.notnull"/> 
    134134              </c:when> 
    135135              <c:otherwise> 
     
    254254        </td> 
    255255        <td> 
    256         <c:if test="${!empty dec.bags && !dec.nullSelected}"> 
    257                 <html:checkbox property="useBagConstraint(${index})" onclick="clickUseBag(${index})" disabled="${empty dec.bags?'true':'false'}" /> 
    258                 <fmt:message key="template.constraintobe"/> 
    259                 <%--Contained in bag:--%> 
    260                 <html:select property="bagOp(${index})" disabled="true"> 
    261                   <c:forEach items="${dec.bagOps}" var="bagOp"> 
    262                     <option value="${bagOp.property}" <c:if test="${!empty dec.bagSelected && dec.selectedOp.property == bagOp.property}">selected</c:if>> 
    263                       <c:out value="${bagOp.label}" /> 
    264                     </option> 
    265                   </c:forEach> 
    266                 </html:select>  
    267                 <fmt:message key="template.constraintobelist"><fmt:param value="${dec.bagType}"/></fmt:message> 
    268                 <html:select property="bag(${index})" disabled="true"> 
    269                   <c:forEach items="${dec.bags}" var="bag"> 
    270                     <option value="${bag}" <c:if test="${!empty dec.bagSelected && dec.selectedValue == bag}">selected</c:if>> 
    271                       <c:out value="${bag}" /> 
    272                     </option> 
    273                   </c:forEach> 
    274                 </html:select>  
    275             </c:if>  
    276             </td> 
    277             <%-- AND and OR button --%> 
    278             <%--   
    279             <td valign="middle"> 
    280                 <a id="orButton(${index})" style="text-decoration:none;" href="javascript:addOR(${index})" title="Add OR constraint"> 
    281                     <span style="font-size: 12px;color: #477b46;font-weight: bold;margin-left: 15px;margin-right: 5px">OR+</span> 
    282                 </a>  
    283              
    284                 <a id="andButton(${index})" style="text-decoration:none;" href="javascript:addAND(${index})" title="Add AND constraint"> 
    285                     <span style="font-size: 12px;color: #477b46;font-weight: bold;margin-right: 5px">AND+</span> 
    286                 </a> 
    287             </td> 
    288             --%> 
    289             </tr> 
    290             </table> 
    291             <c:if test="${!empty builder && builder=='yes'}"> 
    292                 </div> 
    293             </c:if> 
    294         </li> 
     256          <c:if test="${!empty dec.bags && !dec.nullSelected}"> 
     257            <html:checkbox property="useBagConstraint(${index})" onclick="clickUseBag(${index})" disabled="${empty dec.bags?'true':'false'}" /> 
     258            <fmt:message key="template.constraintobe"/> 
     259            <%--Contained in bag:--%> 
     260            <html:select property="bagOp(${index})" disabled="true"> 
     261              <c:forEach items="${dec.bagOps}" var="bagOp"> 
     262                <option value="${bagOp.property}" <c:if test="${!empty dec.bagSelected && dec.selectedOp.property == bagOp.property}">selected</c:if>> 
     263                  <c:out value="${bagOp.label}" /> 
     264                </option> 
     265              </c:forEach> 
     266            </html:select>  
     267            <fmt:message key="template.constraintobelist"><fmt:param value="${dec.bagType}"/></fmt:message> 
     268            <html:select property="bag(${index})" disabled="true"> 
     269              <c:forEach items="${dec.bags}" var="bag"> 
     270                <option value="${bag}" <c:if test="${!empty dec.bagSelected && dec.selectedValue == bag}">selected</c:if>> 
     271                  <c:out value="${bag}" /> 
     272                </option> 
     273              </c:forEach> 
     274            </html:select>  
     275          </c:if>  
     276        </td> 
     277 
     278        <%-- AND and OR button --%> 
     279       <%--   
     280         <td valign="middle"> 
     281           <a id="orButton(${index})" style="text-decoration:none;" href="javascript:addOR(${index})" title="Add OR constraint"> 
     282             <span style="font-size: 12px;color: #477b46;font-weight: bold;margin-left: 15px;margin-right: 5px">OR+</span> 
     283           </a>  
     284           <a id="andButton(${index})" style="text-decoration:none;" href="javascript:addAND(${index})" title="Add AND constraint"> 
     285             <span style="font-size: 12px;color: #477b46;font-weight: bold;margin-right: 5px">AND+</span> 
     286           </a> 
     287         </td> 
     288       --%> 
     289      </tr> 
     290    </table> 
     291    <c:if test="${!empty builder && builder=='yes'}"> 
     292      </div> 
     293    </c:if> 
     294  </li> 
    295295         
    296296       <script type="text/javascript"> 
    297             initConstraints(${index}); 
    298         </script> 
     297         initConstraints(${index}); 
     298       </script> 
    299299        </c:forEach> 
    300         </ol> 
    301       </div> 
     300</ol> 
     301</div> 
    302302<%-- edit/submit buttons --%> 
    303303<c:if test="${empty builder}"> 
Note: See TracChangeset for help on using the changeset viewer.