Changeset 2697


Ignore:
Timestamp:
03/09/10 18:31:18 (2 years ago)
Author:
rwagner
Message:
 
Location:
molgenis_projects/col7a1
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • molgenis_projects/col7a1/handwritten/java/plugin/ui/SearchPlugin.ftl

    r2683 r2697  
    11<#macro plugin_ui_SearchPlugin screen> 
    22<!-- normally you make one big form for the whole plugin--> 
     3 
     4<#if screen.action?starts_with("showProteinDomain")> 
     5 
     6<p align="center"> 
     7<table border=0 cellpadding="4" cellspacing="4"> 
     8<tr><td colspan="${screen.exonVOResult?size}" style="background-color:#ffdddd;">${screen.proteinDomainVO.name}</td></tr> 
     9<tr><#list screen.exonVOResult as exonVO><td align="center" width="${exonVO.length}px"><a href="molgenis.do?__target=${screen.name}&__action=findMutations&exon=${exonVO.number_}&snpbool=1">${exonVO.number_}</a></td></#list></tr> 
     10<tr><#list screen.exonVOResult as exonVO><td align="center"><table width="${exonVO.length}px" border="1" style="background-color:#ffffdd; border-color:#ff0000;"><tr><td>${exonVO.length}</td></tr></table></td></#list></tr> 
     11</table> 
     12</p> 
     13 
     14<#else> 
     15 
    316<form method="post" enctype="multipart/form-data" name="${screen.name}"> 
    417        <!--needed in every form: to redirect the request to the right screen--> 
     
    2639<#--begin your plugin-->         
    2740 
     41<h1>${screen.getName()}</h1> 
    2842<p> 
    2943<table> 
     
    7084</tr> 
    7185<tr> 
    72         <td colspan="4"><table border="1"><tr> 
     86        <td colspan="4"> 
     87                <table border="1"> 
     88                <tr> 
    7389                <#list screen.mutationService.proteinDomains as domain> 
    7490                <#assign firstExonVO = screen.mutationService.findExonsByProteinDomainId(domain.id)?first> 
    7591                <#assign lastExonVO = screen.mutationService.findExonsByProteinDomainId(domain.id)?last> 
    76                 <td style="background-color:#ffdddd;">${domain.name} (exon ${firstExonVO.number_}-${lastExonVO.number_}) 
    77                 </td> 
     92                <td style="background-color:#ffdddd;"><a href="molgenis.do?__target=${screen.name}&__action=showProteinDomain&id=${domain.id}">${domain.name} (exon ${firstExonVO.number_}-${lastExonVO.number_})</a></td> 
    7893                </#list> 
    79         </tr></table></td> 
     94                </tr> 
     95                </table> 
     96        </td> 
    8097</tr> 
    8198</table> 
     
    84101<hr/> 
    85102 
    86 <#if screen.exonVOResult?size == 0 && screen.mutationVOResult?size == 0> 
     103<#if screen.action?starts_with("find") && screen.exonVOResult?size == 0 && screen.mutationVOResult?size == 0 && screen.proteinDomainVOResult?size == 0> 
    87104No results found. You might want to formulate a less restrictive query. 
    88105</#if> 
    89106 
    90 <!-- 
    91 <iframe src="http://www.heise.de/" width="100%" height="200" name="ExonView"> 
     107<#if screen.proteinDomainVOResult?size == 1> 
     108<#assign proteinDomainVO = screen.proteinDomainVOResult?first> 
     109<iframe src="molgenis.do?__target=View&select=ProteinDomain&id=${proteinDomainVO.id}" width="95%" height="200" name="ProteinDomainView"> 
    92110</iframe> 
    93 --> 
     111</#if> 
    94112 
    95113<#if screen.exonVOResult?size &gt; 0> 
     
    115133<table border="1"> 
    116134<tr style="background-color:#eeeeee;"> 
     135<td>No</td> 
    117136<td>cDNA</td> 
    118137<td>gDNA</td> 
     
    132151</tr> 
    133152<tr> 
     153<td>${screen.mutationVOResult?seq_index_of(mutationVO) + 1}</td> 
    134154<td>${mutationVO.cdna_notation}</td> 
    135155<td>${mutationVO.gdna_notation}</td> 
     
    156176<table border="1"> 
    157177<tr style="background-color:#eeeeee;"> 
     178<td>No</td> 
    158179<td>cDNA</td> 
    159180<td>Protein</td> 
     
    165186<#list screen.mutationVOOther as othermutationVO> 
    166187<tr> 
     188<td>${screen.mutationVOOther?seq_index_of(othermutationVO) + 1}</td> 
    167189<td>${othermutationVO.cdna_notation}</td> 
    168190<td>(to be implemented)</td> 
     
    190212        </div> 
    191213</form> 
     214 
     215</#if> 
     216 
    192217</#macro> 
  • molgenis_projects/col7a1/handwritten/java/plugin/ui/SearchPlugin.java

    r2683 r2697  
    3030public class SearchPlugin extends PluginModel 
    3131{ 
     32        private String action = "init"; 
    3233        private MutationService mutationService; 
    3334        private QueryParametersVO queryParametersVO; 
    34          
     35 
    3536        private List<ExonVO> exonVOResult; 
    3637        private List<MutationVO> mutationVOResult; 
    3738        private List<MutationVO> mutationVOOther; 
     39        private ProteinDomainVO proteinDomainVO; 
     40        private List<ProteinDomainVO> proteinDomainVOResult; 
    3841         
    3942        public SearchPlugin(String name, ScreenModel parent) 
     
    4548        private void init() 
    4649        { 
    47                 this.queryParametersVO = new QueryParametersVO(); 
    48  
    49                 this.exonVOResult      = new ArrayList<ExonVO>(); 
    50                 this.mutationVOResult  = new ArrayList<MutationVO>(); 
    51                 this.mutationVOOther   = new ArrayList<MutationVO>(); 
     50                this.queryParametersVO     = new QueryParametersVO(); 
     51 
     52                this.exonVOResult          = new ArrayList<ExonVO>(); 
     53                this.mutationVOResult      = new ArrayList<MutationVO>(); 
     54                this.mutationVOOther       = new ArrayList<MutationVO>(); 
     55                this.proteinDomainVOResult = new ArrayList<ProteinDomainVO>(); 
    5256        } 
    5357 
     
    7983//                      this.mutationVOResult = mutationService.findMutations(id, cdna_notation, type, reportedSNP, exonId); 
    8084                         
    81                         String action = request.getAction(); 
     85                        this.action = request.getAction(); 
    8286                         
    83                          
     87                        if (this.action.equals("findMutations")) 
     88                        { 
    8489                        if (request.getString("snpbool").equals("1")) 
    8590                                this.queryParametersVO.setShowSNP(true); 
     
    8792                        if (StringUtils.isNotEmpty(request.getString("mutation"))) 
    8893                        { 
    89                                 this.queryParametersVO.setMutationId(Integer.valueOf(request.getString("mutation"))); 
    90                                 this.mutationVOResult = mutationService.findMutationById(this.queryParametersVO.getMutationId(), request.getBool("snpbool")); 
     94                                this.queryParametersVO.setMutationId(request.getInt("mutation")); 
     95                                this.mutationVOResult = this.mutationService.findMutationById(this.queryParametersVO.getMutationId(), request.getBool("snpbool")); 
    9196                                for (MutationVO mutationVO : this.mutationVOResult) 
    92                                         this.mutationVOOther.addAll(mutationService.findMutationsByPosition(mutationVO.getPosition(), request.getBool("snpbool"))); 
     97                                        this.mutationVOOther.addAll(this.mutationService.findMutationsByPosition(mutationVO.getPosition(), request.getBool("snpbool"))); 
    9398                        } 
    9499                        else if (StringUtils.isNotEmpty(request.getString("variation")) && 
     
    96101                        { 
    97102                                this.queryParametersVO.setMutationName(request.getString("variation")); 
    98                                 this.mutationVOResult = mutationService.findMutationByCdna_notation(this.queryParametersVO.getMutationName(), request.getBool("snpbool")); 
     103                                this.mutationVOResult = this.mutationService.findMutationByCdna_notation(this.queryParametersVO.getMutationName(), request.getBool("snpbool")); 
    99104                                for (MutationVO mutationVO : this.mutationVOResult) 
    100                                         this.mutationVOOther.addAll(mutationService.findMutationsByPosition(mutationVO.getPosition(), request.getBool("snpbool"))); 
     105                                        this.mutationVOOther.addAll(this.mutationService.findMutationsByPosition(mutationVO.getPosition(), request.getBool("snpbool"))); 
    101106                        } 
    102107                        else if (StringUtils.isNotEmpty(request.getString("nuclno")) && 
     
    104109                        { 
    105110                                this.queryParametersVO.setMutationPosition(request.getString("nuclno")); 
    106                                 this.mutationVOResult = mutationService.findMutationsByPosition(Integer.valueOf(this.queryParametersVO.getMutationPosition()), request.getBool("snpbool")); 
     111                                this.mutationVOResult = this.mutationService.findMutationsByPosition(Integer.valueOf(this.queryParametersVO.getMutationPosition()), request.getBool("snpbool")); 
    107112                                for (MutationVO mutationVO : mutationVOResult) 
    108                                         this.exonVOResult.add(mutationService.findExonById(mutationVO.getExonId())); 
     113                                        this.exonVOResult.add(this.mutationService.findExonById(mutationVO.getExonId())); 
    109114                                for (MutationVO mutationVO : this.mutationVOResult) 
    110                                         this.mutationVOOther.addAll(mutationService.findMutationsByPosition(mutationVO.getPosition(), request.getBool("snpbool"))); 
     115                                        this.mutationVOOther.addAll(this.mutationService.findMutationsByPosition(mutationVO.getPosition(), request.getBool("snpbool"))); 
    111116                        } 
    112117                        else if (StringUtils.isNotEmpty(request.getString("aano")) && 
     
    120125                        { 
    121126                                this.queryParametersVO.setExonNumber(request.getString("exon")); 
    122                                 this.exonVOResult     = mutationService.findExonsByNumber(Integer.valueOf(this.queryParametersVO.getExonNumber())); 
     127                                this.exonVOResult     = this.mutationService.findExonsByNumber(Integer.valueOf(this.queryParametersVO.getExonNumber())); 
    123128                                for (ExonVO exonVO : this.exonVOResult) 
    124129                                        this.mutationVOResult.addAll(mutationService.findMutationByExonId(exonVO.getId(), request.getBool("snpbool"))); 
     
    126131                        else if (StringUtils.isNotEmpty(request.getString("exonlist"))) 
    127132                        { 
    128                                 this.queryParametersVO.setExonId(Integer.valueOf(request.getString("exonlist"))); 
    129                                 ExonVO exonVO         = mutationService.findExonById(this.queryParametersVO.getExonId()); 
     133                                this.queryParametersVO.setExonId(request.getInt("exonlist")); 
     134                                ExonVO exonVO         = this.mutationService.findExonById(this.queryParametersVO.getExonId()); 
    130135                                this.exonVOResult.add(exonVO); 
    131                                 this.mutationVOResult = mutationService.findMutationByExonId(exonVO.getId(), request.getBool("snpbool")); 
     136                                this.mutationVOResult = this.mutationService.findMutationByExonId(exonVO.getId(), request.getBool("snpbool")); 
    132137                        } 
    133138                        else if (StringUtils.isNotEmpty(request.getString("type"))) 
    134139                        { 
    135140                                this.queryParametersVO.setMutationType(request.getString("type")); 
    136                                 this.mutationVOResult = mutationService.findMutationByType(this.queryParametersVO.getMutationType(), request.getBool("snpbool")); 
     141                                this.mutationVOResult = this.mutationService.findMutationByType(this.queryParametersVO.getMutationType(), request.getBool("snpbool")); 
    137142                        } 
    138143                        else if (StringUtils.isNotEmpty(request.getString("domain"))) 
    139144                        { 
    140                                 this.queryParametersVO.setProteinDomainId(Integer.valueOf(request.getString("domain"))); 
    141                                 this.exonVOResult     = mutationService.findExonsByProteinDomainId(this.queryParametersVO.getProteinDomainId()); 
     145                                this.queryParametersVO.setProteinDomainId(request.getInt("domain")); 
     146                                ProteinDomainVO proteinDomainVO = this.mutationService.findProteinDomainById(this.queryParametersVO.getProteinDomainId()); 
     147                                this.proteinDomainVOResult.add(proteinDomainVO); 
     148                        } 
     149                        } 
     150                        else if (this.action.equals("showProteinDomain")) 
     151                        { 
     152                                this.proteinDomainVO = this.mutationService.findProteinDomainById(request.getInt("id")); 
     153                                this.exonVOResult    = this.mutationService.findExonsByProteinDomainId(proteinDomainVO.getId()); 
    142154                        } 
    143155                } 
     
    163175        } 
    164176         
     177        public String getAction() 
     178        { 
     179                return this.action; 
     180        } 
     181 
    165182        public MutationService getMutationService() 
    166183        { 
     
    187204                return this.mutationVOOther; 
    188205        } 
     206         
     207        public ProteinDomainVO getProteinDomainVO() 
     208        { 
     209                return this.proteinDomainVO; 
     210        } 
     211 
     212        public List<ProteinDomainVO> getProteinDomainVOResult() 
     213        { 
     214                return this.proteinDomainVOResult; 
     215        } 
    189216} 
  • molgenis_projects/col7a1/handwritten/java/service/MutationService.java

    r2683 r2697  
    106106        } 
    107107         
     108        public ProteinDomainVO findProteinDomainById(Integer id) throws Exception 
     109        { 
     110                ProteinDomain proteinDomain = this.db.findById(ProteinDomain.class, id); 
     111                return toProteinDomainVO(proteinDomain); 
     112        } 
     113 
    108114        public List<ExonVO> getExons() throws Exception 
    109115        { 
  • molgenis_projects/col7a1/molgenis_ui.xml

    r2660 r2697  
    2626--> 
    2727                <menu name="Upload"> 
    28                         <form name="Gene" entity="Gene"/> 
    29                         <form name="ProteinDomain" entity="ProteinDomain"/> 
    30                         <form name="Exon" entity="Exon"/> 
    31                         <form name="Mutation" entity="Mutation"/> 
    32                         <form name="Patient" entity="Patient"/> 
    33                         <form name="Phenotype" entity="Phenotype"/> 
    34                         <form name="Publication" entity="Publication"/> 
    35                         <form name="Antibody" entity="Antibody"/> 
    36                         <form name="AntibodyValue" entity="I_F_Antibody"/> 
    37                         <form name="IF" entity="I_F"/> 
    38                         <form name="EM" entity="E_M"/> 
     28                        <form name="GeneUpload" entity="Gene"/> 
     29                        <form name="ProteinDomainUpload" entity="ProteinDomain"/> 
     30                        <form name="ExonUpload" entity="Exon"/> 
     31                        <form name="MutationUpload" entity="Mutation"/> 
     32                        <form name="PatientUpload" entity="Patient"/> 
     33                        <form name="PhenotypeUpload" entity="Phenotype"/> 
     34                        <form name="PublicationUpload" entity="Publication"/> 
     35                        <form name="AntibodyUpload" entity="Antibody"/> 
     36                        <form name="AntibodyValueUpload" entity="I_F_Antibody"/> 
     37                        <form name="IFUpload" entity="I_F"/> 
     38                        <form name="EMUpload" entity="E_M"/> 
    3939                </menu> 
    4040                <plugin name="Contact" type="plugin.ui.ContactPlugin"/> 
Note: See TracChangeset for help on using the changeset viewer.