Examples of UserKey


Examples of org.openqreg.bean.UserKey

      con.setAutoCommit(false);
     
      UserBean user1 = BeanFactory.getUser(Thread.currentThread().getId());
      user1.setAttribute("name1", "value1");
      user1.create(con);
      UserBean user2 = (UserBean)UserFinderBase.findByPrimaryKey(con, new UserKey(user1.getId()));
      assertEquals("Userna skall vara lika", user1, user2);
      con.rollback();
      con.close();
    } catch (SQLException sqle) {
      fail("SQLException on testEquals: "+ sqle.getMessage());
View Full Code Here

Examples of org.openqreg.bean.UserKey

      //Spara och ladda attribut
      UserBean user1 = BeanFactory.getUser(Thread.currentThread().getId());
      user1.setAttribute("name1", "value1");
      user1.create(con);
      UserBean user2 = (UserBean)UserFinderBase.findByPrimaryKey(con, new UserKey(user1.getId()));
      assertEquals("Attributen skall vara lika", user1.getAttribute("name1"), user2.getAttribute("name1"));
     
      //Radera attribut
      user2.removeAttribute("name1");
      assertNull("Attributet skall inte finnas", user2.getAttribute("name1"));
      user2.store(con);
      user1 = (UserBean)UserFinderBase.findByPrimaryKey(con, new UserKey(user2.getId()));
      assertNull("Attributet skall inte finnas", user2.getAttribute("name1"));

      //Uppdatera attribut
      user1.setAttribute("name1", "value1");
      user1.store(con);
      user1.setAttribute("name1", "newvalue1");
      user1.store(con);
      user2 = (UserBean)UserFinderBase.findByPrimaryKey(con, new UserKey(user1.getId()));
      assertEquals("Attributet skall ha nytt v�rde", "newvalue1", user2.getAttribute("name1"));
      user2.removeAllAttributes();
      user2.store(con);
     
      //Skapa tre attribut, d�refter uppdatera ett och radera ett
      assertTrue("Det skall inte finnas n�gra attribut", user2.getAttributes().isEmpty());
      user2.setAttribute("name1", "value1");
      user2.setAttribute("name2", "value2");
      user2.setAttribute("name3", "value3");
      user2.store(con);
     
      user2.setAttribute("name1", "newvalue1");
      user2.setAttribute("name3", "");
      user2.removeAttribute("name2");
      assertEquals("Det skall finnas tv� attribut", 2, user2.getAttributes().size());
      user2.store(con);
     
      user1 = (UserBean)UserFinderBase.findByPrimaryKey(con, new UserKey(user2.getId()));
      assertEquals("Det skall finnas ett attribut", 1, user1.getAttributes().size());
      assertEquals("Fel attributv�rde", "newvalue1", user1.getAttribute("name1"));
      assertNull("Attributet skall inte finnas", user1.getAttribute("name2"));
      assertNull("Attributet skall inte finnas", user1.getAttribute("name3"));
     
      user1.remove(con);
      user2 = (UserBean)UserFinderBase.findByPrimaryKey(con, new UserKey(user1.getId()));
      assertNull("User skall inte finnas", user2);
      con.rollback();
      con.close();
     
    }catch(SQLException sqle){
View Full Code Here

Examples of org.openqreg.bean.UserKey

      return;
    }

    // tempUser = the user we are inviting
    User tempUser = (User) UserFinderBase.findByPrimaryKey(con,
        new UserKey(userId));

    // user does not exist
    if (tempUser == null) {
      ucrBean = null;
      message = lang.getTranslation(langId,
View Full Code Here

Examples of org.openqreg.bean.UserKey

    Connection con = null;
    try {
      con = DbHandler.getConnection();
      con.setAutoCommit(false);
      UserBean user = (UserBean) UserFinderBase.findByPrimaryKey(new UserKey("System"));

      UsergroupBean ug1 = new UsergroupBean();
      ug1.setId("JUnit@Master1");
      ug1.setDescription("JUnit@Master1");
      ug1.setUseucr(Integer.valueOf(0));
View Full Code Here

Examples of org.openqreg.bean.UserKey

        for (String uId : fileShareUsers) {
          FileshareuserBean fsuBean = new FileshareuserBean();
          fsuBean.setFileid(fileBean.getId());
          fsuBean.setUserid(uId);
          fileUser = (User) UserFinderBase
              .findByPrimaryKey(new UserKey(uId));
          if (null != fileUser) {
            //set correct label ending up on switch
            fsuBean.setUserdescription(fileUser.getFirstname()
                + " " + fileUser.getLastname());
          }
View Full Code Here

Examples of org.openqreg.bean.UserKey

   * con)
   */
  @Override
  protected void populateKeysAndBeans(Connection con) throws SQLException {
    userToEdit = (UserBean) UserFinderBase.findByPrimaryKey(con,
        new UserKey(fetch.getValueAsString("USER_ID")));
    if (userToEdit != null) {
      ucrBean = (UsercentrerelBean) UsercentrerelFinderBase
          .findByPrimaryKey(con, new UsercentrerelKey(userToEdit
              .getId(), userToEdit.getCentreid()));
      ucrUserToEdit = UsercentrerelFinder.findByUseridReturnMap(con, userToEdit
View Full Code Here

Examples of org.openqreg.bean.UserKey

    }
  }

  @Override
  protected void populateKeysAndBeans(Connection con) throws SQLException {
    myself = (UserBean) UserFinderBase.findByPrimaryKey(new UserKey(fetch
        .getValueAsString("USERID")));
  }
View Full Code Here

Examples of org.openqreg.bean.UserKey

      }
    }
    if (loggedUserid != null) {
      // Search for spec. user committed, get User from DB
      loggedUser = (UserBean) UserFinderBase.findByPrimaryKey(
          new UserKey(loggedUserid));
    }
    if (col != null) {
      nrofvalues = new Integer(col.size());
    }
    } catch (SQLException e) {
View Full Code Here

Examples of org.openqreg.bean.UserKey

      try {
        con = DbHandler.getConnection();
        Collection<CentreBean> col = UserRelation.retrieveCentreList(
            con, Dispatcher.getInstance().getUser(userId),
            (UserBean) UserFinderBase.findByPrimaryKey(con,
                new UserKey(userToEdit)), centreStatus,
            ucrStatus, allPossible);
        BeanSorter.sort(BeanSorter.getLocale(Dispatcher.getInstance()
            .getUser(userId)), col, "centrename");
        return col;
      } finally {
View Full Code Here

Examples of org.openqreg.bean.UserKey

        .indexOf("</id>"));

   
    try {
      userBean = (UserBean) UserFinder
          .findByPrimaryKey(new UserKey(userId));
      userBean.setPassword(null);
      userBean.setChangepassword(null);
      userBean.setTspassword(null);
     
    res.getWriter().write("<user>\n");
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.