Changeset 732
- Timestamp:
- 01/18/13 17:58:52 (11 years ago)
- Location:
- ether_iasi/trunk
- Files:
-
- 7 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
ether_iasi/trunk/common/implementation/com/ether/DateHelper.java
r710 r732 1 1 package com.ether; 2 3 import org.apache.commons.logging.Log; 4 import org.apache.commons.logging.LogFactory; 5 import org.jetbrains.annotations.Nullable; 2 6 3 7 import java.text.DateFormat; … … 7 11 import java.util.Date; 8 12 import java.util.Locale; 9 10 import org.apache.commons.logging.Log;11 import org.apache.commons.logging.LogFactory;12 import org.jetbrains.annotations.Nullable;13 13 14 14 /** … … 132 132 133 133 @Nullable 134 public static Date parseDate( @Nullable final String date, final String format ) throws ParseException 134 public static Date parseDate( @Nullable final String date, final String format ) 135 throws ParseException 135 136 { 136 137 if( date == null ) 137 138 return null; 138 139 139 140 final SimpleDateFormat simpleDateFormat = new SimpleDateFormat( format ); 140 return simpleDateFormat.parse( date);141 return simpleDateFormat.parse( date ); 141 142 } 142 143 143 144 private static final Log LOGGER = LogFactory.getLog( DateHelper.class ); 144 145 145 146 public static final String FRENCH_DATE_PATTERN_SHORT = "dd/MM/yyyy"; 147 public static final String FRENCH_DATE_PATTERN = "dd/MM/yyyy HH:mm"; 146 148 public static final String ENGLISH_DATE_PATTERN_SHORT = "yyyy-MM-dd"; 147 149 public static final String ENGLISH_DATE_PATTERN = "yyyy-MM-dd HH:mm"; -
ether_iasi/trunk/web/project/dataAccess.jsp
r728 r732 31 31 <ether:htmlJs jsFile="classesForJQuery/Select"/> 32 32 <ether:htmlJs jsFile="classesForJQuery/Tab"/> 33 <ether:htmlJs jsFile="classesForJQuery/Radio"/> 33 34 <ether:htmlJs jsFile="calendar/anytime"/> 34 35 … … 43 44 44 45 <div class="containerDataAccess"> 45 <div id="title" class=" containerTitle"></div>46 <div id="title" class="mainTitle"></div> 46 47 47 <div class="containerAccess"> 48 <div class="title1"><spring:message code="label.access.level"/></div><BR/> 49 <div id="productLevel"></div> 50 <div id="productLevelComment"></div> 51 </div> 48 <div id="accessContent"> 49 <div class="containerAccess"> 50 <div class="subTitle"><spring:message code="label.access.level"/></div> 51 <BR/> 52 52 53 <div id="spatial" class="containerAccess">54 <div class="title1"><spring:message code="label.access.spatial"/></div>55 </div>53 <div id="productLevel"></div> 54 <div id="productLevelComment"></div> 55 </div> 56 56 57 <div id="temporal" class="containerAccess"> 58 <div class="title1"><spring:message code="label.access.temporal"/></div><BR/> 59 <spring:message code="label.access.date.begin"/> : <input type="text" id="beginDate" size="15"/> 60 <spring:message code="label.access.date.end"/> : <input type="text" id="endDate" size="15"/> 57 <div id="spatial" class="containerAccess"> 58 <div class="subTitle"><spring:message code="label.access.spatial"/></div> 59 </div> 60 61 <div id="temporal" class="containerAccess"> 62 <div class="subTitle"><spring:message code="label.access.temporal"/></div> 63 <BR/> 64 65 <spring:message code="label.access.date.begin"/> : <input type="text" id="beginDate" size="15"/> 66 67 <spring:message code="label.access.date.end"/> : <input type="text" id="endDate" size="15"/> 68 </div> 69 70 <div id="buttonDataAccess"></div> 61 71 </div> 62 72 -
ether_iasi/trunk/web/project/dataAccess_script.jsp
r728 r732 10 10 this.containerTab = $( "#tab" ); 11 11 this.containerTitle = $( "#title" ); 12 this.containterAccessContent = $( "#accessContent" ); 12 13 this.containerProductLevel = $( "#productLevel" ); 13 14 this.containerProductLevelComment = $( "#productLevelComment" ); 14 15 this.containerSpatial = $( "#spatial" ); 15 16 this.containerTemporal = $( "#temporal" ); 17 this.containerButton = $( "#buttonDataAccess" ); 16 18 this.containerErrors = $( "#errors" ); 17 19 … … 23 25 this.lastDate = formatDate( addHoursToDate( new Date(), 1 ) ); 24 26 25 this.createTabs();26 27 this.createProductLevels(); 27 28 this.createTemporal(); 29 this.createTabs(); 30 31 var dataButton = new Button( {id:"dataButton", value:"<spring:message code="label.access.get"/>", parent:this.containerButton, className: "small get", onClick:jQuery.proxy( this.onClickData, this )} ); 28 32 }, 29 33 … … 41 45 createProductLevels: function() 42 46 { 43 var divRadioBalloon = this.createRadio( "ballonRadio", "productLevel", "balloon", '<spring:message code="label.access.level.balloon"/>', jQuery.proxy( this.onClickRadio, [this, '<spring:message code="label.access.level.balloon.comment"/>'] ), true ); 44 this.containerProductLevel.append( divRadioBalloon ); 45 var divRadioClouds = this.createRadio( "cloudRadio", "productLevel", "cloud", '<spring:message code="label.access.level.clouds"/>', jQuery.proxy( this.onClickRadio, [this, '<spring:message code="label.access.level.clouds.comment"/>'] ), false ); 46 this.containerProductLevel.append( divRadioClouds ); 47 var divRadioTemp = this.createRadio( "tempRadio", "productLevel", "temp", '<spring:message code="label.access.level.temp"/>', jQuery.proxy( this.onClickRadio, [this, '<spring:message code="label.access.level.temp.comment"/>'] ), false ); 48 this.containerProductLevel.append( divRadioTemp ); 49 var divRadioCarbon = this.createRadio( "carbonRadio", "productLevel", "carbon", '<spring:message code="label.access.level.carbon"/>', jQuery.proxy( this.onClickRadio, [this, '<spring:message code="label.access.level.carbon.comment"/>'] ), false ); 50 this.containerProductLevel.append( divRadioCarbon ); 51 }, 52 53 createRadio: function( id, name, value, text, onClickRadio, checked ) 54 { 55 var divRadio = $( document.createElement( "div" ) ); 56 divRadio.addClass( "radioProductLevel" ); 57 58 var radio = $( document.createElement( "input" ) ); 59 radio.attr( {type: "radio", id:id, name:name, value:value, checked: checked} ); 60 divRadio.append( radio ); 61 62 var label = $( document.createElement( "label" ) ); 63 label.attr( {for:id} ); 64 label.html( text ); 65 divRadio.append( label ); 66 67 divRadio.bind( 'click', this, onClickRadio ); 68 if( checked ) 69 divRadio.click(); 70 return divRadio; 47 this.radioBalloon = new Radio( {id:"ballonRadio", name:"productLevel", value:"balloon", parent:this.containerProductLevel, className:"radioProductLevel", text:'<spring:message code="label.access.level.balloon"/>', onClick:jQuery.proxy( this.onClickRadio, [this, '<spring:message code="label.access.level.balloon.comment"/>'] )} ); 48 this.radioCloud = new Radio( {id:"cloudRadio", name:"productLevel", value:"cloud", parent:this.containerProductLevel, className:"radioProductLevel", text:'<spring:message code="label.access.level.clouds"/>', onClick:jQuery.proxy( this.onClickRadio, [this, '<spring:message code="label.access.level.clouds.comment"/>'] )} ); 49 this.radioTemp = new Radio( {id:"tempRadio", name:"productLevel", value:"temp", parent:this.containerProductLevel, className:"radioProductLevel", text:'<spring:message code="label.access.level.temp"/>', onClick:jQuery.proxy( this.onClickRadio, [this, '<spring:message code="label.access.level.temp.comment"/>'] )} ); 50 this.radioCarbon = new Radio( {id:"carbonRadio", name:"productLevel", value:"carbon", parent:this.containerProductLevel, className:"radioProductLevel", text:'<spring:message code="label.access.level.carbon"/>', onClick:jQuery.proxy( this.onClickRadio, [this, '<spring:message code="label.access.level.carbon.comment"/>'] )} ); 71 51 }, 72 52 … … 101 81 this.beginDate = this.calendarConverter.parse( $( "#beginDate" ).val() ).getTime(); 102 82 this.endDate = this.calendarConverter.parse( $( "#endDate" ).val() ).getTime(); 103 104 this.clearCalendarButton = new Button( {value:'<spring:message code="label.clear"/>', parent:this.containerTemporal, id:"button_clear_calendar", className:"small", onClick:jQuery.proxy( this.onClickClear, this )} );105 83 }, 106 84 107 85 // REQUESTS ******************************************************** 108 // requestQuickLooksBySelectValues: function() 109 // { 110 // $.ajax( { 111 // url: "project?methodName=getQuicklookByValues&satellite=" + this.selectSatellites.getValue() + "&projection=" + this.selectProjections.getValue() + "&species=" + this.selectSpecies.getValue() + "&date=" + this.beginDate, 112 // success:jQuery.proxy( this.handleQuickLooksBySelectValues, this ), 113 // error: jQuery.proxy( this.showErrors, this ) 114 // } ); 115 // }, 86 requestDataAccessBySelectValues: function() 87 { 88 var radioValue = $( 'input[type=radio][name=productLevel]:checked' ).attr( 'value' ); 89 $.ajax( { 90 url: "project?methodName=getDataByValues&productLevel=" + radioValue + "&dateBegin=" + this.beginDate + "&dateEnd=" + this.endDate, 91 success:jQuery.proxy( this.handleDataAccessBySelectValues, this ), 92 error: jQuery.proxy( this.showErrors, this ) 93 } ); 94 }, 116 95 117 96 118 97 // HANDLES ******************************************************** 119 // handleQuickLooksBySelectValues: function( result ) 120 // { 121 // 122 // var plotName = jQuery.parseJSON( result ).plotNameResult; 123 // this.containerQuickLookA.html( plotName ); 124 // }, 98 handleDataAccessBySelectValues: function( result ) 99 { 100 var resu = jQuery.parseJSON( result ).resultTest; 101 alert( resu ); 102 }, 125 103 126 104 … … 129 107 { 130 108 this.containerTitle.html( '<spring:message code="label.access.metopA.title"/>' ); 109 this.containterAccessContent.show(); 110 this.initFieldsAB(); 131 111 }, 132 112 … … 134 114 { 135 115 this.containerTitle.html( '<spring:message code="label.access.metopB.title"/>' ); 116 this.containterAccessContent.show(); 117 this.initFieldsAB(); 136 118 }, 137 119 … … 139 121 { 140 122 this.containerTitle.html( '<spring:message code="label.access.balloon.title"/>' ); 123 this.containterAccessContent.hide(); 141 124 }, 142 125 … … 146 129 var comment = this[1]; 147 130 context.containerProductLevelComment.html( comment ); 148 },149 150 onClickClear: function()151 {152 $( "#beginDate" ).val( "" );153 this.beginDate = false;154 $( "#endDate" ).val( "" );155 this.endDate = false;156 131 }, 157 132 … … 177 152 }, 178 153 154 onClickData : function() 155 { 156 this.requestDataAccessBySelectValues(); 157 }, 158 179 159 // OTHERS ******************************************************** 180 160 showErrors: function( result ) … … 182 162 this.containerErrors.show(); 183 163 this.containerErrors.html( result ); 164 }, 165 166 initFieldsAB: function() 167 { 168 this.radioBalloon.check(); 169 $( "#beginDate" ).val( this.firstDate ); 170 $( "#endDate" ).val( this.lastDate ); 171 this.beginDate = this.calendarConverter.parse( $( "#beginDate" ).val() ).getTime(); 172 this.endDate = this.calendarConverter.parse( $( "#endDate" ).val() ).getTime(); 184 173 } 185 174 -
ether_iasi/trunk/web/resources/css/button.css
r710 r732 32 32 33 33 button[type] { 34 34 /* padding: 5px 10px 5px 7px; Firefox */ 35 35 padding: 2px 10px 5px 7px; /* Firefox */ 36 36 line-height: 17px; /* Safari */ … … 54 54 55 55 /* STANDARD */ 56 button:hover {56 button:hover, button.get:hover { 57 57 background-color: #dff4ff; 58 58 border: 1px solid #c2e1ef; 59 59 color: #336699; 60 } 61 62 /* GET */ 63 button.get { 64 background-color: #dff4ff; 65 border: 1px solid #3167AD; 66 color: #0066FF; 60 67 } 61 68 … … 149 156 /* RED BUTTON */ 150 157 button.red_button { 151 158 /* background-color: #581700;*/ 152 159 background-color: #003D6C; 153 160 height: 39px; -
ether_iasi/trunk/web/resources/css/ether.css
r717 r732 8 8 font-size: 13px; 9 9 line-height: 1.7em; /*color: #333333;*/ 10 color: #04155D; 10 /*color: #04155D;*/ 11 color: #595959; 11 12 font-family: Trebuchet MS, Arial, san-serif; 12 13 } … … 73 74 position: absolute; 74 75 top: -13px; 76 } 77 78 .mainTitle { 79 color: #0066FF; 80 font-family: Arial, Helvetica, sans-serif; 81 font-size: 16pt; 82 font-weight: bold; 83 } 84 85 .subTitle { 86 color: #3167AD; 87 font-family: Arial, Helvetica, sans-serif; 88 font-size: 11pt; 89 font-weight: bold; 90 margin-left: 12px; 75 91 } 76 92 -
ether_iasi/trunk/web/resources/css/iasi.css
r729 r732 65 65 66 66 .containerAccess { 67 margin : 0 0 10px 0;67 margin-top: 30px; 68 68 float: left; 69 69 width: 980px; … … 106 106 -moz-border-radius: 4px; 107 107 -webkit-border-radius: 4px; 108 border: solid 1px # 3E647E;109 color: # 3E647E;108 border: solid 1px #AAAAAA; 109 color: #AAAAAA; 110 110 font-size: 11px; 111 } 112 113 #buttonDataAccess { 114 float: right; 111 115 } 112 116 … … 115 119 /** ***************************************************** **/ 116 120 .tab_class { 117 background: none repeat scroll 0 0 gray;121 background: none repeat scroll 0 0 #AAAAAA; 118 122 border-radius: 4px 4px 0 0; 119 123 color: white; … … 128 132 .tab_class.activated { 129 133 background: none repeat scroll 0 0 #EDEDED; 130 color: # 04155D;134 color: #3167AD; 131 135 } -
ether_iasi/trunk/web/resources/js/classesForJQuery/Radio.js
r731 r732 6 6 //******************************************************** 7 7 8 var Tab= Class.create( {8 var Radio = Class.create( { 9 9 initialize: function( param ) 10 10 { 11 11 // Init 12 this.numTab = param.numTab ? param.numTab : 1;13 12 this.id = param.id ? param.id : ""; 14 13 this.parent = param.parent ? param.parent : false; 15 14 this.value = param.value ? param.value : ""; 16 this.title = param.title ? param.title : false; 17 this.className = param.className ? param.className : "tab_class"; 15 this.name = param.name ? param.name : ""; 16 this.checked = param.checked ? param.checked : false; 17 this.text = param.text ? param.text : false; 18 this.className = param.className ? param.className : false; 18 19 this.callbackOnClick = param.onClick ? param.onClick : false; 19 this.contextToSave = param.contextToSave ? param.contextToSave : false;20 20 21 21 // Create tab elements 22 22 this.divContainer = $( document.createElement( "div" ) ); 23 23 this.divContainer.addClass( this.className ); 24 if( this.title )25 this.divContainer.attr( {id:this.id, title:this.title, name:this.numTab} );26 else27 this.divContainer.attr( {id:this.id, name:this.numTab} );28 24 29 this.divContainer.html( this.value ); 25 this.radio = $( document.createElement( "input" ) ); 26 this.radio.attr( {type: "radio", id:this.id, name:this.name, value:this.value, checked: this.checked} ); 27 this.divContainer.append( this.radio ); 28 29 var label = $( document.createElement( "label" ) ); 30 label.attr( {for:this.id} ); 31 label.html( this.text ); 32 this.divContainer.append( label ); 30 33 31 34 if( this.parent ) … … 33 36 34 37 // Define button events 35 if( this.contextToSave ) 36 this.divContainer.bind( 'click', [this, this.contextToSave], this.onClickEvent ); 37 else 38 this.divContainer.bind( 'click', this, this.onClickEvent ); 39 40 38 this.divContainer.bind( 'click', this, this.onClickEvent ); 41 39 }, 42 40 … … 47 45 }, 48 46 49 setValue : function( value ) 47 // Actions ******************************************************** 48 check : function() 50 49 { 51 this. value = value;52 this.div Text.html( this.value);50 this.radio.attr( {checked: true} ); 51 this.divContainer.click(); 53 52 }, 54 53 55 setCallbackOnClick : function( value)54 unckeck : function() 56 55 { 57 this.callbackOnClick = value; 58 }, 59 60 // Actions ******************************************************** 61 active : function() 62 { 63 this.divContainer.addClass( "activated" ); 64 }, 65 66 inactive : function() 67 { 68 this.divContainer.removeClass( "activated" ); 69 }, 70 71 remove : function() 72 { 73 this.divContainer.remove(); 74 56 this.radio.attr( {checked: false} ); 75 57 }, 76 58 … … 80 62 var clickedTab = event.data; 81 63 82 //tabs83 $( "." + this.className ).removeClass( "activated" );84 clickedTab.divContainer.addClass( "activated" );85 86 64 if( (undefined == event.detail || 1 == event.detail) && clickedTab.callbackOnClick ) 87 65 clickedTab.callbackOnClick( event ); -
ether_iasi/trunk/web/src/com/ether/Controller.java
r731 r732 74 74 String plotNameA = ""; 75 75 String plotNameB = ""; 76 if (satellite.equals( "metopa" ) || satellite.equals( "metopab" ))76 if( satellite.equals( "metopa" ) || satellite.equals( "metopab" ) ) 77 77 plotNameA = "iasi_" + species + "_" + projection + "_" + fmtDate + "_" + satellite + ".png"; 78 if (satellite.equals( "metopb" ) || satellite.equals( "metopab" ))78 if( satellite.equals( "metopb" ) || satellite.equals( "metopab" ) ) 79 79 plotNameB = "iasi_" + species + "_" + projection + "_" + fmtDate + "_" + satellite + ".png"; 80 80 … … 84 84 return result; 85 85 86 } 87 88 /** 89 * This method returns the data by product level and temporal and spatial values 90 * 91 * @param productLevel 92 * @param dateBegin 93 * @param dateEnd 94 * @return 95 * @throws WebException 96 */ 97 @ControllerMethod(jsonResult = true) 98 public JSONObject getDataByValues( @Mandatory @ParamName("productLevel") final String productLevel, 99 @Mandatory @ParamName("dateBegin") final String dateBegin, 100 @Mandatory @ParamName("dateEnd") final String dateEnd ) 101 throws WebException 102 { 103 final Calendar calendar = Calendar.getInstance(); 104 calendar.setTimeInMillis( Long.valueOf( dateBegin ) ); 105 final String formatedDateBegin = DateHelper.formatDate( calendar.getTime(), DateHelper.FRENCH_DATE_PATTERN ); 106 calendar.setTimeInMillis( Long.valueOf( dateEnd ) ); 107 final String formatedDateEnd = DateHelper.formatDate( calendar.getTime(), DateHelper.FRENCH_DATE_PATTERN ); 108 109 final JSONObject result = new JSONObject(); 110 result.put( "resultTest", productLevel + "_" + formatedDateBegin + "_" + formatedDateEnd ); 111 return result; 86 112 } 87 113
Note: See TracChangeset
for help on using the changeset viewer.