Package org.openqreg.bean

Examples of org.openqreg.bean.UsergroupBean


    // get grouprelations for the group
    Collection<GrouprelationBean> grCol = GrouprelationFinder
        .findByUsergroupid(con, groupId);

    UsergroupBean ugBean = null;
    // loop grouprelations
    for (GrouprelationBean grBean : grCol) {
      ugBean = (UsergroupBean) UsergroupFinderBase.findByPrimaryKey(con,
          new UsergroupKey(grBean.getRelatestoid()));
      if (Integer.valueOf(0).equals(ugBean.getUseucr())) {
        // group does not use ucr table add to result
        col.add(ugBean);
      }
    }
View Full Code Here


    try {
      this.getWriteLockCCGTables();
      TreeMap<String, String> tmpGroupTable = new TreeMap<String, String>();
      Iterator<UsergroupBean> usergroupIterator = UsergroupFinderBase
          .findAll().iterator();
      UsergroupBean usergroup;
      while (usergroupIterator.hasNext()) {
        usergroup = usergroupIterator.next();
        tmpGroupTable.put(usergroup.getId().toUpperCase(), usergroup
            .getStatus().toString());
      }
      groupTable = tmpGroupTable;
    } catch (Exception sqle) {
      logger.log(Level.FATAL, "Unable to populate usergroups", sqle);
View Full Code Here

   * Creates a new GroupBean. This method can be overridden in subclasses.
   *
   * @return A new GroupBean
   */
  public UsergroupBean createGroup() {
    return new UsergroupBean();
  }
View Full Code Here

      con.setAutoCommit(false);
     
      UserBean user = BeanFactory.getUser(Thread.currentThread().getId());
      user.create(con);
     
      UsergroupBean parent = new UsergroupBean();
      parent.setId("parent");
      parent.setStatus(new Integer(Status.ACTIVE));
      parent.setDescription("Parent usergroup");
      parent.setUseucr(Integer.valueOf(0));
      parent.setCreatedby(user.getId());
      parent.setTscreated(new Timestamp(System.currentTimeMillis()));
      parent.create(con);
     
     
     
      relations = GrouprelationFinder.findByUsergroupid("LU");
      assertEquals("Fel antal relationer", 0, relations.size());
View Full Code Here

          langId, "ADMINGROUPLIST_TSUPDATED_HL"), firstsortorder,
          ascdescsortorder);
     
      out.append("</tr>\n");

      UsergroupBean groupBean = null;
      while (null != it && it.hasNext() && col.size() > 0) {
        groupBean =it.next();

        out.append("<tr class=\"listRow\"");
        out.append(" onClick=\"");
        out.append("listSend('"+listSend+"','" + groupBean.getId()
            + "')");
        out.append("\"\n");
        out
            .append(" onmouseover=\"this.className='listRow_mouseOver'\"");
        out.append(" onmouseout=\"this.className='listRow'\" >\n");

        // id
        out.append("<td>\n");
        if (null != groupBean.getId()) {
          out.append(groupBean.getId());
          // test of ajaxInfo
          // out
          // .append("<span
          // onmouseover=\"getAjaxInfo().ajaxInfo('ajaxUserInfo.jsp','");
          // out.append(userBean.getId());
          // out.append("',this,userInfoParser)\"onmouseout=\"getAjaxInfo().ajaxInfoOut();\">");
          // out.append(userBean.getId());
          // out.append("</span>");
        } else {
          out.append("&nbsp;");
        }
        out.append("</td>\n");

        // lastname
        out.append("<td>\n");
        if (null != groupBean.getDescription()) {
          out.append(groupBean.getDescription());
        } else {
          out.append("&nbsp;");
        }
        out.append("</td>\n");

        // status
        out.append("<td>\n");
        if (null != groupBean.getStatus()) {
          out.append(lang.getListBoxText(langId, "USERGROUP_STATUS_L",
              groupBean.getStatus().toString()));
        } else {
          out.append("&nbsp;");
        }
        out.append("</td>\n");

//         updated by
        out.append("<td>\n");
        if (null != groupBean.getUpdatedby()) {
          out.append(groupBean.getUpdatedby());
        } else {
          out.append("&nbsp;");
        }
        out.append("</td>\n");

//         tsupdated
        out.append("<td>\n");
        if (null != groupBean.getTsupdated()) {
          out.append(groupBean.getTsupdated().toString().substring(0,16));
        } else {
          out.append("&nbsp;");
        }
        out.append("</td>\n");
View Full Code Here

          langId, "ADMINGROUPLIST_TSUPDATED_HL"), firstsortorder,
          ascdescsortorder);
     
      out.append("</tr>\n");

      UsergroupBean groupBean = null;
      while (null != it && it.hasNext() && col.size() > 0) {
        groupBean =it.next();

        out.append("<tr class=\"listRow\"");
        out.append(" onClick=\"");
        out.append("listSend('"+listSend+"','" + groupBean.getId()
            + "')");
        out.append("\"\n");
        out
            .append(" onmouseover=\"this.className='listRow_mouseOver'\"");
        out.append(" onmouseout=\"this.className='listRow'\" >\n");

        // id
        out.append("<td>\n");
        if (null != groupBean.getId()) {
          out.append(groupBean.getId());
          // test of ajaxInfo
          // out
          // .append("<span
          // onmouseover=\"getAjaxInfo().ajaxInfo('ajaxUserInfo.jsp','");
          // out.append(userBean.getId());
          // out.append("',this,userInfoParser)\"onmouseout=\"getAjaxInfo().ajaxInfoOut();\">");
          // out.append(userBean.getId());
          // out.append("</span>");
        } else {
          out.append("&nbsp;");
        }
        out.append("</td>\n");

        // lastname
        out.append("<td>\n");
        if (null != groupBean.getDescription()) {
          out.append(groupBean.getDescription());
        } else {
          out.append("&nbsp;");
        }
        out.append("</td>\n");

        // status
        out.append("<td>\n");
        if (null != groupBean.getStatus()) {
          out.append(lang.getListBoxText(langId, "USERGROUP_STATUS_L",
              groupBean.getStatus().toString()));
        } else {
          out.append("&nbsp;");
        }
        out.append("</td>\n");

//         updated by
        out.append("<td>\n");
        if (null != groupBean.getUpdatedby()) {
          out.append(groupBean.getUpdatedby());
        } else {
          out.append("&nbsp;");
        }
        out.append("</td>\n");

//         tsupdated
        out.append("<td>\n");
        if (null != groupBean.getTsupdated()) {
          out.append(groupBean.getTsupdated().toString().substring(0,16));
        } else {
          out.append("&nbsp;");
        }
        out.append("</td>\n");
View Full Code Here

   
    Collection<LanguageBean> languages = LanguageFinderBase.findAll();
    LanguageBean language = languages.iterator().next();
   
    Collection<UsergroupBean> usergroups = UsergroupFinderBase.findAll();
    UsergroupBean usergroup = usergroups.iterator().next();
   
    Collection<CentreBean> centres = CentreFinderBase.findAll();
    CentreBean centre = centres.iterator().next();
   
    String userid = "JUnit@"+ id +"@"+ System.currentTimeMillis();
    UserBean testUser = new UserBean();
    testUser.setId(userid);
    testUser.setLanguageid(language.getLanguageid());
    testUser.setGroupid(usergroup.getId());
    testUser.setCentreid(centre.getId());
   
    return testUser;
  }
