Package org.jasig.portal.security.provider

Examples of org.jasig.portal.security.provider.PersonImpl


          pstmt = con.prepareStatement("SELECT USER_DFLT_USR_ID FROM UP_USER WHERE USER_ID=?");
          pstmt.setInt(1, person.getID());
          rs = pstmt.executeQuery();
          if(rs.next()) {
            int defaultProfileUser = rs.getInt(1);
            IPerson defaultProfilePerson = new PersonImpl();
            defaultProfilePerson.setID(defaultProfileUser);
            if(defaultProfilePerson.getID() != person.getID()) {
              UserProfile templateProfile = getUserProfileByFname(defaultProfilePerson,profileFname);
              if(templateProfile != null) {
                  final UserProfile newUserProfile = new UserProfile(templateProfile);
                  newUserProfile.setLayoutId(0);
                return addUserProfile(person,newUserProfile);
View Full Code Here


                if (userView != null) {
                    int userId  = userView.getUserId();
   
                    if ( null != ownerId )
                    {
                        IPerson p = new PersonImpl();
                        p.setID( userId );
                        p.setAttribute( "username", ownerId );
                        owners.put(p, fragmentDefinition);
                    }
                }
            }
View Full Code Here

       
        String ownerUsername = layout.valueOf("@username");
        IPerson person = null;
        UserProfile profile = null;
        try {
            person = new PersonImpl();
            person.setUserName(ownerUsername);
            int ownerId = identityStore.getPortalUID(person);
            if (ownerId == -1) {
                String msg = "No userId for username=" + ownerUsername;
                throw new RuntimeException(msg);
View Full Code Here

                        rs.next();
                        userId = rs.getInt(1);
                       
                        // get the profile ID for the default user
                        UserProfile profile = getUserProfileById(person, profileId);
                    IPerson defaultProfilePerson = new PersonImpl();
                    defaultProfilePerson.setID(userId);
                        profileId = getUserProfileByFname(defaultProfilePerson, profile.getProfileFname()).getProfileId();

                    } finally {
                        close(rs);
                    }
View Full Code Here

                        rs.next();
                        userId = rs.getInt(1);
                       
                        // get the profile ID for the default user
                        UserProfile profile = getUserProfileById(person, profileId);
                    IPerson defaultProfilePerson = new PersonImpl();
                    defaultProfilePerson.setID(userId);
                        profileId = getUserProfileByFname(defaultProfilePerson, profile.getProfileFname()).getProfileId();

                    } finally
                    {
                        close(rs);
View Full Code Here

      }
  }// setUserPassword

  public void removeUser( IPerson AnIndividual ) throws Exception {

       IPerson per= new PersonImpl();
       per.setAttribute(IPerson.USERNAME, AnIndividual.getAttribute( Constants.UNFIELD ));

       int portalUID = -1;
       try{
          portalUID = rdbmuser.getPortalUID(per, false);
       }catch(org.jasig.portal.AuthorizationException ae) { /* do nothing */ }
View Full Code Here

     Vector v = new Vector();
     IPerson person = null;

     while( R.next() ){

       person = new PersonImpl();

       for( int i = 1; i <= R.getMetaData().getColumnCount(); i++ ) {

           if( R.getMetaData().getColumnType( i ) != Types.TIMESTAMP )
             person.setAttribute(
                   R.getMetaData().getColumnName( i ).toLowerCase(),
                      (R.getString( i )==null?"":R.getString( i )));
            else
             person.setAttribute(
                   R.getMetaData().getColumnName( i ).toLowerCase(),
                      (R.getString( i )==null?"": RDBMServices.getDbMetaData().sqlTimeStamp(
                         new java.util.Date( R.getTimestamp( i ).getTime()) )));

       }// for

       v.addElement( person );
     }// while

     IPerson pwdtst = null;
     IPerson[] people = new IPerson[ v.size() ];
     for( int i = 0; i < people.length; i++ ) {
       people[ i ] = (IPerson)v.elementAt( i );

       // if the user exists but has no layout information, the account
       // is considered to be locked, this is technically inaccurate
       try{
         pwdtst = new PersonImpl();

         pwdtst.setAttribute( IPerson.USERNAME,
              people[ i ].getAttribute( Constants.UNFIELD ));

         rdbmuser.getPortalUID( pwdtst, false );
View Full Code Here

@Deprecated
public class ChannelRuntimeDataToPersonConverter {

    public IPerson channelRuntimeDataToPerson( ChannelRuntimeData channelRuntimeData ) {

        IPerson newborn = new PersonImpl();
       
        for (String channelRuntimeDataParameterName : channelRuntimeData.getParameters().keySet()) {
          if (! channelRuntimeDataParameterName.equals(Constants.FORMACTION)) {
            String paramValue = channelRuntimeData.getParameter(channelRuntimeDataParameterName);
            // this null handling is required becausee PersonImpl is a HashTable
            // which does not allow null user attribute values
            if (paramValue == null) {
              paramValue = "";
            }
            newborn.setAttribute(channelRuntimeDataParameterName, paramValue);
          }
        }
      
        return newborn;
    }// crd2persion
View Full Code Here

        dls.setUserLayout(owner, profile, view.layout, true, false);
    }

    private IPerson bindToOwner( FragmentDefinition fragment )
    {
        IPerson owner = new PersonImpl();
        owner.setAttribute( "username", fragment.getOwnerId() );
        int userID = -1;
       
        try
        {
            userID = identityStore.getPortalUID( owner, false );
        }
        catch( AuthorizationException ae )
        {
            // current implementation of RDMBUserIdentityStore throws an
            // auth exception if the user doesn't exist even if
            // create data is false as we have it here. So this exception
            // can be discarded since we check for the userID being -1
            // meaning that the user wasn't found to trigger creating
            // that user.
        }
        if (userID == -1)
        {
            userID = createOwner( owner, fragment );
            owner.setAttribute("newlyCreated", "" + (userID != -1));
        }

        owner.setID(userID);
        return owner;
    }
View Full Code Here

    {
        // if fragment not bound to user can't return any preferences.
        if ( view.getUserId() == -1 )
            return;

        IPerson p = new PersonImpl();
        p.setID( view.getUserId() );
        p.setAttribute( "username", fragment.getOwnerId() );

        try
        {
            view.structUserPrefs = dls.getDistributedSSUP(p, view.profileId,
                    view.structureStylesheetId);
View Full Code Here

TOP

Related Classes of org.jasig.portal.security.provider.PersonImpl

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.