dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #32345
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 16506: Made dhis-web-apps index page load automatically
------------------------------------------------------------
revno: 16506
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2014-08-25 17:20:12 +0200
message:
Made dhis-web-apps index page load automatically
modified:
dhis-2/dhis-web/dhis-web-apps/src/main/resources/struts.xml
dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-apps/index.html
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/resources/META-INF/dhis/beans.xml
dhis-2/dhis-web/dhis-web-commons/src/main/resources/META-INF/dhis/security.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-web/dhis-web-apps/src/main/resources/struts.xml'
--- dhis-2/dhis-web/dhis-web-apps/src/main/resources/struts.xml 2014-08-19 21:33:00 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/resources/struts.xml 2014-08-25 15:20:12 +0000
@@ -6,6 +6,12 @@
<include file="dhis-web-commons.xml" />
+ <package name="dhis-web-apps" extends="dhis-web-commons" namespace="/dhis-web-apps">
+ <action name="index" class="org.hisp.dhis.commons.action.NoAction">
+ <result name="success" type="redirect">index.html</result>
+ </action>
+ </package>
+
<package name="dhis-web-pivot" extends="dhis-web-commons" namespace="/dhis-web-pivot">
<action name="index" class="org.hisp.dhis.commons.action.NoAction">
<result name="success" type="redirect">app/index.html</result>
=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-apps/index.html'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-apps/index.html 2014-08-19 21:02:14 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-apps/index.html 2014-08-25 15:20:12 +0000
@@ -1,6 +1,7 @@
<!DOCTYPE html>
<html>
<body>
+ <h3>Apps</h3>
<ul>
<li><a href="../dhis-web-pivot/app/index.html">dhis-web-pivot</a></li>
<li><a href="../dhis-web-visualizer/app/index.html">dhis-web-visualizer</a></li>
=== 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 2014-08-16 08:29:14 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/webportal/module/DefaultModuleManager.java 2014-08-25 15:20:12 +0000
@@ -33,8 +33,10 @@
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
+import java.util.HashSet;
import java.util.List;
import java.util.Map;
+import java.util.Set;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -94,6 +96,13 @@
this.defaultActionName = defaultActionName;
}
+ private Set<String> menuModuleExclusions = new HashSet<>();
+
+ public void setMenuModuleExclusions( Set<String> menuModuleExclusions )
+ {
+ this.menuModuleExclusions = menuModuleExclusions;
+ }
+
// -------------------------------------------------------------------------
// ModuleManager
// -------------------------------------------------------------------------
@@ -182,7 +191,7 @@
if ( packageConfig.getAllActionConfigs().size() == 0 )
{
- log.warn( "Ignoring action package with no actions: " + name );
+ log.debug( "Ignoring action package with no actions: " + name );
continue;
}
@@ -208,8 +217,10 @@
Module module = new Module( name, namespace );
modulesByName.put( name, module );
modulesByNamespace.put( namespace, module );
+
+ boolean include = !menuModuleExclusions.contains( name );
- if ( packageConfig.getActionConfigs().containsKey( defaultActionName ) )
+ if ( packageConfig.getActionConfigs().containsKey( defaultActionName ) && include )
{
module.setDefaultAction( ".." + namespace + "/" + defaultActionName + ".action" );
=== 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 2014-05-28 16:38:44 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/resources/META-INF/dhis/beans.xml 2014-08-25 15:20:12 +0000
@@ -9,6 +9,11 @@
<property name="actionAccessResolver" ref="org.hisp.dhis.security.ActionAccessResolver" />
<property name="moduleComparator" ref="org.hisp.dhis.webportal.module.ConfigurableModuleComparator" />
<property name="defaultActionName" value="index" />
+ <property name="menuModuleExclusions">
+ <set>
+ <value>dhis-web-apps</value>
+ </set>
+ </property>
</bean>
<bean id="org.hisp.dhis.webportal.module.ConfigurableModuleComparator"
=== modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/resources/META-INF/dhis/security.xml'
--- dhis-2/dhis-web/dhis-web-commons/src/main/resources/META-INF/dhis/security.xml 2014-08-19 21:33:00 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/resources/META-INF/dhis/security.xml 2014-08-25 15:20:12 +0000
@@ -192,6 +192,7 @@
<value>dhis-web-commons-stream</value>
<value>dhis-web-commons-help</value>
<value>dhis-web-commons-about</value>
+ <value>dhis-web-apps</value>
<value>dhis-web-api-mobile</value>
<value>dhis-web-portal</value>
</set>
@@ -274,6 +275,7 @@
<value>dhis-web-commons-stream</value>
<value>dhis-web-commons-help</value>
<value>dhis-web-commons-about</value>
+ <value>dhis-web-apps</value>
<value>dhis-web-api-mobile</value>
<value>dhis-web-portal</value>
</set>