Changeset 490 for tapas/service
- Timestamp:
- 04/26/12 15:42:13 (12 years ago)
- Location:
- tapas/service
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
tapas/service/implementation/com/ether/TapasServiceImpl.java
r480 r490 43 43 { 44 44 45 final String rootPath = prop.getProperty( "root_file_path" ); 46 final String execPath = prop.getProperty( "exec_path" ); 45 final String servicePath = prop.getProperty( "service_path" ); 46 final String srcPath = prop.getProperty( "src_path" ); 47 final String dataPath = prop.getProperty( "data_path" ); 48 47 49 48 50 final String userPath = ""; 49 51 50 final String fichier = rootPath+"/"+user.getLastName()+"/"+"request.xml";52 final String fichier = servicePath+"/"+user.getLastName()+"/"+"request.xml"; 51 53 52 54 final Element tapas = new Element( "tapas" ); … … 258 260 259 261 String fileArletty = "", fileECMWF = ""; 260 fileArletty = rootPath + "/" + user.getLastName()+ "/" + createFileName( iRequest.getObservation().getDate(), "arletty" );261 fileECMWF = rootPath + "/" + user.getLastName()+ "/" + createFileName( iRequest.getObservation().getDate(), "ecmwf" );262 fileArletty = dataPath + "/" + createFileName( iRequest.getObservation().getDate(), "arletty" ); 263 fileECMWF = dataPath + "/" + createFileName( iRequest.getObservation().getDate(), "ecmwf" ); 262 264 263 265 final Element arlettyFile = new Element( "arletty_file" ); … … 272 274 } 273 275 274 createXMLFile( fichier, document ); 275 } 276 277 278 public boolean execAppelQSub( User user, Properties prop ) 279 throws ServiceException 280 { 281 282 String commande = prop.getProperty( "root_file_path" )+"/"+user.getLastName()+"/"+prop.getProperty( "process_name" )+" -f request.xml"+" -m "+user.getEmail(); 276 String commandePath = servicePath+"/"+user.getLastName()+"/"+fTapas.getId(); 277 createXMLFile( document, commandePath ); 278 279 //appel a qsub 280 //execAppelQSub( commandePath, user, prop ); 281 } 282 283 284 public boolean execAppelQSub( final String commandePath, User user, Properties prop ) 285 throws ServiceException 286 { 287 String commande=""; 288 //copie run qsub dans repertoire commande 289 commande = "cp "+prop.getProperty( "src_path" )+"/"+prop.getProperty( "process_name" )+" "+commandePath; 290 291 try 292 { 293 EtherHelper.execProcess( commande ); 294 } 295 catch( FormattedException e ) 296 { 297 298 } 299 300 //execution qsub pour la commande en cours 301 commande = commandePath+"/"+prop.getProperty( "process_name" )+" -f request.xml"+" -m "+user.getEmail(); 283 302 284 303 try … … 335 354 336 355 337 public void createXMLFile( final String fichier, final Document document ) 338 { 339 try 340 { 356 public void createXMLFile( final Document document, final String commandePath ) 357 { 358 try 359 { 360 //creation repertoire commande 361 try 362 { 363 EtherHelper.execProcess( "mkdir -p "+commandePath ); 364 } 365 catch( FormattedException e ) 366 { 367 368 } 369 370 final String fichier = commandePath+"/"+"request.xml"; 371 341 372 //On utilise ici un affichage classique avec getPrettyFormat() 342 373 final XMLOutputter sortie = new XMLOutputter( Format.getPrettyFormat() ); -
tapas/service/interface/com/ether/TapasService.java
r480 r490 23 23 throws ServiceException; 24 24 25 public void createXMLFile( final String fichier, final Document document);25 public void createXMLFile( final Document document, final String commandePath ); 26 26 27 27 public List<Observatory> getAllObservatories() throws ServiceException; … … 33 33 public String createFileName(String date, String type) throws ServiceException; 34 34 35 public boolean execAppelQSub( @NotNull final User user, @NotNull final Properties prop ) throws ServiceException;35 public boolean execAppelQSub( final String commandePath, @NotNull final User user, @NotNull final Properties prop ) throws ServiceException; 36 36 37 37 Long insertTapasRequest( @NotNull User user ) throws ServiceException;
Note: See TracChangeset
for help on using the changeset viewer.