Changeset 2130
- Timestamp:
- Nov 11, 2013, 11:36:33 AM (10 years ago)
- Location:
- extensions/net.sf.basedb.reggie/branches/ticket-489
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/net.sf.basedb.reggie/branches/ticket-489/META-INF/extensions.xml
r2113 r2130 151 151 <ref index="1">net.sf.basedb.clients.web.listcolumn.sample</ref> 152 152 <ref index="1">net.sf.basedb.clients.web.listcolumn.extract</ref> 153 <ref index="1">net.sf.basedb.clients.web.listcolumn.bioplate</ref> 153 154 </extends> 154 155 <index>2</index> … … 156 157 <name>Reggie column</name> 157 158 <description> 158 Add a column to the list page of samples and extract for159 including some reggie-specific links.159 Add a column to the list page of samples, extract and bioplates 160 for including some reggie-specific links. 160 161 </description> 161 162 </about> … … 194 195 </extension> 195 196 197 <extension 198 id="net.sf.basedb.reggie.toolbar.histology-score" 199 extends="net.sf.basedb.clients.web.toolbar.item.bioplate" 200 > 201 <about> 202 <name>Histology score</name> 203 <description> 204 Adds a button to the toolbar of paraffin blocks and 205 HE stain bioplates that start the 'histology scoring wizard'. 206 </description> 207 </about> 208 <action-factory> 209 <factory-class> 210 net.sf.basedb.reggie.extensions.HistologyScoreButtonFactory 211 </factory-class> 212 </action-factory> 213 </extension> 196 214 197 215 </extensions> -
extensions/net.sf.basedb.reggie/branches/ticket-489/src/net/sf/basedb/reggie/extensions/ReggieListColumnsFactory.java
r1915 r2130 6 6 import net.sf.basedb.clients.web.extensions.list.ListColumnAction; 7 7 import net.sf.basedb.core.BioMaterial; 8 import net.sf.basedb.core.BioPlate; 8 9 import net.sf.basedb.core.DbControl; 10 import net.sf.basedb.core.Item; 9 11 import net.sf.basedb.reggie.Reggie; 10 12 import net.sf.basedb.util.extensions.InvokationContext; 11 13 12 14 /** 13 Factory that add a "Reggie" column to the sample and extract list pages.14 In this column, we can add reggie-specific information, such as a link15 to the "Case summary" function for all items that15 Factory that add a "Reggie" column to the sample, extract and bioplate 16 list pages. In this column, we can add reggie-specific information, such as a 17 link to the "Case summary" function for all items that 16 18 can be matched to a case name, eg. it starts with 7 digits, optionally 17 19 followed by a dot. 20 21 In 2.14: Added link to Histology scoring wizard for PB and HE plates. 18 22 19 23 @author Nicklas … … 34 38 String ID = jspContext.getSessionControl().getId(); 35 39 String reggieHome = jspContext.getHome(context.getExtension()); 36 ColumnAction action = new ColumnAction(ID, reggieHome); 40 Item guiItem = jspContext.getGuiContext().getItem(); 41 ListColumnAction action = null; 42 if (guiItem == Item.BIOPLATE) 43 { 44 action = new BioPlateColumnAction(ID, reggieHome); 45 } 46 else if (guiItem == Item.SAMPLE || guiItem == Item.EXTRACT) 47 { 48 action = new BioMaterialColumnAction(ID, reggieHome); 49 } 37 50 return new ListColumnAction[] { action }; 38 51 } 39 52 40 static class ColumnAction53 static class BioMaterialColumnAction 41 54 extends AbstractListColumnBean<BioMaterial, String> 42 55 { … … 44 57 private final String reggieHome; 45 58 46 ColumnAction(String ID, String reggieHome)59 BioMaterialColumnAction(String ID, String reggieHome) 47 60 { 48 61 this.ID = ID; … … 70 83 } 71 84 } 85 86 static class BioPlateColumnAction 87 extends AbstractListColumnBean<BioPlate, String> 88 { 89 private final String ID; 90 private final String reggieHome; 91 92 BioPlateColumnAction(String ID, String reggieHome) 93 { 94 this.ID = ID; 95 this.reggieHome = reggieHome; 96 setId("reggie"); 97 setTitle("Reggie"); 98 } 99 100 @Override 101 public String getValue(DbControl dc, BioPlate plate) 102 { 103 String value = null; 104 String name = plate.getName(); 105 if (name != null && HistologyScoreButtonFactory.HE_PLATE_PATTERN.matcher(name).matches()) 106 { 107 String heName = "HE" + name.substring(2, 7); 108 StringBuilder sb = new StringBuilder(); 109 sb.append("<a href=\"" + reggieHome + "/sampleproc/histology_score.jsp?ID="+ID+"&name="+heName+"\""); 110 sb.append(" title=\"Goto HE glass scoring wizard\""); 111 sb.append("><img src=\""+reggieHome+"/images/microscope.png\">"); 112 sb.append("</a>"); 113 value = sb.toString(); 114 } 115 return value; 116 } 117 } 118 72 119 }
Note: See TracChangeset
for help on using the changeset viewer.