Changeset 20787
- Timestamp:
- 03/03/10 16:44:00 (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/intermine/web/main/src/org/intermine/dwr/AjaxServices.java
r20784 r20787 91 91 import org.intermine.web.logic.widget.EnrichmentWidget; 92 92 import org.intermine.web.logic.widget.GraphWidget; 93 import org.intermine.web.logic.widget.GridWidget;94 93 import org.intermine.web.logic.widget.HTMLWidget; 95 94 import org.intermine.web.logic.widget.TableWidget; 96 95 import org.intermine.web.logic.widget.config.EnrichmentWidgetConfig; 97 96 import org.intermine.web.logic.widget.config.GraphWidgetConfig; 98 import org.intermine.web.logic.widget.config.GridWidgetConfig;99 97 import org.intermine.web.logic.widget.config.HTMLWidgetConfig; 100 98 import org.intermine.web.logic.widget.config.TableWidgetConfig; … … 147 145 processException(e); 148 146 } 147 } 148 149 private static void processWidgetException(Exception e, String widgetId) { 150 String msg = "Failed to render widget: " + widgetId; 151 LOG.error(msg, e); 149 152 } 150 153 … … 784 787 } 785 788 } catch (RuntimeException e) { 786 process Exception(e);789 processWidgetException(e, widgetId); 787 790 } 788 791 return null; … … 817 820 } 818 821 } catch (RuntimeException e) { 819 process Exception(e);822 processWidgetException(e, widgetId); 820 823 } 821 824 return null; … … 854 857 } 855 858 } catch (RuntimeException e) { 856 process Exception(e);859 processWidgetException(e, widgetId); 857 860 } 858 861 return null; … … 900 903 } 901 904 } catch (RuntimeException e) { 902 processException(e); 903 } 904 return null; 905 } 906 907 /** 908 * 909 * @param widgetId unique ID for each widget 910 * @param bagName name of list 911 * @param highlight for highlighting 912 * @param pValue pValue 913 * @param numberOpt numberOpt 914 * @param externalLink link to external datasource 915 * @param externalLinkLabel name of external datasource. 916 * @return enrichment widget 917 */ 918 public static GridWidget getProcessGridWidget(String widgetId, String bagName, 919 String highlight, String pValue, String numberOpt, String externalLink, 920 String externalLinkLabel) { 921 try { 922 ServletContext servletContext = WebContextFactory.get().getServletContext(); 923 HttpSession session = WebContextFactory.get().getSession(); 924 final InterMineAPI im = SessionMethods.getInterMineAPI(session); 925 WebConfig webConfig = SessionMethods.getWebConfig(servletContext); 926 ObjectStore os = im.getObjectStore(); 927 Model model = os.getModel(); 928 Profile profile = SessionMethods.getProfile(session); 929 BagManager bagManager = im.getBagManager(); 930 931 InterMineBag imBag = bagManager.getUserOrGlobalBag(profile, bagName); 932 Type type = webConfig.getTypes().get(model.getPackageName() 933 + "." + imBag.getType()); 934 List<WidgetConfig> widgets = type.getWidgets(); 935 for (WidgetConfig widgetConfig : widgets) { 936 if (widgetConfig.getId().equals(widgetId)) { 937 GridWidgetConfig gridWidgetConfig = (GridWidgetConfig) widgetConfig; 938 gridWidgetConfig.setExternalLink(externalLink); 939 gridWidgetConfig.setExternalLinkLabel(externalLinkLabel); 940 GridWidget gridWidget = new GridWidget(gridWidgetConfig, imBag, os, null, 941 highlight, pValue, numberOpt); 942 return gridWidget; 943 } 944 } 945 } catch (RuntimeException e) { 946 processException(e); 905 processWidgetException(e, widgetId); 947 906 } 948 907 return null;
Note: See TracChangeset
for help on using the changeset viewer.
