Changeset 3240
- Timestamp:
- Apr 12, 2007, 1:01:22 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/tab2mage_ebi/src/plugins/core/net/sf/basedb/plugins/Tab2MageWriter.java
r3229 r3240 2 2 3 3 import java.io.BufferedWriter; 4 import java.io.IOException; 4 5 import java.io.OutputStreamWriter; 5 6 import java.io.UnsupportedEncodingException; … … 55 56 new BaseException(e); 56 57 } 57 //statusOut.write(" Please check the messages below for the status of the export");58 58 59 } 59 60 60 61 /** 61 62 writes the tab2mage file 62 @param experiment , the experiment to export which wasselected by the user on the GUI63 @param protocols , the protocls used wthin the experiment64 @param hybSectionHeader , a set containing the hybridization section headers65 @param hybDataRows , list of hybridization data rows66 @param job , the job parameter values67 @param response , the reasponse object68 @param dc , the client database control object69 */ 70 // not checking for null parameters here, it is assumed it been catered for in the calling metthod71 public static void writeTab2MageFile(Experiment experiment, Set<Protocol> protocols, Set<String> hybSectionHeader, List<String> hybDataRows,72 ParameterValues job, Response response, DbControl dc)63 @param experiment 64 @param protocols 65 @param hybSectionHeader 66 @param hybDataRows 67 @param job 68 @param response 69 @param dc 70 */ 71 // not checking for null parameters here, it is assumed it's been catered for in the calling method 72 public static void writeTab2MageFile(Experiment experiment, Set<Protocol> protocols, Set<String> hybSectionHeader, 73 List<String> hybDataRows, ParameterValues job, Response response, DbControl dc) 73 74 { 74 75 /* … … 89 90 90 91 } 91 92 /** 93 writes Tab2Mage experiment section 94 @param experiment, the experiment to write 95 @param response, the reponse object to reytun failures or expceptions 96 @param job, the job parameter values for the plugin 97 */ 92 98 private static void writeTab2MageExperimentSection(Experiment experiment, ParameterValues job, Response response) 93 99 { 94 100 try 95 101 { 102 statusOut.write(" Please check the messages below for the status of the export"); //not part of experiment and may be moved elsewhere. 103 96 104 out.write("# This file contains an experiment exported in tab2mage specification from BASE\n\n"); 97 105 out.write("Experiment section \n"); … … 123 131 response.setError(ex.getMessage(), Arrays.asList(ex)); 124 132 } 125 finally 126 { 127 128 } 129 } 130 133 } 134 /** 135 writes Tab2Mage protocol section 136 @param protocols, list of protocols to write 137 @param response, the reponse object to return failures or exceptions 138 @param dc, database control object 139 */ 131 140 private static void writeTab2MageProtocolSection(Set<Protocol> protocols, DbControl dc, Response response) 132 141 { … … 167 176 response.setError(ex.getMessage(), Arrays.asList(ex)); 168 177 } 169 finally 170 { 171 172 } 173 } 174 /** 175 Tab2Mage Hybridization Header Section 178 } 179 /** 180 writes Tab2Mage hybridization header section 176 181 @param hybSectionHeader, the header to display 177 @param response, the reponse object to reytun failures 182 @param response, the reponse object to reytun failures or expceptions 178 183 */ 179 184 … … 189 194 } 190 195 out.write("\n"); 191 }192 catch(Throwable ex)193 {194 response.setError(ex.getMessage(), Arrays.asList(ex));195 }196 196 out.flush(); 197 } 198 catch(Throwable ex) 199 { 200 response.setError(ex.getMessage(), Arrays.asList(ex)); 201 } 197 202 } 198 203 199 204 /** 200 205 Tab2Mage Hybridization Channel Line Section 201 @param hyb SectionHeader, the headerto display202 @param response, the reponse object to return failures 206 @param hybDataRow, the data rows to display 207 @param response, the reponse object to return failures or expceptions 203 208 */ 204 209 … … 220 225 } 221 226 out.write("\n"); 227 out.flush(); 222 228 } 223 229 catch(Throwable ex) … … 227 233 228 234 } 235 236 /** 237 closes the file writers 238 */ 239 public static void closeWriter() 240 { 241 try 242 { 243 if (out!= null) out.close(); 244 if (statusOut!=null) statusOut.close(); 245 } 246 catch(Throwable ex) 247 { 248 new IOException(ex.getMessage()); 249 } 250 } 251 229 252 /** 230 253 gets the file writer for the tab2mage file … … 251 274 } 252 275 253 254 276 }
Note: See TracChangeset
for help on using the changeset viewer.