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/08/11 23:24:59 UTC

cvs commit: jakarta-jetspeed/fusion/src/java/org/apache/jetspeed/fusion/userinfo/impl FusionUserInfoManagerImpl.java

taylor      2004/08/11 14:24:59

  Added:       fusion/src/java/org/apache/jetspeed/fusion/userinfo/impl
                        FusionUserInfoManagerImpl.java
  Log:
  Start of support in Fusion for PLT.17 - User Attributes
  
  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.1                  jakarta-jetspeed/fusion/src/java/org/apache/jetspeed/fusion/userinfo/impl/FusionUserInfoManagerImpl.java
  
  Index: FusionUserInfoManagerImpl.java
  ===================================================================
  /* Copyright 2004 Apache Software Foundation
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
  *     http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
  package org.apache.jetspeed.fusion.userinfo.impl;
  
  import java.util.HashMap;
  import java.util.Map;
  
  import org.apache.jetspeed.om.security.JetspeedUser;
  import org.apache.jetspeed.request.RequestContext;
  import org.apache.jetspeed.services.rundata.JetspeedRunData;
  import org.apache.jetspeed.services.rundata.JetspeedRunDataService;
  import org.apache.jetspeed.userinfo.UserInfoManager;
  import org.apache.pluto.om.common.ObjectID;
  import org.apache.turbine.services.rundata.RunDataService;
  import org.apache.turbine.services.TurbineServices;
  
  
  /**
   * <p>
   * Implements the {@link org.apache.jetspeed.userinfo.UserInfoManager}
   * interface with a J1/Turbine (JetspeedUser) mapping to JSR 168 User Attributes
   * See Portlet API Specification -- PLT.D Appendix for details on User Attribute naming.
   * </p>
   * 
   * @author <a href="mailto:taylorapache.org">David Sean Taylor</a>
   * @version $Id: FusionUserInfoManagerImpl.java,v 1.1 2004/08/11 21:24:59 taylor Exp $
   */
  public class FusionUserInfoManagerImpl implements UserInfoManager
  {
      private JetspeedRunDataService runDataService = null;
      
      public FusionUserInfoManagerImpl()
      {        
      }
      
      /* (non-Javadoc)
       * @see org.apache.jetspeed.userinfo.UserInfoManager#getUserInfoMap(org.apache.pluto.om.common.ObjectID, org.apache.jetspeed.request.RequestContext)
       */
      public Map getUserInfoMap(ObjectID oid, RequestContext context)
      {
          System.out.println("-- Getting User INFO via Fusion/JetspeedUser");
          JetspeedRunData rundata = getRunDataService().getCurrentRunData();
          
          JetspeedUser user = rundata.getJetspeedUser();
          if (user == null)
          {
              return null;
          }
          
          Map map = new HashMap();
          map.put("user.name.given", "Taylor");
          map.put("user.name.family", "Family");
          map.put("user.name.nickName", "Nick");
          return map;
      }
  
      private JetspeedRunDataService getRunDataService()
      {
          if (runDataService == null)
          {
              runDataService =
                  (JetspeedRunDataService) TurbineServices.getInstance().getService(RunDataService.SERVICE_NAME);
          }
          return runDataService;
      }
  }
  
  
  

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