dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #28112
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 14009: Add UI for CategoryOptionGroupSet object in data dictionary web module.
------------------------------------------------------------
revno: 14009
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2014-02-13 19:09:31 +0700
message:
Add UI for CategoryOptionGroupSet object in data dictionary web module.
added:
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/DefaultCategoryOptionGroupSetService.java
dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonCategoryOptionGroupSet.vm
dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonCategoryOptionGroups.vm
dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetCategoryOptionGroupsAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/categoryoptiongroupset/
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/categoryoptiongroupset/AddCategoryOptionGroupSetAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/categoryoptiongroupset/GetCategoryOptionGroupSetAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/categoryoptiongroupset/GetCategoryOptionGroupSetListAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/categoryoptiongroupset/RemoveCategoryOptionGroupSetAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/categoryoptiongroupset/ShowAddCategoryOptionGroupSetAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/categoryoptiongroupset/ShowUpdateCategoryOptionGroupSetAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/categoryoptiongroupset/UpdateCategoryOptionGroupSetAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/categoryoptiongroupset/ValidateCategoryOptionGroupSetAction.java
modified:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/CategoryOptionGroupSet.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/CategoryOptionGroupSetService.java
dhis-2/dhis-services/dhis-service-core/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-datadictionary/src/main/java/org/hisp/dhis/dd/action/categoryoptiongroup/ShowAddCategoryOptionGroupAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/categoryoptiongroup/ShowUpdateCategoryOptionGroupAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/categoryoptiongroup/UpdateCategoryOptionGroupAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/categoryoptiongroup/ValidateCategoryOptionGroupAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/resources/META-INF/dhis/beans.xml
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/resources/org/hisp/dhis/dd/i18n_module.properties
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/resources/struts.xml
--
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/dataelement/CategoryOptionGroupSet.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/CategoryOptionGroupSet.java 2014-02-12 15:22:28 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/CategoryOptionGroupSet.java 2014-02-13 12:09:31 +0000
@@ -40,15 +40,15 @@
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
/**
-* @author Lars Helge Overland
-*/
-@JacksonXmlRootElement(localName = "categoryOptionGroupSet", namespace = DxfNamespaces.DXF_2_0)
+ * @author Lars Helge Overland
+ */
+@JacksonXmlRootElement( localName = "categoryOptionGroupSet", namespace = DxfNamespaces.DXF_2_0 )
public class CategoryOptionGroupSet
extends BaseDimensionalObject
{
@Scanned
private List<CategoryOptionGroup> members = new ArrayList<CategoryOptionGroup>();
-
+
private boolean dataDimension = true;
// -------------------------------------------------------------------------
@@ -68,12 +68,13 @@
// Logic
// -------------------------------------------------------------------------
- //TODO link group set to category to avoid conflicting grouping of category option combos
-
+ // TODO link group set to category to avoid conflicting grouping of category
+ // option combos
+
public CategoryOptionGroup getGroup( DataElementCategoryOptionCombo optionCombo )
{
Set<DataElementCategoryOption> categoryOptions = optionCombo.getCategoryOptions();
-
+
for ( CategoryOptionGroup group : members )
{
if ( !CollectionUtils.intersection( group.getMembers(), categoryOptions ).isEmpty() )
@@ -108,4 +109,18 @@
{
this.dataDimension = dataDimension;
}
+
+ // -------------------------------------------------------------------------
+ // Logic
+ // -------------------------------------------------------------------------
+
+ public void addCategoryOptionGroup( CategoryOptionGroup categoryOptionGroup )
+ {
+ members.add( categoryOptionGroup );
+ }
+
+ public void removeCategoryOptionGroup( CategoryOptionGroup categoryOptionGroup )
+ {
+ members.remove( categoryOptionGroup );
+ }
}
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/CategoryOptionGroupSetService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/CategoryOptionGroupSetService.java 2014-02-12 10:52:22 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/CategoryOptionGroupSetService.java 2014-02-13 12:09:31 +0000
@@ -1,6 +1,105 @@
package org.hisp.dhis.dataelement;
+import java.util.Collection;
+
public interface CategoryOptionGroupSetService
{
-
+ String ID = CategoryOptionGroupSetService.class.getName();
+
+ /**
+ * Adds an {@link CategoryOptionGroupSet}
+ *
+ * @param groupSet The to CategoryOptionGroupSet add.
+ *
+ * @return A generated unique id of the added {@link CategoryOptionGroupSet}
+ * .
+ */
+ int addCategoryOptionGroupSet( CategoryOptionGroupSet groupSet );
+
+ /**
+ * Deletes a {@link CategoryOptionGroupSet}.
+ *
+ * @param groupSet the CategoryOptionGroupSet to delete.
+ */
+ void deleteCategoryOptionGroupSet( CategoryOptionGroupSet groupSet );
+
+ /**
+ * Updates an {@link CategoryOptionGroupSet}.
+ *
+ * @param groupSet the CategoryOptionGroupSet to update.
+ */
+ void updateCategoryOptionGroupSet( CategoryOptionGroupSet groupSet );
+
+ /**
+ * Returns a {@link CategoryOptionGroupSet}.
+ *
+ * @param id the id of the CategoryOptionGroupSet to return.
+ *
+ * @return the CategoryOptionGroupSet with the given id
+ */
+ CategoryOptionGroupSet getCategoryOptionGroupSet( int id );
+
+ /**
+ * Returns the {@link CategoryOptionGroupSet} with the given UID.
+ *
+ * @param uid the UID.
+ * @return the CategoryOptionGroupSet with the given UID, or null if no
+ * match.
+ */
+ CategoryOptionGroupSet getCategoryOptionGroupSetByUid( String uid );
+
+ /**
+ * Returns a {@link CategoryOptionGroupSet} with a given name.
+ *
+ * @param name the name of the CategoryOptionGroupSet to return.
+ *
+ * @return the CategoryOptionGroupSet with the given name, or null if no
+ * match.
+ */
+ CategoryOptionGroupSet getCategoryOptionGroupSetByName( String name );
+
+ /**
+ * Returns all {@link CategoryOptionGroupSet}
+ *
+ * @return a collection of all CategoryOptionGroupSet, or an empty
+ * collection if there are no CategoryOptionGroupSets.
+ */
+ Collection<CategoryOptionGroupSet> getAllCategoryOptionGroupSets();
+
+ /**
+ * Returns {@link CategoryOptionGroupSet} list with paging
+ *
+ * @param name Keyword for searching by name
+ * @param first
+ * @param max
+ * @return a collection of all CategoryOptionGroupSet, or an empty
+ * collection if there are no CategoryOptionGroupSets.
+ */
+ Collection<CategoryOptionGroupSet> getCategoryOptionGroupSetsBetweenByName( String name, int first, int max );
+
+ /**
+ * Returns The number of all CategoryOptionGroupSet available
+ *
+ */
+ int getCategoryOptionGroupSetCount();
+
+ /**
+ * Returns {@link CategoryOptionGroupSet} list with paging
+ *
+ * @param first
+ * @param max
+ * @return a collection of all CategoryOptionGroupSet, or an empty
+ * collection if there are no CategoryOptionGroupSets.
+ */
+ Collection<CategoryOptionGroupSet> getCategoryOptionGroupSetsBetween( int first, int max );
+
+ /**
+ * Returns The number of CategoryOptionGroupSets with the key searched
+ *
+ * @param name Keyword for searching by name
+ *
+ * @return A number
+ *
+ */
+ int getCategoryOptionGroupSetCountByName( String name );
}
=== added file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/DefaultCategoryOptionGroupSetService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/DefaultCategoryOptionGroupSetService.java 1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/DefaultCategoryOptionGroupSetService.java 2014-02-13 12:09:31 +0000
@@ -0,0 +1,137 @@
+/*
+ * Copyright (c) 2004-2013, 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.dataelement;
+
+import static org.hisp.dhis.i18n.I18nUtils.i18n;
+
+import java.util.Collection;
+
+import org.hisp.dhis.common.GenericIdentifiableObjectStore;
+import org.hisp.dhis.i18n.I18nService;
+import org.springframework.transaction.annotation.Transactional;
+
+/**
+ * @author Chau Thu Tran
+ *
+ * @version $ DefaultCategoryOptionGroupSetService.java Feb 12, 2014 11:38:43 PM
+ * $
+ */
+@Transactional
+public class DefaultCategoryOptionGroupSetService
+ implements CategoryOptionGroupSetService
+{
+ // -------------------------------------------------------------------------
+ // Dependencies
+ // -------------------------------------------------------------------------
+
+ private GenericIdentifiableObjectStore<CategoryOptionGroupSet> categoryOptionGroupSetStore;
+
+ public void setCategoryOptionGroupSetStore(
+ GenericIdentifiableObjectStore<CategoryOptionGroupSet> categoryOptionGroupSetStore )
+ {
+ this.categoryOptionGroupSetStore = categoryOptionGroupSetStore;
+ }
+
+ private I18nService i18nService;
+
+ public void setI18nService( I18nService service )
+ {
+ i18nService = service;
+ }
+
+ // -------------------------------------------------------------------------
+ // CategoryOptionGroupSet
+ // -------------------------------------------------------------------------
+
+ @Override
+ public int addCategoryOptionGroupSet( CategoryOptionGroupSet categoryOptionGroupSet )
+ {
+ return categoryOptionGroupSetStore.save( categoryOptionGroupSet );
+ }
+
+ @Override
+ public void deleteCategoryOptionGroupSet( CategoryOptionGroupSet categoryOptionGroupSet )
+ {
+ categoryOptionGroupSetStore.delete( categoryOptionGroupSet );
+ }
+
+ @Override
+ public void updateCategoryOptionGroupSet( CategoryOptionGroupSet categoryOptionGroupSet )
+ {
+ categoryOptionGroupSetStore.update( categoryOptionGroupSet );
+ }
+
+ @Override
+ public CategoryOptionGroupSet getCategoryOptionGroupSet( int id )
+ {
+ return i18n( i18nService, categoryOptionGroupSetStore.get( id ) );
+ }
+
+ @Override
+ public CategoryOptionGroupSet getCategoryOptionGroupSetByUid( String uid )
+ {
+ return i18n( i18nService, categoryOptionGroupSetStore.getByUid( uid ) );
+ }
+
+ @Override
+ public CategoryOptionGroupSet getCategoryOptionGroupSetByName( String name )
+ {
+ return i18n( i18nService, categoryOptionGroupSetStore.getByName( name ) );
+ }
+
+ @Override
+ public Collection<CategoryOptionGroupSet> getAllCategoryOptionGroupSets()
+ {
+ return i18n( i18nService, categoryOptionGroupSetStore.getAll() );
+ }
+
+ @Override
+ public Collection<CategoryOptionGroupSet> getCategoryOptionGroupSetsBetweenByName( String name, int first, int max )
+ {
+ return i18n( i18nService, categoryOptionGroupSetStore.getAllLikeNameOrderedName( name, first, max ) );
+ }
+
+ @Override
+ public int getCategoryOptionGroupSetCount()
+ {
+ return categoryOptionGroupSetStore.getCount();
+ }
+
+ @Override
+ public Collection<CategoryOptionGroupSet> getCategoryOptionGroupSetsBetween( int first, int max )
+ {
+ return i18n( i18nService, categoryOptionGroupSetStore.getAllOrderedName( first, max ) );
+ }
+
+ @Override
+ public int getCategoryOptionGroupSetCountByName( String name )
+ {
+ return categoryOptionGroupSetStore.getCountLikeName( name );
+ }
+
+}
=== 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 2014-02-13 09:51:36 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/resources/META-INF/dhis/beans.xml 2014-02-13 12:09:31 +0000
@@ -631,7 +631,12 @@
<property name="categoryOptionGroupStore" ref="org.hisp.dhis.dataelement.CategoryOptionGroupStore" />
<property name="i18nService" ref="org.hisp.dhis.i18n.I18nService" />
</bean>
-
+
+ <bean id="org.hisp.dhis.dataelement.CategoryOptionGroupSetService" class="org.hisp.dhis.dataelement.DefaultCategoryOptionGroupSetService">
+ <property name="categoryOptionGroupSetStore" ref="org.hisp.dhis.dataelement.CategoryOptionGroupSetStore" />
+ <property name="i18nService" ref="org.hisp.dhis.i18n.I18nService" />
+ </bean>
+
<bean id="org.hisp.dhis.mapping.MappingService" class="org.hisp.dhis.mapping.DefaultMappingService">
<property name="mapStore" ref="org.hisp.dhis.mapping.MapStore" />
<property name="mapViewStore" ref="org.hisp.dhis.mapping.MapViewStore" />
=== added file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonCategoryOptionGroupSet.vm'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonCategoryOptionGroupSet.vm 1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonCategoryOptionGroupSet.vm 2014-02-13 12:09:31 +0000
@@ -0,0 +1,8 @@
+{ "categoryOptionGroupSet":
+ {
+ "id": $!{categoryOptionGroupSet.id},
+ "name": "$!encoder.jsonEncode( ${categoryOptionGroupSet.displayName} )",
+ "description": "$!encoder.jsonEncode( ${categoryOptionGroupSet.description} )",
+ "memberCount": "$categoryOptionGroupSet.members.size()"
+ }
+}
=== added file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonCategoryOptionGroups.vm'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonCategoryOptionGroups.vm 1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonCategoryOptionGroups.vm 2014-02-13 12:09:31 +0000
@@ -0,0 +1,9 @@
+{ "categoryOptionGroup":
+ {
+ "id": $!{categoryOptionGroup.id},
+ "name": "$!encoder.jsonEncode( ${categoryOptionGroup.displayName} )",
+ "shortName": "$!encoder.jsonEncode( ${categoryOptionGroup.displayShortName} )",
+ "code": "$!encoder.jsonEncode( ${categoryOptionGroup.code} )",
+ "memberCount": "$categoryOptionGroup.members.size()"
+ }
+}
=== added file 'dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetCategoryOptionGroupsAction.java'
--- dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetCategoryOptionGroupsAction.java 1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetCategoryOptionGroupsAction.java 2014-02-13 12:09:31 +0000
@@ -0,0 +1,76 @@
+/*
+ * Copyright (c) 2004-2013, 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.common.comparator.IdentifiableObjectNameComparator;
+import org.hisp.dhis.dataelement.CategoryOptionGroup;
+import org.hisp.dhis.dataelement.CategoryOptionGroupService;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import com.opensymphony.xwork2.Action;
+
+/**
+ * @author Chau Thu Tran
+ *
+ * @version $ GetCategoryOptionGroupsAction.java Feb 13, 2014 6:17:33 PM $
+ */
+public class GetCategoryOptionGroupsAction
+ implements Action
+{
+ @Autowired
+ private CategoryOptionGroupService categoryOptionGroupService;
+
+ // -------------------------------------------------------------------------
+ // Output
+ // -------------------------------------------------------------------------
+
+ private List<CategoryOptionGroup> categoryOptionGroups;
+
+ public List<CategoryOptionGroup> getCategoryOptionGroups()
+ {
+ return categoryOptionGroups;
+ }
+
+ // -------------------------------------------------------------------------
+ // Action
+ // -------------------------------------------------------------------------
+
+ public String execute()
+ {
+ categoryOptionGroups = new ArrayList<CategoryOptionGroup>(
+ categoryOptionGroupService.getAllCategoryOptionGroups() );
+
+ Collections.sort( categoryOptionGroups, IdentifiableObjectNameComparator.INSTANCE );
+
+ return SUCCESS;
+ }
+}
=== 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 2014-01-23 15:04:07 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/resources/dhis-web-commons.xml 2014-02-13 12:09:31 +0000
@@ -637,6 +637,13 @@
</result>
<param name="onExceptionReturn">plainTextError</param>
</action>
+
+ <action name="getCategoryOptionGroups" class="org.hisp.dhis.commons.action.GetCategoryOptionGroupsAction">
+ <result name="success" type="velocity-json">
+ /dhis-web-commons/ajax/jsonCategoryOptionGroups.vm
+ </result>
+ <param name="onExceptionReturn">plainTextError</param>
+ </action>
<action name="getDataSet" class="org.hisp.dhis.commons.action.GetDataSetAction">
<result name="success" type="velocity-json">
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/categoryoptiongroup/ShowAddCategoryOptionGroupAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/categoryoptiongroup/ShowAddCategoryOptionGroupAction.java 2014-02-13 09:51:36 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/categoryoptiongroup/ShowAddCategoryOptionGroupAction.java 2014-02-13 12:09:31 +0000
@@ -66,17 +66,13 @@
// Action implementation
// -------------------------------------------------------------------------
- public void setDataElementCategoryService( DataElementCategoryService dataElementCategoryService )
- {
- this.dataElementCategoryService = dataElementCategoryService;
- }
-
@Override
public String execute()
throws Exception
{
- categoryOptions = new ArrayList<DataElementCategoryOption>( dataElementCategoryService.getAllDataElementCategoryOptions() );
-
+ categoryOptions = new ArrayList<DataElementCategoryOption>(
+ dataElementCategoryService.getAllDataElementCategoryOptions() );
+
return SUCCESS;
}
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/categoryoptiongroup/ShowUpdateCategoryOptionGroupAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/categoryoptiongroup/ShowUpdateCategoryOptionGroupAction.java 2014-02-13 09:51:36 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/categoryoptiongroup/ShowUpdateCategoryOptionGroupAction.java 2014-02-13 12:09:31 +0000
@@ -93,11 +93,6 @@
// Action implementation
// -------------------------------------------------------------------------
- public void setDataElementCategoryService( DataElementCategoryService dataElementCategoryService )
- {
- this.dataElementCategoryService = dataElementCategoryService;
- }
-
@Override
public String execute()
throws Exception
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/categoryoptiongroup/UpdateCategoryOptionGroupAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/categoryoptiongroup/UpdateCategoryOptionGroupAction.java 2014-02-13 09:51:36 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/categoryoptiongroup/UpdateCategoryOptionGroupAction.java 2014-02-13 12:09:31 +0000
@@ -114,7 +114,7 @@
.parseInt( id ) ) );
}
- categoryOptionGroupService.addCategoryOptionGroup( categoryOptionGroup );
+ categoryOptionGroupService.updateCategoryOptionGroup( categoryOptionGroup );
return SUCCESS;
}
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/categoryoptiongroup/ValidateCategoryOptionGroupAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/categoryoptiongroup/ValidateCategoryOptionGroupAction.java 2014-02-13 09:51:36 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/categoryoptiongroup/ValidateCategoryOptionGroupAction.java 2014-02-13 12:09:31 +0000
@@ -42,6 +42,7 @@
public class ValidateCategoryOptionGroupAction
implements Action
{
+
// -------------------------------------------------------------------------
// Dependencies
// -------------------------------------------------------------------------
@@ -116,7 +117,7 @@
}
}
-
+
if ( shortName != null )
{
CategoryOptionGroup match = categoryOptionGroupService.getCategoryOptionGroupByShortName( shortName );
=== added directory 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/categoryoptiongroupset'
=== added file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/categoryoptiongroupset/AddCategoryOptionGroupSetAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/categoryoptiongroupset/AddCategoryOptionGroupSetAction.java 1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/categoryoptiongroupset/AddCategoryOptionGroupSetAction.java 2014-02-13 12:09:31 +0000
@@ -0,0 +1,113 @@
+/*
+ * Copyright (c) 2004-2013, 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.dd.action.categoryoptiongroupset;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.hisp.dhis.dataelement.CategoryOptionGroupService;
+import org.hisp.dhis.dataelement.CategoryOptionGroupSet;
+import org.hisp.dhis.dataelement.CategoryOptionGroupSetService;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import com.opensymphony.xwork2.Action;
+
+/**
+ * @author Chau Thu Tran
+ *
+ * @version $ AddCategoryOptionGroupSetAction.java Feb 12, 2014 11:20:01 PM $
+ */
+public class AddCategoryOptionGroupSetAction
+ implements Action
+{
+ // -------------------------------------------------------------------------
+ // Dependencies
+ // -------------------------------------------------------------------------
+
+ @Autowired
+ private CategoryOptionGroupSetService categoryOptionGroupSetService;
+
+ @Autowired
+ private CategoryOptionGroupService categoryOptionGroupService;
+
+ // -------------------------------------------------------------------------
+ // Input
+ // -------------------------------------------------------------------------
+
+ private String name;
+
+ public void setName( String name )
+ {
+ this.name = name;
+ }
+
+ private String description;
+
+ public void setDescription( String description )
+ {
+ this.description = description;
+ }
+
+ private Boolean dataDimension;
+
+ public void setDataDimension( Boolean dataDimension )
+ {
+ this.dataDimension = dataDimension;
+ }
+
+ private List<String> groupMembers = new ArrayList<String>();
+
+ public void setGroupMembers( List<String> groupMembers )
+ {
+ this.groupMembers = groupMembers;
+ }
+
+ // -------------------------------------------------------------------------
+ // Action implementation
+ // -------------------------------------------------------------------------
+
+ @Override
+ public String execute()
+ throws Exception
+ {
+ CategoryOptionGroupSet categoryOptionGroupSet = new CategoryOptionGroupSet( name );
+ categoryOptionGroupSet.setDescription( description );
+ categoryOptionGroupSet.setDataDimension( dataDimension );
+
+ for ( String id : groupMembers )
+ {
+ categoryOptionGroupSet.addCategoryOptionGroup( categoryOptionGroupService.getCategoryOptionGroup( Integer
+ .parseInt( id ) ) );
+ }
+
+ categoryOptionGroupSetService.addCategoryOptionGroupSet( categoryOptionGroupSet );
+
+ return SUCCESS;
+ }
+
+}
=== added file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/categoryoptiongroupset/GetCategoryOptionGroupSetAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/categoryoptiongroupset/GetCategoryOptionGroupSetAction.java 1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/categoryoptiongroupset/GetCategoryOptionGroupSetAction.java 2014-02-13 12:09:31 +0000
@@ -0,0 +1,82 @@
+/*
+ * Copyright (c) 2004-2013, 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.dd.action.categoryoptiongroupset;
+
+import org.hisp.dhis.dataelement.CategoryOptionGroupSet;
+import org.hisp.dhis.dataelement.CategoryOptionGroupSetService;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import com.opensymphony.xwork2.Action;
+
+/**
+ * @author Chau Thu Tran
+ *
+ * @version $ GetCategoryOptionGroupSetAction.java Feb 12, 2014 11:27:01 PM $
+ */
+public class GetCategoryOptionGroupSetAction
+ implements Action
+{
+ // -------------------------------------------------------------------------
+ // Dependencies
+ // -------------------------------------------------------------------------
+
+ @Autowired
+ private CategoryOptionGroupSetService categoryOptionGroupSetService;
+
+ // -------------------------------------------------------------------------
+ // Input
+ // -------------------------------------------------------------------------
+
+ private int id;
+
+ public void setId( int id )
+ {
+ this.id = id;
+ }
+
+ private CategoryOptionGroupSet categoryOptionGroupSet;
+
+ public CategoryOptionGroupSet getCategoryOptionGroupSet()
+ {
+ return categoryOptionGroupSet;
+ }
+
+ // -------------------------------------------------------------------------
+ // Action implementation
+ // -------------------------------------------------------------------------
+
+ @Override
+ public String execute()
+ throws Exception
+ {
+ categoryOptionGroupSet = categoryOptionGroupSetService.getCategoryOptionGroupSet( id );
+
+ return SUCCESS;
+ }
+
+}
=== added file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/categoryoptiongroupset/GetCategoryOptionGroupSetListAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/categoryoptiongroupset/GetCategoryOptionGroupSetListAction.java 1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/categoryoptiongroupset/GetCategoryOptionGroupSetListAction.java 2014-02-13 12:09:31 +0000
@@ -0,0 +1,109 @@
+/*
+ * Copyright (c) 2004-2013, 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.dd.action.categoryoptiongroupset;
+
+import static org.apache.commons.lang.StringUtils.isNotBlank;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
+import org.hisp.dhis.dataelement.CategoryOptionGroupSet;
+import org.hisp.dhis.dataelement.CategoryOptionGroupSetService;
+import org.hisp.dhis.paging.ActionPagingSupport;
+import org.springframework.beans.factory.annotation.Autowired;
+
+/**
+ * @author Chau Thu Tran
+ *
+ * @version $ GetCategoryOptionGroupSetListAction.java Feb 12, 2014 11:27:01 PM $
+ */
+public class GetCategoryOptionGroupSetListAction
+ extends ActionPagingSupport<CategoryOptionGroupSet>
+{
+ // -------------------------------------------------------------------------
+ // Dependencies
+ // -------------------------------------------------------------------------
+
+ @Autowired
+ private CategoryOptionGroupSetService categoryOptionGroupSetService;
+
+ // -------------------------------------------------------------------------
+ // Input
+ // -------------------------------------------------------------------------
+
+ private String key;
+
+ public String getKey()
+ {
+ return key;
+ }
+
+ public void setKey( String key )
+ {
+ this.key = key;
+ }
+
+ private List<CategoryOptionGroupSet> categoryOptionGroupSets = new ArrayList<CategoryOptionGroupSet>();
+
+ public List<CategoryOptionGroupSet> getCategoryOptionGroupSets()
+ {
+ return categoryOptionGroupSets;
+ }
+
+ // -------------------------------------------------------------------------
+ // Action implementation
+ // -------------------------------------------------------------------------
+
+ @Override
+ public String execute()
+ throws Exception
+ {
+ if ( isNotBlank( key ) ) // Filter on key only if set
+ {
+ this.paging = createPaging( categoryOptionGroupSetService.getCategoryOptionGroupSetCountByName( key ) );
+
+ categoryOptionGroupSets = new ArrayList<CategoryOptionGroupSet>(
+ categoryOptionGroupSetService.getCategoryOptionGroupSetsBetweenByName( key, paging.getStartPos(),
+ paging.getPageSize() ) );
+ }
+ else
+ {
+ this.paging = createPaging( categoryOptionGroupSetService.getCategoryOptionGroupSetCount() );
+
+ categoryOptionGroupSets = new ArrayList<CategoryOptionGroupSet>( categoryOptionGroupSetService.getCategoryOptionGroupSetsBetween(
+ paging.getStartPos(), paging.getPageSize() ) );
+ }
+
+ Collections.sort( categoryOptionGroupSets, IdentifiableObjectNameComparator.INSTANCE );
+
+ return SUCCESS;
+ }
+
+}
=== added file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/categoryoptiongroupset/RemoveCategoryOptionGroupSetAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/categoryoptiongroupset/RemoveCategoryOptionGroupSetAction.java 1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/categoryoptiongroupset/RemoveCategoryOptionGroupSetAction.java 2014-02-13 12:09:31 +0000
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2004-2013, 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.dd.action.categoryoptiongroupset;
+
+import org.hisp.dhis.dataelement.CategoryOptionGroupSet;
+import org.hisp.dhis.dataelement.CategoryOptionGroupSetService;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import com.opensymphony.xwork2.Action;
+
+/**
+ * @author Chau Thu Tran
+ *
+ * @version $ RemoveCategoryOptionGroupSetAction.java Feb 12, 2014 11:27:01 PM $
+ */
+public class RemoveCategoryOptionGroupSetAction
+ implements Action
+{
+ // -------------------------------------------------------------------------
+ // Dependencies
+ // -------------------------------------------------------------------------
+
+ @Autowired
+ private CategoryOptionGroupSetService categoryOptionGroupSetService;
+
+ // -------------------------------------------------------------------------
+ // Input
+ // -------------------------------------------------------------------------
+
+ private int id;
+
+ public void setId( int id )
+ {
+ this.id = id;
+ }
+
+ // -------------------------------------------------------------------------
+ // Action implementation
+ // -------------------------------------------------------------------------
+
+ @Override
+ public String execute()
+ throws Exception
+ {
+ CategoryOptionGroupSet categoryOptionGroupSet = categoryOptionGroupSetService.getCategoryOptionGroupSet( id );
+
+ categoryOptionGroupSetService.deleteCategoryOptionGroupSet( categoryOptionGroupSet );
+
+ return SUCCESS;
+ }
+
+}
=== added file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/categoryoptiongroupset/ShowAddCategoryOptionGroupSetAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/categoryoptiongroupset/ShowAddCategoryOptionGroupSetAction.java 1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/categoryoptiongroupset/ShowAddCategoryOptionGroupSetAction.java 2014-02-13 12:09:31 +0000
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2004-2013, 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.dd.action.categoryoptiongroupset;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.hisp.dhis.dataelement.CategoryOptionGroup;
+import org.hisp.dhis.dataelement.CategoryOptionGroupService;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import com.opensymphony.xwork2.Action;
+
+/**
+ * @author Chau Thu Tran
+ *
+ * @version $ ShowAddCategoryOptionGroupSetAction.java Feb 12, 2014 11:20:01 PM
+ * $
+ */
+public class ShowAddCategoryOptionGroupSetAction
+ implements Action
+{
+ // -------------------------------------------------------------------------
+ // Dependencies
+ // -------------------------------------------------------------------------
+
+ @Autowired
+ private CategoryOptionGroupService categoryOptionGroupService;
+
+ // -------------------------------------------------------------------------
+ // Input
+ // -------------------------------------------------------------------------
+
+ private List<CategoryOptionGroup> categoryOptionGroups;
+
+ public List<CategoryOptionGroup> getCategoryOptionGroups()
+ {
+ return categoryOptionGroups;
+ }
+
+ // -------------------------------------------------------------------------
+ // Action implementation
+ // -------------------------------------------------------------------------
+
+ @Override
+ public String execute()
+ throws Exception
+ {
+ categoryOptionGroups = new ArrayList<CategoryOptionGroup>(
+ categoryOptionGroupService.getAllCategoryOptionGroups() );
+
+ return SUCCESS;
+ }
+
+}
=== added file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/categoryoptiongroupset/ShowUpdateCategoryOptionGroupSetAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/categoryoptiongroupset/ShowUpdateCategoryOptionGroupSetAction.java 1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/categoryoptiongroupset/ShowUpdateCategoryOptionGroupSetAction.java 2014-02-13 12:09:31 +0000
@@ -0,0 +1,111 @@
+/*
+ * Copyright (c) 2004-2013, 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.dd.action.categoryoptiongroupset;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.hisp.dhis.dataelement.CategoryOptionGroup;
+import org.hisp.dhis.dataelement.CategoryOptionGroupService;
+import org.hisp.dhis.dataelement.CategoryOptionGroupSet;
+import org.hisp.dhis.dataelement.CategoryOptionGroupSetService;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import com.opensymphony.xwork2.Action;
+
+/**
+ * @author Chau Thu Tran
+ *
+ * @version $ ShowUpdateCategoryOptionGroupSetAction.java Feb 12, 2014 11:20:01
+ * PM $
+ */
+public class ShowUpdateCategoryOptionGroupSetAction
+ implements Action
+{
+ // -------------------------------------------------------------------------
+ // Dependencies
+ // -------------------------------------------------------------------------
+
+ @Autowired
+ private CategoryOptionGroupSetService categoryOptionGroupSetService;
+
+ @Autowired
+ private CategoryOptionGroupService categoryOptionGroupService;
+
+ // -------------------------------------------------------------------------
+ // Input && Output
+ // -------------------------------------------------------------------------
+
+ private int id;
+
+ public void setId( int id )
+ {
+ this.id = id;
+ }
+
+ private CategoryOptionGroupSet categoryOptionGroupSet;
+
+ public CategoryOptionGroupSet getCategoryOptionGroupSet()
+ {
+ return categoryOptionGroupSet;
+ }
+
+ private List<CategoryOptionGroup> categoryOptionGroups;
+
+ public List<CategoryOptionGroup> getCategoryOptions()
+ {
+ return categoryOptionGroups;
+ }
+
+ private List<CategoryOptionGroup> groupMembers;
+
+ public List<CategoryOptionGroup> getGroupMembers()
+ {
+ return groupMembers;
+ }
+
+ // -------------------------------------------------------------------------
+ // Action implementation
+ // -------------------------------------------------------------------------
+
+
+ @Override
+ public String execute()
+ throws Exception
+ {
+ categoryOptionGroupSet = categoryOptionGroupSetService.getCategoryOptionGroupSet( id );
+
+ groupMembers = new ArrayList<CategoryOptionGroup>( categoryOptionGroupSet.getMembers() );
+
+ categoryOptionGroups = new ArrayList<CategoryOptionGroup>(
+ categoryOptionGroupService.getAllCategoryOptionGroups());
+
+ return SUCCESS;
+ }
+
+}
=== added file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/categoryoptiongroupset/UpdateCategoryOptionGroupSetAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/categoryoptiongroupset/UpdateCategoryOptionGroupSetAction.java 1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/categoryoptiongroupset/UpdateCategoryOptionGroupSetAction.java 2014-02-13 12:09:31 +0000
@@ -0,0 +1,120 @@
+/*
+ * Copyright (c) 2004-2013, 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.dd.action.categoryoptiongroupset;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.hisp.dhis.dataelement.CategoryOptionGroupService;
+import org.hisp.dhis.dataelement.CategoryOptionGroupSet;
+import org.hisp.dhis.dataelement.CategoryOptionGroupSetService;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import com.opensymphony.xwork2.Action;
+
+/**
+ * @author Chau Thu Tran
+ *
+ * @version $ UpdateCategoryOptionGroupSetAction.java Feb 12, 2014 11:25:01 PM $
+ */
+public class UpdateCategoryOptionGroupSetAction
+ implements Action
+{
+ // -------------------------------------------------------------------------
+ // Dependencies
+ // -------------------------------------------------------------------------
+
+ @Autowired
+ private CategoryOptionGroupSetService categoryOptionGroupSetService;
+
+ @Autowired
+ private CategoryOptionGroupService categoryOptionGroupService;
+
+ // -------------------------------------------------------------------------
+ // Input
+ // -------------------------------------------------------------------------
+
+ private int id;
+
+ public void setId( int id )
+ {
+ this.id = id;
+ }
+
+ private String name;
+
+ public void setName( String name )
+ {
+ this.name = name;
+ }
+
+ private String description;
+
+ public void setDescription( String description )
+ {
+ this.description = description;
+ }
+
+ private Boolean dataDimension;
+
+ public void setDataDimension( Boolean dataDimension )
+ {
+ this.dataDimension = dataDimension;
+ }
+
+ private List<String> groupMembers = new ArrayList<String>();
+
+ public void setGroupMembers( List<String> groupMembers )
+ {
+ this.groupMembers = groupMembers;
+ }
+
+ // -------------------------------------------------------------------------
+ // Action implementation
+ // -------------------------------------------------------------------------
+
+ @Override
+ public String execute()
+ throws Exception
+ {
+ CategoryOptionGroupSet categoryOptionGroupSet = categoryOptionGroupSetService.getCategoryOptionGroupSet( id );
+ categoryOptionGroupSet.setName( name );
+ categoryOptionGroupSet.setDescription( description );
+ categoryOptionGroupSet.setDataDimension( dataDimension );
+
+ for ( String id : groupMembers )
+ {
+ categoryOptionGroupSet.addCategoryOptionGroup( categoryOptionGroupService.getCategoryOptionGroup( Integer
+ .parseInt( id ) ) );
+ }
+
+ categoryOptionGroupSetService.updateCategoryOptionGroupSet( categoryOptionGroupSet );
+
+ return SUCCESS;
+ }
+}
=== added file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/categoryoptiongroupset/ValidateCategoryOptionGroupSetAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/categoryoptiongroupset/ValidateCategoryOptionGroupSetAction.java 1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/categoryoptiongroupset/ValidateCategoryOptionGroupSetAction.java 2014-02-13 12:09:31 +0000
@@ -0,0 +1,107 @@
+/*
+ * Copyright (c) 2004-2013, 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.dd.action.categoryoptiongroupset;
+
+import org.hisp.dhis.dataelement.CategoryOptionGroup;
+import org.hisp.dhis.dataelement.CategoryOptionGroupService;
+import org.hisp.dhis.i18n.I18n;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import com.opensymphony.xwork2.Action;
+
+/**
+ * @author Chau Thu Tran
+ *
+ * @version $ ValidateCategoryOptionGroupSetAction.java Feb 12, 2014 11:20:01 PM
+ * $
+ */
+public class ValidateCategoryOptionGroupSetAction
+ implements Action
+{
+ // -------------------------------------------------------------------------
+ // Dependencies
+ // -------------------------------------------------------------------------
+
+ @Autowired
+ private CategoryOptionGroupService categoryOptionGroupService;
+
+ private I18n i18n;
+
+ public void setI18n( I18n i18n )
+ {
+ this.i18n = i18n;
+ }
+
+ // -------------------------------------------------------------------------
+ // Input
+ // -------------------------------------------------------------------------
+
+ 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()
+ throws Exception
+ {
+ CategoryOptionGroup match = categoryOptionGroupService.getCategoryOptionGroupByName( name );
+
+ if ( match != null && (id == null || match.getId() != id.intValue()) )
+ {
+ message = i18n.getString( "name_in_use" );
+
+ return INPUT;
+ }
+
+ message = i18n.getString( "everything_is_ok" );
+
+ return SUCCESS;
+ }
+
+}
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/resources/META-INF/dhis/beans.xml 2014-02-13 09:51:36 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/resources/META-INF/dhis/beans.xml 2014-02-13 12:09:31 +0000
@@ -534,4 +534,38 @@
scope="prototype">
</bean>
+ <!-- CategoryOptionGroupSet -->
+
+ <bean id="org.hisp.dhis.dd.action.categoryoptiongroupset.AddCategoryOptionGroupSetAction" class="org.hisp.dhis.dd.action.categoryoptiongroupset.AddCategoryOptionGroupSetAction"
+ scope="prototype">
+ </bean>
+
+ <bean id="org.hisp.dhis.dd.action.categoryoptiongroupset.GetCategoryOptionGroupSetAction" class="org.hisp.dhis.dd.action.categoryoptiongroupset.GetCategoryOptionGroupSetAction"
+ scope="prototype">
+ </bean>
+
+ <bean id="org.hisp.dhis.dd.action.categoryoptiongroupset.GetCategoryOptionGroupSetListAction" class="org.hisp.dhis.dd.action.categoryoptiongroupset.GetCategoryOptionGroupSetListAction"
+ scope="prototype">
+ </bean>
+
+ <bean id="org.hisp.dhis.dd.action.categoryoptiongroupset.RemoveCategoryOptionGroupSetAction" class="org.hisp.dhis.dd.action.categoryoptiongroupset.RemoveCategoryOptionGroupSetAction"
+ scope="prototype">
+ </bean>
+
+ <bean id="org.hisp.dhis.dd.action.categoryoptiongroupset.ShowAddCategoryOptionGroupSetAction" class="org.hisp.dhis.dd.action.categoryoptiongroupset.ShowAddCategoryOptionGroupSetAction"
+ scope="prototype">
+ </bean>
+
+ <bean id="org.hisp.dhis.dd.action.categoryoptiongroupset.ShowUpdateCategoryOptionGroupSetAction" class="org.hisp.dhis.dd.action.categoryoptiongroupset.ShowUpdateCategoryOptionGroupSetAction"
+ scope="prototype">
+ </bean>
+
+ <bean id="org.hisp.dhis.dd.action.categoryoptiongroupset.UpdateCategoryOptionGroupSetAction" class="org.hisp.dhis.dd.action.categoryoptiongroupset.UpdateCategoryOptionGroupSetAction"
+ scope="prototype">
+ </bean>
+
+ <bean id="org.hisp.dhis.dd.action.categoryoptiongroupset.ValidateCategoryOptionGroupSetAction" class="org.hisp.dhis.dd.action.categoryoptiongroupset.ValidateCategoryOptionGroupSetAction"
+ scope="prototype">
+ </bean>
+
</beans>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/resources/org/hisp/dhis/dd/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/resources/org/hisp/dhis/dd/i18n_module.properties 2014-02-13 09:51:36 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/resources/org/hisp/dhis/dd/i18n_module.properties 2014-02-13 12:09:31 +0000
@@ -217,8 +217,14 @@
option_set_for_data_values=Option set for data values
option_set_for_comments=Option set for comments
organisation_unit_counts=Organisation unit counts
-catergory_option_group = Catergory option group
-catergory_option_group_management = Catergory option group management
+category_option_group = Catergory Option Group
+category_option_group_management = Catergory option group management
create_new_category_option_group = Create new catergory option group
edit_category_option_group = Edit catergory option group
-confirm_delete_catergory_option_group = Are you sure you want to delete this catergory option group?
\ No newline at end of file
+confirm_delete_catergory_option_group = Are you sure you want to delete this catergory option group?
+category_option_group_set = Catergory Option Group Set
+category_option_group_set_management = Catergory option group set management
+create_new_category_option_group_set = Create new catergory option group set
+edit_category_option_group_set = Edit catergory option group set
+available_category_option_groups = Available category option groups
+confirm_delete_catergory_option_group_set = Are you sure you want to delete this catergory option group set?
\ No newline at end of file
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/resources/struts.xml'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/resources/struts.xml 2014-02-13 09:51:36 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/resources/struts.xml 2014-02-13 12:09:31 +0000
@@ -692,7 +692,7 @@
<action name="getCategoryOptionGroup"
class="org.hisp.dhis.dd.action.categoryoptiongroup.GetCategoryOptionGroupAction">
<result name="success" type="velocity-json">
- /dhis-web-commons/ajax/jsonCategoryOptionGroup.vm
+ /dhis-web-commons/ajax/jsonCategoryOptionGroupSet.vm
</result>
<param name="onExceptionReturn">plainTextError</param>
</action>
@@ -702,38 +702,38 @@
<result name="success" type="velocity-json">
/dhis-web-commons/ajax/jsonResponseSuccess.vm
</result>
- <param name="requiredAuthorities">F_CATEGORY_ATTRIBUTE_GROUP_DELETE</param>
+ <param name="requiredAuthorities">F_CATEGORY_OPTION_GROUP_DELETE</param>
</action>
<action name="addCategoryOptionGroup"
class="org.hisp.dhis.dd.action.categoryoptiongroup.AddCategoryOptionGroupAction">
<result name="success" type="redirect">categoryOptionGroup.action
</result>
- <param name="requiredAuthorities">F_CATEGORY_ATTRIBUTE_GROUP_ADD</param>
+ <param name="requiredAuthorities">F_CATEGORY_OPTION_GROUP_ADD</param>
</action>
<action name="showAddCategoryOptionGroupForm" class="org.hisp.dhis.dd.action.categoryoptiongroup.ShowAddCategoryOptionGroupAction">
<result name="success" type="velocity">/main.vm</result>
<param name="page">/dhis-web-maintenance-datadictionary/addCategoryOptionGroupForm.vm</param>
- <param name="javascripts">javascript/categoryOptionGroup.js</param>
+ <param name="javascripts">javascript/categoryOptionGroupSet.js</param>
<param name="stylesheets">style/basic.css</param>
- <param name="requiredAuthorities">F_CATEGORY_ATTRIBUTE_GROUP_ADD</param>
+ <param name="requiredAuthorities">F_CATEGORY_OPTION_GROUP_ADD</param>
</action>
<action name="showUpdateCategoryOptionGroupForm"
class="org.hisp.dhis.dd.action.categoryoptiongroup.ShowUpdateCategoryOptionGroupAction">
<result name="success" type="velocity">/main.vm</result>
<param name="page">/dhis-web-maintenance-datadictionary/updateCategoryOptionGroupForm.vm</param>
- <param name="javascripts">javascript/categoryOptionGroup.js</param>
+ <param name="javascripts">javascript/categoryOptionGroupSet.js</param>
<param name="stylesheets">style/basic.css</param>
- <param name="requiredAuthorities">F_CATEGORY_ATTRIBUTE_GROUP_ADD</param>
+ <param name="requiredAuthorities">F_CATEGORY_OPTION_GROUP_ADD</param>
</action>
<action name="updateCategoryOptionGroup"
class="org.hisp.dhis.dd.action.categoryoptiongroup.UpdateCategoryOptionGroupAction">
<result name="success" type="redirect">categoryOptionGroup.action
</result>
- <param name="requiredAuthorities">F_CATEGORY_ATTRIBUTE_GROUP_ADD</param>
+ <param name="requiredAuthorities">F_CATEGORY_OPTION_GROUP_ADD</param>
</action>
<action name="validateCategoryOptionGroup"
@@ -749,6 +749,77 @@
</result>
<param name="onExceptionReturn">plainTextError</param>
</action>
+
+ <!-- CategoryOptionGroupSet -->
+
+ <action name="categoryOptionGroupSet"
+ class="org.hisp.dhis.dd.action.categoryoptiongroupset.GetCategoryOptionGroupSetListAction">
+ <result name="success" type="velocity">/main.vm</result>
+ <param name="page">/dhis-web-maintenance-datadictionary/categoryOptionGroupSet.vm</param>
+ <param name="menu">/dhis-web-maintenance-datadictionary/menu.vm</param>
+ <param name="javascripts">javascript/categoryOptionGroupSet.js</param>
+ </action>
+
+ <action name="getCategoryOptionGroupSet"
+ class="org.hisp.dhis.dd.action.categoryoptiongroupset.GetCategoryOptionGroupSetAction">
+ <result name="success" type="velocity-json">
+ /dhis-web-commons/ajax/jsonCategoryOptionGroupSet.vm
+ </result>
+ <param name="onExceptionReturn">plainTextError</param>
+ </action>
+
+ <action name="removeCategoryOptionGroupSet"
+ class="org.hisp.dhis.dd.action.categoryoptiongroupset.RemoveCategoryOptionGroupSetAction">
+ <result name="success" type="velocity-json">
+ /dhis-web-commons/ajax/jsonResponseSuccess.vm
+ </result>
+ <param name="requiredAuthorities">F_CATEGORY_OPTION_GROUP_SET_DELETE</param>
+ </action>
+
+ <action name="addCategoryOptionGroupSet"
+ class="org.hisp.dhis.dd.action.categoryoptiongroupset.AddCategoryOptionGroupSetAction">
+ <result name="success" type="redirect">categoryOptionGroupSet.action
+ </result>
+ <param name="requiredAuthorities">F_CATEGORY_OPTION_GROUP_SET_ADD</param>
+ </action>
+
+ <action name="showAddCategoryOptionGroupSetForm" class="org.hisp.dhis.dd.action.categoryoptiongroupset.ShowAddCategoryOptionGroupSetAction">
+ <result name="success" type="velocity">/main.vm</result>
+ <param name="page">/dhis-web-maintenance-datadictionary/addCategoryOptionGroupSetForm.vm</param>
+ <param name="javascripts">javascript/categoryOptionGroupSet.js</param>
+ <param name="stylesheets">style/basic.css</param>
+ <param name="requiredAuthorities">F_CATEGORY_OPTION_GROUP_SET_ADD</param>
+ </action>
+
+ <action name="showUpdateCategoryOptionGroupSetForm"
+ class="org.hisp.dhis.dd.action.categoryoptiongroupset.ShowUpdateCategoryOptionGroupSetAction">
+ <result name="success" type="velocity">/main.vm</result>
+ <param name="page">/dhis-web-maintenance-datadictionary/updateCategoryOptionGroupSetForm.vm</param>
+ <param name="javascripts">javascript/categoryOptionGroupSet.js</param>
+ <param name="stylesheets">style/basic.css</param>
+ <param name="requiredAuthorities">F_CATEGORY_OPTION_GROUP_SET_ADD</param>
+ </action>
+
+ <action name="updateCategoryOptionGroupSet"
+ class="org.hisp.dhis.dd.action.categoryoptiongroupset.UpdateCategoryOptionGroupSetAction">
+ <result name="success" type="redirect">categoryOptionGroupSet.action
+ </result>
+ <param name="requiredAuthorities">F_CATEGORY_ATTRIBUTE_GROUP_ADD</param>
+ </action>
+
+ <action name="validateCategoryOptionGroupSet"
+ class="org.hisp.dhis.dd.action.categoryoptiongroupset.ValidateCategoryOptionGroupSetAction">
+ <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>
+ <result name="input" type="velocity-json">
+ /dhis-web-commons/ajax/jsonResponseInput.vm
+ </result>
+ <param name="onExceptionReturn">plainTextError</param>
+ </action>
</package>