dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #14281
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 4799: removed support for attributes with multiple options
------------------------------------------------------------
revno: 4799
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2011-10-03 11:23:01 +0200
message:
removed support for attributes with multiple options
removed:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/attribute/AttributeOption.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/attribute/AttributeOptionStore.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/attribute/comparator/AttributeOptionNameComparator.java
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/attribute/hibernate/HibernateAttributeOptionStore.java
dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/attribute/hibernate/AttributeOption.hbm.xml
dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/attribute/AttributeOptionServiceTest.java
dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/attribute/AttributeOptionStoreTest.java
dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetAttributeOptionsAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/attribute/AddAttributeOptionAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/attribute/GetAttributeOptionAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/attribute/GetAttributeOptionListAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/attribute/RemoveAttributeOptionAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/attribute/UpdateAttributeOptionAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/attribute/ValidateAttributeOptionAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/addAttributeOptionForm.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/attributeOption.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/jsonAttributeOption.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/updateAttributeOptionForm.vm
modified:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/attribute/Attribute.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/attribute/AttributeService.java
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/attribute/DefaultAttributeService.java
dhis-2/dhis-services/dhis-service-core/src/main/resources/META-INF/dhis/beans.xml
dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/attribute/hibernate/Attribute.hbm.xml
dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/attribute/AttributeStoreTest.java
dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/macros.vm
dhis-2/dhis-web/dhis-web-commons/src/main/resources/META-INF/dhis/beans.xml
dhis-2/dhis-web/dhis-web-commons/src/main/resources/dhis-web-commons.xml
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/attribute/AddAttributeAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/attribute/GetAttributeListAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/attribute/UpdateAttributeAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/resources/META-INF/dhis/beans.xml
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/resources/struts.xml
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/addAttributeForm.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/index.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/menu.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/updateAttributeForm.vm
--
lp:dhis2
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
=== 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-09-21 15:41:25 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/attribute/Attribute.java 2011-10-03 09:23:01 +0000
@@ -57,8 +57,6 @@
private Integer sortOrder;
- private Set<AttributeOption> attributeOptions = new HashSet<AttributeOption>();
-
private Set<AttributeValue> attributeValues = new HashSet<AttributeValue>();
public Attribute()
@@ -142,37 +140,11 @@
this.userAttribute = userAttribute;
}
- public Set<AttributeOption> getAttributeOptions()
- {
- return attributeOptions;
- }
-
- public void setAttributeOptions( Set<AttributeOption> attributeOptions )
- {
- this.attributeOptions = attributeOptions;
- }
-
public Set<AttributeValue> getAttributeValues()
{
return attributeValues;
}
- // -------------------------------------------------------------------------
- // Helpers
- // -------------------------------------------------------------------------
-
- public void addAttributeOption( AttributeOption attributeOption )
- {
- attributeOptions.add( attributeOption );
- attributeOption.getAttributes().add( this );
- }
-
- public void removeAttributeOption( AttributeOption attributeOption )
- {
- attributeOption.getAttributes().remove( this );
- attributeOptions.remove( attributeOption );
- }
-
public Integer getSortOrder()
{
return sortOrder;
=== removed file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/attribute/AttributeOption.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/attribute/AttributeOption.java 2011-09-07 13:42:12 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/attribute/AttributeOption.java 1970-01-01 00:00:00 +0000
@@ -1,67 +0,0 @@
-/*
- * Copyright (c) 2004-2010, 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.attribute;
-
-import java.util.HashSet;
-import java.util.Set;
-
-import org.hisp.dhis.common.AbstractIdentifiableObject;
-
-/**
- * @author mortenoh
- */
-public class AttributeOption
- extends AbstractIdentifiableObject
-{
- /**
- * Determines if a de-serialized file is compatible with this class.
- */
- private static final long serialVersionUID = -2698940415255819380L;
-
- private Set<Attribute> attributes = new HashSet<Attribute>();
-
- public AttributeOption()
- {
-
- }
-
- public AttributeOption( String name )
- {
- this.name = name;
- }
-
- public Set<Attribute> getAttributes()
- {
- return attributes;
- }
-
- public void setAttributes( Set<Attribute> attributes )
- {
- this.attributes = attributes;
- }
-}
=== removed file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/attribute/AttributeOptionStore.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/attribute/AttributeOptionStore.java 2011-09-07 13:42:12 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/attribute/AttributeOptionStore.java 1970-01-01 00:00:00 +0000
@@ -1,39 +0,0 @@
-/*
- * Copyright (c) 2004-2010, 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.attribute;
-
-import org.hisp.dhis.common.GenericIdentifiableObjectStore;
-
-/**
- * @author mortenoh
- */
-public interface AttributeOptionStore
- extends GenericIdentifiableObjectStore<AttributeOption>
-{
- String ID = AttributeOptionStore.class.getName();
-}
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/attribute/AttributeService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/attribute/AttributeService.java 2011-09-14 09:22:51 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/attribute/AttributeService.java 2011-10-03 09:23:01 +0000
@@ -67,30 +67,6 @@
public Set<Attribute> getAttributesBetweenByName( String name, int first, int max );
// -------------------------------------------------------------------------
- // AttributeOption
- // -------------------------------------------------------------------------
-
- public void addAttributeOption( AttributeOption attributeOption );
-
- public void updateAttributeOption( AttributeOption attributeOption );
-
- public void deleteAttributeOption( AttributeOption attributeOption );
-
- public AttributeOption getAttributeOption( int id );
-
- public AttributeOption getAttributeOptionByName( String name );
-
- public Set<AttributeOption> getAllAttributeOptions();
-
- public int getAttributeOptionCount();
-
- public int getAttributeOptionCountByName( String name );
-
- public Set<AttributeOption> getAttributeOptionsBetween( int first, int max );
-
- public Set<AttributeOption> getAttributeOptionsBetweenByName( String name, int first, int max );
-
- // -------------------------------------------------------------------------
// AttributeValue
// -------------------------------------------------------------------------
=== removed file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/attribute/comparator/AttributeOptionNameComparator.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/attribute/comparator/AttributeOptionNameComparator.java 2011-09-07 13:42:12 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/attribute/comparator/AttributeOptionNameComparator.java 1970-01-01 00:00:00 +0000
@@ -1,42 +0,0 @@
-/*
- * Copyright (c) 2004-2010, 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.attribute.comparator;
-
-import java.util.Comparator;
-
-import org.hisp.dhis.attribute.AttributeOption;
-
-public class AttributeOptionNameComparator
- implements Comparator<AttributeOption>
-{
- @Override
- public int compare( AttributeOption ao0, AttributeOption ao1 )
- {
- return ao0.getName().compareToIgnoreCase( ao1.getName() );
- }
-}
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/attribute/DefaultAttributeService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/attribute/DefaultAttributeService.java 2011-09-14 09:22:51 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/attribute/DefaultAttributeService.java 2011-10-03 09:23:01 +0000
@@ -51,18 +51,6 @@
this.attributeStore = attributeStore;
}
- private AttributeOptionStore attributeOptionStore;
-
- public AttributeOptionStore getAttributeOptionStore()
- {
- return attributeOptionStore;
- }
-
- public void setAttributeOptionStore( AttributeOptionStore attributeOptionStore )
- {
- this.attributeOptionStore = attributeOptionStore;
- }
-
private AttributeValueStore attributeValueStore;
public AttributeValueStore getAttributeValueStore()
@@ -158,70 +146,6 @@
}
// -------------------------------------------------------------------------
- // AttributeOption implementation
- // -------------------------------------------------------------------------
-
- @Override
- public void addAttributeOption( AttributeOption attributeOption )
- {
- attributeOptionStore.save( attributeOption );
- }
-
- @Override
- public void updateAttributeOption( AttributeOption attributeOption )
- {
- attributeOptionStore.update( attributeOption );
- }
-
- @Override
- public void deleteAttributeOption( AttributeOption attributeOption )
- {
- attributeOptionStore.delete( attributeOption );
- }
-
- @Override
- public AttributeOption getAttributeOption( int id )
- {
- return attributeOptionStore.get( id );
- }
-
- @Override
- public AttributeOption getAttributeOptionByName( String name )
- {
- return attributeOptionStore.getByName( name );
- }
-
- @Override
- public Set<AttributeOption> getAllAttributeOptions()
- {
- return new HashSet<AttributeOption>( attributeOptionStore.getAll() );
- }
-
- @Override
- public int getAttributeOptionCount()
- {
- return attributeOptionStore.getCount();
- }
-
- @Override
- public int getAttributeOptionCountByName( String name )
- {
- return attributeOptionStore.getCountByName( name );
- }
-
- @Override
- public Set<AttributeOption> getAttributeOptionsBetween( int first, int max )
- {
- return new HashSet<AttributeOption>( attributeOptionStore.getBetween( first, max ) );
- }
-
- @Override
- public Set<AttributeOption> getAttributeOptionsBetweenByName( String name, int first, int max )
- {
- return new HashSet<AttributeOption>( attributeOptionStore.getBetweenByName( name, first, max ) );
- }
-
- // -------------------------------------------------------------------------
// AttributeValue implementation
// -------------------------------------------------------------------------
=== removed file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/attribute/hibernate/HibernateAttributeOptionStore.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/attribute/hibernate/HibernateAttributeOptionStore.java 2011-09-06 11:52:18 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/attribute/hibernate/HibernateAttributeOptionStore.java 1970-01-01 00:00:00 +0000
@@ -1,38 +0,0 @@
-/*
- * Copyright (c) 2004-2010, 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.attribute.hibernate;
-
-import org.hisp.dhis.attribute.AttributeOption;
-import org.hisp.dhis.attribute.AttributeOptionStore;
-import org.hisp.dhis.hibernate.HibernateGenericStore;
-
-/**
- * @author mortenoh
- */
-public class HibernateAttributeOptionStore
- extends HibernateGenericStore<AttributeOption>
- implements AttributeOptionStore
-{
-
-}
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-services/dhis-service-core/src/main/resources/META-INF/dhis/beans.xml 2011-10-03 09:15:35 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/resources/META-INF/dhis/beans.xml 2011-10-03 09:23:01 +0000
@@ -236,11 +236,6 @@
<property name="clazz" value="org.hisp.dhis.attribute.Attribute" />
</bean>
- <bean id="org.hisp.dhis.attribute.AttributeOptionStore" class="org.hisp.dhis.attribute.hibernate.HibernateAttributeOptionStore">
- <property name="sessionFactory" ref="sessionFactory" />
- <property name="clazz" value="org.hisp.dhis.attribute.AttributeOption" />
- </bean>
-
<bean id="org.hisp.dhis.attribute.AttributeValueStore" class="org.hisp.dhis.attribute.hibernate.HibernateAttributeValueStore">
<property name="sessionFactory" ref="sessionFactory" />
<property name="clazz" value="org.hisp.dhis.attribute.AttributeValue" />
@@ -477,7 +472,6 @@
<bean id="org.hisp.dhis.attribute.AttributeService" class="org.hisp.dhis.attribute.DefaultAttributeService">
<property name="attributeStore" ref="org.hisp.dhis.attribute.AttributeStore" />
- <property name="attributeOptionStore" ref="org.hisp.dhis.attribute.AttributeOptionStore" />
<property name="attributeValueStore" ref="org.hisp.dhis.attribute.AttributeValueStore" />
</bean>
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/attribute/hibernate/Attribute.hbm.xml'
--- dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/attribute/hibernate/Attribute.hbm.xml 2011-09-21 15:41:25 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/attribute/hibernate/Attribute.hbm.xml 2011-10-03 09:23:01 +0000
@@ -28,11 +28,6 @@
<property name="sortOrder" />
- <set name="attributeOptions" table="attributeattributeoptions">
- <key column="attributeid" />
- <many-to-many column="attributeoptionid" class="AttributeOption" />
- </set>
-
<set name="attributeValues" inverse="true" lazy="true">
<cache usage="read-write" />
<key column="attributeid" />
=== removed file 'dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/attribute/hibernate/AttributeOption.hbm.xml'
--- dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/attribute/hibernate/AttributeOption.hbm.xml 2011-09-07 13:42:12 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/attribute/hibernate/AttributeOption.hbm.xml 1970-01-01 00:00:00 +0000
@@ -1,24 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE hibernate-mapping PUBLIC
- "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
- "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
-
-<hibernate-mapping package="org.hisp.dhis.attribute">
- <class name="AttributeOption" table="attributeoption">
-
- <cache usage="read-write" />
-
- <id name="id" column="attributeoptionid">
- <generator class="native" />
- </id>
-
- <property name="name" not-null="true" unique="true" />
-
- <set name="attributes" table="attributeattributeoptions">
- <cache usage="read-write" />
- <key column="attributeoptionid" />
- <many-to-many column="attributeid" class="Attribute" />
- </set>
-
- </class>
-</hibernate-mapping>
=== removed file 'dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/attribute/AttributeOptionServiceTest.java'
--- dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/attribute/AttributeOptionServiceTest.java 2011-09-07 13:42:12 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/attribute/AttributeOptionServiceTest.java 1970-01-01 00:00:00 +0000
@@ -1,132 +0,0 @@
-/*
- * Copyright (c) 2004-2010, 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.attribute;
-
-import org.junit.Test;
-import static org.junit.Assert.*;
-
-import org.hisp.dhis.DhisSpringTest;
-
-/**
- * @author mortenoh
- */
-public class AttributeOptionServiceTest
- extends DhisSpringTest
-{
- private AttributeService attributeService;
-
- @Override
- protected void setUpTest()
- {
- attributeService = (AttributeService) getBean( "org.hisp.dhis.attribute.AttributeService" );
- }
-
- @Test
- public void testAddAttributeOption()
- {
- AttributeOption attributeOption1 = new AttributeOption( "option 1" );
- AttributeOption attributeOption2 = new AttributeOption( "option 2" );
-
- attributeService.addAttributeOption( attributeOption1 );
- attributeService.addAttributeOption( attributeOption2 );
-
- attributeOption1 = attributeService.getAttributeOption( attributeOption1.getId() );
- attributeOption2 = attributeService.getAttributeOption( attributeOption2.getId() );
-
- assertNotNull( attributeOption1 );
- assertNotNull( attributeOption2 );
- }
-
- @Test
- public void testUpdateAttributeOption()
- {
- AttributeOption attributeOption1 = new AttributeOption( "option 1" );
- AttributeOption attributeOption2 = new AttributeOption( "option 2" );
-
- attributeService.addAttributeOption( attributeOption1 );
- attributeService.addAttributeOption( attributeOption2 );
-
- attributeOption1.setName( "updated option 1" );
- attributeOption2.setName( "updated option 2" );
-
- attributeService.updateAttributeOption( attributeOption1 );
- attributeService.updateAttributeOption( attributeOption2 );
-
- attributeOption1 = attributeService.getAttributeOption( attributeOption1.getId() );
- attributeOption2 = attributeService.getAttributeOption( attributeOption2.getId() );
-
- assertNotNull( attributeOption1 );
- assertNotNull( attributeOption2 );
-
- assertEquals( "updated option 1", attributeOption1.getName() );
- assertEquals( "updated option 2", attributeOption2.getName() );
- }
-
- @Test
- public void testDeleteAttributeOption()
- {
- AttributeOption attributeOption1 = new AttributeOption( "option 1" );
- AttributeOption attributeOption2 = new AttributeOption( "option 2" );
-
- attributeService.addAttributeOption( attributeOption1 );
- attributeService.addAttributeOption( attributeOption2 );
-
- int attributeOptionId1 = attributeOption1.getId();
- int attributeOptionId2 = attributeOption2.getId();
-
- attributeService.deleteAttributeOption( attributeOption1 );
- attributeService.deleteAttributeOption( attributeOption2 );
-
- assertNull( attributeService.getAttributeOption( attributeOptionId1 ) );
- assertNull( attributeService.getAttributeOption( attributeOptionId2 ) );
- }
-
- @Test
- public void testGetAttributeOption()
- {
- AttributeOption attributeOption1 = new AttributeOption( "option 1" );
- AttributeOption attributeOption2 = new AttributeOption( "option 2" );
-
- attributeService.addAttributeOption( attributeOption1 );
- attributeService.addAttributeOption( attributeOption2 );
-
- attributeOption1 = attributeService.getAttributeOption( attributeOption1.getId() );
- attributeOption2 = attributeService.getAttributeOption( attributeOption2.getId() );
-
- assertNotNull( attributeOption1 );
- assertNotNull( attributeOption2 );
- }
-
- @Test
- public void testGetAllAttributeOptions()
- {
- AttributeOption attributeOption1 = new AttributeOption( "option 1" );
- AttributeOption attributeOption2 = new AttributeOption( "option 2" );
-
- attributeService.addAttributeOption( attributeOption1 );
- attributeService.addAttributeOption( attributeOption2 );
-
- assertEquals( 2, attributeService.getAllAttributeOptions().size() );
- }
-}
=== removed file 'dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/attribute/AttributeOptionStoreTest.java'
--- dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/attribute/AttributeOptionStoreTest.java 2011-09-06 11:52:18 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/attribute/AttributeOptionStoreTest.java 1970-01-01 00:00:00 +0000
@@ -1,76 +0,0 @@
-/*
- * Copyright (c) 2004-2010, 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.attribute;
-
-import org.junit.Test;
-import static org.junit.Assert.*;
-
-import org.hisp.dhis.DhisSpringTest;
-
-public class AttributeOptionStoreTest
- extends DhisSpringTest
-{
- private AttributeOptionStore attributeOptionStore;
-
- private AttributeOption option1;
-
- private AttributeOption option2;
-
- @Override
- protected void setUpTest()
- {
- attributeOptionStore = (AttributeOptionStore) getBean( "org.hisp.dhis.attribute.AttributeOptionStore" );
-
- Attribute attribute1 = new Attribute();
- attribute1.setName( "attribute_simple1" );
- attribute1.setValueType( "string" );
-
- Attribute attribute2 = new Attribute();
- attribute2.setName( "attribute_simple2" );
- attribute2.setValueType( "string" );
-
- option1 = new AttributeOption( "option 1" );
- option1.getAttributes().add( attribute1 );
- option1.getAttributes().add( attribute2 );
-
- option2 = new AttributeOption( "option 2" );
- option2.getAttributes().add( attribute2 );
-
- attributeOptionStore.save( option1 );
- attributeOptionStore.save( option2 );
- }
-
- @Test
- public void testGetAttributes()
- {
- AttributeOption ao1 = attributeOptionStore.get( option1.getId() );
- AttributeOption ao2 = attributeOptionStore.get( option2.getId() );
-
- assertNotNull( ao1 );
- assertNotNull( ao2 );
-
- assertEquals( 2, ao1.getAttributes().size() );
- assertEquals( 1, ao2.getAttributes().size() );
- }
-}
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/attribute/AttributeStoreTest.java'
--- dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/attribute/AttributeStoreTest.java 2011-09-21 12:46:20 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/attribute/AttributeStoreTest.java 2011-10-03 09:23:01 +0000
@@ -54,9 +54,6 @@
attribute2.setOrganisationUnitAttribute( true );
attribute2.setDataElementAttribute( true );
- attribute2.addAttributeOption( new AttributeOption( "option 1" ) );
- attribute2.addAttributeOption( new AttributeOption( "option 2" ) );
-
attributeStore.save( attribute1 );
attributeStore.save( attribute2 );
}
@@ -78,12 +75,4 @@
{
assertEquals( 1, attributeStore.getOrganisationUnitAttributes().size() );
}
-
- @Test
- public void testGetAttributeOptions()
- {
- Attribute attr = attributeStore.get( attribute2.getId() );
- assertNotNull( attr );
- assertEquals( 2, attr.getAttributeOptions().size() );
- }
}
=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/macros.vm'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/macros.vm 2011-09-26 09:31:56 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/macros.vm 2011-10-03 09:23:01 +0000
@@ -411,14 +411,6 @@
#trPositiveIntegerInput( { "text": $text, "id": "attribute_$id", "mandatory": $mandatory, "value": $value } )
#elseif( $attribute.valueType == "negative_integer" )
#trNegativeIntegerInput( { "text": $text, "id": "attribute_$id", "mandatory": $mandatory, "value": $value } )
- #elseif( $attribute.valueType == "multiple_choice" )
- #set( $attributeOptions = [] )
-
- #foreach( $attributeOption in $attribute.attributeOptions )
- #set( $return = $attributeOptions.add( $attributeOption.name ) )
- #end
-
- #trMultipleChoiceInput( { "text": $text, "id": "attribute_$id", "mandatory": $mandatory, "choices": $attributeOptions, "value": $value } )
#end
#end
</table>
=== removed file 'dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetAttributeOptionsAction.java'
--- dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetAttributeOptionsAction.java 2011-09-08 10:38:20 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetAttributeOptionsAction.java 1970-01-01 00:00:00 +0000
@@ -1,81 +0,0 @@
-/*
- * 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.
- */
-
-package org.hisp.dhis.commons.action;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import org.hisp.dhis.attribute.AttributeOption;
-import org.hisp.dhis.attribute.AttributeService;
-import org.hisp.dhis.attribute.comparator.AttributeOptionNameComparator;
-
-import com.opensymphony.xwork2.Action;
-
-/**
- * @author mortenoh
- */
-public class GetAttributeOptionsAction
- implements Action
-{
- // -------------------------------------------------------------------------
- // Dependencies
- // -------------------------------------------------------------------------
-
- private AttributeService attributeService;
-
- public void setAttributeService( AttributeService attributeService )
- {
- this.attributeService = attributeService;
- }
-
- // -------------------------------------------------------------------------
- // Input & Output
- // -------------------------------------------------------------------------
-
- private List<AttributeOption> attributeOptions;
-
- public List<AttributeOption> getAttributeOptions()
- {
- return attributeOptions;
- }
-
- // -------------------------------------------------------------------------
- // Action implementation
- // -------------------------------------------------------------------------
-
- @Override
- public String execute()
- {
- attributeOptions = new ArrayList<AttributeOption>( attributeService.getAllAttributeOptions() );
-
- Collections.sort( attributeOptions, new AttributeOptionNameComparator() );
-
- return SUCCESS;
- }
-}
=== modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-web/dhis-web-commons/src/main/resources/META-INF/dhis/beans.xml 2011-09-30 12:21:59 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/resources/META-INF/dhis/beans.xml 2011-10-03 09:23:01 +0000
@@ -628,8 +628,4 @@
<property name="attributeService" ref="org.hisp.dhis.attribute.AttributeService" />
</bean>
- <bean id="org.hisp.dhis.commons.action.GetAttributeOptionsAction" class="org.hisp.dhis.commons.action.GetAttributeOptionsAction">
- <property name="attributeService" ref="org.hisp.dhis.attribute.AttributeService" />
- </bean>
-
</beans>
=== modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/resources/dhis-web-commons.xml'
--- dhis-2/dhis-web/dhis-web-commons/src/main/resources/dhis-web-commons.xml 2011-09-30 12:21:59 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/resources/dhis-web-commons.xml 2011-10-03 09:23:01 +0000
@@ -711,13 +711,6 @@
<param name="onExceptionReturn">plainTextError</param>
</action>
- <action name="getAttributeOptions" class="org.hisp.dhis.commons.action.GetAttributeOptionsAction">
- <result name="success" type="velocity-json">
- /dhis-web-commons/ajax/jsonAttributeOptions.vm
- </result>
- <param name="onExceptionReturn">plainTextError</param>
- </action>
-
<action name="getPeriod" class="org.hisp.dhis.commons.action.GetPeriodAction">
<result name="success" type="velocity-json">
/dhis-web-commons/ajax/jsonPeriod.vm
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/attribute/AddAttributeAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/attribute/AddAttributeAction.java 2011-09-21 12:46:20 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/attribute/AddAttributeAction.java 2011-10-03 09:23:01 +0000
@@ -27,12 +27,7 @@
package org.hisp.dhis.dataadmin.action.attribute;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
import org.hisp.dhis.attribute.Attribute;
-import org.hisp.dhis.attribute.AttributeOption;
import org.hisp.dhis.attribute.AttributeService;
import com.opensymphony.xwork2.Action;
@@ -107,13 +102,6 @@
this.userAttribute = userAttribute;
}
- private List<Integer> selectedAttributeOptions;
-
- public void setSelectedAttributeOptions( List<Integer> selectedAttributeOptions )
- {
- this.selectedAttributeOptions = selectedAttributeOptions;
- }
-
// -------------------------------------------------------------------------
// Action implementation
// -------------------------------------------------------------------------
@@ -128,18 +116,6 @@
attribute.setOrganisationUnitAttribute( organisationUnitAttribute );
attribute.setUserAttribute( userAttribute );
- Set<AttributeOption> attributeOptions = new HashSet<AttributeOption>();
-
- if ( valueType.compareTo( "multiple_choice" ) == 0 )
- {
- for ( Integer id : selectedAttributeOptions )
- {
- attributeOptions.add( attributeService.getAttributeOption( id ) );
- }
- }
-
- attribute.setAttributeOptions( attributeOptions );
-
attributeService.addAttribute( attribute );
return SUCCESS;
=== removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/attribute/AddAttributeOptionAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/attribute/AddAttributeOptionAction.java 2011-09-08 10:38:20 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/attribute/AddAttributeOptionAction.java 1970-01-01 00:00:00 +0000
@@ -1,76 +0,0 @@
-/*
- * 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.
- */
-
-package org.hisp.dhis.dataadmin.action.attribute;
-
-import org.hisp.dhis.attribute.AttributeOption;
-import org.hisp.dhis.attribute.AttributeService;
-
-import com.opensymphony.xwork2.Action;
-
-/**
- * @author mortenoh
- */
-public class AddAttributeOptionAction
- implements Action
-{
- // -------------------------------------------------------------------------
- // Dependencies
- // -------------------------------------------------------------------------
-
- private AttributeService attributeService;
-
- public void setAttributeService( AttributeService attributeService )
- {
- this.attributeService = attributeService;
- }
-
- // -------------------------------------------------------------------------
- // Input & Output
- // -------------------------------------------------------------------------
-
- private String name;
-
- public void setName( String name )
- {
- this.name = name;
- }
-
- // -------------------------------------------------------------------------
- // Action implementation
- // -------------------------------------------------------------------------
-
- @Override
- public String execute()
- {
- AttributeOption attributeOption = new AttributeOption( name );
-
- attributeService.addAttributeOption( attributeOption );
-
- return SUCCESS;
- }
-}
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/attribute/GetAttributeListAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/attribute/GetAttributeListAction.java 2011-09-07 13:42:12 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/attribute/GetAttributeListAction.java 2011-10-03 09:23:01 +0000
@@ -94,7 +94,7 @@
}
else
{
- this.paging = createPaging( attributeService.getAttributeOptionCount() );
+ this.paging = createPaging( attributeService.getAttributeCount() );
attributes = new ArrayList<Attribute>( attributeService.getAttributesBetween( paging.getStartPos(),
paging.getPageSize() ) );
=== removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/attribute/GetAttributeOptionAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/attribute/GetAttributeOptionAction.java 2011-09-07 13:42:12 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/attribute/GetAttributeOptionAction.java 1970-01-01 00:00:00 +0000
@@ -1,78 +0,0 @@
-/*
- * 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.
- */
-
-package org.hisp.dhis.dataadmin.action.attribute;
-
-import org.hisp.dhis.attribute.AttributeOption;
-import org.hisp.dhis.attribute.AttributeService;
-
-import com.opensymphony.xwork2.Action;
-
-public class GetAttributeOptionAction
- implements Action
-{
- // -------------------------------------------------------------------------
- // Dependencies
- // -------------------------------------------------------------------------
-
- private AttributeService attributeService;
-
- public void setAttributeService( AttributeService attributeService )
- {
- this.attributeService = attributeService;
- }
-
- // -------------------------------------------------------------------------
- // Input & Output
- // -------------------------------------------------------------------------
-
- private AttributeOption attributeOption;
-
- public AttributeOption getAttributeOption()
- {
- return attributeOption;
- }
-
- private Integer id;
-
- public void setId( Integer id )
- {
- this.id = id;
- }
-
- // -------------------------------------------------------------------------
- // Action implementation
- // -------------------------------------------------------------------------
-
- @Override
- public String execute()
- {
- attributeOption = attributeService.getAttributeOption( id );
-
- return SUCCESS;
- }
-}
=== removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/attribute/GetAttributeOptionListAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/attribute/GetAttributeOptionListAction.java 2011-09-07 13:42:12 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/attribute/GetAttributeOptionListAction.java 1970-01-01 00:00:00 +0000
@@ -1,107 +0,0 @@
-/*
- * 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.
- */
-
-package org.hisp.dhis.dataadmin.action.attribute;
-
-import static org.apache.commons.lang.StringUtils.isNotBlank;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import org.hisp.dhis.attribute.AttributeOption;
-import org.hisp.dhis.attribute.AttributeService;
-import org.hisp.dhis.attribute.comparator.AttributeOptionNameComparator;
-import org.hisp.dhis.paging.ActionPagingSupport;
-
-/**
- * @author mortenoh
- */
-public class GetAttributeOptionListAction
- extends ActionPagingSupport<AttributeOption>
-{
- // -------------------------------------------------------------------------
- // Dependencies
- // -------------------------------------------------------------------------
-
- private AttributeService attributeService;
-
- public void setAttributeService( AttributeService attributeService )
- {
- this.attributeService = attributeService;
- }
-
- // -------------------------------------------------------------------------
- // Input & Output
- // -------------------------------------------------------------------------
-
- private List<AttributeOption> attributeOptions;
-
- public List<AttributeOption> getAttributeOptions()
- {
- return attributeOptions;
- }
-
- private String key;
-
- public String getKey()
- {
- return key;
- }
-
- public void setKey( String key )
- {
- this.key = key;
- }
-
- // -------------------------------------------------------------------------
- // Action implementation
- // -------------------------------------------------------------------------
-
- @Override
- public String execute()
- {
- if ( isNotBlank( key ) )
- {
- this.paging = createPaging( attributeService.getAttributeOptionCountByName( key ) );
-
- attributeOptions = new ArrayList<AttributeOption>( attributeService.getAttributeOptionsBetweenByName( key,
- paging.getStartPos(), paging.getPageSize() ) );
- }
- else
- {
- this.paging = createPaging( attributeService.getAttributeOptionCount() );
-
- attributeOptions = new ArrayList<AttributeOption>( attributeService.getAttributeOptionsBetween(
- paging.getStartPos(), paging.getPageSize() ) );
- }
-
- Collections.sort( attributeOptions, new AttributeOptionNameComparator() );
-
- return SUCCESS;
- }
-}
=== removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/attribute/RemoveAttributeOptionAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/attribute/RemoveAttributeOptionAction.java 2011-09-29 07:41:04 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/attribute/RemoveAttributeOptionAction.java 1970-01-01 00:00:00 +0000
@@ -1,101 +0,0 @@
-/*
- * 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.
- */
-
-package org.hisp.dhis.dataadmin.action.attribute;
-
-import org.hisp.dhis.attribute.AttributeService;
-import org.hisp.dhis.common.DeleteNotAllowedException;
-import org.hisp.dhis.i18n.I18n;
-
-import com.opensymphony.xwork2.Action;
-
-/**
- * @author mortenoh
- */
-public class RemoveAttributeOptionAction
- implements Action
-{
- // -------------------------------------------------------------------------
- // Dependencies
- // -------------------------------------------------------------------------
-
- private AttributeService attributeService;
-
- public void setAttributeService( AttributeService attributeService )
- {
- this.attributeService = attributeService;
- }
-
- private I18n i18n;
-
- public void setI18n( I18n i18n )
- {
- this.i18n = i18n;
- }
-
- // -------------------------------------------------------------------------
- // Input & Output
- // -------------------------------------------------------------------------
-
- private Integer id;
-
- public void setId( Integer id )
- {
- this.id = id;
- }
-
- private String message;
-
- public String getMessage()
- {
- return message;
- }
-
- // -------------------------------------------------------------------------
- // Action implementation
- // -------------------------------------------------------------------------
-
- @Override
- public String execute()
- {
- try
- {
- attributeService.deleteAttributeOption( attributeService.getAttributeOption( id ) );
- }
- catch ( DeleteNotAllowedException ex )
- {
- if ( ex.getErrorCode().equals( DeleteNotAllowedException.ERROR_ASSOCIATED_BY_OTHER_OBJECTS ) )
- {
- message = i18n.getString( "object_not_deleted_associated_by_objects" ) + " " + ex.getMessage();
-
- return ERROR;
- }
- }
-
- return SUCCESS;
- }
-}
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/attribute/UpdateAttributeAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/attribute/UpdateAttributeAction.java 2011-09-21 12:46:20 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/attribute/UpdateAttributeAction.java 2011-10-03 09:23:01 +0000
@@ -27,13 +27,7 @@
package org.hisp.dhis.dataadmin.action.attribute;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
import org.hisp.dhis.attribute.Attribute;
-import org.hisp.dhis.attribute.AttributeOption;
import org.hisp.dhis.attribute.AttributeService;
import com.opensymphony.xwork2.Action;
@@ -115,13 +109,6 @@
this.userAttribute = userAttribute;
}
- private List<Integer> selectedAttributeOptions = new ArrayList<Integer>();
-
- public void setSelectedAttributeOptions( List<Integer> selectedAttributeOptions )
- {
- this.selectedAttributeOptions = selectedAttributeOptions;
- }
-
// -------------------------------------------------------------------------
// Action implementation
// -------------------------------------------------------------------------
@@ -141,18 +128,6 @@
attribute.setOrganisationUnitAttribute( organisationUnitAttribute );
attribute.setUserAttribute( userAttribute );
- Set<AttributeOption> attributeOptions = new HashSet<AttributeOption>();
-
- if ( valueType.compareTo( "multiple_choice" ) == 0 )
- {
- for ( Integer id : selectedAttributeOptions )
- {
- attributeOptions.add( attributeService.getAttributeOption( id ) );
- }
- }
-
- attribute.setAttributeOptions( attributeOptions );
-
attributeService.updateAttribute( attribute );
return SUCCESS;
=== removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/attribute/UpdateAttributeOptionAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/attribute/UpdateAttributeOptionAction.java 2011-09-08 10:38:20 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/attribute/UpdateAttributeOptionAction.java 1970-01-01 00:00:00 +0000
@@ -1,90 +0,0 @@
-/*
- * 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.
- */
-
-package org.hisp.dhis.dataadmin.action.attribute;
-
-import org.hisp.dhis.attribute.AttributeOption;
-import org.hisp.dhis.attribute.AttributeService;
-
-import com.opensymphony.xwork2.Action;
-
-/**
- * @author mortenoh
- */
-public class UpdateAttributeOptionAction
- implements Action
-{
- // -------------------------------------------------------------------------
- // Dependencies
- // -------------------------------------------------------------------------
-
- private AttributeService attributeService;
-
- public void setAttributeService( AttributeService attributeService )
- {
- this.attributeService = attributeService;
- }
-
- // -------------------------------------------------------------------------
- // Input & Output
- // -------------------------------------------------------------------------
-
- private Integer id;
-
- public void setId( Integer id )
- {
- this.id = id;
- }
-
- private String name;
-
- public void setName( String name )
- {
- this.name = name;
- }
-
- // -------------------------------------------------------------------------
- // Action implementation
- // -------------------------------------------------------------------------
-
- @Override
- public String execute()
- {
- AttributeOption attributeOption = attributeService.getAttributeOption( id );
-
- if ( attributeOption != null )
- {
- attributeOption.setName( name );
-
- attributeService.updateAttributeOption( attributeOption );
-
- return SUCCESS;
- }
-
- return ERROR;
- }
-}
=== removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/attribute/ValidateAttributeOptionAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/attribute/ValidateAttributeOptionAction.java 2011-09-08 10:38:20 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/attribute/ValidateAttributeOptionAction.java 1970-01-01 00:00:00 +0000
@@ -1,106 +0,0 @@
-/*
- * Copyright (c) 2004-2010, 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.dataadmin.action.attribute;
-
-import org.hisp.dhis.attribute.AttributeOption;
-import org.hisp.dhis.attribute.AttributeService;
-import org.hisp.dhis.i18n.I18n;
-
-import com.opensymphony.xwork2.Action;
-
-/**
- * @author mortenoh
- */
-public class ValidateAttributeOptionAction
- implements Action
-{
- // -------------------------------------------------------------------------
- // Dependencies
- // -------------------------------------------------------------------------
-
- private AttributeService attributeService;
-
- public void setAttributeService( AttributeService attributeService )
- {
- this.attributeService = attributeService;
- }
-
- private I18n i18n;
-
- public void setI18n( I18n i18n )
- {
- this.i18n = i18n;
- }
-
- // -------------------------------------------------------------------------
- // Input & Output
- // -------------------------------------------------------------------------
-
- private Integer id;
-
- public void setId( Integer id )
- {
- this.id = id;
- }
-
- private String name;
-
- public void setName( String name )
- {
- this.name = name;
- }
-
- private String message;
-
- public String getMessage()
- {
- return message;
- }
-
- // -------------------------------------------------------------------------
- // Action implementation
- // -------------------------------------------------------------------------
-
- @Override
- public String execute()
- {
- if ( name != null )
- {
- AttributeOption match = attributeService.getAttributeOptionByName( name );
-
- if ( match != null && (id == null || match.getId() != id) )
- {
- message = i18n.getString( "name_in_use" );
-
- return ERROR;
- }
- }
-
- return SUCCESS;
- }
-}
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/resources/META-INF/dhis/beans.xml 2011-09-21 15:41:25 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/resources/META-INF/dhis/beans.xml 2011-10-03 09:23:01 +0000
@@ -293,41 +293,21 @@
<property name="attributeService" ref="org.hisp.dhis.attribute.AttributeService" />
</bean>
- <bean id="org.hisp.dhis.dataadmin.action.attribute.GetAttributeOptionListAction" class="org.hisp.dhis.dataadmin.action.attribute.GetAttributeOptionListAction"
- scope="prototype">
- <property name="attributeService" ref="org.hisp.dhis.attribute.AttributeService" />
- </bean>
-
<bean id="org.hisp.dhis.dataadmin.action.attribute.GetAttributeAction" class="org.hisp.dhis.dataadmin.action.attribute.GetAttributeAction"
scope="prototype">
<property name="attributeService" ref="org.hisp.dhis.attribute.AttributeService" />
</bean>
- <bean id="org.hisp.dhis.dataadmin.action.attribute.GetAttributeOptionAction" class="org.hisp.dhis.dataadmin.action.attribute.GetAttributeOptionAction"
- scope="prototype">
- <property name="attributeService" ref="org.hisp.dhis.attribute.AttributeService" />
- </bean>
-
<bean id="org.hisp.dhis.dataadmin.action.attribute.ValidateAttributeAction" class="org.hisp.dhis.dataadmin.action.attribute.ValidateAttributeAction"
scope="prototype">
<property name="attributeService" ref="org.hisp.dhis.attribute.AttributeService" />
</bean>
- <bean id="org.hisp.dhis.dataadmin.action.attribute.ValidateAttributeOptionAction" class="org.hisp.dhis.dataadmin.action.attribute.ValidateAttributeOptionAction"
- scope="prototype">
- <property name="attributeService" ref="org.hisp.dhis.attribute.AttributeService" />
- </bean>
-
<bean id="org.hisp.dhis.dataadmin.action.attribute.AddAttributeAction" class="org.hisp.dhis.dataadmin.action.attribute.AddAttributeAction"
scope="prototype">
<property name="attributeService" ref="org.hisp.dhis.attribute.AttributeService" />
</bean>
- <bean id="org.hisp.dhis.dataadmin.action.attribute.AddAttributeOptionAction" class="org.hisp.dhis.dataadmin.action.attribute.AddAttributeOptionAction"
- scope="prototype">
- <property name="attributeService" ref="org.hisp.dhis.attribute.AttributeService" />
- </bean>
-
<bean id="org.hisp.dhis.dataadmin.action.attribute.SaveAttributeSortOrderAction" class="org.hisp.dhis.dataadmin.action.attribute.SaveAttributeSortOrderAction"
scope="prototype">
<property name="attributeService" ref="org.hisp.dhis.attribute.AttributeService" />
@@ -338,19 +318,9 @@
<property name="attributeService" ref="org.hisp.dhis.attribute.AttributeService" />
</bean>
- <bean id="org.hisp.dhis.dataadmin.action.attribute.UpdateAttributeOptionAction" class="org.hisp.dhis.dataadmin.action.attribute.UpdateAttributeOptionAction"
- scope="prototype">
- <property name="attributeService" ref="org.hisp.dhis.attribute.AttributeService" />
- </bean>
-
<bean id="org.hisp.dhis.dataadmin.action.attribute.RemoveAttributeAction" class="org.hisp.dhis.dataadmin.action.attribute.RemoveAttributeAction"
scope="prototype">
<property name="attributeService" ref="org.hisp.dhis.attribute.AttributeService" />
</bean>
- <bean id="org.hisp.dhis.dataadmin.action.attribute.RemoveAttributeOptionAction" class="org.hisp.dhis.dataadmin.action.attribute.RemoveAttributeOptionAction"
- scope="prototype">
- <property name="attributeService" ref="org.hisp.dhis.attribute.AttributeService" />
- </bean>
-
</beans>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/resources/struts.xml'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/resources/struts.xml 2011-09-28 09:08:07 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/resources/struts.xml 2011-10-03 09:23:01 +0000
@@ -485,13 +485,6 @@
<param name="stylesheets">../dhis-web-commons/paging/paging.css</param>
</action>
- <action name="attributeOption" class="org.hisp.dhis.dataadmin.action.attribute.GetAttributeOptionListAction">
- <result name="success" type="velocity">/main.vm</result>
- <param name="menu">/dhis-web-maintenance-dataadmin/menu.vm</param>
- <param name="page">/dhis-web-maintenance-dataadmin/attributeOption.vm</param>
- <param name="stylesheets">../dhis-web-commons/paging/paging.css</param>
- </action>
-
<action name="showAddAttributeForm" class="org.hisp.dhis.dataadmin.action.NoAction">
<result name="success" type="velocity">/main.vm</result>
<param name="menu">/dhis-web-maintenance-dataadmin/menu.vm</param>
@@ -500,14 +493,6 @@
<param name="requiredAuthorities">F_DATAELEMENT_ADD</param>
</action>
- <action name="showAddAttributeOptionForm" class="org.hisp.dhis.dataadmin.action.NoAction">
- <result name="success" type="velocity">/main.vm</result>
- <param name="menu">/dhis-web-maintenance-dataadmin/menu.vm</param>
- <param name="page">/dhis-web-maintenance-dataadmin/addAttributeOptionForm.vm</param>
- <param name="stylesheets">../dhis-web-commons/paging/paging.css</param>
- <param name="requiredAuthorities">F_DATAELEMENT_ADD</param>
- </action>
-
<action name="showUpdateAttributeForm" class="org.hisp.dhis.dataadmin.action.attribute.GetAttributeAction">
<result name="success" type="velocity">/main.vm</result>
<param name="menu">/dhis-web-maintenance-dataadmin/menu.vm</param>
@@ -516,14 +501,6 @@
<param name="requiredAuthorities">F_DATAELEMENT_UPDATE</param>
</action>
- <action name="showUpdateAttributeOptionForm" class="org.hisp.dhis.dataadmin.action.attribute.GetAttributeOptionAction">
- <result name="success" type="velocity">/main.vm</result>
- <param name="menu">/dhis-web-maintenance-dataadmin/menu.vm</param>
- <param name="page">/dhis-web-maintenance-dataadmin/updateAttributeOptionForm.vm</param>
- <param name="stylesheets">../dhis-web-commons/paging/paging.css</param>
- <param name="requiredAuthorities">F_DATAELEMENT_UPDATE</param>
- </action>
-
<action name="showSortAttributeForm" class="org.hisp.dhis.dataadmin.action.attribute.GetAttributeListSortOrderAction">
<result name="success" type="velocity">/main.vm</result>
<param name="page">/dhis-web-maintenance-dataadmin/sortAttributeForm.vm</param>
@@ -535,12 +512,6 @@
<param name="requiredAuthorities">F_DATAELEMENT_ADD</param>
</action>
- <action name="addAttributeOption" class="org.hisp.dhis.dataadmin.action.attribute.AddAttributeOptionAction">
- <result name="success" type="redirect">attributeOption.action</result>
- <result name="error" type="redirect">index.action</result>
- <param name="requiredAuthorities">F_DATAELEMENT_ADD</param>
- </action>
-
<action name="saveAttributeSortOrder" class="org.hisp.dhis.dataadmin.action.attribute.SaveAttributeSortOrderAction">
<result name="success" type="redirect">attribute.action</result>
<param name="requiredAuthorities">F_DATAELEMENT_UPDATE</param>
@@ -552,12 +523,6 @@
<param name="requiredAuthorities">F_DATAELEMENT_UPDATE</param>
</action>
- <action name="updateAttributeOption" class="org.hisp.dhis.dataadmin.action.attribute.UpdateAttributeOptionAction">
- <result name="success" type="redirect">attributeOption.action</result>
- <result name="error" type="redirect">index.action</result>
- <param name="requiredAuthorities">F_DATAELEMENT_UPDATE</param>
- </action>
-
<action name="removeAttribute" class="org.hisp.dhis.dataadmin.action.attribute.RemoveAttributeAction">
<result name="success" type="velocity-json">
/dhis-web-commons/ajax/jsonResponseSuccess.vm
@@ -569,29 +534,12 @@
<param name="requiredAuthorities">F_DATAELEMENT_DELETE</param>
</action>
- <action name="removeAttributeOption" class="org.hisp.dhis.dataadmin.action.attribute.RemoveAttributeOptionAction">
- <result name="success" type="velocity-json">
- /dhis-web-commons/ajax/jsonResponseSuccess.vm
- </result>
- <result name="error" type="velocity-json">
- /dhis-web-commons/ajax/jsonResponseError.vm
- </result>
- <param name="onExceptionReturn">plainTextError</param>
- <param name="requiredAuthorities">F_DATAELEMENT_DELETE</param>
- </action>
-
<action name="getAttribute" class="org.hisp.dhis.dataadmin.action.attribute.GetAttributeAction">
<result name="success" type="velocity-json">
/dhis-web-maintenance-dataadmin/jsonAttribute.vm</result>
<param name="onExceptionReturn">plainTextError</param>
</action>
- <action name="getAttributeOption" class="org.hisp.dhis.dataadmin.action.attribute.GetAttributeOptionAction">
- <result name="success" type="velocity-json">
- /dhis-web-maintenance-dataadmin/jsonAttributeOption.vm</result>
- <param name="onExceptionReturn">plainTextError</param>
- </action>
-
<action name="validateAttribute" class="org.hisp.dhis.dataadmin.action.attribute.ValidateAttributeAction">
<result name="success" type="velocity-json">
/dhis-web-commons/ajax/jsonResponseSuccess.vm
@@ -602,15 +550,5 @@
<param name="onExceptionReturn">plainTextError</param>
</action>
- <action name="validateAttributeOption" class="org.hisp.dhis.dataadmin.action.attribute.ValidateAttributeOptionAction">
- <result name="success" type="velocity-json">
- /dhis-web-commons/ajax/jsonResponseSuccess.vm
- </result>
- <result name="error" type="velocity-json">
- /dhis-web-commons/ajax/jsonResponseError.vm
- </result>
- <param name="onExceptionReturn">plainTextError</param>
- </action>
-
</package>
</struts>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/addAttributeForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/addAttributeForm.vm 2011-09-21 12:46:20 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/addAttributeForm.vm 2011-10-03 09:23:01 +0000
@@ -3,12 +3,10 @@
jQuery(document).ready( function()
{
validation2( 'addAttributeForm', function( form ) {
- $("#selectedAttributeOptions").children().attr("selected", "selected");
form.submit();
}, {
'beforeValidateHandler' : function()
{
- listValidator( 'memberValidator', 'selectedAttributeOptions' );
},
'rules': getValidationRules("attribute")
});
@@ -17,19 +15,6 @@
$("#valueType").bind("change", onValueTypeChange);
$("#valueType").change();
-
- jQuery("#availableAttributeOptions").dhisAjaxSelect({
- source: "../dhis-web-commons-ajax-json/getAttributeOptions.action",
- iterator: "attributeOptions",
- connectedTo: 'selectedAttributeOptions',
- handler: function(item) {
- var option = jQuery("<option />");
- option.text( item.name );
- option.attr( "value", item.id );
-
- return option;
- }
- });
});
</script>
@@ -76,47 +61,10 @@
<option value="integer" >$i18n.getString( "integer" )</option>
<option value="positive_integer">$i18n.getString( "positive_integer" )</option>
<option value="negative_integer">$i18n.getString( "negative_integer" )</option>
- <option value="multiple_choice">$i18n.getString( "multiple_choice" )</option>
</select>
</td>
</tr>
- <tr id="multipleChoice" style="display: none;">
- <td colspan="3">
- <table>
-
- <col style="width: 300px"/>
- <col/>
- <col style="width: 300px"/>
-
- <tr>
- <th>$i18n.getString( "available_attribute_options" )</th>
- <th></th>
- <th>$i18n.getString( "selected_attribute_options" )
- <select id="memberValidator" multiple="multiple" style="display:none"/>
- </th>
- </tr>
-
- <tr>
- <td>
- <select id="availableAttributeOptions" name="availableAttributeOptions" multiple="multiple" style="height: 200px; width: 100%;"></select>
- </td>
-
- <td style="text-align:center">
- <input type="button" value=">" title="$i18n.getString( 'move_selected' )" style="width:50px" onclick="dhisAjaxSelect_moveAllSelected( 'availableAttributeOptions' );"/><br/>
- <input type="button" value="<" title="$i18n.getString( 'remove_selected' )" style="width:50px" onclick="dhisAjaxSelect_moveAllSelected( 'selectedAttributeOptions' );"/><br/>
- <input type="button" value=">>" title="$i18n.getString('move_all')" style="width:50px" onclick="dhisAjaxSelect_moveAll( 'availableAttributeOptions' );"/><br/>
- <input type="button" value="<<" title="$i18n.getString('remove_all')" style="width:50px" onclick="dhisAjaxSelect_moveAll( 'selectedAttributeOptions' );"/>
- </td>
-
- <td>
- <select id="selectedAttributeOptions" name="selectedAttributeOptions" multiple="multiple" style="height: 200px; width: 100%; margin-top: 22px;"></select>
- </td>
- </tr>
- </table>
- </td>
- </tr>
-
<tr>
<td colspan="2">
<br/>
=== removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/addAttributeOptionForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/addAttributeOptionForm.vm 2011-09-07 13:42:12 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/addAttributeOptionForm.vm 1970-01-01 00:00:00 +0000
@@ -1,37 +0,0 @@
-<script type="text/javascript">
- jQuery(document).ready( function()
- {
- var rules = getValidationRules("attributeOption");
-
- validation2( 'addAttributeOptionForm', function( form ){ form.submit(); },
- {
- 'rules': rules
- });
-
- checkValueIsExist( "name", "validateAttributeOption.action" );
- });
-</script>
-
-<h3>$i18n.getString( "create_new_attribute_option" )</h3>
-
-<form id="addAttributeOptionForm" action="addAttributeOption.action" method="post" >
-
-<table>
- <tr>
- <th colspan="2">$i18n.getString( "details" )</th>
- </tr>
-
- <tr>
- <td><label for="name">$i18n.getString( "name" ) <em title="$i18n.getString( 'required' )" class="required">*</em></label></td>
- <td><input type="text" id="name" name="name" style="width:20em"/></td>
- </tr>
-
- <tr>
- <td colspan="2">
- <input type="submit" value="$i18n.getString( 'add' )" style="width:10em"/>
- <input type="button" value="$i18n.getString( 'cancel' )" onclick="window.location.href='attributeOption.action'" style="width:10em"/>
- </td>
- </tr>
-</table>
-
-</form>
=== removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/attributeOption.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/attributeOption.vm 2011-09-28 09:08:07 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/attributeOption.vm 1970-01-01 00:00:00 +0000
@@ -1,79 +0,0 @@
-<script type="text/javascript">
- jQuery(document).ready(function() {
- tableSorter( 'listTable' );
- });
-
- var i18n_confirm_delete = '$encoder.jsEscape( $i18n.getString( "confirm_delete_attribute_option" ) , "'")';
-
- function showAttributeOptionDetails( attributeOptionId )
- {
- jQuery.post( 'getAttributeOption.action', { id:attributeOptionId },
- function( json ) {
- setInnerHTML( 'nameField', json.attributeOption.name );
- showDetails();
- });
- }
-
- function removeAttributeOption( attributeOptionId, attributeOptionName )
- {
- removeItem( attributeOptionId, attributeOptionName, i18n_confirm_delete, 'removeAttributeOption.action' );
- }
-</script>
-
-<h3>$i18n.getString( "attribute_option_management" ) #openHelp( "attribute_option" )</h3>
-
-<table class="mainPageTable">
- <tr>
- <td style="vertical-align:top">
- <table width="100%">
- <tr>
- <td>#filterDiv( "attribute_option" )</td>
- <td colspan="4" style="text-align:right">
- <input type="button" value="$i18n.getString( 'add_new' )" onclick="window.location.href='showAddAttributeOptionForm.action'" style="width:80px"/>
- </td>
- </tr>
- </table>
- <table class="listTable" id="listTable">
- <col/>
- <col width="96px"/>
- <thead>
- <tr>
- <th>$i18n.getString( "name" )</th>
- <th class="{sorter: false}">$i18n.getString( "operations" )</th>
- </tr>
- </thead>
- <tbody id="list">
- #foreach( $attributeOption in $attributeOptions )
- <tr id="tr${attributeOption.id}">
- <td onclick="javascript:showAttributeOptionDetails( $attributeOption.id )">$encoder.htmlEncode( $attributeOption.name )</td>
- <td style="text-align:right">
- <a href="showUpdateAttributeOptionForm.action?id=$attributeOption.id" title="$i18n.getString( 'edit' )"><img src="../images/edit.png" alt="$i18n.getString( 'edit' )"/></a>
- <a href="javascript:removeAttributeOption( $attributeOption.id, '$encoder.jsEncode( $attributeOption.name )' )" title="$i18n.getString( 'remove' )"><img src="../images/delete.png" alt="$i18n.getString( 'remove' )"/></a>
- <a href="javascript:showAttributeOptionDetails( $attributeOption.id )" title="$i18n.getString( 'show_details' )"><img src="../images/information.png" alt="$i18n.getString( 'show_details' )"/></a>
- </td>
- </tr>
- #end
- </tbody>
- </table>
- <p></p>
- #parse( "/dhis-web-commons/paging/paging.vm" )
- </td>
-
- <td style="width:20em; padding-left:2em; vertical-align:top">
- <div id="detailsArea" style="display:none">
- <div style="float:right">
- <a href="javascript:hideDetails()" title="$i18n.getString( 'hide_details' )"><img src="../images/close.png" alt="$i18n.getString( 'hide_details' )"/></a>
- </div>
- <p><label>$i18n.getString( "name" ):</label><br/><span id="nameField"></span></p>
- </div>
-
- <div id="warningArea" style="position:fixed;right:10px;top:200px;display:none">
- <div style="float:right">
- <a href="javascript:hideWarning()" title="$i18n.getString( 'hide_warning' )"><img src="../images/close.png" alt="$i18n.getString( 'hide_warning' )"/></a>
- </div>
- <p><span id="warningField"></span></p>
- </div>
- </td>
-
- </tr>
-</table>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/index.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/index.vm 2011-09-07 13:42:12 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/index.vm 2011-10-03 09:23:01 +0000
@@ -25,5 +25,4 @@
#introListImgItem( "showCache.action" "cache_statistics" "cachestatistics" )
#introListImgItem( "constant.action" "constant" "constant" )
#introListImgItem( "attribute.action" "attribute" "constant" )
- #introListImgItem( "attributeOption.action" "attribute_option" "constant" )
</ul>
=== removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/jsonAttributeOption.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/jsonAttributeOption.vm 2011-09-28 09:08:07 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/jsonAttributeOption.vm 1970-01-01 00:00:00 +0000
@@ -1,6 +0,0 @@
-{ "attributeOption":
- {
- "id": "$!{attributeOption.id}",
- "name": "$!encoder.jsonEncode( ${attributeOption.name} )"
- }
-}
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/menu.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/menu.vm 2011-09-07 13:42:12 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/menu.vm 2011-10-03 09:23:01 +0000
@@ -29,5 +29,4 @@
<ul>
<li><a href="attribute.action">$i18n.getString( "attribute" ) </a></li>
- <li><a href="attributeOption.action">$i18n.getString( "attribute_option" ) </a></li>
</ul>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/updateAttributeForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/updateAttributeForm.vm 2011-09-21 12:46:20 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/updateAttributeForm.vm 2011-10-03 09:23:01 +0000
@@ -3,12 +3,10 @@
jQuery(document).ready( function()
{
validation2( 'updateAttributeForm', function( form ) {
- $("#selectedAttributeOptions").children().attr("selected", "selected");
form.submit();
}, {
'beforeValidateHandler' : function()
{
- listValidator( 'memberValidator', 'selectedAttributeOptions' );
},
'rules': getValidationRules("attribute")
});
@@ -17,19 +15,6 @@
$("#valueType").bind("change", onValueTypeChange);
$("#valueType").change();
-
- jQuery("#availableAttributeOptions").dhisAjaxSelect({
- source: "../dhis-web-commons-ajax-json/getAttributeOptions.action",
- iterator: "attributeOptions",
- connectedTo: 'selectedAttributeOptions',
- handler: function(item) {
- var option = jQuery("<option />");
- option.text( item.name );
- option.attr( "value", item.id );
-
- return option;
- }
- });
});
</script>
@@ -77,53 +62,11 @@
<option value="integer" #if( $attribute.valueType == 'integer') selected="selected" #end>$i18n.getString( "integer" )</option>
<option value="positive_integer" #if( $attribute.valueType == 'positive_integer') selected="selected" #end>$i18n.getString( "positive_integer" )</option>
<option value="negative_integer" #if( $attribute.valueType == 'negative_integer') selected="selected" #end>$i18n.getString( "negative_integer" )</option>
- <option value="multiple_choice" #if( $attribute.valueType == 'multiple_choice') selected="selected" #end>$i18n.getString( "multiple_choice" )</option>
</select>
</td>
</tr>
<tr>
- <td colspan="3" id="multipleChoice" style="display: none;">
- <br />
- <table>
-
- <col style="width: 300px"/>
- <col/>
- <col style="width: 300px"/>
-
- <tr>
- <th>$i18n.getString( "available_attribute_options" )</th>
- <th></th>
- <th>$i18n.getString( "selected_attribute_options" )
- <select id="memberValidator" multiple="multiple" style="display:none"/>
- </th>
- </tr>
-
- <tr>
- <td>
- <select id="availableAttributeOptions" name="availableAttributeOptions" multiple="multiple" style="height: 200px; width: 100%;"></select>
- </td>
-
- <td style="text-align:center">
- <input type="button" value=">" title="$i18n.getString( 'move_selected' )" style="width:50px" onclick="dhisAjaxSelect_moveAllSelected( 'availableAttributeOptions' );"/><br/>
- <input type="button" value="<" title="$i18n.getString( 'remove_selected' )" style="width:50px" onclick="dhisAjaxSelect_moveAllSelected( 'selectedAttributeOptions' );"/><br/>
- <input type="button" value=">>" title="$i18n.getString('move_all')" style="width:50px" onclick="dhisAjaxSelect_moveAll( 'availableAttributeOptions' );"/><br/>
- <input type="button" value="<<" title="$i18n.getString('remove_all')" style="width:50px" onclick="dhisAjaxSelect_moveAll( 'selectedAttributeOptions' );"/>
- </td>
-
- <td>
- <select id="selectedAttributeOptions" name="selectedAttributeOptions" multiple="multiple" style="height: 200px; width: 100%; margin-top: 22px;">
- #foreach( $attributeOption in $attribute.attributeOptions )
- <option value="$attributeOption.id">$encoder.htmlEncode( $attributeOption.name )</option>
- #end
- </select>
- </td>
- </tr>
- </table>
- </td>
- </tr>
-
- <tr>
<td colspan="2">
<br/>
<input type="submit" value="$i18n.getString( 'save' )" style="width:10em"/>
=== removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/updateAttributeOptionForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/updateAttributeOptionForm.vm 2011-09-08 19:22:56 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/updateAttributeOptionForm.vm 1970-01-01 00:00:00 +0000
@@ -1,38 +0,0 @@
-<script type="text/javascript">
- jQuery(document).ready( function()
- {
- var rules = getValidationRules("attributeOption");
-
- validation2( 'updateAttributeOptionForm', function( form ){ form.submit(); },
- {
- 'rules': rules
- });
-
- checkValueIsExist( "name", "validateAttributeOption.action", {id: $attributeOption.id} );
- });
-</script>
-
-<h3>$i18n.getString( "edit_attribute_option" )</h3>
-
-<form id="updateAttributeOptionForm" action="updateAttributeOption.action" method="post" >
-<input type="hidden" id="id" name="id" value="$!attributeOption.id"/>
-
-<table>
- <tr>
- <th colspan="2">$i18n.getString( "details" )</th>
- </tr>
-
- <tr>
- <td><label for="name">$i18n.getString( "name" ) <em title="$i18n.getString( 'required' )" class="required">*</em></label></td>
- <td><input type="text" id="name" name="name" value="$encoder.htmlEncode( $!attributeOption.name )" style="width:20em"/></td>
- </tr>
-
- <tr>
- <td colspan="2">
- <input type="submit" value="$i18n.getString( 'save' )" style="width:10em"/>
- <input type="button" value="$i18n.getString( 'cancel' )" onclick="window.location.href='attributeOption.action'" style="width:10em"/>
- </td>
- </tr>
-</table>
-
-</form>