dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #24985
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 12304: Made apps appear together with bundled modules in top menu
------------------------------------------------------------
revno: 12304
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Sun 2013-09-29 21:31:42 +0200
message:
Made apps appear together with bundled modules in top menu
modified:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/appmanager/App.java
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/appmanager/DefaultAppManager.java
dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/green/green.css
dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/india/india.css
dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/light_blue/light_blue.css
dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/vietnam/vietnam.css
dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/macros.vm
dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/webportal/interceptor/XWorkPortalModuleInterceptor.java
dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/webportal/module/DefaultModuleManager.java
dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/webportal/module/Module.java
dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/webportal/module/ModuleManager.java
dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/style/dashboard.css
--
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/appmanager/App.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/appmanager/App.java 2013-09-26 17:11:40 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/appmanager/App.java 2013-09-29 19:31:42 +0000
@@ -79,6 +79,9 @@
@JsonIgnore
private String folderName;
+ @JsonIgnore
+ private String baseUrl;
+
// -------------------------------------------------------------------------
// Logic
// -------------------------------------------------------------------------
@@ -202,7 +205,17 @@
{
this.folderName = folderName;
}
-
+
+ public String getBaseUrl()
+ {
+ return baseUrl;
+ }
+
+ public void setBaseUrl( String baseUrl )
+ {
+ this.baseUrl = baseUrl;
+ }
+
// -------------------------------------------------------------------------
// hashCode, equals, toString
// -------------------------------------------------------------------------
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/appmanager/DefaultAppManager.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/appmanager/DefaultAppManager.java 2013-09-26 17:20:47 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/appmanager/DefaultAppManager.java 2013-09-29 19:31:42 +0000
@@ -93,6 +93,13 @@
@Override
public List<App> getInstalledApps()
{
+ String baseUrl = getAppBaseUrl();
+
+ for ( App app : apps )
+ {
+ app.setBaseUrl( baseUrl );
+ }
+
return apps;
}
@@ -134,10 +141,8 @@
}
zip.close();
-
- // Reload app state
-
- reloadAppsInternal();
+
+ reloadAppsInternal(); // Reload app state
}
@Override
@@ -152,10 +157,6 @@
String folderPath = getAppFolderPath() + File.separator + app.getFolderName();
FileUtils.forceDelete( new File( folderPath ) );
- // Reload app state
-
- reloadAppsInternal();
-
return true;
}
catch ( IOException ex )
@@ -163,6 +164,10 @@
log.error( "Could not delete app: " + name, ex );
return false;
}
+ finally
+ {
+ reloadAppsInternal(); // Reload app state
+ }
}
}
=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/green/green.css'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/green/green.css 2013-09-26 14:59:56 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/green/green.css 2013-09-29 19:31:42 +0000
@@ -166,6 +166,8 @@
padding-left: 4px;
padding-right: 4px;
width: 189px;
+ max-heigth: 610px;
+ overflow-y: auto;
background-color: #467e4a;
display: none;
z-index: 10;
=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/india/india.css'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/india/india.css 2013-09-26 14:59:56 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/india/india.css 2013-09-29 19:31:42 +0000
@@ -166,6 +166,8 @@
padding-left: 4px;
padding-right: 4px;
width: 189px;
+ max-heigth: 610px;
+ overflow-y: auto;
background-color: #518a0f;
display: none;
z-index: 10;
=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/light_blue/light_blue.css'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/light_blue/light_blue.css 2013-09-26 14:59:56 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/light_blue/light_blue.css 2013-09-29 19:31:42 +0000
@@ -166,6 +166,8 @@
padding-left: 4px;
padding-right: 4px;
width: 189px;
+ max-heigth: 610px;
+ overflow-y: auto;
background-color: #276696;
display: none;
z-index: 10;
=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/vietnam/vietnam.css'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/vietnam/vietnam.css 2013-09-26 14:59:56 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/vietnam/vietnam.css 2013-09-29 19:31:42 +0000
@@ -166,6 +166,8 @@
padding-left: 4px;
padding-right: 4px;
width: 189px;
+ max-heigth: 610px;
+ overflow-y: auto;
background-color: #b91010;
display: none;
z-index: 10;
=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/macros.vm'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/macros.vm 2013-09-26 18:17:41 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/macros.vm 2013-09-29 19:31:42 +0000
@@ -81,7 +81,7 @@
#end
#macro( introListImgApp $module )
-<li class="introItem" onclick="window.location.href='${appBaseUrl}/${module.defaultAction}'">
+<li class="introItem" onclick="window.location.href='${module.defaultAction}'">
<img src="${appBaseUrl}/${module.icon}" class="introIcon">
<div class="introItemText"><div class="introItemHeader">${module.name}</div><div>${module.description}</div></div>
</li>
=== modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/webportal/interceptor/XWorkPortalModuleInterceptor.java'
--- dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/webportal/interceptor/XWorkPortalModuleInterceptor.java 2013-09-26 18:17:41 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/webportal/interceptor/XWorkPortalModuleInterceptor.java 2013-09-29 19:31:42 +0000
@@ -85,7 +85,7 @@
Map<String, Object> handle = new HashMap<String, Object>( 2 );
handle.put( KEY_MAINTENANCE_MODULES, moduleManager.getAccessibleMaintenanceModules() );
- handle.put( KEY_SERVICE_MODULES, moduleManager.getAccessibleServiceModules() );
+ handle.put( KEY_SERVICE_MODULES, moduleManager.getAccessibleServiceModulesAndApps() );
handle.put( KEY_MENU_MODULES, moduleManager.getAccessibleMenuModulesAndApps() );
actionInvocation.getStack().push( handle );
=== modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/webportal/module/DefaultModuleManager.java'
--- dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/webportal/module/DefaultModuleManager.java 2013-09-26 18:17:41 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/webportal/module/DefaultModuleManager.java 2013-09-29 19:31:42 +0000
@@ -28,7 +28,6 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-import java.io.File;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
@@ -43,7 +42,6 @@
import org.hisp.dhis.appmanager.App;
import org.hisp.dhis.appmanager.AppManager;
import org.hisp.dhis.security.ActionAccessResolver;
-import org.hisp.dhis.system.util.TextUtils;
import org.springframework.beans.factory.annotation.Autowired;
import com.opensymphony.xwork2.config.Configuration;
@@ -155,16 +153,8 @@
List<App> apps = appManager.getInstalledApps();
for ( App app : apps )
- {
- String defaultAction = app.getFolderName() + File.separator + app.getLaunchPath();
- String icon = app.getFolderName() + File.separator + app.getIcons().getIcon48();
- String description = TextUtils.subString( app.getDescription(), 0, 80 );
-
- Module module = new Module( app.getName(), app.getName(), defaultAction );
- module.setIcon( icon );
- module.setDescription( description );
-
- modules.add( module );
+ {
+ modules.add( Module.getModule( app ) );
}
return modules;
@@ -197,6 +187,20 @@
return getAccessibleModules( serviceMenuModules );
}
+
+ public List<Module> getAccessibleServiceModulesAndApps()
+ {
+ List<Module> modules = getAccessibleServiceModules();
+
+ List<App> apps = appManager.getInstalledApps();
+
+ for ( App app : apps )
+ {
+ modules.add( Module.getModule( app ) );
+ }
+
+ return modules;
+ }
public Collection<Module> getAllModules()
{
=== modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/webportal/module/Module.java'
--- dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/webportal/module/Module.java 2013-09-26 18:17:41 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/webportal/module/Module.java 2013-09-29 19:31:42 +0000
@@ -1,5 +1,10 @@
package org.hisp.dhis.webportal.module;
+import java.io.File;
+
+import org.hisp.dhis.appmanager.App;
+import org.hisp.dhis.system.util.TextUtils;
+
/*
* Copyright (c) 2004-2013, University of Oslo
* All rights reserved.
@@ -72,6 +77,23 @@
}
// -------------------------------------------------------------------------
+ // Logic
+ // -------------------------------------------------------------------------
+
+ public static Module getModule( App app )
+ {
+ String defaultAction = app.getBaseUrl() + File.separator + app.getFolderName() + File.separator + app.getLaunchPath();
+ String icon = app.getFolderName() + File.separator + app.getIcons().getIcon48();
+ String description = TextUtils.subString( app.getDescription(), 0, 80 );
+
+ Module module = new Module( app.getName(), app.getName(), defaultAction );
+ module.setIcon( icon );
+ module.setDescription( description );
+
+ return module;
+ }
+
+ // -------------------------------------------------------------------------
// Getters and setters
// -------------------------------------------------------------------------
=== modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/webportal/module/ModuleManager.java'
--- dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/webportal/module/ModuleManager.java 2013-09-26 18:17:41 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/webportal/module/ModuleManager.java 2013-09-29 19:31:42 +0000
@@ -57,6 +57,8 @@
List<Module> getAccessibleServiceModules();
+ List<Module> getAccessibleServiceModulesAndApps();
+
Collection<Module> getAllModules();
Module getCurrentModule();
=== modified file 'dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/style/dashboard.css'
--- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/style/dashboard.css 2013-09-26 12:05:36 +0000
+++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/style/dashboard.css 2013-09-29 19:31:42 +0000
@@ -230,7 +230,7 @@
left: 411px;
width: 498px;
max-height: 520px;
- overflow-y: scroll;
+ overflow-y: auto;
border-right: 1px solid #bbb;
border-bottom: 1px solid #bbb;
border-left: 1px solid #bbb;