Changeset 246
- Timestamp:
- 11/10/11 17:23:05 (13 years ago)
- Location:
- ether_megapoli/trunk/web
- Files:
-
- 4 deleted
- 18 edited
- 1 copied
- 6 moved
Legend:
- Unmodified
- Added
- Removed
-
ether_megapoli/trunk/web/WEB-INF/servlet-context.xml
r155 r246 31 31 <property name="mappings"> 32 32 <props> 33 <prop key="/visualization">controller</prop> 33 <prop key="/visualization">controllerVisualization</prop> 34 <prop key="/data">controllerData</prop> 34 35 </props> 35 36 </property> … … 52 53 </bean> 53 54 54 <bean id="controller " class="com.ether.Controller" parent="controllerEther">55 <bean id="controllerVisualization" class="com.ether.ControllerVisualization" parent="controllerEther"> 55 56 <property name="etherService" ref="etherService" /> 56 57 </bean> 57 58 59 <bean id="controllerData" class="com.ether.ControllerData" parent="controllerEther"> 60 </bean> 61 58 62 </beans> -
ether_megapoli/trunk/web/WEB-INF/struts-config.xml
r170 r246 160 160 name="metadataForm" 161 161 validate="false" 162 input="/data/ access/jeux.jsp">162 input="/data/jeux.jsp"> 163 163 <forward name="success" path="/data/access/metadataInfo.jsp"/> 164 164 </action> … … 250 250 path="/PrepareTreeAccess" 251 251 type="com.medias.megapoli.struts.actions.PrepareTreeAccessAction"> 252 <forward name="success" path="/data/ access/jeux.jsp"/>252 <forward name="success" path="/data/jeux.jsp"/> 253 253 </action> 254 254 <action … … 293 293 type="com.medias.megapoli.struts.actions.ParametresAccessAction" 294 294 name="parametresForm"> 295 <forward name="success" path="/data /access/param.jsp"/>295 <forward name="success" path="/data?methodName=viewParameters"/> 296 296 </action> 297 297 <action … … 299 299 type="com.medias.megapoli.struts.actions.CapteursAccessAction" 300 300 name="capteursForm"> 301 <forward name="success" path="/data /access/capt.jsp"/>301 <forward name="success" path="/data?methodName=viewSensors"/> 302 302 </action> 303 303 <action … … 305 305 type="com.medias.megapoli.struts.actions.JeuxAccessAction" 306 306 name="jeuxForm"> 307 <forward name="success" path="/data /access/jeux.jsp"/>307 <forward name="success" path="/data?methodName=viewSets"/> 308 308 </action> 309 309 <action … … 317 317 type="com.medias.megapoli.struts.actions.PlateformesAccessAction" 318 318 name="plateformesForm"> 319 <forward name="success" path="/data /access/plat.jsp"/>319 <forward name="success" path="/data?methodName=viewPlateforms"/> 320 320 </action> 321 321 <action … … 332 332 name="datasForm" 333 333 validate="true"> 334 <forward name="cancel" path="/data/access /access.jsp"/>334 <forward name="cancel" path="/data/access.jsp"/> 335 335 <forward name="reset" path="/data/access/extract.jsp"/> 336 336 <forward name="success" path="/data/access/extract2.jsp"/> -
ether_megapoli/trunk/web/WEB-INF/web.xml
r199 r246 1 1 <?xml version="1.0" encoding="UTF-8"?> 2 <web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.4" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"> 2 <web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.4" 3 xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"> 3 4 4 5 <display-name>Megapoli</display-name> … … 9 10 10 11 <!--<context-param>--> 11 12 13 14 15 16 <!---->17 18 12 <!--<param-name>contextConfigLocation</param-name>--> 13 <!--<param-value>--> 14 <!--classpath:hibernate.cfg.xml,--> 15 <!--classpath:dao-context.xml,--> 16 <!--classpath:service-context.xml,--> 17 <!----> 18 <!--classpath:json/json-context.xml--> 19 <!--</param-value>--> 19 20 <!--</context-param>--> 20 21 … … 102 103 103 104 <servlet> 104 105 106 105 <servlet-name>MegapoliInitialisation</servlet-name> 106 <servlet-class>com.medias.megapoli.utils.MegapoliInitialisation</servlet-class> 107 <load-on-startup>0</load-on-startup> 107 108 </servlet> 109 110 <servlet> 111 <servlet-name>data</servlet-name> 112 <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> 113 <init-param> 114 <param-name>contextConfigLocation</param-name> 115 <param-value> 116 /WEB-INF/servlet-context.xml 117 </param-value> 118 </init-param> 119 </servlet> 120 121 <servlet-mapping> 122 <servlet-name>data</servlet-name> 123 <url-pattern>/data</url-pattern> 124 </servlet-mapping> 108 125 109 126 <!-- taglib> … … 111 128 <taglib-location>/tlds/struts-logic.tld</taglib-location> 112 129 </taglib> 113 130 <taglib> 114 131 <taglib-uri>/tlds/struts-html.tld</taglib-uri> 115 132 <taglib-location>/tlds/struts-html.tld</taglib-location> -
ether_megapoli/trunk/web/data/access.jsp
r161 r246 1 <%@ page import="com.medias.Context" contentType="text/html; charset=UTF-8"%>2 1 <%@ page language="java" contentType="text/html; charset=UTF-8"%> 3 2 <%@ taglib uri="/WEB-INF/tlds/struts-tiles.tld" prefix="tiles"%> 4 3 <%@ taglib uri="/WEB-INF/tlds/struts-html.tld" prefix="html"%> 5 4 <%@ taglib uri="/WEB-INF/tlds/struts-bean.tld" prefix="bean"%> 6 <%@ taglib uri="/WEB-INF/tlds/struts-logic.tld" prefix="logic"%>7 5 8 <tiles:insert page="/resources/templates/template .jsp" flush="true">6 <tiles:insert page="/resources/templates/templateEther.jsp" flush="true"> 9 7 10 <bean:define type="java.lang.String" id="relativePath" value="<%=Context.getRelativePath(request)%>"/> 8 <tiles:put name="insertCss" type="string"></tiles:put> 9 <tiles:put name="insertJsOrJsp" type="string"></tiles:put> 11 10 12 <tiles:put name="nav" value='<%=relativePath+"/nav.jsp"%>'/> 11 <tiles:put name="title" type="string"><bean:message key="app.title"/> - <bean:message key="data.access"/></tiles:put> 12 <tiles:put name="nav" type="string"> 13 <html:link page="/index.jsp"><bean:message key="app.home"/></html:link> > 14 <html:link page="/data?methodName=viewCatalog"><bean:message key="data.access"/></html:link> 15 </tiles:put> 13 16 14 <tiles:put name="title" type="string"> 15 <bean:message key="app.title"/> - <bean:message key="data.access"/> 16 </tiles:put> 17 18 <tiles:put name="bodytitle" type="string"> 19 <bean:message key="data.access"/> 20 </tiles:put> 17 <%--****************** CONTENT ****************** --%> 18 <tiles:put name="bodytitle" type="string"><bean:message key="data.access"/></tiles:put> 21 19 22 20 <tiles:put name="body" type="string"> 23 21 <bean:message key="data.access.intro3"/> 24 22 <bean:define id="access" value="access"/> 23 25 24 - 26 <html:link page="/JeuxAccess.do"> 27 <bean:message key="data.access.jeux"/> 28 </html:link> 29 <br> 30 - 31 <html:link page="/ParametresAccess.do"> 32 <bean:message key="data.access.param"/> 33 </html:link> 34 <br> 35 - 36 <html:link page="/CapteursAccess.do"> 37 <bean:message key="data.access.capt"/> 38 </html:link> 39 <br> 40 - 41 <html:link page="/PlateformesAccess.do"> 42 <bean:message key="data.access.plat"/> 43 </html:link> 44 <%--br> 45 - 46 <html:link page="/DataAccess.do"> 47 <bean:message key="data.access.extract"/> 48 </html:link--%> 25 <html:link page="/data?methodName=viewSets"><bean:message key="data.access.jeux"/></html:link> 26 27 <br> - 28 <html:link page="/data?methodName=viewParameters"><bean:message key="data.access.param"/></html:link> 29 30 <br> - 31 <html:link page="/CapteursAccess.do"><bean:message key="data.access.capt"/></html:link> 32 33 <br> - 34 <html:link page="/PlateformesAccess.do"><bean:message key="data.access.plat"/></html:link> 49 35 </tiles:put> 50 36 </tiles:insert> -
ether_megapoli/trunk/web/data/access/navCapt.jsp
r161 r246 8 8 <li><html:link page="/index.jsp"><bean:message key="app.home"/></html:link></li> 9 9 <%--li><html:link page="/data/data.jsp"><bean:message key="data"/></html:link></li--%> 10 <li><html:link page="/data/access /access.jsp"><bean:message key="data.access"/></html:link></li>10 <li><html:link page="/data/access.jsp"><bean:message key="data.access"/></html:link></li> 11 11 <li><html:link page="/CapteursAccess.do"><bean:message key="data.access.capt"/></html:link></li> 12 12 <li><html:link page="/data/access/desc_capt.jsp"><bean:message key="data.access.capt4"/></html:link></li> -
ether_megapoli/trunk/web/data/access/navCapts.jsp
r161 r246 8 8 <li><html:link page="/index.jsp"><bean:message key="app.home"/></html:link></li> 9 9 <%--li><html:link page="/data/data.jsp"><bean:message key="data"/></html:link></li--%> 10 <li><html:link page="/data/access /access.jsp"><bean:message key="data.access"/></html:link></li>11 <li><html:link page="/data/ access/capt.jsp"><bean:message key="data.access.capt"/></html:link></li>10 <li><html:link page="/data/access.jsp"><bean:message key="data.access"/></html:link></li> 11 <li><html:link page="/data/capt.jsp"><bean:message key="data.access.capt"/></html:link></li> 12 12 </ul> -
ether_megapoli/trunk/web/data/access/navFiles.jsp
r161 r246 8 8 <li><html:link page="/index.jsp"><bean:message key="app.home"/></html:link></li> 9 9 <%--li><html:link page="/data/data.jsp"><bean:message key="data"/></html:link></li--%> 10 <li><html:link page="/data/access /access.jsp"><bean:message key="data.access"/></html:link></li>11 <li><html:link page="/data/ access/jeux.jsp"><bean:message key="data.access.jeux"/></html:link></li>10 <li><html:link page="/data/access.jsp"><bean:message key="data.access"/></html:link></li> 11 <li><html:link page="/data/jeux.jsp"><bean:message key="data.access.jeux"/></html:link></li> 12 12 <li><html:link page="/data/access/files.jsp"><bean:message key="data.access.files"/></html:link></li> 13 13 </ul> -
ether_megapoli/trunk/web/data/access/navParam.jsp
r161 r246 8 8 <li><html:link page="/index.jsp"><bean:message key="app.home"/></html:link></li> 9 9 <%--li><html:link page="/data/data.jsp"><bean:message key="data"/></html:link></li--%> 10 <li><html:link page="/data/access /access.jsp"><bean:message key="data.access"/></html:link></li>10 <li><html:link page="/data/access.jsp"><bean:message key="data.access"/></html:link></li> 11 11 <li><html:link page="/ParametresAccess.do"><bean:message key="data.access.param"/></html:link></li> 12 12 <li><html:link page="/data/access/desc_param.jsp"><bean:message key="data.access.param4"/></html:link></li> -
ether_megapoli/trunk/web/data/access/navPlat.jsp
r161 r246 8 8 <li><html:link page="/index.jsp"><bean:message key="app.home"/></html:link></li> 9 9 <%--li><html:link page="/data/data.jsp"><bean:message key="data"/></html:link></li--%> 10 <li><html:link page="/data/access /access.jsp"><bean:message key="data.access"/></html:link></li>10 <li><html:link page="/data/access.jsp"><bean:message key="data.access"/></html:link></li> 11 11 <li><html:link page="/PlateformesAccess.do"><bean:message key="data.access.plat"/></html:link></li> 12 12 <li><html:link page="/data/access/desc_plat.jsp"><bean:message key="data.access.plat4"/></html:link></li> -
ether_megapoli/trunk/web/data/access/navPlats.jsp
r161 r246 8 8 <li><html:link page="/index.jsp"><bean:message key="app.home"/></html:link></li> 9 9 <%--li><html:link page="/data/data.jsp"><bean:message key="data"/></html:link></li--%> 10 <li><html:link page="/data/access /access.jsp"><bean:message key="data.access"/></html:link></li>11 <li><html:link page="/data/ access/plat.jsp"><bean:message key="data.access.plat"/></html:link></li>10 <li><html:link page="/data/access.jsp"><bean:message key="data.access"/></html:link></li> 11 <li><html:link page="/data/plat.jsp"><bean:message key="data.access.plat"/></html:link></li> 12 12 </ul> -
ether_megapoli/trunk/web/data/capt.jsp
r200 r246 95 95 96 96 <div class="hdp" align="right"> 97 <html:link page="/data/ access/capt.jsp" anchor="top" titleKey="app.hdp">97 <html:link page="/data/capt.jsp" anchor="top" titleKey="app.hdp"> 98 98 <html:img page="/resources/images/utils/hdp1.png"/> 99 99 </html:link> -
ether_megapoli/trunk/web/data/data.jsp
r161 r246 38 38 </li> 39 39 <li> 40 <html:link page="/data/access /access.jsp"><bean:message key="data.access"/></html:link>40 <html:link page="/data/access.jsp"><bean:message key="data.access"/></html:link> 41 41 : <bean:message key="data.access.intro"/> 42 42 </li> -
ether_megapoli/trunk/web/data/jeux.jsp
r200 r246 1 <%@ page import="com.medias.Context" contentType="text/html; charset=UTF-8"%>2 1 <%@ page language="java" contentType="text/html; charset=UTF-8"%> 3 2 <%@ page import="com.medias.Calcul"%> … … 8 7 <%@ taglib uri="/WEB-INF/tlds/struts-nested.tld" prefix="nested"%> 9 8 10 <tiles:insert page="/resources/templates/template.jsp" flush="true"> 11 12 <bean:define type="java.lang.String" id="relativePath" value="<%=Context.getRelativePath(request)%>"/> 13 14 <tiles:put name="nav" value='<%=relativePath+"/navJeux.jsp"%>'/> 15 16 <tiles:put name="title" type="string"> 17 <bean:message key="app.title"/> - <bean:message key="data.access.jeux"/> 18 </tiles:put> 19 20 <tiles:put name="bodytitle" type="string"> 21 <bean:message key="data.access.jeux"/> 22 </tiles:put> 9 <tiles:insert page="/resources/templates/templateEther.jsp" flush="true"> 10 11 <tiles:put name="insertCss" type="string"></tiles:put> 12 <tiles:put name="insertJsOrJsp" type="string"></tiles:put> 13 14 15 <tiles:put name="title" type="string"><bean:message key="app.title"/> - <bean:message key="data.access.jeux"/></tiles:put> 16 <tiles:put name="nav" type="string"> 17 <html:link page="/index.jsp"><bean:message key="app.home"/></html:link> > 18 <html:link page="/data?methodName=viewCatalog"><bean:message key="data.access"/></html:link> > 19 <html:link page="/data?methodName=viewSets"><bean:message key="data.access.jeux"/></html:link> 20 </tiles:put> 21 22 <%--****************** CONTENT ****************** --%> 23 <tiles:put name="bodytitle" type="string"><bean:message key="data.access.jeux"/></tiles:put> 23 24 24 25 <tiles:put name="body" type="string"> … … 238 239 239 240 <div class="hdp" align="right"> 240 <html:link page="/data/ access/jeux.jsp" anchor="top" titleKey="app.hdp">241 <html:link page="/data/jeux.jsp" anchor="top" titleKey="app.hdp"> 241 242 <html:img page="/resources/images/utils/hdp1.png"/> 242 243 </html:link> -
ether_megapoli/trunk/web/data/param.jsp
r200 r246 1 <%@ page import="com.medias.Context" contentType="text/html; charset=UTF-8"%>2 1 <%@ page import="com.medias.Calcul"%> 3 <%@ page import="java.util.ArrayList"%>4 2 <%@ page language="java" contentType="text/html; charset=UTF-8"%> 5 3 <%@ taglib uri="/WEB-INF/tlds/struts-tiles.tld" prefix="tiles"%> … … 9 7 <%@ taglib uri="/WEB-INF/tlds/struts-nested.tld" prefix="nested"%> 10 8 11 <tiles:insert page="/resources/templates/template .jsp" flush="true">9 <tiles:insert page="/resources/templates/templateEther.jsp" flush="true"> 12 10 13 <bean:define type="java.lang.String" id="relativePath" value="<%=Context.getRelativePath(request)%>"/> 11 <tiles:put name="insertCss" type="string"></tiles:put> 12 <tiles:put name="insertJsOrJsp" type="string"></tiles:put> 14 13 15 <tiles:put name="nav" value='<%=relativePath+"/navParams.jsp"%>'/>16 14 17 <tiles:put name="title" type="string"> 18 <bean:message key="app.title"/> - <bean:message key="data.access.param"/> 19 </tiles:put> 15 <tiles:put name="title" type="string"><bean:message key="app.title"/> - <bean:message key="data.access.param"/></tiles:put> 16 <tiles:put name="nav" type="string"> 17 <html:link page="/index.jsp"><bean:message key="app.home"/></html:link> > 18 <html:link page="/data?methodName=viewCatalog"><bean:message key="data.access"/></html:link> > 19 <html:link page="/data?methodName=viewParameters"><bean:message key="data.access.param"/></html:link> 20 </tiles:put> 20 21 21 <tiles:put name="bodytitle" type="string"> 22 <bean:message key="data.access.param"/> 23 </tiles:put> 22 <%--****************** CONTENT ****************** --%> 23 <tiles:put name="bodytitle" type="string"><bean:message key="data.access.param"/></tiles:put> 24 24 25 25 <tiles:put name="body" type="string"> … … 79 79 80 80 <div class="hdp" align="right"> 81 <html:link page="/data/ access/param.jsp" anchor="top" titleKey="app.hdp">81 <html:link page="/data/param.jsp" anchor="top" titleKey="app.hdp"> 82 82 <html:img page="/resources/images/utils/hdp1.png"/> 83 83 </html:link> -
ether_megapoli/trunk/web/data/plat.jsp
r200 r246 113 113 114 114 <div class="hdp" align="right"> 115 <html:link page="/data/ access/plat.jsp" anchor="top" titleKey="app.hdp">115 <html:link page="/data/plat.jsp" anchor="top" titleKey="app.hdp"> 116 116 <html:img page="/resources/images/utils/hdp1.png"/> 117 117 </html:link> -
ether_megapoli/trunk/web/index.jsp
r239 r246 28 28 <ul> 29 29 <li> 30 <html:link page="/data/access /access.jsp"><bean:message key="data.access"/></html:link>: <bean:message30 <html:link page="/data/access.jsp"><bean:message key="data.access"/></html:link>: <bean:message 31 31 key="data.access.intro"/> 32 32 </li> -
ether_megapoli/trunk/web/resources/js/classesForJQuery/etherClasses.js
r243 r246 9 9 jQuery.each( jsonElements, jQuery.proxy( function( i, jsonElement ) 10 10 { 11 this.addItem( jsonElement, objectParameter ); 11 // if( jQuery.isArray( jsonElement ) && 1 < jsonElement.length ) 12 // var subItems = new ListItem( jsonElement, new Object() ); 13 // else 14 this.addItem( jsonElement, objectParameter ); 12 15 }, this ) ); 13 16 }, … … 216 219 var divMenu_arrow = $( document.createElement( "div" ) ); 217 220 divMenu_arrow.attr( {id:"divMenu_arrow_" + this.getId(), class:"divMenu_arrow" } ); 218 // divNameMenu_arrow.bind( 'click', this, this.onClickMenu );219 221 this.divContainer.append( divMenu_arrow ); 220 222 … … 225 227 { 226 228 var divSubMenu_name = $( document.createElement( "div" ) ); 227 divSubMenu_name.addClass( classNameValue +"_subMenu" );229 divSubMenu_name.addClass( classNameValue + "_subMenu" ); 228 230 divSubMenu_name.addClass( "parameter_menu_" + element.id ); 229 231 divSubMenu_name.html( element.code ); 232 divSubMenu_name.bind( 'click', {divContainer:this.divContainer, jsonElement:element}, this.onClickMenu ); 230 233 this.divHiddenElements.append( divSubMenu_name ); 231 234 }, this ) ); … … 261 264 else 262 265 this.addName( classNameValue ); 266 }, 267 268 onClickMenu: function( event ) 269 { 270 var jsonElement = event.data.jsonElement; 271 event.data = event.data.divContainer.item; 272 event.data.jsonElement = jsonElement; 263 273 } 264 274 265 // onClickMenu: function( event )266 // {267 // var contextEvent = event.data;268 // contextEvent.divNameMenu_up.animate( {width:"toggle"} );269 // contextEvent.divNameMenu_down.animate( {width:"toggle"} );270 // }271 272 275 } ); -
ether_megapoli/trunk/web/resources/jsp/etherHead.jsp
r240 r246 14 14 this.path = "<%=request.getContextPath()%>"; 15 15 this.webmaster = "<%=Context.getWebmaster(request)%>"; 16 this.relativePageUri = "<%=Context.getRelativePath( request )%>?<%=request.getQueryString()%>";16 this.relativePageUri = <%=request.getQueryString() != null%> ? "<%=Context.getRelativePath( request )%>?<%=request.getQueryString()%>" : "<%=Context.getRelativePageURI(request)%>"; 17 17 this.jSONUser = <%=Context.getUser( request )%> ? <%=Context.getUser( request )%> : false; 18 18 this.screenWidthLimit = 1336; -
ether_megapoli/trunk/web/resources/templates/mainTemplate.jsp
r222 r246 91 91 92 92 <div id="menuMetaData" class="span-5"> 93 <html:link page="/data/access /access.jsp" paramName="access" paramId="source">93 <html:link page="/data/access.jsp" paramName="access" paramId="source"> 94 94 <h2><bean:message key="data.access"/></h2> 95 95 </html:link> -
ether_megapoli/trunk/web/resources/templates/template.jsp
r222 r246 142 142 <bean:define id="access" value="access"/> 143 143 <ul> 144 <li><html:link page="/data/access /access.jsp" paramName="access" paramId="source">144 <li><html:link page="/data/access.jsp" paramName="access" paramId="source"> 145 145 <bean:message key="data.access"/> 146 146 </html:link> -
ether_megapoli/trunk/web/resources/templates/template2.jsp
r222 r246 143 143 <bean:define id="access" value="access"/> 144 144 <ul> 145 <li><html:link page="/data/access /access.jsp" paramName="access" paramId="source">145 <li><html:link page="/data/access.jsp" paramName="access" paramId="source"> 146 146 <bean:message key="data.access"/> 147 147 </html:link> -
ether_megapoli/trunk/web/resources/templates/templateEther.jsp
r240 r246 105 105 <ul class="menu"> 106 106 <li> 107 <html:link page="/data /access/access.jsp" paramName="access" paramId="source">107 <html:link page="/data?methodName=viewCatalog" paramName="access" paramId="source"> 108 108 <span><bean:message key="data.access"/></span> 109 109 </html:link> … … 111 111 <ul> 112 112 <li><html:link page="/JeuxAccess.do"><span><bean:message key="data.access.jeux"/></span></html:link></li> 113 <li><html:link page="/ParametresAccess.do"><span><bean:message key="data.access.param"/></span></html:link> 114 </li> 113 <li><html:link page="/ParametresAccess.do"><span><bean:message key="data.access.param"/></span></html:link></li> 115 114 <li><html:link page="/CapteursAccess.do"><span><bean:message key="data.access.capt"/></span></html:link></li> 116 <li><html:link page="/PlateformesAccess.do"><span><bean:message key="data.access.plat"/></span></html:link> 117 </li> 115 <li><html:link page="/PlateformesAccess.do"><span><bean:message key="data.access.plat"/></span></html:link></li> 118 116 </ul> 119 117 </div> … … 121 119 122 120 <li> 123 <html:link page="/data/access /access.jsp" paramName="access" paramId="source">121 <html:link page="/data/access.jsp" paramName="access" paramId="source"> 124 122 <span><bean:message key="app.data"/></span> 125 123 </html:link> … … 127 125 <ul> 128 126 <logic:notPresent name="SES_USER" scope="session"> 129 <li><html:link page="/InitLogonAccess.do" paramName="access" paramId="source"><span><bean:message key="data.access.extract.short"/></span></html:link> 130 </li> 127 <li><html:link page="/InitLogonAccess.do" paramName="access" paramId="source"><span><bean:message key="data.access.extract.short"/></span></html:link></li> 131 128 <li><html:link page="/InitLogon.do" paramName="upload" paramId="source"><span><bean:message key="data.upload.short"/></span></html:link></li> 132 129 </logic:notPresent> … … 140 137 141 138 <li class="last"> 142 <html:link page="/visualization?methodName=view"> 143 <span><bean:message key="all.visualization"/></span> 144 </html:link> 139 <html:link page="/visualization?methodName=view"><span><bean:message key="all.visualization"/></span></html:link> 145 140 <div> 146 141 <ul> -
ether_megapoli/trunk/web/src/com/ether/ControllerData.java
r244 r246 2 2 3 3 import com.ether.annotation.ControllerMethod; 4 import com.ether.annotation.Mandatory;5 import com.ether.annotation.ParamName;6 import com.medias.annuaire.Personne;7 import com.medias.database.objects.Parametre;8 import com.medias.database.objects.Plateforme;9 import com.medias.megapoli.struts.forms.DatasForm;10 import com.medias.megapoli.trade.MesureAdapter;11 import com.medias.megapoli.trade.ValeurAdapter;12 import com.medias.megapoli.utils.Requete;13 import net.sf.json.JSONObject;14 4 import org.apache.commons.logging.Log; 15 5 import org.apache.commons.logging.LogFactory; 16 import org.jdom.Document;17 import org.jdom.output.XMLOutputter;18 import org.jetbrains.annotations.NotNull;19 import org.springframework.beans.factory.annotation.Required;20 import org.springframework.web.servlet.ModelAndView;21 6 22 import javax.servlet.http.HttpServletRequest;23 import javax.servlet.http.HttpServletResponse;24 import java.io.BufferedReader;25 import java.io.DataOutputStream;26 import java.io.InputStreamReader;27 import java.net.URL;28 import java.net.URLConnection;29 import java.net.URLEncoder;30 import java.util.ArrayList;31 import java.util.Calendar;32 import java.util.Date;33 7 import java.util.HashMap; 34 import java.util.List;35 8 import java.util.Map; 36 9 37 10 /** 38 11 * @author vmipsl 39 * @date 1 7 feb201112 * @date 10 nov 2011 40 13 */ 41 public class Controller 14 public class ControllerData 42 15 extends ControllerEther 43 16 { … … 45 18 /** *********************** VIEWS ***************************** **/ 46 19 /** *********************************************************** **/ 47 // Default view if methodName is unknown 48 public ModelAndView home( final HttpServletRequest request, final HttpServletResponse response ) 49 throws EtherException 50 { 51 return new ModelAndView( "index" ); 52 } 53 54 @ControllerMethod(view = VIEW_WORK) 55 public Map<String, Object> viewInWork() 20 @ControllerMethod(view = VIEW_CATALOG) 21 public Map<String, Object> viewCatalog() 56 22 throws ServiceException 57 23 { … … 59 25 } 60 26 61 @ControllerMethod(view = VIEW_ VISUALIZATION)62 public Map<String, Object> view ()27 @ControllerMethod(view = VIEW_SETS) 28 public Map<String, Object> viewSets() 63 29 throws ServiceException 64 30 { … … 66 32 } 67 33 68 @ControllerMethod(view = VIEW_ VISUALIZATION_PARAMETER_BY_PLATEFORM)69 public Map<String, Object> viewParameters ByPlateform()34 @ControllerMethod(view = VIEW_PARAMETERS) 35 public Map<String, Object> viewParameters() 70 36 throws ServiceException 71 37 { 72 final List<Plateforme> plateforms = _etherService.getAllPlateforms(); 73 final Date firstDate = _etherService.getFirstDate(); 74 final Date endDate = _etherService.getLastDate(); 38 return new HashMap<String, Object>(); 39 } 75 40 76 final Map<String, Object> model = new HashMap<String, Object>(); 77 model.put( "plateforms", getJsonHelper().toJSON( plateforms ) ); 78 model.put( "axeTypesForFixedPlateforms", getJSONAxeTypesForFixedPlateforms() ); 79 model.put( "axeTypesForMobilePlateforms", getJSONAxeTypesForMobilePlateforms() ); 80 model.put( "firstDate", DateHelper.formatDate( firstDate, DateHelper.ENGLISH_DATE_PATTERN ) ); 81 model.put( "lastDate", DateHelper.formatDate( endDate, DateHelper.ENGLISH_DATE_PATTERN ) ); 82 return model; 41 @ControllerMethod(view = VIEW_SENSORS) 42 public Map<String, Object> viewSensors() 43 throws ServiceException 44 { 45 return new HashMap<String, Object>(); 46 } 47 48 @ControllerMethod(view = VIEW_PLATEFORMS) 49 public Map<String, Object> viewPlateforms() 50 throws ServiceException 51 { 52 return new HashMap<String, Object>(); 83 53 } 84 54 … … 86 56 /** *********************** CALLS ***************************** **/ 87 57 /** *********************************************************** **/ 88 @ControllerMethod(jsonResult = true)89 public JSONObject searchParametersByPlateform( @Mandatory @ParamName(ParameterConstants.PARAMETER_ID) final Integer plateformId )90 throws ServiceException, EtherException91 {92 final List<Parametre> fullParametersByPlateform = _etherService.getParametersByPlateformId( plateformId );93 final List<List<Parametre>> parametersByPlateform = manageMenusForParameterList( fullParametersByPlateform );94 58 95 final JSONObject result = new JSONObject(); 96 result.put( ParameterConstants.PARAMETER_PARAMETERS, getJsonHelper().toJSON( parametersByPlateform ) ); 97 return result; 98 } 59 private static final Log LOGGER = LogFactory.getLog( ControllerData.class ); 99 60 100 /** 101 * This method manage the sub-menus for the list of parameters (to avoid multiple "Particle Concentration" by example) 102 * The fullParameters must be ordered with parameterName ascendant 103 * 104 * @param fullParameters 105 * @return 106 */ 107 @NotNull 108 private List<List<Parametre>> manageMenusForParameterList( @NotNull final List<Parametre> fullParameters ) 109 { 110 final List<List<Parametre>> parameterListWithMenu = new ArrayList<List<Parametre>>(); 111 112 int i = 0; 113 while( i < fullParameters.size() ) 114 { 115 final Parametre fullParameter = fullParameters.get( i ); 116 final int firstIndex = fullParameters.indexOf( fullParameter ); 117 final int lastIndex = fullParameters.lastIndexOf( fullParameter ); 118 final List<Parametre> parameters = fullParameters.subList( firstIndex, lastIndex + 1 ); 119 parameterListWithMenu.add( parameters ); 120 i += parameters.size(); 121 } 122 123 return parameterListWithMenu; 124 } 125 126 127 @ControllerMethod(jsonResult = true, loginMandatory = true) 128 public JSONObject downloadData( @ParamName(ParameterConstants.PARAMETER_DATE_BEGIN) final String dateBegin, 129 @ParamName(ParameterConstants.PARAMETER_DATE_END) final String dateEnd, 130 @ParamName(ParameterConstants.PARAMETER_PFID_PID_LIST) final String pIdPIdArrayString, 131 @NotNull final Personne personne ) 132 throws ServiceException, WebException 133 { 134 final JSONObject result = new JSONObject(); 135 136 final List<Pair<String, String>> pfIdPIdList = EtherHelper.extractpfIdPIdListFromString( pIdPIdArrayString, String.class, String.class ); 137 if( null == pfIdPIdList ) 138 throw new WebException( WebException.WebCode.PLATEFORM_OR_PARAMETER_IS_NULL, null ); 139 140 final DatasForm dataForm = createDataForm( dateBegin, dateEnd, pfIdPIdList ); 141 142 final XMLOutputter outXml = new XMLOutputter(); 143 final Document docXml = Requete.toXml( dataForm, personne ); 144 final String requete = outXml.outputString( docXml ); 145 try 146 { 147 final String encoded = "requete=" + URLEncoder.encode( requete, "UTF-8" ); 148 // Configuration de l'URL 149 final String urlCGIStr = (String) this.getServletContext().getAttribute( "APP_CGI" ); 150 final URL urlCGI = new URL( urlCGIStr ); 151 final URLConnection conn = urlCGI.openConnection(); 152 conn.setDoOutput( true ); 153 conn.setUseCaches( false ); 154 conn.setRequestProperty( "content-type", "application/x-www-form-urlencoded" ); 155 156 // Envoi de la requête 157 final DataOutputStream out = new DataOutputStream( conn.getOutputStream() ); 158 out.writeBytes( encoded ); 159 out.flush(); 160 out.close(); 161 162 // Réponse du CGI 163 final BufferedReader in = new BufferedReader( new InputStreamReader( conn.getInputStream() ) ); 164 String aLine; 165 while( ( aLine = in.readLine() ) != null ) 166 { 167 if( aLine.length() == 0 ) continue; 168 if( aLine.startsWith( "1" ) ) 169 { 170 System.err.println( "ERROR :" + aLine ); 171 } 172 else System.out.println( "REPONSE :" + aLine ); 173 } 174 } 175 catch( Exception e ) 176 { 177 result.put( ParameterConstants.PARAMETER_RESULT, ParameterConstants.PARAMETER_NOT_OK ); 178 return result; 179 } 180 181 result.put( ParameterConstants.PARAMETER_RESULT, ParameterConstants.PARAMETER_OK ); 182 return result; 183 } 184 185 /** 186 * This method create a dataForms to simulate and use the struts actions "DataAccessAction" and "DataSubmitAction" 187 * 188 * @param dateBegin 189 * @param dateEnd 190 * @param pfIdPIdList 191 * @return 192 * @throws WebException 193 */ 194 @NotNull 195 private DatasForm createDataForm( final String dateBegin, final String dateEnd, final List<Pair<String, String>> pfIdPIdList ) 196 throws WebException 197 { 198 final DatasForm dataForm = new DatasForm(); 199 200 // Plateforms and parameters 201 final List<String> plateformIds = EtherHelper.getFirstValues( pfIdPIdList ); 202 final List<String> parameterIds = EtherHelper.getSecondValues( pfIdPIdList ); 203 dataForm.setSelectPlats( plateformIds.toArray( new String[plateformIds.size()] ) ); 204 dataForm.setSelectParams( parameterIds.toArray( new String[parameterIds.size()] ) ); 205 206 // Localisations 207 final MesureAdapter mAdapter = new MesureAdapter(); 208 mAdapter.loadLocsFromDatabase( dataForm ); 209 210 // Dates 211 final Calendar calendar = Calendar.getInstance(); 212 String formatedDateBegin = null; 213 String formatedDateEnd = null; 214 if( null != dateBegin && null != dateEnd && !"false".equals( dateBegin ) && !"false".equals( dateEnd ) ) 215 { 216 try 217 { 218 calendar.setTimeInMillis( Long.valueOf( dateBegin ) ); 219 formatedDateBegin = DateHelper.formatDate( calendar.getTime(), DateHelper.FRENCH_DATE_PATTERN ); 220 calendar.setTimeInMillis( Long.valueOf( dateEnd ) ); 221 formatedDateEnd = DateHelper.formatDate( calendar.getTime(), DateHelper.FRENCH_DATE_PATTERN ); 222 dataForm.setDateDeb( formatedDateBegin ); 223 dataForm.setDateFin( formatedDateEnd ); 224 } 225 catch( Exception e ) 226 { 227 throw new WebException( WebException.WebCode.INVALID_DATE, e ); 228 } 229 } 230 else 231 mAdapter.loadDatesFromDatabase( dataForm ); 232 233 // Fill dataForm 234 final ValeurAdapter vAdapter = new ValeurAdapter(); 235 vAdapter.loadCountFromDatabase( dataForm ); 236 dataForm.setListeCoords( dataForm.getLatMin() + "," + dataForm.getLatMax() + "," + dataForm.getLonMin() + "," + dataForm.getLonMax() ); 237 dataForm.setListeDates( dataForm.getDateDeb() + "," + dataForm.getDateFin() ); 238 dataForm.setOutput( FORMAT_DEFAULT ); 239 dataForm.setCompression( COMPRESSION_DEFAULT ); 240 241 return dataForm; 242 } 243 244 private List<JSONObject> getJSONAxeTypesForFixedPlateforms() 245 { 246 final AxeTypeForFixedPlateform[] axeTypes = AxeTypeForFixedPlateform.values(); 247 248 final List<JSONObject> jsonAxeTypes = new ArrayList<JSONObject>( axeTypes.length ); 249 250 for( final AxeTypeForFixedPlateform axeType : axeTypes ) 251 { 252 final JSONObject jsonAxeType = new JSONObject(); 253 jsonAxeType.put( "text", axeType.name() ); 254 jsonAxeType.put( "value", axeType.name() ); 255 jsonAxeTypes.add( jsonAxeType ); 256 } 257 return jsonAxeTypes; 258 } 259 260 private List<JSONObject> getJSONAxeTypesForMobilePlateforms() 261 { 262 final AxeTypeForMobilePlateform[] axeTypes = AxeTypeForMobilePlateform.values(); 263 264 final List<JSONObject> jsonAxeTypes = new ArrayList<JSONObject>( axeTypes.length ); 265 266 for( final AxeTypeForMobilePlateform axeType : axeTypes ) 267 { 268 final JSONObject jsonAxeType = new JSONObject(); 269 jsonAxeType.put( "text", axeType.name() ); 270 jsonAxeType.put( "value", axeType.name() ); 271 jsonAxeTypes.add( jsonAxeType ); 272 } 273 return jsonAxeTypes; 274 } 275 276 @Required 277 public void setEtherService( @NotNull final EtherService etherService ) 278 { 279 _etherService = etherService; 280 } 281 282 private static final Log LOGGER = LogFactory.getLog( Controller.class ); 283 284 private static final String VIEW_WORK = "visualization/inWork"; 285 private static final String VIEW_VISUALIZATION = "visualization/visu"; 286 private static final String VIEW_VISUALIZATION_PARAMETER_BY_PLATEFORM = "visualization/visu_parameter_by_pf"; 287 private static final String VIEW_DOWNLOAD_OK = "data/access/extract3"; 288 289 private static final String FORMAT_DEFAULT = "NASA-AMES"; 290 private static final String COMPRESSION_DEFAULT = "None"; 291 private EtherService _etherService; 61 private static final String VIEW_CATALOG = "data/access"; 62 private static final String VIEW_SETS = "data/jeux"; 63 private static final String VIEW_PARAMETERS = "data/param"; 64 private static final String VIEW_SENSORS = "data/capt"; 65 private static final String VIEW_PLATEFORMS = "data/plat"; 292 66 } -
ether_megapoli/trunk/web/src/com/ether/ControllerVisualization.java
r244 r246 39 39 * @date 17 feb 2011 40 40 */ 41 public class Controller 41 public class ControllerVisualization 42 42 extends ControllerEther 43 43 { … … 280 280 } 281 281 282 private static final Log LOGGER = LogFactory.getLog( Controller .class );282 private static final Log LOGGER = LogFactory.getLog( ControllerVisualization.class ); 283 283 284 284 private static final String VIEW_WORK = "visualization/inWork"; -
ether_megapoli/trunk/web/visualization/visu_parameter_by_pf-classes.jsp
r241 r246 51 51 this.createContainer( "containerParameter", "containerParameter " + className ); 52 52 this.addNameWithMenus( "parameter_name" ); 53 // this.addCode( "parameter_code" );54 53 this.appendContainer( parentNode ); 55 54 this.addObservers(); … … 65 64 this.unselectWithParameter( "parameter_selected" ); 66 65 } 67 68 // addCode: function ( classNameValue )69 // {70 // if( !this.divContainer )71 // return;72 //73 // this.divName = $( document.createElement( "div" ) );74 // this.divName.className = classNameValue;75 // this.divName.innerHTML = " (" + this.jsonElement.code + ")";76 //77 // this.divContainer.appendChild( this.divName );78 // }79 66 } ); 80 67 </script>
Note: See TracChangeset
for help on using the changeset viewer.