dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #40562
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 20588: Removed unused dependencies
------------------------------------------------------------
revno: 20588
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2015-10-08 16:12:50 +0200
message:
Removed unused dependencies
modified:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/GenericIdentifiableObjectStore.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnitStore.java
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/common/hibernate/HibernateIdentifiableObjectStore.java
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/organisationunit/DefaultOrganisationUnitService.java
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/organisationunit/hibernate/HibernateOrganisationUnitStore.java
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/preheat/DefaultPreheatService.java
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/program/DefaultProgramInstanceService.java
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/program/ProgramStageDataElementDeletionHandler.java
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/schema/AbstractPropertyIntrospectorService.java
dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataanalysis/DataAnalysisStoreTest.java
dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataanalysis/MinMaxOutlierAnalysisServiceTest.java
dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataapproval/DataApprovalServiceCategoryOptionGroupTest.java
dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataset/SectionStoreTest.java
dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/datavalue/DataValueServiceTest.java
dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/mapping/MappingServiceTest.java
dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/organisationunit/OrganisationUnitServiceTest.java
dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/program/ProgramExpressionServiceTest.java
dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/program/ProgramStageSectionServiceTest.java
dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/program/ProgramStageSectionStoreTest.java
dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/program/ProgramStoreTest.java
dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/program/ProgramValidationStoreTest.java
dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/trackedentity/TrackedEntityInstanceServiceTest.java
dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/trackedentity/TrackedEntityInstanceStoreTest.java
dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/validation/ValidationRuleServiceTest.java
dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/datavalueset/DefaultDataValueSetService.java
dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/importers/DefaultIdentifiableObjectImporter.java
--
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/common/GenericIdentifiableObjectStore.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/GenericIdentifiableObjectStore.java 2015-03-08 13:34:06 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/GenericIdentifiableObjectStore.java 2015-10-08 14:12:50 +0000
@@ -185,14 +185,30 @@
int getCountLikeName( String name );
/**
- * Retrieves a list of objects referenced by the given List of uids.
+ * Retrieves a list of objects referenced by the given collection of uids.
*
- * @param uids a List of uids.
+ * @param uids a collection of uids.
* @return a list of objects.
*/
List<T> getByUid( Collection<String> uids );
/**
+ * Retrieves a list of objects referenced by the given collection of codes.
+ *
+ * @param uids a collection of codes.
+ * @return a list of objects.
+ */
+ List<T> getByCode( Collection<String> codes );
+
+ /**
+ * Retrieves a list of objects referenced by the given collection of names.
+ *
+ * @param uids a collection of names.
+ * @return a list of objects.
+ */
+ List<T> getByName( Collection<String> names );
+
+ /**
* Retrieves a list of objects referenced by the given List of uids.
* Bypasses the ACL system.
*
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnitStore.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnitStore.java 2015-09-17 13:42:30 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnitStore.java 2015-10-08 14:12:50 +0000
@@ -28,7 +28,6 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-import java.util.Collection;
import java.util.Date;
import java.util.List;
import java.util.Map;
@@ -60,22 +59,6 @@
OrganisationUnit getByUuid( String uuid );
/**
- * Retrieves all OrganisationUnits matching the given names.
- *
- * @param names names of the OrganisationUnits to return.
- * @return all OrganisationUnits matching the given names.
- */
- List<OrganisationUnit> getByNames( Collection<String> names );
-
- /**
- * Retrieves all OrganisationUnits matching the given codes.
- *
- * @param codes codes of the OrganisationUnits to return.
- * @return all OrganisationUnits matching the given codes.
- */
- List<OrganisationUnit> getByCodes( Collection<String> codes );
-
- /**
* Returns all OrganisationUnits by lastUpdated.
*
* @param lastUpdated OrganisationUnits from this date
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/common/hibernate/HibernateIdentifiableObjectStore.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/common/hibernate/HibernateIdentifiableObjectStore.java 2015-03-18 20:13:23 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/common/hibernate/HibernateIdentifiableObjectStore.java 2015-10-08 14:12:50 +0000
@@ -436,6 +436,30 @@
}
@Override
+ @SuppressWarnings( "unchecked" )
+ public List<T> getByCode( Collection<String> codes )
+ {
+ if ( codes == null || codes.isEmpty() )
+ {
+ return new ArrayList<>();
+ }
+
+ return getSharingCriteria().add( Restrictions.in( "code", codes ) ).list();
+ }
+
+ @Override
+ @SuppressWarnings( "unchecked" )
+ public List<T> getByName( Collection<String> names )
+ {
+ if ( names == null || names.isEmpty() )
+ {
+ return new ArrayList<>();
+ }
+
+ return getSharingCriteria().add( Restrictions.in( "name", names ) ).list();
+ }
+
+ @Override
public List<T> getByUidNoAcl( Collection<String> uids )
{
List<T> list = new ArrayList<>();
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/organisationunit/DefaultOrganisationUnitService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/organisationunit/DefaultOrganisationUnitService.java 2015-09-30 18:21:31 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/organisationunit/DefaultOrganisationUnitService.java 2015-10-08 14:12:50 +0000
@@ -256,13 +256,13 @@
@Override
public List<OrganisationUnit> getOrganisationUnitsByNames( Collection<String> names )
{
- return i18n( i18nService, organisationUnitStore.getByNames( names ) );
+ return i18n( i18nService, organisationUnitStore.getByName( names ) );
}
@Override
public List<OrganisationUnit> getOrganisationUnitsByCodes( Collection<String> codes )
{
- return i18n( i18nService, organisationUnitStore.getByCodes( codes ) );
+ return i18n( i18nService, organisationUnitStore.getByCode( codes ) );
}
@Override
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/organisationunit/hibernate/HibernateOrganisationUnitStore.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/organisationunit/hibernate/HibernateOrganisationUnitStore.java 2015-10-05 15:32:26 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/organisationunit/hibernate/HibernateOrganisationUnitStore.java 2015-10-08 14:12:50 +0000
@@ -32,7 +32,6 @@
import java.sql.SQLException;
import java.sql.Timestamp;
import java.util.ArrayList;
-import java.util.Collection;
import java.util.Date;
import java.util.List;
import java.util.Map;
@@ -91,36 +90,6 @@
}
@Override
- @SuppressWarnings( "unchecked" )
- public List<OrganisationUnit> getByNames( Collection<String> names )
- {
- if ( names == null || names.isEmpty() )
- {
- return new ArrayList<>();
- }
-
- Query query = getQuery( "from OrganisationUnit where name in :names" );
- query.setParameterList( "names", names );
-
- return query.list();
- }
-
- @Override
- @SuppressWarnings( "unchecked" )
- public List<OrganisationUnit> getByCodes( Collection<String> codes )
- {
- if ( codes == null || codes.isEmpty() )
- {
- return new ArrayList<>();
- }
-
- Query query = getQuery( "from OrganisationUnit where code in :codes" );
- query.setParameterList( "codes", codes );
-
- return query.list();
- }
-
- @Override
public List<OrganisationUnit> getAllOrganisationUnitsByLastUpdated( Date lastUpdated )
{
return getAllGeLastUpdated( lastUpdated );
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/preheat/DefaultPreheatService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/preheat/DefaultPreheatService.java 2015-10-01 07:51:29 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/preheat/DefaultPreheatService.java 2015-10-08 14:12:50 +0000
@@ -32,8 +32,6 @@
import java.util.Map;
import java.util.Set;
-import org.hisp.dhis.common.IdentifiableObjectManager;
-import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
/**
@@ -42,9 +40,6 @@
@Transactional
public class DefaultPreheatService implements PreheatService
{
- @Autowired
- private IdentifiableObjectManager identifiableObjectManager;
-
@Override
public void preheat( Set<Class<?>> classes )
{
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/program/DefaultProgramInstanceService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/program/DefaultProgramInstanceService.java 2015-09-24 08:32:10 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/program/DefaultProgramInstanceService.java 2015-10-08 14:12:50 +0000
@@ -28,6 +28,18 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+import static org.hisp.dhis.common.OrganisationUnitSelectionMode.ACCESSIBLE;
+import static org.hisp.dhis.common.OrganisationUnitSelectionMode.ALL;
+import static org.hisp.dhis.common.OrganisationUnitSelectionMode.CHILDREN;
+
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.Collection;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.hisp.dhis.common.CodeGenerator;
@@ -50,23 +62,11 @@
import org.hisp.dhis.trackedentity.TrackedEntityInstanceReminderService;
import org.hisp.dhis.trackedentity.TrackedEntityInstanceService;
import org.hisp.dhis.trackedentity.TrackedEntityService;
-import org.hisp.dhis.trackedentityattributevalue.TrackedEntityAttributeValueService;
-import org.hisp.dhis.trackedentitydatavalue.TrackedEntityDataValueService;
import org.hisp.dhis.user.CurrentUserService;
import org.hisp.dhis.user.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
-import java.util.ArrayList;
-import java.util.Calendar;
-import java.util.Collection;
-import java.util.Date;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import static org.hisp.dhis.common.OrganisationUnitSelectionMode.*;
-
/**
* @author Abyot Asalefew
*/
@@ -84,12 +84,6 @@
private ProgramInstanceStore programInstanceStore;
@Autowired
- private TrackedEntityAttributeValueService attributeValueService;
-
- @Autowired
- private TrackedEntityDataValueService dataValueService;
-
- @Autowired
private ProgramService programService;
@Autowired
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/program/ProgramStageDataElementDeletionHandler.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/program/ProgramStageDataElementDeletionHandler.java 2015-10-07 04:52:14 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/program/ProgramStageDataElementDeletionHandler.java 2015-10-08 14:12:50 +0000
@@ -28,7 +28,6 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-import org.hisp.dhis.common.IdentifiableObjectManager;
import org.hisp.dhis.dataelement.DataElement;
import org.hisp.dhis.dataelement.DataElementDomain;
import org.hisp.dhis.system.deletion.DeletionHandler;
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/schema/AbstractPropertyIntrospectorService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/schema/AbstractPropertyIntrospectorService.java 2015-10-08 04:16:40 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/schema/AbstractPropertyIntrospectorService.java 2015-10-08 14:12:50 +0000
@@ -58,7 +58,6 @@
import org.hisp.dhis.common.DimensionalObject;
import org.hisp.dhis.common.IdentifiableObject;
import org.hisp.dhis.common.NameableObject;
-import org.hisp.dhis.dataelement.DataElement;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.orm.hibernate4.LocalSessionFactoryBean;
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataanalysis/DataAnalysisStoreTest.java'
--- dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataanalysis/DataAnalysisStoreTest.java 2015-09-23 16:56:18 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataanalysis/DataAnalysisStoreTest.java 2015-10-08 14:12:50 +0000
@@ -41,13 +41,11 @@
import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo;
import org.hisp.dhis.dataelement.DataElementCategoryService;
import org.hisp.dhis.dataelement.DataElementService;
-import org.hisp.dhis.dataset.DataSetService;
import org.hisp.dhis.datavalue.DataValueService;
import org.hisp.dhis.organisationunit.OrganisationUnit;
import org.hisp.dhis.organisationunit.OrganisationUnitService;
import org.hisp.dhis.period.MonthlyPeriodType;
import org.hisp.dhis.period.Period;
-import org.hisp.dhis.period.PeriodService;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
@@ -67,17 +65,11 @@
private DataElementCategoryService categoryService;
@Autowired
- private DataSetService dataSetService;
-
- @Autowired
private OrganisationUnitService organisationUnitService;
@Autowired
private DataValueService dataValueService;
- @Autowired
- private PeriodService periodService;
-
private DataElement dataElementA;
private DataElement dataElementB;
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataanalysis/MinMaxOutlierAnalysisServiceTest.java'
--- dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataanalysis/MinMaxOutlierAnalysisServiceTest.java 2015-09-04 09:29:23 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataanalysis/MinMaxOutlierAnalysisServiceTest.java 2015-10-08 14:12:50 +0000
@@ -35,7 +35,6 @@
import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo;
import org.hisp.dhis.dataelement.DataElementCategoryService;
import org.hisp.dhis.dataelement.DataElementService;
-import org.hisp.dhis.dataset.DataSetService;
import org.hisp.dhis.datavalue.DataValue;
import org.hisp.dhis.datavalue.DataValueService;
import org.hisp.dhis.datavalue.DeflatedDataValue;
@@ -45,7 +44,6 @@
import org.hisp.dhis.organisationunit.OrganisationUnitService;
import org.hisp.dhis.period.MonthlyPeriodType;
import org.hisp.dhis.period.Period;
-import org.hisp.dhis.period.PeriodService;
import org.junit.Ignore;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
@@ -79,17 +77,11 @@
private DataElementCategoryService categoryService;
@Autowired
- private DataSetService dataSetService;
-
- @Autowired
private OrganisationUnitService organisationUnitService;
@Autowired
private DataValueService dataValueService;
- @Autowired
- private PeriodService periodService;
-
private DataElement dataElementA;
private DataElement dataElementB;
private DataElement dataElementC;
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataapproval/DataApprovalServiceCategoryOptionGroupTest.java'
--- dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataapproval/DataApprovalServiceCategoryOptionGroupTest.java 2015-10-06 18:24:42 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataapproval/DataApprovalServiceCategoryOptionGroupTest.java 2015-10-08 14:12:50 +0000
@@ -46,7 +46,6 @@
import org.hisp.dhis.dataapproval.exceptions.DataApprovalException;
import org.hisp.dhis.dataelement.CategoryOptionGroup;
import org.hisp.dhis.dataelement.CategoryOptionGroupSet;
-import org.hisp.dhis.dataelement.CategoryOptionGroupStore;
import org.hisp.dhis.dataelement.DataElementCategory;
import org.hisp.dhis.dataelement.DataElementCategoryCombo;
import org.hisp.dhis.dataelement.DataElementCategoryOption;
@@ -103,9 +102,6 @@
private DataElementCategoryService categoryService;
@Autowired
- private CategoryOptionGroupStore categoryOptionGroupStore;
-
- @Autowired
private HibernateCategoryOptionGroupStore hibernateCategoryOptionGroupStore;
@Autowired
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataset/SectionStoreTest.java'
--- dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataset/SectionStoreTest.java 2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataset/SectionStoreTest.java 2015-10-08 14:12:50 +0000
@@ -37,7 +37,6 @@
import org.hisp.dhis.DhisSpringTest;
import org.hisp.dhis.dataelement.DataElement;
-import org.hisp.dhis.dataelement.DataElementCategoryService;
import org.hisp.dhis.dataelement.DataElementService;
import org.hisp.dhis.period.MonthlyPeriodType;
import org.junit.Test;
@@ -56,9 +55,6 @@
private DataSetService dataSetService;
@Autowired
- private DataElementCategoryService categoryService;
-
- @Autowired
private SectionStore sectionStore;
private DataSet dataSet;
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/datavalue/DataValueServiceTest.java'
--- dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/datavalue/DataValueServiceTest.java 2015-09-21 12:17:42 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/datavalue/DataValueServiceTest.java 2015-10-08 14:12:50 +0000
@@ -45,7 +45,6 @@
import org.hisp.dhis.organisationunit.OrganisationUnit;
import org.hisp.dhis.organisationunit.OrganisationUnitService;
import org.hisp.dhis.period.Period;
-import org.hisp.dhis.period.PeriodService;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
@@ -66,9 +65,6 @@
private DataValueService dataValueService;
@Autowired
- private PeriodService periodService;
-
- @Autowired
private OrganisationUnitService organisationUnitService;
// -------------------------------------------------------------------------
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/mapping/MappingServiceTest.java'
--- dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/mapping/MappingServiceTest.java 2015-02-24 13:16:58 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/mapping/MappingServiceTest.java 2015-10-08 14:12:50 +0000
@@ -53,9 +53,6 @@
extends DhisSpringTest
{
@Autowired
- private MappingService mappingService;
-
- @Autowired
private OrganisationUnitService organisationUnitService;
@Autowired
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/organisationunit/OrganisationUnitServiceTest.java'
--- dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/organisationunit/OrganisationUnitServiceTest.java 2015-09-17 13:26:47 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/organisationunit/OrganisationUnitServiceTest.java 2015-10-08 14:12:50 +0000
@@ -162,6 +162,26 @@
}
@Test
+ public void testGetOrganisationUnitByCode()
+ {
+ OrganisationUnit unit1 = createOrganisationUnit( 'A' );
+ OrganisationUnit unit2 = createOrganisationUnit( 'B' );
+ OrganisationUnit unit3 = createOrganisationUnit( 'C' );
+
+ organisationUnitService.addOrganisationUnit( unit1 );
+ organisationUnitService.addOrganisationUnit( unit2 );
+ organisationUnitService.addOrganisationUnit( unit3 );
+
+ Set<String> codes = Sets.newHashSet( unit2.getCode(), unit3.getCode() );
+
+ List<OrganisationUnit> units = organisationUnitService.getOrganisationUnitsByCodes( codes );
+
+ assertEquals( 2, units.size() );
+ assertTrue( units.contains( unit2 ) );
+ assertTrue( units.contains( unit3 ) );
+ }
+
+ @Test
public void testGetOrganisationUnitLevel()
{
OrganisationUnit unitA = createOrganisationUnit( 'A' );
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/program/ProgramExpressionServiceTest.java'
--- dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/program/ProgramExpressionServiceTest.java 2015-09-03 03:11:47 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/program/ProgramExpressionServiceTest.java 2015-10-08 14:12:50 +0000
@@ -41,7 +41,6 @@
import org.hisp.dhis.DhisSpringTest;
import org.hisp.dhis.dataelement.DataElement;
import org.hisp.dhis.dataelement.DataElementService;
-import org.hisp.dhis.dataentryform.DataEntryFormService;
import org.hisp.dhis.organisationunit.OrganisationUnit;
import org.hisp.dhis.organisationunit.OrganisationUnitService;
import org.hisp.dhis.trackedentity.TrackedEntityInstance;
@@ -73,12 +72,6 @@
private ProgramService programService;
@Autowired
- private ProgramStageDataElementService programStageDataElementService;
-
- @Autowired
- private DataEntryFormService dataEntryFormService;
-
- @Autowired
private ProgramStageService programStageService;
@Autowired
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/program/ProgramStageSectionServiceTest.java'
--- dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/program/ProgramStageSectionServiceTest.java 2015-09-03 03:11:47 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/program/ProgramStageSectionServiceTest.java 2015-10-08 14:12:50 +0000
@@ -54,9 +54,6 @@
private ProgramStageSectionService programStageSectionService;
@Autowired
- private ProgramStageDataElementStore programStageDataElementStore;
-
- @Autowired
private OrganisationUnitService organisationUnitService;
@Autowired
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/program/ProgramStageSectionStoreTest.java'
--- dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/program/ProgramStageSectionStoreTest.java 2015-09-03 03:11:47 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/program/ProgramStageSectionStoreTest.java 2015-10-08 14:12:50 +0000
@@ -53,9 +53,6 @@
private ProgramStageSectionStore programStageSectionStore;
@Autowired
- private ProgramStageDataElementStore programStageDataElementStore;
-
- @Autowired
private OrganisationUnitService organisationUnitService;
@Autowired
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/program/ProgramStoreTest.java'
--- dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/program/ProgramStoreTest.java 2015-09-03 03:11:47 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/program/ProgramStoreTest.java 2015-10-08 14:12:50 +0000
@@ -36,7 +36,6 @@
import org.hisp.dhis.DhisSpringTest;
import org.hisp.dhis.organisationunit.OrganisationUnit;
import org.hisp.dhis.organisationunit.OrganisationUnitService;
-import org.hisp.dhis.validation.ValidationCriteriaService;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
@@ -52,9 +51,6 @@
@Autowired
private OrganisationUnitService organisationUnitService;
- @Autowired
- private ValidationCriteriaService validationCriteriaService;
-
private OrganisationUnit organisationUnitA;
private OrganisationUnit organisationUnitB;
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/program/ProgramValidationStoreTest.java'
--- dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/program/ProgramValidationStoreTest.java 2015-09-03 03:11:47 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/program/ProgramValidationStoreTest.java 2015-10-08 14:12:50 +0000
@@ -52,9 +52,6 @@
private ProgramValidationStore programValidationStore;
@Autowired
- private ProgramStageInstanceService programStageInstanceService;
-
- @Autowired
private ProgramStageDataElementService programStageDataElementService;
@Autowired
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/trackedentity/TrackedEntityInstanceServiceTest.java'
--- dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/trackedentity/TrackedEntityInstanceServiceTest.java 2015-09-03 03:11:47 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/trackedentity/TrackedEntityInstanceServiceTest.java 2015-10-08 14:12:50 +0000
@@ -40,13 +40,9 @@
import org.hisp.dhis.DhisSpringTest;
import org.hisp.dhis.organisationunit.OrganisationUnit;
import org.hisp.dhis.organisationunit.OrganisationUnitService;
-import org.hisp.dhis.program.ProgramInstanceService;
-import org.hisp.dhis.program.ProgramService;
import org.hisp.dhis.relationship.RelationshipType;
import org.hisp.dhis.relationship.RelationshipTypeService;
import org.hisp.dhis.trackedentityattributevalue.TrackedEntityAttributeValue;
-import org.hisp.dhis.trackedentityattributevalue.TrackedEntityAttributeValueService;
-import org.hisp.dhis.validation.ValidationCriteriaService;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
@@ -60,24 +56,12 @@
private TrackedEntityInstanceService entityInstanceService;
@Autowired
- private ProgramService programService;
-
- @Autowired
- private ProgramInstanceService programInstanceService;
-
- @Autowired
private OrganisationUnitService organisationUnitService;
@Autowired
private TrackedEntityAttributeService attributeService;
@Autowired
- private TrackedEntityAttributeValueService attributeValueService;
-
- @Autowired
- private ValidationCriteriaService validationCriteriaService;
-
- @Autowired
private RelationshipTypeService relationshipTypeService;
private TrackedEntityInstance entityInstanceA1;
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/trackedentity/TrackedEntityInstanceStoreTest.java'
--- dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/trackedentity/TrackedEntityInstanceStoreTest.java 2015-06-23 15:59:19 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/trackedentity/TrackedEntityInstanceStoreTest.java 2015-10-08 14:12:50 +0000
@@ -36,10 +36,6 @@
import org.hisp.dhis.DhisSpringTest;
import org.hisp.dhis.organisationunit.OrganisationUnit;
import org.hisp.dhis.organisationunit.OrganisationUnitService;
-import org.hisp.dhis.program.ProgramInstanceService;
-import org.hisp.dhis.program.ProgramService;
-import org.hisp.dhis.trackedentityattributevalue.TrackedEntityAttributeValueService;
-import org.hisp.dhis.validation.ValidationCriteriaService;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
@@ -53,23 +49,11 @@
private TrackedEntityInstanceStore entityInstanceStore;
@Autowired
- private ProgramService programService;
-
- @Autowired
- private ProgramInstanceService programInstanceService;
-
- @Autowired
private OrganisationUnitService organisationUnitService;
@Autowired
private TrackedEntityAttributeService attributeService;
- @Autowired
- private TrackedEntityAttributeValueService attributeValueService;
-
- @Autowired
- private ValidationCriteriaService validationCriteriaService;
-
private TrackedEntityInstance entityInstanceA1;
private TrackedEntityInstance entityInstanceB1;
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/validation/ValidationRuleServiceTest.java'
--- dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/validation/ValidationRuleServiceTest.java 2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/validation/ValidationRuleServiceTest.java 2015-10-08 14:12:50 +0000
@@ -64,7 +64,6 @@
import org.hisp.dhis.organisationunit.OrganisationUnitService;
import org.hisp.dhis.period.MonthlyPeriodType;
import org.hisp.dhis.period.Period;
-import org.hisp.dhis.period.PeriodService;
import org.hisp.dhis.period.PeriodType;
import org.hisp.dhis.period.WeeklyPeriodType;
import org.hisp.dhis.period.YearlyPeriodType;
@@ -101,9 +100,6 @@
@Autowired
private OrganisationUnitService organisationUnitService;
- @Autowired
- private PeriodService periodService;
-
private DataElement dataElementA;
private DataElement dataElementB;
=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/datavalueset/DefaultDataValueSetService.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/datavalueset/DefaultDataValueSetService.java 2015-10-06 18:24:42 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/datavalueset/DefaultDataValueSetService.java 2015-10-08 14:12:50 +0000
@@ -63,7 +63,6 @@
import org.hisp.dhis.dataset.CompleteDataSetRegistration;
import org.hisp.dhis.dataset.CompleteDataSetRegistrationService;
import org.hisp.dhis.dataset.DataSet;
-import org.hisp.dhis.dataset.DataSetService;
import org.hisp.dhis.datavalue.DataValue;
import org.hisp.dhis.dxf2.common.IdSchemes;
import org.hisp.dhis.dxf2.common.ImportOptions;
@@ -118,9 +117,6 @@
private DataElementCategoryService categoryService;
@Autowired
- private DataSetService dataSetService;
-
- @Autowired
private OrganisationUnitService organisationUnitService;
@Autowired
=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/importers/DefaultIdentifiableObjectImporter.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/importers/DefaultIdentifiableObjectImporter.java 2015-10-05 07:55:19 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/importers/DefaultIdentifiableObjectImporter.java 2015-10-08 14:12:50 +0000
@@ -28,9 +28,18 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-import com.google.common.collect.Lists;
-import com.google.common.collect.Maps;
-import com.google.common.collect.Sets;
+import static org.hisp.dhis.system.util.PredicateUtils.idObjectCollectionsWithScanned;
+import static org.hisp.dhis.system.util.PredicateUtils.idObjects;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.hibernate.SessionFactory;
@@ -56,7 +65,6 @@
import org.hisp.dhis.dxf2.importsummary.ImportConflict;
import org.hisp.dhis.dxf2.metadata.ImportTypeSummary;
import org.hisp.dhis.dxf2.metadata.Importer;
-import org.hisp.dhis.dxf2.metadata.MergeService;
import org.hisp.dhis.dxf2.metadata.ObjectBridge;
import org.hisp.dhis.dxf2.metadata.handlers.ObjectHandler;
import org.hisp.dhis.dxf2.metadata.handlers.ObjectHandlerUtils;
@@ -85,17 +93,9 @@
import org.hisp.dhis.validation.ValidationRule;
import org.springframework.beans.factory.annotation.Autowired;
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import static org.hisp.dhis.system.util.PredicateUtils.idObjectCollectionsWithScanned;
-import static org.hisp.dhis.system.util.PredicateUtils.idObjects;
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
+import com.google.common.collect.Sets;
/**
* Importer that can handle IdentifiableObject and NameableObject.
@@ -147,9 +147,6 @@
@Autowired( required = false )
private List<ObjectHandler<T>> objectHandlers;
- @Autowired
- private MergeService mergeService;
-
//-------------------------------------------------------------------------------------------------------
// Constructor
//-------------------------------------------------------------------------------------------------------