Changeset 615
- Timestamp:
- 10/30/12 15:52:00 (12 years ago)
- Location:
- geisa
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
geisa/.idea/libraries/lib.xml
r533 r615 56 56 <root url="jar://$PROJECT_DIR$/web/WEB-INF/lib/commons-beanutils-1.7.0.jar!/" /> 57 57 <root url="jar://$PROJECT_DIR$/web/WEB-INF/lib/mysql-connector-java-5.1.21-bin.jar!/" /> 58 <root url="jar://$PROJECT_DIR$/web/WEB-INF/lib/hibernate-c3p0-4.1.7.Final.jar!/" /> 58 59 </CLASSES> 59 60 <JAVADOC /> -
geisa/persistence/implementation/hibernate.cfg.xml
r594 r615 15 15 <property name="hibernateProperties"> 16 16 <props> 17 18 19 20 21 17 <!--<prop key="hibernate.bytecode.use_reflection_optimizer">false</prop>--> 18 <!--<prop key="hibernate.connection.driver_class">org.postgresql.Driver</prop>--> 19 <!--<prop key="hibernate.connection.url">jdbc:postgresql://darkstar.ipslnet:5432/PROJECT_SOURCE</prop>--> 20 <!--<prop key="hibernate.connection.username">postgres</prop>--> 21 <!--<prop key="hibernate.dialect">org.hibernate.dialect.PostgreSQLDialect</prop>--> 22 22 <prop key="hibernate.connection.driver_class">com.mysql.jdbc.Driver</prop> 23 < prop key="hibernate.connection.url">jdbc:mysql://localhost/geisa?autoReconnect=true</prop>24 <!-- <prop key="hibernate.connection.url">jdbc:mysql://localhost/geisa</prop>-->23 <!--<prop key="hibernate.connection.url">jdbc:mysql://localhost/geisa?autoReconnect=true</prop>--> 24 <prop key="hibernate.connection.url">jdbc:mysql://localhost/geisa</prop> 25 25 <!-- en local--> 26 26 <prop key="hibernate.connection.username">root</prop> 27 27 <!-- sur naboo --> 28 <!-- <prop key="hibernate.connection.username">geisa</prop> -->28 <!-- <prop key="hibernate.connection.username">geisa</prop> --> 29 29 <prop key="hibernate.connection.password">geisa11</prop> 30 30 <prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop> 31 31 <prop key="hibernate.show_sql">true</prop> 32 32 <!--<prop key="hibernate.generate_statistics">true</prop>--> 33 33 34 </props> 35 </property> 34 <!-- configuration pool via c3p0--> 35 36 37 <prop key="hibernate.c3p0.acquire_increment">1</prop> 38 <prop key="hibernate.c3p0.idle_test_period">100</prop><!-- seconds --> 39 <prop key="hibernate.c3p0.max_size">100</prop><!-- Taille maximale du pool --> 40 <prop key="hibernate.c3p0.min_size">10</prop><!-- Taille minimale du pool --> 41 <prop key="hibernate.c3p0.timeout">0</prop><!-- seconds / 0 =jamais--> 42 <prop key="hibernate.c3p0.max_statements">0</prop><!-- Taille du cache de statements de C3P0. 0 = désactive le cache --> 43 <prop key="connection.provider_class">org.hibernate.connection.C3P0ConnectionProvider</prop> 44 45 </props> 46 </property> 36 47 </bean> 37 48 … … 60 71 <!-- </bean> --> 61 72 73 62 74 </beans> -
geisa/web/initGeisa_script.jsp
r595 r615 687 687 this.selectTransitionUpper = $( document.createElement( "select" ) ); 688 688 this.selectTransitionUpper.attr( {id:"transition1"} ); 689 //fonction sur le menu déroulant (des qu'on clique dessus) et non sur chacune des options 690 this.selectTransitionUpper.bind( 'click', jQuery.proxy(this.OnclickVerifTransition, this)); 689 691 var optTransitionUpper = $( document.createElement( "option" ) ); 690 692 optTransitionUpper.attr( {value:"-1", text:"Select a molecule"} ); … … 708 710 this.selectTransitionLower = $( document.createElement( "select" ) ); 709 711 this.selectTransitionLower.attr( {id:"transition2"} ); 712 this.selectTransitionLower.bind( 'click', jQuery.proxy(this.OnclickVerifTransition, this)); 710 713 var optTransitionLower = $( document.createElement( "option" ) ); 711 714 optTransitionLower.attr( {value:"-1", text:"Select a molecule"} ); … … 1228 1231 // var transitionUpper = "["+transitionUp+"]"; 1229 1232 // alert ("transitionUpper"+transitionUpper); 1233 //certaine transitions ont plusieurs espaces à droite qui ne sont pas conservés (ex ch4 et C2HD) 1234 //si la longueur de la chaine de caracteres n'est pas 25 on rajoute le nobre d'espace nécessaire pour arriver à 25 1235 var nb=0; 1236 nb=25-transitionUpper.length 1237 if (nb != 0) 1238 { 1239 for (i = 1; i <= nb; i++) { 1240 transitionUpper=transitionUpper+" "; 1241 } 1242 } 1243 1244 //alert("transitionUpper.length"+transitionUpper.length); 1245 //transitionUpper=transitionUpper+" "; 1246 //alert("transitionUpper.length"+transitionUpper.length); 1230 1247 1231 1248 // var TransitionLower ="-vib_ident_lower '[ "+this.selectTransitionLower.getValue()+" ]'"; … … 1234 1251 // var TransitionLower ="-vib_ident_lower ["+TransitionLo+"]"; 1235 1252 //var transitionLower ="["+transitionLo+"]"; 1253 1254 //certaine transitions ont plusieurs espaces à droite qui ne sont pas conservés (ex ch4 et C2HD) 1255 //si la longueur de la chaine de caracteres n'est pas 25 on rajoute le nobre d'espace nécessaire pour arriver à 25 1256 var nb=0; 1257 nb=25-transitionUpper.length 1258 if (nb != 0) 1259 { 1260 for (i = 1; i <= nb; i++) { 1261 transitionUpper=transitionUpper+" "; 1262 } 1263 } 1236 1264 1237 1265 //pas de transition sélectionnée … … 1397 1425 meanValue+" "+nbCourbes+" "+field+" "+logScale+" "+lineType+" "+field2+" "+logScale2+" "+lineType2; 1398 1426 1399 //alert ("parameters"+parameters);1427 //alert ("parameters"+parameters); 1400 1428 1401 1429 //remplacement de espace par "EEE" pour que le shell script ne voit qu'un seul argument en entrée 1402 parameters=parameters.replace(/ /g," EEE");1403 transitionUpper=transitionUpper.replace(/ /g," EEE");1430 parameters=parameters.replace(/ /g,"kkk"); 1431 transitionUpper=transitionUpper.replace(/ /g,"kkk"); 1404 1432 //le + est interprété comme un espace (plus sera retransformé en + dans le shell) 1405 1433 transitionUpper=transitionUpper.replace(/\+/g,"plus"); 1406 transitionLower=transitionLower.replace(/ /g," EEE");1434 transitionLower=transitionLower.replace(/ /g,"kkk"); 1407 1435 transitionLower=transitionLower.replace(/\+/g,"plus"); 1408 1436 1409 1437 this.nomFichier="GEISA2011"; 1410 1438 //envoie de la requête au controller 1411 1439 //en cas de succes appel de la fonction "handleGeisa" 1412 1440 $.ajax( { 1413 1441 //url: "project?methodName=createUserRequest&"+parameters+"&nbGraph="+ this.nbGraph, 1414 url: "project?methodName=createUserRequest&"+parameters+"&transitionUpper="+ transitionUpper+"&transitionLower="+ transitionLower+"&nbGraph="+ this.nbGraph, 1442 //url: "project?methodName=createUserRequest&"+parameters+"&transitionUpper="+ transitionUpper+"&transitionLower="+ transitionLower+"&nbGraph="+ this.nbGraph, 1443 url: "project?methodName=createUserRequest&"+parameters+"&transitionUpper="+ transitionUpper+"&transitionLower="+ transitionLower+"&nbGraph="+ this.nbGraph+"&nomFichier="+this.nomFichier, 1415 1444 success:jQuery.proxy( this.handleGeisa, this ) 1416 1445 } ); … … 1635 1664 { 1636 1665 1666 //numéro unique pour le nom du répertoire 1667 //this.nb = jQuery.parseJSON( result ).nb; 1668 this.NomRepFileOut = jQuery.parseJSON( result ).NomRepFileOut; 1637 1669 1638 1670 //chemin de l'image 1639 1671 // this.pathImg = jQuery.parseJSON( result ).pathImg; 1640 this.pathImg = "<%=Controller.PATH_IMAGES%>" ;1641 //numéro unique pour le nom du graph 1642 this.nb = jQuery.parseJSON( result ).nb; 1672 this.pathImg = "<%=Controller.PATH_IMAGES%>"+this.NomRepFileOut; 1673 1674 1643 1675 //Pour tracer le bon nombre de graphe et de bouton download 1644 1676 var i=1; 1645 1677 var content = ''; 1646 1678 for (i=1; i<this.nbGraph+1; i++) { 1647 content = content + '<img src=' + this.pathImg + "graph" + this.nb +"-"+i+ ".png"+ ' /><a href="project?methodName=downloadFile&fileName=' + "graph" + this.nb+"-"+i + ".png"+ '"><button class="dataProtocolDownloadButton">Download</button></a>'; 1679 //content = content + '<img src=' + this.pathImg + "graph" + this.nb +"-"+i+ ".png"+ ' /><a href="project?methodName=downloadFile&fileName=' + "graph" + this.nb+"-"+i + ".png"+ '"><button class="dataProtocolDownloadButton">Download</button></a>'; 1680 content = content + '<img src=' + this.pathImg + this.nomFichier +"-"+i+ ".png"+ ' /><a href="project?methodName=downloadFile&fileName=' +this.NomRepFileOut + this.nomFichier+"-"+i + ".png"+ '"><button class="dataProtocolDownloadButton">Download</button></a>'; 1681 1648 1682 } 1649 1683 … … 1681 1715 // this.selectTransitionUpper.selectFirst(); 1682 1716 1683 // alert ("transitionsUpper"+transitionsUpper); 1717 1684 1718 $.each(transitionsLower, jQuery.proxy( function(index, transitionsLower ) 1685 1719 { … … 1721 1755 this.selectTransitionLower.append($( document.createElement( "option" ) ).attr( {value:this.transitionLower, text:this.transitionLower, selected:"selected"} )); 1722 1756 //this.selectTransitionUpper.add('transition', "Choose a transition"); 1723 //rajout du text "Choose a transition" selectionné en premier mais on ne peut pa cliquer dessus1757 //rajout du text "Choose a transition" selectionné en premier mais on ne peut pas cliquer dessus 1724 1758 this.selectTransitionUpper.append($( document.createElement( "option" ) ).attr( {value:"transition", text:"Choose a transition", disabled:"disabled", selected:"selected"} )); 1725 1759 … … 1907 1941 for( i = 0; i < count; i++ ) 1908 1942 { 1909 // ouvrir que les div dont l'id contient la chaine Cache1943 //fermer que les div dont l'id contient la chaine Cache 1910 1944 if (divs.item(i).id.indexOf("Cache") != -1) { 1911 1945 divs.item(i).style.display = "none" ; … … 2065 2099 }, 2066 2100 2067 2101 //si aucun transition n'a été trouvée 2102 OnclickVerifTransition : function() 2103 { 2104 //si il n'y a qu'un élément dans les menu déroulant transition upper et lower et que la valeur est "transition" 2105 if (document.getElementById('transition1').length==1 && document.getElementById('transition1').options[0].value=="transition" && document.getElementById('transition2').length==1 && document.getElementById('transition2').options[0].value=="transition") 2106 { 2107 alert("Change isotopologues selection or spectral range values to obtain transition values"); 2108 } 2109 }, 2068 2110 2069 2111 onBlurInputMeanValue: function() … … 2236 2278 resetPage: function() 2237 2279 { 2238 location.reload(); 2280 //location.reload(); //pas appliquée car supprime la fenêtre graphique 2281 2282 //reset du choix de la base de données 2283 // selectFirst : affiche le premier élément de la liste 2284 //true : active la fonction associée au bouton 2285 this.selectDatabase.selectFirst( true ); 2286 2287 //cacher tous les isotopes 2288 var divs = document.getElementsByTagName( 'div' ); 2289 var count = divs.length; 2290 var i = 0; 2291 2292 for( i = 0; i < count; i++ ) 2293 { 2294 //fermer que les div dont l'id contient la chaine Cache 2295 if (divs.item(i).id.indexOf("Cache") != -1) { 2296 divs.item(i).style.display = "none" ; 2297 } 2298 } 2299 this.showButton.setValue("View all isotopologues"); 2300 2301 //déselectionner tous les isotopes 2302 var inputs = document.getElementsByTagName( 'input' ); 2303 var count = inputs.length; 2304 var i=0; 2305 2306 for( i = 0; i < count; i++ ) 2307 { 2308 var input = inputs.item( i ); 2309 if( input.type == 'checkbox' ) 2310 { 2311 input.checked = false; 2312 } 2313 } 2314 this.selectButton.setValue("Select all isotopologues"); 2315 2316 //spectral range 2317 $("#rangeLower").val(0); 2318 $("#rangeUpper").val(35877.030506); 2319 $("#sampStep").val(""); 2320 2321 //intensity range 2322 $("#intensityLo").val(0); 2323 $("#intensityUp").val(1e-16); 2324 2325 this.selectNbCourbes.selectFirst( true ); 2326 2327 this.selectTraceAxeY1.selectFirst( true ); 2328 this.selectScaleY1.selectFirst( true ); 2329 this.selectTypeTraceY1.selectFirst( true ); 2330 2331 document.getElementById("transition1").length=0; 2332 document.getElementById("transition2").length=0; 2333 this.selectTransitionLower.append($( document.createElement( "option" ) ).attr( {value:"-1", text:"Select a molecule", selected:"selected"} )); 2334 this.selectTransitionUpper.append($( document.createElement( "option" ) ).attr( {value:"-1", text:"Select a molecule", selected:"selected"} )); 2335 $("#transitionUpper").removeClass("notActiveText"); 2336 $("#transitionLower").removeClass("notActiveText"); 2337 2338 2339 $("#meanValue2").val(""); 2340 2341 this.selectTraceAxeY2.selectFirst( true ); 2342 this.selectScaleY2.selectFirst( true ); 2343 this.selectTypeTraceY2.selectFirst( true ); 2344 2239 2345 }, 2240 2346 -
geisa/web/src/com/ether/Controller.java
r594 r615 51 51 @ControllerMethod(jsonResult = true) 52 52 //public JSONObject createUserRequest( @ParamName("fortranRequest") final String fortranRequest, @ParamName("nbGraph") @NotNull final String nbGraph) 53 public JSONObject createUserRequest( @ParamName("fortranRequest") final String fortranRequest, @ParamName("transitionUpper") final String transitionUpper, @ParamName("transitionLower") final String transitionLower, @ParamName("nbGraph") @NotNull final String nbGraph) 53 //public JSONObject createUserRequest( @ParamName("fortranRequest") final String fortranRequest, @ParamName("transitionUpper") final String transitionUpper, @ParamName("transitionLower") final String transitionLower, @ParamName("nbGraph") @NotNull final String nbGraph) 54 public JSONObject createUserRequest( @ParamName("fortranRequest") final String fortranRequest, @ParamName("transitionUpper") final String transitionUpper, @ParamName("transitionLower") final String transitionLower, @ParamName("nbGraph") @NotNull final String nbGraph, @ParamName("nomFichier") final String nomFichier) 54 55 throws WebException 55 56 { … … 64 65 // Process p = Runtime.getRuntime().exec("/home/npipsl/Desktop/geisa-Graphique/prog-ether/graph.sh " + fortranRequest + " " + timeInMillis + ""); 65 66 // Process p = Runtime.getRuntime().exec(PATH_PROCESS+File.separatorChar+"graph.sh " + fortranRequest + " " + timeInMillis + ""); 66 //////// Process p = Runtime.getRuntime().exec(PATH_PROCESS+"graph.sh " + fortranRequest + " " + timeInMillis + ""); 67 Process p = Runtime.getRuntime().exec(PATH_PROCESS+"graph.sh " + fortranRequest + " " + transitionUpper + " " + transitionLower +" " + timeInMillis + ""); 68 // Process p = Runtime.getRuntime().exec("/home/www/GEISA/graph.sh " + fortranRequest + " " + timeInMillis + ""); 67 //création d'un répertoire par requete 68 Process q = Runtime.getRuntime().exec("mkdir "+ LONG_PATH_IMAGES+"graph"+timeInMillis); 69 70 //////// Process p = Runtime.getRuntime().exec(PATH_PROCESS+"graph.sh " + fortranRequest + " " + transitionUpper + " " + transitionLower +" " + timeInMillis + ""); 71 Process p = Runtime.getRuntime().exec(PATH_PROCESS+"graph.sh " + fortranRequest + " " + transitionUpper + " " + transitionLower + " " + nomFichier + " " + PATH_PROCESS+ " " + LONG_PATH_IMAGES+"graph"+timeInMillis+"/" +""); 72 69 73 70 74 71 75 //permet de connaitre le nom du dernier fichier creer (en cas de plusieurs graphs à tracer) pour tester si le dernier fichier est bien present 72 final String lastFileName = "graph" + timeInMillis +"-"+nbGraph+ ".png"; 76 //final String lastFileName = "graph" + timeInMillis +"-"+nbGraph+ ".png"; 77 final String lastFileName = nomFichier +"-"+nbGraph+ ".png"; 73 78 //final File lastFile = new java.io.File(LONG_PATH_IMAGES+File.separatorChar+lastFileName); 74 final File lastFile = new java.io.File(LONG_PATH_IMAGES+ lastFileName);79 final File lastFile = new java.io.File(LONG_PATH_IMAGES+"graph"+timeInMillis+"/"+lastFileName); 75 80 final Integer maxTimeWait = 65000; 76 81 … … 104 109 //result.put( "resultAjax", valselectTraceAxeY1 + valselectTraceAxeY2 + inputSpectralRangeLower + inputSpectralRangeUpper + inputIntensityLower + inputIntensityUpper + valselectTypeTrace); 105 110 // result.put( "pathImg", PATH_IMAGES ); 106 result.put("nb", timeInMillis); 111 final String NomRepFileOut = "graph"+timeInMillis+"/"; 112 result.put("NomRepFileOut", NomRepFileOut); 113 //result.put("nb", timeInMillis); 107 114 108 115 return result; … … 212 219 private static final Log LOGGER = LogFactory.getLog( Controller.class ); 213 220 221 //public static final String PATH_IMAGES = "resources/images/graphGeisa/"; 214 222 public static final String PATH_IMAGES = "resources/images/graphGeisa/"; 215 223 //local 216 224 public static final String LONG_PATH_IMAGES = "/home_local/npipsl/workspaces/GEISA/web/resources/images/graphGeisa/"; 225 217 226 // naboo 218 227 // public static final String LONG_PATH_IMAGES = "/usr/local/apache-tomcat/webapps/geisa/resources/images/graphGeisa/"; 228 219 229 //local 220 230 public static final String PATH_PROCESS = "/home/npipsl/Desktop/geisa-Graphique/prog-ether/";
Note: See TracChangeset
for help on using the changeset viewer.