=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/attribute/Attribute.java' --- dhis-2/dhis-api/src/main/java/org/hisp/dhis/attribute/Attribute.java 2011-12-06 19:19:40 +0000 +++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/attribute/Attribute.java 2011-12-06 21:57:53 +0000 @@ -41,7 +41,7 @@ /** * @author mortenoh */ -@XmlRootElement( name = "attribute", namespace = Dxf2Namespace.NAMESPACE ) +@XmlRootElement( name = "attributeType", namespace = Dxf2Namespace.NAMESPACE ) @XmlAccessorType( value = XmlAccessType.NONE ) public class Attribute extends BaseIdentifiableObject { === modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/attribute/AttributeValue.java' --- dhis-2/dhis-api/src/main/java/org/hisp/dhis/attribute/AttributeValue.java 2011-12-06 19:52:58 +0000 +++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/attribute/AttributeValue.java 2011-12-06 21:57:53 +0000 @@ -28,22 +28,18 @@ package org.hisp.dhis.attribute; import org.codehaus.jackson.annotate.JsonProperty; -import org.codehaus.jackson.map.annotate.JsonSerialize; import org.hisp.dhis.common.Dxf2Namespace; -import org.hisp.dhis.common.adapter.BaseIdentifiableObjectXmlAdapter; -import org.hisp.dhis.common.adapter.JsonIdentifiableObjectSerializer; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; import java.io.Serializable; /** * @author mortenoh */ -@XmlRootElement( name = "attributeValue", namespace = Dxf2Namespace.NAMESPACE ) +@XmlRootElement( name = "attribute", namespace = Dxf2Namespace.NAMESPACE ) @XmlAccessorType( value = XmlAccessType.NONE ) public class AttributeValue implements Serializable @@ -79,9 +75,24 @@ this.id = id; } - @XmlElement( name = "attribute" ) - @XmlJavaTypeAdapter( BaseIdentifiableObjectXmlAdapter.class ) - @JsonSerialize( using = JsonIdentifiableObjectSerializer.class ) + @XmlAttribute + @JsonProperty + public String getAttributeTypeRef() + { + return attribute.getUid(); + } + + @XmlAttribute( name = "name" ) + @JsonProperty( value = "name" ) + public String getAttributeName() + { + return attribute.getName(); + } + + /* @XmlElement( name = "attributeType" ) +@XmlJavaTypeAdapter( BaseIdentifiableObjectXmlAdapter.class ) +@JsonSerialize( using = JsonIdentifiableObjectSerializer.class ) +@JsonProperty( value = "attributeType" ) */ public Attribute getAttribute() { return attribute; @@ -92,7 +103,7 @@ this.attribute = attribute; } - @XmlElement + @XmlAttribute @JsonProperty public String getValue() { === modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/attribute/Attributes.java' --- dhis-2/dhis-api/src/main/java/org/hisp/dhis/attribute/Attributes.java 2011-12-03 14:31:45 +0000 +++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/attribute/Attributes.java 2011-12-06 21:57:53 +0000 @@ -41,14 +41,14 @@ /** * @author Morten Olav Hansen */ -@XmlRootElement( name = "attributes", namespace = Dxf2Namespace.NAMESPACE ) +@XmlRootElement( name = "attributeTypes", namespace = Dxf2Namespace.NAMESPACE ) @XmlAccessorType( value = XmlAccessType.NONE ) public class Attributes extends BaseLinkableObject { private List attributes = new ArrayList(); - @XmlElement( name = "attribute" ) - @JsonProperty( value = "attributes" ) + @XmlElement( name = "attributeType" ) + @JsonProperty( value = "attributeTypes" ) public List getAttributes() { return attributes; === modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElement.java' --- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElement.java 2011-12-06 22:23:13 +0000 +++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElement.java 2011-12-07 13:32:36 +0000 @@ -531,8 +531,9 @@ this.numberType = numberType; } - @XmlElementWrapper( name = "attributeValues" ) - @XmlElement( name = "attributeValue" ) + @XmlElementWrapper( name = "attributes" ) + @XmlElement( name = "attribute" ) + @JsonProperty( value = "attributes" ) @JsonSerialize( using = JsonCollectionSerializer.class ) public Set getAttributeValues() { === modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategories.java' --- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategories.java 2011-12-03 14:31:45 +0000 +++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategories.java 2011-12-07 12:27:51 +0000 @@ -1,5 +1,32 @@ package org.hisp.dhis.dataelement; +/* + * Copyright (c) 2004-2011, 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 org.codehaus.jackson.annotate.JsonProperty; import org.hisp.dhis.common.BaseLinkableObject; import org.hisp.dhis.common.Dxf2Namespace; @@ -14,21 +41,21 @@ /** * @author Morten Olav Hansen */ -@XmlRootElement( name = "dataElementCategories", namespace = Dxf2Namespace.NAMESPACE ) +@XmlRootElement( name = "categories", namespace = Dxf2Namespace.NAMESPACE ) @XmlAccessorType( value = XmlAccessType.NONE ) public class DataElementCategories extends BaseLinkableObject { - private List dataElementCategories = new ArrayList(); + private List categories = new ArrayList(); - @XmlElement( name = "dataElementCategory" ) - @JsonProperty( value = "dataElementCategories" ) - public List getDataElementCategories() + @XmlElement( name = "category" ) + @JsonProperty( value = "categories" ) + public List getCategories() { - return dataElementCategories; + return categories; } - public void setDataElementCategories( List dataElementCategories ) + public void setCategories( List categories ) { - this.dataElementCategories = dataElementCategories; + this.categories = categories; } } === modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategory.java' --- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategory.java 2011-12-06 19:52:58 +0000 +++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategory.java 2011-12-07 12:27:51 +0000 @@ -47,7 +47,7 @@ * * @author Abyot Asalefew */ -@XmlRootElement( name = "dataElementCategory", namespace = Dxf2Namespace.NAMESPACE ) +@XmlRootElement( name = "category", namespace = Dxf2Namespace.NAMESPACE ) @XmlAccessorType( value = XmlAccessType.NONE ) public class DataElementCategory extends BaseIdentifiableObject { === modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategoryCombo.java' --- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategoryCombo.java 2011-12-06 19:52:58 +0000 +++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategoryCombo.java 2011-12-07 12:27:51 +0000 @@ -41,7 +41,7 @@ /** * @author Abyot Aselefew */ -@XmlRootElement( name = "dataElementCategoryCombo", namespace = Dxf2Namespace.NAMESPACE ) +@XmlRootElement( name = "categoryCombo", namespace = Dxf2Namespace.NAMESPACE ) @XmlAccessorType( value = XmlAccessType.NONE ) public class DataElementCategoryCombo extends BaseIdentifiableObject === modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategoryCombos.java' --- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategoryCombos.java 2011-12-03 14:31:45 +0000 +++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategoryCombos.java 2011-12-07 12:27:51 +0000 @@ -1,5 +1,32 @@ package org.hisp.dhis.dataelement; +/* + * Copyright (c) 2004-2011, 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 org.codehaus.jackson.annotate.JsonProperty; import org.hisp.dhis.common.BaseLinkableObject; import org.hisp.dhis.common.Dxf2Namespace; @@ -14,21 +41,21 @@ /** * @author Morten Olav Hansen */ -@XmlRootElement( name = "dataElementCategoryCombos", namespace = Dxf2Namespace.NAMESPACE ) +@XmlRootElement( name = "categoryCombos", namespace = Dxf2Namespace.NAMESPACE ) @XmlAccessorType( value = XmlAccessType.NONE ) public class DataElementCategoryCombos extends BaseLinkableObject { - private List dataElementCategoryCombos = new ArrayList(); + private List categoryCombos = new ArrayList(); - @XmlElement( name = "dataElementCategoryCombo" ) - @JsonProperty( value = "dataElementCategoryCombos" ) - public List getDataElementCategoryCombos() + @XmlElement( name = "categoryCombo" ) + @JsonProperty( value = "categoryCombos" ) + public List getCategoryCombos() { - return dataElementCategoryCombos; + return categoryCombos; } - public void setDataElementCategoryCombos( List dataElementCategoryCombos ) + public void setCategoryCombos( List categoryCombos ) { - this.dataElementCategoryCombos = dataElementCategoryCombos; + this.categoryCombos = categoryCombos; } } === modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategoryOption.java' --- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategoryOption.java 2011-12-06 19:52:58 +0000 +++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategoryOption.java 2011-12-07 12:27:51 +0000 @@ -42,7 +42,7 @@ /** * @author Abyot Asalefew */ -@XmlRootElement( name = "dataElementCategoryOption", namespace = Dxf2Namespace.NAMESPACE ) +@XmlRootElement( name = "categoryOption", namespace = Dxf2Namespace.NAMESPACE ) @XmlAccessorType( value = XmlAccessType.NONE ) public class DataElementCategoryOption extends BaseNameableObject { === modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategoryOptionCombo.java' --- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategoryOptionCombo.java 2011-12-06 19:52:58 +0000 +++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategoryOptionCombo.java 2011-12-07 12:27:51 +0000 @@ -44,7 +44,7 @@ /** * @author Abyot Aselefew */ -@XmlRootElement( name = "dataElementCategoryOptionCombo", namespace = Dxf2Namespace.NAMESPACE ) +@XmlRootElement( name = "categoryOptionCombo", namespace = Dxf2Namespace.NAMESPACE ) @XmlAccessorType( value = XmlAccessType.NONE ) public class DataElementCategoryOptionCombo extends BaseNameableObject { === modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategoryOptionCombos.java' --- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategoryOptionCombos.java 2011-12-03 14:31:45 +0000 +++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategoryOptionCombos.java 2011-12-07 12:27:51 +0000 @@ -1,5 +1,32 @@ package org.hisp.dhis.dataelement; +/* + * Copyright (c) 2004-2011, 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 org.codehaus.jackson.annotate.JsonProperty; import org.hisp.dhis.common.BaseLinkableObject; import org.hisp.dhis.common.Dxf2Namespace; @@ -14,21 +41,21 @@ /** * @author Morten Olav Hansen */ -@XmlRootElement( name = "dataElementCategoryOptionCombos", namespace = Dxf2Namespace.NAMESPACE ) +@XmlRootElement( name = "categoryOptionCombos", namespace = Dxf2Namespace.NAMESPACE ) @XmlAccessorType( value = XmlAccessType.NONE ) public class DataElementCategoryOptionCombos extends BaseLinkableObject { - private List dataElementCategoryOptionCombos = new ArrayList(); + private List categoryOptionCombos = new ArrayList(); - @XmlElement( name = "dataElementCategoryOptionCombo" ) - @JsonProperty( value = "dataElementCategoryOptionCombos" ) - public List getDataElementCategoryOptionCombos() + @XmlElement( name = "categoryOptionCombo" ) + @JsonProperty( value = "categoryOptionCombos" ) + public List getCategoryOptionCombos() { - return dataElementCategoryOptionCombos; + return categoryOptionCombos; } - public void setDataElementCategoryOptionCombos( List dataElementCategoryOptionCombos ) + public void setCategoryOptionCombos( List categoryOptionCombos ) { - this.dataElementCategoryOptionCombos = dataElementCategoryOptionCombos; + this.categoryOptionCombos = categoryOptionCombos; } } === modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategoryOptions.java' --- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategoryOptions.java 2011-12-03 14:31:45 +0000 +++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategoryOptions.java 2011-12-07 12:27:51 +0000 @@ -14,21 +14,21 @@ /** * @author Morten Olav Hansen */ -@XmlRootElement( name = "dataElementCategoryOptions", namespace = Dxf2Namespace.NAMESPACE ) +@XmlRootElement( name = "categoryOptions", namespace = Dxf2Namespace.NAMESPACE ) @XmlAccessorType( value = XmlAccessType.NONE ) public class DataElementCategoryOptions extends BaseLinkableObject { - private List dataElementCategoryOptions = new ArrayList(); + private List categoryOptions = new ArrayList(); - @XmlElement( name = "dataElementCategoryOption" ) - @JsonProperty( value = "dataElementCategoryOptions" ) - public List getDataElementCategoryOptions() + @XmlElement( name = "categoryOption" ) + @JsonProperty( value = "categoryOptions" ) + public List getCategoryOptions() { - return dataElementCategoryOptions; + return categoryOptions; } - public void setDataElementCategoryOptions( List dataElementCategoryOptions ) + public void setCategoryOptions( List categoryOptions ) { - this.dataElementCategoryOptions = dataElementCategoryOptions; + this.categoryOptions = categoryOptions; } } === modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/Indicator.java' --- dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/Indicator.java 2011-12-06 19:52:58 +0000 +++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/Indicator.java 2011-12-06 21:57:53 +0000 @@ -305,8 +305,9 @@ this.dataSets = dataSets; } - @XmlElementWrapper( name = "attributeValues" ) - @XmlElement( name = "attributeValue" ) + @XmlElementWrapper( name = "attributes" ) + @XmlElement( name = "attribute" ) + @JsonProperty( value = "attributes" ) @JsonSerialize( using = JsonCollectionSerializer.class ) public Set getAttributeValues() { === modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnit.java' --- dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnit.java 2011-12-06 19:52:58 +0000 +++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnit.java 2011-12-06 21:57:53 +0000 @@ -757,8 +757,9 @@ this.type = type; } - @XmlElementWrapper( name = "attributeValues" ) - @XmlElement( name = "attributeValue" ) + @XmlElementWrapper( name = "attributes" ) + @XmlElement( name = "attribute" ) + @JsonProperty( value = "attributes" ) @JsonSerialize( using = JsonCollectionSerializer.class ) public Set getAttributeValues() { === modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/User.java' --- dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/User.java 2011-12-06 19:52:58 +0000 +++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/User.java 2011-12-06 21:57:53 +0000 @@ -281,8 +281,9 @@ this.organisationUnits = organisationUnits; } - @XmlElementWrapper( name = "attributeValues" ) - @XmlElement( name = "attributeValue" ) + @XmlElementWrapper( name = "attributes" ) + @XmlElement( name = "attribute" ) + @JsonProperty( value = "attributes" ) @JsonSerialize( using = JsonCollectionSerializer.class ) public Set getAttributeValues() { === removed file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/adapter/MediaTypeCollecctionJsonSerializer.java' --- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/adapter/MediaTypeCollecctionJsonSerializer.java 2011-12-06 19:52:58 +0000 +++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/adapter/MediaTypeCollecctionJsonSerializer.java 1970-01-01 00:00:00 +0000 @@ -1,55 +0,0 @@ -package org.hisp.dhis.api.adapter; - -/* - * Copyright (c) 2004-2011, 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 org.codehaus.jackson.JsonGenerator; -import org.codehaus.jackson.map.JsonSerializer; -import org.codehaus.jackson.map.SerializerProvider; -import org.springframework.http.MediaType; - -import java.io.IOException; -import java.util.Collection; - -/** - * @author Morten Olav Hansen - */ -public class MediaTypeCollecctionJsonSerializer extends JsonSerializer> -{ - @Override - public void serialize( Collection mediaTypes, JsonGenerator jgen, SerializerProvider serializerProvider ) throws IOException - { - jgen.writeStartArray(); - - for ( MediaType mediaType : mediaTypes ) - { - jgen.writeString( mediaType.toString() ); - } - - jgen.writeEndArray(); - } -} === added file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/adapter/MediaTypeCollectionJsonSerializer.java' --- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/adapter/MediaTypeCollectionJsonSerializer.java 1970-01-01 00:00:00 +0000 +++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/adapter/MediaTypeCollectionJsonSerializer.java 2011-12-07 08:41:05 +0000 @@ -0,0 +1,55 @@ +package org.hisp.dhis.api.adapter; + +/* + * Copyright (c) 2004-2011, 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 org.codehaus.jackson.JsonGenerator; +import org.codehaus.jackson.map.JsonSerializer; +import org.codehaus.jackson.map.SerializerProvider; +import org.springframework.http.MediaType; + +import java.io.IOException; +import java.util.Collection; + +/** + * @author Morten Olav Hansen + */ +public class MediaTypeCollectionJsonSerializer extends JsonSerializer> +{ + @Override + public void serialize( Collection mediaTypes, JsonGenerator jgen, SerializerProvider serializerProvider ) throws IOException + { + jgen.writeStartArray(); + + for ( MediaType mediaType : mediaTypes ) + { + jgen.writeString( mediaType.toString() ); + } + + jgen.writeEndArray(); + } +} === added file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/CategoryComboController.java' --- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/CategoryComboController.java 1970-01-01 00:00:00 +0000 +++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/CategoryComboController.java 2011-12-07 12:27:51 +0000 @@ -0,0 +1,87 @@ +package org.hisp.dhis.api.controller; + +/* + * Copyright (c) 2004-2011, 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 org.hisp.dhis.api.utils.IdentifiableObjectParams; +import org.hisp.dhis.api.utils.WebLinkPopulator; +import org.hisp.dhis.dataelement.DataElementCategoryCombo; +import org.hisp.dhis.dataelement.DataElementCategoryCombos; +import org.hisp.dhis.dataelement.DataElementCategoryService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; + +import javax.servlet.http.HttpServletRequest; +import java.util.ArrayList; + +/** + * @author Morten Olav Hansen + */ +@Controller +@RequestMapping( value = "/categoryCombos" ) +public class CategoryComboController +{ + @Autowired + private DataElementCategoryService dataElementCategoryService; + + @RequestMapping( method = RequestMethod.GET ) + public String getCategoryCombos( IdentifiableObjectParams params, Model model, HttpServletRequest request ) + { + DataElementCategoryCombos categoryCombos = new DataElementCategoryCombos(); + categoryCombos.setCategoryCombos( new ArrayList( dataElementCategoryService.getAllDataElementCategoryCombos() ) ); + + if ( params.hasLinks() ) + { + WebLinkPopulator listener = new WebLinkPopulator( request ); + listener.addLinks( categoryCombos ); + } + + model.addAttribute( "model", categoryCombos ); + + return "categoryCombos"; + } + + @RequestMapping( value = "/{uid}", method = RequestMethod.GET ) + public String getCategoryCombo( @PathVariable( "uid" ) String uid, IdentifiableObjectParams params, Model model, HttpServletRequest request ) + { + DataElementCategoryCombo categoryCombo = dataElementCategoryService.getDataElementCategoryCombo( uid ); + + if ( params.hasLinks() ) + { + WebLinkPopulator listener = new WebLinkPopulator( request ); + listener.addLinks( categoryCombo ); + } + + model.addAttribute( "model", categoryCombo ); + + return "categoryCombo"; + } +} === added file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/CategoryController.java' --- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/CategoryController.java 1970-01-01 00:00:00 +0000 +++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/CategoryController.java 2011-12-07 12:27:51 +0000 @@ -0,0 +1,87 @@ +package org.hisp.dhis.api.controller; + +/* + * Copyright (c) 2004-2011, 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 org.hisp.dhis.api.utils.IdentifiableObjectParams; +import org.hisp.dhis.api.utils.WebLinkPopulator; +import org.hisp.dhis.dataelement.DataElementCategories; +import org.hisp.dhis.dataelement.DataElementCategory; +import org.hisp.dhis.dataelement.DataElementCategoryService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; + +import javax.servlet.http.HttpServletRequest; +import java.util.ArrayList; + +/** + * @author Morten Olav Hansen + */ +@Controller +@RequestMapping( value = "/categories" ) +public class CategoryController +{ + @Autowired + private DataElementCategoryService dataElementCategoryService; + + @RequestMapping( method = RequestMethod.GET ) + public String getCategories( IdentifiableObjectParams params, Model model, HttpServletRequest request ) + { + DataElementCategories categories = new DataElementCategories(); + categories.setCategories( new ArrayList( dataElementCategoryService.getAllDataElementCategories() ) ); + + if ( params.hasLinks() ) + { + WebLinkPopulator listener = new WebLinkPopulator( request ); + listener.addLinks( categories ); + } + + model.addAttribute( "model", categories ); + + return "categories"; + } + + @RequestMapping( value = "/{uid}", method = RequestMethod.GET ) + public String getCategory( @PathVariable( "uid" ) String uid, IdentifiableObjectParams params, Model model, HttpServletRequest request ) + { + DataElementCategory category = dataElementCategoryService.getDataElementCategory( uid ); + + if ( params.hasLinks() ) + { + WebLinkPopulator listener = new WebLinkPopulator( request ); + listener.addLinks( category ); + } + + model.addAttribute( "model", category ); + + return "category"; + } +} === added file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/CategoryOptionComboController.java' --- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/CategoryOptionComboController.java 1970-01-01 00:00:00 +0000 +++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/CategoryOptionComboController.java 2011-12-07 12:27:51 +0000 @@ -0,0 +1,87 @@ +package org.hisp.dhis.api.controller; + +/* + * Copyright (c) 2004-2011, 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 org.hisp.dhis.api.utils.IdentifiableObjectParams; +import org.hisp.dhis.api.utils.WebLinkPopulator; +import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo; +import org.hisp.dhis.dataelement.DataElementCategoryOptionCombos; +import org.hisp.dhis.dataelement.DataElementCategoryService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; + +import javax.servlet.http.HttpServletRequest; +import java.util.ArrayList; + +/** + * @author Morten Olav Hansen + */ +@Controller +@RequestMapping( value = "/categoryOptionCombos" ) +public class CategoryOptionComboController +{ + @Autowired + private DataElementCategoryService dataElementCategoryService; + + @RequestMapping( method = RequestMethod.GET ) + public String getCategoryOptionCombos( IdentifiableObjectParams params, Model model, HttpServletRequest request ) + { + DataElementCategoryOptionCombos categoryOptionCombos = new DataElementCategoryOptionCombos(); + categoryOptionCombos.setCategoryOptionCombos( new ArrayList( dataElementCategoryService.getAllDataElementCategoryOptionCombos() ) ); + + if ( params.hasLinks() ) + { + WebLinkPopulator listener = new WebLinkPopulator( request ); + listener.addLinks( categoryOptionCombos ); + } + + model.addAttribute( "model", categoryOptionCombos ); + + return "categoryOptionCombos"; + } + + @RequestMapping( value = "/{uid}", method = RequestMethod.GET ) + public String getCategoryOptionCombo( @PathVariable( "uid" ) String uid, IdentifiableObjectParams params, Model model, HttpServletRequest request ) + { + DataElementCategoryOptionCombo categoryOptionCombo = dataElementCategoryService.getDataElementCategoryOptionCombo( uid ); + + if ( params.hasLinks() ) + { + WebLinkPopulator listener = new WebLinkPopulator( request ); + listener.addLinks( categoryOptionCombo ); + } + + model.addAttribute( "model", categoryOptionCombo ); + + return "categoryOptionCombo"; + } +} === added file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/CategoryOptionController.java' --- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/CategoryOptionController.java 1970-01-01 00:00:00 +0000 +++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/CategoryOptionController.java 2011-12-07 12:27:51 +0000 @@ -0,0 +1,87 @@ +package org.hisp.dhis.api.controller; + +/* + * Copyright (c) 2004-2011, 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 org.hisp.dhis.api.utils.IdentifiableObjectParams; +import org.hisp.dhis.api.utils.WebLinkPopulator; +import org.hisp.dhis.dataelement.DataElementCategoryOption; +import org.hisp.dhis.dataelement.DataElementCategoryOptions; +import org.hisp.dhis.dataelement.DataElementCategoryService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; + +import javax.servlet.http.HttpServletRequest; +import java.util.ArrayList; + +/** + * @author Morten Olav Hansen + */ +@Controller +@RequestMapping( value = "/categoryOptions" ) +public class CategoryOptionController +{ + @Autowired + private DataElementCategoryService dataElementCategoryService; + + @RequestMapping( method = RequestMethod.GET ) + public String getDataElementCategoryOptions( IdentifiableObjectParams params, Model model, HttpServletRequest request ) + { + DataElementCategoryOptions categoryOptions = new DataElementCategoryOptions(); + categoryOptions.setCategoryOptions( new ArrayList( dataElementCategoryService.getAllDataElementCategoryOptions() ) ); + + if ( params.hasLinks() ) + { + WebLinkPopulator listener = new WebLinkPopulator( request ); + listener.addLinks( categoryOptions ); + } + + model.addAttribute( "model", categoryOptions ); + + return "categoryOptions"; + } + + @RequestMapping( value = "/{uid}", method = RequestMethod.GET ) + public String getDataElementCategoryOption( @PathVariable( "uid" ) String uid, IdentifiableObjectParams params, Model model, HttpServletRequest request ) + { + DataElementCategoryOption categoryOption = dataElementCategoryService.getDataElementCategoryOption( uid ); + + if ( params.hasLinks() ) + { + WebLinkPopulator listener = new WebLinkPopulator( request ); + listener.addLinks( categoryOption ); + } + + model.addAttribute( "model", categoryOption ); + + return "categoryOption"; + } +} === removed file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/DataElementCategoryComboController.java' --- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/DataElementCategoryComboController.java 2011-12-06 15:03:45 +0000 +++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/DataElementCategoryComboController.java 1970-01-01 00:00:00 +0000 @@ -1,87 +0,0 @@ -package org.hisp.dhis.api.controller; - -/* - * Copyright (c) 2004-2011, 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 org.hisp.dhis.api.utils.IdentifiableObjectParams; -import org.hisp.dhis.api.utils.WebLinkPopulator; -import org.hisp.dhis.dataelement.DataElementCategoryCombo; -import org.hisp.dhis.dataelement.DataElementCategoryCombos; -import org.hisp.dhis.dataelement.DataElementCategoryService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; - -import javax.servlet.http.HttpServletRequest; -import java.util.ArrayList; - -/** - * @author Morten Olav Hansen - */ -@Controller -@RequestMapping( value = "/dataElementCategoryCombos" ) -public class DataElementCategoryComboController -{ - @Autowired - private DataElementCategoryService dataElementCategoryService; - - @RequestMapping( method = RequestMethod.GET ) - public String getDataElementCategoryCombos( IdentifiableObjectParams params, Model model, HttpServletRequest request ) - { - DataElementCategoryCombos dataElementCategoryCombos = new DataElementCategoryCombos(); - dataElementCategoryCombos.setDataElementCategoryCombos( new ArrayList( dataElementCategoryService.getAllDataElementCategoryCombos() ) ); - - if ( params.hasLinks() ) - { - WebLinkPopulator listener = new WebLinkPopulator( request ); - listener.addLinks( dataElementCategoryCombos ); - } - - model.addAttribute( "model", dataElementCategoryCombos ); - - return "dataElementCategoryCombos"; - } - - @RequestMapping( value = "/{uid}", method = RequestMethod.GET ) - public String getDataElementCategoryCombo( @PathVariable( "uid" ) String uid, IdentifiableObjectParams params, Model model, HttpServletRequest request ) - { - DataElementCategoryCombo dataElementCategoryCombo = dataElementCategoryService.getDataElementCategoryCombo( uid ); - - if ( params.hasLinks() ) - { - WebLinkPopulator listener = new WebLinkPopulator( request ); - listener.addLinks( dataElementCategoryCombo ); - } - - model.addAttribute( "model", dataElementCategoryCombo ); - - return "dataElementCategoryCombo"; - } -} === removed file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/DataElementCategoryController.java' --- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/DataElementCategoryController.java 2011-12-06 15:03:45 +0000 +++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/DataElementCategoryController.java 1970-01-01 00:00:00 +0000 @@ -1,87 +0,0 @@ -package org.hisp.dhis.api.controller; - -/* - * Copyright (c) 2004-2011, 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 org.hisp.dhis.api.utils.IdentifiableObjectParams; -import org.hisp.dhis.api.utils.WebLinkPopulator; -import org.hisp.dhis.dataelement.DataElementCategories; -import org.hisp.dhis.dataelement.DataElementCategory; -import org.hisp.dhis.dataelement.DataElementCategoryService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; - -import javax.servlet.http.HttpServletRequest; -import java.util.ArrayList; - -/** - * @author Morten Olav Hansen - */ -@Controller -@RequestMapping( value = "/dataElementCategories" ) -public class DataElementCategoryController -{ - @Autowired - private DataElementCategoryService dataElementCategoryService; - - @RequestMapping( method = RequestMethod.GET ) - public String getDataElementCategories( IdentifiableObjectParams params, Model model, HttpServletRequest request ) - { - DataElementCategories dataElementCategories = new DataElementCategories(); - dataElementCategories.setDataElementCategories( new ArrayList( dataElementCategoryService.getAllDataElementCategories() ) ); - - if ( params.hasLinks() ) - { - WebLinkPopulator listener = new WebLinkPopulator( request ); - listener.addLinks( dataElementCategories ); - } - - model.addAttribute( "model", dataElementCategories ); - - return "dataElementCategories"; - } - - @RequestMapping( value = "/{uid}", method = RequestMethod.GET ) - public String getDataElementCategory( @PathVariable( "uid" ) String uid, IdentifiableObjectParams params, Model model, HttpServletRequest request ) - { - DataElementCategory dataElementCategory = dataElementCategoryService.getDataElementCategory( uid ); - - if ( params.hasLinks() ) - { - WebLinkPopulator listener = new WebLinkPopulator( request ); - listener.addLinks( dataElementCategory ); - } - - model.addAttribute( "model", dataElementCategory ); - - return "dataElementCategory"; - } -} === removed file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/DataElementCategoryOptionComboController.java' --- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/DataElementCategoryOptionComboController.java 2011-12-06 15:03:45 +0000 +++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/DataElementCategoryOptionComboController.java 1970-01-01 00:00:00 +0000 @@ -1,87 +0,0 @@ -package org.hisp.dhis.api.controller; - -/* - * Copyright (c) 2004-2011, 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 org.hisp.dhis.api.utils.IdentifiableObjectParams; -import org.hisp.dhis.api.utils.WebLinkPopulator; -import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo; -import org.hisp.dhis.dataelement.DataElementCategoryOptionCombos; -import org.hisp.dhis.dataelement.DataElementCategoryService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; - -import javax.servlet.http.HttpServletRequest; -import java.util.ArrayList; - -/** - * @author Morten Olav Hansen - */ -@Controller -@RequestMapping( value = "/dataElementCategoryOptionCombos" ) -public class DataElementCategoryOptionComboController -{ - @Autowired - private DataElementCategoryService dataElementCategoryService; - - @RequestMapping( method = RequestMethod.GET ) - public String getDataElementCategoryOptionCombos( IdentifiableObjectParams params, Model model, HttpServletRequest request ) - { - DataElementCategoryOptionCombos dataElementCategoryOptionCombos = new DataElementCategoryOptionCombos(); - dataElementCategoryOptionCombos.setDataElementCategoryOptionCombos( new ArrayList( dataElementCategoryService.getAllDataElementCategoryOptionCombos() ) ); - - if ( params.hasLinks() ) - { - WebLinkPopulator listener = new WebLinkPopulator( request ); - listener.addLinks( dataElementCategoryOptionCombos ); - } - - model.addAttribute( "model", dataElementCategoryOptionCombos ); - - return "dataElementCategoryOptionCombos"; - } - - @RequestMapping( value = "/{uid}", method = RequestMethod.GET ) - public String getDataElementCategoryCombo( @PathVariable( "uid" ) String uid, IdentifiableObjectParams params, Model model, HttpServletRequest request ) - { - DataElementCategoryOptionCombo dataElementCategoryOptionCombo = dataElementCategoryService.getDataElementCategoryOptionCombo( uid ); - - if ( params.hasLinks() ) - { - WebLinkPopulator listener = new WebLinkPopulator( request ); - listener.addLinks( dataElementCategoryOptionCombo ); - } - - model.addAttribute( "model", dataElementCategoryOptionCombo ); - - return "dataElementCategoryOptionCombo"; - } -} === removed file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/DataElementCategoryOptionController.java' --- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/DataElementCategoryOptionController.java 2011-12-06 15:03:45 +0000 +++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/DataElementCategoryOptionController.java 1970-01-01 00:00:00 +0000 @@ -1,87 +0,0 @@ -package org.hisp.dhis.api.controller; - -/* - * Copyright (c) 2004-2011, 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 org.hisp.dhis.api.utils.IdentifiableObjectParams; -import org.hisp.dhis.api.utils.WebLinkPopulator; -import org.hisp.dhis.dataelement.DataElementCategoryOption; -import org.hisp.dhis.dataelement.DataElementCategoryOptions; -import org.hisp.dhis.dataelement.DataElementCategoryService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; - -import javax.servlet.http.HttpServletRequest; -import java.util.ArrayList; - -/** - * @author Morten Olav Hansen - */ -@Controller -@RequestMapping( value = "/dataElementCategoryOptions" ) -public class DataElementCategoryOptionController -{ - @Autowired - private DataElementCategoryService dataElementCategoryService; - - @RequestMapping( method = RequestMethod.GET ) - public String getDataElementCategoryOptions( IdentifiableObjectParams params, Model model, HttpServletRequest request ) - { - DataElementCategoryOptions dataElementCategoryOptions = new DataElementCategoryOptions(); - dataElementCategoryOptions.setDataElementCategoryOptions( new ArrayList( dataElementCategoryService.getAllDataElementCategoryOptions() ) ); - - if ( params.hasLinks() ) - { - WebLinkPopulator listener = new WebLinkPopulator( request ); - listener.addLinks( dataElementCategoryOptions ); - } - - model.addAttribute( "model", dataElementCategoryOptions ); - - return "dataElementCategoryOptions"; - } - - @RequestMapping( value = "/{uid}", method = RequestMethod.GET ) - public String getDataElementCategoryOption( @PathVariable( "uid" ) String uid, IdentifiableObjectParams params, Model model, HttpServletRequest request ) - { - DataElementCategoryOption dataElementCategoryOption = dataElementCategoryService.getDataElementCategoryOption( uid ); - - if ( params.hasLinks() ) - { - WebLinkPopulator listener = new WebLinkPopulator( request ); - listener.addLinks( dataElementCategoryOption ); - } - - model.addAttribute( "model", dataElementCategoryOption ); - - return "dataElementCategoryOption"; - } -} === modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/OrganisationUnitController.java' --- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/OrganisationUnitController.java 2011-12-06 15:03:45 +0000 +++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/OrganisationUnitController.java 2011-12-07 13:29:09 +0000 @@ -29,7 +29,15 @@ public String getOrganisationUnits( IdentifiableObjectParams params, Model model, HttpServletRequest request ) { OrganisationUnits organisationUnits = new OrganisationUnits(); - organisationUnits.setOrganisationUnits( new ArrayList( organisationUnitService.getAllOrganisationUnits() ) ); + + if ( params.hasNoPaging() ) + { + organisationUnits.setOrganisationUnits( new ArrayList( organisationUnitService.getAllOrganisationUnits() ) ); + } + else + { + organisationUnits.setOrganisationUnits( new ArrayList( organisationUnitService.getAllOrganisationUnits() ) ); + } if ( params.hasLinks() ) { === modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/utils/IdentifiableObjectParams.java' --- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/utils/IdentifiableObjectParams.java 2011-12-03 18:00:10 +0000 +++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/utils/IdentifiableObjectParams.java 2011-12-07 13:29:09 +0000 @@ -27,6 +27,8 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +import java.util.Date; + /** * @author Morten Olav Hansen */ @@ -34,6 +36,25 @@ { private boolean links = true; + private Date lastUpdated; + + private String nameLike; + + /** + * Paging related + */ + + private boolean noPaging = false; + + private int offset = 1; + + private int limit = 50; + + public IdentifiableObjectParams() + { + + } + public boolean hasLinks() { return links; @@ -43,4 +64,54 @@ { this.links = links; } + + public Date getLastUpdated() + { + return lastUpdated; + } + + public void setLastUpdated( Date lastUpdated ) + { + this.lastUpdated = lastUpdated; + } + + public String getNameLike() + { + return nameLike; + } + + public void setNameLike( String nameLike ) + { + this.nameLike = nameLike; + } + + public boolean hasNoPaging() + { + return noPaging; + } + + public void setNoPaging( boolean noPaging ) + { + this.noPaging = noPaging; + } + + public int getOffset() + { + return offset; + } + + public void setOffset( int offset ) + { + this.offset = offset; + } + + public int getLimit() + { + return limit; + } + + public void setLimit( int limit ) + { + this.limit = limit; + } } === modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/utils/WebLinkPopulator.java' --- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/utils/WebLinkPopulator.java 2011-12-06 19:19:40 +0000 +++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/utils/WebLinkPopulator.java 2011-12-07 12:27:51 +0000 @@ -64,6 +64,18 @@ static { + resourcePaths.put( DataElementCategories.class, "categories" ); + resourcePaths.put( DataElementCategory.class, "categories" ); + + resourcePaths.put( DataElementCategoryOptions.class, "categoryOptions" ); + resourcePaths.put( DataElementCategoryOption.class, "categoryOptions" ); + + resourcePaths.put( DataElementCategoryCombos.class, "categoryCombos" ); + resourcePaths.put( DataElementCategoryCombo.class, "categoryCombos" ); + + resourcePaths.put( DataElementCategoryOptionCombos.class, "categoryOptionCombos" ); + resourcePaths.put( DataElementCategoryOptionCombo.class, "categoryOptionCombos" ); + resourcePaths.put( MapView.class, "maps" ); } @@ -318,7 +330,7 @@ if ( root ) { - for ( DataElementCategory dataElementCategory : dataElementCategories.getDataElementCategories() ) + for ( DataElementCategory dataElementCategory : dataElementCategories.getCategories() ) { populateDataElementCategory( dataElementCategory, false ); } @@ -342,7 +354,7 @@ if ( root ) { for ( DataElementCategoryCombo dataElementCategoryCombo : dataElementCategoryCombos - .getDataElementCategoryCombos() ) + .getCategoryCombos() ) { populateDataElementCategoryCombo( dataElementCategoryCombo, false ); } @@ -366,8 +378,7 @@ if ( root ) { - for ( DataElementCategoryOption dataElementCategoryOption : dataElementCategoryOptions - .getDataElementCategoryOptions() ) + for ( DataElementCategoryOption dataElementCategoryOption : dataElementCategoryOptions.getCategoryOptions() ) { populateDataElementCategoryOption( dataElementCategoryOption, false ); } @@ -393,7 +404,7 @@ if ( root ) { for ( DataElementCategoryOptionCombo dataElementCategoryOptionCombo : dataElementCategoryOptionCombos - .getDataElementCategoryOptionCombos() ) + .getCategoryOptionCombos() ) { populateDataElementCategoryOptionCombo( dataElementCategoryOptionCombo, false ); } === modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/webdomain/Resource.java' --- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/webdomain/Resource.java 2011-12-06 19:52:58 +0000 +++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/webdomain/Resource.java 2011-12-07 08:41:05 +0000 @@ -29,7 +29,7 @@ import org.codehaus.jackson.annotate.JsonProperty; import org.codehaus.jackson.map.annotate.JsonSerialize; -import org.hisp.dhis.api.adapter.MediaTypeCollecctionJsonSerializer; +import org.hisp.dhis.api.adapter.MediaTypeCollectionJsonSerializer; import org.hisp.dhis.api.adapter.MediaTypeXmlAdapter; import org.hisp.dhis.api.adapter.RequestMethodCollectionJsonSerializer; import org.hisp.dhis.api.adapter.RequestMethodXmlAdapter; @@ -103,7 +103,7 @@ @XmlElementWrapper( name = "mediaTypes" ) @XmlElement( name = "mediaType" ) @XmlJavaTypeAdapter( MediaTypeXmlAdapter.class ) - @JsonSerialize( using = MediaTypeCollecctionJsonSerializer.class ) + @JsonSerialize( using = MediaTypeCollectionJsonSerializer.class ) public List getMediaTypes() { return mediaTypes; === modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/webdomain/Resources.java' --- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/webdomain/Resources.java 2011-12-06 10:58:10 +0000 +++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/webdomain/Resources.java 2011-12-07 13:29:09 +0000 @@ -90,7 +90,7 @@ private void generateResources() { RequestMethod[] defaultRequestMethods = new RequestMethod[]{ - RequestMethod.GET, RequestMethod.POST, RequestMethod.PUT, RequestMethod.DELETE + RequestMethod.GET /* , RequestMethod.POST, RequestMethod.PUT, RequestMethod.DELETE */ }; MediaType[] defaultMediaTypes = new MediaType[]{ @@ -112,10 +112,10 @@ resources.add( new Resource( "DataElements", DataElements.class, requestMethods, mediaTypes ) ); resources.add( new Resource( "DataElementGroups", DataElementGroups.class, requestMethods, mediaTypes ) ); resources.add( new Resource( "DataElementGroupSets", DataElementGroupSets.class, requestMethods, mediaTypes ) ); - resources.add( new Resource( "DataElementCategories", DataElementCategories.class, requestMethods, mediaTypes ) ); - resources.add( new Resource( "DataElementCategoryCombos", DataElementCategoryCombos.class, requestMethods, mediaTypes ) ); - resources.add( new Resource( "DataElementCategoryOptions", DataElementCategoryOptions.class, requestMethods, mediaTypes ) ); - resources.add( new Resource( "DataElementCategoryOptionCombos", DataElementCategoryOptionCombos.class, requestMethods, mediaTypes ) ); + resources.add( new Resource( "Categories", DataElementCategories.class, requestMethods, mediaTypes ) ); + resources.add( new Resource( "CategoryCombos", DataElementCategoryCombos.class, requestMethods, mediaTypes ) ); + resources.add( new Resource( "CategoryOptions", DataElementCategoryOptions.class, requestMethods, mediaTypes ) ); + resources.add( new Resource( "CategoryOptionCombos", DataElementCategoryOptionCombos.class, requestMethods, mediaTypes ) ); resources.add( new Resource( "OrganisationUnits", OrganisationUnits.class, requestMethods, mediaTypes ) ); resources.add( new Resource( "OrganisationUnitGroups", OrganisationUnitGroups.class, requestMethods, mediaTypes ) ); resources.add( new Resource( "OrganisationUnitGroupSets", OrganisationUnitGroupSets.class, requestMethods, mediaTypes ) ); === renamed directory 'dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/xslt' => 'dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html' === added file 'dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/category.xsl' --- dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/category.xsl 1970-01-01 00:00:00 +0000 +++ dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/category.xsl 2011-12-07 12:27:51 +0000 @@ -0,0 +1,35 @@ + + + + +
+

+ + + + + + + + + + +
ID
Last Updated
+ + +
+
+ + + +

CategoryOptions

+ + +
+
+
+ +
=== added file 'dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/categoryCombo.xsl' --- dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/categoryCombo.xsl 1970-01-01 00:00:00 +0000 +++ dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/categoryCombo.xsl 2011-12-07 12:27:51 +0000 @@ -0,0 +1,44 @@ + + + + +
+

+ + + + + + + + + + +
ID
Last Updated
+ + +
+
+ + + +

OptionCombos

+ + +
+
+
+ + + +

Categories

+ + +
+
+
+ +
=== added file 'dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/categoryOption.xsl' --- dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/categoryOption.xsl 1970-01-01 00:00:00 +0000 +++ dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/categoryOption.xsl 2011-12-07 12:27:51 +0000 @@ -0,0 +1,42 @@ + + + + +
+

+ + + + + + + + + + +
ID
Last Updated
+ + +
+
+ + +

Category

+ + +
+
+ + + +

CategoryOptionCombos

+ + +
+
+
+ +
=== added file 'dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/categoryOptionCombo.xsl' --- dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/categoryOptionCombo.xsl 1970-01-01 00:00:00 +0000 +++ dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/categoryOptionCombo.xsl 2011-12-07 12:27:51 +0000 @@ -0,0 +1,42 @@ + + + + +
+

+ + + + + + + + + + +
ID
Last Updated
+ + +
+
+ + +

CategoryCombo

+ + +
+
+ + + +

CategoryOptions

+ + +
+
+
+ +
=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/chart.xsl' --- dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/xslt/chart.xsl 2011-12-06 18:27:36 +0000 +++ dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/chart.xsl 2011-12-06 20:38:31 +0000 @@ -14,81 +14,55 @@ - + - + - + - + - + - + - + - + - + - + - + - + - +
ID - -
Last Updated - -
Dimension - -
Hide legend - -
Hide subtitle - -
Horizontal Pilot Orientation - -
Regression - -
Size - -
Target line - -
Target line label - -
Type - -
User organisation unit - -
Vertical labels - -
=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/dataElement.xsl' --- dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/xslt/dataElement.xsl 2011-12-06 19:04:21 +0000 +++ dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/dataElement.xsl 2011-12-07 12:27:51 +0000 @@ -6,63 +6,44 @@
-

- -

+

+ - + - + - + - + - + - + - + - + - +
ID - -
Last Updated - -
Short Name - -
Type - -
Zero is Significant - -
Sort Order - -
Active - -
Aggregation Operator - -
Domain Type - -
@@ -70,7 +51,7 @@ -

DataElementCategoryCombo

+

CategoryCombo

@@ -94,4 +75,4 @@
- \ No newline at end of file + === added file 'dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/dataElementGroup.xsl' --- dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/dataElementGroup.xsl 1970-01-01 00:00:00 +0000 +++ dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/dataElementGroup.xsl 2011-12-06 20:59:32 +0000 @@ -0,0 +1,39 @@ + + + + +
+

+ + + + + + + + + + + + + + +
ID
Last Updated
Code
+ + +
+
+ + + +

DataElements

+ + +
+
+
+ +
=== added file 'dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/dataElementGroupSet.xsl' --- dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/dataElementGroupSet.xsl 1970-01-01 00:00:00 +0000 +++ dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/dataElementGroupSet.xsl 2011-12-06 20:59:32 +0000 @@ -0,0 +1,39 @@ + + + + +
+

+ + + + + + + + + + + + + + +
ID
Last Updated
Code
+ + +
+
+ + + +

DataElement Groups

+ + +
+
+
+ +
=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/dataSet.xsl' --- dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/xslt/dataSet.xsl 2011-12-06 14:07:14 +0000 +++ dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/dataSet.xsl 2011-12-06 20:30:07 +0000 @@ -12,33 +12,23 @@ - + - + - + - + - +
ID - -
Last Updated - -
Short Name - -
Version - -
Mobile - -
=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/identifiable-row.xsl' --- dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/xslt/identifiable-row.xsl 2011-12-06 19:04:21 +0000 +++ dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/identifiable-row.xsl 2011-12-06 20:45:22 +0000 @@ -3,24 +3,14 @@ xmlns="http://www.w3.org/1999/xhtml" xmlns:d="http://dhis2.org/schema/dxf/2.0"> - - - - - html - - - xml - - - json - - - jsonp - - - pdf - + + + html + xml + json + jsonp + pdf + === added file 'dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/indicatorGroup.xsl' --- dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/indicatorGroup.xsl 1970-01-01 00:00:00 +0000 +++ dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/indicatorGroup.xsl 2011-12-06 20:59:32 +0000 @@ -0,0 +1,39 @@ + + + + +
+

+ + + + + + + + + + + + + + +
ID
Last Updated
Code
+ + +
+
+ + + +

Indicators

+ + +
+
+
+ +
=== added file 'dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/indicatorGroupSet.xsl' --- dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/indicatorGroupSet.xsl 1970-01-01 00:00:00 +0000 +++ dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/indicatorGroupSet.xsl 2011-12-06 20:59:32 +0000 @@ -0,0 +1,39 @@ + + + + +
+

+ + + + + + + + + + + + + + +
ID
Last Updated
Code
+ + +
+
+ + + +

Indicator Groups

+ + +
+
+
+ +
=== 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/xslt/list.xsl 2011-12-06 13:34:35 +0000 +++ dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/list.xsl 2011-12-07 12:45:41 +0000 @@ -7,11 +7,12 @@ - - -

- -

+ +

=== 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/xslt/model2html.xsl 2011-12-06 13:34:35 +0000 +++ dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/model2html.xsl 2011-12-07 12:27:51 +0000 @@ -9,17 +9,27 @@ - + - + + + + + + + + + + + - - \ No newline at end of file + + === modified file 'dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/organisationUnit.xsl' --- dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/xslt/organisationUnit.xsl 2011-12-06 19:04:21 +0000 +++ dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/organisationUnit.xsl 2011-12-06 20:30:07 +0000 @@ -6,57 +6,40 @@
-

- -

+

+
- + - + - + - + - + - + - + - +
ID - -
Last Updated - -
Short Name - -
Opening Date - -
Level - -
Active - -
Current Parent - -
Has Patients - -
=== added file 'dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/organisationUnitGroup.xsl' --- dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/organisationUnitGroup.xsl 1970-01-01 00:00:00 +0000 +++ dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/organisationUnitGroup.xsl 2011-12-06 20:59:32 +0000 @@ -0,0 +1,39 @@ + + + + +
+

+ + + + + + + + + + + + + + +
ID
Last Updated
Code
+ + +
+
+ + + +

OrganisationUnits

+ + +
+
+
+ +
=== added file 'dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/organisationUnitGroupSet.xsl' --- dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/organisationUnitGroupSet.xsl 1970-01-01 00:00:00 +0000 +++ dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/organisationUnitGroupSet.xsl 2011-12-06 20:59:32 +0000 @@ -0,0 +1,39 @@ + + + + +
+

+ + + + + + + + + + + + + + +
ID
Last Updated
Code
+ + +
+
+ + + +

OrganisationUnit Groups

+ + +
+
+
+ +
=== renamed directory 'dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/xslfo' => 'dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/pdf'