Changeset 20767


Ignore:
Timestamp:
02/03/10 15:56:21 (2 years ago)
Author:
julie
Message:

fixed null pointer error.

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/bio/webapp/src/org/intermine/bio/web/logic/OrthologueConverter.java

    r20760 r20767  
    7373    public String getConvertedObjectFields(Profile profile, String bagType, String bagName, 
    7474            String organismName) { 
    75         StringBuffer orthologues = null; 
     75        StringBuffer orthologues = new StringBuffer(); 
    7676        PathQuery pathQuery = constructPathQuery(organismName); 
    7777        pathQuery.addConstraint(bagType, Constraints.in(bagName)); 
  • trunk/intermine/web/main/src/org/intermine/dwr/AjaxServices.java

    r20765 r20767  
    13411341     * @throws UnsupportedEncodingException bad encoding 
    13421342     */ 
    1343     public String convertObjects(String bagType, String bagName, String selectedValue)  
     1343    public String convertObjects(String bagType, String bagName, String param,  
     1344            String selectedValue)  
    13441345    throws UnsupportedEncodingException { 
    13451346        ServletContext servletContext = WebContextFactory.get().getServletContext(); 
     
    13571358        if (additionalConverters != null) { 
    13581359            for (String converterClassName : additionalConverters.keySet()) { 
    1359  
    1360                 String addparameter = PortalHelper.getAdditionalParameter(request, 
     1360                String addparameter = PortalHelper.getAdditionalParameter(param, 
    13611361                        additionalConverters.get(converterClassName)); 
    1362  
    13631362                if (StringUtils.isNotEmpty(addparameter)) { 
    1364  
    13651363                    BagConverter bagConverter = portalHelper.getBagConverter(im, webConfig,  
    13661364                            converterClassName); 
    1367  
    1368  
    13691365                return bagConverter.getConvertedObjectFields(profile, bagType, bagName, 
    13701366                        selectedValue); 
  • trunk/intermine/web/main/src/org/intermine/web/logic/PortalHelper.java

    r20758 r20767  
    3333 
    3434    private static Map<String, BagConverter> bagConverters = new HashMap(); 
     35     
     36    public static String getAdditionalParameter(String param, String[] paramArray) { 
     37 
     38        String[] urlFields = paramArray[0].split(","); 
     39        for (String urlField : urlFields) { 
     40            // if one of the request vars matches the variables listed in the bagquery 
     41            // config, add the variable to be passed to the custom converter 
     42             
     43            if (urlField.equals(param)) { 
     44                // the spaces in organisms, eg. D.%20rerio, need to be handled 
     45                return param; 
     46            } 
     47        } 
     48        return null; 
     49    } 
    3550     
    3651    public static String getAdditionalParameter(HttpServletRequest request, String[] paramArray) 
  • trunk/intermine/webapp/main/resources/webapp/js/imdwr.js

    r20758 r20767  
    803803    // convert orthologues then post 
    804804    if (myForm.orthologueMapping[1].checked) { 
    805  
    806805        // convert orthologues 
    807         AjaxServices.convertObjects(bagType, bagName, selectedOrganism, function(identifiers) { 
     806        AjaxServices.convertObjects(bagType, bagName, 'orthologue', selectedOrganism, function(identifiers) { 
    808807            if (identifiers != null && identifiers != '') { 
    809808                myForm.externalids.value = identifiers; 
Note: See TracChangeset for help on using the changeset viewer.