Changeset 20754
Legend:
- Unmodified
- Added
- Removed
-
trunk/bio/tools/main/src/org/intermine/bio/logic/Mine.java
r20698 r20754 29 29 private Set<String> organismNames = new HashSet(); 30 30 31 // gene.organismName --> gene.orthologue.organismName --> local/remote --> gene.orthologue.datasets 31 // gene.organismName --> gene.orthologue.organismName --> local/remote 32 // --> gene.orthologue.datasets 32 33 private Map<String, Map<String, Set[]>> orthologues = new HashMap(); 33 34 -
trunk/bio/webapp/src/org/intermine/bio/web/logic/OrthologueConverter.java
r20752 r20754 38 38 { 39 39 40 41 40 // D. melanogaster, C. lupus familiaris 42 41 private static final Pattern ORGANISM_SHORTNAME_MATCHER = Pattern.compile("([a-zA-Z]\\..+)"); 43 42 private Model model; 44 45 43 46 44 /** … … 51 49 super(im, webConfig); 52 50 model = im.getModel(); 53 54 51 } 55 52 … … 70 67 /** 71 68 * runs the orthologue conversion pathquery and returns a comma-delimited list of identifiers 69 * used on list analysis page for intermine linking 72 70 * @param profile the user's profile 73 71 * @param bagType the class of the list, has to be gene I think … … 101 99 /** 102 100 * runs the orthologue conversion pathquery and returns list of intermine IDs 101 * used in the portal 103 102 * @param profile the user's profile 104 103 * @param bagType the class of the list, has to be gene I think … … 111 110 PathQuery pathQuery = constructPathQuery(bagType, bagName, organismName); 112 111 pathQuery.setView(bagType + ".id"); 112 pathQuery.syncLogicExpression("and"); 113 113 PathQueryExecutor executor = im.getPathQueryExecutor(profile); 114 114 ExportResultsIterator it = executor.execute(pathQuery); -
trunk/intermine/web/main/src/org/intermine/web/struts/PortalQueryAction.java
r20753 r20754 49 49 import org.intermine.pathquery.PathException; 50 50 import org.intermine.pathquery.PathQuery; 51 import org.intermine.util.StringUtil; 51 52 import org.intermine.web.logic.Constants; 52 53 import org.intermine.web.logic.bag.BagConverter; … … 114 115 } 115 116 116 117 117 String[] idList = extId.split(","); 118 118 … … 130 130 131 131 // If the class is not in the model, we can't continue 132 className = StringUtil.capitalise(className); 132 133 if (model.getClassDescriptorByName(className) == null) { 133 134 recordError(new ActionMessage("errors.badportalclass"), request); … … 166 167 for (String converterClassName : additionalConverters.keySet()) { 167 168 168 String [] addparameters = getAdditionalParameters(request,169 String addparameter = getAdditionalParameter(request, 169 170 additionalConverters.get(converterClassName)); 170 171 171 if ( addparameters.length > 0) {172 if (StringUtils.isNotEmpty(addparameter)) { 172 173 173 174 BagConverter bagConverter = getBagConverter(im, webConfig, converterClassName); … … 175 176 imBag = profile.createBag(bagName, className, ""); 176 177 List<Integer> converted = bagConverter.getConvertedObjectIds(profile, 177 className, bagName, addparameter s[0]);178 className, bagName, addparameter); 178 179 // No matches 179 180 if (converted.size() <= 0) { 180 181 actionMessages.add(Constants.PORTAL_MSG, 181 new ActionMessage("portal.noorthologues", addparameter s, extId));182 new ActionMessage("portal.noorthologues", addparameter, extId)); 182 183 session.setAttribute(Constants.PORTAL_MSG, actionMessages); 183 184 return goToResults(mapping, session, webResults); 184 185 } 185 186 actionMessages.add(Constants.PORTAL_MSG, bagConverter.getActionMessage(extId, 186 converted.size(), className, addparameter s));187 converted.size(), className, addparameter)); 187 188 session.setAttribute(Constants.PORTAL_MSG, actionMessages); 188 189 … … 234 235 } 235 236 236 private String [] getAdditionalParameters(HttpServletRequest request, String[] paramArray)237 private String getAdditionalParameter(HttpServletRequest request, String[] paramArray) 237 238 throws UnsupportedEncodingException { 238 239 239 String[] urlFields = paramArray[0].split(","); 240 String[] addparameters = new String[urlFields.length]; 241 int i = 0; 242 for (String urlField : urlFields) { 243 // if one of the request vars matches the variables listed in the bagquery 244 // config, add the variable to be passed to the custom converter 245 String param = request.getParameter(urlField); 246 if (StringUtils.isNotEmpty(param)) { 247 // the spaces in organisms, eg. D.%20rerio, need to be handled 248 addparameters[i] = URLDecoder.decode(param, "UTF-8"); 249 } 250 } 251 return addparameters; 252 } 253 254 private ActionForward goToResults(ActionMapping mapping, 255 HttpSession session, WebResults webResults) { 240 String[] urlFields = paramArray[0].split(","); 241 String addparameter = null; 242 for (String urlField : urlFields) { 243 // if one of the request vars matches the variables listed in the bagquery 244 // config, add the variable to be passed to the custom converter 245 String param = request.getParameter(urlField); 246 if (StringUtils.isNotEmpty(param)) { 247 // the spaces in organisms, eg. D.%20rerio, need to be handled 248 addparameter = URLDecoder.decode(param, "UTF-8"); 249 } 250 } 251 return addparameter; 252 } 253 254 private ActionForward goToResults(ActionMapping mapping, HttpSession session, 255 WebResults webResults) { 256 256 PagedTable pc = new PagedTable(webResults); 257 257 String identifier = "col" + index++; … … 285 285 if (bagListSize == 0 && bagQueryResultSize == 1) { 286 286 ActionMessage msg = new ActionMessage("results.lookup.noresults.one", 287 new Integer(bagQueryResultSize), 288 className); 287 new Integer(bagQueryResultSize), className); 289 288 actionMessages.add(Constants.PORTAL_MSG, msg); 290 289 } else if (bagListSize == 0 && bagQueryResultSize > 1) { 291 290 ActionMessage msg = new ActionMessage("results.lookup.noresults.many", 292 new Integer(bagQueryResultSize), 293 className); 291 new Integer(bagQueryResultSize), className); 294 292 actionMessages.add(Constants.PORTAL_MSG, msg); 295 293 } else if (bagListSize > 0) {
Note: See TracChangeset
for help on using the changeset viewer.
