You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-dev@portals.apache.org by ta...@apache.org on 2004/12/22 18:49:19 UTC
cvs commit: jakarta-jetspeed-2/applications/pam/src/java/org/apache/jetspeed/portlets/pam/beans TabBean.java
taylor 2004/12/22 09:49:18
Modified: applications/pam/src/java/org/apache/jetspeed/portlets/security/users
UserManagerPortlet.java
applications/pam/src/java/org/apache/jetspeed/portlets/pam
PortletApplicationBrowser.java
PortletApplicationDetail.java
PortletApplicationResources.java
applications/pam/src/webapp/WEB-INF portlet.xml
applications/pam/src/java/org/apache/jetspeed/portlets/site
SiteDetailPortlet.java
Removed: applications/pam/src/webapp/WEB-INF/view user-browser.jsp
user-details.jsp
applications/pam/src/java/org/apache/jetspeed/portlets/security/users
UserData.java TabbedPaneBean.java UserBean.java
JetspeedUserBean.java
applications/pam/src/java/org/apache/jetspeed/portlets/security
UserBrowserPortlet.java UserDetailsPortlet.java
applications/pam/src/java/org/apache/jetspeed/portlets/security/resources
SecurityResources_it.properties
SecurityResources_zh.properties
SecurityResources.properties
SecurityResources_en.properties
SecurityResources_ja.properties
applications/pam/src/java/org/apache/jetspeed/portlets/pam/beans
TabBean.java
Log:
http://nagoya.apache.org/jira/browse/JS2-175
Ive moved the User Browser and Details portlet into the security application
since the Role portlet will need to interact with the user portlets
and it makes more sense having all of these security portlets in the same portlet app
PR:
CVS: ----------------------------------------------------------------------
CVS: PR:
CVS: If this change addresses a PR in the problem report tracking
CVS: database, then enter the PR number(s) here.
CVS: Obtained from:
CVS: If this change has been taken from another system, such as NCSA,
CVS: then name the system in this line, otherwise delete it.
CVS: Submitted by:
CVS: If this code has been contributed to Apache by someone else; i.e.,
CVS: they sent us a patch or a new module, then include their name/email
CVS: address here. If this is your work then delete this line.
CVS: Reviewed by:
CVS: If we are doing pre-commit code reviews and someone else has
CVS: reviewed your changes, include their name(s) here.
CVS: If you have not had it reviewed then delete this line.
Revision Changes Path
1.7 +42 -50 jakarta-jetspeed-2/applications/pam/src/java/org/apache/jetspeed/portlets/security/users/UserManagerPortlet.java
Index: UserManagerPortlet.java
===================================================================
RCS file: /home/cvs/jakarta-jetspeed-2/applications/pam/src/java/org/apache/jetspeed/portlets/security/users/UserManagerPortlet.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- UserManagerPortlet.java 15 Oct 2004 22:58:43 -0000 1.6
+++ UserManagerPortlet.java 22 Dec 2004 17:49:18 -0000 1.7
@@ -36,56 +36,48 @@
* @author <a href="mailto:taylor@apache.org">David Sean Taylor </a>
* @version $Id$
*/
-public class UserManagerPortlet extends FacesPortlet
-{
- private UserManager userManager;
+public class UserManagerPortlet extends FacesPortlet {
+ private UserManager userManager;
- public void init(PortletConfig config) throws PortletException
- {
- super.init(config);
- userManager = (UserManager) getPortletContext().getAttribute(
- PortletApplicationResources.CPS_USER_MANAGER_COMPONENT);
- if (null == userManager)
- {
- throw new PortletException("Failed to find the User Manager on portlet initialization");
- }
- System.out.println("user manager = " + userManager);
- try
- {
- Iterator users = userManager.getUsers("");
- while (users.hasNext())
- {
- User user = (User) users.next();
- System.out.println("++++ User = " + user);
- Principal principal = getPrincipal(user.getSubject(), UserPrincipal.class);
- System.out.println("principal = " + principal.getName());
- }
- }
- catch (SecurityException se)
- {
- throw new PortletException(se);
- }
- }
+ public void init(PortletConfig config) throws PortletException {
+ super.init(config);
+ userManager = (UserManager) getPortletContext().getAttribute(
+ PortletApplicationResources.CPS_USER_MANAGER_COMPONENT);
+ if (null == userManager) {
+ throw new PortletException(
+ "Failed to find the User Manager on portlet initialization");
+ }
+ System.out.println("user manager = " + userManager);
+ try {
+ Iterator users = userManager.getUsers("");
+ while (users.hasNext()) {
+ User user = (User) users.next();
+ System.out.println("++++ User = " + user);
+ Principal principal = getPrincipal(user.getSubject(),
+ UserPrincipal.class);
+ System.out.println("principal = " + principal.getName());
+ }
+ } catch (SecurityException se) {
+ throw new PortletException(se);
+ }
+ }
- protected void preProcessFaces(FacesContext context)
- {
- System.out.println("*** pre processing faces for user manager: " + context);
- }
-
- public Principal getPrincipal(Subject subject, Class classe)
- {
- Principal principal = null;
- Iterator principals = subject.getPrincipals().iterator();
- while (principals.hasNext())
- {
- Principal p = (Principal) principals.next();
- if (classe.isInstance(p))
- {
- principal = p;
- break;
- }
- }
- return principal;
- }
+ protected void preProcessFaces(FacesContext context) {
+ System.out.println("*** pre processing faces for user manager: "
+ + context);
+ }
+
+ public Principal getPrincipal(Subject subject, Class classe) {
+ Principal principal = null;
+ Iterator principals = subject.getPrincipals().iterator();
+ while (principals.hasNext()) {
+ Principal p = (Principal) principals.next();
+ if (classe.isInstance(p)) {
+ principal = p;
+ break;
+ }
+ }
+ return principal;
+ }
}
1.19 +2 -2 jakarta-jetspeed-2/applications/pam/src/java/org/apache/jetspeed/portlets/pam/PortletApplicationBrowser.java
Index: PortletApplicationBrowser.java
===================================================================
RCS file: /home/cvs/jakarta-jetspeed-2/applications/pam/src/java/org/apache/jetspeed/portlets/pam/PortletApplicationBrowser.java,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- PortletApplicationBrowser.java 3 Nov 2004 17:50:51 -0000 1.18
+++ PortletApplicationBrowser.java 22 Dec 2004 17:49:18 -0000 1.19
@@ -33,10 +33,10 @@
import org.apache.jetspeed.components.portletregistry.PortletRegistry;
import org.apache.jetspeed.om.common.portlet.MutablePortletApplication;
import org.apache.jetspeed.om.common.portlet.PortletDefinitionComposite;
-import org.apache.jetspeed.portlets.pam.beans.TabBean;
import org.apache.jetspeed.search.SearchEngine;
import org.apache.jetspeed.search.SearchResults;
import org.apache.pluto.om.portlet.PortletDefinition;
+import org.apache.portals.bridges.beans.TabBean;
import org.apache.portals.bridges.common.GenericServletPortlet;
import org.apache.webapp.admin.TreeControl;
import org.apache.webapp.admin.TreeControlNode;
1.36 +2 -2 jakarta-jetspeed-2/applications/pam/src/java/org/apache/jetspeed/portlets/pam/PortletApplicationDetail.java
Index: PortletApplicationDetail.java
===================================================================
RCS file: /home/cvs/jakarta-jetspeed-2/applications/pam/src/java/org/apache/jetspeed/portlets/pam/PortletApplicationDetail.java,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -r1.35 -r1.36
--- PortletApplicationDetail.java 29 Oct 2004 13:43:15 -0000 1.35
+++ PortletApplicationDetail.java 22 Dec 2004 17:49:18 -0000 1.36
@@ -49,10 +49,10 @@
import org.apache.jetspeed.om.common.portlet.PortletDefinitionComposite;
import org.apache.jetspeed.om.common.preference.PreferenceComposite;
import org.apache.jetspeed.portlets.pam.beans.PortletApplicationBean;
-import org.apache.jetspeed.portlets.pam.beans.TabBean;
import org.apache.pluto.om.common.DescriptionSet;
import org.apache.pluto.om.common.SecurityRoleRef;
import org.apache.pluto.om.portlet.ContentType;
+import org.apache.portals.bridges.beans.TabBean;
import org.apache.portals.bridges.common.GenericServletPortlet;
/**
1.15 +11 -13 jakarta-jetspeed-2/applications/pam/src/java/org/apache/jetspeed/portlets/pam/PortletApplicationResources.java
Index: PortletApplicationResources.java
===================================================================
RCS file: /home/cvs/jakarta-jetspeed-2/applications/pam/src/java/org/apache/jetspeed/portlets/pam/PortletApplicationResources.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- PortletApplicationResources.java 26 Nov 2004 18:33:12 -0000 1.14
+++ PortletApplicationResources.java 22 Dec 2004 17:49:18 -0000 1.15
@@ -21,8 +21,17 @@
* @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
* @version $Id$
*/
-public final class PortletApplicationResources
+public interface PortletApplicationResources
{
+ public final static String CPS_SEARCH_COMPONENT = "cps:SearchComponent";
+ public final static String CPS_REGISTRY_COMPONENT = "cps:PortletRegistryComponent";
+ public final static String CPS_USER_MANAGER_COMPONENT = "cps:UserManager";
+ public final static String CPS_PAGE_MANAGER_COMPONENT = "cps:PageManager";
+ public final static String CPS_ROLE_MANAGER_COMPONENT = "cps:RoleManager";
+ public final static String CPS_GROUP_MANAGER_COMPONENT = "cps:GroupManager";
+ public final static String CPS_PROFILER_COMPONENT = "cps:Profiler";
+ public final static String CPS_SSO_COMPONENT = "cps:SSO";
+
/** the selected non-leaf node in the tree view */
public final static String REQUEST_NODE = "node";
/** the selected leaf node in the tree view */
@@ -32,19 +41,8 @@
public final static String REQUEST_SELECT_PORTLET = "select_portlet";
public final static String REQUEST_SELECT_TAB = "selected_tab";
public final static String PAM_CURRENT_PA = "org.apache.jetspeed.pam.pa";
- public final static String CPS_SEARCH_COMPONENT = "cps:SearchComponent";
- public final static String CPS_REGISTRY_COMPONENT = "cps:PortletRegistryComponent";
- public final static String CPS_USER_MANAGER_COMPONENT = "cps:UserManager";
- public final static String CPS_PAGE_MANAGER_COMPONENT = "cps:PageManager";
- public final static String CPS_ROLE_MANAGER_COMPONENT = "cps:RoleManager";
- public final static String CPS_GROUP_MANAGER_COMPONENT = "cps:GroupManager";
- public final static String CPS_PROFILER_COMPONENT = "cps:Profiler";
- public final static String CPS_SSO_COMPONENT = "cps:SSO";
public final static String CURRENT_FOLDER = "current_folder";
public final static String CURRENT_PAGE = "current_page";
- public final static String CURRENT_USER = "current_user";
- public final static String PAM_CURRENT_USER = "org.apache.jetspeed.pam.user";
- public final static String REQUEST_SELECT_USER = "select_user";
public final static String PORTLET_ACTION = "portlet_action";
public final static String REQUEST_SELECT_SITE_TAB = "selected_site_tab";
public final static String SITE_PORTLET = "SitePortlet";
1.17 +3 -55 jakarta-jetspeed-2/applications/pam/src/webapp/WEB-INF/portlet.xml
Index: portlet.xml
===================================================================
RCS file: /home/cvs/jakarta-jetspeed-2/applications/pam/src/webapp/WEB-INF/portlet.xml,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- portlet.xml 19 Nov 2004 21:53:12 -0000 1.16
+++ portlet.xml 22 Dec 2004 17:49:18 -0000 1.17
@@ -196,9 +196,9 @@
<portlet id="JetspeedUserAdmin">
<init-param>
- <description>This parameter sets the template used in view mode.</description>
- <name>ViewPage</name>
- <value>/WEB-INF/view/user-admin.jsp</value>
+ <description>This parameter sets the template used in view mode.</description>
+ <name>ViewPage</name>
+ <value>/WEB-INF/view/user-admin.jsp</value>
</init-param>
<portlet-name>JetspeedUserAdmin</portlet-name>
<display-name>User Administration</display-name>
@@ -217,58 +217,6 @@
<keywords>admin,security,users</keywords>
</portlet-info>
</portlet>
-
-<portlet id="UserBrowserPortlet">
- <init-param>
- <description>This parameter sets the template used in view mode.</description>
- <name>ViewPage</name>
- <value>/WEB-INF/view/user-browser.jsp</value>
- </init-param>
- <portlet-name>UserBrowserPortlet</portlet-name>
- <display-name>User Browser</display-name>
- <description>The User Browser displays a list of users managed in this portal. From here you can add, edit, and users.</description>
- <portlet-class>org.apache.jetspeed.portlets.security.UserBrowserPortlet</portlet-class>
- <expiration-cache>-1</expiration-cache>
- <supports>
- <mime-type>text/html</mime-type>
- <portlet-mode>EDIT</portlet-mode>
- <portlet-mode>VIEW</portlet-mode>
- <portlet-mode>HELP</portlet-mode>
- </supports>
- <supported-locale>en</supported-locale>
- <resource-bundle>org.apache.jetspeed.portlets.security.resources.SecurityResources</resource-bundle>
- <portlet-info>
- <title>User Browser</title>
- <short-title>Users</short-title>
- <keywords>admin,security,users</keywords>
- </portlet-info>
- </portlet>
-
-<portlet id="UserDetailsPortlet">
- <init-param>
- <description>This parameter sets the template used in view mode.</description>
- <name>ViewPage</name>
- <value>/WEB-INF/view/user-details.jsp</value>
- </init-param>
- <portlet-name>UserDetailsPortlet</portlet-name>
- <display-name>User Information</display-name>
- <description>The User Details portlet displays a users details in a tabbed view. From here you can add, edit, and user information.</description>
- <portlet-class>org.apache.jetspeed.portlets.security.UserDetailsPortlet</portlet-class>
- <expiration-cache>-1</expiration-cache>
- <supports>
- <mime-type>text/html</mime-type>
- <portlet-mode>EDIT</portlet-mode>
- <portlet-mode>VIEW</portlet-mode>
- <portlet-mode>HELP</portlet-mode>
- </supports>
- <supported-locale>en</supported-locale>
- <resource-bundle>org.apache.jetspeed.portlets.security.resources.SecurityResources</resource-bundle>
- <portlet-info>
- <title>User Detail Information</title>
- <short-title>User</short-title>
- <keywords>admin,security,users</keywords>
- </portlet-info>
- </portlet>
</portlet-app>
1.9 +2 -2 jakarta-jetspeed-2/applications/pam/src/java/org/apache/jetspeed/portlets/site/SiteDetailPortlet.java
Index: SiteDetailPortlet.java
===================================================================
RCS file: /home/cvs/jakarta-jetspeed-2/applications/pam/src/java/org/apache/jetspeed/portlets/site/SiteDetailPortlet.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- SiteDetailPortlet.java 19 Nov 2004 03:09:06 -0000 1.8
+++ SiteDetailPortlet.java 22 Dec 2004 17:49:18 -0000 1.9
@@ -37,7 +37,7 @@
import org.apache.jetspeed.page.document.NodeException;
import org.apache.jetspeed.page.document.NodeNotFoundException;
import org.apache.jetspeed.portlets.pam.PortletApplicationResources;
-import org.apache.jetspeed.portlets.pam.beans.TabBean;
+import org.apache.portals.bridges.beans.TabBean;
import org.apache.portals.bridges.common.GenericServletPortlet;
/**
---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-dev-help@jakarta.apache.org