← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 16929: display apps on list of start page options, no effect on actual start page yet

 

------------------------------------------------------------
revno: 16929
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2014-10-02 16:50:33 +0700
message:
  display apps on list of start page options, no effect on actual start page yet
modified:
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/system/GetAppearanceSettingsAction.java
  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/webapp/dhis-web-maintenance-settings/systemAppearanceSettings.vm


--
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-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/system/GetAppearanceSettingsAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/system/GetAppearanceSettingsAction.java	2014-06-26 14:38:54 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/system/GetAppearanceSettingsAction.java	2014-10-02 09:50:33 +0000
@@ -28,20 +28,23 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import java.util.List;
-import java.util.Locale;
-import java.util.SortedMap;
-
+import com.opensymphony.xwork2.Action;
+import org.hisp.dhis.appmanager.App;
+import org.hisp.dhis.appmanager.AppManager;
 import org.hisp.dhis.i18n.locale.LocaleManager;
+import org.hisp.dhis.setting.StyleManager;
 import org.hisp.dhis.setting.SystemSettingManager;
-import org.hisp.dhis.setting.StyleManager;
 import org.hisp.dhis.system.util.Filter;
 import org.hisp.dhis.system.util.FilterUtils;
 import org.hisp.dhis.webportal.module.Module;
 import org.hisp.dhis.webportal.module.ModuleManager;
 import org.hisp.dhis.webportal.module.StartableModuleFilter;
+import org.springframework.beans.factory.annotation.Autowired;
 
-import com.opensymphony.xwork2.Action;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Locale;
+import java.util.SortedMap;
 
 /**
  * @author Lars Helge Overland
@@ -55,52 +58,46 @@
     // Dependencies
     // -------------------------------------------------------------------------
 
+    @Autowired
     private SystemSettingManager systemSettingManager;
 
-    public void setSystemSettingManager( SystemSettingManager systemSettingManager )
-    {
-        this.systemSettingManager = systemSettingManager;
-    }
-
+    @Autowired
     private ModuleManager moduleManager;
 
-    public void setModuleManager( ModuleManager moduleManager )
-    {
-        this.moduleManager = moduleManager;
-    }
-
+    @Autowired
     private StyleManager styleManager;
 
-    public void setStyleManager( StyleManager styleManager )
-    {
-        this.styleManager = styleManager;
-    }
-
+    @Autowired
     private LocaleManager localeManager;
 
-    public void setLocaleManager( LocaleManager localeManager )
-    {
-        this.localeManager = localeManager;
-    }
-    
+    @Autowired
+    private AppManager appManager;
+
     // -------------------------------------------------------------------------
     // Output
     // -------------------------------------------------------------------------
 
-    private List<String> flags;
+    private List<String> flags = new ArrayList<>();
 
     public List<String> getFlags()
     {
         return flags;
     }
 
-    private List<Module> modules;
+    private List<Module> modules = new ArrayList<>();
 
     public List<Module> getModules()
     {
         return modules;
     }
 
+    private List<App> apps = new ArrayList<>();
+
+    public List<App> getApps()
+    {
+        return apps;
+    }
+
     private SortedMap<String, String> styles;
 
     public SortedMap<String, String> getStyles()
@@ -115,7 +112,7 @@
         return currentStyle;
     }
 
-    private List<Locale> availableLocales;
+    private List<Locale> availableLocales = new ArrayList<>();
 
     public List<Locale> getAvailableLocales()
     {
@@ -131,13 +128,15 @@
         availableLocales = localeManager.getAvailableLocales();
 
         styles = styleManager.getStyles();
-        
+
         currentStyle = styleManager.getSystemStyle();
-        
+
         flags = systemSettingManager.getFlags();
 
         modules = moduleManager.getMenuModules();
 
+        apps = appManager.getApps();
+
         FilterUtils.filter( modules, startableFilter );
 
         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	2014-08-08 09:41:58 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/resources/META-INF/dhis/beans.xml	2014-10-02 09:50:33 +0000
@@ -31,10 +31,6 @@
   <bean id="org.hisp.dhis.settings.action.system.GetAppearanceSettingsAction"
     class="org.hisp.dhis.settings.action.system.GetAppearanceSettingsAction"
     scope="prototype">
-    <property name="systemSettingManager" ref="org.hisp.dhis.setting.SystemSettingManager" />
-    <property name="moduleManager" ref="org.hisp.dhis.webportal.module.ModuleManager" />
-    <property name="styleManager" ref="org.hisp.dhis.setting.StyleManager" />
-    <property name="localeManager" ref="org.hisp.dhis.i18n.locale.LocaleManager" />
   </bean>
 
   <bean id="org.hisp.dhis.settings.action.system.SetAppearanceSettingsAction"

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/webapp/dhis-web-maintenance-settings/systemAppearanceSettings.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/webapp/dhis-web-maintenance-settings/systemAppearanceSettings.vm	2014-06-26 14:38:54 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/webapp/dhis-web-maintenance-settings/systemAppearanceSettings.vm	2014-10-02 09:50:33 +0000
@@ -65,9 +65,16 @@
 <div class="setting">
 <select id="startModule" name="startModule">
     <option value="NO_START_PAGE">$i18n.getString( "system_overview" )</option>
-	#foreach ( $module in $modules )
-	<option value="$module.name" #if( $module.name == $startModule )selected="selected"#end>$i18n.getString( "$module.name" )</option>
-	#end
+    #foreach ( $module in $modules )
+    <option value="$module.name" #if( $module.name == $startModule )selected="selected"#end>$i18n.getString( "$module.name" )</option>
+    #end
+    #if( $apps.size() > 0 )
+    <optgroup label="Apps">
+        #foreach ( $app in $apps )
+        <option value="$app.name" #if( $app.name == $startModule )selected="selected"#end>$i18n.getString( "$app.name" )</option>
+        #end
+    </optgroup>
+    #end
 </select>
 </div>