dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #14252
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 4775: Removed silly class DataDictionaryModeManager
------------------------------------------------------------
revno: 4775
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2011-09-30 10:52:43 +0200
message:
Removed silly class DataDictionaryModeManager
removed:
dhis-2/dhis-services/dhis-service-options/src/main/java/org/hisp/dhis/options/datadictionary/
dhis-2/dhis-services/dhis-service-options/src/main/java/org/hisp/dhis/options/datadictionary/DataDictionaryModeManager.java
dhis-2/dhis-services/dhis-service-options/src/main/java/org/hisp/dhis/options/datadictionary/DefaultDataDictionaryModeManager.java
modified:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/options/UserSettingManager.java
dhis-2/dhis-services/dhis-service-options/src/main/resources/META-INF/dhis/beans.xml
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/datadictionary/SetCurrentDataDictionaryAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/GetDataElementListAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicator/GetIndicatorListAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/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
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/options/UserSettingManager.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/options/UserSettingManager.java 2011-05-26 11:45:58 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/options/UserSettingManager.java 2011-09-30 08:52:43 +0000
@@ -39,6 +39,7 @@
final String ID = UserSettingManager.class.getName();
final String KEY_CHARTS_IN_DASHBOARD = "keyChartsInDashboard";
+ final String KEY_CURRENT_DATADICTIONARY = "currentDataDictionary";
final int DEFAULT_CHARTS_IN_DASHBOARD = 4;
=== removed directory 'dhis-2/dhis-services/dhis-service-options/src/main/java/org/hisp/dhis/options/datadictionary'
=== removed file 'dhis-2/dhis-services/dhis-service-options/src/main/java/org/hisp/dhis/options/datadictionary/DataDictionaryModeManager.java'
--- dhis-2/dhis-services/dhis-service-options/src/main/java/org/hisp/dhis/options/datadictionary/DataDictionaryModeManager.java 2011-01-17 17:03:05 +0000
+++ dhis-2/dhis-services/dhis-service-options/src/main/java/org/hisp/dhis/options/datadictionary/DataDictionaryModeManager.java 1970-01-01 00:00:00 +0000
@@ -1,40 +0,0 @@
-package org.hisp.dhis.options.datadictionary;
-
-/*
- * Copyright (c) 2004-2010, 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.
- */
-
-
-/**
- * @author Lars Helge Overland
- * @version $Id$
- */
-public interface DataDictionaryModeManager
-{
- void setCurrentDataDictionary( Integer id );
-
- Integer getCurrentDataDictionary();
-}
=== removed file 'dhis-2/dhis-services/dhis-service-options/src/main/java/org/hisp/dhis/options/datadictionary/DefaultDataDictionaryModeManager.java'
--- dhis-2/dhis-services/dhis-service-options/src/main/java/org/hisp/dhis/options/datadictionary/DefaultDataDictionaryModeManager.java 2011-01-17 17:03:05 +0000
+++ dhis-2/dhis-services/dhis-service-options/src/main/java/org/hisp/dhis/options/datadictionary/DefaultDataDictionaryModeManager.java 1970-01-01 00:00:00 +0000
@@ -1,72 +0,0 @@
-package org.hisp.dhis.options.datadictionary;
-
-/*
- * Copyright (c) 2004-2010, 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.user.NoCurrentUserException;
-import org.hisp.dhis.user.UserSettingService;
-
-/**
- * @author Lars Helge Overland
- * @version $Id$
- */
-public class DefaultDataDictionaryModeManager
- implements DataDictionaryModeManager
-{
- private static final String SETTING_NAME_DATADICTIONARY = "currentDataDictionary";
-
- // -------------------------------------------------------------------------
- // Dependencies
- // -------------------------------------------------------------------------
-
- private UserSettingService userSettingService;
-
- public void setUserSettingService( UserSettingService userSettingService )
- {
- this.userSettingService = userSettingService;
- }
-
- // -------------------------------------------------------------------------
- // DataDictionaryModeManager implementation
- // -------------------------------------------------------------------------
-
- public void setCurrentDataDictionary( Integer id )
- {
- try
- {
- userSettingService.saveUserSetting( SETTING_NAME_DATADICTIONARY, id );
- }
- catch ( NoCurrentUserException e )
- {
- }
- }
-
- public Integer getCurrentDataDictionary()
- {
- return (Integer) userSettingService.getUserSetting( SETTING_NAME_DATADICTIONARY, null );
- }
-}
=== modified file 'dhis-2/dhis-services/dhis-service-options/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-services/dhis-service-options/src/main/resources/META-INF/dhis/beans.xml 2011-08-18 19:36:40 +0000
+++ dhis-2/dhis-services/dhis-service-options/src/main/resources/META-INF/dhis/beans.xml 2011-09-30 08:52:43 +0000
@@ -12,10 +12,6 @@
<property name="userSettingService" ref="org.hisp.dhis.user.UserSettingService" />
</bean>
- <bean id="org.hisp.dhis.options.datadictionary.DataDictionaryModeManager" class="org.hisp.dhis.options.datadictionary.DefaultDataDictionaryModeManager">
- <property name="userSettingService" ref="org.hisp.dhis.user.UserSettingService" />
- </bean>
-
<bean id="org.hisp.dhis.options.SystemSettingStore" class="org.hisp.dhis.hibernate.HibernateGenericStore">
<property name="clazz" value="org.hisp.dhis.options.SystemSetting" />
<property name="sessionFactory" ref="sessionFactory" />
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/datadictionary/SetCurrentDataDictionaryAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/datadictionary/SetCurrentDataDictionaryAction.java 2010-04-12 21:23:33 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/datadictionary/SetCurrentDataDictionaryAction.java 2011-09-30 08:52:43 +0000
@@ -27,12 +27,12 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-import org.hisp.dhis.options.datadictionary.DataDictionaryModeManager;
+import org.hisp.dhis.options.UserSettingManager;
import com.opensymphony.xwork2.Action;
/**
- * @author Lars Helge Overland
+ * @author Lars Helge Overland
* @version $Id$
*/
public class SetCurrentDataDictionaryAction
@@ -42,13 +42,13 @@
// Dependencies
// -------------------------------------------------------------------------
- private DataDictionaryModeManager dataDictionaryModeManager;
+ private UserSettingManager userSettingManager;
- public void setDataDictionaryModeManager( DataDictionaryModeManager dataDictionaryModeManager )
+ public void setUserSettingManager( UserSettingManager userSettingManager )
{
- this.dataDictionaryModeManager = dataDictionaryModeManager;
+ this.userSettingManager = userSettingManager;
}
-
+
// -------------------------------------------------------------------------
// Input
// -------------------------------------------------------------------------
@@ -66,7 +66,7 @@
public String execute()
{
- dataDictionaryModeManager.setCurrentDataDictionary( id );
+ userSettingManager.saveUserSetting( UserSettingManager.KEY_CURRENT_DATADICTIONARY, id );
return SUCCESS;
}
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/GetDataElementListAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/GetDataElementListAction.java 2011-09-23 18:54:49 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/GetDataElementListAction.java 2011-09-30 08:52:43 +0000
@@ -28,6 +28,7 @@
*/
import static org.apache.commons.lang.StringUtils.isNotBlank;
+import static org.hisp.dhis.options.UserSettingManager.KEY_CURRENT_DATADICTIONARY;
import java.util.ArrayList;
import java.util.Collections;
@@ -39,14 +40,12 @@
import org.hisp.dhis.datadictionary.comparator.DataDictionaryNameComparator;
import org.hisp.dhis.dataelement.DataElement;
import org.hisp.dhis.dataelement.DataElementService;
-import org.hisp.dhis.options.datadictionary.DataDictionaryModeManager;
+import org.hisp.dhis.options.UserSettingManager;
import org.hisp.dhis.options.displayproperty.DisplayPropertyHandler;
import org.hisp.dhis.paging.ActionPagingSupport;
/**
* @author Torgeir Lorange Ostby
- * @version $Id: GetDataElementListAction.java 5573 2008-08-22 03:39:55Z
- * ch_bharath1 $
*/
public class GetDataElementListAction
extends ActionPagingSupport<DataElement>
@@ -62,11 +61,11 @@
this.dataElementService = dataElementService;
}
- private DataDictionaryModeManager dataDictionaryModeManager;
+ private UserSettingManager userSettingManager;
- public void setDataDictionaryModeManager( DataDictionaryModeManager dataDictionaryModeManager )
+ public void setUserSettingManager( UserSettingManager userSettingManager )
{
- this.dataDictionaryModeManager = dataDictionaryModeManager;
+ this.userSettingManager = userSettingManager;
}
private DataDictionaryService dataDictionaryService;
@@ -152,17 +151,17 @@
{
if ( dataDictionaryId == null ) // None, get current data dictionary
{
- dataDictionaryId = dataDictionaryModeManager.getCurrentDataDictionary();
+ dataDictionaryId = (Integer) userSettingManager.getUserSetting( KEY_CURRENT_DATADICTIONARY );
}
else if ( dataDictionaryId == -1 ) // All, reset current data dictionary
{
- dataDictionaryModeManager.setCurrentDataDictionary( null );
+ userSettingManager.saveUserSetting( KEY_CURRENT_DATADICTIONARY, null );
dataDictionaryId = null;
}
else // Specified, set current data dictionary
{
- dataDictionaryModeManager.setCurrentDataDictionary( dataDictionaryId );
+ userSettingManager.saveUserSetting( KEY_CURRENT_DATADICTIONARY, dataDictionaryId );
}
dataDictionaries = new ArrayList<DataDictionary>( dataDictionaryService.getAllDataDictionaries() );
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicator/GetIndicatorListAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicator/GetIndicatorListAction.java 2011-09-23 18:54:49 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicator/GetIndicatorListAction.java 2011-09-30 08:52:43 +0000
@@ -28,6 +28,7 @@
*/
import static org.apache.commons.lang.StringUtils.isNotBlank;
+import static org.hisp.dhis.options.UserSettingManager.KEY_CURRENT_DATADICTIONARY;
import java.util.ArrayList;
import java.util.Collections;
@@ -39,7 +40,7 @@
import org.hisp.dhis.datadictionary.comparator.DataDictionaryNameComparator;
import org.hisp.dhis.indicator.Indicator;
import org.hisp.dhis.indicator.IndicatorService;
-import org.hisp.dhis.options.datadictionary.DataDictionaryModeManager;
+import org.hisp.dhis.options.UserSettingManager;
import org.hisp.dhis.options.displayproperty.DisplayPropertyHandler;
import org.hisp.dhis.paging.ActionPagingSupport;
@@ -62,11 +63,11 @@
this.indicatorService = indicatorService;
}
- private DataDictionaryModeManager dataDictionaryModeManager;
+ private UserSettingManager userSettingManager;
- public void setDataDictionaryModeManager( DataDictionaryModeManager dataDictionaryModeManager )
+ public void setUserSettingManager( UserSettingManager userSettingManager )
{
- this.dataDictionaryModeManager = dataDictionaryModeManager;
+ this.userSettingManager = userSettingManager;
}
private DataDictionaryService dataDictionaryService;
@@ -152,17 +153,17 @@
{
if ( dataDictionaryId == null ) // None, get current data dictionary
{
- dataDictionaryId = dataDictionaryModeManager.getCurrentDataDictionary();
+ dataDictionaryId = (Integer) userSettingManager.getUserSetting( KEY_CURRENT_DATADICTIONARY );
}
else if ( dataDictionaryId == -1 ) // All, reset current data dictionary
{
- dataDictionaryModeManager.setCurrentDataDictionary( null );
+ userSettingManager.saveUserSetting( KEY_CURRENT_DATADICTIONARY, null );
dataDictionaryId = null;
}
else // Specified, set current data dictionary
{
- dataDictionaryModeManager.setCurrentDataDictionary( dataDictionaryId );
+ userSettingManager.saveUserSetting( KEY_CURRENT_DATADICTIONARY, dataDictionaryId );
}
dataDictionaries = new ArrayList<DataDictionary>( dataDictionaryService.getAllDataDictionaries() );
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/resources/META-INF/dhis/beans.xml 2011-09-27 18:03:19 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/resources/META-INF/dhis/beans.xml 2011-09-30 08:52:43 +0000
@@ -10,8 +10,8 @@
<property name="dataElementService">
<ref bean="org.hisp.dhis.dataelement.DataElementService" />
</property>
- <property name="dataDictionaryModeManager">
- <ref bean="org.hisp.dhis.options.datadictionary.DataDictionaryModeManager" />
+ <property name="userSettingManager">
+ <ref bean="org.hisp.dhis.options.UserSettingManager" />
</property>
<property name="dataDictionaryService">
<ref bean="org.hisp.dhis.datadictionary.DataDictionaryService" />
@@ -420,8 +420,8 @@
<property name="indicatorService">
<ref bean="org.hisp.dhis.indicator.IndicatorService" />
</property>
- <property name="dataDictionaryModeManager">
- <ref bean="org.hisp.dhis.options.datadictionary.DataDictionaryModeManager" />
+ <property name="userSettingManager">
+ <ref bean="org.hisp.dhis.options.UserSettingManager" />
</property>
<property name="dataDictionaryService">
<ref bean="org.hisp.dhis.datadictionary.DataDictionaryService" />
@@ -542,8 +542,8 @@
<bean id="org.hisp.dhis.dd.action.datadictionary.SetCurrentDataDictionaryAction" class="org.hisp.dhis.dd.action.datadictionary.SetCurrentDataDictionaryAction"
scope="prototype">
- <property name="dataDictionaryModeManager">
- <ref bean="org.hisp.dhis.options.datadictionary.DataDictionaryModeManager" />
+ <property name="userSettingManager">
+ <ref bean="org.hisp.dhis.options.UserSettingManager" />
</property>
</bean>