summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSidharth Singh2013-09-04 07:29:01 (EDT)
committer Stephan Born2013-09-23 05:05:06 (EDT)
commitf5381ec3dc188226c5121a771a44b57b21ca7034 (patch)
treed27089b67c1d308ad780cda684a3ea69ba09a809
parente3d17ff542a88ecac34d6fbc1b1f621f52bfce86 (diff)
downloadorg.eclipse.stardust.ui.web-f5381ec3dc188226c5121a771a44b57b21ca7034.zip
org.eclipse.stardust.ui.web-f5381ec3dc188226c5121a771a44b57b21ca7034.tar.gz
org.eclipse.stardust.ui.web-f5381ec3dc188226c5121a771a44b57b21ca7034.tar.bz2
Jira-ID: CRNT-30344
Added initializeSession.xhtml for initializing LoginSession. Changed main.iface reference to main.html path git-svn-id: https://svn.csa.sungard.com/repos/ipp2/product/trunk/stardust/ui.web@67089 8100b5e0-4d52-466c-ae9c-bdeccbdeaf6b Signed-off-by: Sidharth Singh <sidharth.singh@sungard.com>
-rw-r--r--portal-common/src/main/resources/META-INF/xhtml/initializeSession.xhtml33
-rw-r--r--views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/login/dialogs/InitializeSessionBean.java41
-rw-r--r--views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/login/filter/LoginFilter.java17
-rw-r--r--views-common/src/main/resources/META-INF/spring/views-common-context.xml7
4 files changed, 94 insertions, 4 deletions
diff --git a/portal-common/src/main/resources/META-INF/xhtml/initializeSession.xhtml b/portal-common/src/main/resources/META-INF/xhtml/initializeSession.xhtml
new file mode 100644
index 0000000..7b00a27
--- /dev/null
+++ b/portal-common/src/main/resources/META-INF/xhtml/initializeSession.xhtml
@@ -0,0 +1,33 @@
+<f:view xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ice="http://www.icesoft.com/icefaces/component"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:c="http://java.sun.com/jstl/core"
+ xmlns:fn="http://java.sun.com/jsp/jstl/functions">
+ <html>
+<head>
+<script type="text/javascript">
+ function loaded() {
+ document.getElementById("loginSessionInitFrm:initializeFlag").value = true;
+ iceSubmitPartial(document.getElementById("loginSessionInitFrm"),
+ document.getElementById("loginSessionInitFrm:initializeFlag"));
+ }
+</script>
+</head>
+<body onload="loaded()">
+ <ice:form id="loginSessionInitFrm">
+ <ice:inputHidden id="initializeFlag" value=""
+ valueChangeListener="#{initializeSessionBean.initUserSession}"
+ partialSubmit="true" immediate="true" />
+ </ice:form>
+ <c:if test="#{initializeSessionBean.initSuccess}">
+ <script>
+ var href = window.location.href.substr(0, window.location.href
+ .indexOf('/plugins'));
+ href += '/main.html';
+ window.location.replace(href);
+ </script>
+ </c:if>
+</body>
+ </html>
+</f:view> \ No newline at end of file
diff --git a/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/login/dialogs/InitializeSessionBean.java b/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/login/dialogs/InitializeSessionBean.java
new file mode 100644
index 0000000..60cf788
--- /dev/null
+++ b/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/login/dialogs/InitializeSessionBean.java
@@ -0,0 +1,41 @@
+/*******************************************************************************
+ * Copyright (c) 2011 SunGard CSA LLC and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * SunGard CSA LLC - initial API and implementation and/or initial documentation
+ *******************************************************************************/
+package org.eclipse.stardust.ui.web.viewscommon.login.dialogs;
+
+import java.io.Serializable;
+
+import javax.faces.event.ValueChangeEvent;
+
+import org.eclipse.stardust.ui.web.viewscommon.login.util.LoginUtils;
+
+public class InitializeSessionBean implements Serializable
+{
+ /**
+ *
+ */
+ private static final long serialVersionUID = 7084643287916287831L;
+ private boolean initSuccess;
+
+ /**
+ * @param event
+ */
+ public void initUserSession(ValueChangeEvent event)
+ {
+ LoginUtils.initialize();
+ initSuccess = true;
+ }
+
+ public boolean isInitSuccess()
+ {
+ return initSuccess;
+ }
+
+}
diff --git a/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/login/filter/LoginFilter.java b/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/login/filter/LoginFilter.java
index 1da72aa..8fffe06 100644
--- a/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/login/filter/LoginFilter.java
+++ b/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/login/filter/LoginFilter.java
@@ -65,7 +65,7 @@ public class LoginFilter implements Filter
private final static String DEFAULT_LOGOUT_PAGE = "/ipp/common/ippPortalLogout.jsp";
private final static String MAIN_PAGE = "mainPage";
- private final static String DEFAULT_MAIN_PAGE = "plugins/common/main.iface";
+ private final static String DEFAULT_MAIN_PAGE = "/main.html";
private final static String PRINCIPAL_USER_ROLES = "principalUserRoles";
@@ -76,6 +76,8 @@ public class LoginFilter implements Filter
private static final String DEFAULT_PUBLIC_URI_PATTERNS = ANY_PLUGIN_URI_PREFIX
+ "/public/*";
+ private static final String PRINCIPAL_LOGIN_INIT_PAGE = "/plugins/common/initializeSession.iface";
+
private String loginPage;
private String logoutPage;
private String mainPage;
@@ -246,8 +248,17 @@ public class LoginFilter implements Filter
{
trace.info("Redirect to login, because session was not initialized.");
StringBuffer url = new StringBuffer(request.getContextPath());
- url.append(logoutPage); // Always forward to logout, so that checks applied and cleanup happens properly,
- // before login page is displayed
+ if (requestUri.endsWith(PRINCIPAL_LOGIN_INIT_PAGE))
+ {
+ url.append("/").append(loginPage); // While login for principal user,
+ // no session present
+ }
+ else
+ {
+ url.append(logoutPage); // Always forward to logout, so that checks
+ // applied and cleanup happens properly,
+ // before login page is displayed
+ }
Map<String, String> urlParams = new LinkedHashMap<String, String>();
diff --git a/views-common/src/main/resources/META-INF/spring/views-common-context.xml b/views-common/src/main/resources/META-INF/spring/views-common-context.xml
index be9a76e..a0b6988 100644
--- a/views-common/src/main/resources/META-INF/spring/views-common-context.xml
+++ b/views-common/src/main/resources/META-INF/spring/views-common-context.xml
@@ -73,7 +73,12 @@
<bean name="panelConfirmation" class="org.eclipse.stardust.ui.web.viewscommon.dialogs.PanelConfirmation"
scope="portalTab">
</bean>
-
+
+ <bean name="initializeSessionBean"
+ class="org.eclipse.stardust.ui.web.viewscommon.login.dialogs.InitializeSessionBean"
+ scope="session">
+ </bean>
+
<bean name="commonFileUploadDialog"
class="org.eclipse.stardust.ui.web.viewscommon.views.doctree.CommonFileUploadDialog"
scope="portalTab">