Changeset 2658 for molgenis4animaldb


Ignore:
Timestamp:
02/25/10 16:48:22 (2 years ago)
Author:
erikroos
Message:
  • Added basic filtering of columns in list viewer
  • Added (very) basic plugin to add animals -> does not yet generate born/broughtin/etc. events
  • Added new version of datamodel (!)
Location:
molgenis4animaldb
Files:
3 added
7 edited

Legend:

Unmodified
Added
Removed
  • molgenis4animaldb/.project

    r2263 r2658  
    11<?xml version="1.0" encoding="UTF-8"?> 
    22<projectDescription> 
    3         <name>molgenis_distro</name> 
     3        <name>molgenis4animaldb</name> 
    44        <comment></comment> 
    55        <projects> 
     
    3434                <nature>org.eclipse.jem.workbench.JavaEMFNature</nature> 
    3535        </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> 
    3648</projectDescription> 
  • molgenis4animaldb/AnimalDB.sql

    r2637 r2658  
    44-- 
    55-- Host: localhost 
    6 -- Generation Time: Feb 11, 2010 at 02:09  
     6-- Generation Time: Feb 25, 2010 at 04:57  
    77-- Server version: 5.1.41 
    88-- PHP Version: 5.3.1 
     
    3939  KEY `eventtypeid` (`eventtypeid`), 
    4040  KEY `actorid` (`actorid`) 
    41 ) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=18 ; 
     41) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=31 ; 
    4242 
    4343-- 
     
    6161(15, 'eventThu Feb 11 11:57:27 CET 2010', NULL, 5, '2010-02-11 11:57:27', 1, NULL), 
    6262(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); 
    6476 
    6577-- -------------------------------------------------------- 
     
    7688  UNIQUE KEY `name` (`name`), 
    7789  UNIQUE KEY `id` (`id`) 
    78 ) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=14 ; 
     90) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=17 ; 
    7991 
    8092-- 
     
    93105(9, 'InExperiment', NULL), 
    94106(10, 'SetCorrespondingLocation', NULL), 
    95 (11, 'Move', NULL); 
     107(11, 'Move', NULL), 
     108(12, 'SetDummy', NULL), 
     109(15, 'EventTypeWithoutFeature', NULL), 
     110(16, 'EventTypeWithoutFeature2', NULL); 
    96111 
    97112-- -------------------------------------------------------- 
     
    119134(19, 3), 
    120135(19, 4), 
     136(27, 5), 
     137(27, 6), 
     138(27, 7), 
    121139(23, 8), 
    122140(23, 9), 
    123141(25, 10), 
    124 (25, 11); 
     142(25, 11), 
     143(27, 12), 
     144(27, 15), 
     145(27, 16); 
    125146 
    126147-- -------------------------------------------------------- 
     
    148169(18, 19), 
    149170(21, 23), 
    150 (24, 25); 
     171(24, 25), 
     172(26, 27); 
    151173 
    152174-- -------------------------------------------------------- 
     
    282304  UNIQUE KEY `name` (`name`), 
    283305  UNIQUE KEY `accession` (`accession`) 
    284 ) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=27 ; 
     306) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=28 ; 
    285307 
    286308-- 
     
    312334('Feature', 23, 'CorrespondingExperiment', 'Feature', NULL, NULL, NULL), 
    313335('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); 
    315339 
    316340-- -------------------------------------------------------- 
     
    329353  UNIQUE KEY `id` (`id`), 
    330354  KEY `targettype` (`targettype`) 
    331 ) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=6 ; 
     355) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=10 ; 
    332356 
    333357-- 
     
    340364(3, 'Nemo', NULL, 6), 
    341365(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); 
    343371 
    344372-- -------------------------------------------------------- 
     
    364392  KEY `featureid` (`featureid`), 
    365393  KEY `targetid` (`targetid`) 
    366 ) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=14 ; 
     394) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=26 ; 
    367395 
    368396-- 
     
    383411(11, 'value0Wed Feb 10 14:01:44 CET 2010', NULL, '2010-02-02 14:01:39', 10, 25, 3, 'string', '5'), 
    384412(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'); 
    386425 
    387426-- 
  • molgenis4animaldb/handwritten/java/decorators/EventTypeDecorator.java

    r2656 r2658  
    2323import animaldb.EventType; 
    2424import animaldb.Feature; 
     25import animaldb.Ontology; 
    2526 
    2627public class EventTypeDecorator extends MappingDecorator<animaldb.EventType> 
     
    3435        private boolean CheckForEmptyFeatures(List<animaldb.EventType> entities) { 
    3536 
     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 
    3649                List<Integer> dummyFeatureList = new ArrayList<Integer>(); 
    37                 dummyFeatureList.add(27); // TO DO: hardcoded ID of Dummy feature 
     50                dummyFeatureList.add(DummyID); 
    3851                 
    3952                for (EventType et : entities) { 
  • molgenis4animaldb/handwritten/java/plugin/addevent/AddEventPlugin.java

    r2636 r2658  
    167167        } 
    168168 
    169         @Override 
    170169        public void reload(Database db) 
    171170        { 
  • molgenis4animaldb/handwritten/java/plugin/listplugin/ListPlugin.ftl

    r2657 r2658  
    2727 
    2828<div style="float:left"> 
    29         <input type="hidden" name="ColumnToRemove" /> 
     29        <input type="hidden" name="ColumnInQuestion" /> 
    3030        <table class='listtable'> 
    3131        <tr> 
     
    3939                </#list> 
    4040        </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         
    5942        <tr> 
    6043                <td></td> 
     
    6346                        <#if screen.featureVisibilityList[i] == 1> 
    6447                                <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                                        &nbsp; 
     50                                        <button type="submit" onclick="ColumnInQuestion.value='${i}'; __action.value='noFilterColumn';"><img src="res/img/nofunnel.jpg" alt="no funnel" /></button> 
    6651                                </div></td> 
    6752                        </#if> 
     
    6954                </#list> 
    7055        </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                                        &nbsp; 
     88                                        <input type="text" name="filtertext${i}" /> 
     89                                        &nbsp; 
     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         
    7197        </table> 
    7298</div> 
  • molgenis4animaldb/handwritten/java/plugin/listplugin/ListPlugin.java

    r2657 r2658  
    5858        } 
    5959         
     60        public List<Integer> getAnimalVisibilityList() { 
     61                return animalVisibilityList; 
     62        } 
     63         
     64        public void setAnimalVisibilityList(List<Integer> animalVisibilityList) { 
     65                this.animalVisibilityList = animalVisibilityList; 
     66        } 
     67         
    6068        // Feature related methods: 
    6169        public List<Feature> getFeatureList() { 
     
    6775        } 
    6876         
     77        public List<Integer> getFeatureVisibilityList() { 
     78                return featureVisibilityList; 
     79        } 
     80         
     81        public void setFeatureVisibilityList(List<Integer> featureVisibilityList) { 
     82                this.featureVisibilityList = featureVisibilityList; 
     83        } 
     84         
    6985        // Value matrix related methods: 
    7086         
     
    7894         
    7995        // 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         } 
    8896         
    8997        private void populateValueMatrix(Database db) { 
     
    144152                         
    145153                        if (action.equals("remColumn")) { 
    146                                 int selectedFeatureId = request.getInt("ColumnToRemove"); 
     154                                int selectedFeatureId = request.getInt("ColumnInQuestion"); 
    147155                                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                                } 
    148176                        } 
    149177                         
     
    187215                        } 
    188216                         
    189                         // Clean animal visibility list 
     217                        // Initialize animal visibility list 
    190218                        animalVisibilityList.clear(); 
    191219                        for (int i = 0; i < animalList.size(); i++) { 
    192                                 animalVisibilityList.add(0); 
     220                                animalVisibilityList.add(1); 
    193221                        } 
    194222         
  • molgenis4animaldb/molgenis4animal_ui.xml

    r2656 r2658  
    2020                        <form name="EventType" entity="EventType" view="list" label="Types of events" /> 
    2121                </menu> 
     22                 
     23                <plugin name="AddAnimal" type="plugin.addanimal.AddAnimalPlugin" 
     24                        label="Add animal" /> 
    2225 
    2326                <plugin name="AddEvent" type="plugin.addevent.AddEventPlugin" 
Note: See TracChangeset for help on using the changeset viewer.