Changeset 411 for tapas/service
- Timestamp:
- 03/14/12 17:48:39 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tapas/service/implementation/com/ether/TapasServiceImpl.java
r409 r411 3 3 import com.ether.dao.ParameterDAO; 4 4 import com.ether.dao.PlateformDAO; 5 import com.ether.tapas.Request; 5 6 import com.ether.tapas.Tapas; 6 7 import org.apache.commons.logging.Log; … … 27 28 { 28 29 29 public void createXMLRequest( @NotNull final Tapas tapas )30 public void createXMLRequest( @NotNull final Tapas fTapas ) 30 31 { 31 String idF = "Ether_TAPAS_0000001";32 String idRF = "1";33 String validFF = "ASCII";34 String validRF = "YES";35 32 36 String xvalidFF = "ASCII,FITS,NETCDF"; 37 String xvalidRF = "YES,NO"; 38 String fichier = "request1.xml"; 33 final String fichier = "/home_local/workspace/request1.xml"; 39 34 40 final Element racine= new Element( "tapas" );35 final Element tapas = new Element( "tapas" ); 41 36 final Element request = new Element( "request" ); 42 37 final Element preferences = new Element( "preferences" ); … … 45 40 46 41 //On crée un nouveau Document JDOM basé sur la racine que l'on vient de créer 47 final Document document = new Document( racine);42 final Document document = new Document( tapas ); 48 43 49 final Attribute id = new Attribute( "Id", idF);50 racine.setAttribute( id );44 final Attribute id = new Attribute( "Id", fTapas.getId() ); 45 tapas.setAttribute( id ); 51 46 52 final Attribute idR = new Attribute( "Id", idRF );53 request.setAttribute( idR);47 //a terme devient une boucle 48 final List<Request> requests = fTapas.getRequests(); 54 49 55 racine.addContent( request ); 56 request.addContent( preferences ); 50 for( final Request iRequest : requests ) 51 { 52 final Attribute idR = new Attribute( "Id", iRequest.getId().toString() ); 53 request.setAttribute( idR ); 57 54 58 final Attribute validF = new Attribute( "valid", xvalidFF ); 59 format.setAttribute( validF ); 60 format.setText( validFF ); 55 tapas.addContent( request ); 56 request.addContent( preferences ); 61 57 62 final Attribute validR = new Attribute( "valid", xvalidRF ); 63 rayleighExtinction.setAttribute( validR ); 64 rayleighExtinction.setText( validRF ); 58 final Attribute validF = new Attribute( "valid", iRequest.getPreference().getFormat().getFirstValue() ); 59 format.setAttribute( validF ); 60 format.setText( iRequest.getPreference().getFormat().getSecondValue() ); 61 62 final Attribute validR = new Attribute( "valid", iRequest.getPreference().getRayleighExtinction().getFirstValue() ); 63 rayleighExtinction.setAttribute( validR ); 64 rayleighExtinction.setText( iRequest.getPreference().getRayleighExtinction().getSecondValue() ); 65 66 } 65 67 66 68 createXMLFile( fichier, document );
Note: See TracChangeset
for help on using the changeset viewer.