Changeset 779 for tapas/service


Ignore:
Timestamp:
04/01/14 16:56:38 (10 years ago)
Author:
rboipsl
Message:

Dernière version rboipsl

Location:
tapas/service
Files:
2 edited

Legend:

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

    r767 r779  
    4444    public void createXMLRequest( @NotNull final Tapas fTapas, @NotNull final Properties prop ) 
    4545            throws ServiceException 
    46     { 
     46   { 
    4747 
    4848        final String servicePath = prop.getProperty( "service_path" ); 
     
    125125            preferences.addContent( co2e ); 
    126126 
    127             //berv correction 
    128             final Element bervCorr = new Element( "berv_correction" ); 
     127            //ch4 
     128            final Element ch4e = new Element( "ch4_extinction" ); 
    129129            validR = new Attribute( "valid", "YES,NO" ); 
    130             bervCorr.setAttribute( validR ); 
    131             bervCorr.setText( iRequest.getPreference().getBervCorrection().getSecondValue() ); 
    132             preferences.addContent( bervCorr ); 
     130            ch4e.setAttribute( validR ); 
     131            ch4e.setText( iRequest.getPreference().getCh4Extinction().getSecondValue() ); 
     132            preferences.addContent( ch4e ); 
     133 
     134            //no2 
     135            final Element n2oe = new Element( "n2o_extinction" ); 
     136            validR = new Attribute( "valid", "YES,NO" ); 
     137            n2oe.setAttribute( validR ); 
     138            n2oe.setText( iRequest.getPreference().getN2oExtinction().getSecondValue() ); 
     139            preferences.addContent( n2oe ); 
    133140 
    134141 
     
    158165            try 
    159166            { 
    160                 obs = _observatoryDAO.selectByPrimaryKey( iRequest.getObservation().getObservatory().getId() ); 
     167                //obs = _observatoryDAO.selectByPrimaryKey( iRequest.getObservation().getObservatory().getId() ); 
     168                obs = _observatoryDAO.getObservatoryByName( iRequest.getObservation().getObservatory().getName() ); 
    161169            } 
    162170            catch( PersistenceException e ) 
     
    280288            instrument.addContent( samplingRatio ); 
    281289 
     290            //berv correction 
     291            //final Element bervCorr = new Element( "berv_correction" ); 
     292            final Element bervCorr = new Element( "appli_berv" ); 
     293            validR = new Attribute( "valid", "YES,NO" ); 
     294            bervCorr.setAttribute( validR ); 
     295            bervCorr.setText( iRequest.getPreference().getBervCorrection().getSecondValue() ); 
     296            instrument.addContent( bervCorr ); 
     297 
     298 
    282299            request.addContent( observation ); 
    283300 
     
    629646 
    630647 
     648    // recuperation infos observatoire avec le nom 
     649    @Nullable 
     650    @Transactional(readOnly = true) 
     651    public Observatory getObservatoryByName( @NotNull final String name ) 
     652            throws ServiceException 
     653    { 
     654        try 
     655        { 
     656            return _observatoryDAO.getObservatoryByName( name ); 
     657        } 
     658        catch( PersistenceException e ) 
     659        { 
     660            throw new ServiceException( ServiceException.ServiceCode.OBSERVATORY_NOT_FOUND, e ); 
     661        } 
     662    } 
     663 
     664 
    631665    @Required 
    632666    public void setObservatoryDAO( final ObservatoryDAO observatoryDAO ) 
  • tapas/service/interface/com/ether/TapasService.java

    r507 r779  
    3232    public Observatory getObservatoryById(@NotNull final long id) throws ServiceException; 
    3333 
     34    public Observatory getObservatoryByName(@NotNull final String name) throws ServiceException; 
     35 
    3436    public Long getNumRequest() throws ServiceException; 
    3537 
Note: See TracChangeset for help on using the changeset viewer.