Update of /cvsroot/nmrshiftdb/nmrshiftdb/src/java/org/openscience/nmrshiftdb/portlets
In directory usw-pr-cvs1:/tmp/cvs-serv12820/java/org/openscience/nmrshiftdb/portlets
Modified Files:
SubmitPortlet.java
Log Message:
Index: SubmitPortlet.java
===================================================================
RCS file: /cvsroot/nmrshiftdb/nmrshiftdb/src/java/org/openscience/nmrshiftdb/portlets/SubmitPortlet.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** SubmitPortlet.java 22 Feb 2002 16:11:19 -0000 1.3
--- SubmitPortlet.java 26 Feb 2002 17:01:23 -0000 1.4
***************
*** 13,16 ****
--- 13,18 ----
import org.openscience.nmrshiftdb.utils.*;
+ import java.io.*;
+
/**
* Description of the Class
***************
*** 82,85 ****
--- 84,90 ----
}
}
+ if(action!=null&&action.equals("submitMolecule")){
+ subData.setMolecule(req.getParameter("MolTxt"));
+ }
int tableSize;
if(subData.getSignalstable().size()<10)
***************
*** 90,103 ****
returnValue+="<p><bold>"+messages+"</bold></p>";
returnValue+="<table border=\"3\"><tr><th>Draw your structure</th><th colspan=\"3\">Here the assignment which will be uploaded</th><th>Enter your spectral data here</th></tr><tr><td rowspan=\"";
! returnValue+=tableSize+"\">";
! //Here our applet
! returnValue+="<APPLET WIDTH=400 HEIGHT=400 NAME=\"MView\" CODEBASE=\"/jetspeed/nmrshiftdb\" ARCHIVE=\"marvin.jar\" CODE=\"MView\" MAYSCRIPT></APPLET><br>";
! returnValue+="<APPLET WIDTH=400 HEIGHT=400 NAME=\"MSketch\" CODEBASE=\"/jetspeed/nmrshiftdb\" ARCHIVE=\"marvin.jar\" CODE=\"MSketch\" MAYSCRIPT></APPLET><br>";
! returnValue+="<a href=\"javascript:alert(document.MSketch.geetMol(\'smiles\'))\">Submit the atom</a></td><td>Atom No.</td><td>Shift</td><td>Intensity</td>";
returnValue+="<td rowspan=\"";
returnValue+=tableSize+"\"><form action=\"/jetspeed/portal/\" name=\"spectrumForm\" method=\"post\"><input type=\"hidden\" name=\"nmrshiftdbaction\" value=\"submitSpectrumForAssignment\"><textarea name=\"spectrum\" cols=\"10\" rows=\"10\"></textarea><br><input type=\"submit\" value=\"Submit the Spectrum\"></form></td></tr>";
returnValue+="<form action=\"/jetspeed/portal/\" method=\"post\"><input type=\"hidden\" name=\"nmrshiftdbaction\" value=\"submitAssignments\">";
for(int i=0;i<subData.getSignalstable().size();i++){
! returnValue+="<tr><td><select name=\"atomSelect"+i+"\" size=\"1\">";
for(int k=0;k<subData.getSignalstable().size();k++){
if(k==((IntTriple)subData.getSignalstable().get(i)).value3)
--- 95,148 ----
returnValue+="<p><bold>"+messages+"</bold></p>";
returnValue+="<table border=\"3\"><tr><th>Draw your structure</th><th colspan=\"3\">Here the assignment which will be uploaded</th><th>Enter your spectral data here</th></tr><tr><td rowspan=\"";
! returnValue+=tableSize+"\">Click to draw your molecule!<br>";
! returnValue+="<script LANGUAGE=\"JavaScript1.1\" SRC=\"/jetspeed/nmrshiftdb/marvin.js\"></script>\n";
! returnValue+="<script LANGUAGE=\"JavaScript1.1\">\n";
! returnValue+="<!--\n";
! returnValue+="function exportMol(format) {\n";
! returnValue+="if(document.MSketch != null) {\n";
! returnValue+="var s = document.MSketch.getMol(format);\n";
! returnValue+="s = unix2local(s);\n";
! returnValue+="document.MolForm.MolTxt.value=s;\n";
! returnValue+="} else {\n";
! returnValue+="alert(\"Cannot import molecule: no JavaScript to Java communication in your browser.\");\n";
! returnValue+="}\n";
! returnValue+="}\n";
! returnValue+="function unselectandselect(b){\n";
! returnValue+="document.MView.selectAllAtoms(0,false);\n";
! returnValue+="document.MView.selectAtom(0,b,true);\n";
! returnValue+="}\n";
! returnValue+="msketch_name = \"MSketch\";\n";
! returnValue+="msketch_begin(\"/jetspeed/nmrshiftdb\", 100, 300);\n";
! returnValue+="msketch_param(\"autoscale\", \"true\");\n";
! returnValue+="msketch_param(\"detach\", \"hide\");\n";
! returnValue+="msketch_param(\"menubar\",\"false\");\n";
! returnValue+="msketch_end();\n";
! returnValue+="mview_name = \"MView\";\n";
! returnValue+="mview_begin(\"/jetspeed/nmrshiftdb\", 300, 300);\n";
! File outputFile = new File("/usr/local/jakarta-tomcat-3.3a/webapps/jetspeed/nmrshiftdb/temp.mol");
! try{
! FileWriter out=new FileWriter(outputFile);
! out.write(subData.getMolecule());
! out.close();
! }
! catch(Exception e){
! System.out.println(e.getMessage());
! }
! if(!subData.getMolecule().equals("")){
! returnValue+="mview_param(\"mol\",\"temp.mol\");\n";
! }
! returnValue+="mview_end();\n";
! returnValue+="//-->\n";
! returnValue+="</script>\n";
! returnValue+="<form action=\"/jetspeed/portal/\" method=\"post\" NAME=\"MolForm\">";
! returnValue+="<input type=\"hidden\" name=\"MolTxt\" value=\""+subData.getMolecule()+"\">";
! returnValue+="<input type=\"hidden\" name=\"nmrshiftdbaction\"value=\"submitMolecule\">";
! returnValue+="<input TYPE=\"submit\" VALUE=\"Submit molecule\" onClick=\"exportMol(\'mol\')\"></form>";
! returnValue+="</td><td>Atom No.</td><td>Shift</td><td>Intensity</td>";
returnValue+="<td rowspan=\"";
returnValue+=tableSize+"\"><form action=\"/jetspeed/portal/\" name=\"spectrumForm\" method=\"post\"><input type=\"hidden\" name=\"nmrshiftdbaction\" value=\"submitSpectrumForAssignment\"><textarea name=\"spectrum\" cols=\"10\" rows=\"10\"></textarea><br><input type=\"submit\" value=\"Submit the Spectrum\"></form></td></tr>";
returnValue+="<form action=\"/jetspeed/portal/\" method=\"post\"><input type=\"hidden\" name=\"nmrshiftdbaction\" value=\"submitAssignments\">";
for(int i=0;i<subData.getSignalstable().size();i++){
! returnValue+="<tr><td><select name=\"atomSelect"+i+"\" size=\"1\" onChange=\"unselectandselect(this.value)\">";
for(int k=0;k<subData.getSignalstable().size();k++){
if(k==((IntTriple)subData.getSignalstable().get(i)).value3)
|