Changeset 2697
- Timestamp:
- 03/09/10 18:31:18 (2 years ago)
- Location:
- molgenis_projects/col7a1
- Files:
-
- 4 edited
-
handwritten/java/plugin/ui/SearchPlugin.ftl (modified) (9 diffs)
-
handwritten/java/plugin/ui/SearchPlugin.java (modified) (10 diffs)
-
handwritten/java/service/MutationService.java (modified) (1 diff)
-
molgenis_ui.xml (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
molgenis_projects/col7a1/handwritten/java/plugin/ui/SearchPlugin.ftl
r2683 r2697 1 1 <#macro plugin_ui_SearchPlugin screen> 2 2 <!-- 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 3 16 <form method="post" enctype="multipart/form-data" name="${screen.name}"> 4 17 <!--needed in every form: to redirect the request to the right screen--> … … 26 39 <#--begin your plugin--> 27 40 41 <h1>${screen.getName()}</h1> 28 42 <p> 29 43 <table> … … 70 84 </tr> 71 85 <tr> 72 <td colspan="4"><table border="1"><tr> 86 <td colspan="4"> 87 <table border="1"> 88 <tr> 73 89 <#list screen.mutationService.proteinDomains as domain> 74 90 <#assign firstExonVO = screen.mutationService.findExonsByProteinDomainId(domain.id)?first> 75 91 <#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> 78 93 </#list> 79 </tr></table></td> 94 </tr> 95 </table> 96 </td> 80 97 </tr> 81 98 </table> … … 84 101 <hr/> 85 102 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> 87 104 No results found. You might want to formulate a less restrictive query. 88 105 </#if> 89 106 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"> 92 110 </iframe> 93 -->111 </#if> 94 112 95 113 <#if screen.exonVOResult?size > 0> … … 115 133 <table border="1"> 116 134 <tr style="background-color:#eeeeee;"> 135 <td>No</td> 117 136 <td>cDNA</td> 118 137 <td>gDNA</td> … … 132 151 </tr> 133 152 <tr> 153 <td>${screen.mutationVOResult?seq_index_of(mutationVO) + 1}</td> 134 154 <td>${mutationVO.cdna_notation}</td> 135 155 <td>${mutationVO.gdna_notation}</td> … … 156 176 <table border="1"> 157 177 <tr style="background-color:#eeeeee;"> 178 <td>No</td> 158 179 <td>cDNA</td> 159 180 <td>Protein</td> … … 165 186 <#list screen.mutationVOOther as othermutationVO> 166 187 <tr> 188 <td>${screen.mutationVOOther?seq_index_of(othermutationVO) + 1}</td> 167 189 <td>${othermutationVO.cdna_notation}</td> 168 190 <td>(to be implemented)</td> … … 190 212 </div> 191 213 </form> 214 215 </#if> 216 192 217 </#macro> -
molgenis_projects/col7a1/handwritten/java/plugin/ui/SearchPlugin.java
r2683 r2697 30 30 public class SearchPlugin extends PluginModel 31 31 { 32 private String action = "init"; 32 33 private MutationService mutationService; 33 34 private QueryParametersVO queryParametersVO; 34 35 35 36 private List<ExonVO> exonVOResult; 36 37 private List<MutationVO> mutationVOResult; 37 38 private List<MutationVO> mutationVOOther; 39 private ProteinDomainVO proteinDomainVO; 40 private List<ProteinDomainVO> proteinDomainVOResult; 38 41 39 42 public SearchPlugin(String name, ScreenModel parent) … … 45 48 private void init() 46 49 { 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>(); 52 56 } 53 57 … … 79 83 // this.mutationVOResult = mutationService.findMutations(id, cdna_notation, type, reportedSNP, exonId); 80 84 81 Stringaction = request.getAction();85 this.action = request.getAction(); 82 86 83 87 if (this.action.equals("findMutations")) 88 { 84 89 if (request.getString("snpbool").equals("1")) 85 90 this.queryParametersVO.setShowSNP(true); … … 87 92 if (StringUtils.isNotEmpty(request.getString("mutation"))) 88 93 { 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")); 91 96 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"))); 93 98 } 94 99 else if (StringUtils.isNotEmpty(request.getString("variation")) && … … 96 101 { 97 102 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")); 99 104 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"))); 101 106 } 102 107 else if (StringUtils.isNotEmpty(request.getString("nuclno")) && … … 104 109 { 105 110 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")); 107 112 for (MutationVO mutationVO : mutationVOResult) 108 this.exonVOResult.add( mutationService.findExonById(mutationVO.getExonId()));113 this.exonVOResult.add(this.mutationService.findExonById(mutationVO.getExonId())); 109 114 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"))); 111 116 } 112 117 else if (StringUtils.isNotEmpty(request.getString("aano")) && … … 120 125 { 121 126 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())); 123 128 for (ExonVO exonVO : this.exonVOResult) 124 129 this.mutationVOResult.addAll(mutationService.findMutationByExonId(exonVO.getId(), request.getBool("snpbool"))); … … 126 131 else if (StringUtils.isNotEmpty(request.getString("exonlist"))) 127 132 { 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()); 130 135 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")); 132 137 } 133 138 else if (StringUtils.isNotEmpty(request.getString("type"))) 134 139 { 135 140 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")); 137 142 } 138 143 else if (StringUtils.isNotEmpty(request.getString("domain"))) 139 144 { 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()); 142 154 } 143 155 } … … 163 175 } 164 176 177 public String getAction() 178 { 179 return this.action; 180 } 181 165 182 public MutationService getMutationService() 166 183 { … … 187 204 return this.mutationVOOther; 188 205 } 206 207 public ProteinDomainVO getProteinDomainVO() 208 { 209 return this.proteinDomainVO; 210 } 211 212 public List<ProteinDomainVO> getProteinDomainVOResult() 213 { 214 return this.proteinDomainVOResult; 215 } 189 216 } -
molgenis_projects/col7a1/handwritten/java/service/MutationService.java
r2683 r2697 106 106 } 107 107 108 public ProteinDomainVO findProteinDomainById(Integer id) throws Exception 109 { 110 ProteinDomain proteinDomain = this.db.findById(ProteinDomain.class, id); 111 return toProteinDomainVO(proteinDomain); 112 } 113 108 114 public List<ExonVO> getExons() throws Exception 109 115 { -
molgenis_projects/col7a1/molgenis_ui.xml
r2660 r2697 26 26 --> 27 27 <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"/> 39 39 </menu> 40 40 <plugin name="Contact" type="plugin.ui.ContactPlugin"/>
Note: See TracChangeset
for help on using the changeset viewer.