Changeset 515
- Timestamp:
- Dec 7, 2007, 11:56:19 AM (15 years ago)
- Location:
- branches/uk_ac_ebi_Tab2MageImporter
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/uk_ac_ebi_Tab2MageImporter/build.xml
r511 r515 69 69 70 70 <target name="copyToServer" depends="build.plugin,copyJSPs"> 71 <copy file="${plugin.name}.jar" todir=" C:\tomcat\apache-tomcat-6.0.13\webapps\base\WEB-INF\lib" verbose="true" />71 <copy file="${plugin.name}.jar" todir="${tomcat.home}\webapps\base\WEB-INF\lib" verbose="true" /> 72 72 <!-- now restart tomcat to reload the application --> 73 73 <echo message="tomcat home = "/> -
branches/uk_ac_ebi_Tab2MageImporter/src/uk/ac/ebi/nugo/plugins/Tab2MageImporter.java
r513 r515 153 153 System.out.println("configure()"); 154 154 String command = request.getCommand(); 155 System.out.println(" command = " + command);155 System.out.println(" configure request = " +request + ", command = " + request.getCommand()); 156 156 157 157 try … … 348 348 { 349 349 System.out.println("running Tab2MageImporter plugin"); 350 response.setDone("Import plugin ended successfully");351 350 System.out.println(" run request = " +request + ", command = " + request.getCommand()); 351 352 352 353 353 DbControl dc=null; … … 381 381 // save the new subDir 382 382 dc.saveItem(subDir); 383 384 if(dc==null) 385 dc = sc.newDbControl(); 383 386 384 387 // String directoryName = (String)job.getValue("directory"); … … 415 418 //now write the tab2mage file to the user's home dir on the server so it can be consumed by the plugin 416 419 //this takes all the inputs provided by the user on the custom interface (input.jsp) 417 //give the file a unique name so we don't get any conflicts 418 //use code from tab2mage exporter to do so 419 420 //PluginConfigurationRequest pcRequest = (PluginConfigurationRequest) sc.getSessionSetting("plugin.configure.request"); 421 Tab2MageWriter t2mWriter = new Tab2MageWriter(request, dir,dc); 420 //give the file a unique name so we don't get any conflicts 421 Tab2MageWriter t2mWriter = new Tab2MageWriter(job, dir,sc); 422 422 t2mWriter.writeTab2MageFile(); 423 423 424 424 425 425 ///////////////////////////////////////////////////////////////////////////////////////////////// … … 567 567 // -- end of messaging module 568 568 */ 569 dc.commit();569 //dc.commit(); 570 570 response.setDone("Import plugin ended successfully"); 571 571 } -
branches/uk_ac_ebi_Tab2MageImporter/src/uk/ac/ebi/nugo/plugins/Tab2MageWriter.java
r514 r515 9 9 import net.sf.basedb.core.PermissionDeniedException; 10 10 import net.sf.basedb.core.PluginConfigurationRequest; 11 import net.sf.basedb.core.SessionControl; 12 import net.sf.basedb.core.plugin.ParameterValues; 11 13 import net.sf.basedb.core.plugin.Request; 12 14 … … 15 17 //===================================================vars================================================ 16 18 17 int num Subjects;19 int numReplicates; 18 20 int numTissues; 19 21 int numTreatments; 20 Request pcRequest ;21 22 Directory dir; 22 DbControl dc;23 SessionControl sc; 23 24 24 25 // ===================================================c'tor================================================ 25 26 26 public Tab2MageWriter( Request pcRequest,Directory dir,DbControl dc)27 public Tab2MageWriter(ParameterValues job,Directory dir,SessionControl sc) 27 28 { 28 this.pcRequest = pcRequest;29 29 this.dir = dir; 30 this.dc = dc; 30 this.sc = sc; 31 32 //get values for the parameters we need here 33 int numReplicates = Integer.parseInt((String)job.getValue("numReplicates")); 34 int numTreatments = Integer.parseInt((String)job.getValue("numTreatments")); 35 String tissues = (String)job.getValue("tissues"); 36 int numTissues = tissues.split(",").length; 31 37 32 //get values for the parameters we need here 33 int numSubjects = Integer.parseInt((String)pcRequest.getParameterValue("numReplicates")); 34 int numTreatments = Integer.parseInt((String)pcRequest.getParameterValue("numTreatments")); 35 String tissues = (String)pcRequest.getParameterValue("tissues"); 36 int numTissues = tissues.split(",").length; 38 System.out.println("numReplicates extracted from job = " +numReplicates); 37 39 } 38 40 … … 48 50 { 49 51 //set up a file writer 52 DbControl dc = sc.newDbControl(); 50 53 net.sf.basedb.core.File t2mFile = net.sf.basedb.core.File.getNew(dc, dir); 51 t2mFile.setName("tab2mage.txt"); 54 System.out.println("dir for writing new tab2mage file = "+dir.getName()); 55 t2mFile.setName("tab2mage.txt"); 56 dc.saveItem(t2mFile); 57 58 if(dc==null) 59 dc = sc.newDbControl(); 60 52 61 Writer out= new BufferedWriter(new OutputStreamWriter(t2mFile.getUploadStream(false),"ISO-8859-1")); 53 62 … … 57 66 //close writer 58 67 if (out!= null) out.close(); 68 69 dc.commit(); 70 if(dc!=null) 71 dc.close(); 59 72 } 60 73 catch (Exception e) … … 67 80 { 68 81 //Number of hybridizations (NH) = Number of subjects (NS) x Number of Target Tissue (NTT) x Number of Study groups (NSG) 69 return num Subjects * numTissues * numTreatments;82 return numReplicates * numTissues * numTreatments; 70 83 71 84 }
Note: See TracChangeset
for help on using the changeset viewer.