← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 8668: Reimplemented redirect logic in web commons. Cleaned up now obsolete stuff from portal.

 

------------------------------------------------------------
revno: 8668
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2012-10-23 16:04:27 +0200
message:
  Reimplemented redirect logic in web commons. Cleaned up now obsolete stuff from portal.
removed:
  dhis-2/dhis-web/dhis-web-portal/src/main/java/org/
  dhis-2/dhis-web/dhis-web-portal/src/main/java/org/hisp/
  dhis-2/dhis-web/dhis-web-portal/src/main/java/org/hisp/dhis/
  dhis-2/dhis-web/dhis-web-portal/src/main/java/org/hisp/dhis/wp/
  dhis-2/dhis-web/dhis-web-portal/src/main/java/org/hisp/dhis/wp/action/
  dhis-2/dhis-web/dhis-web-portal/src/main/java/org/hisp/dhis/wp/action/NoAction.java
  dhis-2/dhis-web/dhis-web-portal/src/main/webapp/dhis-web-portal/
  dhis-2/dhis-web/dhis-web-portal/src/main/webapp/dhis-web-portal/images/
  dhis-2/dhis-web/dhis-web-portal/src/main/webapp/dhis-web-portal/images/intro.jpg
  dhis-2/dhis-web/dhis-web-portal/src/main/webapp/dhis-web-portal/javascript/
  dhis-2/dhis-web/dhis-web-portal/src/main/webapp/dhis-web-portal/javascript/intro.js
  dhis-2/dhis-web/dhis-web-portal/src/main/webapp/dhis-web-portal/redirect.vm
  dhis-2/dhis-web/dhis-web-portal/src/main/webapp/dhis-web-portal/style/
  dhis-2/dhis-web/dhis-web-portal/src/main/webapp/dhis-web-portal/style/intro.css
added:
  dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/about/action/RedirectAction.java
modified:
  dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/interceptor/SystemSettingInterceptor.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-portal/src/main/resources/META-INF/dhis/beans.xml
  dhis-2/dhis-web/dhis-web-portal/src/main/resources/struts.xml
  dhis-2/dhis-web/dhis-web-portal/src/main/webapp/WEB-INF/web.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
=== added file 'dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/about/action/RedirectAction.java'
--- dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/about/action/RedirectAction.java	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/about/action/RedirectAction.java	2012-10-23 14:04:27 +0000
@@ -0,0 +1,70 @@
+package org.hisp.dhis.about.action;
+
+/*
+ * Copyright (c) 2004-2012, 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 static org.hisp.dhis.setting.SystemSettingManager.KEY_START_MODULE;
+
+import org.hisp.dhis.setting.SystemSettingManager;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import com.opensymphony.xwork2.Action;
+
+/**
+ * @author Lars Helge Overland
+ */
+public class RedirectAction
+    implements Action
+{
+    @Autowired
+    private SystemSettingManager systemSettingManager;
+
+    private String redirectUrl;
+    
+    public String getRedirectUrl()
+    {
+        return redirectUrl;
+    }
+
+    @Override
+    public String execute()
+        throws Exception
+    {
+        String startModule = (String) systemSettingManager.getSystemSetting( KEY_START_MODULE );
+        
+        if ( startModule != null )
+        {
+            redirectUrl = "../" + startModule + "/index.action";
+        }
+        else
+        {
+            redirectUrl = "../dhis-web-dashboard-integration/index.action";
+        }
+        
+        return SUCCESS;
+    }  
+}

=== modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/interceptor/SystemSettingInterceptor.java'
--- dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/interceptor/SystemSettingInterceptor.java	2012-10-23 08:04:24 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/interceptor/SystemSettingInterceptor.java	2012-10-23 14:04:27 +0000
@@ -53,7 +53,6 @@
 
 /**
  * @author Lars Helge Overland
- * @version $Id$
  */
 public class SystemSettingInterceptor
     implements Interceptor

=== 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	2012-10-23 10:26:43 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/resources/META-INF/dhis/beans.xml	2012-10-23 14:04:27 +0000
@@ -303,11 +303,14 @@
     <property name="helpManager" ref="org.hisp.dhis.help.HelpManager" />
   </bean>
 
