summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSidharth Singh2013-01-07 05:18:00 (EST)
committer Stephan Born2013-01-25 13:19:55 (EST)
commitb1db1a426bdfe0af88527d44b6e8890f8e71fe6e (patch)
tree9cd875eec126b079424573853a8bae0288d4e35c
parentaa30948221275a7bde05ea6eab8e42829e5d460d (diff)
downloadorg.eclipse.stardust.ui.web-b1db1a426bdfe0af88527d44b6e8890f8e71fe6e.zip
org.eclipse.stardust.ui.web-b1db1a426bdfe0af88527d44b6e8890f8e71fe6e.tar.gz
org.eclipse.stardust.ui.web-b1db1a426bdfe0af88527d44b6e8890f8e71fe6e.tar.bz2
Jira-ID: CRNT-27408
Added stardust Header to TechnicalUserUtils.java, added log msg to logout() Removed one catch block from apply() in ResetPasswordDialog.java Removed reference of "camino" from LoginDialogBean git-svn-id: http://emeafrazerg/svn/ipp/product/trunk/stardust/ui.web@61856 8100b5e0-4d52-466c-ae9c-bdeccbdeaf6b
-rw-r--r--views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/common/Constants.java2
-rw-r--r--views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/common/TechnicalUserUtils.java99
-rw-r--r--views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/common/spi/theme/impl/IppThemeProvider.java7
-rw-r--r--views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/login/dialogs/LoginDialogBean.java12
-rw-r--r--views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/login/dialogs/ResetPasswordDialog.java10
5 files changed, 61 insertions, 69 deletions
diff --git a/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/common/Constants.java b/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/common/Constants.java
index 6b00567..5a92f56 100644
--- a/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/common/Constants.java
+++ b/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/common/Constants.java
@@ -66,7 +66,7 @@ public class Constants
public static final String ROOT_GRID = "rootGrid";
- public static final String PLUGIN_FOLDER_PATH = "/public/skins";
+ public static final String SKIN_FOLDER = "/public/skins";
public static final String PLUGIN_ROOT_FOLDER_PATH = "/plugins/";
public ActivityInstanceStates getActivityInstanceState()
diff --git a/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/common/TechnicalUserUtils.java b/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/common/TechnicalUserUtils.java
index 6f2d9b8..7d88a68 100644
--- a/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/common/TechnicalUserUtils.java
+++ b/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/common/TechnicalUserUtils.java
@@ -1,7 +1,13 @@
-/*
- * $Id$
- * (C) 2000 - 2012 CARNOT AG
- */
+/*******************************************************************************
+ * 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.common;
import java.util.Map;
@@ -13,8 +19,12 @@ import org.eclipse.stardust.ui.web.common.log.Logger;
import org.eclipse.stardust.ui.web.common.util.CollectionUtils;
import org.eclipse.stardust.ui.web.common.util.StringUtils;
import org.eclipse.stardust.ui.web.viewscommon.beans.SessionContext;
-import org.eclipse.stardust.ui.web.viewscommon.utils.ExceptionHandler;
+/**
+ *
+ * @author Sidharth.Singh
+ * @version $Revision: $
+ */
public class TechnicalUserUtils
{
@@ -23,6 +33,9 @@ public class TechnicalUserUtils
public static final String TECH_USER_PARAM_ACCOUNT = "Security.ResetPassword.TechnicalUser.Account";
public static final String TECH_USER_PARAM_PASSWORD = "Security.ResetPassword.TechnicalUser.Password";
public static final String TECH_USER_PARAM_REALM = "Security.ResetPassword.TechnicalUser.Realm";
+ public static final String TECH_USER_ACCOUNT = "motu";
+ public static final String TECH_USER_PASSWORD = "motu";
+ public static final String TECH_USER_REALM = "carnot";
/**
*
@@ -35,51 +48,42 @@ public class TechnicalUserUtils
SessionContext sessionCtx;
// Login With Technical User
- try
+ trace.debug("Technical User about to log in...");
+
+ Parameters parameters = Parameters.instance();
+
+ String user = parameters.getString(TECH_USER_PARAM_ACCOUNT);
+ String pwd = parameters.getString(TECH_USER_PARAM_PASSWORD);
+ String realm = parameters.getString(TECH_USER_PARAM_REALM);
+
+ Map<String, String> properties = CollectionUtils.newHashMap();
+ properties.put(SecurityProperties.REALM, realm);
+
+ if (StringUtils.isEmpty(user) || StringUtils.isEmpty(pwd) || StringUtils.isEmpty(realm))
+ {
+ user = TECH_USER_ACCOUNT;
+ pwd = TECH_USER_PASSWORD;
+ realm = TECH_USER_REALM;
+
+ trace.info("The default user credentials were used to initiate the 'Reset Password' request. Please configure a new technical user.");
+ }
+ else
{
- if (trace.isDebugEnabled())
- {
- trace.debug("Technical User about to log in...");
- }
-
- Parameters parameters = Parameters.instance();
-
- String user = parameters.getString(TECH_USER_PARAM_ACCOUNT);
- String pwd = parameters.getString(TECH_USER_PARAM_PASSWORD);
- String realm = parameters.getString(TECH_USER_PARAM_REALM);
-
- Map<String, String> properties = CollectionUtils.newHashMap();
- properties.put(SecurityProperties.REALM, realm);
-
- if (StringUtils.isEmpty(user) || StringUtils.isEmpty(pwd) || StringUtils.isEmpty(realm))
- {
- user = "motu";
- pwd = "motu";
- realm = "carnot";
-
- trace.info("The default user credentials were used to initiate the 'Reset Password' request. Please configure a new technical user.");
- }
- else
- {
- trace.debug("Technical User is found to be configured. Using the same to Reset Password");
- }
-
- // Set the partition of Tech User same as the current user
- if (loginProperties.containsKey(SecurityProperties.PARTITION))
- {
- properties.put(SecurityProperties.PARTITION, loginProperties.get(SecurityProperties.PARTITION));
- }
-
- sessionCtx = SessionContext.findSessionContext();
- sessionCtx.initInternalSession(user, pwd, properties);
-
- if (trace.isDebugEnabled())
- {
- trace.debug("Technical User Logged in...");
- }
+ trace.debug("Technical User is found to be configured. Using the same to Reset Password");
}
- finally
+
+ // Set the partition of Tech User same as the current user
+ if (loginProperties.containsKey(SecurityProperties.PARTITION))
+ {
+ properties.put(SecurityProperties.PARTITION, loginProperties.get(SecurityProperties.PARTITION));
+ }
+
+ sessionCtx = SessionContext.findSessionContext();
+ sessionCtx.initInternalSession(user, pwd, properties);
+
+ if (trace.isDebugEnabled())
{
+ trace.debug("Technical User" + user + " Logged in...");
}
return sessionCtx;
}
@@ -91,5 +95,6 @@ public class TechnicalUserUtils
public static void logout(SessionContext sessionCtx)
{
sessionCtx.logout();
+ trace.debug("Technical User Logged out...");
}
}
diff --git a/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/common/spi/theme/impl/IppThemeProvider.java b/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/common/spi/theme/impl/IppThemeProvider.java
index 06e56cd..de3c4db 100644
--- a/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/common/spi/theme/impl/IppThemeProvider.java
+++ b/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/common/spi/theme/impl/IppThemeProvider.java
@@ -18,7 +18,6 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
-
import org.eclipse.stardust.common.CollectionUtils;
import org.eclipse.stardust.common.StringUtils;
import org.eclipse.stardust.common.config.Parameters;
@@ -37,10 +36,6 @@ import org.eclipse.stardust.ui.web.viewscommon.common.Constants;
import org.eclipse.stardust.ui.web.viewscommon.common.PortalPluginSkinResourceResolver;
import org.eclipse.stardust.ui.web.viewscommon.login.dialogs.LoginDialogBean;
import org.eclipse.stardust.ui.web.viewscommon.utils.DMSHelper;
-import org.springframework.core.io.Resource;
-
-
-
/**
* @author Subodh.Godbole
@@ -123,7 +118,7 @@ public class IppThemeProvider implements ThemeProvider
{
Set<Theme> availablePluginThemes = new HashSet<Theme>();
- pluginAvailableSkins = PortalPluginSkinResourceResolver.findPluginSkins(Constants.PLUGIN_FOLDER_PATH, null);
+ pluginAvailableSkins = PortalPluginSkinResourceResolver.findPluginSkins(Constants.SKIN_FOLDER, null);
for (Map.Entry<String, List<String>> entry : pluginAvailableSkins.entrySet())
{
diff --git a/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/login/dialogs/LoginDialogBean.java b/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/login/dialogs/LoginDialogBean.java
index e2c7e80..7a637bf 100644
--- a/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/login/dialogs/LoginDialogBean.java
+++ b/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/login/dialogs/LoginDialogBean.java
@@ -135,18 +135,18 @@ public class LoginDialogBean implements Serializable, InitializingBean
UserPreferencesEntries.F_SKIN);
TechnicalUserUtils.logout(sessionCtx);
Map<String, List<String>> pluginAvailableSkins = null;
- if (skinPreference.contains(Constants.PLUGIN_FOLDER_PATH))
+ if (skinPreference.contains(Constants.SKIN_FOLDER))
{
- // if skinPreference =<plugin-id>/public/skins/camino, directly retrieve the
+ // if skinPreference =<plugin-id>/public/skins/<skinId>, directly retrieve the
// skin
- pluginAvailableSkins = PortalPluginSkinResourceResolver.findPluginSkins(Constants.PLUGIN_FOLDER_PATH,
+ pluginAvailableSkins = PortalPluginSkinResourceResolver.findPluginSkins(Constants.SKIN_FOLDER,
loginStyleSheetName);
}
else
{
- // If skinPreference ="camino" (i.e loaded from
- // SungardSkinStaticConfigurationProvider), search skin folder
- pluginAvailableSkins = PortalPluginSkinResourceResolver.findPluginSkins(Constants.PLUGIN_FOLDER_PATH, null);
+ // If skinPreference =<skinId> (i.e loaded from
+ // static Configuration Provider), search skin folder
+ pluginAvailableSkins = PortalPluginSkinResourceResolver.findPluginSkins(Constants.SKIN_FOLDER, null);
}
for (Map.Entry<String, List<String>> entry : pluginAvailableSkins.entrySet())
diff --git a/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/login/dialogs/ResetPasswordDialog.java b/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/login/dialogs/ResetPasswordDialog.java
index 3e9888d..18da250 100644
--- a/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/login/dialogs/ResetPasswordDialog.java
+++ b/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/login/dialogs/ResetPasswordDialog.java
@@ -72,16 +72,8 @@ public class ResetPasswordDialog extends PopupDialog
try
{
sessionCtx = TechnicalUserUtils.login(loginProperties);
- }
- catch (Exception e)
- {
- ExceptionHandler.handleException(FORM_ID + ":" + COMMON_MESSAGE_ID, e);
- return;
- }
- // Reset Password
- try
- {
+ // Reset Password
if (trace.isDebugEnabled())
{
trace.debug("Resetting Pwd for - " + account);