dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #28900
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 14516: Minor
------------------------------------------------------------
revno: 14516
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2014-03-28 11:13:01 +0100
message:
Minor
modified:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataapproval/DataApprovalLevelService.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataapproval/DataApprovalLevelStore.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataapproval/DataApprovalPermissions.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataapproval/DataApprovalState.java
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataapproval/DataApprovalSelection.java
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataapproval/DefaultDataApprovalService.java
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataapproval/hibernate/HibernateDataApprovalLevelStore.java
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataapproval/hibernate/HibernateDataApprovalStore.java
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataset/DefaultDataSetService.java
dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataapproval/DataApprovalLevelServiceTest.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/system/AddApprovalLevelAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/system/GetAddApprovalLevelFormParameters.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/system/GetApprovalSettingsAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/system/MoveApprovalLevelDownAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/system/MoveApprovalLevelUpAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/system/RemoveApprovalLevelAction.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/dataapproval/DataApprovalLevelService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataapproval/DataApprovalLevelService.java 2014-03-28 01:53:11 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataapproval/DataApprovalLevelService.java 2014-03-28 10:13:01 +0000
@@ -28,17 +28,10 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-import org.hisp.dhis.dataelement.CategoryOptionGroup;
-import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo;
-import org.hisp.dhis.dataset.DataSet;
-import org.hisp.dhis.organisationunit.OrganisationUnit;
-import org.hisp.dhis.period.Period;
-
import java.util.List;
/**
* @author Jim Grace
- * @version $Id$
*/
public interface DataApprovalLevelService
{
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataapproval/DataApprovalLevelStore.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataapproval/DataApprovalLevelStore.java 2014-02-21 19:55:16 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataapproval/DataApprovalLevelStore.java 2014-03-28 10:13:01 +0000
@@ -28,11 +28,6 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-import org.hisp.dhis.dataelement.CategoryOptionGroup;
-import org.hisp.dhis.dataset.DataSet;
-import org.hisp.dhis.organisationunit.OrganisationUnit;
-import org.hisp.dhis.period.Period;
-
import java.util.List;
/**
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataapproval/DataApprovalPermissions.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataapproval/DataApprovalPermissions.java 2014-03-28 01:53:11 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataapproval/DataApprovalPermissions.java 2014-03-28 10:13:01 +0000
@@ -34,9 +34,7 @@
* is permitted to perform on this data selection.
*
* @author Jim Grace
- * @version $Id$
*/
-
public class DataApprovalPermissions
{
private DataApprovalStatus dataApprovalStatus;
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataapproval/DataApprovalState.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataapproval/DataApprovalState.java 2014-03-28 01:53:11 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataapproval/DataApprovalState.java 2014-03-28 10:13:01 +0000
@@ -33,9 +33,7 @@
* organisation unit, and category options or category group options.
*
* @author Jim Grace
- * @version $Id$
*/
-
public enum DataApprovalState
{
/**
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataapproval/DataApprovalSelection.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataapproval/DataApprovalSelection.java 2014-03-28 02:42:50 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataapproval/DataApprovalSelection.java 2014-03-28 10:13:01 +0000
@@ -49,7 +49,6 @@
* between methods.
*
* @author Jim Grace
- * @version $Id$
*/
class DataApprovalSelection
{
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataapproval/DefaultDataApprovalService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataapproval/DefaultDataApprovalService.java 2014-03-28 01:53:11 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataapproval/DefaultDataApprovalService.java 2014-03-28 10:13:01 +0000
@@ -28,8 +28,13 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+import java.util.Set;
+
import org.apache.commons.collections.CollectionUtils;
-import org.hisp.dhis.dataelement.*;
+import org.hisp.dhis.dataelement.CategoryOptionGroup;
+import org.hisp.dhis.dataelement.DataElementCategoryOption;
+import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo;
+import org.hisp.dhis.dataelement.DataElementCategoryService;
import org.hisp.dhis.dataset.DataSet;
import org.hisp.dhis.organisationunit.OrganisationUnit;
import org.hisp.dhis.period.Period;
@@ -39,8 +44,6 @@
import org.hisp.dhis.user.User;
import org.springframework.transaction.annotation.Transactional;
-import java.util.*;
-
/**
* @author Jim Grace
*/
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataapproval/hibernate/HibernateDataApprovalLevelStore.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataapproval/hibernate/HibernateDataApprovalLevelStore.java 2014-03-12 14:59:01 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataapproval/hibernate/HibernateDataApprovalLevelStore.java 2014-03-28 10:13:01 +0000
@@ -28,40 +28,27 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+import java.util.List;
+
import org.hibernate.criterion.Order;
import org.hisp.dhis.dataapproval.DataApprovalLevel;
import org.hisp.dhis.dataapproval.DataApprovalLevelStore;
import org.hisp.dhis.hibernate.HibernateGenericStore;
-import org.hisp.dhis.period.PeriodService;
import org.springframework.transaction.annotation.Transactional;
-import java.util.List;
-
/**
* @author Jim Grace
- * @version $Id$
*/
@Transactional
public class HibernateDataApprovalLevelStore
extends HibernateGenericStore<DataApprovalLevel>
implements DataApprovalLevelStore
{
-
- // -------------------------------------------------------------------------
- // Dependencies
- // -------------------------------------------------------------------------
-
- private DataApprovalLevelStore dataApprovalLevelStore;
-
- public void setDataApprovalLevelStore( DataApprovalLevelStore dataApprovalLevelStore )
- {
- this.dataApprovalLevelStore = dataApprovalLevelStore;
- }
-
- // -------------------------------------------------------------------------
- // DataApprovalLevel
- // -------------------------------------------------------------------------
-
+ // -------------------------------------------------------------------------
+ // DataApprovalLevelStore implementation
+ // -------------------------------------------------------------------------
+
+ @SuppressWarnings("unchecked")
public List<DataApprovalLevel> getAllDataApprovalLevels()
{
return getCriteria().addOrder( Order.asc( "level" ) ).list();
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataapproval/hibernate/HibernateDataApprovalStore.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataapproval/hibernate/HibernateDataApprovalStore.java 2014-03-28 01:53:11 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataapproval/hibernate/HibernateDataApprovalStore.java 2014-03-28 10:13:01 +0000
@@ -35,7 +35,6 @@
import org.hisp.dhis.dataelement.CategoryOptionGroup;
import org.hisp.dhis.dataset.DataSet;
import org.hisp.dhis.hibernate.HibernateGenericStore;
-import org.hisp.dhis.hibernate.exception.CreateAccessDeniedException;
import org.hisp.dhis.organisationunit.OrganisationUnit;
import org.hisp.dhis.period.Period;
import org.hisp.dhis.period.PeriodService;
@@ -43,7 +42,6 @@
/**
* @author Jim Grace
- * @version $Id$
*/
public class HibernateDataApprovalStore
extends HibernateGenericStore<DataApproval>
@@ -68,9 +66,11 @@
{
dataApproval.setPeriod( periodService.reloadPeriod( dataApproval.getPeriod() ) );
+ // ---------------------------------------------------------------------
// In general null values do not violate a unique constraint,
// so we check by hand if categoryOptionGroup has a null value,
// that no identical record exists with a null value.
+ // ---------------------------------------------------------------------
if ( dataApproval.getCategoryOptionGroup() == null )
{
@@ -107,6 +107,7 @@
criteria.add( Restrictions.eq( "dataSet", dataSet ) );
criteria.add( Restrictions.eq( "period", storedPeriod ) );
criteria.add( Restrictions.eq( "organisationUnit", organisationUnit ) );
+
if ( categoryOptionGroup != null )
{
criteria.add( Restrictions.eq( "categoryOptionGroup", categoryOptionGroup ) );
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataset/DefaultDataSetService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataset/DefaultDataSetService.java 2014-03-25 11:32:33 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataset/DefaultDataSetService.java 2014-03-28 10:13:01 +0000
@@ -42,7 +42,6 @@
import java.util.Set;
import org.hisp.dhis.dataapproval.DataApprovalService;
-import org.hisp.dhis.dataapproval.DataApprovalState;
import org.hisp.dhis.dataapproval.DataApprovalStatus;
import org.hisp.dhis.dataelement.DataElement;
import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo;
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataapproval/DataApprovalLevelServiceTest.java'
--- dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataapproval/DataApprovalLevelServiceTest.java 2014-02-23 13:08:31 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataapproval/DataApprovalLevelServiceTest.java 2014-03-28 10:13:01 +0000
@@ -30,12 +30,11 @@
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-import java.util.*;
+import java.util.Date;
+import java.util.List;
import org.hisp.dhis.DhisSpringTest;
import org.hisp.dhis.dataelement.CategoryOptionGroupSet;
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/system/AddApprovalLevelAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/system/AddApprovalLevelAction.java 2014-02-23 13:42:18 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/system/AddApprovalLevelAction.java 2014-03-28 10:13:01 +0000
@@ -1,4 +1,5 @@
package org.hisp.dhis.settings.action.system;
+
/*
* Copyright (c) 2004-2013, University of Oslo
* All rights reserved.
@@ -27,7 +28,6 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-import com.opensymphony.xwork2.Action;
import org.hisp.dhis.dataapproval.DataApprovalLevel;
import org.hisp.dhis.dataapproval.DataApprovalLevelService;
import org.hisp.dhis.dataelement.CategoryOptionGroupSet;
@@ -36,15 +36,13 @@
import org.hisp.dhis.organisationunit.OrganisationUnitLevel;
import org.hisp.dhis.organisationunit.OrganisationUnitService;
-import java.util.Date;
-import java.util.List;
+import com.opensymphony.xwork2.Action;
/**
* @author Jim Grace
- * @version $Id$
*/
public class AddApprovalLevelAction
- implements Action
+ implements Action
{
// -------------------------------------------------------------------------
// Dependencies
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/system/GetAddApprovalLevelFormParameters.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/system/GetAddApprovalLevelFormParameters.java 2014-02-19 04:11:17 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/system/GetAddApprovalLevelFormParameters.java 2014-03-28 10:13:01 +0000
@@ -1,4 +1,5 @@
package org.hisp.dhis.settings.action.system;
+
/*
* Copyright (c) 2004-2013, University of Oslo
* All rights reserved.
@@ -38,10 +39,9 @@
/**
* @author Jim Grace
- * @version $Id$
*/
public class GetAddApprovalLevelFormParameters
- implements Action
+ implements Action
{
// -------------------------------------------------------------------------
// Dependencies
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/system/GetApprovalSettingsAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/system/GetApprovalSettingsAction.java 2014-02-19 04:11:17 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/system/GetApprovalSettingsAction.java 2014-03-28 10:13:01 +0000
@@ -35,10 +35,9 @@
/**
* @author Jim Grace
- * @version $Id$
*/
public class GetApprovalSettingsAction
- implements Action
+ implements Action
{
// -------------------------------------------------------------------------
// Dependencies
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/system/MoveApprovalLevelDownAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/system/MoveApprovalLevelDownAction.java 2014-02-23 13:08:31 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/system/MoveApprovalLevelDownAction.java 2014-03-28 10:13:01 +0000
@@ -1,4 +1,5 @@
package org.hisp.dhis.settings.action.system;
+
/*
* Copyright (c) 2004-2013, University of Oslo
* All rights reserved.
@@ -27,18 +28,16 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+import org.hisp.dhis.dataapproval.DataApprovalLevelService;
+
import com.opensymphony.xwork2.Action;
-import org.hisp.dhis.dataapproval.DataApprovalLevel;
-import org.hisp.dhis.dataapproval.DataApprovalLevelService;
-
-import java.util.List;
/**
* @author Jim Grace
* @version $Id$
*/
public class MoveApprovalLevelDownAction
- implements Action
+ implements Action
{
// -------------------------------------------------------------------------
// Dependencies
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/system/MoveApprovalLevelUpAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/system/MoveApprovalLevelUpAction.java 2014-02-23 13:08:31 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/system/MoveApprovalLevelUpAction.java 2014-03-28 10:13:01 +0000
@@ -1,4 +1,5 @@
package org.hisp.dhis.settings.action.system;
+
/*
* Copyright (c) 2004-2013, University of Oslo
* All rights reserved.
@@ -27,15 +28,12 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+import org.hisp.dhis.dataapproval.DataApprovalLevelService;
+
import com.opensymphony.xwork2.Action;
-import org.hisp.dhis.dataapproval.DataApprovalLevel;
-import org.hisp.dhis.dataapproval.DataApprovalLevelService;
-
-import java.util.List;
/**
* @author Jim Grace
- * @version $Id$
*/
public class MoveApprovalLevelUpAction
implements Action
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/system/RemoveApprovalLevelAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/system/RemoveApprovalLevelAction.java 2014-02-23 13:08:31 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/system/RemoveApprovalLevelAction.java 2014-03-28 10:13:01 +0000
@@ -1,4 +1,5 @@
package org.hisp.dhis.settings.action.system;
+
/*
* Copyright (c) 2004-2013, University of Oslo
* All rights reserved.
@@ -27,18 +28,16 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+import org.hisp.dhis.dataapproval.DataApprovalLevelService;
+
import com.opensymphony.xwork2.Action;
-import org.hisp.dhis.dataapproval.DataApprovalLevel;
-import org.hisp.dhis.dataapproval.DataApprovalLevelService;
-
-import java.util.List;
/**
* @author Jim Grace
* @version $Id$
*/
public class RemoveApprovalLevelAction
- implements Action
+ implements Action
{
// -------------------------------------------------------------------------
// Dependencies