portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vku...@apache.org
Subject svn commit: r698191 - in /portals/jetspeed-2/applications/j2-admin/branches/security-refactoring/src: main/java/org/apache/jetspeed/portlets/localeselector/ main/java/org/apache/jetspeed/portlets/localeselector/resources/ main/java/org/apache/jetspeed/...
Date Tue, 23 Sep 2008 14:29:09 GMT
Author: vkumar
Date: Tue Sep 23 07:29:09 2008
New Revision: 698191

URL: http://svn.apache.org/viewvc?rev=698191&view=rev
Log:
Fixing issues user details portlet & adding new locale selector portlet in refactoring
branch

Modified:
    portals/jetspeed-2/applications/j2-admin/branches/security-refactoring/src/main/java/org/apache/jetspeed/portlets/localeselector/LocaleSelectorPortlet.java
    portals/jetspeed-2/applications/j2-admin/branches/security-refactoring/src/main/java/org/apache/jetspeed/portlets/localeselector/resources/LocaleSelectorResources.properties
    portals/jetspeed-2/applications/j2-admin/branches/security-refactoring/src/main/java/org/apache/jetspeed/portlets/security/users/JetspeedUserBean.java
    portals/jetspeed-2/applications/j2-admin/branches/security-refactoring/src/main/java/org/apache/jetspeed/portlets/security/users/UserDetailsPortlet.java
    portals/jetspeed-2/applications/j2-admin/branches/security-refactoring/src/webapp/WEB-INF/view/locale-list.jsp

