dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #25266
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 12485: Removed hard-coded organisation unit group sets
------------------------------------------------------------
revno: 12485
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2013-10-07 20:30:46 +0200
message:
Removed hard-coded organisation unit group sets
removed:
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnitGroupSetPopulator.java
modified:
dhis-2/dhis-services/dhis-service-core/src/main/resources/META-INF/dhis/beans.xml
dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/hibernate/HibernatePatientStore.java
dhis-2/dhis-web/dhis-web-api-mobile/src/main/java/org/hisp/dhis/api/mobile/controller/MobileOrganisationUnitController.java
dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/login.css
dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/GetOrganisationUnitInfoFacilityAction.java
dhis-2/dhis-web/dhis-web-mapping/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-services/dhis-service-core/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnitGroupSetPopulator.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnitGroupSetPopulator.java 2013-08-23 16:05:01 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnitGroupSetPopulator.java 1970-01-01 00:00:00 +0000
@@ -1,90 +0,0 @@
-package org.hisp.dhis.organisationunit;
-
-/*
- * 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 org.hisp.dhis.system.startup.AbstractStartupRoutine;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * @author Lars Helge Overland
- * @version $Id$
- */
-public class OrganisationUnitGroupSetPopulator
- extends AbstractStartupRoutine
-{
- public static final String NAME_TYPE = "Type";
- public static final String NAME_OWNERSHIP = "Ownership";
-
- // -------------------------------------------------------------------------
- // Dependencies
- // -------------------------------------------------------------------------
-
- private OrganisationUnitGroupService organisationUnitGroupService;
-
- public void setOrganisationUnitGroupService( OrganisationUnitGroupService organisationUnitGroupService )
- {
- this.organisationUnitGroupService = organisationUnitGroupService;
- }
-
- // -------------------------------------------------------------------------
- // AbstractStartupRoutine implementation
- // -------------------------------------------------------------------------
-
- public void execute()
- throws Exception
- {
- List<OrganisationUnitGroupSet> types = new ArrayList<OrganisationUnitGroupSet>( organisationUnitGroupService.getOrganisationUnitGroupSetByName( NAME_TYPE ) );
- OrganisationUnitGroupSet type = types.isEmpty() ? null : types.get( 0 );
-
- if ( type == null )
- {
- type = new OrganisationUnitGroupSet();
- type.setName( "Type" );
- type.setDescription( "Type of organisation unit, examples are PHU, chiefdom and district" );
- type.setCompulsory( false );
-
- organisationUnitGroupService.addOrganisationUnitGroupSet( type );
- }
-
- List<OrganisationUnitGroupSet> ownerships = new ArrayList<OrganisationUnitGroupSet>( organisationUnitGroupService.getOrganisationUnitGroupSetByName( NAME_OWNERSHIP ) );
- OrganisationUnitGroupSet ownership = ownerships.isEmpty() ? null : ownerships.get( 0 );
-
- if ( ownership == null )
- {
- ownership = new OrganisationUnitGroupSet();
- ownership.setName( "Ownership" );
- ownership.setDescription( "Ownership of organisation unit, examples are private and public" );
- ownership.setCompulsory( false );
-
- organisationUnitGroupService.addOrganisationUnitGroupSet( ownership );
- }
- }
-}
=== 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 2013-10-06 10:34:59 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/resources/META-INF/dhis/beans.xml 2013-10-07 18:30:46 +0000
@@ -844,13 +844,6 @@
<property name="runlevel" value="3" />
</bean>
- <bean id="org.hisp.dhis.organisationunit.OrganisationUnitGroupSetPopulator"
- class="org.hisp.dhis.organisationunit.OrganisationUnitGroupSetPopulator">
- <property name="organisationUnitGroupService" ref="org.hisp.dhis.organisationunit.OrganisationUnitGroupService" />
- <property name="runlevel" value="5" />
- <property name="skipInTests" value="true" />
- </bean>
-
<bean id="org.hisp.dhis.dataentryform.DataEntryFormUpgrader" class="org.hisp.dhis.dataentryform.DataEntryFormUpgrader">
<property name="dataEntryFormService" ref="org.hisp.dhis.dataentryform.DataEntryFormService" />
<property name="runlevel" value="5" />
@@ -890,7 +883,6 @@
<ref local="org.hisp.dhis.period.PeriodTypePopulator" />
<ref local="org.hisp.dhis.startup.TableCreator" />
<ref local="org.hisp.dhis.dataelement.DataElementDefaultDimensionPopulator" />
- <ref local="org.hisp.dhis.organisationunit.OrganisationUnitGroupSetPopulator" />
<ref local="org.hisp.dhis.dataentryform.DataEntryFormUpgrader" />
<ref local="org.hisp.dhis.startup.ExpressionUpgrader" />
<ref local="org.hisp.dhis.startup.ConfigurationPopulator" />
=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/hibernate/HibernatePatientStore.java'
--- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/hibernate/HibernatePatientStore.java 2013-10-07 13:16:23 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/hibernate/HibernatePatientStore.java 2013-10-07 18:30:46 +0000
@@ -56,7 +56,6 @@
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
-import java.util.Arrays;
import java.util.Collection;
import java.util.Date;
import java.util.HashSet;
=== modified file 'dhis-2/dhis-web/dhis-web-api-mobile/src/main/java/org/hisp/dhis/api/mobile/controller/MobileOrganisationUnitController.java'
--- dhis-2/dhis-web/dhis-web-api-mobile/src/main/java/org/hisp/dhis/api/mobile/controller/MobileOrganisationUnitController.java 2013-10-07 02:49:58 +0000
+++ dhis-2/dhis-web/dhis-web-api-mobile/src/main/java/org/hisp/dhis/api/mobile/controller/MobileOrganisationUnitController.java 2013-10-07 18:30:46 +0000
@@ -405,7 +405,6 @@
@RequestMapping( method = RequestMethod.GET, value = "{clientVersion}/LWUIT/orgUnits/{id}/findLostToFollowUpDetail" )
@ResponseBody
public Patient findLostToFollowUpDetail( @PathVariable int id, @RequestHeader( "programStageInstanceId" ) String programStageInstanceId )
- throws NotAllowedException
{
return null;
}
=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/login.css'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/login.css 2013-10-07 15:45:20 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/login.css 2013-10-07 18:30:46 +0000
@@ -61,7 +61,7 @@
#bannerArea
{
- margin-bottom: 15px;
+ margin-bottom: 20px;
border: none;
text-align: center;
}
=== modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/GetOrganisationUnitInfoFacilityAction.java'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/GetOrganisationUnitInfoFacilityAction.java 2013-08-23 16:05:01 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/GetOrganisationUnitInfoFacilityAction.java 2013-10-07 18:30:46 +0000
@@ -29,9 +29,6 @@
*/
import org.hisp.dhis.organisationunit.OrganisationUnit;
-import org.hisp.dhis.organisationunit.OrganisationUnitGroupService;
-import org.hisp.dhis.organisationunit.OrganisationUnitGroupSet;
-import org.hisp.dhis.organisationunit.OrganisationUnitGroupSetPopulator;
import org.hisp.dhis.organisationunit.OrganisationUnitService;
import com.opensymphony.xwork2.Action;
@@ -54,13 +51,6 @@
this.organisationUnitService = organisationUnitService;
}
- private OrganisationUnitGroupService organisationUnitGroupService;
-
- public void setOrganisationUnitGroupService( OrganisationUnitGroupService organisationUnitGroupService )
- {
- this.organisationUnitGroupService = organisationUnitGroupService;
- }
-
// -------------------------------------------------------------------------
// Input
// -------------------------------------------------------------------------
@@ -92,10 +82,7 @@
{
object = organisationUnitService.getOrganisationUnit( id );
- OrganisationUnitGroupSet typeGroupSet = organisationUnitGroupService
- .getOrganisationUnitGroupSetByName( OrganisationUnitGroupSetPopulator.NAME_TYPE ).get( 0 );
-
- object.setType( object.getGroupNameInGroupSet( typeGroupSet ) );
+ object.setType( "" ); // TODO use web api and remove this class
return SUCCESS;
}
=== modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/resources/META-INF/dhis/beans.xml 2013-09-20 13:43:24 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/resources/META-INF/dhis/beans.xml 2013-10-07 18:30:46 +0000
@@ -40,8 +40,6 @@
scope="prototype">
<property name="organisationUnitService"
ref="org.hisp.dhis.organisationunit.OrganisationUnitService" />
- <property name="organisationUnitGroupService"
- ref="org.hisp.dhis.organisationunit.OrganisationUnitGroupService" />
</bean>
<bean id="org.hisp.dhis.mapping.action.GetOrganisationUnitGroupsByGroupSetAction"