+  <bean id="org.hisp.dhis.about.action.RedirectAction" class="org.hisp.dhis.about.action.RedirectAction"
+    scope="prototype"/>
+
   <bean id="org.hisp.dhis.help.action.GetHelpItemsAction" class="org.hisp.dhis.help.action.GetHelpItemsAction"
     scope="prototype">
     <property name="helpManager" ref="org.hisp.dhis.help.HelpManager" />
   </bean>
-
+  
   <!-- Common actions -->
 
   <bean id="org.hisp.dhis.commons.action.GetNotificationsAction" class="org.hisp.dhis.commons.action.GetNotificationsAction" scope="prototype"/>

=== 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	2012-10-23 10:26:43 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/resources/dhis-web-commons.xml	2012-10-23 14:04:27 +0000
@@ -883,8 +883,6 @@
       <param name="menu">/dhis-web-commons/about/menu.vm</param>
     </action>
 
-	<!-- User settings -->
-	
     <action name="userSettings" class="org.hisp.dhis.settings.user.action.GetGeneralSettingsAction">
       <result name="success" type="velocity">/main.vm</result>
       <param name="page">/dhis-web-commons/settings/userGeneralSettings.vm</param>
@@ -897,5 +895,9 @@
 	  <param name="onExceptionReturn">plainTextError</param>
     </action>
 	
+	<action name="redirect" class="org.hisp.dhis.about.action.RedirectAction">
+	  <result name="success" type="redirect">${redirectUrl}</result>
+	</action>
+	
   </package>
 </struts>

=== removed directory 'dhis-2/dhis-web/dhis-web-portal/src/main/java/org'
=== removed directory 'dhis-2/dhis-web/dhis-web-portal/src/main/java/org/hisp'
=== removed directory 'dhis-2/dhis-web/dhis-web-portal/src/main/java/org/hisp/dhis'
=== removed directory 'dhis-2/dhis-web/dhis-web-portal/src/main/java/org/hisp/dhis/wp'
=== removed directory 'dhis-2/dhis-web/dhis-web-portal/src/main/java/org/hisp/dhis/wp/action'
=== removed file 'dhis-2/dhis-web/dhis-web-portal/src/main/java/org/hisp/dhis/wp/action/NoAction.java'
--- dhis-2/dhis-web/dhis-web-portal/src/main/java/org/hisp/dhis/wp/action/NoAction.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-web/dhis-web-portal/src/main/java/org/hisp/dhis/wp/action/NoAction.java	1970-01-01 00:00:00 +0000
@@ -1,43 +0,0 @@
-package org.hisp.dhis.wp.action;
-
-/*
- * Copyright (c) 2004-2012, 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 com.opensymphony.xwork2.Action;
-
-/**
- * @author Lars Helge Overland
- * @version $Id$
- */
-public class NoAction
-    implements Action
-{
-    public String execute()
-    {
-        return SUCCESS;
-    }
-}

=== modified file 'dhis-2/dhis-web/dhis-web-portal/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-web/dhis-web-portal/src/main/resources/META-INF/dhis/beans.xml	2012-01-05 20:39:23 +0000
+++ dhis-2/dhis-web/dhis-web-portal/src/main/resources/META-INF/dhis/beans.xml	2012-10-23 14:04:27 +0000
@@ -3,9 +3,5 @@
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
        xsi:schemaLocation="
 http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd";>
-    
-  <bean id="org.hisp.dhis.wp.action.NoAction"
-    class="org.hisp.dhis.wp.action.NoAction"
-    scope="prototype"/>
-  
+      
 </beans>

=== modified file 'dhis-2/dhis-web/dhis-web-portal/src/main/resources/struts.xml'
--- dhis-2/dhis-web/dhis-web-portal/src/main/resources/struts.xml	2012-08-13 14:18:26 +0000
+++ dhis-2/dhis-web/dhis-web-portal/src/main/resources/struts.xml	2012-10-23 14:04:27 +0000
@@ -8,11 +8,5 @@
   
   <package name="dhis-web-portal" extends="dhis-web-commons" namespace="/dhis-web-portal">
     
-    <action name="redirect" class="org.hisp.dhis.wp.action.NoAction">
-      <result name="success" type="velocity">/main.vm</result>
-      <param name="page">/dhis-web-portal/redirect.vm</param>
-      <param name="javascripts">javascript/intro.js</param>
-    </action>
-    
   </package>
 </struts>

=== modified file 'dhis-2/dhis-web/dhis-web-portal/src/main/webapp/WEB-INF/web.xml'
--- dhis-2/dhis-web/dhis-web-portal/src/main/webapp/WEB-INF/web.xml	2012-10-02 07:46:54 +0000
+++ dhis-2/dhis-web/dhis-web-portal/src/main/webapp/WEB-INF/web.xml	2012-10-23 14:04:27 +0000
@@ -18,7 +18,7 @@
     <filter-class>org.hisp.dhis.servlet.filter.HttpRedirectFilter</filter-class>
     <init-param>
       <param-name>redirectPath</param-name>
-      <param-value>dhis-web-portal/redirect.action</param-value>
+      <param-value>dhis-web-commons-about/redirect.action</param-value>
     </init-param>
   </filter>
   <filter>

=== removed directory 'dhis-2/dhis-web/dhis-web-portal/src/main/webapp/dhis-web-portal'
=== removed directory 'dhis-2/dhis-web/dhis-web-portal/src/main/webapp/dhis-web-portal/images'
=== removed file 'dhis-2/dhis-web/dhis-web-portal/src/main/webapp/dhis-web-portal/images/intro.jpg'
Binary files dhis-2/dhis-web/dhis-web-portal/src/main/webapp/dhis-web-portal/images/intro.jpg	2009-03-03 16:46:36 +0000 and dhis-2/dhis-web/dhis-web-portal/src/main/webapp/dhis-web-portal/images/intro.jpg	1970-01-01 00:00:00 +0000 differ
=== removed directory 'dhis-2/dhis-web/dhis-web-portal/src/main/webapp/dhis-web-portal/javascript'
=== removed file 'dhis-2/dhis-web/dhis-web-portal/src/main/webapp/dhis-web-portal/javascript/intro.js'
--- dhis-2/dhis-web/dhis-web-portal/src/main/webapp/dhis-web-portal/javascript/intro.js	2011-01-19 12:40:41 +0000
+++ dhis-2/dhis-web/dhis-web-portal/src/main/webapp/dhis-web-portal/javascript/intro.js	1970-01-01 00:00:00 +0000
@@ -1,10 +0,0 @@
-
-$( document ).ready( function()
-{
-  $( "div#intro" ).fadeIn( 1500 );
-});
-
-function redirect()
-{
-	window.location = redirectUrl;
-}

=== removed file 'dhis-2/dhis-web/dhis-web-portal/src/main/webapp/dhis-web-portal/redirect.vm'
--- dhis-2/dhis-web/dhis-web-portal/src/main/webapp/dhis-web-portal/redirect.vm	2012-03-04 13:26:24 +0000
+++ dhis-2/dhis-web/dhis-web-portal/src/main/webapp/dhis-web-portal/redirect.vm	1970-01-01 00:00:00 +0000
@@ -1,24 +0,0 @@
-
-<script type="text/javascript">
-var redirectUrl;
-
-#if ( $startModule && $auth.hasAccess( $startModule, "index" ) )
-	redirectUrl = "../${startModule}/index.action";
-#else
-	redirectUrl = "../dhis-web-commons-about/modules.action";
-#end
-</script>
-
-#if ( !$inMemoryDatabase )
-
-<script type="text/javascript">
-redirect();
-</script>
-
-#else
-
-<span id="info">$i18n.getString( "in_memory_notification" )</span>
-
-<p><input type="button" value="$i18n.getString( 'proceed' )" onclick="redirect()"></p>
-
-#end
\ No newline at end of file

=== removed directory 'dhis-2/dhis-web/dhis-web-portal/src/main/webapp/dhis-web-portal/style'
=== removed file 'dhis-2/dhis-web/dhis-web-portal/src/main/webapp/dhis-web-portal/style/intro.css'
--- dhis-2/dhis-web/dhis-web-portal/src/main/webapp/dhis-web-portal/style/intro.css	2011-06-12 10:33:24 +0000
+++ dhis-2/dhis-web/dhis-web-portal/src/main/webapp/dhis-web-portal/style/intro.css	1970-01-01 00:00:00 +0000
@@ -1,19 +0,0 @@
-
-div#intro
-{
-  background-image: url('../images/intro.jpg');
-  background-repeat: repeat-x;
-  color: #374565;
-  font-size: 11pt;
-  border: 1px solid #5c6988;
-  width: 540px;
-  height: 280px;
-  text-align: center;
-  display: none;
-}
-
-div#intro a
-{
-  color: #374565;
-  font-weight: normal;
-}