Examples of BaseUser


Examples of org.atricore.idbus.kernel.main.authn.BaseUser

   }

   public BaseUser loadUser(UserKey userKey) throws NoSuchUserException,
         SSOIdentityException
   {
      BaseUser user = new BaseUserImpl();
      user.setName(userKey.toString());
      return user;
   }
View Full Code Here

Examples of org.josso.gateway.identity.service.BaseUser

  }

  public BaseUser loadUser(UserKey userKey) throws NoSuchUserException,
      SSOIdentityException
  {   
    BaseUser user = new BaseUserImpl();
    user.setName(userKey.toString());
    return user;
  }
View Full Code Here

Examples of org.josso.gateway.identity.service.BaseUser

  }

  public BaseUser loadUser(UserKey userKey) throws NoSuchUserException,
      SSOIdentityException
  {   
    BaseUser user = new BaseUserImpl();
    user.setName(userKey.toString());
    return user;
  }
View Full Code Here

Examples of org.josso.gateway.identity.service.BaseUser

      {
         throw new IllegalStateException("JOSSOIdentityStore not properly registered with the JOSSO system..");
      }
     
      //Map the Portal Identity to JOSSO Identity
      BaseUser user = new BaseUserImpl();
      user.setName(userKey.toString());
      user.addProperty("password", "");
     
      return user;
   }  
View Full Code Here

Examples of org.josso.gateway.identity.service.BaseUser

      {
         throw new IllegalStateException("JOSSOIdentityStore not properly registered with the JOSSO system..");
      }
     
      //Get the User corresponding to this credentialKey
      BaseUser user = this.loadUser((SimpleUserKey)credentialKey);
      SSONameValuePair[] properties = user.getProperties();
      String password = properties[0].getValue();
     
      return new Credential[]{new UsernameCredential(user.getName()), new PasswordCredential(password)};
   }
View Full Code Here

Examples of org.opentides.bean.user.BaseUser

    _log.debug("saving widget order...");
    //TODO: 1. validation in parsing the string order (valid, widget exists, proper format, etc)
    //    2. acegi security
   
    String order = req.getParameter("order");
    BaseUser user = userService.load(SecurityUtil.getSessionUser().getRealId());
    String[] col = order.split("\\|");
    int countCol = 1;
    for (int i=0;i<col.length;i++) {
      String[] widget = col[i].split(",");
      int countRow = 1;
View Full Code Here

Examples of org.opentides.bean.user.BaseUser

    String status = req.getParameter("status");
    //must be a valid state before processing the code...
    if (status.equals(""+WidgetService.WIDGET_STATUS_MINIMIZE) || status.equals(""+WidgetService.WIDGET_STATUS_SHOW)
        || status.equals(""+WidgetService.WIDGET_STATUS_REMOVE)) {
      String widgetName = req.getParameter("widgetName");
      BaseUser user = userService.load(SecurityUtil.getSessionUser().getRealId());
      UserWidgets userWidgets = userWidgetsService.findSpecificUserWidgets(user, widgetName);
      if (userWidgets != null) {
        try {
          Integer statusNum = Integer.parseInt(status);
          userWidgetsService.updateUserWidgetsStatus(userWidgets, statusNum);
View Full Code Here

Examples of org.opentides.bean.user.BaseUser

    Session session=null;
    try {
      session = HibernateUtil.getSessionFactory().openSession();
      Object object = session.load(log.getEntityClass(), log.getEntityId());
      log.setObject(object);
            BaseUser user = (BaseUser)session.load(BaseUser.class, log.getUserId());
            log.setUser(user.cloneUserProfile());
    } catch (Throwable e) {
      _log.error(e, e);
    } finally {
      if (session!=null) session.close();
    }
View Full Code Here

Examples of org.opentides.bean.user.BaseUser

    }
 
  @Test
  public void testAddUser() {
    BaseUser user = new BaseUser();
    user.addGroup(group1);
    user.setFirstName("John");
    user.setLastName("Doe");
    user.setEmailAddress("johndoe@unittest.com");
    UserCredential userAccount = new UserCredential();
    userAccount.setPassword("unittest");
    userAccount.setUsername("jdoe");
    userAccount.setUser(user);
    user.setCredential(userAccount);
    coreUserDAO.saveEntityModel(user);
    // ensure user is saved and has id
    assertNotNull(user.getId());
    assertEquals( 1, jdbcTemplate.queryForInt("select count(*) from USER_PROFILE where EMAIL='johndoe@unittest.com'"));
    long userId = user.getId();
   
    Map result = jdbcTemplate.queryForMap("select * from USER_PROFILE where ID=?", new Object[]{userId});
    assertEquals("John",result.get("FIRSTNAME"));
    assertEquals("Doe",result.get("LASTNAME"));
    assertEquals("johndoe@unittest.com",result.get("EMAIL"));

    Map cred = jdbcTemplate.queryForMap("select * from USERS where USERID=?", new Object[]{userId});
    assertEquals("jdoe",cred.get("USERNAME"));
    assertEquals("unittest",cred.get("PASSWORD"))
   
    // add user group
    BaseUser testUser = coreUserDAO.loadEntityModel(user.getId());
    Set<UserGroup> groups = testUser.getGroups();
    assertNotNull(groups);
    assertTrue(groups.size() == 1);
    assertTrue(groups.iterator().next().getId().equals(group1.getId()));
   
    // remove user group
    testUser.removeGroup(group1);
    coreUserDAO.saveEntityModel(testUser);
    BaseUser testUser2 = coreUserDAO.loadEntityModel(testUser.getId());
    assertTrue(testUser2.getGroups().size() == 0);
   
    // remove user
    int id = jdbcTemplate.queryForInt("select id from USER_PROFILE where EMAIL='johndoe@unittest.com'");
    coreUserDAO.deleteEntityModel(user.getId());
    assertEquals(0, jdbcTemplate.queryForInt("select count(*) from USER_PROFILE where ID="+user.getId()));
View Full Code Here

Examples of org.opentides.bean.user.BaseUser

        assertEquals(false, coreUserDAO.isRegisteredByEmail("test@missing.com"));
  }
 
  @Test
    public void testLoadByUsername() {
      BaseUser user = coreUserDAO.loadByUsername("admin");
        assertEquals("SuperAdmin", user.getFirstName());
        assertEquals("User", user.getLastName());       
        assertEquals(null, coreUserDAO.loadByUsername("missing"));
    assertNull(coreUserDAO.loadByUsername(""));
    assertNull(coreUserDAO.loadByUsername(null));
       
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.