Changeset 3767
- Timestamp:
- Aug 16, 2010, 3:00:39 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/client/servlet/src/org/proteios/action/mascot/ViewActiveMascotParameterSetStorage.java
r3297 r3767 63 63 throws ActionException, InvalidParameterValue 64 64 { 65 /***********************************************************************66 * Properties67 */68 65 // Get the MascotParameterSetStorage item to use for the search 69 Integer mascotpssId = getValidInteger(VMASCOTPARAMETERSETSTORAGEID); 66 Integer mascotpssId; 67 Boolean useWebInterfaceFlag; 68 String mascotSearchUserName, mascotSearchUserEmail; 69 DbControl dc; 70 ItemFactory factory; 71 MascotParameterSetStorage mascotpss; 72 MascotParameterFileUtil fileUtil; 73 InputStream iStream; 74 MascotParameterSet mascotParameterSet; 75 MascotParameterSetOptionsUtil util; 76 Form mascotParameterSetForm; 77 Toolbar toolbar; 78 ActionLink save,saveAs,searchMascot,saveAsAndSearchMascot; 79 RowLayout layout; 80 Title title; 81 List<Integer> spectrumFileIds, mascotpssIds; 82 List<String> enzymeStringList; 83 List<Option> enzymeOptionList; 84 List<String> missedCleavagesStringList; 85 List<Option> missedCleavagesOptionList; 86 List<String> sequenceLibraryStringList; 87 List<Option> sequenceLibraryOptionList; 88 List<String> speciesStringList; 89 List<Option> speciesOptionList; 90 List<String> fixedModsStringList; 91 List<Option> fixedModsOptionList; 92 List<String> variableModsStringList; 93 List<Option> variableModsOptionList; 94 List<String> quantitationStringList; 95 List<Option> quantitationOptionList; 96 List<String> peptideTolUnitStringList; 97 List<Option> peptideTolUnitOptionList; 98 List<String> peptideIsotopeErrorStringList; 99 List<Option> peptideIsotopeErrorOptionList; 100 List<String> msMsTolUnitStringList; 101 List<Option> msMsTolUnitOptionList; 102 List<String> peptideChargeStringList; 103 List<Option> peptideChargeOptionList; 104 List<String> dataFormatStringList; 105 List<Option> dataFormatOptionList; 106 List<String> instrumentStringList; 107 List<Option> instrumentOptionList; 108 List<String> reportTopStringList; 109 List<Option> reportTopOptionList; 110 // Define 111 112 mascotpssId = getValidInteger(VMASCOTPARAMETERSETSTORAGEID); 113 useWebInterfaceFlag = getValidBoolean(SearchMascot.VMASCOTUSEWEBINTERFACEFLAG); 114 115 if (useWebInterfaceFlag == null) 116 { 117 useWebInterfaceFlag = true; 118 } 119 // Optional Mascot search user data 120 mascotSearchUserName = getValidString(SearchMascot.VMASCOT_SEARCH_USER_NAME); 121 mascotSearchUserEmail = getValidString(SearchMascot.VMASCOT_SEARCH_USER_EMAIL); 122 70 123 log.debug("mascotParameterSetStorageId from VMASCOTPARAMETERSETSTORAGEID = " + mascotpssId); 71 // Get the MascotParameterSetStorage item to use for the search72 Boolean useWebInterfaceFlag = getValidBoolean(SearchMascot.VMASCOTUSEWEBINTERFACEFLAG);73 124 log.debug("useWebInterfaceFlag from SearchMascot.VMASCOTUSEWEBINTERFACEFLAG = " + useWebInterfaceFlag); 74 if (useWebInterfaceFlag == null)75 {76 useWebInterfaceFlag = true;77 }78 125 log.debug("useWebInterfaceFlag = " + useWebInterfaceFlag); 79 // SearchMascot.VMASCOTUSEWEBINTERFACEFLAG80 // Get optional Mascot search user data81 String mascotSearchUserName = getValidString(SearchMascot.VMASCOT_SEARCH_USER_NAME);82 String mascotSearchUserEmail = getValidString(SearchMascot.VMASCOT_SEARCH_USER_EMAIL);83 126 log.debug("mascotSearchUserName = \"" + mascotSearchUserName + "\""); 84 127 log.debug("mascotSearchUserEmail = \"" + mascotSearchUserEmail + "\""); … … 86 129 if (mascotpssId == null || mascotpssId == 0) 87 130 { 88 List<Integer>mascotpssIds = getValidIntegerList(FormFactory.VID);131 mascotpssIds = getValidIntegerList(FormFactory.VID); 89 132 log.debug("mascotpssIds from FormFactory.VID = " + mascotpssIds); 90 133 // Make sure at least one file has been selected … … 99 142 log.debug("mascotpssId = " + mascotpssId); 100 143 // Get the spectrum file items to use for the search 101 List<Integer>spectrumFileIds = getValidIntegerList(SearchMascot.VSPECTRUMFILEID);144 spectrumFileIds = getValidIntegerList(SearchMascot.VSPECTRUMFILEID); 102 145 log.debug("spectrumFileIds = " + spectrumFileIds); 103 // 104 DbControl dc = newDbControl(); 105 ItemFactory factory = getItemFactory(dc); 106 MascotParameterSetStorage mascotpss = factory.getById(MascotParameterSetStorage.class, mascotpssId); 146 dc = newDbControl(); 147 factory = getItemFactory(dc); 148 mascotpss = factory.getById(MascotParameterSetStorage.class, mascotpssId); 107 149 // Get Mascot parameter data from xml file 108 MascotParameterFileUtil mascotParameterFileUtil = new MascotParameterFileUtil(); 109 InputStream iStream = mascotpss.getParameterFile().getDownloadStream(0); 110 mascotParameterFileUtil.setXMLInputStream(iStream); 111 MascotParameterSet mascotParameterSet = mascotParameterFileUtil.fetchMascotParameterSet(); 112 // Get Mascot parameter set option alternatives 150 fileUtil = new MascotParameterFileUtil(); 151 iStream = mascotpss.getParameterFile().getDownloadStream(0); 152 fileUtil.setXMLInputStream(iStream); 153 mascotParameterSet = fileUtil.fetchMascotParameterSet(); 113 154 // Get MascotParameterSetOptionsUtil instance 114 MascotParameterSetOptionsUtil mascotParameterSetOptionUtil = new MascotParameterSetOptionsUtil(mascotParameterSet.getSearchType());115 mascotParameterSetOptionUtil.setWebInterfaceUsed(useWebInterfaceFlag);155 util = new MascotParameterSetOptionsUtil(mascotParameterSet.getSearchType()); 156 util.setWebInterfaceUsed(useWebInterfaceFlag); 116 157 // Get enzyme option data 117 List<String> enzymeStringList = mascotParameterSetOptionUtil.fetchEnzymeStringList();118 List<Option>enzymeOptionList = stringListToOptionList(enzymeStringList);158 enzymeStringList = util.fetchEnzymeStringList(); 159 enzymeOptionList = stringListToOptionList(enzymeStringList); 119 160 // Get missed cleavages option data 120 List<String> missedCleavagesStringList = mascotParameterSetOptionUtil.fetchMissedCleavagesStringList();121 List<Option>missedCleavagesOptionList = stringListToOptionList(missedCleavagesStringList);161 missedCleavagesStringList = util.fetchMissedCleavagesStringList(); 162 missedCleavagesOptionList = stringListToOptionList(missedCleavagesStringList); 122 163 // Get sequence library option data 123 List<String> sequenceLibraryStringList = mascotParameterSetOptionUtil.fetchSequenceLibraryStringList();124 List<Option>sequenceLibraryOptionList = stringListToOptionList(sequenceLibraryStringList);164 sequenceLibraryStringList = util.fetchSequenceLibraryStringList(); 165 sequenceLibraryOptionList = stringListToOptionList(sequenceLibraryStringList); 125 166 // Get species option data 126 List<String> speciesStringList = mascotParameterSetOptionUtil.fetchSpeciesStringList();127 List<Option>speciesOptionList = stringListToOptionList(speciesStringList);167 speciesStringList = util.fetchSpeciesStringList(); 168 speciesOptionList = stringListToOptionList(speciesStringList); 128 169 // Get fixed modifications option data 129 List<String> fixedModsStringList = mascotParameterSetOptionUtil.fetchModificationStringList();130 List<Option>fixedModsOptionList = stringListToOptionList(fixedModsStringList);170 fixedModsStringList = util.fetchModificationStringList(); 171 fixedModsOptionList = stringListToOptionList(fixedModsStringList); 131 172 // Get variable modifications option data 132 List<String> variableModsStringList = mascotParameterSetOptionUtil.fetchModificationStringList();133 List<Option>variableModsOptionList = stringListToOptionList(variableModsStringList);173 variableModsStringList = util.fetchModificationStringList(); 174 variableModsOptionList = stringListToOptionList(variableModsStringList); 134 175 // Get quantitation option data 135 List<String> quantitationStringList = mascotParameterSetOptionUtil.fetchQuantitationStringList();136 List<Option>quantitationOptionList = stringListToOptionList(quantitationStringList);176 quantitationStringList = util.fetchQuantitationStringList(); 177 quantitationOptionList = stringListToOptionList(quantitationStringList); 137 178 // Get peptide tolerance unit option data 138 List<String> peptideTolUnitStringList = mascotParameterSetOptionUtil.fetchPeptideTolUnitStringList();139 List<Option>peptideTolUnitOptionList = stringListToOptionList(peptideTolUnitStringList);179 peptideTolUnitStringList = util.fetchPeptideTolUnitStringList(); 180 peptideTolUnitOptionList = stringListToOptionList(peptideTolUnitStringList); 140 181 // Get peptide isotope error option data 141 List<String> peptideIsotopeErrorStringList = mascotParameterSetOptionUtil.fetchPeptideIsotopeErrorStringList();142 List<Option>peptideIsotopeErrorOptionList = stringListToOptionList(peptideIsotopeErrorStringList);182 peptideIsotopeErrorStringList = util.fetchPeptideIsotopeErrorStringList(); 183 peptideIsotopeErrorOptionList = stringListToOptionList(peptideIsotopeErrorStringList); 143 184 // Get quantitation option data 144 List<String> msMsTolUnitStringList = mascotParameterSetOptionUtil.fetchMsMsTolUnitStringList();145 List<Option>msMsTolUnitOptionList = stringListToOptionList(msMsTolUnitStringList);185 msMsTolUnitStringList = util.fetchMsMsTolUnitStringList(); 186 msMsTolUnitOptionList = stringListToOptionList(msMsTolUnitStringList); 146 187 // Get peptide charge option data 147 List<String> peptideChargeStringList = mascotParameterSetOptionUtil.fetchPeptideChargeStringList();148 List<Option>peptideChargeOptionList = stringListToOptionList(peptideChargeStringList);188 peptideChargeStringList = util.fetchPeptideChargeStringList(); 189 peptideChargeOptionList = stringListToOptionList(peptideChargeStringList); 149 190 // Get data format option data 150 List<String> dataFormatStringList = mascotParameterSetOptionUtil.fetchDataFormatStringList();151 List<Option>dataFormatOptionList = stringListToOptionList(dataFormatStringList);191 dataFormatStringList = util.fetchDataFormatStringList(); 192 dataFormatOptionList = stringListToOptionList(dataFormatStringList); 152 193 // Get instrument option data 153 List<String> instrumentStringList = mascotParameterSetOptionUtil.fetchInstrumentStringList();154 List<Option>instrumentOptionList = stringListToOptionList(instrumentStringList);194 instrumentStringList = util.fetchInstrumentStringList(); 195 instrumentOptionList = stringListToOptionList(instrumentStringList); 155 196 // Get report top option data 156 List<String> reportTopStringList = mascotParameterSetOptionUtil.fetchReportTopStringList();157 List<Option>reportTopOptionList = stringListToOptionList(reportTopStringList);197 reportTopStringList = util.fetchReportTopStringList(); 198 reportTopOptionList = stringListToOptionList(reportTopStringList); 158 199 // Mascot parameter set form 159 FormmascotParameterSetForm = getFormFactory().getMascotParameterSetForm(mascotParameterSet,200 mascotParameterSetForm = getFormFactory().getMascotParameterSetForm(mascotParameterSet, 160 201 enzymeOptionList, 161 202 missedCleavagesOptionList, … … 172 213 instrumentOptionList, 173 214 reportTopOptionList); 174 /*********************************************************************** 175 * Annotations table 176 */ 177 /* 178 Annotator anna = new Annotator(getItemFactory(dc)); 179 TableFactory tableFactory = getTableFactory(); 180 tableFactory.reset(); 181 tableFactory.setItemClass(Annotation.class); 182 ItemQuery<Annotation> annotationQuery = anna.getAnnotationSet(mascotpss) 183 .getAnnotations(); 184 tableFactory.setQuery(annotationQuery); 185 tableFactory.setMaxResults(100); 186 Table annotationsTable = tableFactory.build(); 187 */ 188 /*********************************************************************** 215 216 /*********************************************************************** 189 217 * Toolbar 190 218 */ 191 Toolbartoolbar = new Toolbar();219 toolbar = new Toolbar(); 192 220 if (spectrumFileIds == null) 193 221 { 194 222 // Save Mascot parameter set button 195 ActionLinksave = getActionLink(SaveMascotParameterSetStorage.class, "Save");223 save = getActionLink(SaveMascotParameterSetStorage.class, "Save"); 196 224 save.addParameter(VMASCOTPARAMETERSETSTORAGEID, mascotpssId); 197 225 save.addParameter(SearchMascot.VMASCOT_SEARCH_USER_NAME, mascotSearchUserName); … … 201 229 toolbar.add(save); 202 230 // "Save As" Mascot parameter set button 203 ActionLinksaveAs = getActionLink(SaveMascotParameterSetStorage.class, "SaveAs");231 saveAs = getActionLink(SaveMascotParameterSetStorage.class, "SaveAs"); 204 232 saveAs.addParameter(VMASCOTPARAMETERSETSTORAGEID, mascotpssId); 205 233 saveAs.addParameter(SearchMascot.VMASCOT_SEARCH_USER_NAME, mascotSearchUserName); … … 213 241 { 214 242 // Save and Search Mascot 215 ActionLinksearchMascot = getActionLink(SaveMascotParameterSetStorage.class, "SaveAndSearchMascot");243 searchMascot = getActionLink(SaveMascotParameterSetStorage.class, "SaveAndSearchMascot"); 216 244 searchMascot.addParameter(VMASCOTPARAMETERSETSTORAGEID, mascotpssId); 217 245 searchMascot.addParameter(SearchMascot.VMASCOT_SEARCH_USER_NAME, mascotSearchUserName); … … 226 254 toolbar.add(searchMascot); 227 255 // "Save As" and Search Mascot 228 ActionLinksaveAsAndSearchMascot = getActionLink(SaveMascotParameterSetStorage.class, "SaveAsAndSearchMascot");256 saveAsAndSearchMascot = getActionLink(SaveMascotParameterSetStorage.class, "SaveAsAndSearchMascot"); 229 257 saveAsAndSearchMascot.addParameter(VMASCOTPARAMETERSETSTORAGEID, mascotpssId); 230 258 saveAsAndSearchMascot.addParameter(SearchMascot.VMASCOT_SEARCH_USER_NAME, mascotSearchUserName); … … 244 272 * Layout 245 273 */ 246 RowLayoutlayout = getLayoutFactory().getRowLayout();247 Titletitle = new Title("MascotParameterSet");274 layout = getLayoutFactory().getRowLayout(); 275 title = new Title("MascotParameterSet"); 248 276 title.setSubtitle(mascotpss.getName()); 249 277 layout.add(title); 250 // 251 /* 252 Tab annotations = new Tab("OtherSettings", "annotationsTab"); 253 annotations.setGuiElement(annotationsTable); 254 ts.add(annotations); 255 */ 256 layout.add(mascotParameterSetForm); 278 layout.add(mascotParameterSetForm); 257 279 setLayout(layout); 258 280 } … … 272 294 return null; 273 295 } 274 List<Option> optionList = new ArrayList<Option>( 0);296 List<Option> optionList = new ArrayList<Option>(stringList.size()); 275 297 for (int i = 0; i < stringList.size(); i = i + 2) 276 298 {
Note: See TracChangeset
for help on using the changeset viewer.