portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vku...@apache.org
Subject svn commit: r724754 - /portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/security/users/WicketUserAdmin.java
Date Tue, 09 Dec 2008 15:25:58 GMT
Author: vkumar
Date: Tue Dec  9 07:25:57 2008
New Revision: 724754

URL: http://svn.apache.org/viewvc?rev=724754&view=rev
Log:
Adding INIT PARAM support for wicket portlets

Modified:
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/security/users/WicketUserAdmin.java

Modified: portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/security/users/WicketUserAdmin.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/security/users/WicketUserAdmin.java?rev=724754&r1=724753&r2=724754&view=diff
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/security/users/WicketUserAdmin.java
(original)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/security/users/WicketUserAdmin.java
Tue Dec  9 07:25:57 2008
@@ -16,6 +16,8 @@
  */
 package org.apache.jetspeed.portlets.security.users;
 
+import java.util.Map;
+
 import javax.portlet.PortletRequest;
 
 import org.apache.jetspeed.CommonPortletServices;
@@ -27,6 +29,7 @@
 import org.apache.jetspeed.portlets.wicket.AdminWicketPortlet;
 import org.apache.jetspeed.profiler.Profiler;
 import org.apache.jetspeed.security.GroupManager;
+import org.apache.jetspeed.security.JetspeedPrincipalManagerProvider;
 import org.apache.jetspeed.security.PasswordCredential;
 import org.apache.jetspeed.security.RoleManager;
 import org.apache.jetspeed.security.SecurityException;
@@ -44,18 +47,29 @@
  */
 public class WicketUserAdmin extends WebPage
 {
-    
     public static final String USER_ADMINISTRATION = "J2 User Administration";
-    
-	public WicketUserAdmin()
-	{
-	}
-    
+    public Map initParams = null;
+
+    public WicketUserAdmin()
+    {
+        initParams = (Map) getPortletRequest().getAttribute(AdminWicketPortlet.INIT_PARAMS);
+    }
+
+    public String getInitParam(String paramKey)
+    {
+        String paramValue = null;
+        if (initParams.containsKey(paramKey))
+        {
+            paramValue = (String) initParams.get(paramKey);
+        }
+        return paramValue;
+    }
+
     protected PortletRequest getPortletRequest()
     {
         return ((PortletRequestContext) RequestContext.get()).getPortletRequest();
     }
-    
+
     protected String getPAIdentifier()
     {
         return (String) getPortletRequest().getAttribute(AdminWicketPortlet.JETSPEED_PA_IDENTIFIER);
@@ -65,32 +79,32 @@
     {
         return (UserManager) getPortletRequest().getAttribute(CommonPortletServices.CPS_USER_MANAGER_COMPONENT);
     }
-    
+
     protected RoleManager getRoleManager()
     {
         return (RoleManager) getPortletRequest().getAttribute(CommonPortletServices.CPS_ROLE_MANAGER_COMPONENT);
     }
-    
+
     protected GroupManager getGroupManager()
     {
         return (GroupManager) getPortletRequest().getAttribute(CommonPortletServices.CPS_GROUP_MANAGER_COMPONENT);
     }
-    
+
     protected Profiler getProfiler()
     {
         return (Profiler) getPortletRequest().getAttribute(CommonPortletServices.CPS_PROFILER_COMPONENT);
     }
-    
+
     protected AuditActivity getAuditActivity()
     {
         return (AuditActivity) getPortletRequest().getAttribute(CommonPortletServices.CPS_AUDIT_ACTIVITY);
     }
-    
+
     protected PageManager getPageManager()
     {
         return (PageManager) getPortletRequest().getAttribute(CommonPortletServices.CPS_PAGE_MANAGER_COMPONENT);
     }
-    
+
     protected PortletRegistry getPortletRegistry()
     {
         return (PortletRegistry) getPortletRequest().getAttribute(CommonPortletServices.CPS_REGISTRY_COMPONENT);
@@ -101,33 +115,25 @@
         return (PortalConfiguration) getPortletRequest().getAttribute(CommonPortletServices.CPS_PORTAL_CONFIGURATION);
     }
 
+    protected JetspeedPrincipalManagerProvider getJetspeedPrincipalManagerProvider()
+    {
+        return (JetspeedPrincipalManagerProvider) getPortletRequest().getAttribute(CommonPortletServices.CPS_JETSPEED_PRINCIPAL_MANAGER_PROVIDER);
+    }
+
     protected PasswordCredential getCredential(User user) throws SecurityException
-    {        
-    	return getUserManager().getPasswordCredential(user);
-    	/*PasswordCredential credential = null;
-        
-        Set credentials = user.getSubject().getPrivateCredentials();
-        Iterator iter = credentials.iterator();
-        
-        while (iter.hasNext())
-        {
-            Object o = iter.next();
-            
-            if (o instanceof PasswordCredential)
-            {
-                credential = (PasswordCredential)o;
-                break;
-            }
-        }
-        
-        return credential;*/
+    {
+        return getUserManager().getPasswordCredential(user);
+        /*
+         * PasswordCredential credential = null; Set credentials = user.getSubject().getPrivateCredentials();
Iterator iter = credentials.iterator(); while
+         * (iter.hasNext()) { Object o = iter.next(); if (o instanceof PasswordCredential)
{ credential = (PasswordCredential)o; break; } } return credential;
+         */
     }
 
     protected String getIPAddress()
     {
-        org.apache.jetspeed.request.RequestContext context = (org.apache.jetspeed.request.RequestContext)
getPortletRequest().getAttribute(PortalReservedParameters.REQUEST_CONTEXT_ATTRIBUTE);
-        
+        org.apache.jetspeed.request.RequestContext context = (org.apache.jetspeed.request.RequestContext)
getPortletRequest()
+                                                                                        
                                    .getAttribute(
+                                                                                        
                                                  PortalReservedParameters.REQUEST_CONTEXT_ATTRIBUTE);
         return (context == null ? "" : context.getRequest().getRemoteAddr());
     }
-    
 }
\ 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