dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #00576
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 161: Added skeleton dhis-web-mapping project in gis folder in trunk.
------------------------------------------------------------
revno: 161
committer: Lars Helge Oeverland larshelge@xxxxxxxxx
branch nick: trunk
timestamp: Tue 2009-04-07 15:22:12 +0200
message:
Added skeleton dhis-web-mapping project in gis folder in trunk.
added:
gis/dhis-web-mapping/
gis/dhis-web-mapping/pom.xml
gis/dhis-web-mapping/src/
gis/dhis-web-mapping/src/main/
gis/dhis-web-mapping/src/main/java/
gis/dhis-web-mapping/src/main/java/org/
gis/dhis-web-mapping/src/main/java/org/hisp/
gis/dhis-web-mapping/src/main/java/org/hisp/dhis/
gis/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/
gis/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/
gis/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/GetOrganisationUnitLevelsAction.java
gis/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/NoAction.java
gis/dhis-web-mapping/src/main/resources/
gis/dhis-web-mapping/src/main/resources/META-INF/
gis/dhis-web-mapping/src/main/resources/META-INF/dhis/
gis/dhis-web-mapping/src/main/resources/META-INF/dhis/beans.xml
gis/dhis-web-mapping/src/main/resources/xwork.xml
gis/dhis-web-mapping/src/main/webapp/
gis/dhis-web-mapping/src/main/webapp/WEB-INF/
gis/dhis-web-mapping/src/main/webapp/WEB-INF/web.xml
gis/dhis-web-mapping/src/main/webapp/dhis-web-mapping/
gis/dhis-web-mapping/src/main/webapp/dhis-web-mapping/index.vm
gis/dhis-web-mapping/src/main/webapp/dhis-web-mapping/jsonOrganisationUnitLevels.vm
modified:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/mapping/Map.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/mapping/MapOrganisationUnitRelation.java
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/mapping/Map.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/mapping/Map.java 2009-04-06 18:55:31 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/mapping/Map.java 2009-04-07 13:22:12 +0000
@@ -37,7 +37,6 @@
* @author Jan Henrik Overland
* @version $Id$
*/
-
public class Map
{
private int id;
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/mapping/MapOrganisationUnitRelation.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/mapping/MapOrganisationUnitRelation.java 2009-04-06 18:55:31 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/mapping/MapOrganisationUnitRelation.java 2009-04-07 13:22:12 +0000
@@ -33,7 +33,6 @@
* @author Jan Henrik Overland
* @version $Id$
*/
-
public class MapOrganisationUnitRelation
{
private int id;
@@ -59,15 +58,6 @@
// hashCode, equals and toString
// -------------------------------------------------------------------------
- // -------------------------------------------------------------------------
- // Getters and setters
- // -------------------------------------------------------------------------
-
- public int getId()
- {
- return id;
- }
-
@Override
public int hashCode()
{
@@ -75,7 +65,6 @@
int result = 1;
- result = prime * result + ( ( featureId == null ) ? 0 : featureId.hashCode() );
result = prime * result + ( ( map == null ) ? 0 : map.hashCode() );
result = prime * result + ( ( organisationUnit == null ) ? 0 : organisationUnit.hashCode() );
@@ -83,37 +72,35 @@
}
@Override
- public boolean equals( Object obj )
+ public boolean equals( Object object )
{
- if ( this == obj )
+ if ( this == object )
+ {
return true;
- if ( obj == null )
- return false;
- if ( getClass() != obj.getClass() )
- return false;
- MapOrganisationUnitRelation other = ( MapOrganisationUnitRelation ) obj;
- if ( featureId == null )
- {
- if ( other.featureId != null )
- return false;
- }
- else if ( !featureId.equals( other.featureId ) )
- return false;
- if ( map == null )
- {
- if ( other.map != null )
- return false;
- }
- else if ( !map.equals( other.map ) )
- return false;
- if ( organisationUnit == null )
- {
- if ( other.organisationUnit != null )
- return false;
- }
- else if ( !organisationUnit.equals( other.organisationUnit ) )
- return false;
- return true;
+ }
+
+ if ( object == null )
+ {
+ return false;
+ }
+
+ if ( getClass() != object.getClass() )
+ {
+ return false;
+ }
+
+ final MapOrganisationUnitRelation other = ( MapOrganisationUnitRelation ) object;
+
+ return map.equals( other.map ) && organisationUnit.equals( other.organisationUnit );
+ }
+
+ // -------------------------------------------------------------------------
+ // Getters and setters
+ // -------------------------------------------------------------------------
+
+ public int getId()
+ {
+ return id;
}
public void setId( int id )
=== added directory 'gis/dhis-web-mapping'
=== added file 'gis/dhis-web-mapping/pom.xml'
--- gis/dhis-web-mapping/pom.xml 1970-01-01 00:00:00 +0000
+++ gis/dhis-web-mapping/pom.xml 2009-04-07 13:22:12 +0000
@@ -0,0 +1,84 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.hisp.dhis</groupId>
+ <artifactId>dhis-web</artifactId>
+ <version>2.0.1-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>dhis-web-mapping</artifactId>
+ <packaging>war</packaging>
+ <name>DHIS Mapping</name>
+
+ <build>
+ <finalName>dhis-web-mapping</finalName>
+ </build>
+
+ <dependencies>
+
+ <!-- DHIS -->
+
+ <dependency>
+ <groupId>org.hisp.dhis</groupId>
+ <artifactId>dhis-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.hisp.dhis</groupId>
+ <artifactId>dhis-support-system</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.hisp.dhis</groupId>
+ <artifactId>dhis-service-core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.hisp.dhis</groupId>
+ <artifactId>dhis-service-organisationunit</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.hisp.dhis</groupId>
+ <artifactId>dhis-service-mapping</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.hisp.dhis</groupId>
+ <artifactId>dhis-options</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.hisp.dhis</groupId>
+ <artifactId>dhis-web-commons</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.hisp.dhis</groupId>
+ <artifactId>dhis-web-commons-resources</artifactId>
+ <type>war</type>
+ </dependency>
+
+ <!-- Web -->
+
+ <dependency>
+ <groupId>com.opensymphony</groupId>
+ <artifactId>webwork</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>commons-fileupload</groupId>
+ <artifactId>commons-fileupload</artifactId>
+ </dependency>
+
+ <!-- Other -->
+
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>ognl</groupId>
+ <artifactId>ognl</artifactId>
+ </dependency>
+ </dependencies>
+</project>
=== added directory 'gis/dhis-web-mapping/src'
=== added directory 'gis/dhis-web-mapping/src/main'
=== added directory 'gis/dhis-web-mapping/src/main/java'
=== added directory 'gis/dhis-web-mapping/src/main/java/org'
=== added directory 'gis/dhis-web-mapping/src/main/java/org/hisp'
=== added directory 'gis/dhis-web-mapping/src/main/java/org/hisp/dhis'
=== added directory 'gis/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping'
=== added directory 'gis/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action'
=== added file 'gis/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/GetOrganisationUnitLevelsAction.java'
--- gis/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/GetOrganisationUnitLevelsAction.java 1970-01-01 00:00:00 +0000
+++ gis/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/GetOrganisationUnitLevelsAction.java 2009-04-07 13:22:12 +0000
@@ -0,0 +1,77 @@
+package org.hisp.dhis.mapping.action;
+
+/*
+ * Copyright (c) 2004-2007, University of Oslo
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ * * Neither the name of the HISP project nor the names of its contributors may
+ * be used to endorse or promote products derived from this software without
+ * specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import java.util.List;
+
+import org.hisp.dhis.organisationunit.OrganisationUnitLevel;
+import org.hisp.dhis.organisationunit.OrganisationUnitService;
+
+import com.opensymphony.xwork.Action;
+
+/**
+ * @author Jan Henrik Oeverland
+ * @version $Id$
+ */
+public class GetOrganisationUnitLevelsAction
+ implements Action
+{
+ // -------------------------------------------------------------------------
+ // Dependencies
+ // -------------------------------------------------------------------------
+
+ private OrganisationUnitService organisationUnitService;
+
+ public void setOrganisationUnitService( OrganisationUnitService organisationUnitService )
+ {
+ this.organisationUnitService = organisationUnitService;
+ }
+
+ // -------------------------------------------------------------------------
+ // Output
+ // -------------------------------------------------------------------------
+
+ private List<OrganisationUnitLevel> object;
+
+ public List<OrganisationUnitLevel> getObject()
+ {
+ return object;
+ }
+
+ // -------------------------------------------------------------------------
+ // Action implementation
+ // -------------------------------------------------------------------------
+
+ public String execute()
+ throws Exception
+ {
+ object = organisationUnitService.getOrganisationUnitLevels();
+
+ return SUCCESS;
+ }
+}
=== added file 'gis/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/NoAction.java'
--- gis/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/NoAction.java 1970-01-01 00:00:00 +0000
+++ gis/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/NoAction.java 2009-04-07 13:22:12 +0000
@@ -0,0 +1,43 @@
+package org.hisp.dhis.mapping.action;
+
+/*
+ * Copyright (c) 2004-2007, University of Oslo
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ * * Neither the name of the HISP project nor the names of its contributors may
+ * be used to endorse or promote products derived from this software without
+ * specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import com.opensymphony.xwork.Action;
+
+/**
+ * @author Lars Helge Overland
+ * @version $Id: NoAction.java 3229 2007-04-10 17:41:29Z stianast $
+ */
+public class NoAction
+ implements Action
+{
+ public String execute()
+ {
+ return SUCCESS;
+ }
+}
=== added directory 'gis/dhis-web-mapping/src/main/resources'
=== added directory 'gis/dhis-web-mapping/src/main/resources/META-INF'
=== added directory 'gis/dhis-web-mapping/src/main/resources/META-INF/dhis'
=== added file 'gis/dhis-web-mapping/src/main/resources/META-INF/dhis/beans.xml'
--- gis/dhis-web-mapping/src/main/resources/META-INF/dhis/beans.xml 1970-01-01 00:00:00 +0000
+++ gis/dhis-web-mapping/src/main/resources/META-INF/dhis/beans.xml 2009-04-07 13:22:12 +0000
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
+
+ <bean id="org.hisp.dhis.mapping.action.NoAction"
+ class="org.hisp.dhis.mapping.action.NoAction"
+ scope="prototype"/>
+
+ <bean id="org.hisp.dhis.mapping.action.GetOrganisationUnitLevelsAction"
+ class="org.hisp.dhis.mapping.action.GetOrganisationUnitLevelsAction"
+ scope="prototype">
+ <property name="organisationUnitService"
+ ref="org.hisp.dhis.organisationunit.OrganisationUnitService"/>
+ </bean>
+
+</beans>
=== added file 'gis/dhis-web-mapping/src/main/resources/xwork.xml'
--- gis/dhis-web-mapping/src/main/resources/xwork.xml 1970-01-01 00:00:00 +0000
+++ gis/dhis-web-mapping/src/main/resources/xwork.xml 2009-04-07 13:22:12 +0000
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE xwork PUBLIC "-//OpenSymphony Group//XWork 1.0//EN"
+ "http://www.opensymphony.com/xwork/xwork-1.0.dtd">
+<xwork>
+ <include file="dhis-web-commons.xml"/>
+
+ <package name="dhis-web-mapping" extends="dhis-web-commons"
+ namespace="/dhis-web-mapping">
+
+ <action name="index" class="org.hisp.dhis.mapping.action.NoAction">
+ <result name="success" type="velocity">/main.vm</result>
+ <param name="page">/dhis-web-mapping/index.vm</param>
+ </action>
+
+ <action name="getOrganisationUnitLevels" class="org.hisp.dhis.mapping.action.GetOrganisationUnitLevelsAction">
+ <result name="success" type="velocity-json">/dhis-web-mapping/jsonOrganisationUnitLevels.vm</result>
+ </action>
+
+ </package>
+</xwork>
=== added directory 'gis/dhis-web-mapping/src/main/webapp'
=== added directory 'gis/dhis-web-mapping/src/main/webapp/WEB-INF'
=== added file 'gis/dhis-web-mapping/src/main/webapp/WEB-INF/web.xml'
--- gis/dhis-web-mapping/src/main/webapp/WEB-INF/web.xml 1970-01-01 00:00:00 +0000
+++ gis/dhis-web-mapping/src/main/webapp/WEB-INF/web.xml 2009-04-07 13:22:12 +0000
@@ -0,0 +1,68 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+ "http://java.sun.com/dtd/web-app_2_3.dtd">
+<web-app>
+ <display-name>DHIS Mapping</display-name>
+
+ <context-param>
+ <param-name>contextConfigLocation</param-name>
+ <param-value>classpath*:/META-INF/dhis/beans.xml</param-value>
+ </context-param>
+ <context-param>
+ <param-name>automaticAccessType</param-name>
+ <param-value>ghostAdmin</param-value>
+ </context-param>
+
+ <filter>
+ <filter-name>RedirectFilter</filter-name>
+ <filter-class>org.hisp.dhis.servlet.filter.HttpRedirectFilter</filter-class>
+ <init-param>
+ <param-name>redirectPath</param-name>
+ <param-value>dhis-web-mapping/index.action</param-value>
+ </init-param>
+ </filter>
+ <filter>
+ <filter-name>OpenSessionInViewFilter</filter-name>
+ <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
+ <init-param>
+ <param-name>targetBeanName</param-name>
+ <param-value>org.hisp.dhis.servlet.filter.OpenSessionInViewFilter</param-value>
+ </init-param>
+ </filter>
+ <filter>
+ <filter-name>SecurityFilterChain</filter-name>
+ <filter-class>org.acegisecurity.util.FilterToBeanProxy</filter-class>
+ <init-param>
+ <param-name>targetBean</param-name>
+ <param-value>org.acegisecurity.util.FilterChainProxy</param-value>
+ </init-param>
+ </filter>
+ <filter>
+ <filter-name>WebWork</filter-name>
+ <filter-class>com.opensymphony.webwork.dispatcher.FilterDispatcher</filter-class>
+ </filter>
+
+ <filter-mapping>
+ <filter-name>RedirectFilter</filter-name>
+ <url-pattern>/</url-pattern>
+ </filter-mapping>
+ <filter-mapping>
+ <filter-name>OpenSessionInViewFilter</filter-name>
+ <url-pattern>*.action</url-pattern>
+ </filter-mapping>
+ <filter-mapping>
+ <filter-name>SecurityFilterChain</filter-name>
+ <url-pattern>/*</url-pattern>
+ </filter-mapping>
+ <filter-mapping>
+ <filter-name>WebWork</filter-name>
+ <url-pattern>*.action</url-pattern>
+ </filter-mapping>
+
+ <listener>
+ <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
+ </listener>
+ <listener>
+ <listener-class>org.hisp.dhis.system.startup.StartupListener</listener-class>
+ </listener>
+</web-app>
=== added directory 'gis/dhis-web-mapping/src/main/webapp/dhis-web-mapping'
=== added file 'gis/dhis-web-mapping/src/main/webapp/dhis-web-mapping/index.vm'
--- gis/dhis-web-mapping/src/main/webapp/dhis-web-mapping/index.vm 1970-01-01 00:00:00 +0000
+++ gis/dhis-web-mapping/src/main/webapp/dhis-web-mapping/index.vm 2009-04-07 13:22:12 +0000
@@ -0,0 +1,2 @@
+
+<h3>Welcome to GIS</h3>
\ No newline at end of file
=== added file 'gis/dhis-web-mapping/src/main/webapp/dhis-web-mapping/jsonOrganisationUnitLevels.vm'
--- gis/dhis-web-mapping/src/main/webapp/dhis-web-mapping/jsonOrganisationUnitLevels.vm 1970-01-01 00:00:00 +0000
+++ gis/dhis-web-mapping/src/main/webapp/dhis-web-mapping/jsonOrganisationUnitLevels.vm 2009-04-07 13:22:12 +0000
@@ -0,0 +1,10 @@
+#set( $size = $object.size() )
+{ "organisationUnitLevels": [
+#foreach ( $level in $object )
+ {
+ "id": $!{level.id},
+ "level": $!{level.level},
+ "name": "$!{level.name}"
+ }#if( $velocityCount < $size ),#end
+#end
+] }
\ No newline at end of file
--
Trunk
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk
Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription.