← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 4782: Removed UserStyleManager, merged into StyleManager

 

------------------------------------------------------------
revno: 4782
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2011-09-30 14:21:59 +0200
message:
  Removed UserStyleManager, merged into StyleManager
removed:
  dhis-2/dhis-services/dhis-service-options/src/main/java/org/hisp/dhis/options/style/DefaultUserStyleManager.java
  dhis-2/dhis-services/dhis-service-options/src/main/java/org/hisp/dhis/options/style/UserStyleManager.java
  dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/interceptor/StyleInterceptor.java
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/UserSettingService.java
  dhis-2/dhis-services/dhis-service-options/src/main/java/org/hisp/dhis/options/setting/DefaultSystemSettingManager.java
  dhis-2/dhis-services/dhis-service-options/src/main/java/org/hisp/dhis/options/style/DefaultStyleManager.java
  dhis-2/dhis-services/dhis-service-options/src/main/java/org/hisp/dhis/options/style/StyleManager.java
  dhis-2/dhis-services/dhis-service-options/src/main/resources/META-INF/dhis/beans.xml
  dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/interceptor/UserSettingInterceptor.java
  dhis-2/dhis-web/dhis-web-commons/src/main/resources/META-INF/dhis/beans.xml
  dhis-2/dhis-web/dhis-web-commons/src/main/resources/dhis-web-commons.xml
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/system/GetSystemSettingsAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/system/SetSystemSettingsAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/user/GetAvailableUserSettingsAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/user/SetCurrentStyleAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/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/user/UserSettingService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/UserSettingService.java	2011-09-30 10:24:49 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/UserSettingService.java	2011-09-30 12:21:59 +0000
@@ -46,6 +46,9 @@
     final String AUTO_SAVE_DATA_ENTRY_FORM = "autoSaveDataEntryForm";
     final String KEY_CHARTS_IN_DASHBOARD = "keyChartsInDashboard";
     final String KEY_CURRENT_DATADICTIONARY = "currentDataDictionary";
+    final String KEY_STYLE = "stylesheet";
+    final String KEY_STYLE_DIRECTORY = "stylesheetDirectory";
+
 
     final int DEFAULT_CHARTS_IN_DASHBOARD = 4;
     final List<Integer> DASHBOARD_CHARTS_TO_DISPLAY = Arrays.asList( 4, 6, 8 );

=== modified file 'dhis-2/dhis-services/dhis-service-options/src/main/java/org/hisp/dhis/options/setting/DefaultSystemSettingManager.java'
--- dhis-2/dhis-services/dhis-service-options/src/main/java/org/hisp/dhis/options/setting/DefaultSystemSettingManager.java	2011-04-11 15:42:51 +0000
+++ dhis-2/dhis-services/dhis-service-options/src/main/java/org/hisp/dhis/options/setting/DefaultSystemSettingManager.java	2011-09-30 12:21:59 +0000
@@ -41,7 +41,6 @@
 /**
  * @author Stian Strandli
  * @author Lars Helge Overland
- * @version $Id: DefaultSystemSettingManager.java 4910 2008-04-15 17:55:02Z larshelg $
  */
 @Transactional
 public class DefaultSystemSettingManager
@@ -69,10 +68,6 @@
     // SystemSettingManager implementation
     // -------------------------------------------------------------------------
 
-    // -------------------------------------------------------------------------
-    // Generic methods
-    // -------------------------------------------------------------------------
-    
     public void saveSystemSetting( String name, Serializable value )
     {
         SystemSetting setting = systemSettingStore.getByName( name );

=== modified file 'dhis-2/dhis-services/dhis-service-options/src/main/java/org/hisp/dhis/options/style/DefaultStyleManager.java'
--- dhis-2/dhis-services/dhis-service-options/src/main/java/org/hisp/dhis/options/style/DefaultStyleManager.java	2010-09-04 08:21:14 +0000
+++ dhis-2/dhis-services/dhis-service-options/src/main/java/org/hisp/dhis/options/style/DefaultStyleManager.java	2011-09-30 12:21:59 +0000
@@ -31,6 +31,7 @@
 import java.util.SortedMap;
 
 import org.hisp.dhis.options.SystemSettingManager;
+import org.hisp.dhis.user.UserSettingService;
 
 /**
  * @author Lars Helge Overland
@@ -55,6 +56,13 @@
     {
         this.systemSettingManager = systemSettingManager;
     }
+    
+    private UserSettingService userSettingService;
+
+    public void setUserSettingService( UserSettingService userSettingService )
+    {
+        this.userSettingService = userSettingService;
+    }
 
     private String defaultStyle;
 
@@ -74,13 +82,30 @@
     // StyleManager implementation
     // -------------------------------------------------------------------------
 
-    public void setCurrentStyle( String file )
-    {
-         systemSettingManager.saveSystemSetting( SETTING_NAME_STYLE, file );
+    public void setSystemStyle( String style )
+    {
+         systemSettingManager.saveSystemSetting( SETTING_NAME_STYLE, style );
+    }
+    
+    public void setUserStyle( String style )
+    {
+        userSettingService.saveUserSetting( SETTING_NAME_STYLE, style );
     }
 
     public String getCurrentStyle()
     {
+        String style = (String) userSettingService.getUserSetting( SETTING_NAME_STYLE );
+        
+        if ( style != null )
+        {
+            return style;
+        }
+        
+        return getSystemStyle();
+    }
+    
+    public String getSystemStyle()
+    {
         return (String) systemSettingManager.getSystemSetting( SETTING_NAME_STYLE, styles.get( defaultStyle ) );
     }
 

=== removed file 'dhis-2/dhis-services/dhis-service-options/src/main/java/org/hisp/dhis/options/style/DefaultUserStyleManager.java'
--- dhis-2/dhis-services/dhis-service-options/src/main/java/org/hisp/dhis/options/style/DefaultUserStyleManager.java	2011-09-30 10:24:49 +0000
+++ dhis-2/dhis-services/dhis-service-options/src/main/java/org/hisp/dhis/options/style/DefaultUserStyleManager.java	1970-01-01 00:00:00 +0000
@@ -1,88 +0,0 @@
-
-/*
- * 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.
- */
-
-package org.hisp.dhis.options.style;
-
-import java.io.File;
-
-import org.hisp.dhis.user.UserSettingService;
-
-/**
- * @author Chau Thu Tran
- */
-public class DefaultUserStyleManager
-    implements UserStyleManager
-{
-    private static final String SETTING_NAME_STYLE = "currentStyle";
-
-    private static final String SEPARATOR = "/";
-
-    private static final String SYSTEM_SEPARATOR = File.separator;
-
-    // -------------------------------------------------------------------------
-    // Dependencies
-    // -------------------------------------------------------------------------
-
-    private UserSettingService userSettingService;
-
-    public void setUserSettingService( UserSettingService userSettingService )
-    {
-        this.userSettingService = userSettingService;
-    }
-
-    // -------------------------------------------------------------------------
-    // UserStyleManager implementation
-    // -------------------------------------------------------------------------
-
-    public void setCurrentStyle( String file )
-    {
-        userSettingService.saveUserSetting( SETTING_NAME_STYLE, file );
-    }
-
-    public String getCurrentStyle()
-    {
-        return (String) userSettingService.getUserSetting( SETTING_NAME_STYLE );
-    }
-
-    public String getCurrentStyleDirectory()
-    {
-        String currentStyle = getCurrentStyle();
-
-        if ( currentStyle.lastIndexOf( SEPARATOR ) != -1 )
-        {
-            return currentStyle.substring( 0, currentStyle.lastIndexOf( SEPARATOR ) );
-        }
-
-        if ( currentStyle.lastIndexOf( SYSTEM_SEPARATOR ) != -1 )
-        {
-            return currentStyle.substring( 0, currentStyle.lastIndexOf( SYSTEM_SEPARATOR ) );
-        }
-
-        return currentStyle;
-    }
-}

=== modified file 'dhis-2/dhis-services/dhis-service-options/src/main/java/org/hisp/dhis/options/style/StyleManager.java'
--- dhis-2/dhis-services/dhis-service-options/src/main/java/org/hisp/dhis/options/style/StyleManager.java	2010-04-12 21:23:33 +0000
+++ dhis-2/dhis-services/dhis-service-options/src/main/java/org/hisp/dhis/options/style/StyleManager.java	2011-09-30 12:21:59 +0000
@@ -37,10 +37,14 @@
 {
     String ID = StyleManager.class.getName();
     
-    void setCurrentStyle( String file );
+    void setSystemStyle( String file );
+    
+    void setUserStyle( String style );
     
     String getCurrentStyle();
     
+    String getSystemStyle();
+    
     String getCurrentStyleDirectory();
         
     SortedMap<String, String> getStyles();

=== removed file 'dhis-2/dhis-services/dhis-service-options/src/main/java/org/hisp/dhis/options/style/UserStyleManager.java'
--- dhis-2/dhis-services/dhis-service-options/src/main/java/org/hisp/dhis/options/style/UserStyleManager.java	2010-10-28 09:25:22 +0000
+++ dhis-2/dhis-services/dhis-service-options/src/main/java/org/hisp/dhis/options/style/UserStyleManager.java	1970-01-01 00:00:00 +0000
@@ -1,44 +0,0 @@
-package org.hisp.dhis.options.style;
-
-/*
- * 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 Chau Thu Tran
- * @version $Id UserStyleManager.java 
- */
-public interface UserStyleManager
-{
-    String ID = UserStyleManager.class.getName();
-    
-    void setCurrentStyle( String file );
-    
-    String getCurrentStyle();
-    
-    String getCurrentStyleDirectory();
-}

=== 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-09-30 10:24:49 +0000
+++ dhis-2/dhis-services/dhis-service-options/src/main/resources/META-INF/dhis/beans.xml	2011-09-30 12:21:59 +0000
@@ -280,6 +280,7 @@
 
   <bean id="org.hisp.dhis.options.style.StyleManager" class="org.hisp.dhis.options.style.DefaultStyleManager">
     <property name="systemSettingManager" ref="org.hisp.dhis.options.SystemSettingManager" />
+	<property name="userSettingService" ref="org.hisp.dhis.user.UserSettingService" />
     <property name="defaultStyle" value="light_blue" />
     <property name="styles">
       <map>
@@ -317,10 +318,6 @@
     </property>
   </bean>
 
-  <bean id="org.hisp.dhis.options.style.UserStyleManager" class="org.hisp.dhis.options.style.DefaultUserStyleManager">
-    <property name="userSettingService" ref="org.hisp.dhis.user.UserSettingService" />
-  </bean>
-
   <bean id="org.hisp.dhis.options.help.HelpManager" class="org.hisp.dhis.options.help.DefaultHelpManager" />
 
 </beans>

=== removed file 'dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/interceptor/StyleInterceptor.java'
--- dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/interceptor/StyleInterceptor.java	2011-05-05 21:15:45 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/interceptor/StyleInterceptor.java	1970-01-01 00:00:00 +0000
@@ -1,114 +0,0 @@
-package org.hisp.dhis.interceptor;
-
-/*
- * 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 java.util.HashMap;
-import java.util.Map;
-
-import org.hisp.dhis.options.style.StyleManager;
-import org.hisp.dhis.options.style.UserStyleManager;
-
-import com.opensymphony.xwork2.ActionInvocation;
-import com.opensymphony.xwork2.interceptor.Interceptor;
-
-/**
- * @author Lars Helge Overland
- * @version $Id$
- */
-public class StyleInterceptor
-    implements Interceptor
-{
-    /**
-     * Determines if a de-serialized file is compatible with this class.
-     */
-    private static final long serialVersionUID = -4046465567852737440L;
-
-    private static final String KEY_STYLE = "stylesheet";
-
-    private static final String KEY_STYLE_DIRECTORY = "stylesheetDirectory";
-
-    // -------------------------------------------------------------------------
-    // Dependencies
-    // -------------------------------------------------------------------------
-
-    private StyleManager systemStyleManager;
-
-    public void setSystemStyleManager( StyleManager systemStyleManager )
-    {
-        this.systemStyleManager = systemStyleManager;
-    }
-
-    private UserStyleManager userStyleManager;
-
-    public void setUserStyleManager( UserStyleManager userStyleManager )
-    {
-        this.userStyleManager = userStyleManager;
-    }
-
-    // -------------------------------------------------------------------------
-    // AroundInterceptor implementation
-    // -------------------------------------------------------------------------
-
-    public void destroy()
-    {
-        // TODO Auto-generated method stub
-
-    }
-
-    public void init()
-    {
-        // TODO Auto-generated method stub
-
-    }
-
-    public String intercept( ActionInvocation invocation )
-        throws Exception
-    {
-        Map<String, Object> map = new HashMap<String, Object>( 2 );
-
-        String style = userStyleManager.getCurrentStyle();
-        String styleDirectory = "";
-
-        if ( style == null )
-        {
-            style = systemStyleManager.getCurrentStyle();
-            styleDirectory = systemStyleManager.getCurrentStyleDirectory();
-        }
-        else
-        {
-            styleDirectory = userStyleManager.getCurrentStyleDirectory();
-        }
-
-        map.put( KEY_STYLE, style );
-        map.put( KEY_STYLE_DIRECTORY, styleDirectory );
-
-        invocation.getStack().push( map );
-
-        return invocation.invoke();
-    }
-}

=== modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/interceptor/UserSettingInterceptor.java'
--- dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/interceptor/UserSettingInterceptor.java	2011-09-30 09:50:17 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/interceptor/UserSettingInterceptor.java	2011-09-30 12:21:59 +0000
@@ -28,11 +28,12 @@
  */
 
 import static org.hisp.dhis.user.UserSettingService.DEFAULT_CHARTS_IN_DASHBOARD;
-import static org.hisp.dhis.user.UserSettingService.KEY_CHARTS_IN_DASHBOARD;
+import static org.hisp.dhis.user.UserSettingService.*;
 
 import java.util.HashMap;
 import java.util.Map;
 
+import org.hisp.dhis.options.style.StyleManager;
 import org.hisp.dhis.user.UserSettingService;
 
 import com.opensymphony.xwork2.ActionInvocation;
@@ -55,6 +56,13 @@
         this.userSettingService = userSettingService;
     }
 
+    private StyleManager styleManager;
+
+    public void setStyleManager( StyleManager styleManager )
+    {
+        this.styleManager = styleManager;
+    }
+
     // -------------------------------------------------------------------------
     // UserSettingInterceptor implementation
     // -------------------------------------------------------------------------
@@ -73,6 +81,8 @@
         Map<String, Object> map = new HashMap<String, Object>();
 
         map.put( KEY_CHARTS_IN_DASHBOARD, userSettingService.getUserSetting( KEY_CHARTS_IN_DASHBOARD, DEFAULT_CHARTS_IN_DASHBOARD ) );
+        map.put( KEY_STYLE, styleManager.getCurrentStyle() );
+        map.put( KEY_STYLE_DIRECTORY, styleManager.getCurrentStyleDirectory() );
 
         invocation.getStack().push( map );
 

=== modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-web/dhis-web-commons/src/main/resources/META-INF/dhis/beans.xml	2011-09-30 09:50:17 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/resources/META-INF/dhis/beans.xml	2011-09-30 12:21:59 +0000
@@ -587,11 +587,6 @@
     <property name="sortOrderManager" ref="org.hisp.dhis.options.sortorder.SortOrderManager" />
   </bean>
 
-  <bean id="org.hisp.dhis.interceptor.StyleInterceptor" class="org.hisp.dhis.interceptor.StyleInterceptor">
-    <property name="systemStyleManager" ref="org.hisp.dhis.options.style.StyleManager" />
-    <property name="userStyleManager" ref="org.hisp.dhis.options.style.UserStyleManager" />
-  </bean>
-
   <bean id="org.hisp.dhis.interceptor.SystemSettingInterceptor" class="org.hisp.dhis.interceptor.SystemSettingInterceptor">
     <property name="systemSettingManager" ref="org.hisp.dhis.options.SystemSettingManager" />
   </bean>
@@ -602,6 +597,7 @@
 
   <bean id="org.hisp.dhis.interceptor.UserSettingInterceptor" class="org.hisp.dhis.interceptor.UserSettingInterceptor">
     <property name="userSettingService" ref="org.hisp.dhis.user.UserSettingService" />
+    <property name="styleManager" ref="org.hisp.dhis.options.style.StyleManager" />
   </bean>
 
   <bean id="org.hisp.dhis.useraccount.action.GetCurrentUserAction" class="org.hisp.dhis.useraccount.action.GetCurrentUserAction"

=== modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/resources/dhis-web-commons.xml'
--- dhis-2/dhis-web/dhis-web-commons/src/main/resources/dhis-web-commons.xml	2011-09-30 03:49:43 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/resources/dhis-web-commons.xml	2011-09-30 12:21:59 +0000
@@ -40,7 +40,6 @@
       <interceptor name="displayPropertyInterceptor" class="org.hisp.dhis.interceptor.DisplayPropertyInterceptor" />
       <interceptor name="systemSettingInterceptor" class="org.hisp.dhis.interceptor.SystemSettingInterceptor" />
       <interceptor name="userSettingInterceptor" class="org.hisp.dhis.interceptor.UserSettingInterceptor" />
-      <interceptor name="styleInterceptor" class="org.hisp.dhis.interceptor.StyleInterceptor" />
       <interceptor name="contextInterceptor" class="org.hisp.dhis.interceptor.ContextInterceptor" />
 
       <interceptor name="portalParamsInterceptor" class="org.hisp.dhis.webportal.interceptor.XWorkPortalParamsInterceptor" />
@@ -63,7 +62,6 @@
         <interceptor-ref name="displayPropertyInterceptor" />
         <interceptor-ref name="systemSettingInterceptor" />
         <interceptor-ref name="userSettingInterceptor" />
-        <interceptor-ref name="styleInterceptor" />
         <interceptor-ref name="contextInterceptor" />
         <interceptor-ref name="portalParamsInterceptor" />
         <interceptor-ref name="portalMenuInterceptor" />

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/system/GetSystemSettingsAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/system/GetSystemSettingsAction.java	2011-08-18 17:28:45 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/system/GetSystemSettingsAction.java	2011-09-30 12:21:59 +0000
@@ -203,7 +203,7 @@
 
         styles = styleManager.getStyles();
 
-        currentStyle = styleManager.getCurrentStyle();
+        currentStyle = styleManager.getSystemStyle();
 
         aggregationStrategies = systemSettingManager.getAggregationStrategies();
 

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/system/SetSystemSettingsAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/system/SetSystemSettingsAction.java	2011-08-02 10:55:30 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/system/SetSystemSettingsAction.java	2011-09-30 12:21:59 +0000
@@ -219,12 +219,10 @@
         systemSettingManager.saveSystemSetting( KEY_APPLICATION_TITLE, applicationTitle );
         systemSettingManager.saveSystemSetting( KEY_FLAG, flag );
         systemSettingManager.saveSystemSetting( KEY_START_MODULE, startModule );
-        systemSettingManager.saveSystemSetting( KEY_OMIT_INDICATORS_ZERO_NUMERATOR_DATAMART,
-            omitIndicatorsZeroNumeratorDataMart );
-        systemSettingManager
-            .saveSystemSetting( KEY_DISABLE_DATAENTRYFORM_WHEN_COMPLETED, disableDataEntryWhenCompleted );
+        systemSettingManager.saveSystemSetting( KEY_OMIT_INDICATORS_ZERO_NUMERATOR_DATAMART, omitIndicatorsZeroNumeratorDataMart );
+        systemSettingManager.saveSystemSetting( KEY_DISABLE_DATAENTRYFORM_WHEN_COMPLETED, disableDataEntryWhenCompleted );
         systemSettingManager.saveSystemSetting( KEY_FACTOR_OF_DEVIATION, factorDeviation );
-        styleManager.setCurrentStyle( currentStyle );
+        styleManager.setSystemStyle( currentStyle );
         systemSettingManager.saveSystemSetting( KEY_AGGREGATION_STRATEGY, aggregationStrategy );
         systemSettingManager.saveSystemSetting( KEY_COMPLETENESS_OFFSET, completenessOffset );
 

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/user/GetAvailableUserSettingsAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/user/GetAvailableUserSettingsAction.java	2011-09-30 10:24:49 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/user/GetAvailableUserSettingsAction.java	2011-09-30 12:21:59 +0000
@@ -27,6 +27,9 @@
 
 package org.hisp.dhis.settings.action.user;
 
+import static org.hisp.dhis.user.UserSettingService.DEFAULT_CHARTS_IN_DASHBOARD;
+import static org.hisp.dhis.user.UserSettingService.KEY_CHARTS_IN_DASHBOARD;
+
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Comparator;
@@ -40,13 +43,10 @@
 import org.hisp.dhis.options.displayproperty.DisplayPropertyManager;
 import org.hisp.dhis.options.sortorder.SortOrderManager;
 import org.hisp.dhis.options.style.StyleManager;
-import org.hisp.dhis.options.style.UserStyleManager;
 import org.hisp.dhis.user.UserSettingService;
 
 import com.opensymphony.xwork2.Action;
 
-import static org.hisp.dhis.user.UserSettingService.*;
-
 /**
  * @author Chau Thu Tran
  * @version $ GetAvailableUserSettingsAction.java May 31, 2011 9:31:54 AM $
@@ -100,14 +100,7 @@
     {
         this.styleManager = styleManager;
     }
-
-    private UserStyleManager userStyleManager;
-
-    public void setUserStyleManager( UserStyleManager userStyleManager )
-    {
-        this.userStyleManager = userStyleManager;
-    }
-
+    
     private DisplayPropertyManager displayPropertyManager;
 
     public void setDisplayPropertyManager( DisplayPropertyManager displayPropertyManager )
@@ -290,7 +283,7 @@
 
         styles = styleManager.getStyles();
 
-        currentStyle = userStyleManager.getCurrentStyle();
+        currentStyle = styleManager.getCurrentStyle();
 
         return SUCCESS;
     }

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/user/SetCurrentStyleAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/user/SetCurrentStyleAction.java	2011-05-05 21:15:45 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/user/SetCurrentStyleAction.java	2011-09-30 12:21:59 +0000
@@ -27,7 +27,7 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import org.hisp.dhis.options.style.UserStyleManager;
+import org.hisp.dhis.options.style.StyleManager;
 
 import com.opensymphony.xwork2.Action;
 
@@ -42,13 +42,13 @@
     // Dependencies
     // -------------------------------------------------------------------------
 
-    private UserStyleManager userStyleManager;
+    private StyleManager styleManager;
 
-    public void setUserStyleManager( UserStyleManager userStyleManager )
+    public void setStyleManager( StyleManager styleManager )
     {
-        this.userStyleManager = userStyleManager;
+        this.styleManager = styleManager;
     }
-
+    
     // -------------------------------------------------------------------------
     // Dependencies
     // -------------------------------------------------------------------------
@@ -66,7 +66,7 @@
 
     public String execute()
     {
-        userStyleManager.setCurrentStyle( currentStyle );
+        styleManager.setUserStyle( currentStyle );
 
         return SUCCESS;
     }

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/resources/META-INF/dhis/beans.xml	2011-09-30 10:24:49 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/resources/META-INF/dhis/beans.xml	2011-09-30 12:21:59 +0000
@@ -51,9 +51,6 @@
     <property name="styleManager">
       <ref bean="org.hisp.dhis.options.style.StyleManager" />
     </property>
-    <property name="userStyleManager">
-      <ref bean="org.hisp.dhis.options.style.UserStyleManager" />
-    </property>
   </bean>
 
   <bean id="org.hisp.dhis.settings.action.user.SetCurrentLocaleAction" class="org.hisp.dhis.settings.action.user.SetCurrentLocaleAction"
@@ -100,8 +97,8 @@
 
   <bean id="org.hisp.dhis.settings.action.user.SetCurrentStyleAction" class="org.hisp.dhis.settings.action.user.SetCurrentStyleAction"
     scope="prototype">
-    <property name="userStyleManager">
-      <ref bean="org.hisp.dhis.options.style.UserStyleManager" />
+    <property name="styleManager">
+      <ref bean="org.hisp.dhis.options.style.StyleManager" />
     </property>
   </bean>