Changeset 530
- Timestamp:
- 07/03/12 17:02:35 (12 years ago)
- Location:
- ether_megapoli/trunk
- Files:
-
- 6 added
- 17 edited
- 4 copied
Legend:
- Unmodified
- Added
- Removed
-
ether_megapoli/trunk/common/implementation/com/ether/EtherHelper.java
r520 r530 219 219 } 220 220 221 /** 222 * This method returns only the files included in the directory 223 * 224 * @param pathSimulation 225 * @param fileEnd 226 * @return 227 */ 228 public static List<String> getOnlyFileNames( @NotNull final String pathSimulation, @Nullable final String fileEnd ) 229 { 230 final List<String> files = new ArrayList<String>(); 231 final File directory = new File( pathSimulation ); 232 for( final File file : directory.listFiles() ) 233 { 234 if( file.isFile() && ( fileEnd != null && file.getName().endsWith( fileEnd ) ) ) 235 files.add( file.getName() ); 236 } 237 return files; 238 } 239 240 /** 241 * This method returns only the directories included in the directory 242 * 243 * @param pathSimulation 244 * @return 245 */ 246 public static List<String> getOnlyDirectorieNames( @NotNull final String pathSimulation ) 247 { 248 final List<String> files = new ArrayList<String>(); 249 final File directory = new File( pathSimulation ); 250 for( final File file : directory.listFiles() ) 251 { 252 if( file.isDirectory() ) 253 files.add( file.getName() ); 254 } 255 return files; 256 } 257 258 /** 259 * This method wait until the file exist (and until the end of duration) 260 * The duration is used to avoid infinite waiting 261 * 262 * @param file 263 * @param duration 264 * @throws InterruptedException 265 */ 266 public static void waitForFileWithMax( @NotNull final File file, @NotNull final Integer duration ) 267 throws InterruptedException 268 { 269 Integer start = 0; 270 final Integer interval = 1000; 271 while( !file.exists() && start < duration ) 272 { 273 Thread.sleep( interval ); 274 } 275 start += interval; 276 } 221 277 } -
ether_megapoli/trunk/common/implementation/com/ether/ParameterConstants.java
r484 r530 35 35 public static final String PARAMETER_CATEGORY = "category"; 36 36 public static final String PARAMETER_VERSION = "version"; 37 public static final String PARAMETER_DIRECTORY_NAME = "directoryName"; 37 38 } -
ether_megapoli/trunk/persistence/implementation/com/ether/dao/simulation/Variable.hbm.xml
r423 r530 4 4 5 5 <hibernate-mapping> 6 <class name="com.ether. user.User" table="user" schema="public">6 <class name="com.ether.simulation.Variable" table="simulation_variable" schema="public"> 7 7 <id name="id"> 8 <column name=" user_id"/>8 <column name="id"/> 9 9 10 10 <generator class="sequence"> 11 <param name="sequence">s_ user</param>11 <param name="sequence">s_variable</param> 12 12 </generator> 13 13 </id> 14 14 15 <property name=" lastName">16 <column name=" lastname" not-null="true"/>15 <property name="name"> 16 <column name="name" not-null="true"/> 17 17 </property> 18 18 19 <property name=" firstName">20 <column name=" firstname"/>19 <property name="shape"> 20 <column name="shape"/> 21 21 </property> 22 22 23 <property name=" email">24 <column name=" email" not-null="true"/>23 <property name="type"> 24 <column name="type"/> 25 25 </property> 26 26 27 <property name=" password">28 <column name=" password" not-null="true"/>27 <property name="units"> 28 <column name="units"/> 29 29 </property> 30 30 31 <property name="role" type="com.ether.dao.user.UserRoleEnum"> 32 <column name="role"/> 33 </property> 34 35 <property name="creationDate" type="timestamp"> 36 <column name="creation_date" not-null="true"/> 37 </property> 38 39 <property name="state" type="com.ether.dao.user.UserStateEnum"> 40 <column name="state" not-null="true"/> 41 </property> 42 43 <property name="accessToBO"> 44 <column name="access_to_bo" not-null="true"/> 31 <property name="longName"> 32 <column name="long_name"/> 45 33 </property> 46 34 </class> -
ether_megapoli/trunk/persistence/implementation/com/ether/dao/simulation/VariableDAOImpl.java
r473 r530 1 package com.ether.dao. user;1 package com.ether.dao.simulation; 2 2 3 import com.ether.PersistenceException; 4 import com.ether.dao.SearchableAbstractHibernateMappingDAO; 5 import com.ether.dao.UserDAO; 6 import com.ether.user.User; 7 import com.ether.user.UserFilter; 8 import com.ether.user.UserState; 9 import org.hibernate.criterion.DetachedCriteria; 10 import org.hibernate.criterion.Order; 11 import org.hibernate.criterion.Restrictions; 12 import org.jetbrains.annotations.NotNull; 13 import org.jetbrains.annotations.Nullable; 14 import org.springframework.util.StringUtils; 15 16 import java.util.List; 3 import com.ether.dao.DomainAccessObjectImpl; 4 import com.ether.dao.VariableDAO; 5 import com.ether.simulation.Variable; 17 6 18 7 /** 19 8 * @author vmipsl 20 * @date 29 nov. 20119 * @date 03 juillet 2012 21 10 */ 22 public class UserDAOImpl23 extends SearchableAbstractHibernateMappingDAO<User, Integer, UserFilter>24 implements UserDAO11 public class VariableDAOImpl 12 extends DomainAccessObjectImpl<Variable, Integer> 13 implements VariableDAO 25 14 { 26 protected UserDAOImpl()15 protected VariableDAOImpl() 27 16 { 28 super( User.class, Integer.class ); 29 } 30 31 @Nullable 32 public User getUserByEmail( @NotNull final String userEmail ) 33 throws PersistenceException 34 { 35 final DetachedCriteria criteria = DetachedCriteria.forClass( User.class ) 36 .add( Restrictions.eq( "email", userEmail ) ); 37 38 return selectByCriteria( User.class, criteria ); 39 } 40 41 @NotNull 42 public List<User> getUsersByState( @NotNull final UserState userState ) 43 throws PersistenceException 44 { 45 final DetachedCriteria criteria = DetachedCriteria.forClass( User.class ) 46 .add( Restrictions.eq( "state", userState ) ) 47 .addOrder( Order.asc( "lastName" ) ); 48 49 return selectAllByCriteria( User.class, criteria ); 50 } 51 52 @NotNull 53 public List<User> getAllUsersByNameOrder() 54 throws PersistenceException 55 { 56 final DetachedCriteria criteria = DetachedCriteria.forClass( User.class ) 57 .addOrder( Order.asc( "lastName" ) ); 58 59 return selectAllByCriteria( User.class, criteria ); 60 } 61 62 @Override 63 protected DetachedCriteria searchCriteria( @NotNull final UserFilter filter, final boolean isForCount ) 64 { 65 final DetachedCriteria criteria = DetachedCriteria.forClass( User.class ); 66 67 if( null != filter.getSortRole() ) 68 criteria.add( Restrictions.eq( "role", filter.getSortRole() ) ); 69 70 if( null != filter.getSortState() ) 71 criteria.add( Restrictions.eq( "state", filter.getSortState() ) ); 72 73 if( !filter.isSortAccessBoTrue() && filter.isSortAccessBoFalse() ) 74 criteria.add( Restrictions.eq( "accessToBO", false ) ); 75 else if( filter.isSortAccessBoTrue() && !filter.isSortAccessBoFalse() ) 76 criteria.add( Restrictions.eq( "accessToBO", true ) ); 77 78 if( StringUtils.hasText( filter.getSearchText() ) ) 79 criteria.add( Restrictions.or( Restrictions.or( escapedLike( "lastName", filter.getSearchText() ), escapedLike( "firstName", filter.getSearchText() ) ), escapedLike( "email", filter.getSearchText() ) ) ); 80 81 if( !isForCount ) 82 criteria.addOrder( Order.asc( filter.getSort() ) ); 83 return criteria; 17 super( Variable.class, Integer.class ); 84 18 } 85 19 } -
ether_megapoli/trunk/persistence/implementation/dao-context.xml
r473 r530 52 52 </bean> 53 53 54 <bean id="refVariableDAO" class="com.ether.dao.simulation.VariableDAOImpl"> 55 <property name="sessionFactory"> 56 <ref bean="sessionFactory"/> 57 </property> 58 </bean> 59 54 60 </beans> -
ether_megapoli/trunk/persistence/implementation/hibernate-domain.cfg.xml
r516 r530 36 36 <mapping resource="com/ether/dao/person/Personne.hbm.xml"/> 37 37 <mapping resource="com/ether/dao/mco/Mco.hbm.xml"/> 38 <mapping resource="com/ether/dao/simulation/Variable.hbm.xml"/> 38 39 39 40 <!--<mapping resource="com/ether/dao/Query.hbm.xml"/>--> -
ether_megapoli/trunk/persistence/interface/com/ether/dao/VariableDAO.java
r423 r530 1 1 package com.ether.dao; 2 2 3 import com.ether.PersistenceException; 4 import com.ether.user.User; 5 import com.ether.user.UserFilter; 6 import com.ether.user.UserState; 7 import org.jetbrains.annotations.NotNull; 8 import org.jetbrains.annotations.Nullable; 9 10 import java.util.List; 3 import com.ether.simulation.Variable; 11 4 12 5 /** 13 6 * @author vmipsl 14 * @date 29 nov. 20117 * @date 03 juillet 2012 15 8 */ 16 public interface UserDAO17 extends SearchableDomainAccessObject<User, Integer, UserFilter>9 public interface VariableDAO 10 extends DomainAccessObject<Variable, Integer> 18 11 { 19 @Nullable20 User getUserByEmail( @NotNull final String userEmail )21 throws PersistenceException;22 23 @NotNull24 List<User> getUsersByState( @NotNull final UserState userState )25 throws PersistenceException;26 27 @NotNull28 List<User> getAllUsersByNameOrder()29 throws PersistenceException;30 12 } -
ether_megapoli/trunk/service/implementation/com/ether/EtherServiceImpl.java
r520 r530 9 9 import com.ether.dao.UserDAO; 10 10 import com.ether.dao.ValueDAO; 11 import com.ether.dao.VariableDAO; 11 12 import com.ether.mco.Mco; 12 13 import com.ether.mco.McoFilter; 14 import com.ether.simulation.SimulationHeader; 15 import com.ether.simulation.Variable; 13 16 import com.ether.user.User; 14 17 import com.ether.user.UserFilter; … … 25 28 import org.springframework.transaction.annotation.Transactional; 26 29 30 import javax.xml.bind.JAXBContext; 31 import javax.xml.bind.JAXBException; 32 import javax.xml.bind.Marshaller; 33 import javax.xml.bind.PropertyException; 34 import javax.xml.bind.Unmarshaller; 35 import java.io.File; 36 import java.io.IOException; 27 37 import java.util.ArrayList; 28 38 import java.util.Date; … … 576 586 } 577 587 588 /** 589 * This method create a directory for all ".nc" files in the simulation directory 590 * And create for each a "header_init.xml" file which contents the attributes, variables, dimensions, etc... for the simulation 591 * The second line of the "header_init.xml" file is changed by "xmlnsHeader" because of the term "xmlns" which is not ok for the "unmarshall" method 592 * The real file to work becomes "header.xml" 593 * 594 * @param simulationPath 595 */ 596 public void launchNCDumpInSimulationDirectory( @NotNull final String simulationPath ) 597 throws ServiceException 598 { 599 final File simulationsDirectory = new File( simulationPath ); 600 for( final String fileName : simulationsDirectory.list() ) 601 { 602 if( fileName.endsWith( ".nc" ) ) 603 { 604 // Create directory and move simulation file into 605 final String shortFileName = fileName.substring( 0, fileName.lastIndexOf( '.' ) ); 606 final String directoryName = simulationPath + File.separatorChar + shortFileName; 607 final File directory = new File( directoryName ); 608 final File file = new File( simulationPath + File.separatorChar + fileName ); 609 if( !directory.exists() ) 610 { 611 directory.mkdir(); 612 file.renameTo( new File( directoryName + File.separatorChar + fileName ) ); 613 try 614 { 615 final Runtime runtime = Runtime.getRuntime(); 616 final String headerInit = directoryName + File.separatorChar + "header_init.xml"; 617 final String[] argsNcdump = {"/bin/sh", "-c", "/usr/bin/ncdump -h -x " + directoryName + File.separatorChar + fileName + " > " + headerInit}; 618 runtime.exec( argsNcdump ); 619 EtherHelper.waitForFileWithMax( new File( headerInit ), 5000 ); 620 final String[] argsSed = {"/bin/sh", "-c", "sed s/xmlns/xmlnsHeader/ " + directoryName + File.separatorChar + "header_init.xml > " + directoryName + File.separatorChar + FILE_HEADER_NAME}; 621 runtime.exec( argsSed ); 622 } 623 catch( IOException e ) 624 { 625 throw new ServiceException( ServiceException.ServiceCode.ERROR_PROCESS_SIMULATION_NCDUMP, e ); 626 } 627 catch( InterruptedException e ) 628 { 629 throw new ServiceException( ServiceException.ServiceCode.ERROR_PROCESS_SIMULATION_NCDUMP_WAIT, e ); 630 } 631 } 632 } 633 } 634 } 635 636 /** 637 * This method insert the header in database 638 * The new variables are separatly created in the table .... 639 * The metadata are saved in the table .... 640 * 641 * @param simulationPath 642 * @param directoryName 643 */ 644 public void insertHeader( @NotNull final String simulationPath, @NotNull final String directoryName ) 645 throws ServiceException 646 { 647 try 648 { 649 final String fileName = simulationPath + File.separatorChar + directoryName + File.separatorChar + FILE_HEADER_NAME; 650 651 final JAXBContext context = JAXBContext.newInstance( SimulationHeader.class ); 652 final Marshaller marshaller = context.createMarshaller(); 653 marshaller.setProperty( Marshaller.JAXB_FORMATTED_OUTPUT, true ); 654 final Unmarshaller uMarshaller = context.createUnmarshaller(); 655 final SimulationHeader simulation = (SimulationHeader) uMarshaller.unmarshal( new File( fileName ) ); 656 657 final Variable var = simulation.getVariable().get( 0 ); 658 _variableDAO.insert( var ); 659 final String bob = "bib"; 660 } 661 catch( PersistenceException e ) 662 { 663 throw new ServiceException( ServiceException.ServiceCode.PERSISTENCE, e ); 664 } 665 catch( PropertyException e ) 666 { 667 throw new ServiceException( ServiceException.ServiceCode.ERROR_PROPERTY, e ); 668 } 669 catch( JAXBException e ) 670 { 671 throw new ServiceException( ServiceException.ServiceCode.ERROR_JAXB, e ); 672 } 673 } 674 578 675 @Required 579 676 public void setPlateformDAO( final PlateformDAO plateformDAO ) … … 622 719 { 623 720 _jeuDAO = jeuDAO; 721 } 722 723 @Required 724 public void setVariableDAO( final VariableDAO variableDAO ) 725 { 726 _variableDAO = variableDAO; 624 727 } 625 728 … … 634 737 private McoDAO _mcoDAO; 635 738 private JeuDAO _jeuDAO; 739 private VariableDAO _variableDAO; 740 741 private static String FILE_HEADER_NAME = "header.xml"; 636 742 } -
ether_megapoli/trunk/service/implementation/service-context.xml
r473 r530 12 12 <property name="mcoDAO" ref="refMcoDAO"/> 13 13 <property name="jeuDAO" ref="refJeuDAO"/> 14 <property name="variableDAO" ref="refVariableDAO"/> 14 15 </bean> 15 16 <bean id="etherService" parent="transactionProxy"> -
ether_megapoli/trunk/service/interface/com/ether/EtherService.java
r520 r530 152 152 String getDatasetNameById( @NotNull final Integer jeuId ) 153 153 throws ServiceException; 154 155 public void launchNCDumpInSimulationDirectory( @NotNull final String simulationPath ) 156 throws ServiceException; 157 158 void insertHeader( @NotNull final String simulationPath, @NotNull final String directoryName ) 159 throws ServiceException; 160 154 161 } -
ether_megapoli/trunk/service/interface/com/ether/ServiceException.java
r528 r530 58 58 PROPERTIES_FILE_NOT_READABLE, 59 59 ERROR_INSERT_PRINCIPAL, 60 ERROR_IN_FILE_TO_INSERT 60 ERROR_IN_FILE_TO_INSERT, 61 ERROR_PROCESS_SIMULATION_NCDUMP, 62 ERROR_PROCESS_SIMULATION_NCDUMP_WAIT, 63 ERROR_PROPERTY, 64 ERROR_JAXB 61 65 } 62 66 } -
ether_megapoli/trunk/web/WEB-INF/megapoli.properties
r528 r530 40 40 41 41 # ParamÚtres pour la simulation 42 directory.simulation=/home_local/ Simulations42 directory.simulation=/home_local/PROJETS/MEGAPOLI/Simulations -
ether_megapoli/trunk/web/backoffice/simulation-script.jsp
r528 r530 3 3 var interfaceBODataInsertion = Class.create( { 4 4 5 initialize: function( pathSimulationFiles )5 initialize: function( simulationFiles, simulationDirectories ) 6 6 { 7 7 // Values 8 this.files = pathSimulationFiles || null; 8 this.files = simulationFiles || null; 9 this.directories = simulationDirectories || null; 9 10 10 11 // Containers … … 41 42 42 43 // Bind buttons 43 // $( "#insert" ).bind( 'click', this, jQuery.proxy( this.onClickInsert, this ) );44 $( "#ncdumpButton" ).bind( 'click', this, jQuery.proxy( this.onClickLaunchNcDump, this ) ); 44 45 // $( "#cleanLocalisationAndFlagButton" ).bind( 'click', this, jQuery.proxy( this.onClickCleanLocalisationAndFlag, this ) ); 45 46 }, … … 58 59 }, 59 60 61 requestLaunchNcDump: function() 62 { 63 $.ajax( { 64 url: "backoffice?methodName=launchNCDumpInSimulationDirectory", 65 success:jQuery.proxy( this.handleLaunchNcDump, this ), 66 error: jQuery.proxy( this.showErrors, [this] ) 67 } ); 68 }, 69 70 requestInsertHeader: function( directoryName ) 71 { 72 $.ajax( { 73 url: "backoffice?methodName=insertHeader&directoryName=" + directoryName, 74 success:jQuery.proxy( this.handleInsertHeader, this ), 75 error: jQuery.proxy( this.showErrors, [this] ) 76 } ); 77 }, 60 78 61 79 // HANDLES ******************************************************** … … 67 85 }, 68 86 87 handleLaunchNcDump: function( result ) 88 { 89 this.files = jQuery.parseJSON( result ).simulationFiles; 90 this.directories = jQuery.parseJSON( result ).simulationDirectories; 91 this.displayFiles(); 92 }, 93 94 handleInsertHeader: function( result ) 95 { 96 // this.files = jQuery.parseJSON( result ).simulationFiles; 97 // this.directories = jQuery.parseJSON( result ).simulationDirectories; 98 // this.displayFiles(); 99 }, 100 69 101 // DISPLAYS ******************************************************** 70 102 displayFiles: function() 71 103 { 104 this.containerFileList_left.empty(); 105 this.containerFileList_right.empty(); 72 106 var number = this.files.length; 107 jQuery.each( this.directories, jQuery.proxy( function( i, directory ) 108 { 109 var divDirectory = $( document.createElement( "div" ) ); 110 var divDirectoryName = $( document.createElement( "div" ) ); 111 divDirectoryName.attr( {style:"float:left"} ); 112 divDirectoryName.html( "- " + directory + " " ); 113 divDirectory.append( divDirectoryName ); 114 115 var button = $( document.createElement( "button" ) ); 116 button.addClass( "small negative" ); 117 button.html( interfaceTexts["bo.simulation.save.header"] ); 118 button.bind( 'click', [this, directory], jQuery.proxy( this.onClickInsertHeader, this ) ); 119 divDirectory.append( button ); 120 121 this.containerFileList_left.append( divDirectory ); 122 }, this ) ); 123 73 124 jQuery.each( this.files, jQuery.proxy( function( i, file ) 74 125 { 75 if( (number / 2) > i ) 76 this.containerFileList_left.append( " - " + file + "<BR/>" ); 77 else 78 this.containerFileList_right.append( " - " + file + "<BR/>" ); 126 this.containerFileList_right.append( " - " + file + "<BR/>" ); 79 127 }, this ) ); 80 81 128 }, 82 129 … … 193 240 }, 194 241 195 onClickRemove: function( dataset ) 196 { 197 this.dataset = dataset; 198 199 this.containerErrors.hide(); 200 this.hideRemove(); 201 this.hideMove(); 202 this.hideInsert(); 203 204 this.displayFilesMove(); 205 206 $( "#categoryNameInsert" ).val( this.dataset.categoryName ); 207 $( "#datasetNameInsert" ).val( this.dataset.name ); 208 209 if( window.confirm( interfaceTexts["bo.dataset.remove.confirm"] + " " + dataset.name + " ?" ) ) 210 this.requestRemoveDataset(); 211 }, 212 213 onClickMove: function() 214 { 215 this.containerErrors.hide(); 216 this.containerResultRemove.addClass( "disable" ); 217 this.hideMove(); 218 this.hideInsert(); 219 this.requestFilesMove(); 220 }, 221 222 onClickInsert: function() 223 { 224 this.containerErrors.hide(); 225 this.containerResultMove.addClass( "disable" ); 226 this.hideInsert(); 227 228 if( "" != $( "#categoryNameInsert" ).val() && "" != $( "#datasetNameInsert" ).val() && "" != $( "#versionInsert" ).val() ) 229 this.requestDatasetInsert(); 230 else 231 this.showErrors( interfaceTexts["bo.dataset.fields"] ); 232 }, 233 234 onClickCleanLocalisationAndFlag: function() 235 { 236 if( window.confirm( interfaceTexts["bo.cleanTables.confirm"] ) ) 237 this.requestCleanLocalisationAndFlag(); 242 onClickLaunchNcDump: function() 243 { 244 this.requestLaunchNcDump(); 245 }, 246 247 onClickInsertHeader: function( parameters ) 248 { 249 var context = parameters.data[0]; 250 var directoryName = parameters.data[1]; 251 this.requestInsertHeader( directoryName ); 238 252 }, 239 253 -
ether_megapoli/trunk/web/backoffice/simulation.jsp
r528 r530 35 35 <div id="fileList_left" style="float:left"></div> 36 36 <div id="fileList_right" style="float:right"></div> 37 38 <div class="containerButtons"> 39 <button id="ncdumpButton" class="small positive" style="float:right"><bean:message key="bo.simulation.launchNcDump"/></button> 40 </div> 37 41 </div> 38 42 … … 106 110 <script type="text/javascript"> 107 111 var interfaceTexts = $A( "" ); 112 interfaceTexts["bo.simulation.save.header"] = '<bean:message key="bo.simulation.save.header"/>'; 108 113 109 new interfaceBODataInsertion( ${ pathSimulationFiles} );114 new interfaceBODataInsertion( ${simulationFiles}, ${simulationDirectories} ); 110 115 </script> 111 116 -
ether_megapoli/trunk/web/resources/css/backoffice.css
r520 r530 86 86 margin-right: 11px; 87 87 } 88 89 #fileList_left, #fileList_right { 90 margin: 0 40px; 91 } -
ether_megapoli/trunk/web/resources/css/megapoli.css
r528 r530 244 244 width: 950px; 245 245 margin-bottom: 10px; 246 } 247 248 .containerButtons { 249 float: right; 250 width: 800px; 251 margin-top: 12px; 246 252 } 247 253 -
ether_megapoli/trunk/web/src/ApplicationResources_en.properties
r528 r530 658 658 bo.simulation.database=Simulations in database 659 659 bo.simulation.list=List of simulations 660 bo.simulation.launchNcDump=Launch ncdump 661 bo.simulation.save.header=Save header in database -
ether_megapoli/trunk/web/src/com/ether/ControllerBackoffice.java
r528 r530 86 86 final JSONObject jsonObject = new JSONObject(); 87 87 final String pathSimulation = getProperty( "directory.simulation" ); 88 final File directory = new File( pathSimulation ); 88 89 final List<String> files = EtherHelper.getOnlyFileNames( pathSimulation, ".nc" ); 90 final List<String> directories = EtherHelper.getOnlyDirectorieNames( pathSimulation ); 89 91 jsonObject.put( "pathSimulation", pathSimulation ); 90 jsonObject.put( "pathSimulationFiles", directory.list() ); 92 jsonObject.put( "simulationFiles", files ); 93 jsonObject.put( "simulationDirectories", directories ); 91 94 return jsonObject; 92 95 } … … 94 97 /** *********************************************************** **/ 95 98 /** *********************** CALLS ***************************** **/ 99 /** *********************************************************** **/ 100 101 /** *********************************************************** **/ 102 /** *********************** USERS ***************************** **/ 96 103 /** *********************************************************** **/ 97 104 /** … … 293 300 } 294 301 302 /** *********************************************************** **/ 303 /** *********************** MCO ******************************* **/ 304 /** *********************************************************** **/ 295 305 /** 296 306 * This method sorts the MCO's requests … … 441 451 442 452 453 /** *********************************************************** **/ 454 /** *********************** DATASETS ************************** **/ 455 /** *********************************************************** **/ 443 456 /** 444 457 * This method sorts the datasets … … 568 581 // } 569 582 583 /** *********************************************************** **/ 584 /** *********************** SIMULATIONS *********************** **/ 585 /** *********************************************************** **/ 586 /** 587 * @return 588 * @throws WebException 589 */ 590 @ControllerMethod(jsonResult = true) 591 public JSONObject launchNCDumpInSimulationDirectory() 592 throws WebException 593 { 594 final JSONObject jsonObject = new JSONObject(); 595 try 596 { 597 final String pathSimulation = getProperty( "directory.simulation" ); 598 getEtherService().launchNCDumpInSimulationDirectory( pathSimulation ); 599 600 final List<String> files = EtherHelper.getOnlyFileNames( pathSimulation, ".nc" ); 601 final List<String> directories = EtherHelper.getOnlyDirectorieNames( pathSimulation ); 602 jsonObject.put( "simulationFiles", files ); 603 jsonObject.put( "simulationDirectories", directories ); 604 } 605 catch( ServiceException e ) 606 { 607 throw new WebException( WebException.WebCode.ERROR_PROCESS_SIMULATION_NCDUMP, e ); 608 } 609 return jsonObject; 610 } 611 612 @ControllerMethod(jsonResult = true) 613 public JSONObject insertHeader( @NotNull @ParamName(ParameterConstants.PARAMETER_DIRECTORY_NAME) final String directoryName ) 614 throws WebException 615 { 616 final JSONObject jsonObject = new JSONObject(); 617 try 618 { 619 final String pathSimulation = getProperty( "directory.simulation" ); 620 getEtherService().insertHeader( pathSimulation, directoryName ); 621 } 622 catch( ServiceException e ) 623 { 624 throw new WebException( WebException.WebCode.ERROR_INSERT_HEADER, e ); 625 } 626 return jsonObject; 627 } 628 629 /** *********************************************************** **/ 630 /** ************************ PRIVATES ************************* **/ 631 /** *********************************************************** **/ 570 632 /** 571 633 * This method create and send an email to the user to inform of the administrator decision -
ether_megapoli/trunk/web/src/com/ether/WebException.java
r520 r530 59 59 DOWNLOAD_DIRECTORY_DOESNOT_EXISTS, 60 60 ERROR_NO_CLEAN_LOCALISATION_AND_FLAG, 61 ERROR_TO_READ_FILE_PROPERTIES 61 ERROR_TO_READ_FILE_PROPERTIES, 62 ERROR_PROCESS_SIMULATION_NCDUMP, 63 ERROR_INSERT_HEADER 62 64 } 63 65 -
ether_megapoli/trunk/web/visualization/visu_simulation.jsp
r528 r530 10 10 11 11 <tiles:put name="insertCss" type="string"> 12 <ether:htmlCss cssFile="blueprint-css/blueprint/src/grid"/>13 <ether:htmlCss cssFile="visu_parameter_by_pf"/>14 12 <ether:htmlCss cssFile="select"/> 15 13 <ether:htmlCss cssFile="calendar/anytime"/> … … 20 18 <ether:htmlJs jsFile="classesForJQuery/etherClasses"/> 21 19 <ether:htmlJs jsFile="classesForJQuery/megapoliClasses"/> 22 <ether:htmlJsp jspFile="visu_parameter_by_pf-script"/> 23 <ether:htmlJs jsFile="classesForJQuery/Select"/> 20 <ether:htmlJsp jspFile="visu_simulation-script"/> 24 21 <ether:htmlJs jsFile="classesForJQuery/Loading"/> 25 22 <ether:htmlJs jsFile="calendar/anytime"/>
Note: See TracChangeset
for help on using the changeset viewer.