dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #28146
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 14033: Merge TrackedEntityAttributeOptionService into TrackedEntityAttributeService.
------------------------------------------------------------
revno: 14033
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2014-02-14 23:13:55 +0700
message:
Merge TrackedEntityAttributeOptionService into TrackedEntityAttributeService.
removed:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityAttributeOptionService.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityAttributeOptionStore.java
dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/DefaultTrackedEntityAttributeOptionService.java
dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/hibernate/HibernateTrackedEntityAttributeOptionStore.java
modified:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityAttributeService.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityAttributeStore.java
dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/DefaultTrackedEntityAttributeService.java
dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/hibernate/HibernateTrackedEntityAttributeStore.java
dhis-2/dhis-services/dhis-service-tracker/src/main/resources/META-INF/dhis/beans.xml
dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/AddRepresentativeAction.java
dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/AddTrackedEntityInstanceAction.java
dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/SaveAttributeAction.java
dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/UpdateTrackedEntityInstanceAction.java
dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml
dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/beneficiaryenrollment/action/SaveMobileProgramEnrollmentAction.java
dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/beneficiaryregistration/action/SaveBeneficiaryAction.java
dhis-2/dhis-web/dhis-web-light/src/main/resources/META-INF/dhis/beans.xml
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/trackedentityattribute/AddAttributeAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/trackedentityattribute/RemoveAttributeOptionAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/trackedentityattribute/UpdateAttributeAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/resources/META-INF/dhis/beans.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
=== removed file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityAttributeOptionService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityAttributeOptionService.java 2014-02-07 20:25:49 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityAttributeOptionService.java 1970-01-01 00:00:00 +0000
@@ -1,92 +0,0 @@
-package org.hisp.dhis.trackedentity;
-
-/*
- * 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.
- */
-
-import java.util.Collection;
-
-/**
- * @author Viet
- *
- * @version $Id$
- */
-public interface TrackedEntityAttributeOptionService
-{
- /**
- * Adds an {@link TrackedEntityAttributeOption}
- *
- * @param option The to TrackedEntityAttributeOption add.
- *
- * @return A generated unique id of the added {@link TrackedEntityAttributeOption}.
- */
- int addTrackedEntityAttributeOption( TrackedEntityAttributeOption option );
-
- /**
- * Updates a {@link TrackedEntityAttributeOption}.
- *
- * @param option the TrackedEntityAttributeOption to update.
- */
- void updateTrackedEntityAttributeOption( TrackedEntityAttributeOption option );
-
- /**
- * Deletes a {@link TrackedEntityAttributeOption}.
- *
- * @param option the TrackedEntityAttributeOption to delete.
- */
- void deleteTrackedEntityAttributeOption( TrackedEntityAttributeOption option );
-
- /**
- * Returns a {@link TrackedEntityAttributeOption} with a given name.
- *
- * @param attribute {@link TrackedEntityAttribute}
- * @param name the name of the TrackedEntityAttributeOption to return.
- *
- * @return the TrackedEntityAttributeOption with the given name, or null if no
- * match.
- */
- TrackedEntityAttributeOption get( TrackedEntityAttribute attribute, String name );
-
- /**
- * Returns a {@link TrackedEntityAttributeOption}.
- *
- * @param id the id of the TrackedEntityAttributeOption to return.
- *
- * @return the TrackedEntityAttributeOption with the given id
- */
- TrackedEntityAttributeOption get( int id );
-
- /**
- * Get all {@link TrackedEntityAttributeOption} of a {@link TrackedEntityAttribute}
- *
- * @param attribute {@link TrackedEntityAttribute}
- *
- * @return {@link TrackedEntityAttributeOption}
- */
- Collection<TrackedEntityAttributeOption> get( TrackedEntityAttribute attribute );
-
-}
=== removed file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityAttributeOptionStore.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityAttributeOptionStore.java 2014-02-07 20:25:49 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityAttributeOptionStore.java 1970-01-01 00:00:00 +0000
@@ -1,62 +0,0 @@
-package org.hisp.dhis.trackedentity;
-
-/*
- * 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.
- */
-
-import java.util.Collection;
-
-import org.hisp.dhis.common.GenericStore;
-
-/**
- * @author Viet
- */
-public interface TrackedEntityAttributeOptionStore
- extends GenericStore<TrackedEntityAttributeOption>
-{
- String ID = TrackedEntityAttributeOption.class.getName();
-
- /**
- * Returns a {@link TrackedEntityAttributeOption} with a given name.
- *
- * @param attribute {@link TrackedEntityAttribute}
- * @param name the name of the TrackedEntityAttributeOption to return.
- *
- * @return the TrackedEntityAttributeOption with the given name, or null if no
- * match.
- */
- TrackedEntityAttributeOption get( TrackedEntityAttribute attribute, String name );
-
- /**
- * Get all {@link TrackedEntityAttributeOption} of a {@link TrackedEntityAttribute}
- *
- * @param attribute {@link TrackedEntityAttribute}
- *
- * @return {@link TrackedEntityAttributeOption}
- */
- Collection<TrackedEntityAttributeOption> get( TrackedEntityAttribute attribute );
-}
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityAttributeService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityAttributeService.java 2014-02-13 09:51:36 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityAttributeService.java 2014-02-14 16:13:55 +0000
@@ -199,4 +199,61 @@
*
*/
int getTrackedEntityAttributeCountByName( String name );
+
+ // -------------------------------------------------------------------------
+ // TrackedEntityAttributeOption
+ // -------------------------------------------------------------------------
+
+ /**
+ * Adds an {@link TrackedEntityAttributeOption}
+ *
+ * @param option The to TrackedEntityAttributeOption add.
+ *
+ * @return A generated unique id of the added {@link TrackedEntityAttributeOption}.
+ */
+ int addTrackedEntityAttributeOption( TrackedEntityAttributeOption option );
+
+ /**
+ * Updates a {@link TrackedEntityAttributeOption}.
+ *
+ * @param option the TrackedEntityAttributeOption to update.
+ */
+ void updateTrackedEntityAttributeOption( TrackedEntityAttributeOption option );
+
+ /**
+ * Deletes a {@link TrackedEntityAttributeOption}.
+ *
+ * @param option the TrackedEntityAttributeOption to delete.
+ */
+ void deleteTrackedEntityAttributeOption( TrackedEntityAttributeOption option );
+
+ /**
+ * Returns a {@link TrackedEntityAttributeOption} with a given name.
+ *
+ * @param attribute {@link TrackedEntityAttribute}
+ * @param name the name of the TrackedEntityAttributeOption to return.
+ *
+ * @return the TrackedEntityAttributeOption with the given name, or null if no
+ * match.
+ */
+ TrackedEntityAttributeOption getTrackedEntityAttributeOption( TrackedEntityAttribute attribute, String name );
+
+ /**
+ * Returns a {@link TrackedEntityAttributeOption}.
+ *
+ * @param id the id of the TrackedEntityAttributeOption to return.
+ *
+ * @return the TrackedEntityAttributeOption with the given id
+ */
+ TrackedEntityAttributeOption getTrackedEntityAttributeOption( int id );
+
+ /**
+ * Get all {@link TrackedEntityAttributeOption} of a {@link TrackedEntityAttribute}
+ *
+ * @param attribute {@link TrackedEntityAttribute}
+ *
+ * @return {@link TrackedEntityAttributeOption}
+ */
+ Collection<TrackedEntityAttributeOption> getTrackedEntityAttributeOption( TrackedEntityAttribute attribute );
+
}
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityAttributeStore.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityAttributeStore.java 2014-02-13 09:51:36 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityAttributeStore.java 2014-02-14 16:13:55 +0000
@@ -97,4 +97,29 @@
*/
Collection<TrackedEntityAttribute> getDisplayedInList( boolean displayInListNoProgram );
+ // -------------------------------------------------------------------------
+ // TrackedEntityAttributeOption
+ // -------------------------------------------------------------------------
+
+ /**
+ * Returns a {@link TrackedEntityAttributeOption} with a given name.
+ *
+ * @param attribute {@link TrackedEntityAttribute}
+ *
+ * @param name the name of the TrackedEntityAttributeOption to return.
+ *
+ * @return the TrackedEntityAttributeOption with the given name, or null if
+ * no match.
+ */
+ TrackedEntityAttributeOption get( TrackedEntityAttribute attribute, String name );
+
+ /**
+ * Get all {@link TrackedEntityAttributeOption} of a
+ * {@link TrackedEntityAttribute}
+ *
+ * @param attribute {@link TrackedEntityAttribute}
+ *
+ * @return {@link TrackedEntityAttributeOption}
+ */
+ Collection<TrackedEntityAttributeOption> get( TrackedEntityAttribute attribute );
}
=== removed file 'dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/DefaultTrackedEntityAttributeOptionService.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/DefaultTrackedEntityAttributeOptionService.java 2014-02-07 20:25:49 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/DefaultTrackedEntityAttributeOptionService.java 1970-01-01 00:00:00 +0000
@@ -1,88 +0,0 @@
-package org.hisp.dhis.trackedentity;
-
-/*
- * 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.
- */
-
-import java.util.Collection;
-
-import org.springframework.transaction.annotation.Transactional;
-
-/**
- * @author Abyot Asalefew
- * @version $Id$
- */
-@Transactional
-public class DefaultTrackedEntityAttributeOptionService
- implements TrackedEntityAttributeOptionService
-{
- // -------------------------------------------------------------------------
- // Dependencies
- // -------------------------------------------------------------------------
-
- private TrackedEntityAttributeOptionStore attributeOptionStore;
-
- public void setAttributeOptionStore( TrackedEntityAttributeOptionStore attributeOptionStore )
- {
- this.attributeOptionStore = attributeOptionStore;
- }
-
- // -------------------------------------------------------------------------
- // Implementation methods
- // -------------------------------------------------------------------------
-
- public int addTrackedEntityAttributeOption( TrackedEntityAttributeOption option )
- {
- return attributeOptionStore.save( option );
- }
-
- public void deleteTrackedEntityAttributeOption( TrackedEntityAttributeOption option )
- {
- attributeOptionStore.delete( option );
- }
-
- public void updateTrackedEntityAttributeOption( TrackedEntityAttributeOption option )
- {
- attributeOptionStore.update( option );
- }
-
- public TrackedEntityAttributeOption get( TrackedEntityAttribute attribute, String name )
- {
- return attributeOptionStore.get( attribute, name );
- }
-
- public TrackedEntityAttributeOption get( int id )
- {
- return attributeOptionStore.get( id );
- }
-
- public Collection<TrackedEntityAttributeOption> get( TrackedEntityAttribute attribute )
- {
- return attributeOptionStore.get( attribute );
- }
-
-}
=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/DefaultTrackedEntityAttributeService.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/DefaultTrackedEntityAttributeService.java 2014-02-13 09:51:36 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/DefaultTrackedEntityAttributeService.java 2014-02-14 16:13:55 +0000
@@ -30,11 +30,9 @@
import java.util.Collection;
+import org.hisp.dhis.common.GenericNameableObjectStore;
import org.hisp.dhis.program.Program;
import org.hisp.dhis.program.ProgramService;
-import org.hisp.dhis.trackedentity.TrackedEntityAttribute;
-import org.hisp.dhis.trackedentity.TrackedEntityAttributeService;
-import org.hisp.dhis.trackedentity.TrackedEntityAttributeStore;
import org.springframework.transaction.annotation.Transactional;
/**
@@ -56,6 +54,13 @@
this.attributeStore = attributeStore;
}
+ private GenericNameableObjectStore<TrackedEntityAttributeOption> attributeOptionStore;
+
+ public void setAttributeOptionStore( GenericNameableObjectStore<TrackedEntityAttributeOption> attributeOptionStore )
+ {
+ this.attributeOptionStore = attributeOptionStore;
+ }
+
private ProgramService programService;
public void setProgramService( ProgramService programService )
@@ -171,4 +176,37 @@
return attributeStore.getCountEqNameNoAcl( name );
}
+ // -------------------------------------------------------------------------
+ // TrackedEntityAttributeOption
+ // -------------------------------------------------------------------------
+
+ public int addTrackedEntityAttributeOption( TrackedEntityAttributeOption option )
+ {
+ return attributeOptionStore.save( option );
+ }
+
+ public void deleteTrackedEntityAttributeOption( TrackedEntityAttributeOption option )
+ {
+ attributeOptionStore.delete( option );
+ }
+
+ public void updateTrackedEntityAttributeOption( TrackedEntityAttributeOption option )
+ {
+ attributeOptionStore.update( option );
+ }
+
+ public TrackedEntityAttributeOption getTrackedEntityAttributeOption( TrackedEntityAttribute attribute, String name )
+ {
+ return attributeStore.get( attribute, name );
+ }
+
+ public TrackedEntityAttributeOption getTrackedEntityAttributeOption( int id )
+ {
+ return attributeOptionStore.get( id );
+ }
+
+ public Collection<TrackedEntityAttributeOption> getTrackedEntityAttributeOption( TrackedEntityAttribute attribute )
+ {
+ return attributeStore.get( attribute );
+ }
}
=== removed file 'dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/hibernate/HibernateTrackedEntityAttributeOptionStore.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/hibernate/HibernateTrackedEntityAttributeOptionStore.java 2014-02-07 20:25:49 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/hibernate/HibernateTrackedEntityAttributeOptionStore.java 1970-01-01 00:00:00 +0000
@@ -1,58 +0,0 @@
-package org.hisp.dhis.trackedentity.hibernate;
-
-/*
- * 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.
- */
-
-import java.util.Collection;
-
-import org.hibernate.criterion.Restrictions;
-import org.hisp.dhis.hibernate.HibernateGenericStore;
-import org.hisp.dhis.trackedentity.TrackedEntityAttribute;
-import org.hisp.dhis.trackedentity.TrackedEntityAttributeOption;
-import org.hisp.dhis.trackedentity.TrackedEntityAttributeOptionStore;
-
-/**
- * @author Viet
- */
-public class HibernateTrackedEntityAttributeOptionStore
- extends HibernateGenericStore<TrackedEntityAttributeOption>
- implements TrackedEntityAttributeOptionStore
-{
- public TrackedEntityAttributeOption get( TrackedEntityAttribute attribute, String name )
- {
- return (TrackedEntityAttributeOption) getCriteria( Restrictions.eq( "name", name ),
- Restrictions.eq( "attribute", attribute ) ).uniqueResult();
- }
-
- @SuppressWarnings( "unchecked" )
- public Collection<TrackedEntityAttributeOption> get( TrackedEntityAttribute attribute )
- {
- return getCriteria( Restrictions.eq( "attribute", attribute ) ).list();
- }
-
-}
=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/hibernate/HibernateTrackedEntityAttributeStore.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/hibernate/HibernateTrackedEntityAttributeStore.java 2014-02-07 20:25:49 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/hibernate/HibernateTrackedEntityAttributeStore.java 2014-02-14 16:13:55 +0000
@@ -31,6 +31,7 @@
import org.hibernate.criterion.Restrictions;
import org.hisp.dhis.common.hibernate.HibernateIdentifiableObjectStore;
import org.hisp.dhis.trackedentity.TrackedEntityAttribute;
+import org.hisp.dhis.trackedentity.TrackedEntityAttributeOption;
import org.hisp.dhis.trackedentity.TrackedEntityAttributeStore;
import java.util.Collection;
@@ -54,22 +55,22 @@
}
@Override
- @SuppressWarnings( "unchecked" )
+ @SuppressWarnings( "unchecked" )
public Collection<TrackedEntityAttribute> getByMandatory( boolean mandatory )
{
return getCriteria( Restrictions.eq( "mandatory", mandatory ) ).list();
}
@Override
- @SuppressWarnings( "unchecked" )
+ @SuppressWarnings( "unchecked" )
public Collection<TrackedEntityAttribute> getOptionalAttributesWithoutGroup()
{
- return getCriteria( Restrictions.isNull( "attributeGroup" ) )
- .add( Restrictions.eq( "mandatory", false ) ).list();
+ return getCriteria( Restrictions.isNull( "attributeGroup" ) ).add( Restrictions.eq( "mandatory", false ) )
+ .list();
}
@Override
- public TrackedEntityAttribute getByGroupBy()
+ public TrackedEntityAttribute getByGroupBy()
{
return (TrackedEntityAttribute) getCriteria( Restrictions.eq( "groupBy", true ) ).uniqueResult();
}
@@ -89,10 +90,26 @@
}
@Override
- @SuppressWarnings( "unchecked" )
+ @SuppressWarnings( "unchecked" )
public Collection<TrackedEntityAttribute> getDisplayedInList( boolean displayInListNoProgram )
{
return getCriteria( Restrictions.eq( "displayInListNoProgram", displayInListNoProgram ) ).list();
}
+ // -------------------------------------------------------------------------
+ // TrackedEntityAttributeOption
+ // -------------------------------------------------------------------------
+
+ public TrackedEntityAttributeOption get( TrackedEntityAttribute attribute, String name )
+ {
+ return (TrackedEntityAttributeOption) getCriteria( Restrictions.eq( "name", name ),
+ Restrictions.eq( "attribute", attribute ) ).uniqueResult();
+ }
+
+ @SuppressWarnings( "unchecked" )
+ public Collection<TrackedEntityAttributeOption> get( TrackedEntityAttribute attribute )
+ {
+ return getCriteria( Restrictions.eq( "attribute", attribute ) ).list();
+ }
+
}
=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-services/dhis-service-tracker/src/main/resources/META-INF/dhis/beans.xml 2014-02-10 08:26:08 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/main/resources/META-INF/dhis/beans.xml 2014-02-14 16:13:55 +0000
@@ -99,7 +99,7 @@
</bean>
<bean id="org.hisp.dhis.trackedentity.TrackedEntityAttributeOptionStore"
- class="org.hisp.dhis.trackedentity.hibernate.HibernateTrackedEntityAttributeOptionStore">
+ class="org.hisp.dhis.common.hibernate.HibernateIdentifiableObjectStore">
<property name="clazz"
value="org.hisp.dhis.trackedentity.TrackedEntityAttributeOption" />
<property name="sessionFactory" ref="sessionFactory" />
@@ -247,6 +247,8 @@
class="org.hisp.dhis.trackedentity.DefaultTrackedEntityAttributeService">
<property name="attributeStore"
ref="org.hisp.dhis.trackedentity.TrackedEntityAttributeStore" />
+ <property name="attributeOptionStore"
+ ref="org.hisp.dhis.trackedentity.TrackedEntityAttributeOptionStore" />
<property name="programService" ref="org.hisp.dhis.program.ProgramService" />
</bean>
@@ -257,12 +259,6 @@
ref="org.hisp.dhis.trackedentityattributevalue.TrackedEntityAttributeValueStore" />
</bean>
- <bean id="org.hisp.dhis.trackedentity.TrackedEntityAttributeOptionService"
- class="org.hisp.dhis.trackedentity.DefaultTrackedEntityAttributeOptionService">
- <property name="attributeOptionStore"
- ref="org.hisp.dhis.trackedentity.TrackedEntityAttributeOptionStore" />
- </bean>
-
<bean
id="org.hisp.dhis.trackedentitydatavalue.TrackedEntityDataValueService"
class="org.hisp.dhis.trackedentitydatavalue.DefaultTrackedEntityDataValueService">
@@ -391,26 +387,27 @@
ref="org.hisp.dhis.dataentryform.DataEntryFormService" />
</bean>
- <bean id="org.hisp.dhis.common.TrackerIdentityPopulator" class="org.hisp.dhis.common.IdentityPopulator">
- <property name="name" value="TrackerIdentityPopulator" />
- <property name="runlevel" value="3" />
- <property name="skipInTests" value="true" />
- <property name="tables">
- <list>
- <value>trackedentityattribute</value>
- <value>trackedentityattributegroup</value>
- <value>program</value>
- <value>programstage</value>
- <value>programinstance</value>
- <value>programstageinstance</value>
- <value>relationshiptype</value>
- <value>programstagesection</value>
- <value>programvalidation</value>
- </list>
- </property>
- </bean>
-
- <bean class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
+ <bean id="org.hisp.dhis.common.TrackerIdentityPopulator" class="org.hisp.dhis.common.IdentityPopulator">
+ <property name="name" value="TrackerIdentityPopulator" />
+ <property name="runlevel" value="3" />
+ <property name="skipInTests" value="true" />
+ <property name="tables">
+ <list>
+ <value>trackedentityattribute</value>
+ <value>trackedentityattributegroup</value>
+ <value>program</value>
+ <value>programstage</value>
+ <value>programinstance</value>
+ <value>programstageinstance</value>
+ <value>relationshiptype</value>
+ <value>programstagesection</value>
+ <value>programvalidation</value>
+ </list>
+ </property>
+ </bean>
+
+ <bean
+ class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
<property name="targetObject"
ref="org.hisp.dhis.system.startup.StartupRoutineExecutor" />
<property name="targetMethod" value="addStartupRoutines" />
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/AddRepresentativeAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/AddRepresentativeAction.java 2014-02-07 20:25:49 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/AddRepresentativeAction.java 2014-02-14 16:13:55 +0000
@@ -39,11 +39,10 @@
import org.hisp.dhis.i18n.I18nFormat;
import org.hisp.dhis.organisationunit.OrganisationUnit;
import org.hisp.dhis.ouwt.manager.OrganisationUnitSelectionManager;
-import org.hisp.dhis.trackedentity.TrackedEntityInstance;
import org.hisp.dhis.trackedentity.TrackedEntityAttribute;
import org.hisp.dhis.trackedentity.TrackedEntityAttributeOption;
-import org.hisp.dhis.trackedentity.TrackedEntityAttributeOptionService;
import org.hisp.dhis.trackedentity.TrackedEntityAttributeService;
+import org.hisp.dhis.trackedentity.TrackedEntityInstance;
import org.hisp.dhis.trackedentity.TrackedEntityInstanceService;
import org.hisp.dhis.trackedentityattributevalue.TrackedEntityAttributeValue;
@@ -62,9 +61,7 @@
private OrganisationUnitSelectionManager selectionManager;
- private TrackedEntityAttributeService AttributeService;
-
- private TrackedEntityAttributeOptionService attributeOptionService;
+ private TrackedEntityAttributeService attributeService;
private I18nFormat format;
@@ -103,7 +100,7 @@
HttpServletRequest request = ServletActionContext.getRequest();
- Collection<TrackedEntityAttribute> attributes = AttributeService.getAllTrackedEntityAttributes();
+ Collection<TrackedEntityAttribute> attributes = attributeService.getAllTrackedEntityAttributes();
Set<TrackedEntityAttributeValue> entityInstanceAttributeValues = new HashSet<TrackedEntityAttributeValue>();
@@ -127,7 +124,7 @@
}
else if ( TrackedEntityAttribute.TYPE_COMBO.equalsIgnoreCase( attribute.getValueType() ) )
{
- TrackedEntityAttributeOption option = attributeOptionService.get( Integer.parseInt( value ) );
+ TrackedEntityAttributeOption option = attributeService.getTrackedEntityAttributeOption( Integer.parseInt( value ) );
if ( option != null )
{
attributeValue.setAttributeOption( option );
@@ -154,9 +151,9 @@
this.entityInstanceService = entityInstanceService;
}
- public void setAttributeService( TrackedEntityAttributeService AttributeService )
+ public void setAttributeService( TrackedEntityAttributeService attributeService )
{
- this.AttributeService = AttributeService;
+ this.attributeService = attributeService;
}
public void setFormat( I18nFormat format )
@@ -169,11 +166,6 @@
this.selectionManager = selectionManager;
}
- public void setAttributeOptionService( TrackedEntityAttributeOptionService attributeOptionService )
- {
- this.attributeOptionService = attributeOptionService;
- }
-
public Integer getRelationshipTypeId()
{
return relationshipTypeId;
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/AddTrackedEntityInstanceAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/AddTrackedEntityInstanceAction.java 2014-02-07 20:25:49 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/AddTrackedEntityInstanceAction.java 2014-02-14 16:13:55 +0000
@@ -43,11 +43,10 @@
import org.hisp.dhis.relationship.RelationshipService;
import org.hisp.dhis.relationship.RelationshipType;
import org.hisp.dhis.relationship.RelationshipTypeService;
-import org.hisp.dhis.trackedentity.TrackedEntityInstance;
import org.hisp.dhis.trackedentity.TrackedEntityAttribute;
import org.hisp.dhis.trackedentity.TrackedEntityAttributeOption;
-import org.hisp.dhis.trackedentity.TrackedEntityAttributeOptionService;
import org.hisp.dhis.trackedentity.TrackedEntityAttributeService;
+import org.hisp.dhis.trackedentity.TrackedEntityInstance;
import org.hisp.dhis.trackedentity.TrackedEntityInstanceService;
import org.hisp.dhis.trackedentityattributevalue.TrackedEntityAttributeValue;
@@ -70,8 +69,6 @@
private TrackedEntityAttributeService attributeService;
- private TrackedEntityAttributeOptionService attributeOptionService;
-
private RelationshipTypeService relationshipTypeService;
private RelationshipService relationshipService;
@@ -140,7 +137,7 @@
}
else if ( TrackedEntityAttribute.TYPE_COMBO.equalsIgnoreCase( attribute.getValueType() ) )
{
- TrackedEntityAttributeOption option = attributeOptionService.get( Integer.parseInt( value ) );
+ TrackedEntityAttributeOption option = attributeService.getTrackedEntityAttributeOption( Integer.parseInt( value ) );
if ( option != null )
{
attributeValue.setAttributeOption( option );
@@ -241,11 +238,6 @@
this.attributeService = attributeService;
}
- public void setAttributeOptionService( TrackedEntityAttributeOptionService attributeOptionService )
- {
- this.attributeOptionService = attributeOptionService;
- }
-
public void setRepresentativeId( Integer representativeId )
{
this.representativeId = representativeId;
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/SaveAttributeAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/SaveAttributeAction.java 2014-02-12 16:37:44 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/SaveAttributeAction.java 2014-02-14 16:13:55 +0000
@@ -38,11 +38,10 @@
import org.hisp.dhis.i18n.I18nFormat;
import org.hisp.dhis.program.Program;
import org.hisp.dhis.program.ProgramService;
-import org.hisp.dhis.trackedentity.TrackedEntityInstance;
import org.hisp.dhis.trackedentity.TrackedEntityAttribute;
import org.hisp.dhis.trackedentity.TrackedEntityAttributeOption;
-import org.hisp.dhis.trackedentity.TrackedEntityAttributeOptionService;
import org.hisp.dhis.trackedentity.TrackedEntityAttributeService;
+import org.hisp.dhis.trackedentity.TrackedEntityInstance;
import org.hisp.dhis.trackedentity.TrackedEntityInstanceService;
import org.hisp.dhis.trackedentityattributevalue.TrackedEntityAttributeValue;
import org.hisp.dhis.trackedentityattributevalue.TrackedEntityAttributeValueService;
@@ -67,8 +66,6 @@
private TrackedEntityAttributeService attributeService;
- private TrackedEntityAttributeOptionService attributeOptionService;
-
private ProgramService programService;
private I18nFormat format;
@@ -101,12 +98,7 @@
{
this.attributeValueService = attributeValueService;
}
-
- public void setAttributeOptionService( TrackedEntityAttributeOptionService attributeOptionService )
- {
- this.attributeOptionService = attributeOptionService;
- }
-
+
public void setProgramService( ProgramService programService )
{
this.programService = programService;
@@ -198,8 +190,8 @@
if ( TrackedEntityAttribute.TYPE_COMBO.equalsIgnoreCase( attribute.getValueType() ) )
{
- TrackedEntityAttributeOption option = attributeOptionService
- .get( Integer.parseInt( value ) );
+ TrackedEntityAttributeOption option = attributeService
+ .getTrackedEntityAttributeOption( Integer.parseInt( value ) );
if ( option != null )
{
@@ -215,7 +207,7 @@
{
if ( TrackedEntityAttribute.TYPE_COMBO.equalsIgnoreCase( attribute.getValueType() ) )
{
- TrackedEntityAttributeOption option = attributeOptionService.get( NumberUtils.toInt( value,
+ TrackedEntityAttributeOption option = attributeService.getTrackedEntityAttributeOption( NumberUtils.toInt( value,
0 ) );
if ( option != null )
{
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/UpdateTrackedEntityInstanceAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/UpdateTrackedEntityInstanceAction.java 2014-02-07 20:25:49 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/UpdateTrackedEntityInstanceAction.java 2014-02-14 16:13:55 +0000
@@ -40,11 +40,10 @@
import org.hisp.dhis.i18n.I18nFormat;
import org.hisp.dhis.organisationunit.OrganisationUnit;
import org.hisp.dhis.ouwt.manager.OrganisationUnitSelectionManager;
-import org.hisp.dhis.trackedentity.TrackedEntityInstance;
import org.hisp.dhis.trackedentity.TrackedEntityAttribute;
import org.hisp.dhis.trackedentity.TrackedEntityAttributeOption;
-import org.hisp.dhis.trackedentity.TrackedEntityAttributeOptionService;
import org.hisp.dhis.trackedentity.TrackedEntityAttributeService;
+import org.hisp.dhis.trackedentity.TrackedEntityInstance;
import org.hisp.dhis.trackedentity.TrackedEntityInstanceService;
import org.hisp.dhis.trackedentityattributevalue.TrackedEntityAttributeValue;
import org.hisp.dhis.trackedentityattributevalue.TrackedEntityAttributeValueService;
@@ -68,8 +67,6 @@
private TrackedEntityAttributeValueService attributeValueService;
- private TrackedEntityAttributeOptionService attributeOptionService;
-
private OrganisationUnitSelectionManager selectionManager;
private I18nFormat format;
@@ -146,7 +143,7 @@
attributeValue.setValue( value.trim() );
if ( TrackedEntityAttribute.TYPE_COMBO.equalsIgnoreCase( attribute.getValueType() ) )
{
- TrackedEntityAttributeOption option = attributeOptionService.get( Integer
+ TrackedEntityAttributeOption option = attributeService.getTrackedEntityAttributeOption( Integer
.parseInt( value ) );
if ( option != null )
{
@@ -160,7 +157,7 @@
{
if ( TrackedEntityAttribute.TYPE_COMBO.equalsIgnoreCase( attribute.getValueType() ) )
{
- TrackedEntityAttributeOption option = attributeOptionService.get( NumberUtils.toInt(
+ TrackedEntityAttributeOption option = attributeService.getTrackedEntityAttributeOption( NumberUtils.toInt(
value, 0 ) );
if ( option != null )
{
@@ -225,11 +222,6 @@
return entityInstance;
}
- public void setattributeOptionService( TrackedEntityAttributeOptionService attributeOptionService )
- {
- this.attributeOptionService = attributeOptionService;
- }
-
public void setRepresentativeId( Integer representativeId )
{
this.representativeId = representativeId;
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml 2014-02-07 20:25:49 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml 2014-02-14 16:13:55 +0000
@@ -446,8 +446,6 @@
<property name="entityInstanceService" ref="org.hisp.dhis.trackedentity.TrackedEntityInstanceService" />
<property name="attributeService"
ref="org.hisp.dhis.trackedentity.TrackedEntityAttributeService" />
- <property name="attributeOptionService"
- ref="org.hisp.dhis.trackedentity.TrackedEntityAttributeOptionService" />
<property name="relationshipService"
ref="org.hisp.dhis.relationship.RelationshipService" />
<property name="relationshipTypeService"
@@ -471,8 +469,6 @@
<property name="attributeService">
<ref bean="org.hisp.dhis.trackedentity.TrackedEntityAttributeService" />
</property>
- <property name="attributeOptionService"
- ref="org.hisp.dhis.trackedentity.TrackedEntityAttributeOptionService" />
<property name="selectionManager"
ref="org.hisp.dhis.ouwt.manager.OrganisationUnitSelectionManager" />
</bean>
@@ -518,7 +514,7 @@
ref="org.hisp.dhis.ouwt.manager.OrganisationUnitSelectionManager" />
<property name="relationshipTypeService"
ref="org.hisp.dhis.relationship.RelationshipTypeService" />
- <property name="AttributeService"
+ <property name="attributeService"
ref="org.hisp.dhis.trackedentity.TrackedEntityAttributeService" />
</bean>
@@ -621,8 +617,6 @@
<property name="entityInstanceService" ref="org.hisp.dhis.trackedentity.TrackedEntityInstanceService" />
<property name="attributeValueService"
ref="org.hisp.dhis.trackedentityattributevalue.TrackedEntityAttributeValueService" />
- <property name="attributeOptionService"
- ref="org.hisp.dhis.trackedentity.TrackedEntityAttributeOptionService" />
<property name="programService" ref="org.hisp.dhis.program.ProgramService" />
<property name="attributeService"
ref="org.hisp.dhis.trackedentity.TrackedEntityAttributeService" />
=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/beneficiaryenrollment/action/SaveMobileProgramEnrollmentAction.java'
--- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/beneficiaryenrollment/action/SaveMobileProgramEnrollmentAction.java 2014-02-07 20:25:49 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/beneficiaryenrollment/action/SaveMobileProgramEnrollmentAction.java 2014-02-14 16:13:55 +0000
@@ -53,7 +53,6 @@
import org.hisp.dhis.trackedentity.TrackedEntityInstance;
import org.hisp.dhis.trackedentity.TrackedEntityAttribute;
import org.hisp.dhis.trackedentity.TrackedEntityAttributeOption;
-import org.hisp.dhis.trackedentity.TrackedEntityAttributeOptionService;
import org.hisp.dhis.trackedentity.TrackedEntityAttributeService;
import org.hisp.dhis.trackedentity.TrackedEntityInstanceService;
import org.hisp.dhis.trackedentityattributevalue.TrackedEntityAttributeValue;
@@ -125,18 +124,6 @@
this.patientAttributeService = patientAttributeService;
}
- private TrackedEntityAttributeOptionService patientAttributeOptionService;
-
- public TrackedEntityAttributeOptionService getPatientAttributeOptionService()
- {
- return patientAttributeOptionService;
- }
-
- public void setPatientAttributeOptionService( TrackedEntityAttributeOptionService patientAttributeOptionService )
- {
- this.patientAttributeOptionService = patientAttributeOptionService;
- }
-
private TrackedEntityAttributeValueService patientAttributeValueService;
public TrackedEntityAttributeValueService getPatientAttributeValueService()
@@ -311,7 +298,7 @@
if ( TrackedEntityAttribute.TYPE_COMBO.equalsIgnoreCase( patientAttribute.getValueType() ) )
{
- TrackedEntityAttributeOption option = patientAttributeOptionService.get( NumberUtils.toInt(
+ TrackedEntityAttributeOption option = patientAttributeService.getTrackedEntityAttributeOption( NumberUtils.toInt(
value, 0 ) );
if ( option != null )
=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/beneficiaryregistration/action/SaveBeneficiaryAction.java'
--- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/beneficiaryregistration/action/SaveBeneficiaryAction.java 2014-02-07 20:25:49 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/beneficiaryregistration/action/SaveBeneficiaryAction.java 2014-02-14 16:13:55 +0000
@@ -46,7 +46,6 @@
import org.hisp.dhis.trackedentity.TrackedEntityInstance;
import org.hisp.dhis.trackedentity.TrackedEntityAttribute;
import org.hisp.dhis.trackedentity.TrackedEntityAttributeOption;
-import org.hisp.dhis.trackedentity.TrackedEntityAttributeOptionService;
import org.hisp.dhis.trackedentity.TrackedEntityAttributeService;
import org.hisp.dhis.trackedentity.TrackedEntityInstanceService;
import org.hisp.dhis.trackedentityattributevalue.TrackedEntityAttributeValue;
@@ -98,18 +97,6 @@
this.patientAttributeService = patientAttributeService;
}
- private TrackedEntityAttributeOptionService patientAttributeOptionService;
-
- public TrackedEntityAttributeOptionService getPatientAttributeOptionService()
- {
- return patientAttributeOptionService;
- }
-
- public void setPatientAttributeOptionService( TrackedEntityAttributeOptionService patientAttributeOptionService )
- {
- this.patientAttributeOptionService = patientAttributeOptionService;
- }
-
private ProgramService programService;
public ProgramService getProgramService()
@@ -354,8 +341,8 @@
if ( TrackedEntityAttribute.TYPE_COMBO.equalsIgnoreCase( patientAttribute.getValueType() ) )
{
- TrackedEntityAttributeOption option = patientAttributeOptionService
- .get( NumberUtils.toInt( value, 0 ) );
+ TrackedEntityAttributeOption option = patientAttributeService
+ .getTrackedEntityAttributeOption( NumberUtils.toInt( value, 0 ) );
if ( option != null )
{
=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-web/dhis-web-light/src/main/resources/META-INF/dhis/beans.xml 2014-02-07 20:25:49 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/resources/META-INF/dhis/beans.xml 2014-02-14 16:13:55 +0000
@@ -357,8 +357,6 @@
<property name="patientService" ref="org.hisp.dhis.trackedentity.TrackedEntityInstanceService" />
<property name="patientAttributeService"
ref="org.hisp.dhis.trackedentity.TrackedEntityAttributeService" />
- <property name="patientAttributeOptionService"
- ref="org.hisp.dhis.trackedentity.TrackedEntityAttributeOptionService" />
<property name="programService" ref="org.hisp.dhis.program.ProgramService" />
</bean>
@@ -413,8 +411,6 @@
<property name="formUtils" ref="org.hisp.dhis.light.utils.FormUtils" />
<property name="patientAttributeValueService"
ref="org.hisp.dhis.trackedentityattributevalue.TrackedEntityAttributeValueService" />
- <property name="patientAttributeOptionService"
- ref="org.hisp.dhis.trackedentity.TrackedEntityAttributeOptionService" />
<property name="patientAttributeService"
ref="org.hisp.dhis.trackedentity.TrackedEntityAttributeService" />
</bean>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/trackedentityattribute/AddAttributeAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/trackedentityattribute/AddAttributeAction.java 2014-02-07 20:25:49 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/trackedentityattribute/AddAttributeAction.java 2014-02-14 16:13:55 +0000
@@ -35,7 +35,6 @@
import org.hisp.dhis.period.PeriodType;
import org.hisp.dhis.trackedentity.TrackedEntityAttribute;
import org.hisp.dhis.trackedentity.TrackedEntityAttributeOption;
-import org.hisp.dhis.trackedentity.TrackedEntityAttributeOptionService;
import org.hisp.dhis.trackedentity.TrackedEntityAttributeService;
import org.springframework.beans.factory.annotation.Autowired;
@@ -59,13 +58,6 @@
this.attributeService = attributeService;
}
- private TrackedEntityAttributeOptionService attributeOptionService;
-
- public void setAttributeOptionService( TrackedEntityAttributeOptionService attributeOptionService )
- {
- this.attributeOptionService = attributeOptionService;
- }
-
@Autowired
private PeriodService periodService;
@@ -215,7 +207,7 @@
opt.setName( optionName );
opt.setAttribute( attribute );
attribute.addAttributeOptions( opt );
- attributeOptionService.addTrackedEntityAttributeOption( opt );
+ attributeService.addTrackedEntityAttributeOption( opt );
}
}
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/trackedentityattribute/RemoveAttributeOptionAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/trackedentityattribute/RemoveAttributeOptionAction.java 2014-02-07 20:25:49 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/trackedentityattribute/RemoveAttributeOptionAction.java 2014-02-14 16:13:55 +0000
@@ -30,7 +30,7 @@
import org.hisp.dhis.i18n.I18n;
import org.hisp.dhis.trackedentity.TrackedEntityAttributeOption;
-import org.hisp.dhis.trackedentity.TrackedEntityAttributeOptionService;
+import org.hisp.dhis.trackedentity.TrackedEntityAttributeService;
import org.hisp.dhis.trackedentityattributevalue.TrackedEntityAttributeValueService;
import com.opensymphony.xwork2.Action;
@@ -45,44 +45,40 @@
// Dependencies
// -------------------------------------------------------------------------
- private TrackedEntityAttributeOptionService attributeOptionService;
+ private TrackedEntityAttributeService attributeService;
+
+ public void setAttributeService( TrackedEntityAttributeService attributeService )
+ {
+ this.attributeService = attributeService;
+ }
private TrackedEntityAttributeValueService attributeValueService;
+ public void setAttributeValueService( TrackedEntityAttributeValueService attributeValueService )
+ {
+ this.attributeValueService = attributeValueService;
+ }
+
// -------------------------------------------------------------------------
// Input/Output
// -------------------------------------------------------------------------
private int id;
- private String message;
-
- private I18n i18n;
-
- // -------------------------------------------------------------------------
- // Getter && Setter
- // -------------------------------------------------------------------------
-
- public void setAttributeOptionService( TrackedEntityAttributeOptionService attributeOptionService )
- {
- this.attributeOptionService = attributeOptionService;
- }
-
- public void setAttributeValueService( TrackedEntityAttributeValueService attributeValueService )
- {
- this.attributeValueService = attributeValueService;
- }
-
public void setId( int id )
{
this.id = id;
}
+ private String message;
+
public String getMessage()
{
return message;
}
+ private I18n i18n;
+
public void setI18n( I18n i18n )
{
this.i18n = i18n;
@@ -95,7 +91,7 @@
public String execute()
throws Exception
{
- TrackedEntityAttributeOption attributeOption = attributeOptionService.get( id );
+ TrackedEntityAttributeOption attributeOption = attributeService.getTrackedEntityAttributeOption( id );
if ( attributeOption != null )
{
@@ -107,7 +103,7 @@
}
else
{
- attributeOptionService.deleteTrackedEntityAttributeOption( attributeOption );
+ attributeService.deleteTrackedEntityAttributeOption( attributeOption );
message = i18n.getString( "success_delete_tracked_entity_attribute_option" );
return SUCCESS;
}
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/trackedentityattribute/UpdateAttributeAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/trackedentityattribute/UpdateAttributeAction.java 2014-02-07 20:25:49 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/trackedentityattribute/UpdateAttributeAction.java 2014-02-14 16:13:55 +0000
@@ -39,7 +39,6 @@
import org.hisp.dhis.period.PeriodType;
import org.hisp.dhis.trackedentity.TrackedEntityAttribute;
import org.hisp.dhis.trackedentity.TrackedEntityAttributeOption;
-import org.hisp.dhis.trackedentity.TrackedEntityAttributeOptionService;
import org.hisp.dhis.trackedentity.TrackedEntityAttributeService;
import org.hisp.dhis.trackedentityattributevalue.TrackedEntityAttributeValueService;
import org.springframework.beans.factory.annotation.Autowired;
@@ -66,13 +65,6 @@
this.attributeService = attributeService;
}
- private TrackedEntityAttributeOptionService attributeOptionService;
-
- public void setAttributeOptionService( TrackedEntityAttributeOptionService attributeOptionService )
- {
- this.attributeOptionService = attributeOptionService;
- }
-
private TrackedEntityAttributeValueService attributeValueService;
public void setAttributeValueService( TrackedEntityAttributeValueService attributeValueService )
@@ -207,7 +199,7 @@
HttpServletRequest request = ServletActionContext.getRequest();
- Collection<TrackedEntityAttributeOption> attributeOptions = attributeOptionService.get( attribute );
+ Collection<TrackedEntityAttributeOption> attributeOptions = attributeService.getTrackedEntityAttributeOption( attribute );
if ( attributeOptions != null && attributeOptions.size() > 0 )
{
@@ -218,7 +210,7 @@
if ( StringUtils.isNotBlank( value ) )
{
option.setName( value.trim() );
- attributeOptionService.updateTrackedEntityAttributeOption( option );
+ attributeService.updateTrackedEntityAttributeOption( option );
attributeValueService.updateTrackedEntityAttributeValues( option );
}
}
@@ -229,14 +221,14 @@
TrackedEntityAttributeOption opt = null;
for ( String optionName : attrOptions )
{
- opt = attributeOptionService.get( attribute, optionName );
+ opt = attributeService.getTrackedEntityAttributeOption( attribute, optionName );
if ( opt == null )
{
opt = new TrackedEntityAttributeOption();
opt.setName( optionName );
opt.setAttribute( attribute );
attribute.addAttributeOptions( opt );
- attributeOptionService.addTrackedEntityAttributeOption( opt );
+ attributeService.addTrackedEntityAttributeOption( opt );
}
}
}
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/resources/META-INF/dhis/beans.xml 2014-02-07 20:25:49 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/resources/META-INF/dhis/beans.xml 2014-02-14 16:13:55 +0000
@@ -77,8 +77,6 @@
scope="prototype">
<property name="attributeService"
ref="org.hisp.dhis.trackedentity.TrackedEntityAttributeService" />
- <property name="attributeOptionService"
- ref="org.hisp.dhis.trackedentity.TrackedEntityAttributeOptionService" />
</bean>
<bean
@@ -95,8 +93,6 @@
scope="prototype">
<property name="attributeService"
ref="org.hisp.dhis.trackedentity.TrackedEntityAttributeService" />
- <property name="attributeOptionService"
- ref="org.hisp.dhis.trackedentity.TrackedEntityAttributeOptionService" />
<property name="attributeValueService"
ref="org.hisp.dhis.trackedentityattributevalue.TrackedEntityAttributeValueService" />
</bean>
@@ -129,8 +125,8 @@
id="org.hisp.dhis.trackedentity.action.trackedentityattribute.RemoveAttributeOptionAction"
class="org.hisp.dhis.trackedentity.action.trackedentityattribute.RemoveAttributeOptionAction"
scope="prototype">
- <property name="attributeOptionService"
- ref="org.hisp.dhis.trackedentity.TrackedEntityAttributeOptionService" />
+ <property name="attributeService"
+ ref="org.hisp.dhis.trackedentity.TrackedEntityAttributeService" />
<property name="attributeValueService"
ref="org.hisp.dhis.trackedentityattributevalue.TrackedEntityAttributeValueService" />
</bean>