Changeset 2658 for molgenis4animaldb
- Timestamp:
- 02/25/10 16:48:22 (2 years ago)
- Location:
- molgenis4animaldb
- Files:
-
- 3 added
- 7 edited
-
.project (modified) (2 diffs)
-
AnimalDB.sql (modified) (13 diffs)
-
handwritten/java/decorators/EventTypeDecorator.java (modified) (2 diffs)
-
handwritten/java/plugin/addanimal (added)
-
handwritten/java/plugin/addanimal/AddAnimalPlugin.ftl (added)
-
handwritten/java/plugin/addanimal/AddAnimalPlugin.java (added)
-
handwritten/java/plugin/addevent/AddEventPlugin.java (modified) (1 diff)
-
handwritten/java/plugin/listplugin/ListPlugin.ftl (modified) (4 diffs)
-
handwritten/java/plugin/listplugin/ListPlugin.java (modified) (5 diffs)
-
molgenis4animal_ui.xml (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
molgenis4animaldb/.project
r2263 r2658 1 1 <?xml version="1.0" encoding="UTF-8"?> 2 2 <projectDescription> 3 <name>molgenis _distro</name>3 <name>molgenis4animaldb</name> 4 4 <comment></comment> 5 5 <projects> … … 34 34 <nature>org.eclipse.jem.workbench.JavaEMFNature</nature> 35 35 </natures> 36 <linkedResources> 37 <link> 38 <name>WebContent/res/img/funnel.jpg</name> 39 <type>1</type> 40 <location>C:/Documents and Settings/Administrator/workspace/molgenis4animaldb/WebContent/res/img/funnel.jpg</location> 41 </link> 42 <link> 43 <name>WebContent/res/img/nofunnel.jpg</name> 44 <type>1</type> 45 <location>C:/Documents and Settings/Administrator/workspace/molgenis4animaldb/WebContent/res/img/nofunnel.jpg</location> 46 </link> 47 </linkedResources> 36 48 </projectDescription> -
molgenis4animaldb/AnimalDB.sql
r2637 r2658 4 4 -- 5 5 -- Host: localhost 6 -- Generation Time: Feb 11, 2010 at 02:096 -- Generation Time: Feb 25, 2010 at 04:57 7 7 -- Server version: 5.1.41 8 8 -- PHP Version: 5.3.1 … … 39 39 KEY `eventtypeid` (`eventtypeid`), 40 40 KEY `actorid` (`actorid`) 41 ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT= 18;41 ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=31 ; 42 42 43 43 -- … … 61 61 (15, 'eventThu Feb 11 11:57:27 CET 2010', NULL, 5, '2010-02-11 11:57:27', 1, NULL), 62 62 (16, 'eventThu Feb 11 11:58:23 CET 2010', NULL, 5, '2010-02-11 11:58:23', 1, NULL), 63 (17, 'eventThu Feb 11 11:59:07 CET 2010', NULL, 6, '2010-02-11 11:59:07', 1, NULL); 63 (17, 'eventThu Feb 11 11:59:07 CET 2010', NULL, 6, '2010-02-11 11:59:07', 1, NULL), 64 (18, 'eventTue Feb 23 10:16:27 CET 2010', NULL, 7, '2010-02-23 10:16:27', 1, NULL), 65 (19, 'eventTue Feb 23 10:19:05 CET 2010', NULL, 6, '2010-02-23 10:19:05', 1, NULL), 66 (20, 'eventTue Feb 23 11:20:56 CET 2010', NULL, 15, '2010-02-23 11:20:56', 1, NULL), 67 (21, 'eventTue Feb 23 13:15:30 CET 2010', NULL, 15, '2010-02-23 13:15:30', 1, NULL), 68 (22, 'eventTue Feb 23 13:23:14 CET 2010', NULL, 15, '2010-02-23 13:23:14', 1, NULL), 69 (23, 'eventTue Feb 23 13:28:06 CET 2010', NULL, 15, '2010-02-23 13:28:06', 1, NULL), 70 (24, 'eventWed Feb 24 15:06:11 CET 2010', NULL, 5, '2010-02-24 15:06:11', 1, NULL), 71 (26, 'eventThu Feb 25 09:39:23 CET 2010', NULL, 11, '2010-02-25 09:39:23', 1, NULL), 72 (27, 'eventThu Feb 25 09:55:18 CET 2010', NULL, 4, '2010-02-25 09:55:18', 1, NULL), 73 (28, 'eventThu Feb 25 09:57:13 CET 2010', NULL, 1, '2010-02-25 09:57:13', 1, NULL), 74 (29, 'eventThu Feb 25 09:59:42 CET 2010', NULL, 1, '2010-02-25 09:59:42', 1, NULL), 75 (30, 'eventThu Feb 25 14:13:43 CET 2010', NULL, 9, '2010-02-25 14:13:43', 1, NULL); 64 76 65 77 -- -------------------------------------------------------- … … 76 88 UNIQUE KEY `name` (`name`), 77 89 UNIQUE KEY `id` (`id`) 78 ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 4;90 ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=17 ; 79 91 80 92 -- … … 93 105 (9, 'InExperiment', NULL), 94 106 (10, 'SetCorrespondingLocation', NULL), 95 (11, 'Move', NULL); 107 (11, 'Move', NULL), 108 (12, 'SetDummy', NULL), 109 (15, 'EventTypeWithoutFeature', NULL), 110 (16, 'EventTypeWithoutFeature2', NULL); 96 111 97 112 -- -------------------------------------------------------- … … 119 134 (19, 3), 120 135 (19, 4), 136 (27, 5), 137 (27, 6), 138 (27, 7), 121 139 (23, 8), 122 140 (23, 9), 123 141 (25, 10), 124 (25, 11); 142 (25, 11), 143 (27, 12), 144 (27, 15), 145 (27, 16); 125 146 126 147 -- -------------------------------------------------------- … … 148 169 (18, 19), 149 170 (21, 23), 150 (24, 25); 171 (24, 25), 172 (26, 27); 151 173 152 174 -- -------------------------------------------------------- … … 282 304 UNIQUE KEY `name` (`name`), 283 305 UNIQUE KEY `accession` (`accession`) 284 ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 7;306 ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=28 ; 285 307 286 308 -- … … 312 334 ('Feature', 23, 'CorrespondingExperiment', 'Feature', NULL, NULL, NULL), 313 335 ('Ontology', 24, 'LocationLink', 'DatabaseLink', NULL, NULL, NULL), 314 ('Feature', 25, 'CorrespondingLocation', 'Feature', NULL, NULL, NULL); 336 ('Feature', 25, 'CorrespondingLocation', 'Feature', NULL, NULL, NULL), 337 ('Ontology', 26, 'DummyUnit', 'Unit', NULL, NULL, NULL), 338 ('Feature', 27, 'Dummy', 'Feature', NULL, NULL, NULL); 315 339 316 340 -- -------------------------------------------------------- … … 329 353 UNIQUE KEY `id` (`id`), 330 354 KEY `targettype` (`targettype`) 331 ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT= 6;355 ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=10 ; 332 356 333 357 -- … … 340 364 (3, 'Nemo', NULL, 6), 341 365 (4, 'AtesExperiment', NULL, 11), 342 (5, 'Room D228', NULL, 4); 366 (5, 'Room D228', NULL, 4), 367 (6, 'Henkie', NULL, 5), 368 (7, 'Frits', NULL, 5), 369 (8, 'CDL', NULL, 4), 370 (9, 'Blub', NULL, 6); 343 371 344 372 -- -------------------------------------------------------- … … 364 392 KEY `featureid` (`featureid`), 365 393 KEY `targetid` (`targetid`) 366 ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT= 14;394 ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=26 ; 367 395 368 396 -- … … 383 411 (11, 'value0Wed Feb 10 14:01:44 CET 2010', NULL, '2010-02-02 14:01:39', 10, 25, 3, 'string', '5'), 384 412 (12, 'value0Thu Feb 11 11:51:20 CET 2010', NULL, '2010-02-11 11:51:05', 14, 9, 3, 'string', '37'), 385 (13, 'value1Thu Feb 11 11:51:20 CET 2010', NULL, '2010-02-25 11:51:14', 14, 10, 3, 'string', '38'); 413 (13, 'value1Thu Feb 11 11:51:20 CET 2010', NULL, '2010-02-25 11:51:14', 14, 10, 3, 'string', '38'), 414 (14, 'value0Tue Feb 23 10:19:05 CET 2010', NULL, '2010-02-23 10:19:02', 19, 27, 3, 'string', 'supplied water'), 415 (15, 'value0Tue Feb 23 11:20:56 CET 2010', NULL, '2010-02-23 11:20:54', 20, 27, 2, 'string', 'nonsense'), 416 (16, 'value0Tue Feb 23 13:28:06 CET 2010', NULL, '2010-02-23 13:28:03', 23, 27, 2, 'string', 'Dummy'), 417 (17, 'value0Wed Feb 24 15:06:11 CET 2010', NULL, '2010-02-24 15:06:08', 24, 27, 7, 'string', 'Dummy'), 418 (19, 'value0Thu Feb 25 09:39:23 CET 2010', NULL, '2010-02-25 09:39:20', 26, 25, 3, 'string', '8'), 419 (20, 'value0Thu Feb 25 09:55:18 CET 2010', NULL, '2010-02-25 09:55:15', 27, 19, 6, 'string', 'Due to experiment'), 420 (21, 'value0Thu Feb 25 09:57:13 CET 2010', NULL, '2010-02-25 09:57:04', 28, 9, 6, 'string', '20'), 421 (22, 'value1Thu Feb 25 09:57:13 CET 2010', NULL, '2010-02-25 09:57:09', 28, 10, 6, 'string', '20'), 422 (23, 'value0Thu Feb 25 09:59:42 CET 2010', NULL, '2010-02-25 09:59:38', 29, 9, 7, 'string', '38'), 423 (24, 'value1Thu Feb 25 09:59:42 CET 2010', NULL, '2010-02-25 09:59:40', 29, 10, 7, 'string', '37'), 424 (25, 'value0Thu Feb 25 14:13:43 CET 2010', NULL, '2010-02-25 14:13:41', 30, 23, 7, 'string', '4'); 386 425 387 426 -- -
molgenis4animaldb/handwritten/java/decorators/EventTypeDecorator.java
r2656 r2658 23 23 import animaldb.EventType; 24 24 import animaldb.Feature; 25 import animaldb.Ontology; 25 26 26 27 public class EventTypeDecorator extends MappingDecorator<animaldb.EventType> … … 34 35 private boolean CheckForEmptyFeatures(List<animaldb.EventType> entities) { 35 36 37 // get ID for Dummy entry in Ontology 38 int DummyID = 0; 39 Database db = this.getDatabase(); 40 List<Ontology> ontList; 41 try { 42 ontList = db.find(Ontology.class, new QueryRule("name", Operator.EQUALS, "Dummy")); 43 Ontology currentOntTerm = ontList.get(0); 44 DummyID = currentOntTerm.getId(); 45 } catch (DatabaseException e) { 46 e.printStackTrace(); 47 } 48 36 49 List<Integer> dummyFeatureList = new ArrayList<Integer>(); 37 dummyFeatureList.add( 27); // TO DO: hardcoded ID of Dummy feature50 dummyFeatureList.add(DummyID); 38 51 39 52 for (EventType et : entities) { -
molgenis4animaldb/handwritten/java/plugin/addevent/AddEventPlugin.java
r2636 r2658 167 167 } 168 168 169 @Override170 169 public void reload(Database db) 171 170 { -
molgenis4animaldb/handwritten/java/plugin/listplugin/ListPlugin.ftl
r2657 r2658 27 27 28 28 <div style="float:left"> 29 <input type="hidden" name="Column ToRemove" />29 <input type="hidden" name="ColumnInQuestion" /> 30 30 <table class='listtable'> 31 31 <tr> … … 39 39 </#list> 40 40 </tr> 41 <#assign i = 0> 42 <#list screen.animalList as al> 43 <#if i % 2 == 0> 44 <tr class='form_listrow1'> 45 <#else> 46 <tr class='form_listrow0'> 47 </#if> 48 <td width="50em">${al.name}</td> 49 <#assign j = 0> 50 <#list screen.featureList as fl> 51 <#if screen.featureVisibilityList[j] == 1> 52 <td width="50em">${screen.valueMatrix[i][j]}</td> 53 </#if> 54 <#assign j = j + 1> 55 </#list> 56 </tr> 57 <#assign i = i + 1> 58 </#list> 41 59 42 <tr> 60 43 <td></td> … … 63 46 <#if screen.featureVisibilityList[i] == 1> 64 47 <td><div align="center"> 65 <input type="submit" value="-" class="minusbutton" onclick="ColumnToRemove.value='${i}'; __action.value='remColumn';" /> 48 <input type="submit" value="-" class="minusbutton" onclick="ColumnInQuestion.value='${i}'; __action.value='remColumn';" /> 49 50 <button type="submit" onclick="ColumnInQuestion.value='${i}'; __action.value='noFilterColumn';"><img src="res/img/nofunnel.jpg" alt="no funnel" /></button> 66 51 </div></td> 67 52 </#if> … … 69 54 </#list> 70 55 </tr> 56 57 <#assign i = 0> 58 <#list screen.animalList as al> 59 <#if screen.animalVisibilityList[i] == 1> 60 <#if i % 2 == 0> 61 <tr class='form_listrow1'> 62 <#else> 63 <tr class='form_listrow0'> 64 </#if> 65 <td width="50em">${al.name}</td> 66 <#assign j = 0> 67 <#list screen.featureList as fl> 68 <#if screen.featureVisibilityList[j] == 1> 69 <td width="50em">${screen.valueMatrix[i][j]}</td> 70 </#if> 71 <#assign j = j + 1> 72 </#list> 73 </tr> 74 </#if> 75 <#assign i = i + 1> 76 </#list> 77 78 <tr> 79 <td></td> 80 <#assign i = 0> 81 <#list screen.featureList as fl> 82 <#if screen.featureVisibilityList[i] == 1> 83 <td><div align="center"> 84 <select name="operator"> 85 <option value="=">=</option> 86 </select> 87 88 <input type="text" name="filtertext${i}" /> 89 90 <button type="submit" onclick="ColumnInQuestion.value='${i}'; __action.value='filterColumn';"><img src="res/img/funnel.jpg" alt="funnel" /></button> 91 </div></td> 92 </#if> 93 <#assign i = i + 1> 94 </#list> 95 </tr> 96 71 97 </table> 72 98 </div> -
molgenis4animaldb/handwritten/java/plugin/listplugin/ListPlugin.java
r2657 r2658 58 58 } 59 59 60 public List<Integer> getAnimalVisibilityList() { 61 return animalVisibilityList; 62 } 63 64 public void setAnimalVisibilityList(List<Integer> animalVisibilityList) { 65 this.animalVisibilityList = animalVisibilityList; 66 } 67 60 68 // Feature related methods: 61 69 public List<Feature> getFeatureList() { … … 67 75 } 68 76 77 public List<Integer> getFeatureVisibilityList() { 78 return featureVisibilityList; 79 } 80 81 public void setFeatureVisibilityList(List<Integer> featureVisibilityList) { 82 this.featureVisibilityList = featureVisibilityList; 83 } 84 69 85 // Value matrix related methods: 70 86 … … 78 94 79 95 // The rest: 80 81 public List<Integer> getFeatureVisibilityList() {82 return featureVisibilityList;83 }84 85 public void setFeatureVisibilityList(List<Integer> featureVisibilityList) {86 this.featureVisibilityList = featureVisibilityList;87 }88 96 89 97 private void populateValueMatrix(Database db) { … … 144 152 145 153 if (action.equals("remColumn")) { 146 int selectedFeatureId = request.getInt("Column ToRemove");154 int selectedFeatureId = request.getInt("ColumnInQuestion"); 147 155 featureVisibilityList.set(selectedFeatureId, 0); 156 } 157 158 if (action.equals("filterColumn")) { 159 int selectedFeatureId = request.getInt("ColumnInQuestion"); 160 //String operator = request.getString("operator"); 161 String filtertext = request.getString("filtertext" + selectedFeatureId); 162 for (int i = 0; i < animalList.size(); i++) { 163 String currentValue = valueMatrix.get(i).get(selectedFeatureId); 164 if (!currentValue.equals(filtertext)) { // TO DO: allow other operators! 165 animalVisibilityList.set(i, 0); 166 } 167 } 168 } 169 170 if (action.equals("noFilterColumn")) { 171 //int selectedFeatureId = request.getInt("ColumnInQuestion"); 172 // TO DO: remove only rows filtered out by filter on this column 173 for (int i = 0; i < animalList.size(); i++) { 174 animalVisibilityList.set(i, 1); 175 } 148 176 } 149 177 … … 187 215 } 188 216 189 // Cleananimal visibility list217 // Initialize animal visibility list 190 218 animalVisibilityList.clear(); 191 219 for (int i = 0; i < animalList.size(); i++) { 192 animalVisibilityList.add( 0);220 animalVisibilityList.add(1); 193 221 } 194 222 -
molgenis4animaldb/molgenis4animal_ui.xml
r2656 r2658 20 20 <form name="EventType" entity="EventType" view="list" label="Types of events" /> 21 21 </menu> 22 23 <plugin name="AddAnimal" type="plugin.addanimal.AddAnimalPlugin" 24 label="Add animal" /> 22 25 23 26 <plugin name="AddEvent" type="plugin.addevent.AddEventPlugin"
Note: See TracChangeset
for help on using the changeset viewer.