View Full Code Here

    return testUser;
  }
 
  public static UsergroupBean getUsergroup(long id){
   
    UsergroupBean usergroup = new UsergroupBean();
    usergroup.setId(Long.toString(id));
    usergroup.setStatus(new Integer(Status.ACTIVE));
    usergroup.setDescription("Usergroup");
    usergroup.setCreatedby("System");
    usergroup.setTscreated(new Timestamp(System.currentTimeMillis()));
    usergroup.setUpdatedby("System");
    usergroup.setTsupdated(new Timestamp(System.currentTimeMillis()));   
   
    return usergroup;   
  }
View Full Code Here

    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));
      ug1.setStatus(new Integer(Status.ACTIVE));
      ug1.setCreatedby(user.getId());
      ug1.setTscreated(new Timestamp(System.currentTimeMillis()));
      ug1.create(con);

      UsergroupBean sg1 = new UsergroupBean();
      sg1.setId("JUNit@Subgroup1");
      sg1.setDescription("JUNit@Subgroup1");
      sg1.setUseucr(Integer.valueOf(0));
      sg1.setStatus(new Integer(Status.ACTIVE));
      sg1.setCreatedby(user.getId());
      sg1.setTscreated(new Timestamp(System.currentTimeMillis()));
      sg1.create(con);

      UsergroupBean sg2 = new UsergroupBean();
      sg2.setId("JUNit@Subgroup2");
      sg2.setDescription("JUNit@Subgroup2");
      sg2.setUseucr(Integer.valueOf(0));
      sg2.setStatus(new Integer(Status.ACTIVE));
      sg2.setCreatedby(user.getId());
      sg2.setTscreated(new Timestamp(System.currentTimeMillis()));
      sg2.create(con);

//      assertTrue("En undergrupp skall ha blivit tillagd", ug1.addChild(sg1));
//      assertTrue("Undergruppen skall finnas", ug1.isChild(sg1));
//
//      assertTrue("En undergrupp skall ha blivit tillagd", ug1.addChild(sg2));
View Full Code Here

* @return A populated UsergroupBean
*
* @throws SQLException
*/
protected static UsergroupBean populate(ResultSet rs) throws SQLException {
UsergroupBean valueObject = new UsergroupBean();
valueObject.setId((String)rs.getObject(1));
valueObject.setDescription((String)rs.getObject(2));
valueObject.setUseucr((Integer)rs.getObject(3));
valueObject.setStatus((Integer)rs.getObject(4));
valueObject.setTscreated((java.sql.Timestamp)rs.getObject(5));
valueObject.setTsupdated((java.sql.Timestamp)rs.getObject(6));
valueObject.setCreatedby((String)rs.getObject(7));
valueObject.setUpdatedby((String)rs.getObject(8));
return valueObject;
}
View Full Code Here

TOP

Related Classes of org.openqreg.bean.UsergroupBean

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.