Modified: portals/jetspeed-2/applications/j2-admin/branches/security-refactoring/src/main/java/org/apache/jetspeed/portlets/localeselector/LocaleSelectorPortlet.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/branches/security-refactoring/src/main/java/org/apache/jetspeed/portlets/localeselector/LocaleSelectorPortlet.java?rev=698191&r1=698190&r2=698191&view=diff
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/branches/security-refactoring/src/main/java/org/apache/jetspeed/portlets/localeselector/LocaleSelectorPortlet.java
(original)
+++ portals/jetspeed-2/applications/j2-admin/branches/security-refactoring/src/main/java/org/apache/jetspeed/portlets/localeselector/LocaleSelectorPortlet.java
Tue Sep 23 07:29:09 2008
@@ -47,7 +47,7 @@
  */
 public class LocaleSelectorPortlet extends GenericPortlet
 {
-    public static final String PREFERED_LOCALE_SESSION_KEY = "org.apache.jetspeed.prefered.locale";
+    public static final String PREFERED_LOCALE_SESSION_KEY = "prefered_locale";
 
     private UserManager userManager;
     

Modified: portals/jetspeed-2/applications/j2-admin/branches/security-refactoring/src/main/java/org/apache/jetspeed/portlets/localeselector/resources/LocaleSelectorResources.properties
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/branches/security-refactoring/src/main/java/org/apache/jetspeed/portlets/localeselector/resources/LocaleSelectorResources.properties?rev=698191&r1=698190&r2=698191&view=diff
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/branches/security-refactoring/src/main/java/org/apache/jetspeed/portlets/localeselector/resources/LocaleSelectorResources.properties
(original)
+++ portals/jetspeed-2/applications/j2-admin/branches/security-refactoring/src/main/java/org/apache/jetspeed/portlets/localeselector/resources/LocaleSelectorResources.properties
Tue Sep 23 07:29:09 2008
@@ -18,7 +18,7 @@
 
 # Base Locales
 # DO NOT TRANSLATE & DO NOT INCLUDE IN L10N PROPERTIES FILE
-localeselector.locales=de,en,es,fr,hu,it,ja,ko,nl,pl,pt,ru,sv,zh,zh_TW
+localeselector.locales=hu,de,en,es,fr,hu,it,ja,ko,nl,pl,pt,ru,sv,zh,zh_TW
 
 # Label
 localeselector.label.language=Language:

Modified: portals/jetspeed-2/applications/j2-admin/branches/security-refactoring/src/main/java/org/apache/jetspeed/portlets/security/users/JetspeedUserBean.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/branches/security-refactoring/src/main/java/org/apache/jetspeed/portlets/security/users/JetspeedUserBean.java?rev=698191&r1=698190&r2=698191&view=diff
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/branches/security-refactoring/src/main/java/org/apache/jetspeed/portlets/security/users/JetspeedUserBean.java
(original)
+++ portals/jetspeed-2/applications/j2-admin/branches/security-refactoring/src/main/java/org/apache/jetspeed/portlets/security/users/JetspeedUserBean.java
Tue Sep 23 07:29:09 2008
@@ -17,12 +17,14 @@
 package org.apache.jetspeed.portlets.security.users;
 
 import java.security.Principal;
+import java.util.HashMap;
 import java.util.Iterator;
 import java.util.LinkedHashMap;
 import java.util.Map;
 
 import javax.security.auth.Subject;
 
+import org.apache.jetspeed.security.SecurityAttribute;
 import org.apache.jetspeed.security.User;
 
 /**
@@ -40,9 +42,16 @@
 	{
 		// Principal userPrincipal = createPrincipal(user.getSubject(), UserPrincipal.class);
 		this.principal = user.getName();
-
+		String attributeKey;
 		// Preferences userAttributes = user.getUserAttributes();
-		Map<String, String> userAttributes = user.getInfoMap();
+		Iterator<String> iterator =  user.getSecurityAttributes().getAttributeMap().keySet().iterator();
+		Map<String, String> userAttributes = new HashMap<String, String>();
+		
+		while(iterator.hasNext())
+		{
+		    attributeKey = iterator.next();
+		    userAttributes.put(attributeKey, user.getSecurityAttributes().getAttribute(attributeKey).getStringValue());
+		}		
 		attributes.putAll(userAttributes);
 	}
 

Modified: portals/jetspeed-2/applications/j2-admin/branches/security-refactoring/src/main/java/org/apache/jetspeed/portlets/security/users/UserDetailsPortlet.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/branches/security-refactoring/src/main/java/org/apache/jetspeed/portlets/security/users/UserDetailsPortlet.java?rev=698191&r1=698190&r2=698191&view=diff
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/branches/security-refactoring/src/main/java/org/apache/jetspeed/portlets/security/users/UserDetailsPortlet.java
(original)
+++ portals/jetspeed-2/applications/j2-admin/branches/security-refactoring/src/main/java/org/apache/jetspeed/portlets/security/users/UserDetailsPortlet.java
Tue Sep 23 07:29:09 2008
@@ -630,7 +630,8 @@
 				Map<String,String> attributes = user.getInfoMap();
 				String firstName = attributes.get("user.name.given") == null ?"n/a":attributes.get("user.name.given");
 				String lastName = attributes.get("user.name.family") == null ?"n/a":attributes.get("user.name.family");
-				String subsite = user.getSecurityAttributes().getAttribute(User.JETSPEED_USER_SUBSITE_ATTRIBUTE).getStringValue();
+				SecurityAttribute subsiteAttr =user.getSecurityAttributes().getAttribute(User.JETSPEED_USER_SUBSITE_ATTRIBUTE);
+				String subsite = subsiteAttr != null ? subsiteAttr.getStringValue() : null;
 				userManager.removeUser(userName);
 				PortletMessaging.publish(actionRequest, SecurityResources.TOPIC_USERS, SecurityResources.MESSAGE_REFRESH,
"true");
 				if (subsite == null)

Modified: portals/jetspeed-2/applications/j2-admin/branches/security-refactoring/src/webapp/WEB-INF/view/locale-list.jsp
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/branches/security-refactoring/src/webapp/WEB-INF/view/locale-list.jsp?rev=698191&r1=698190&r2=698191&view=diff
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/branches/security-refactoring/src/webapp/WEB-INF/view/locale-list.jsp
(original)
+++ portals/jetspeed-2/applications/j2-admin/branches/security-refactoring/src/webapp/WEB-INF/view/locale-list.jsp
Tue Sep 23 07:29:09 2008
@@ -21,24 +21,26 @@
 
 <portlet:actionURL var="changeLocaleAction">
 </portlet:actionURL>
-
-<form action="<%=changeLocaleAction%>" method="POST">
+<script>
+function setLanguage(lang)
+{
+	document.langChng.prefered_locale.value=lang;
+	document.langChng.submit();
+}
+</script>
+<form name="langChng" action="<%=changeLocaleAction%>" method="POST">
 <table border="0">
 	<tr>
-		<td align="right"><fmt:message key="localeselector.label.language"/></td>
-		<td align="left">
-			<select name="org.apache.jetspeed.prefered.locale">
-				<c:set var="locales"><fmt:message key="localeselector.locales"/></c:set>
-				<c:forTokens var="l" items="${locales}" delims=",">
-				<option value="<c:out value="${l}"/>"
-					<c:if test="${currentLocale == l}">selected</c:if>
-				><fmt:message>localeselector.locale.<c:out value="${l}"/></fmt:message></option>
-				</c:forTokens>
-			</select>
-		</td>
+		<td align="left"><fmt:message key="localeselector.label.language"/></td>
 	</tr>
 	<tr>
-		<td align="center" colspan="2"><input type="submit" value="<fmt:message key="localeselector.label.change"/>"/></td>
+		<td align="left">
+			<c:set var="locales"><fmt:message key="localeselector.locales"/></c:set>
+			<c:forTokens var="l" items="${locales}" delims=",">
+				<a href="javascript:setLanguage('<c:out value="${l}"/>')" title="<fmt:message
key="localeselector.locale.${l}"/>""><img border="0" src="<%=request.getContextPath()%><c:out
value="/images/${l}.gif"/>" /></a>
+			</c:forTokens>
+		</td>
 	</tr>
 </table>
-</form>
+<input type="hidden" name="prefered_locale" value=""/>
+</form>
\ No newline at end of file



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org


Mime
View raw message