Changeset 490 for tapas/service


Ignore:
Timestamp:
04/26/12 15:42:13 (12 years ago)
Author:
rboipsl
Message:

ajout onglets

Location:
tapas/service
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • tapas/service/implementation/com/ether/TapasServiceImpl.java

    r480 r490  
    4343    { 
    4444 
    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 
    4749 
    4850        final String userPath = ""; 
    4951 
    50         final String fichier = rootPath+"/"+user.getLastName()+"/"+"request.xml"; 
     52        final String fichier = servicePath+"/"+user.getLastName()+"/"+"request.xml"; 
    5153 
    5254        final Element tapas = new Element( "tapas" ); 
     
    258260 
    259261            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" ); 
    262264 
    263265            final Element arlettyFile = new Element( "arletty_file" ); 
     
    272274        } 
    273275 
    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(); 
    283302 
    284303        try 
     
    335354 
    336355 
    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 
    341372            //On utilise ici un affichage classique avec getPrettyFormat() 
    342373            final XMLOutputter sortie = new XMLOutputter( Format.getPrettyFormat() ); 
  • tapas/service/interface/com/ether/TapasService.java

    r480 r490  
    2323            throws ServiceException; 
    2424 
    25     public void createXMLFile( final String fichier, final Document document ); 
     25    public void createXMLFile( final Document document, final String commandePath ); 
    2626 
    2727    public List<Observatory> getAllObservatories() throws ServiceException; 
     
    3333    public String createFileName(String date, String type) throws ServiceException; 
    3434 
    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; 
    3636 
    3737    Long insertTapasRequest( @NotNull User user ) throws ServiceException; 
Note: See TracChangeset for help on using the changeset viewer.