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 we...@apache.org on 2003/11/03 18:43:26 UTC

cvs commit: jakarta-jetspeed/src/java/org/apache/jetspeed/om/profile BaseProfileLocator.java

weaver      2003/11/03 09:43:26

  Modified:    src/java/org/apache/jetspeed/om/profile
                        BaseProfileLocator.java
  Log:
  Make the BaseprofileLocator a little more tolerant.  If a user, group or role
  does not exist in/has been removed from the security store but still exists
  within the PSML, it can still be located.
  
  Revision  Changes    Path
  1.19      +19 -6     jakarta-jetspeed/src/java/org/apache/jetspeed/om/profile/BaseProfileLocator.java
  
  Index: BaseProfileLocator.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/om/profile/BaseProfileLocator.java,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- BaseProfileLocator.java	23 Jul 2003 19:50:14 -0000	1.18
  +++ BaseProfileLocator.java	3 Nov 2003 17:43:26 -0000	1.19
  @@ -89,6 +89,10 @@
       private Role   role = null;
       private Group  group = null;
       private boolean anonymous = false;
  +    
  +    private String roleName = null;
  +    private String userName = null;
  +    private String groupName = null;
   
       private static final String DELIM = "/";
   
  @@ -242,7 +246,10 @@
               {
                   try
                   {
  -                    this.setUser( JetspeedSecurity.getUser(tok.nextToken()) );
  +                    // keep profile locator from failing if the user has been removed
  +				    // from security as it may still exist in the PSML structure.
  +                	this.userName = tok.nextToken();
  +                    this.setUser( JetspeedSecurity.getUser(this.userName) );
                   }
                   catch (Exception e)
                   {
  @@ -253,7 +260,10 @@
               {
                   try
                   {
  -                    this.setGroup( JetspeedSecurity.getGroup(tok.nextToken()) );
  +                    // keep profile locator from failing if the group has been removed
  +				    // from security as it may still exist in the PSML structure.
  +                	this.groupName = tok.nextToken();
  +                    this.setGroup( JetspeedSecurity.getGroup(this.groupName) );
                   }
                   catch (Exception e)
                   {
  @@ -264,6 +274,9 @@
               {
                   try
                   {
  +                	// keep profile locator from failing if the role has been removed
  +                	// from security as it may still exist in the PSML structure.
  +					this.roleName = tok.nextToken();
                       this.setRole( JetspeedSecurity.getRole(tok.nextToken()) );
                   }
                   catch (Exception e)
  @@ -437,7 +450,7 @@
       public String getUserName()
       {
           if (null == user)
  -            return null;
  +            return userName;
   
           return user.getUserName();
       }
  @@ -465,7 +478,7 @@
       public String getRoleName()
       {
           if (null == role)
  -            return null;
  +            return roleName;
   
           return role.getName();
       }
  @@ -509,7 +522,7 @@
       public String getGroupName()
       {
           if (null == group)
  -            return null;
  +            return groupName;
   
           return group.getName();
       }
  
  
  

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