=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/DataValueSetController.java' --- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/DataValueSetController.java 2012-01-06 09:25:10 +0000 +++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/DataValueSetController.java 2012-01-11 09:02:20 +0000 @@ -29,19 +29,19 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.hisp.dhis.api.webdomain.DataValueSets; import org.hisp.dhis.importexport.dxf2.model.DataValueSet; import org.hisp.dhis.importexport.dxf2.service.DataValueSetService; import org.hisp.dhis.organisationunit.OrganisationUnit; -import org.hisp.dhis.system.velocity.VelocityManager; import org.hisp.dhis.user.User; import org.hisp.dhis.user.UserService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletResponse; import java.io.IOException; -import java.io.Writer; import java.util.Collection; @Controller @@ -59,11 +59,11 @@ private UserService userService; @RequestMapping( method = RequestMethod.GET ) - public void getDataValueSet( Writer writer ) throws Exception + public String getDataValueSet( Model model ) throws Exception { - VelocityManager velocityManager = new VelocityManager(); - String str = velocityManager.render( "/templates/html/dataValueSet" ); - writer.write( str ); + model.addAttribute( "model", new DataValueSets() ); + + return "dataValueSets"; } @RequestMapping( method = RequestMethod.POST ) === added file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/webdomain/DataValueSets.java' --- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/webdomain/DataValueSets.java 1970-01-01 00:00:00 +0000 +++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/webdomain/DataValueSets.java 2012-01-11 09:02:20 +0000 @@ -0,0 +1,63 @@ +/* +* Copyright (c) 2004-2012, 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. +*/ + +package org.hisp.dhis.api.webdomain; + +import org.codehaus.jackson.annotate.JsonProperty; +import org.codehaus.jackson.map.annotate.JsonSerialize; +import org.hisp.dhis.common.BaseIdentifiableObject; +import org.hisp.dhis.common.Dxf2Namespace; +import org.hisp.dhis.common.adapter.DataElementXmlAdapter; +import org.hisp.dhis.importexport.dxf2.model.DataValueSet; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; +import java.util.ArrayList; +import java.util.List; + +/** + * @author Morten Olav Hansen + */ +@XmlRootElement( name = "dataValueSets", namespace = Dxf2Namespace.NAMESPACE ) +@XmlAccessorType( value = XmlAccessType.NONE ) +public class DataValueSets +{ + private List dataValueSets = new ArrayList(); + + public List getDataValueSets() + { + return dataValueSets; + } + + public void setDataValueSets( List dataValueSets ) + { + this.dataValueSets = dataValueSets; + } +} === removed file 'dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/dataValueSet.vm' --- dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/dataValueSet.vm 2012-01-06 09:47:59 +0000 +++ dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/dataValueSet.vm 1970-01-01 00:00:00 +0000 @@ -1,33 +0,0 @@ - -The DataValueSet resource gives you a mean to POST dataValues into DHIS 2. - -It needs a phoneNumber as the query string, this will be matched against the phoneNumber for the users -in the system, and the dataValues will be added to their orgUnit. - -The supported format is XML, and the root dataValueSet is declared with the following attributes - -dataSet - The UID of the dataset to report on -period - The period to report on -orgUnit - The UID of organisation unit to report on - -The actual dataValues are sent with a format matching this - - - - - - - - - -So, a complete example would be: - - - - - - - - - - === added file 'dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/dataValueSets.xsl' --- dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/dataValueSets.xsl 1970-01-01 00:00:00 +0000 +++ dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/dataValueSets.xsl 2012-01-11 09:02:20 +0000 @@ -0,0 +1,50 @@ + + + + + + +
+    
+    
+    
+    
+    
+    
+
+
+So, a complete example would be:
+
+
+    
+        
+        
+        
+        
+        
+    
+
+    ]]>
+    
+ +
+ +
=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/list.xsl' --- dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/list.xsl 2011-12-21 11:37:17 +0000 +++ dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/list.xsl 2012-01-11 09:02:20 +0000 @@ -12,7 +12,8 @@ d:organisationUnits|d:dataElementGroups|d:dataElementGroupSets|d:dataSets| d:documents|d:indicatorGroups|d:indicatorGroupSets|d:organisationUnitGroups| d:organisationUnitGroupSets|d:indicatorTypes|d:attributeTypes|d:reports|d:constants| - d:sqlViews|d:validationRules|d:validationRuleGroups|d:users|d:userGroups|d:reportTables"> + d:sqlViews|d:validationRules|d:validationRuleGroups|d:users|d:userGroups|d:reportTables| + d:dataValueSets"> === modified file 'dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/model2html.xsl' --- dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/model2html.xsl 2011-12-21 11:37:17 +0000 +++ dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/model2html.xsl 2012-01-11 09:02:20 +0000 @@ -44,6 +44,7 @@ +