Ignore:
Timestamp:
11/14/11 16:33:00 (13 years ago)
Author:
vmipsl
Message:

Modif pages medias

Location:
ether_megapoli/trunk/web/src
Files:
3 edited
2 copied

Legend:

Unmodified
Added
Removed
  • ether_megapoli/trunk/web/src/ApplicationResources.properties

    r228 r247  
    8383data.intro1=Vous pouvez demander l'ouverture d'un compte personnalis\u00E9 en envoyant un email au  
    8484data.authentification=Authentification 
    85 data.authentification.intro=Veuillez vous identifier ci-dessous afin d'acc\u00E9der aux zones prot\u00E9g\u00E9es de ce site. 
     85data.authentification.intro=Veuillez vous identifier afin d'acc\u00E9der aux zones prot\u00E9g\u00E9es de ce site. 
    8686data.authentification.login=Login 
    8787data.authentification.pwd=Mot de passe 
     
    251251data.access.intro2=Une interface dynamique permet d'extraire des donn\u00E9es de la base de donn\u00E9es Megapoli. 
    252252data.access.intro3=Dans cette zone, vous pouvez \:<ul><li>acc\u00E9der aux donn\u00E9es en t\u00E9l\u00E9chargeant directement les fichiers d'origine issus de chaque jeu de donn\u00E9es</li><li>consulter les m\u00E9tadonn\u00E9es \:</li></ul> 
     253data.access.intro4=Cette zone concerne l'acc\u00E8s et le d\u00E9p\u00F4t de donn\u00E9es. 
    253254data.access.listFiles.title=Fichiers d\u00E9pos\u00E9s dans le jeu {0} 
    254255data.access.metadata.link=Voir les m\u00E9tadonn\u00E9es du jeu 
     
    503504plot.degres=Degr\u00E9s 
    504505 
     506####################### BACKOFFICE ####################### 
     507bo.fulltitle=MEGAPOLI Backoffice 
  • ether_megapoli/trunk/web/src/ApplicationResources_en.properties

    r228 r247  
    8383data.intro1=You can ask for a login account by sending an email to the  
    8484data.authentification=Authentification 
    85 data.authentification.intro=Please login below to access the protected areas of this website. 
     85data.authentification.intro=Please login to access the protected areas of this website. 
    8686data.authentification.login=Login 
    8787data.authentification.pwd=Password 
     
    251251data.access.intro2=The interface is based on interactive queries through Megapoli database 
    252252data.access.intro3=In this area, you can<ul><li>access the data by directly downloading the original files from each data set</li><li>consult the data characteristics \:</li></ul> 
     253data.access.intro4=This area is for access and download MEGAPOLI data. 
    253254data.access.listFiles.title=Files uploaded in the data set {0} 
    254255data.access.metadata.link=See metadata 
     
    502503plot.longitude=Longitude 
    503504plot.degres=Degrees 
     505 
     506 
     507####################### BACKOFFICE ####################### 
     508bo.fulltitle=MEGAPOLI Backoffice 
  • ether_megapoli/trunk/web/src/com/ether/ControllerBackoffice.java

    r246 r247  
    3737/** 
    3838 * @author vmipsl 
    39  * @date 17 feb 2011 
     39 * @date 13 nov 2011 
    4040 */ 
    41 public class ControllerVisualization 
     41public class ControllerBackoffice 
    4242        extends ControllerEther 
    4343{ 
     44    // TODO : mettre un pwd pour chaque méthode !!! 
     45 
    4446    /** *********************************************************** **/ 
    4547    /** *********************** VIEWS ***************************** **/ 
    4648    /** *********************************************************** **/ 
    47     // Default view if methodName is unknown 
    48     public ModelAndView home( final HttpServletRequest request, final HttpServletResponse response ) 
    49             throws EtherException 
    50     { 
    51         return new ModelAndView( "index" ); 
    52     } 
    53  
    54     @ControllerMethod(view = VIEW_WORK) 
    55     public Map<String, Object> viewInWork() 
    56             throws ServiceException 
    57     { 
    58         return new HashMap<String, Object>(); 
    59     } 
    60  
    61     @ControllerMethod(view = VIEW_VISUALIZATION) 
     49    @ControllerMethod(view = VIEW_BO_INDEX) 
    6250    public Map<String, Object> view() 
    6351            throws ServiceException 
     
    7664        final Map<String, Object> model = new HashMap<String, Object>(); 
    7765        model.put( "plateforms", getJsonHelper().toJSON( plateforms ) ); 
    78         model.put( "axeTypesForFixedPlateforms", getJSONAxeTypesForFixedPlateforms() ); 
    79         model.put( "axeTypesForMobilePlateforms", getJSONAxeTypesForMobilePlateforms() ); 
    8066        model.put( "firstDate", DateHelper.formatDate( firstDate, DateHelper.ENGLISH_DATE_PATTERN ) ); 
    8167        model.put( "lastDate", DateHelper.formatDate( endDate, DateHelper.ENGLISH_DATE_PATTERN ) ); 
     
    8672    /** *********************** CALLS ***************************** **/ 
    8773    /** *********************************************************** **/ 
    88     @ControllerMethod(jsonResult = true) 
    89     public JSONObject searchParametersByPlateform( @Mandatory @ParamName(ParameterConstants.PARAMETER_ID) final Integer plateformId ) 
    90             throws ServiceException, EtherException 
    91     { 
    92         final List<Parametre> fullParametersByPlateform = _etherService.getParametersByPlateformId( plateformId ); 
    93         final List<List<Parametre>> parametersByPlateform = manageMenusForParameterList( fullParametersByPlateform ); 
    9474 
    95         final JSONObject result = new JSONObject(); 
    96         result.put( ParameterConstants.PARAMETER_PARAMETERS, getJsonHelper().toJSON( parametersByPlateform ) ); 
    97         return result; 
    98     } 
    99  
    100     /** 
    101      * This method manage the sub-menus for the list of parameters (to avoid multiple "Particle Concentration" by example) 
    102      * The fullParameters must be ordered with parameterName ascendant 
    103      * 
    104      * @param fullParameters 
    105      * @return 
    106      */ 
    107     @NotNull 
    108     private List<List<Parametre>> manageMenusForParameterList( @NotNull final List<Parametre> fullParameters ) 
    109     { 
    110         final List<List<Parametre>> parameterListWithMenu = new ArrayList<List<Parametre>>(); 
    111  
    112         int i = 0; 
    113         while( i < fullParameters.size() ) 
    114         { 
    115             final Parametre fullParameter = fullParameters.get( i ); 
    116             final int firstIndex = fullParameters.indexOf( fullParameter ); 
    117             final int lastIndex = fullParameters.lastIndexOf( fullParameter ); 
    118             final List<Parametre> parameters = fullParameters.subList( firstIndex, lastIndex + 1 ); 
    119             parameterListWithMenu.add( parameters ); 
    120             i += parameters.size(); 
    121         } 
    122  
    123         return parameterListWithMenu; 
    124     } 
    125  
    126  
    127     @ControllerMethod(jsonResult = true, loginMandatory = true) 
    128     public JSONObject downloadData( @ParamName(ParameterConstants.PARAMETER_DATE_BEGIN) final String dateBegin, 
    129                                     @ParamName(ParameterConstants.PARAMETER_DATE_END) final String dateEnd, 
    130                                     @ParamName(ParameterConstants.PARAMETER_PFID_PID_LIST) final String pIdPIdArrayString, 
    131                                     @NotNull final Personne personne ) 
    132             throws ServiceException, WebException 
    133     { 
    134         final JSONObject result = new JSONObject(); 
    135  
    136         final List<Pair<String, String>> pfIdPIdList = EtherHelper.extractpfIdPIdListFromString( pIdPIdArrayString, String.class, String.class ); 
    137         if( null == pfIdPIdList ) 
    138             throw new WebException( WebException.WebCode.PLATEFORM_OR_PARAMETER_IS_NULL, null ); 
    139  
    140         final DatasForm dataForm = createDataForm( dateBegin, dateEnd, pfIdPIdList ); 
    141  
    142         final XMLOutputter outXml = new XMLOutputter(); 
    143         final Document docXml = Requete.toXml( dataForm, personne ); 
    144         final String requete = outXml.outputString( docXml ); 
    145         try 
    146         { 
    147             final String encoded = "requete=" + URLEncoder.encode( requete, "UTF-8" ); 
    148             // Configuration de l'URL 
    149             final String urlCGIStr = (String) this.getServletContext().getAttribute( "APP_CGI" ); 
    150             final URL urlCGI = new URL( urlCGIStr ); 
    151             final URLConnection conn = urlCGI.openConnection(); 
    152             conn.setDoOutput( true ); 
    153             conn.setUseCaches( false ); 
    154             conn.setRequestProperty( "content-type", "application/x-www-form-urlencoded" ); 
    155  
    156             // Envoi de la requête 
    157             final DataOutputStream out = new DataOutputStream( conn.getOutputStream() ); 
    158             out.writeBytes( encoded ); 
    159             out.flush(); 
    160             out.close(); 
    161  
    162             // Réponse du CGI 
    163             final BufferedReader in = new BufferedReader( new InputStreamReader( conn.getInputStream() ) ); 
    164             String aLine; 
    165             while( ( aLine = in.readLine() ) != null ) 
    166             { 
    167                 if( aLine.length() == 0 ) continue; 
    168                 if( aLine.startsWith( "1" ) ) 
    169                 { 
    170                     System.err.println( "ERROR :" + aLine ); 
    171                 } 
    172                 else System.out.println( "REPONSE :" + aLine ); 
    173             } 
    174         } 
    175         catch( Exception e ) 
    176         { 
    177             result.put( ParameterConstants.PARAMETER_RESULT, ParameterConstants.PARAMETER_NOT_OK ); 
    178             return result; 
    179         } 
    180  
    181         result.put( ParameterConstants.PARAMETER_RESULT, ParameterConstants.PARAMETER_OK ); 
    182         return result; 
    183     } 
    184  
    185     /** 
    186      * This method create a dataForms to simulate and use the struts actions "DataAccessAction" and "DataSubmitAction" 
    187      * 
    188      * @param dateBegin 
    189      * @param dateEnd 
    190      * @param pfIdPIdList 
    191      * @return 
    192      * @throws WebException 
    193      */ 
    194     @NotNull 
    195     private DatasForm createDataForm( final String dateBegin, final String dateEnd, final List<Pair<String, String>> pfIdPIdList ) 
    196             throws WebException 
    197     { 
    198         final DatasForm dataForm = new DatasForm(); 
    199  
    200         // Plateforms and parameters 
    201         final List<String> plateformIds = EtherHelper.getFirstValues( pfIdPIdList ); 
    202         final List<String> parameterIds = EtherHelper.getSecondValues( pfIdPIdList ); 
    203         dataForm.setSelectPlats( plateformIds.toArray( new String[plateformIds.size()] ) ); 
    204         dataForm.setSelectParams( parameterIds.toArray( new String[parameterIds.size()] ) ); 
    205  
    206         // Localisations 
    207         final MesureAdapter mAdapter = new MesureAdapter(); 
    208         mAdapter.loadLocsFromDatabase( dataForm ); 
    209  
    210         // Dates 
    211         final Calendar calendar = Calendar.getInstance(); 
    212         String formatedDateBegin = null; 
    213         String formatedDateEnd = null; 
    214         if( null != dateBegin && null != dateEnd && !"false".equals( dateBegin ) && !"false".equals( dateEnd ) ) 
    215         { 
    216             try 
    217             { 
    218                 calendar.setTimeInMillis( Long.valueOf( dateBegin ) ); 
    219                 formatedDateBegin = DateHelper.formatDate( calendar.getTime(), DateHelper.FRENCH_DATE_PATTERN ); 
    220                 calendar.setTimeInMillis( Long.valueOf( dateEnd ) ); 
    221                 formatedDateEnd = DateHelper.formatDate( calendar.getTime(), DateHelper.FRENCH_DATE_PATTERN ); 
    222                 dataForm.setDateDeb( formatedDateBegin ); 
    223                 dataForm.setDateFin( formatedDateEnd ); 
    224             } 
    225             catch( Exception e ) 
    226             { 
    227                 throw new WebException( WebException.WebCode.INVALID_DATE, e ); 
    228             } 
    229         } 
    230         else 
    231             mAdapter.loadDatesFromDatabase( dataForm ); 
    232  
    233         // Fill dataForm 
    234         final ValeurAdapter vAdapter = new ValeurAdapter(); 
    235         vAdapter.loadCountFromDatabase( dataForm ); 
    236         dataForm.setListeCoords( dataForm.getLatMin() + "," + dataForm.getLatMax() + "," + dataForm.getLonMin() + "," + dataForm.getLonMax() ); 
    237         dataForm.setListeDates( dataForm.getDateDeb() + "," + dataForm.getDateFin() ); 
    238         dataForm.setOutput( FORMAT_DEFAULT ); 
    239         dataForm.setCompression( COMPRESSION_DEFAULT ); 
    240  
    241         return dataForm; 
    242     } 
    243  
    244     private List<JSONObject> getJSONAxeTypesForFixedPlateforms() 
    245     { 
    246         final AxeTypeForFixedPlateform[] axeTypes = AxeTypeForFixedPlateform.values(); 
    247  
    248         final List<JSONObject> jsonAxeTypes = new ArrayList<JSONObject>( axeTypes.length ); 
    249  
    250         for( final AxeTypeForFixedPlateform axeType : axeTypes ) 
    251         { 
    252             final JSONObject jsonAxeType = new JSONObject(); 
    253             jsonAxeType.put( "text", axeType.name() ); 
    254             jsonAxeType.put( "value", axeType.name() ); 
    255             jsonAxeTypes.add( jsonAxeType ); 
    256         } 
    257         return jsonAxeTypes; 
    258     } 
    259  
    260     private List<JSONObject> getJSONAxeTypesForMobilePlateforms() 
    261     { 
    262         final AxeTypeForMobilePlateform[] axeTypes = AxeTypeForMobilePlateform.values(); 
    263  
    264         final List<JSONObject> jsonAxeTypes = new ArrayList<JSONObject>( axeTypes.length ); 
    265  
    266         for( final AxeTypeForMobilePlateform axeType : axeTypes ) 
    267         { 
    268             final JSONObject jsonAxeType = new JSONObject(); 
    269             jsonAxeType.put( "text", axeType.name() ); 
    270             jsonAxeType.put( "value", axeType.name() ); 
    271             jsonAxeTypes.add( jsonAxeType ); 
    272         } 
    273         return jsonAxeTypes; 
    274     } 
    275  
    276     @Required 
     75   @Required 
    27776    public void setEtherService( @NotNull final EtherService etherService ) 
    27877    { 
     
    28079    } 
    28180 
    282     private static final Log LOGGER = LogFactory.getLog( ControllerVisualization.class ); 
     81    private static final Log LOGGER = LogFactory.getLog( ControllerBackoffice.class ); 
    28382 
    284     private static final String VIEW_WORK = "visualization/inWork"; 
    285     private static final String VIEW_VISUALIZATION = "visualization/visu"; 
     83    private static final String VIEW_BO_INDEX = "backoffice/index"; 
    28684    private static final String VIEW_VISUALIZATION_PARAMETER_BY_PLATEFORM = "visualization/visu_parameter_by_pf"; 
    287     private static final String VIEW_DOWNLOAD_OK = "data/access/extract3"; 
    28885 
    289     private static final String FORMAT_DEFAULT = "NASA-AMES"; 
    290     private static final String COMPRESSION_DEFAULT = "None"; 
    29186    private EtherService _etherService; 
    29287} 
  • ether_megapoli/trunk/web/src/com/ether/ControllerData.java

    r246 r247  
    1818    /** *********************** VIEWS ***************************** **/ 
    1919    /** *********************************************************** **/ 
    20     @ControllerMethod(view = VIEW_CATALOG) 
    21     public Map<String, Object> viewCatalog() 
     20    @ControllerMethod(view = VIEW_CATALOG_RESUME) 
     21    public Map<String, Object> viewCatalogResume() 
    2222            throws ServiceException 
    2323    { 
     
    5353    } 
    5454 
     55    @ControllerMethod(view = VIEW_DATA_RESUME) 
     56    public Map<String, Object> viewDataResume() 
     57            throws ServiceException 
     58    { 
     59        return new HashMap<String, Object>(); 
     60    } 
     61 
     62    @ControllerMethod(view = VIEW_METADATA_INFO) 
     63    public Map<String, Object> viewMetadataInfo() 
     64            throws ServiceException 
     65    { 
     66        return new HashMap<String, Object>(); 
     67    } 
     68 
     69    @ControllerMethod(view = VIEW_DESC_PARAMETER) 
     70    public Map<String, Object> viewDescParameter() 
     71            throws ServiceException 
     72    { 
     73        return new HashMap<String, Object>(); 
     74    } 
     75 
     76    @ControllerMethod(view = VIEW_DESC_SENSOR) 
     77    public Map<String, Object> viewDescSensor() 
     78            throws ServiceException 
     79    { 
     80        return new HashMap<String, Object>(); 
     81    } 
     82 
     83    @ControllerMethod(view = VIEW_DESC_PLATEFORM) 
     84    public Map<String, Object> viewDescPlateform() 
     85            throws ServiceException 
     86    { 
     87        return new HashMap<String, Object>(); 
     88    } 
     89 
    5590    /** *********************************************************** **/ 
    5691    /** *********************** CALLS ***************************** **/ 
     
    5994    private static final Log LOGGER = LogFactory.getLog( ControllerData.class ); 
    6095 
    61     private static final String VIEW_CATALOG = "data/access"; 
     96    private static final String VIEW_CATALOG_RESUME = "data/catalogResume"; 
    6297    private static final String VIEW_SETS = "data/jeux"; 
    63     private static final String VIEW_PARAMETERS = "data/param"; 
    64     private static final String VIEW_SENSORS = "data/capt"; 
    65     private static final String VIEW_PLATEFORMS = "data/plat"; 
     98    private static final String VIEW_PARAMETERS = "data/parameter"; 
     99    private static final String VIEW_SENSORS = "data/sensor"; 
     100    private static final String VIEW_PLATEFORMS = "data/plateform"; 
     101    private static final String VIEW_DATA_RESUME = "data/dataResume"; 
     102 
     103    private static final String VIEW_METADATA_INFO = "data/metadataInfo"; 
     104    private static final String VIEW_DESC_PARAMETER = "data/desc_parameter"; 
     105    private static final String VIEW_DESC_SENSOR = "data/desc_sensor"; 
     106    private static final String VIEW_DESC_PLATEFORM = "data/desc_plateform"; 
     107 
    66108} 
  • ether_megapoli/trunk/web/src/com/ether/ControllerEponge.java

    r246 r247  
    1010/** 
    1111 * @author vmipsl 
    12  * @date 10 nov 2011 
     12 * @date 12 nov 2011 
    1313 */ 
    14 public class ControllerData 
     14public class ControllerEponge 
    1515        extends ControllerEther 
    1616{ 
     
    1818    /** *********************** VIEWS ***************************** **/ 
    1919    /** *********************************************************** **/ 
    20     @ControllerMethod(view = VIEW_CATALOG) 
    21     public Map<String, Object> viewCatalog() 
     20    @ControllerMethod(view = VIEW_ERRORS) 
     21    public Map<String, Object> viewErrors() 
    2222            throws ServiceException 
    2323    { 
     
    2525    } 
    2626 
    27     @ControllerMethod(view = VIEW_SETS) 
    28     public Map<String, Object> viewSets() 
    29             throws ServiceException 
    30     { 
    31         return new HashMap<String, Object>(); 
    32     } 
    33  
    34     @ControllerMethod(view = VIEW_PARAMETERS) 
    35     public Map<String, Object> viewParameters() 
    36             throws ServiceException 
    37     { 
    38         return new HashMap<String, Object>(); 
    39     } 
    40  
    41     @ControllerMethod(view = VIEW_SENSORS) 
    42     public Map<String, Object> viewSensors() 
    43             throws ServiceException 
    44     { 
    45         return new HashMap<String, Object>(); 
    46     } 
    47  
    48     @ControllerMethod(view = VIEW_PLATEFORMS) 
    49     public Map<String, Object> viewPlateforms() 
     27    @ControllerMethod(view = VIEW_LOGIN) 
     28    public Map<String, Object> viewLogin() 
    5029            throws ServiceException 
    5130    { 
     
    5736    /** *********************************************************** **/ 
    5837 
    59     private static final Log LOGGER = LogFactory.getLog( ControllerData.class ); 
     38    private static final Log LOGGER = LogFactory.getLog( ControllerEponge.class ); 
    6039 
    61     private static final String VIEW_CATALOG = "data/access"; 
    62     private static final String VIEW_SETS = "data/jeux"; 
    63     private static final String VIEW_PARAMETERS = "data/param"; 
    64     private static final String VIEW_SENSORS = "data/capt"; 
    65     private static final String VIEW_PLATEFORMS = "data/plat"; 
     40    private static final String VIEW_ERRORS = "project/errors"; 
     41    private static final String VIEW_LOGIN = "project/login"; 
    6642} 
Note: See TracChangeset for help on using the changeset viewer.