Changeset 130
- Timestamp:
- 08/18/11 12:39:22 (13 years ago)
- Location:
- ether_megapoli/trunk
- Files:
-
- 3 added
- 1 deleted
- 20 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
ether_megapoli/trunk/common/implementation/com/ether/EtherException.java
r129 r130 5 5 * @date 02 feb 2011 6 6 */ 7 public class WebException7 public class EtherException 8 8 extends FormattedException 9 9 { 10 public WebException( final Enum<? extends Code> code )10 public EtherException( final Enum<? extends Code> code ) 11 11 { 12 12 super( code ); 13 13 } 14 14 15 public WebException( final Enum<? extends Code> code, final Throwable cause, final Object... parameters )15 public EtherException( final Enum<? extends Code> code, final Throwable cause, final Object... parameters ) 16 16 { 17 17 this( code, cause.getMessage(), cause, parameters ); 18 18 } 19 19 20 protected WebException( final Enum<? extends Code> code, final String message, final Throwable cause, final Object... parameters )20 protected EtherException( final Enum<? extends Code> code, final String message, final Throwable cause, final Object... parameters ) 21 21 { 22 22 super( prefix( code, message ), cause, parameters ); 23 23 } 24 24 25 public WebException( final Throwable cause )25 public EtherException( final Throwable cause ) 26 26 { 27 27 super( cause ); 28 28 } 29 29 30 public WebException( final Enum<? extends Code> code, final String string )30 public EtherException( final Enum<? extends Code> code, final String string ) 31 31 { 32 32 super( code, string ); 33 33 } 34 34 35 public static enum WebCode35 public static enum EtherCode 36 36 implements Code 37 37 { 38 UNKNOWN,39 PERSISTENCE,40 SERVICE_PROBLEM,41 PLATEFORME_ID_NOT_FOUND,42 38 IO_EXCEPTION_ERROR_TO_GET_OUTPUTSTREAM, 43 ERROR_UNSUPPORTED_UTF8_ENCODING,44 ERROR_NO_REQUEST_HANDLING_METHOD,45 ERROR_NUMBER_OF_PARAM_TYPES_NOT_EQUAL_TO_PARAM_ANNOTATIONS,46 FILE_NOT_FOUND;47 39 } 48 40 } -
ether_megapoli/trunk/common/implementation/com/ether/WebHelper.java
r89 r130 4 4 import java.io.PrintWriter; 5 5 import java.security.InvalidParameterException; 6 import java.util.Locale; 7 import java.util.ResourceBundle; 6 8 7 9 import javax.servlet.ServletOutputStream; … … 14 16 import org.jetbrains.annotations.Nullable; 15 17 16 import com.ether. WebException.WebCode;18 import com.ether.EtherException.EtherCode; 17 19 18 20 public final class WebHelper … … 23 25 24 26 @NotNull 25 public static String getRequestParameter( @NotNull final HttpServletRequest httpServletRequest, @Nullable final String parameterName, @Nullable final String defaultParameterValue, final boolean canBeNull )26 27 public static String getRequestParameter( @NotNull final HttpServletRequest httpServletRequest, @Nullable final String parameterName, @Nullable final String defaultParameterValue, final boolean canBeNull ) 28 throws InvalidParameterException 27 29 { 28 29 if(null == parameterName)30 31 30 String parameterValue; 31 if( null == parameterName ) 32 parameterValue = defaultParameterValue; 33 32 34 parameterValue = httpServletRequest.getParameter( parameterName ); 33 35 … … 54 56 } 55 57 56 public static void displayAjaxError(@NotNull final HttpServletResponse response, @Nullable final String methodName) 57 throws WebException 58 { 59 try { 60 response.setStatus(HttpServletResponse.SC_NOT_IMPLEMENTED); 61 response.setCharacterEncoding(UTF8Charset.getEncoding()); 62 response.setContentType("text/plain;charset="+ UTF8Charset.getEncoding()); 63 final ServletOutputStream outputStream = response.getOutputStream(); 64 outputStream.print("error.method_not_implemented : " + methodName+ " is not implemented."); 65 outputStream.flush(); 66 outputStream.close(); 67 } catch (IOException e) { 68 throw new WebException(WebCode.IO_EXCEPTION_ERROR_TO_GET_OUTPUTSTREAM, e); 69 } 58 public static void displayAjaxError( @NotNull final HttpServletResponse response, @Nullable final String methodName ) 59 throws EtherException 60 { 61 try 62 { 63 response.setStatus( HttpServletResponse.SC_NOT_IMPLEMENTED ); 64 response.setCharacterEncoding( UTF8Charset.getEncoding() ); 65 response.setContentType( "text/plain;charset=" + UTF8Charset.getEncoding() ); 66 final ServletOutputStream outputStream = response.getOutputStream(); 67 outputStream.print( "error.method_not_implemented : " + methodName + " is not implemented." ); 68 outputStream.flush(); 69 outputStream.close(); 70 } 71 catch( IOException e ) 72 { 73 throw new EtherException( EtherCode.IO_EXCEPTION_ERROR_TO_GET_OUTPUTSTREAM, e ); 74 } 75 } 76 77 @NotNull 78 public static ResourceBundle getBundle( @Nullable final Locale locale ) 79 { 80 if( null != locale ) 81 return ResourceBundle.getBundle( "ApplicationResources", locale ); 82 else 83 return ResourceBundle.getBundle( "ApplicationResources" ); 70 84 } 71 85 72 86 private static final Log LOGGER = LogFactory.getLog( WebHelper.class ); 73 87 74 88 private static final String CONTENT_TYPE_TEXT_JSON = "text/javascript;charset=" + UTF8Charset.getEncoding(); 75 private static final char JSON_TAG_BEGIN = ' ' 89 private static final char JSON_TAG_BEGIN = ' '; // '('; 76 90 private static final char JSON_TAG_END = ' '; // ')'; 77 91 } -
ether_megapoli/trunk/persistence/implementation/hibernate-domain.cfg.xml
r129 r130 6 6 <hibernate-configuration> 7 7 <session-factory> 8 8 9 <!--<mapping resource="com/medias/objects/Adresse.hbm.xml"/>--> 9 10 <!--<mapping resource="com/medias/objects/Bilan.hbm.xml"/>--> … … 32 33 <!--<mapping resource="com/medias/objects/Valeur.hbm.xml"/>--> 33 34 <!--<mapping resource="com/medias/objects/Zone.hbm.xml"/>--> 35 34 36 </session-factory> 35 37 </hibernate-configuration> -
ether_megapoli/trunk/service/implementation/com/ether/EtherPlotServiceImpl.java
r129 r130 8 8 import org.jetbrains.annotations.NotNull; 9 9 import org.jetbrains.annotations.Nullable; 10 import org.medias.megapoli.utils.MegapoliInitialisation; 10 11 11 12 import javax.swing.*; … … 29 30 * @param locale 30 31 * @return 31 * @throws WebException32 */33 @NotNull34 public BufferedImage createJPane( @NotNull final MegapoliPlot megapoliPlot, @Nullable final Locale locale )35 { 36 JPane jPane = new JPane( "Main jPane", new Dimension( MAIN_WIDTH, MAIN_HEIGHT) );32 */ 33 @NotNull 34 public BufferedImage createMainPane( @NotNull final MegapoliPlot megapoliPlot, @Nullable final Locale locale ) 35 { 36 // JPane jPane = new JPane( "Main jPane", new Dimension( MAIN_WIDTH, MAIN_HEIGHT ) ); 37 JPane jPane = new JPane( "Main jPane", new Dimension( MAIN_WIDTH, 700 ) ); 37 38 if( null != megapoliPlot.getWidth() && null != megapoliPlot.getHeight() ) 38 39 jPane = new JPane( "Main jPane", new Dimension( megapoliPlot.getWidth(), megapoliPlot.getHeight() ) ); … … 43 44 jPane.setOpaque( true ); 44 45 45 final JPane jPaneTop = createTopPane( megapoliPlot ); 46 jPane.add( jPaneTop, BorderLayout.NORTH ); 47 // final JPane jPaneCenter = createCenterPane( megapoliPlot.getData() ); 48 final JPane jPaneCenter = createTopPane( megapoliPlot ); 46 // Top Pane 47 // final JPane jPaneTop = createTopPane( megapoliPlot ); 48 // jPane.add( jPaneTop, BorderLayout.NORTH ); 49 50 // Center Pane 51 final Integer valuesNumber = megapoliPlot.getData().getYArray().length; 52 final JPane jPaneCenter; 53 if( valuesNumber > 0 ) 54 jPaneCenter = createCenterPane( megapoliPlot.getData() ); 55 else 56 jPaneCenter = createEmptyCenterPane( locale ); 49 57 jPane.add( jPaneCenter, BorderLayout.CENTER ); 50 final JPane jPaneBottom = createBottomPane( megapoliPlot.getData().getYArray().length, locale ); 51 jPane.add( jPaneBottom, BorderLayout.SOUTH ); 58 59 // Bottom Pane 60 // final JPane jPaneBottom = createBottomPane( valuesNumber, locale ); 61 // jPane.add( jPaneBottom, BorderLayout.SOUTH ); 52 62 53 63 final JPanelToImageManager jPanelToImageManager = new JPanelToImageManager( jPane ); 54 55 64 return jPanelToImageManager.saveAsImage(); 56 65 } … … 59 68 * Create the top JPane with the logos and title 60 69 * 61 * @param megapoliPlot@return 70 * @param megapoliPlot 71 * @return 62 72 */ 63 73 @NotNull … … 83 93 84 94 // Title 85 final JLabel jLabelTitle = new JLabel( megapoliPlot.getTitle(), JLabel.CENTER ); 86 final Font police = new Font( "Arial", Font.BOLD, FONT_SIZE ); 95 final String formatedTitle = formatTitle( megapoliPlot.getTitle() ); 96 final JLabel jLabelTitle = new JLabel( formatedTitle, JLabel.CENTER ); 97 final Font police = new Font( "Arial", Font.BOLD, TITLE_FONT_SIZE ); 87 98 jLabelTitle.setFont( police ); 88 99 jPaneTop.add( jLabelTitle, BorderLayout.CENTER ); … … 100 111 public JPane createCenterPane( @NotNull final SGTData data ) 101 112 { 102 final JPane jPaneCenter = new JPane( "Center jPane", new Dimension( 0, 1000 ) ); 103 jPaneCenter.setLayout( new BorderLayout() ); 113 // final JPane jPaneCenter = new JPane( "Center jPane", new Dimension( 0, 1000 ) ); 104 114 105 115 // Graph 106 116 final JPlotLayout jPlotLayout = new JPlotLayout( false, true, false, "Trajectory data", null, false ); 107 jPlotLayout.setTitles( " title1", "title2", "title3" );117 jPlotLayout.setTitles( "", "", "" ); 108 118 jPlotLayout.addData( data, data.getTitle() ); 109 // jPlotLayout.setSize( 800, 800);119 // jPlotLayout.setSize( 800, 1 ); 110 120 jPlotLayout.setVisible( true ); 111 121 … … 114 124 115 125 // TODO : remove this change to bufferedImage to insert directly the jPlotLayout !!!! 126 // final BufferedImage bufferedImage = new BufferedImage( jPlotLayout.getWidth(), jPlotLayout.getHeight(), BufferedImage.TYPE_INT_RGB ); 116 127 final BufferedImage bufferedImage = new BufferedImage( jPlotLayout.getWidth(), jPlotLayout.getHeight(), BufferedImage.TYPE_INT_RGB ); 117 128 final Graphics2D graphics2D = bufferedImage.createGraphics(); … … 119 130 120 131 final ImageIcon imageIcon = new ImageIcon( bufferedImage ); 121 final JLabel jLabel = new JLabel( imageIcon );132 final JLabel jLabel = new JLabel( imageIcon, JLabel.CENTER ); 122 133 jLabel.setBorder( BorderFactory.createLineBorder( Color.blue, 2 ) ); 134 135 // final JPane jPaneCenter = new JPane( "Center jPane", new Dimension( jPlotLayout.getWidth(), jPlotLayout.getHeight() ) ); 136 final JPane jPaneCenter = new JPane(); 137 jPaneCenter.setLayout( new BorderLayout() ); 123 138 jPaneCenter.add( jLabel, BorderLayout.CENTER ); 124 139 125 // final JLabel jj = new JLabel("pif");126 // jj.setBorder( BorderFactory.createLineBorder( Color.red, 2 ) );127 // jPaneCenter.add( jj, BorderLayout.CENTER );128 129 140 return jPaneCenter; 130 141 } 131 142 132 143 /** 144 * Create the center JPane with no graph (if no value) 145 * 146 * @param locale 147 * @return 148 */ 149 public JPane createEmptyCenterPane( @Nullable final Locale locale ) 150 { 151 final ResourceBundle bundle = WebHelper.getBundle( locale ); 152 final String messageData = bundle.getString( "plot.noData" ); 153 154 final JPane jPaneCenter = new JPane(); 155 jPaneCenter.setLayout( new BorderLayout() ); 156 157 final JLabel jLabelData = new JLabel( messageData, JLabel.CENTER ); 158 final Font police = new Font( "Arial", Font.BOLD, FONT_SIZE ); 159 jLabelData.setFont( police ); 160 161 jPaneCenter.add( jLabelData, BorderLayout.CENTER ); 162 return jPaneCenter; 163 } 164 165 /** 133 166 * Create the bottom JPane with the text "published .. (date)" 134 167 * … … 140 173 public JPane createBottomPane( @Nullable final Integer dataNumber, @Nullable final Locale locale ) 141 174 { 142 final ResourceBundle bundle = getBundle( locale );175 final ResourceBundle bundle = WebHelper.getBundle( locale ); 143 176 144 177 final JPane jPaneBottom = new JPane(); … … 148 181 final Calendar calendar = Calendar.getInstance(); 149 182 final String messagePublished = bundle.getString( "plot.published" ); 150 final JLabel jLabel = new JLabel( messagePublished + " " + DateHelper.formatDate( calendar.getTime(), DateHelper.ENGLISH_DATE_PATTERN ) + " " ); 183 final JLabel jLabel = new JLabel( messagePublished + ' ' + DateHelper.formatDate( calendar.getTime(), DateHelper.ENGLISH_DATE_PATTERN ) + " " ); 184 final Font police = new Font( "Arial", Font.BOLD, FONT_SIZE ); 185 jLabel.setFont( police ); 151 186 jPaneBottom.add( jLabel, BorderLayout.EAST ); 152 187 … … 154 189 { 155 190 final String messageDataNumber = bundle.getString( "plot.dataNumber" ); 156 final JLabel jLabelDataNumber = new JLabel( messageDataNumber + " " + dataNumber ); 191 final JLabel jLabelDataNumber = new JLabel( messageDataNumber + ' ' + dataNumber ); 192 jLabelDataNumber.setFont( police ); 157 193 jPaneBottom.add( jLabelDataNumber, BorderLayout.WEST ); 158 194 } … … 161 197 } 162 198 163 // TODO : move this function in a more generally class 164 private ResourceBundle getBundle( @Nullable final Locale locale ) 165 { 166 if( null != locale ) 167 return ResourceBundle.getBundle( "ApplicationResources", locale ); 199 /** 200 * Create an error JPane when plot can be created 201 * 202 * @param mainError 203 * @param errorText 204 * @param locale 205 * @return 206 */ 207 @NotNull 208 public BufferedImage createErrorPane( @NotNull final String mainError, @NotNull final String errorText, @Nullable final Locale locale ) 209 { 210 // Image 211 final ImageIcon errorImage = new ImageIcon( MegapoliInitialisation.pathImages + "/erreur.gif" ); 212 final JLabel jLabelErrorImage = new JLabel( errorImage ); 213 214 // Text 215 final ResourceBundle bundle = WebHelper.getBundle( locale ); 216 final String mainMessage = bundle.getString( "plot.errorMessage" ); 217 final JLabel jLabelError = new JLabel( "<html>" + mainMessage + "<br><br>" + mainError + "<br>" + errorText + "</html>", JLabel.CENTER ); 218 final Font police = new Font( "Arial", Font.BOLD, ERROR_FONT_SIZE ); 219 jLabelError.setFont( police ); 220 221 // jPane 222 final JPane jPane = new JPane( "jPane", new Dimension( MAIN_WIDTH, errorImage.getIconHeight() ) ); 223 jPane.setLayout( new BorderLayout() ); 224 jPane.setBackground( Color.white ); 225 jPane.setOpaque( true ); 226 jPane.add( jLabelErrorImage, BorderLayout.WEST ); 227 jPane.add( jLabelError, BorderLayout.CENTER ); 228 229 final JPanelToImageManager jPanelToImageManager = new JPanelToImageManager( jPane ); 230 return jPanelToImageManager.saveAsImage(); 231 } 232 233 @NotNull 234 private String formatTitle( @Nullable final String title ) 235 { 236 if( null == title ) 237 return ""; 168 238 else 169 return ResourceBundle.getBundle( "ApplicationResources" ); 239 { 240 final String formatTitle = title.replaceAll( "\\n", "<br>" ); 241 return "<html>" + formatTitle + "</html>"; 242 } 170 243 } 171 244 … … 180 253 private static final int MAIN_HEIGHT = 800; 181 254 182 private static final int FONT_SIZE = 20; 255 private static final int TITLE_FONT_SIZE = 20; 256 private static final int FONT_SIZE = 12; 257 private static final int ERROR_FONT_SIZE = 10; 183 258 } -
ether_megapoli/trunk/service/implementation/com/ether/JPanelToImageManager.java
r129 r130 10 10 11 11 /** 12 * @Author : E.Mo.. 12 13 * This class convert a JPanel into a BufferedImage 13 14 */ … … 33 34 private BufferedImage paintComponent( @NotNull final Component component ) 34 35 { 36 if( 0 >= component.getWidth() || 0 >= component.getHeight() ) 37 return null; 38 35 39 // Set it to it's preferred size. (optional) 36 40 component.setSize( component.getPreferredSize() ); -
ether_megapoli/trunk/service/implementation/com/ether/MegapoliPlot.java
r129 r130 41 41 } 42 42 43 @N ullable43 @NotNull 44 44 public String getLogoMegapoli() 45 45 { … … 47 47 } 48 48 49 public void setLogoMegapoli( @N ullablefinal String logoMegapoli )49 public void setLogoMegapoli( @NotNull final String logoMegapoli ) 50 50 { 51 51 _logoMegapoli = logoMegapoli; 52 52 } 53 53 54 @N ullable54 @NotNull 55 55 public String getLogoEther() 56 56 { … … 58 58 } 59 59 60 public void setLogoEther( @N ullablefinal String logoEther )60 public void setLogoEther( @NotNull final String logoEther ) 61 61 { 62 62 _logoEther = logoEther; -
ether_megapoli/trunk/service/interface/com/ether/EtherPlotService.java
r129 r130 17 17 { 18 18 @NotNull 19 public BufferedImage create JPane( @NotNull final MegapoliPlot megapoliPlot, @Nullable final Locale locale );19 public BufferedImage createMainPane( @NotNull final MegapoliPlot megapoliPlot, @Nullable final Locale locale ); 20 20 21 21 @NotNull … … 28 28 public JPane createBottomPane( @Nullable final Integer dataNumber, @Nullable final Locale locale ); 29 29 30 @NotNull 31 public BufferedImage createErrorPane( @NotNull final String mainError, @NotNull final String errorText, @Nullable final Locale locale ); 30 32 } -
ether_megapoli/trunk/service/test/com/ether/SGTTest.java
r129 r130 23 23 import javax.imageio.ImageIO; 24 24 import javax.servlet.ServletException; 25 import javax.servlet.http.HttpServletRequest;26 25 import javax.servlet.http.HttpServletResponse; 27 26 import javax.swing.*; 28 27 import java.awt.*; 29 28 import java.awt.image.BufferedImage; 30 import java.awt.image.RenderedImage;31 29 import java.io.File; 32 30 import java.io.FileInputStream; … … 482 480 } 483 481 484 485 486 482 @ControllerMethod(jsonResult = true) 487 483 public JSONObject searchDatasByPlateformByParameterByPeriod( … … 490 486 @ParamName(ParameterConstants.PARAMETER_DATE_BEGIN) final String dateBegin, 491 487 @ParamName(ParameterConstants.PARAMETER_DATE_END) final String dateEnd ) 492 throws ServiceException, WebException, ParseException488 throws ServiceException, EtherException, ParseException 493 489 { 494 490 // final String pofBegin = "2009-07-13 13:00"; … … 612 608 // @ParamName(ParameterConstants.PARAMETER_DATE_BEGIN) final String dateBegin, 613 609 // @ParamName(ParameterConstants.PARAMETER_DATE_END) final String dateEnd) 614 // throws ServiceException, WebException, ParseException610 // throws ServiceException, EtherException, ParseException 615 611 // { 616 612 // final long time1 = Calendar.getInstance().getTimeInMillis(); -
ether_megapoli/trunk/web/resources/css/button.css
r89 r130 5 5 /* BUTTONS */ 6 6 7 .buttons a, .buttonsbutton {7 button { 8 8 display:block; 9 9 float:left; … … 21 21 color:#565656; 22 22 cursor:pointer; 23 padding:5px 10px 6px 7px; /* Links */ 24 } 25 .buttons button{ 23 26 24 width:auto; 27 25 overflow:visible; 28 26 padding:4px 6px 3px 6px; /* IE6 */ 29 27 } 30 .buttons button[type]{ 28 29 button[type]{ 31 30 padding:5px 10px 5px 7px; /* Firefox */ 32 31 line-height:17px; /* Safari */ 33 32 } 33 34 34 *:first-child+html button[type]{ 35 35 padding:4px 10px 3px 7px; /* IE7 */ 36 36 } 37 .buttons button img, .buttons a img{ 37 38 .small{ 39 font-size:80%; 40 } 41 42 button img{ 38 43 margin:0 3px -3px 0 !important; 39 44 padding:0; … … 45 50 46 51 /* STANDARD */ 47 48 button:hover, .buttons a:hover{ 52 button:hover{ 49 53 background-color:#dff4ff; 50 54 border:1px solid #c2e1ef; 51 55 color:#336699; 52 56 } 53 .buttons a:active{54 background-color:#6299c5;55 border:1px solid #6299c5;56 color:#fff;57 }58 57 59 58 /* POSITIVE */ 60 61 button.positive, .buttons a.positive{ 59 button.positive{ 62 60 color:#529214; 63 61 } 64 .buttons a.positive:hover,button.positive:hover{62 button.positive:hover{ 65 63 background-color:#E6EFC2; 66 64 border:1px solid #C6D880; 67 65 color:#529214; 68 66 } 69 .buttons a.positive:active{70 background-color:#529214;71 border:1px solid #529214;72 color:#fff;73 }74 67 75 68 /* NEGATIVE */ 76 77 .buttons a.negative, button.negative{ 69 button.negative{ 78 70 color:#d12f19; 79 71 } 80 .buttons a.negative:hover,button.negative:hover{72 button.negative:hover{ 81 73 background:#fbe3e4; 82 74 border:1px solid #fbc2c4; 83 75 color:#d12f19; 84 76 } 85 .buttons a.negative:active{86 background-color:#d12f19;87 border:1px solid #d12f19;88 color:#fff;89 }90 77 91 78 /* DISABLE */ 92 93 .buttons a.disable, .buttons a.disable:hover, .buttons button.disable, .buttons button.disable:hover 94 { 79 button.disable, button.disable:hover{ 95 80 background-color:#CCCCCC; 96 81 border:1px solid #dedede; 97 82 color:#565656; 98 83 } 99 -
ether_megapoli/trunk/web/resources/css/visu_parameter_by_pf.css
r129 r130 1 1 /* ****************** CONTAINERS ************************* */ 2 #containerPlateforms, #containerParameters, #containerCalendar 3 { 4 margin-top: 10px; 2 #containerPlateforms, #containerParameters, #containerCalendar { 3 margin-top: 10px; 5 4 } 6 5 7 .containerPlateform, .containerParameter 8 { 9 color: #6178BC; 6 .containerPlateform, .containerParameter { 7 color: #6178BC; 10 8 } 11 9 12 .containerPlateform:hover, .containerParameter:hover 13 { 14 text-decoration: underline; 15 background: #70739C; 16 color: #FFFFFF; 10 .containerPlateform:hover, .containerParameter:hover { 11 text-decoration: none; 12 background: #70739C; 13 color: #FFFFFF; 14 } 15 16 #containerOptionTitle { 17 margin-top: 25px; 18 margin-bottom: 25px; 19 } 20 21 #containerButtons { 22 margin-top: 25px; 17 23 } 18 24 19 25 /* ****************** LOADINGS ************************* */ 20 #loadingForPlateforms, #loadingForParameters 21 { 26 #loadingForPlateforms, #loadingForParameters { 22 27 position: relative; 23 28 top: 102px; … … 25 30 } 26 31 32 .loadingPlot { 33 margin: auto; 34 height: 15px; 35 width: 128px; 36 margin-top: 50px; 37 } 38 27 39 /* ****************** OTHERS ************************* */ 28 #NoPlateform, #NoParameter 29 { 40 #NoPlateform, #NoParameter { 30 41 position: relative; 31 42 top: 100px; 32 43 left: 65px; 33 44 color: #04155D; 34 45 } 35 46 36 47 .plateform_selected, .plateform_selected:hover, 37 .parameter_selected, .parameter_selected:hover 38 { 39 background: #70739C; 40 color: #E1DEF1; 41 text-decoration: none; 48 .parameter_selected, .parameter_selected:hover { 49 background: #70739C; 50 color: #E1DEF1; 51 text-decoration: none; 42 52 } 43 53 44 .errorAndButtons {45 # margin: 0px 22px; 46 54 .errorAndButtons { 55 /*margin: 0px 22px;*/ 56 margin-left: auto; 47 57 margin-right: auto; 48 58 max-width: 240px; … … 50 60 51 61 #copyright { 52 margin-left:-80em;62 margin-left: -80em; 53 63 } 64 65 .messagesHeight { 66 margin-bottom: 5px; 67 } 68 54 69 /** ************************************ **/ 55 70 /** ************ CALENDAR ************** **/ 56 71 /** ************************************ **/ 57 .embeddedCalendar 58 { 59 margin-top: 10px; 60 margin-bottom: 10px; 61 max-width: 240px; 72 /*.embeddedCalendar*/ 73 /*{*/ 74 /*margin-top: 10px;*/ 75 /*margin-bottom: 10px;*/ 76 /*max-width: 240px;*/ 77 /*}*/ 78 79 #beginDate, #endDate { 80 background-image: url("../../resources/icons/calendrier-icone-16x16.png"); 81 background-position: right center; 82 background-repeat: no-repeat; 62 83 } 63 84 64 div.leftField{ 65 float: left; 66 margin-left: 53px; 85 div.leftField { 86 float: left; 67 87 } 68 88 69 div.rightField {70 71 89 div.rightField { 90 float: right; 91 margin-right: 53px; 72 92 } 73 93 -
ether_megapoli/trunk/web/resources/js/etherClasses.js
r89 r130 2 2 /* ****************** LIST ************************* */ 3 3 /* ************************************************* */ 4 var ListItem = Class.create( {4 var ListItem = Class.create( { 5 5 6 6 initialize: function( plateforms, objectParameter ) 7 7 { 8 8 this.array = $A(); 9 $A( plateforms).each(function( jsonObject )9 $A( plateforms ).each( function( jsonObject ) 10 10 { 11 this.addItem( jsonObject, objectParameter);12 }.bind( this));11 this.addItem( jsonObject, objectParameter ); 12 }.bind( this ) ); 13 13 }, 14 14 … … 19 19 var objectItemNew = new Object(); 20 20 objectItemNew.jsonElement = jsonElement; 21 objectItemNew.divItem = this.createItemDiv( objectItemNew.jsonElement, objectParameter);21 objectItemNew.divItem = this.createItemDiv( objectItemNew.jsonElement, objectParameter ); 22 22 23 this.array.push( objectItemNew);23 this.array.push( objectItemNew ); 24 24 }, 25 25 26 26 createItemDiv: function( itemHash, objectParameter ) 27 27 { 28 return new Plateform( itemHash, objectParameter);28 return new Plateform( itemHash, objectParameter ); 29 29 }, 30 30 31 31 addOpenListener : function( func ) 32 32 { 33 this.array.each( function( objectItem )33 this.array.each( function( objectItem ) 34 34 { 35 objectItem.divItem.addOpenListener( func);36 } );35 objectItem.divItem.addOpenListener( func ); 36 } ); 37 37 }, 38 38 … … 41 41 if( 0 >= this.array.size() ) 42 42 { 43 var divNoItem = $( document.createElement("div"));43 var divNoItem = $( document.createElement( "div" ) ); 44 44 divNoItem.id = idIfNoItem; 45 45 divNoItem.textContent = textIfNoItem; 46 parentNode.appendChild( divNoItem);46 parentNode.appendChild( divNoItem ); 47 47 } 48 48 else 49 this.array.each( function( item )49 this.array.each( function( item ) 50 50 { 51 item.divItem.display( parentNode);52 } );51 item.divItem.display( parentNode ); 52 } ); 53 53 }, 54 54 55 55 displayWithPairImpair : function( parentNode, idIfNoItem, textIfNoItem ) 56 56 { 57 Dom.clearContainer(parentNode);57 Dom.clearContainer( parentNode ); 58 58 if( 0 >= this.array.size() ) 59 59 { 60 var divNoItem = $( document.createElement("div"));60 var divNoItem = $( document.createElement( "div" ) ); 61 61 divNoItem.id = idIfNoItem; 62 62 divNoItem.textContent = textIfNoItem; 63 parentNode.appendChild( divNoItem);63 parentNode.appendChild( divNoItem ); 64 64 } 65 65 else 66 66 { 67 68 this.array.each( function( item )67 var rowNumber = 0; 68 this.array.each( function( item ) 69 69 { 70 if(rowNumber % 2 == 0)71 item.divItem.display( parentNode,"pair");72 73 item.divItem.display( parentNode,"impair");74 75 } );70 if( rowNumber % 2 == 0 ) 71 item.divItem.display( parentNode, "pair" ); 72 else 73 item.divItem.display( parentNode, "impair" ); 74 rowNumber++; 75 } ); 76 76 } 77 77 }, … … 80 80 { 81 81 var returnObj = false; 82 this.array.each( function( objItem )82 this.array.each( function( objItem ) 83 83 { 84 84 if( objItem.jsonElement.id == itemId ) 85 85 returnObj = objItem; 86 }.bind( this));86 }.bind( this ) ); 87 87 88 88 return returnObj; 89 89 } 90 90 91 } );91 } ); 92 92 93 93 /* ************************************************* */ 94 94 /* ****************** ITEM ************************* */ 95 95 /* ************************************************* */ 96 var Item = Class.create( {96 var Item = Class.create( { 97 97 98 98 initialize: function( jsonElement, objectParameter ) 99 99 { 100 this.jsonElement = Object.clone( jsonElement); // Warning: This is only a shallow copy100 this.jsonElement = Object.clone( jsonElement ); // Warning: This is only a shallow copy 101 101 this.listeners = $A(); 102 102 … … 124 124 createContainer: function ( containerName, classNameValue ) 125 125 { 126 this.divContainer = $( document.createElement("div"));126 this.divContainer = $( document.createElement( "div" ) ); 127 127 this.divContainer.item = this; 128 if( classNameValue)129 this.divContainer.className = classNameValue;128 if( classNameValue ) 129 this.divContainer.className = classNameValue; 130 130 this.divContainer.id = containerName + "_" + this.jsonElement.id; 131 131 }, … … 134 134 { 135 135 this.parentNode = parentNode; 136 parentNode.appendChild( this.divContainer);136 parentNode.appendChild( this.divContainer ); 137 137 }, 138 138 … … 146 146 { 147 147 if( classNameValue ) 148 this.divContainer.addClassName( classNameValue);148 this.divContainer.addClassName( classNameValue ); 149 149 }, 150 150 … … 152 152 { 153 153 if( classNameValue ) 154 this.divContainer.removeClassName( classNameValue);154 this.divContainer.removeClassName( classNameValue ); 155 155 }, 156 156 157 157 executeListenersFunction: function() 158 158 { 159 this.listeners.each( function ( func )159 this.listeners.each( function ( func ) 160 160 { 161 func( this);162 }.bind( this));161 func( this ); 162 }.bind( this ) ); 163 163 }, 164 164 … … 166 166 { 167 167 if( this.divContainer ) 168 Event.observe( this.divContainer, 'click', this.onClickContainer.bindAsEventListener(this));168 Event.observe( this.divContainer, 'click', this.onClickContainer.bindAsEventListener( this ) ); 169 169 }, 170 170 171 171 addOpenListener: function( func ) 172 172 { 173 this.listeners.push( func);173 this.listeners.push( func ); 174 174 }, 175 175 … … 179 179 return; 180 180 181 this.divName = $( document.createElement("div"));181 this.divName = $( document.createElement( "div" ) ); 182 182 this.divName.className = classNameValue; 183 183 this.divName.innerHTML = this.jsonElement.name; 184 184 185 this.divContainer.appendChild(this.divName); 185 this.divContainer.appendChild( this.divName ); 186 }, 187 188 getName: function () 189 { 190 return this.jsonElement.name; 186 191 } 187 }); 192 193 } ); -
ether_megapoli/trunk/web/resources/jsp/etherHead.jsp
r89 r130 1 1 <%@ taglib prefix="ether" tagdir="/WEB-INF/tags" %> 2 2 3 <ether:htmlJs jsFile="library/prototype /prototype"/>3 <ether:htmlJs jsFile="library/prototype"/> 4 4 <ether:htmlJs jsFile="Request"/> 5 5 <ether:htmlJs jsFile="DomHelper"/> -
ether_megapoli/trunk/web/resources/templates/template.jsp
r89 r130 18 18 <link rel="shortcut icon" href="<html:rewrite page='/resources/images/megapoli/favicon.ico'/>"> 19 19 <script src="<html:rewrite page='/resources/js/maj.js'/>"></script> 20 <script src="<html:rewrite page='/resources/js/ ajax.js'/>"></script>20 <script src="<html:rewrite page='/resources/js/medias/ajax.js'/>"></script> 21 21 <script type="text/javascript"> 22 22 <!-- -
ether_megapoli/trunk/web/src/ApplicationResources.properties
r129 r130 408 408 data.visualization.noParameter=Pas de param\u00E8tre 409 409 data.visualization.selectParameter=Param\u00E8tres 410 data.visualization.select Time=P\u00E9riode410 data.visualization.selectPeriod=P\u00E9riode 411 411 data.visualization.selectDate=Choisissez une date 412 data.visualization.selectYear=Ann\u00E9e 413 data.visualization.selectMonth=Mois 414 data.visualization.selectDay=Jour 415 data.visualization.selectTime=Choisissez un temps 416 data.visualization.selectHour=Heure 417 data.visualization.selectMinute=Minute 412 418 data.visualization.BeginDate=Date de d\u00E9but : 413 419 data.visualization.EndDate=Date de fin : 414 420 data.visualization.Unvalid_Period=P\u00E9riode non valide ! 421 data.visualization.titleChoice=Title 422 data.visualization.axe=Axes 423 data.visualization.button.clear=Effacer 415 424 data.visualization.button.visualize=Visualisation 416 425 data.visualization.button.download=T\u00E9l\u00E9chargement … … 419 428 data.visualization.quicklook=Quicklook 420 429 430 data.visualization.axeType.Time=S\u00E9rie temporelle 431 data.visualization.axeType.Latitude=Latitude / Longitude 432 421 433 simulation.visualization=Visualisation des simulations 422 434 … … 424 436 plot.published=Publi\u00E9 le 425 437 plot.dataNumber=Nombre de donn\u00E9es extraites : 438 plot.errorMessage=Erreur de cr\u00E9ation du quicklook. <BR>Veuillez essayer de corriger les erreurs suivantes ou contacter l'administrateur en indiquant les erreurs rencontr\u00E9es. 439 plot.noData=Aucune donn\u00E9e extraite -
ether_megapoli/trunk/web/src/ApplicationResources_en.properties
r129 r130 395 395 data.visualization.noParameter=No parameter 396 396 data.visualization.selectParameter=Parameters 397 data.visualization.select Time=Period397 data.visualization.selectPeriod=Period 398 398 data.visualization.selectDate=Select a date 399 data.visualization.BeginDate=Start date : 399 data.visualization.selectYear=Year 400 data.visualization.selectMonth=Month 401 data.visualization.selectDay=Day 402 data.visualization.selectTime=Select a time 403 data.visualization.selectHour=Hour 404 data.visualization.selectMinute=Minute 405 data.visualization.BeginDate=Start date : 400 406 data.visualization.EndDate=End date : 401 data.visualization.Unvalid_Period=Unvalid periode ! 407 data.visualization.Unvalid_Period=Unvalid periode ! 408 data.visualization.titleChoice=Titre 409 data.visualization.axe=Axes 410 data.visualization.button.clear=Clear 402 411 data.visualization.button.visualize=Visualization 403 412 data.visualization.button.download=Download … … 406 415 data.visualization.quicklook=Quicklook 407 416 417 data.visualization.axeType.Time=Time serie 418 data.visualization.axeType.Latitude=Latitude / Longitude 419 408 420 simulation.visualization=Simulations visualization 409 421 … … 411 423 plot.published=Published 412 424 plot.dataNumber=Number of extracted datas : 425 plot.errorMessage=Error creating the quicklook. <BR>Please try to correct the following errors or contact the administrator with the detected errors. 426 plot.noData=No extracted data -
ether_megapoli/trunk/web/src/com/ether/Controller.java
r129 r130 15 15 import javax.servlet.http.HttpServletRequest; 16 16 import javax.servlet.http.HttpServletResponse; 17 import java.util.ArrayList; 17 18 import java.util.HashMap; 18 19 import java.util.List; … … 28 29 /** *********************************************************** **/ 29 30 /** *********************** VIEWS ***************************** **/ 30 /** *********************************************************** **/ 31 /** 32 * ********************************************************** * 33 */ 31 34 // Default view if methodName is unknown 32 35 public ModelAndView home( final HttpServletRequest request, final HttpServletResponse response ) 33 throws WebException36 throws EtherException 34 37 { 35 38 return new ModelAndView( "index" ); … … 48 51 { 49 52 final List<Plateforme> plateforms = _etherService.getAllPlateforms(); 53 // final List<Plateforme> plateforms = new ArrayList<Plateforme>(); 54 // final Plateforme pf = new Plateforme(); 55 // pf.setPlateformeId( 1 ); 56 // pf.setPlateformeNom( "LHVP" ); 57 // plateforms.add( pf ); 58 // final Plateforme pf2 = new Plateforme(); 59 // pf2.setPlateformeId( 2 ); 60 // pf2.setPlateformeNom( "SIRTA" ); 61 // plateforms.add( pf2 ); 50 62 51 63 final Map<String, Object> model = new HashMap<String, Object>(); 52 64 model.put( "plateforms", getJsonHelper().toJSON( plateforms ) ); 65 model.put( "axeTypes", getJSONAxeTypes() ); 53 66 return model; 54 67 } … … 56 69 /** *********************************************************** **/ 57 70 /** *********************** CALLS ***************************** **/ 58 /** ********************************************************** **/ 71 /** 72 * ********************************************************* * 73 */ 59 74 @ControllerMethod(jsonResult = true) 60 75 public JSONObject searchParametersByPlateform( @Mandatory @ParamName(ParameterConstants.PARAMETER_ID) final Integer plateformId ) 61 throws ServiceException, WebException76 throws ServiceException, EtherException 62 77 { 63 78 final List<Parametre> parametersByPlateform = _etherService.getParametersByPlateformId( plateformId ); 79 // final List<Parametre> parametersByPlateform = new ArrayList<Parametre>( 2 ); 80 // final Parametre p1 = new Parametre(); 81 // p1.setParametreId( 1 ); 82 // p1.setParametreNom( "JNO2" ); 83 // parametersByPlateform.add( p1 ); 84 // final Parametre p2 = new Parametre(); 85 // p2.setParametreId( 2 ); 86 // p2.setParametreNom( "CO2" ); 87 // parametersByPlateform.add( p2 ); 64 88 65 89 final JSONObject result = new JSONObject(); 66 90 result.put( ParameterConstants.PARAMETER_PARAMETERS, getJsonHelper().toJSON( parametersByPlateform ) ); 67 91 return result; 92 } 93 94 @ControllerMethod(jsonResult = true) 95 private List<JSONObject> getJSONAxeTypes() 96 { 97 final AxeType[] axeTypes = AxeType.values(); 98 99 final List<JSONObject> jsonAxeTypes = new ArrayList<JSONObject>( axeTypes.length ); 100 101 for( final AxeType axeType : axeTypes ) 102 { 103 final JSONObject jsonAxeType = new JSONObject(); 104 jsonAxeType.put( "text", axeType.name() ); 105 jsonAxeType.put( "value", axeType.name() ); 106 jsonAxeTypes.add( jsonAxeType ); 107 } 108 return jsonAxeTypes; 68 109 } 69 110 -
ether_megapoli/trunk/web/src/com/ether/ControllerEther.java
r89 r130 1 1 package com.ether; 2 2 3 import com.ether.annotation.ControllerMethod; 4 import com.ether.annotation.Mandatory; 5 import com.ether.annotation.ParamName; 6 import com.ether.annotation.UseJSON; 7 import net.sf.json.JSON; 8 import net.sf.json.JSONArray; 9 import net.sf.json.JSONNull; 10 import net.sf.json.JSONObject; 11 import net.sf.json.util.JSONUtils; 12 import org.apache.commons.logging.Log; 13 import org.apache.commons.logging.LogFactory; 14 import org.jetbrains.annotations.NotNull; 15 import org.jetbrains.annotations.Nullable; 16 import org.springframework.beans.factory.annotation.Required; 17 import org.springframework.web.servlet.ModelAndView; 18 import org.springframework.web.servlet.mvc.AbstractController; 19 import org.springframework.web.servlet.mvc.multiaction.MethodNameResolver; 20 import org.springframework.web.servlet.mvc.multiaction.NoSuchRequestHandlingMethodException; 21 22 import javax.servlet.http.HttpServletRequest; 23 import javax.servlet.http.HttpServletResponse; 3 24 import java.io.UnsupportedEncodingException; 4 25 import java.lang.annotation.Annotation; … … 12 33 import java.util.Map; 13 34 14 import javax.servlet.http.HttpServletRequest; 15 import javax.servlet.http.HttpServletResponse; 16 17 import net.sf.json.JSON; 18 import net.sf.json.JSONArray; 19 import net.sf.json.JSONNull; 20 import net.sf.json.JSONObject; 21 import net.sf.json.util.JSONUtils; 22 23 import org.apache.commons.logging.Log; 24 import org.apache.commons.logging.LogFactory; 25 import org.jetbrains.annotations.NotNull; 26 import org.jetbrains.annotations.Nullable; 27 import org.springframework.beans.factory.annotation.Required; 28 import org.springframework.web.servlet.ModelAndView; 29 import org.springframework.web.servlet.mvc.AbstractController; 30 import org.springframework.web.servlet.mvc.multiaction.MethodNameResolver; 31 import org.springframework.web.servlet.mvc.multiaction.NoSuchRequestHandlingMethodException; 32 33 import com.ether.annotation.ControllerMethod; 34 import com.ether.annotation.Mandatory; 35 import com.ether.annotation.ParamName; 36 import com.ether.annotation.UseJSON; 37 38 public class ControllerEther extends AbstractController 35 public class ControllerEther 36 extends AbstractController 39 37 { 40 @Override 41 @Nullable 42 protected ModelAndView handleRequestInternal(@NotNull final HttpServletRequest request, @NotNull final HttpServletResponse response) 43 throws WebException 44 { 45 try { 46 if (!_initialized) 47 initialize(); 48 49 request.setCharacterEncoding(UTF8Charset.getEncoding()); 50 51 // Get method to call 52 final String methodName = _methodNameResolver.getHandlerMethodName(request); 53 54 final MethodDescription methodDescription = _methods.get(methodName); 55 if (null == methodDescription) { 56 WebHelper.displayAjaxError(response, methodName); 57 if (LOGGER.isWarnEnabled()) 58 LOGGER.warn(String.format("Controller=%1$s Method=%2$s METHOD NOT FOUND", getClass().getSimpleName(), methodName)); 59 return null; 60 } 61 62 return invokeMethod(methodDescription, request, response); 63 64 } catch (UnsupportedEncodingException e) { 65 throw new WebException(WebException.WebCode.ERROR_UNSUPPORTED_UTF8_ENCODING, e); 66 } catch (NoSuchRequestHandlingMethodException e) { 67 throw new WebException(WebException.WebCode.ERROR_NO_REQUEST_HANDLING_METHOD, e); 68 } 69 } 70 71 @Nullable 72 private ModelAndView invokeMethod( @NotNull final MethodDescription methodDescription, @NotNull final HttpServletRequest request, @NotNull final HttpServletResponse response) 73 throws WebException 74 { 75 try { 76 // Parse parameters 77 final Object[] params = buildParams(methodDescription, request); 78 79 // Invoke method (go to controller) 80 final Object result = methodDescription.getMethod().invoke(this, params); 81 82 // Return result 83 if (!methodDescription.getView().isEmpty()) { 84 response.setStatus(HttpServletResponse.SC_OK); 85 if (result instanceof Map) 86 return new ModelAndView(methodDescription.getView(), (Map) result); 87 else 88 return new ModelAndView(methodDescription.getView(), "result", result); 89 90 } else if (methodDescription.isJsonResult()) { 91 response.setStatus(HttpServletResponse.SC_OK); 92 final String jsonResult = convertToJson(result); 93 WebHelper.writeJsonToResponse(response, jsonResult); 94 return null; 95 } else { 96 response.setStatus(HttpServletResponse.SC_NO_CONTENT); 97 return null; 98 } 99 100 } catch (Throwable e) { 101 throw new WebException(e); 102 } 103 } 104 105 @NotNull 106 private String convertToJson( @Nullable final Object object ) 107 { 108 if( null == object) 38 @Override 39 @Nullable 40 protected ModelAndView handleRequestInternal( @NotNull final HttpServletRequest request, @NotNull final HttpServletResponse response ) 41 throws WebException, EtherException 42 { 43 try 44 { 45 if( !_initialized ) 46 initialize(); 47 48 request.setCharacterEncoding( UTF8Charset.getEncoding() ); 49 50 // Get method to call 51 final String methodName = _methodNameResolver.getHandlerMethodName( request ); 52 53 final MethodDescription methodDescription = _methods.get( methodName ); 54 if( null == methodDescription ) 55 { 56 WebHelper.displayAjaxError( response, methodName ); 57 if( LOGGER.isWarnEnabled() ) 58 LOGGER.warn( String.format( "Controller=%1$s Method=%2$s METHOD NOT FOUND", getClass().getSimpleName(), methodName ) ); 59 return null; 60 } 61 62 return invokeMethod( methodDescription, request, response ); 63 64 } 65 catch( UnsupportedEncodingException e ) 66 { 67 throw new WebException( WebException.WebCode.ERROR_UNSUPPORTED_UTF8_ENCODING, e ); 68 } 69 catch( NoSuchRequestHandlingMethodException e ) 70 { 71 throw new WebException( WebException.WebCode.ERROR_NO_REQUEST_HANDLING_METHOD, e ); 72 } 73 } 74 75 @Nullable 76 private ModelAndView invokeMethod( @NotNull final MethodDescription methodDescription, @NotNull final HttpServletRequest request, @NotNull final HttpServletResponse response ) 77 throws WebException 78 { 79 try 80 { 81 // Parse parameters 82 final Object[] params = buildParams( methodDescription, request ); 83 84 // Invoke method (go to controller) 85 final Object result = methodDescription.getMethod().invoke( this, params ); 86 87 // Return result 88 if( !methodDescription.getView().isEmpty() ) 89 { 90 response.setStatus( HttpServletResponse.SC_OK ); 91 if( result instanceof Map ) 92 return new ModelAndView( methodDescription.getView(), (Map) result ); 93 else 94 return new ModelAndView( methodDescription.getView(), "result", result ); 95 96 } 97 else if( methodDescription.isJsonResult() ) 98 { 99 response.setStatus( HttpServletResponse.SC_OK ); 100 final String jsonResult = convertToJson( result ); 101 WebHelper.writeJsonToResponse( response, jsonResult ); 102 return null; 103 } 104 else 105 { 106 response.setStatus( HttpServletResponse.SC_NO_CONTENT ); 107 return null; 108 } 109 110 } 111 catch( Throwable e ) 112 { 113 throw new WebException( e ); 114 } 115 } 116 117 @NotNull 118 private String convertToJson( @Nullable final Object object ) 119 { 120 if( null == object ) 109 121 return JSONNull.getInstance().toString(); 110 122 if( object instanceof JSON ) … … 119 131 } 120 132 121 @NotNull 122 private Object[] buildParams(@NotNull final MethodDescription methodDescription, @NotNull final HttpServletRequest request) 123 throws InvalidParameterException 124 { 125 final List<Object> params = new ArrayList<Object>(); 126 for (final ParamDescription paramDescription : methodDescription.getParams()) { 127 if (null == paramDescription) { 128 params.add(null); 129 continue; 130 } 131 final boolean canBeNull = !paramDescription.isPrimitive() && !paramDescription.isMandatory(); 132 final String paramValue = WebHelper.getRequestParameter(request, paramDescription.getName(), null, canBeNull); 133 final boolean useJSON = paramDescription.isUsingJSON(); 134 params.add(convertParameter(paramDescription.getType(), paramValue, useJSON)); 135 } 136 return params.toArray(new Object[params.size()]); 137 } 138 139 @Nullable 140 private Object convertParameter( @NotNull final Class paramType, @Nullable final String paramValue, final boolean useJSON ) 133 @NotNull 134 private Object[] buildParams( @NotNull final MethodDescription methodDescription, @NotNull final HttpServletRequest request ) 135 throws InvalidParameterException 136 { 137 final List<Object> params = new ArrayList<Object>(); 138 for( final ParamDescription paramDescription : methodDescription.getParams() ) 139 { 140 if( null == paramDescription ) 141 { 142 params.add( null ); 143 continue; 144 } 145 final boolean canBeNull = !paramDescription.isPrimitive() && !paramDescription.isMandatory(); 146 final String paramValue = WebHelper.getRequestParameter( request, paramDescription.getName(), null, canBeNull ); 147 final boolean useJSON = paramDescription.isUsingJSON(); 148 params.add( convertParameter( paramDescription.getType(), paramValue, useJSON ) ); 149 } 150 return params.toArray( new Object[params.size()] ); 151 } 152 153 @Nullable 154 private Object convertParameter( @NotNull final Class paramType, @Nullable final String paramValue, final boolean useJSON ) 141 155 { 142 156 if( null == paramValue ) … … 148 162 if( JSONArray.class.equals( paramType ) ) 149 163 return _jsonHelper.toJSON( paramValue ); 150 if( String.class 164 if( String.class.equals( paramType ) ) 151 165 return paramValue; 152 166 if( Boolean.TYPE.equals( paramType ) || Boolean.class.equals( paramType ) ) … … 170 184 } 171 185 172 private void initialize() 173 186 private void initialize() 187 throws WebException 174 188 { 175 189 for( final Method method : getClass().getMethods() ) … … 178 192 if( null != annotation ) 179 193 { 180 181 182 194 final MethodDescription methodDescription = new MethodDescription( method, annotation ); 195 fillMethodDescription( method, methodDescription ); 196 _methods.put( method.getName(), methodDescription ); 183 197 } 184 198 } … … 187 201 } 188 202 189 private void fillMethodDescription( @NotNull final Method method, @NotNull final MethodDescription methodDescription ) 190 203 private void fillMethodDescription( @NotNull final Method method, @NotNull final MethodDescription methodDescription ) 204 throws WebException 191 205 { 192 206 final Class<?>[] paramTypes = method.getParameterTypes(); 193 207 final Annotation[][] paramAnnotations = method.getParameterAnnotations(); 194 208 195 if( paramTypes.length != paramAnnotations.length)196 throw new WebException(WebException.WebCode.ERROR_NUMBER_OF_PARAM_TYPES_NOT_EQUAL_TO_PARAM_ANNOTATIONS, paramTypes.length+" "+paramAnnotations.length);197 209 if( paramTypes.length != paramAnnotations.length ) 210 throw new WebException( WebException.WebCode.ERROR_NUMBER_OF_PARAM_TYPES_NOT_EQUAL_TO_PARAM_ANNOTATIONS, paramTypes.length + " " + paramAnnotations.length ); 211 198 212 for( int i = 0; i < paramTypes.length; ++i ) 199 213 { … … 219 233 } 220 234 } 221 } 222 223 235 } 236 237 224 238 @Required 225 239 public void setMethodNameResolver( final MethodNameResolver methodNameResolver ) … … 236 250 public void setJsonHelper( final JSONHelper jsonHelper ) 237 251 { 238 252 _jsonHelper = jsonHelper; 239 253 } 240 254 … … 245 259 246 260 private static final Log LOGGER = LogFactory.getLog( ControllerEther.class ); 247 261 248 262 private JSONHelper _jsonHelper; 249 263 private MethodNameResolver _methodNameResolver; -
ether_megapoli/trunk/web/src/com/ether/ControllerPlot.java
r129 r130 8 8 import org.apache.commons.logging.LogFactory; 9 9 import org.jetbrains.annotations.NotNull; 10 import org.jetbrains.annotations.Nullable; 10 11 import org.springframework.context.ApplicationContext; 11 12 import org.springframework.web.context.support.WebApplicationContextUtils; … … 19 20 import java.awt.image.BufferedImage; 20 21 import java.io.IOException; 21 import java.text.ParseException; 22 import java.util.ArrayList; 23 import java.util.Calendar; 22 24 import java.util.Date; 23 25 import java.util.List; … … 57 59 throws ServletException 58 60 { 61 boolean flagException = false; 62 59 63 try 60 64 { 65 //Parameters 61 66 final Integer plateformId = Integer.valueOf( request.getParameter( "plateformId" ) ); 62 67 final Integer parameterId = Integer.valueOf( request.getParameter( "parameterId" ) ); 68 final String title = request.getParameter( "title" ); 69 final String axeType = request.getParameter( "axeType" ); 70 63 71 final String dateBegin = request.getParameter( "dateBegin" ); 64 72 final String dateEnd = request.getParameter( "dateEnd" ); 65 final String pofBegin = "2009-07-13 13:00"; 66 final String pofEnd = "2009-07-14 14:00"; 67 final Date formatedDateBegin = DateHelper.parseDate( pofBegin, DateHelper.ENGLISH_DATE_PATTERN ); 68 final Date formatedDateEnd = DateHelper.parseDate( pofEnd, DateHelper.ENGLISH_DATE_PATTERN ); 73 final Calendar calendar = Calendar.getInstance(); 74 final Date formatedDateBegin; 75 final Date formatedDateEnd; 76 try 77 { 78 calendar.setTimeInMillis( Long.valueOf( dateBegin ) ); 79 formatedDateBegin = calendar.getTime(); 80 calendar.setTimeInMillis( Long.valueOf( dateEnd ) ); 81 formatedDateEnd = calendar.getTime(); 82 } 83 catch( Exception e ) 84 { 85 createErrorPane( response, request, WebException.WebCode.INVALID_DATE.toString(), e ); 86 flagException = true; 87 throw new ServletException( WebException.WebCode.INVALID_DATE.toString(), e ); 88 } 69 89 90 // Create plot 70 91 //** ******************************************************************** **// 71 92 // TODO : replace List<Data> by List<value> and List<double> 72 93 //** ******************************************************************** **// 73 final List<Pair<Double, Date>> values = _etherService.getValuesByPlateformByParameterByPeriod( plateformId, parameterId, formatedDateBegin, formatedDateEnd ); 94 // final List<Pair<Double, Date>> values = _etherService.getValuesByPlateformByParameterByPeriod( plateformId, parameterId, formatedDateBegin, formatedDateEnd ); 95 final List<Pair<Double, Date>> values = new ArrayList<Pair<Double, Date>>(); 96 final Pair<Double, Date> p1 = new Pair<Double, Date>( Double.valueOf( 23 ), new Date() ); 97 final Pair<Double, Date> p2 = new Pair<Double, Date>( Double.valueOf( 24 ), new Date() ); 98 final Pair<Double, Date> p3 = new Pair<Double, Date>( Double.valueOf( 25 ), new Date() ); 99 final Pair<Double, Date> p4 = new Pair<Double, Date>( Double.valueOf( 26 ), new Date() ); 100 values.add( p1 ); 101 values.add( p2 ); 102 values.add( p3 ); 103 values.add( p4 ); 74 104 final double[] dataArray = extractDoubles( values ); 75 105 final Date[] dateValues = extractDates( values ); … … 88 118 89 119 final MegapoliPlot megapoliPlot = new MegapoliPlot(); 90 megapoliPlot.setTitle( "Mobilis LIDAR");120 megapoliPlot.setTitle( title ); 91 121 megapoliPlot.setData( data ); 92 122 93 final BufferedImage bufferedImage = _etherPlotService.createJPane( megapoliPlot, Context.getLocale( request ) ); 94 123 final BufferedImage bufferedImage = _etherPlotService.createMainPane( megapoliPlot, Context.getLocale( request ) ); 95 124 ImageIO.write( bufferedImage, "png", response.getOutputStream() ); 96 125 } 97 catch( IOException e)126 catch( Exception e1 ) 98 127 { 99 throw new ServletException( "Error : no possibity to write image in response", e ); 128 try 129 { 130 if( !flagException ) 131 createErrorPane( response, request, "", e1 ); 132 } 133 catch( Exception e2 ) 134 { 135 throw new ServletException( "Error : no possibity to write image in response", e2 ); 136 } 100 137 } 101 catch( ServiceException e ) 102 { 103 throw new ServletException( "Error : no possibility to extract data from base", e ); 104 } 105 catch( ParseException e ) 106 { 107 throw new ServletException( "Error : invalid dates, no parsing available", e ); 108 } 138 } 139 140 private void createErrorPane( final HttpServletResponse response, final HttpServletRequest request, @NotNull final String mainError, @NotNull final Exception e ) 141 throws IOException 142 { 143 final BufferedImage errorImage = _etherPlotService.createErrorPane( mainError, e.toString(), Context.getLocale( request ) ); 144 ImageIO.write( errorImage, "png", response.getOutputStream() ); 109 145 } 110 146 … … 137 173 private static final Log LOGGER = LogFactory.getLog( ControllerPlot.class ); 138 174 139 // Dimensions of the jPanes140 private static final int MAIN_WIDTH = 1000;141 private static final int MAIN_HEIGHT = 1000;142 143 175 private EtherService _etherService; 144 176 private EtherPlotService _etherPlotService; -
ether_megapoli/trunk/web/src/com/ether/WebException.java
r89 r130 30 30 public static enum WebCode implements Code 31 31 { 32 UNKNOWN,33 PERSISTENCE,34 SERVICE_PROBLEM,35 PLATEFORME_ID_NOT_FOUND,36 IO_EXCEPTION_ERROR_TO_GET_OUTPUTSTREAM,37 32 ERROR_UNSUPPORTED_UTF8_ENCODING, 38 33 ERROR_NO_REQUEST_HANDLING_METHOD, 39 34 ERROR_NUMBER_OF_PARAM_TYPES_NOT_EQUAL_TO_PARAM_ANNOTATIONS, 35 INVALID_DATE, 40 36 } 41 37 } -
ether_megapoli/trunk/web/visualization/visu_parameter_by_pf-script.jsp
r129 r130 2 2 var InterfaceVisualization = Class.create( { 3 3 4 initialize: function( jsonPlateforms )4 initialize: function( jsonPlateforms, axeTypes ) 5 5 { 6 6 // Values … … 9 9 this.generalContainerPlateforms = $( "generalContainerPlateforms" ); 10 10 this.generalContainerParameters = $( "generalContainerParameters" ); 11 this.generalContainer Calendar = $( "generalContainerCalendar" );11 this.generalContainerOptions = $( "generalContainerOptions" ); 12 12 this.jsonPlateforms = jsonPlateforms || null; 13 this.jsonAxeTypes = axeTypes || null; 13 14 this.selectedPlateform = false; 14 15 this.selectedParameter = false; 15 16 this.beginDate = false; 16 17 this.endDate = false; 17 this.notice = Dom.getContainer( "notice" );18 18 19 19 /** *********** CONTAINERS *********** **/ 20 // Create container for plateforms 21 this.containerPlateforms = Dom.getContainer( "containerPlateforms" ); 22 this.containerParameters = Dom.getContainer( "containerParameters" ); 23 this.containerButtons = Dom.getContainer( "containerButtons" ); 20 this.containerPlateforms = $( "containerPlateforms" ); 21 this.containerParameters = $( "containerParameters" ); 22 this.containerButtons = $( "containerButtons" ); 23 this.containerOptionCalendar = $( "containerOptionCalendar" ); 24 this.containerOptionAxe = $( "containerOptionAxe" ); 24 25 25 26 /** *********** LOADING *********** **/ … … 38 39 this.loadingParameters.display(); 39 40 40 /** *********** BUTTONS *********** **/41 this.visualizeButton = new Button( {value:interfaceTexts["data.visualization.button.visualize"], parent:this.containerButtons, id:"button_visualize", onClick:this.onClickVisualize.bind( this )} );42 this.visualizeButton.enable();43 this.downloadButton = new Button( {value:interfaceTexts["data.visualization.button.download"], parent:this.containerButtons, id:"button_download", onClick:this.onClickDownload.bind( this )} );44 this.downloadButton.disable();45 46 47 41 /** *********** WINDOW FOR THE PLOT *********** **/ 48 42 this.plotWindow = new Window( {className: "dialog", zIndex: 100, … … 51 45 this.plotWindow.setTitle( interfaceTexts["app.title"] + "-" + interfaceTexts["data.visualization.quicklook"] ); 52 46 53 54 this.createCalendar(); 47 this.createOptions(); 55 48 this.displayPlateforms(); 49 }, 50 51 // CREATES ******************************************************** 52 createOptions: function() 53 { 54 // Calendar 55 this.calendarFormat = "%Y-%m-%d %H:%i"; 56 this.calendarConverter = new AnyTime.Converter( { format: this.calendarFormat } ); 57 58 AnyTime.picker( "beginDate", { format: this.calendarFormat, firstDOW: 1, 59 labelTitle: interfaceTexts["data.visualization.selectDate"], labelYear: interfaceTexts["data.visualization.selectYear"], labelMonth: interfaceTexts["data.visualization.selectMonth"], labelDayOfMonth: interfaceTexts["data.visualization.selectDay"], 60 labelHour: interfaceTexts["data.visualization.selectHour"], labelMinute: interfaceTexts["data.visualization.selectMinute"], 61 methodToCall: this.onClickBeginDate.bindAsEventListener( this ) 62 } ); 63 64 AnyTime.picker( "endDate", { format: this.calendarFormat, firstDOW: 1, 65 labelTitle: interfaceTexts["data.visualization.selectDate"], labelYear: interfaceTexts["data.visualization.selectYear"], labelMonth: interfaceTexts["data.visualization.selectMonth"], labelDayOfMonth: interfaceTexts["data.visualization.selectDay"], 66 labelHour: interfaceTexts["data.visualization.selectHour"], labelMinute: interfaceTexts["data.visualization.selectMinute"], 67 idToUpdateEarliest: "beginDate" 68 } ); 69 70 this.clearButton = new Button( {value:interfaceTexts["data.visualization.button.clear"], parent:this.containerOptionCalendar, id:"button_clear", className:"small", onClick:this.onClickClear.bind( this )} ); 71 72 // Buttons and axe's types 73 this.createButtons(); 74 this.createListAxes(); 75 }, 76 77 createButtons: function() 78 { 79 this.visualizeButton = new Button( {value:interfaceTexts["data.visualization.button.visualize"], parent:this.containerButtons, id:"button_visualize", onClick:this.onClickVisualize.bind( this )} ); 80 // this.visualizeButton.disable(); 81 this.downloadButton = new Button( {value:interfaceTexts["data.visualization.button.download"], parent:this.containerButtons, id:"button_download", onClick:this.onClickDownload.bind( this )} ); 82 this.downloadButton.disable(); 83 }, 84 85 createListAxes: function() 86 { 87 var paramSelect = new Object(); 88 paramSelect.id = "select_axes"; 89 paramSelect.parent = $( "containerOptionAxe" ); 90 this.selectAxes = new Select( paramSelect ); 91 92 this.jsonAxeTypes.each( function ( axeType ) 93 { 94 this.selectAxes.add( axeType.value, interfaceTexts[axeType.text] ); 95 }.bind( this ) ); 96 97 this.selectAxes.selectFirst( false ); 56 98 }, 57 99 … … 73 115 }, 74 116 75 handleValuesByPlateformByParameterByPeriod: function( result )76 {77 // this.notice.style.visibility = "hidden";78 79 this.jsonEncodedImage = result.responseText.evalJSON().encodedImage;80 81 82 },83 84 117 // DISPLAYS ******************************************************** 85 createCalendar: function()86 {87 // Embedded Calendar88 this.calendar = Calendar.setup(89 {90 dateField: 'embeddedDateField',91 endDateField: 'embeddedEndDateField',92 parentElement: 'embeddedCalendar',93 clickToDateField: true,94 selectHandler: this.onClickCalendar.bind( this )95 } )96 },97 98 118 displayPlateforms: function() 99 119 { … … 141 161 this.selectedParameter = false; 142 162 163 $( "textareaTitle" ).value = this.selectedPlateform.getName(); 143 164 this.requestParametersByPlateform(); 144 165 this.testAllFields(); … … 156 177 this.selectedParameter = objParameter; 157 178 this.selectedParameter.select(); 179 180 $( "textareaTitle" ).value = this.selectedPlateform.getName() + " - " + this.selectedParameter.getName(); 158 181 this.testAllFields(); 159 182 }, 160 183 161 onClickCalendar: function( calendar ) 162 { 163 if( !calendar.dateField ) return false 164 165 if( calendar.clickToDateField ) 166 { 167 Element.update( calendar.dateField, calendar.date.print( calendar.dateFormat ) ) 168 this.beginDate = calendar.date.print( calendar.dateFormat ); 169 } 170 else 171 { 172 Element.update( calendar.endDateField, calendar.date.print( calendar.dateFormat ) ) 173 this.endDate = calendar.date.print( calendar.dateFormat ); 174 } 175 calendar.setClickToDateField( !calendar.clickToDateField ); 176 this.testCalendarPeriod( calendar.dateField.innerHTML, calendar.endDateField.innerHTML ); 177 178 // Call the close handler, if necessary 179 if( calendar.shouldClose ) calendar.callCloseHandler() 184 onClickBeginDate: function() 185 { 186 var oneHour = 60 * 60 * 1000; 187 var beginDateTime = this.calendarConverter.parse( $( "beginDate" ).value ).getTime(); 188 var endDateTime = null; 189 if( "" != $( "endDate" ).value ) 190 endDateTime = this.calendarConverter.parse( $( "endDate" ).value ).getTime(); 191 this.beginDateWithAnHourLater = new Date( beginDateTime + oneHour ); 192 193 if( null == endDateTime || endDateTime < beginDateTime ) 194 $( "endDate" ).value = this.calendarConverter.format( this.beginDateWithAnHourLater ); 195 196 this.beginDate = this.calendarConverter.parse( $( "beginDate" ).value ).getTime(); 197 this.endDate = this.calendarConverter.parse( $( "endDate" ).value ).getTime(); 198 199 this.testAllFields(); 200 }, 201 202 onClickClear: function() 203 { 204 $( "beginDate" ).value = ""; 205 this.beginDate = false; 206 $( "endDate" ).value = ""; 207 this.endDate = false; 180 208 }, 181 209 182 210 onClickVisualize: function() 183 211 { 212 // this.plotWindow.getContent().innerHTML = '<div class="loadingPlot"><img src="/Megapoli/resources/icons/loading_datas.gif"/></div>'; 213 184 214 // var url = "visualization/plotEther?plateformId=" + this.selectedPlateform.getId() 185 215 // + "¶meterId=" + this.selectedParameter.getId() 186 216 // + "&dateBegin=" + this.beginDate 187 // + "&dateEnd=" + this.endDate; 217 // + "&dateEnd=" + this.endDate 218 // + "&title=" + encodeURIComponent( $( "textareaTitle" ).value ) 219 // + "&axeType=" + this.selectAxes.getValue(); 220 188 221 var url = "visualization/plotEther?plateformId=33" 189 222 + "¶meterId=10" 190 223 + "&dateBegin=" + this.beginDate 191 + "&dateEnd=" + this.endDate; 192 193 this.plotWindow.getContent().innerHTML = '<img src=' + url + '/>'; 194 this.plotWindow.height = this.plotWindow.getContent().firstChild.height; 195 this.plotWindow.width = this.plotWindow.getContent().firstChild.width; 224 + "&dateEnd=" + this.endDate 225 + "&title=" + encodeURIComponent( $( "textareaTitle" ).value ) 226 + "&axeType=" + this.selectAxes.getValue(); 227 228 this.plotWindow.getContent().innerHTML = '<img src=' + url + ' />'; 229 // this.plotWindow.setSize( this.plotWindow.getContent().firstChild.width, this.plotWindow.getContent().firstChild.height, true ); 230 this.plotWindow.setSize( 800, 700 ); 196 231 this.plotWindow.show(); 232 // this.plotWindow.height = this.plotWindow.getContent().firstChild.height; 233 // this.plotWindow.width = this.plotWindow.getContent().firstChild.width; 197 234 }, 198 235 … … 206 243 207 244 // OTHERS ******************************************************** 245 // TODO : resize !!! 208 246 resizeContainers: function() 209 247 { … … 215 253 var containerPlateforms = this.containerPlateforms.offsetHeight; 216 254 var containerParameters = this.containerParameters.offsetHeight; 217 var containerCalendarHeight = this.generalContainerCalendar.offsetHeight; 218 219 var maxHeight = Math.max( containerPlateforms, containerParameters, containerCalendarHeight ); 220 255 var containerOptionsHeight = this.generalContainerOptions.offsetHeight; 256 257 var maxHeight = Math.max( containerPlateforms, containerParameters, containerOptionsHeight ); 221 258 222 259 if( maxHeight > parentHeight ) … … 225 262 this.generalContainerPlateforms.style.height = maxHeight + 10 + "px"; 226 263 this.generalContainerParameters.style.height = maxHeight + 10 + "px"; 227 } else if( maxHeight == container CalendarHeight )228 { 229 this.superParent.style.height = containerCalendarHeight + titleSize + 25 + "px";230 this.generalContainerPlateforms.style.height = container CalendarHeight + "px";231 this.generalContainerParameters.style.height = container CalendarHeight + "px";264 } else if( maxHeight == containerOptionsHeight ) 265 { 266 // this.superParent.style.height = containerOptionsHeight + titleSize + 25 + "px"; 267 this.generalContainerPlateforms.style.height = containerOptionsHeight + "px"; 268 this.generalContainerParameters.style.height = containerOptionsHeight + "px"; 232 269 } 233 270 }, 234 271 235 testCalendarPeriod: function( beginDate, endDate ) 236 { 237 if( !beginDate || !endDate ) 238 return false; 239 240 var matchFormat = /^(\d{4})-(\d{2})-(\d{2})$/i; 241 var testBeginDate = beginDate.match( matchFormat ); 242 var testEndDate = endDate.match( matchFormat ); 243 if( !testEndDate || !testEndDate ) 272 testAllFields: function() 273 { 274 if( !this.selectedPlateform || !this.selectedParameter || !this.beginDate || !this.endDate ) 275 { 276 // this.visualizeButton.disable(); 277 this.downloadButton.disable(); 244 278 return; 245 246 this.resizeContainers();247 248 var datesOk = beginDate <= endDate;249 if( !datesOk )250 this.displayNotice();251 else252 this.hideNotice();253 254 if( !datesOk || !this.selectedPlateform || !this.selectedParameter )255 {256 this.visualizeButton.disable();257 this.downloadButton.disable();258 return false;259 279 } 260 else 261 { 262 this.visualizeButton.enable(); 263 this.downloadButton.enable(); 264 return true; 265 } 266 }, 267 268 testAllFields: function() 269 { 270 return true; 271 272 if( !this.selectedPlateform || !this.selectedParameter || !this.beginDate || !this.endDate ) 273 { 274 this.visualizeButton.disable(); 275 this.downloadButton.disable(); 276 } 277 278 return this.testCalendarPeriod( this.beginDate, this.endDate ); 279 }, 280 281 displayNotice: function() 282 { 283 this.notice.innerHTML = " "; 284 this.notice.removeClassName( "loading" ); 285 this.notice.addClassName( "error" ); 286 this.notice.innerHTML = interfaceTexts["data.visualization.Unvalid_Period"]; 287 this.notice.style.visibility = "visible"; 288 }, 289 290 hideNotice: function() 291 { 292 this.notice.innerHTML = " "; 293 this.notice.style.visibility = "hidden"; 294 }, 295 296 displayLoading: function() 297 { 298 this.notice.innerHTML = " "; 299 this.notice.removeClassName( "error" ); 300 this.notice.style.visibility = "visible"; 301 this.notice.addClassName( "loading" ); 302 var image = new Element( 'img', {src: 'resources/icons/loading_datas.gif'} ); 303 this.notice.appendChild( image ); 304 }, 305 306 hideLoading: function() 307 { 308 this.notice.innerHTML = " "; 280 281 this.visualizeButton.enable(); 282 this.downloadButton.enable(); 309 283 } 284 310 285 } ); 311 286 -
ether_megapoli/trunk/web/visualization/visu_parameter_by_pf.jsp
r129 r130 1 1 <!-- /*** ****************** VISU ******************** **/ --> 2 2 <%@ page import="com.medias.Context" %> 3 <%@ page import="com.ether.AxeType" %> 3 4 4 5 <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %> … … 16 17 17 18 <tiles:put name="insertCss" type="string"> 18 <ether:htmlCss cssFile="calendarview-1.2/calendarview"/>19 19 <ether:htmlCss cssFile="visu_parameter_by_pf"/> 20 <ether:htmlCss cssFile="select"/> 21 22 <%-- Calendar --%> 23 <ether:htmlCss cssFile="calendar/anytime"/> 20 24 <ether:htmlCss cssFile="windows_js_1.3/themes/default"/> 21 25 <ether:htmlCss cssFile="windows_js_1.3/themes/mac_os_x"/> 26 27 <%-- Select --%> 28 <%--ether:htmlCss cssFile="customedSelect/css/customSelect" /--%> 22 29 </tiles:put> 23 30 … … 27 34 <ether:htmlJsp jspFile="visu_parameter_by_pf-classes"/> 28 35 <ether:htmlJs jsFile="Button"/> 29 <ether:htmlJs jsFile=" calendarview-1.2/javascripts/calendarview"/>36 <ether:htmlJs jsFile="Select"/> 30 37 31 <ether:htmlJs jsFile="library/windows_js_1.3/javascripts/debug"/> 32 <ether:htmlJs jsFile="library/windows_js_1.3/javascripts/effects"/> 33 <ether:htmlJs jsFile="library/windows_js_1.3/javascripts/window"/> 34 <ether:htmlJs jsFile="library/windows_js_1.3/javascripts/window_ext"/> 38 <ether:htmlJs jsFile="library/jquery-1.4.2.min"/> 39 <ether:htmlJs jsFile="library/prototype"/> 40 41 <%-- Calendar --%> 42 <ether:htmlJs jsFile="calendar/anytime"/> 43 <ether:htmlJs jsFile="windows_js_1.3/javascripts/debug"/> 44 <ether:htmlJs jsFile="windows_js_1.3/javascripts/effects"/> 45 <ether:htmlJs jsFile="windows_js_1.3/javascripts/window"/> 46 <ether:htmlJs jsFile="windows_js_1.3/javascripts/window_ext"/> 47 48 <%-- Select --%> 49 <%--ether:htmlJs jsFile="customedSelect/js/customSelect"/--%> 35 50 </tiles:put> 36 51 … … 59 74 </div> 60 75 61 <div id="generalContainerCalendar" class="span-9 last"> 62 <div id="messages"><bean:message key="data.visualization.selectTime"/></div> 63 <div id="embeddedCalendar" class="embeddedCalendar"></div> 76 <div id="generalContainerOptions" class="span-9 last"> 77 <div id="containerOptionCalendar" class="span-9"> 78 <div id="messages" class="messagesHeight"><bean:message key="data.visualization.selectPeriod"/></div> 79 <input type="text" id="beginDate" size="15"/> 80 <input type="text" id="endDate" size="15"/> 81 </div> 64 82 65 <div class="dateField leftField"><bean:message key="data.visualization.BeginDate"/></div> 66 <div id="embeddedDateField" class="dateField rightField"><bean:message 67 key="data.visualization.selectDate"/></div> 68 <div class="dateField leftField"><bean:message key="data.visualization.EndDate"/></div> 69 <div id="embeddedEndDateField" class="dateField rightField"><bean:message 70 key="data.visualization.selectDate"/></div> 83 <div id="containerOptionTitle" class="span-8"> 84 <div id="messages" class="messagesHeight"><bean:message key="data.visualization.titleChoice"/></div> 85 <textarea id="textareaTitle" cols="37" rows="2"></textarea> 86 </div> 87 88 <div id="containerOptionAxe" class="span-8"> 89 <div id="messages" class="messagesHeight"><bean:message key="data.visualization.axe"/></div> 90 </div> 71 91 72 92 <div class="errorAndButtons"> 73 <div id="notice" style="visibility:hidden" class="error span-6"> </div> 74 <div id="containerButtons" class="buttons span-7"></div> 93 <div id="containerButtons" class="span-7"></div> 75 94 </div> 76 95 </div> … … 87 106 interfaceTexts["data.visualization.Unvalid_Period"] = "<bean:message key="data.visualization.Unvalid_Period"/>"; 88 107 interfaceTexts["data.visualization.quicklook"] = "<bean:message key="data.visualization.quicklook"/>"; 108 interfaceTexts["data.visualization.titleChoice"] = "<bean:message key="data.visualization.titleChoice"/>"; 109 interfaceTexts["data.visualization.axe"] = "<bean:message key="data.visualization.axe"/>"; 110 interfaceTexts["data.visualization.button.today"] = "<bean:message key="data.visualization.button.today"/>"; 111 interfaceTexts["data.visualization.button.clear"] = "<bean:message key="data.visualization.button.clear"/>"; 89 112 90 var interfaceVisualization = new InterfaceVisualization( ${plateforms} ); 113 interfaceTexts["data.visualization.selectDate"] = "<bean:message key="data.visualization.selectDate"/>"; 114 interfaceTexts["data.visualization.selectYear"] = "<bean:message key="data.visualization.selectYear"/>"; 115 interfaceTexts["data.visualization.selectMonth"] = "<bean:message key="data.visualization.selectMonth"/>"; 116 interfaceTexts["data.visualization.selectDay"] = "<bean:message key="data.visualization.selectDay"/>"; 117 interfaceTexts["data.visualization.selectTime"] = "<bean:message key="data.visualization.selectTime"/>"; 118 interfaceTexts["data.visualization.selectHour"] = "<bean:message key="data.visualization.selectHour"/>"; 119 interfaceTexts["data.visualization.selectMinute"] = "<bean:message key="data.visualization.selectMinute"/>"; 120 121 interfaceTexts["<%=AxeType.TIME%>"] = "<bean:message key="data.visualization.axeType.Time"/>"; 122 interfaceTexts["<%=AxeType.LATITUDE%>"] = "<bean:message key="data.visualization.axeType.Latitude"/>"; 123 124 var interfaceVisualization = new InterfaceVisualization( ${plateforms}, ${axeTypes} ); 91 125 </script> 92 126
Note: See TracChangeset
for help on using the changeset viewer.