Changeset 217 for ether_megapoli
- Timestamp:
- 10/04/11 17:50:31 (13 years ago)
- Location:
- ether_megapoli/trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
ether_megapoli/trunk/common/implementation/com/ether/ParameterConstants.java
r213 r217 3 3 public abstract class ParameterConstants 4 4 { 5 public static final String PARAMETER_RESULT = "result"; 6 public static final String PARAMETER_OK = "ok"; 7 public static final String PARAMETER_NOT_OK = "nok"; 5 8 public static final String PARAMETER_ID = "id"; 6 9 public static final String PARAMETER_DATE = "date"; -
ether_megapoli/trunk/web/src/ApplicationResources.properties
r213 r217 478 478 data.visualization.axeType.2DPoints=2D (points) 479 479 data.authentification.text=Veuillez vous identifier en cliquant sur 'Acc\u00E8s aux donn\u00E9es' afin d'acc\u00E9der aux zones prot\u00E9g\u00E9es de ce site. 480 data.access.extract.process.short=L'extraction des donn\u00E9es est en cours...<br/>Vous allez recevoir un e-mail pour r\u00E9cup\u00E9rer le(s) fichier(s) g\u00E9n\u00E9r\u00E9s. 481 data.access.extract.process.error=Erreur de t\u00E9l\u00E9chargement. <BR>Veuillez essayer de corriger les erreurs suivantes ou contacter l'administrateur en indiquant les erreurs rencontr\u00E9es. 480 482 481 483 simulation.visualization=Des simulations -
ether_megapoli/trunk/web/src/ApplicationResources_en.properties
r213 r217 478 478 479 479 data.authentification.text=Please login by click on 'Access to data' to access the protected areas of this website. 480 data.access.extract.process.short=The downloading is in progress. You will receive an e-mail to get back the generated data file(s). 481 data.access.extract.process.error=Download error. <BR>Please try to correct the following errors or contact the administrator with the detected errors. 480 482 481 483 simulation.visualization=Simulations -
ether_megapoli/trunk/web/src/com/ether/Controller.java
r216 r217 73 73 } 74 74 75 @ControllerMethod(view = VIEW_DOWNLOAD_OK, loginMandatory = true) 76 public Map<String, Object> downloadData( @ParamName(ParameterConstants.PARAMETER_DATE_BEGIN) final String dateBegin, 77 @ParamName(ParameterConstants.PARAMETER_DATE_END) final String dateEnd, 78 @ParamName(ParameterConstants.PARAMETER_PFID_PID_LIST) final String pIdPIdArrayString, 79 @NotNull final Personne personne ) 75 /** *********************************************************** **/ 76 /** *********************** CALLS ***************************** **/ 77 /** 78 * ********************************************************** * 79 */ 80 @ControllerMethod(jsonResult = true) 81 public JSONObject searchParametersByPlateform( @Mandatory @ParamName(ParameterConstants.PARAMETER_ID) final Integer plateformId ) 82 throws ServiceException, EtherException 83 { 84 final List<Parametre> parametersByPlateform = _etherService.getParametersByPlateformId( plateformId ); 85 86 final JSONObject result = new JSONObject(); 87 result.put( ParameterConstants.PARAMETER_PARAMETERS, getJsonHelper().toJSON( parametersByPlateform ) ); 88 return result; 89 } 90 91 92 @ControllerMethod(jsonResult = true, loginMandatory = true) 93 public JSONObject downloadData( @ParamName(ParameterConstants.PARAMETER_DATE_BEGIN) final String dateBegin, 94 @ParamName(ParameterConstants.PARAMETER_DATE_END) final String dateEnd, 95 @ParamName(ParameterConstants.PARAMETER_PFID_PID_LIST) final String pIdPIdArrayString, 96 @NotNull final Personne personne ) 80 97 throws ServiceException, WebException 81 98 { 99 final JSONObject result = new JSONObject(); 100 82 101 final List<Pair<String, String>> pfIdPIdList = EtherHelper.extractpfIdPIdListFromString( pIdPIdArrayString, String.class, String.class ); 83 102 if( null == pfIdPIdList ) … … 121 140 catch( Exception e ) 122 141 { 123 e.printStackTrace(); 124 } 125 126 return new HashMap<String, Object>(); 127 } 128 129 /** *********************************************************** **/ 130 /** *********************** CALLS ***************************** **/ 131 /** 132 * ********************************************************** * 133 */ 134 @ControllerMethod(jsonResult = true) 135 public JSONObject searchParametersByPlateform( @Mandatory @ParamName(ParameterConstants.PARAMETER_ID) final Integer plateformId ) 136 throws ServiceException, EtherException 137 { 138 final List<Parametre> parametersByPlateform = _etherService.getParametersByPlateformId( plateformId ); 139 140 final JSONObject result = new JSONObject(); 141 result.put( ParameterConstants.PARAMETER_PARAMETERS, getJsonHelper().toJSON( parametersByPlateform ) ); 142 result.put( ParameterConstants.PARAMETER_RESULT, ParameterConstants.PARAMETER_NOT_OK ); 143 return result; 144 } 145 146 result.put( ParameterConstants.PARAMETER_RESULT, ParameterConstants.PARAMETER_OK ); 142 147 return result; 143 148 } … … 196 201 dataForm.setListeCoords( dataForm.getLatMin() + "," + dataForm.getLatMax() + "," + dataForm.getLonMin() + "," + dataForm.getLonMax() ); 197 202 dataForm.setListeDates( dataForm.getDateDeb() + "," + dataForm.getDateFin() ); 203 dataForm.setOutput( FORMAT_DEFAULT ); 204 dataForm.setCompression( COMPRESSION_DEFAULT ); 198 205 199 206 return dataForm; -
ether_megapoli/trunk/web/visualization/visu_parameter_by_pf-script.jsp
r213 r217 127 127 }, 128 128 129 requestDownload: function() 130 { 131 var urlObject = this.createUrl(); 132 new Ajax.Request( "?methodName=downloadData&" + urlObject.parameters, 133 { 134 onSuccess:this.handleDownload.bind( this ) 135 } ); 136 }, 137 129 138 // HANDLES ******************************************************** 130 139 handleParametersBySelectedPlateform: function( result ) … … 132 141 this.jsonParameters = result.responseText.evalJSON().parameters; 133 142 this.displayParameters(); 143 }, 144 145 handleDownload: function( result ) 146 { 147 var stateResult = result.responseText.evalJSON().result; 148 149 var downloadWindow = new Window( {className: "dialog", zIndex: 100, resizable: true, draggable:true, wiredDrag: true, showEffect:Effect.BlindDown, hideEffect: Effect.SwitchOff } ); 150 downloadWindow.setTitle( interfaceTexts["data.access.extract3"] ); 151 if( stateResult == "ok" ) 152 { 153 downloadWindow.getContent().innerHTML = '<div class="textExamplesTD">' + interfaceTexts["data.access.extract.process.short"] + '</div>'; 154 downloadWindow.setSize( 350, 50 ); 155 } 156 else 157 { 158 downloadWindow.getContent().innerHTML = '<div class="textExamplesTD">' + interfaceTexts["data.access.extract.process.error"] + '</div>'; 159 downloadWindow.setSize( 350, 60 ); 160 } 161 downloadWindow.show(); 134 162 }, 135 163 … … 310 338 } 311 339 else 312 { 313 var urlObject = this.createUrl(); 314 window.location.href = "?methodName=downloadData&" + urlObject.parameters; 315 } 340 this.requestDownload(); 316 341 }, 317 342 -
ether_megapoli/trunk/web/visualization/visu_parameter_by_pf.jsp
r213 r217 97 97 <div id="containerOptionPlotsSelect" class="span-10"></div> 98 98 <div id="containerOptionPlotsButtons" class="span-10"> 99 <img src="/megapoli/resources/icons/help.gif" id="toolTipPlots" height="19px" width="17px" class="toolTipPlots" onclick="javascript:onClickHelp();"> 100 </div> 99 <img src="/megapoli/resources/icons/help.gif" id="toolTipPlots" height="19px" width="17px" 100 class="toolTipPlots" onclick="javascript:onClickHelp();"> 101 </div> 101 102 </div> 102 103 … … 143 144 interfaceTexts["data.authentification.text"] = "<bean:message key="data.authentification.text"/>"; 144 145 146 interfaceTexts["data.access.extract3"] = "<bean:message key="data.access.extract3"/>"; 147 interfaceTexts["data.access.extract.process.short"] = "<bean:message key="data.access.extract.process.short"/>"; 148 interfaceTexts["data.access.extract.process.error"] = "<bean:message key="data.access.extract.process.error"/>"; 149 145 150 var interfaceVisualization = new InterfaceVisualization( ${plateforms}, ${axeTypesForFixedPlateforms}, ${axeTypesForMobilePlateforms} ); 146 151 </script>
Note: See TracChangeset
for help on using the changeset viewer.