Package org.openqreg.bean

Examples of org.openqreg.bean.UsergroupKey


/**
* @return The primaryKey
*
*/
public PrimaryKey getPrimaryKey() {
return new UsergroupKey(getId());
}
View Full Code Here


      return ucrUC.getGroupid();
    }

    // user does not have a ucrBean, get group
    Usergroup ug = (Usergroup) UsergroupFinderBase.findByPrimaryKey(con,
        new UsergroupKey(user.getGroupid()));

    /**
     * if ug is null (half created ucrUser) return null<br/>
     * or if ug is a ucrGroup, we would have found a ucr for this user on
     * this centre in the code above, as we didn't the user does not have
View Full Code Here

    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

    UsercentrerelBean ucrUC = (UsercentrerelBean) UsercentrerelFinderBase
        .findByPrimaryKey(con, new UsercentrerelKey(user.getId(),
            centreId));

    Usergroup userGroup = (Usergroup) UsergroupFinderBase
        .findByPrimaryKey(new UsergroupKey(Dispatcher.getInstance()
            .getUser(user.getId()).getGroupid()));
    // ucrBean exists for this user on the centreId, user is ucrUser
    if (null != ucrUC) {
      return Integer.valueOf(1).equals(ucrUC.getStatus());
    } else if (userGroup.getUseucr().intValue() == 1) {
View Full Code Here

      return true;
    }

    // user does not have a ucrBean, get group
    Usergroup ug = (Usergroup) UsergroupFinderBase.findByPrimaryKey(con,
        new UsergroupKey(user.getGroupid()));

    /**
     * if ug is null (half created ucrUser) return null<br/>
     * or if ug is a ucrGroup, we would have found a ucr for this user on
     * this centre in the code above, as we didn't the user does not have
View Full Code Here

   * @see org.openqregtag.AbstractStepHandlerTag#populateKeysAndBeans()
   */
  @Override
  protected void populateKeysAndBeans(Connection con)throws SQLException {
    groupBean = (UsergroupBean) UsergroupFinderBase
        .findByPrimaryKey(new UsergroupKey(groupid));
  }
View Full Code Here

    }

    // tempUser is nonUcr, can not be invited
    if (Integer.valueOf(0).equals(
        ((Usergroup) UsergroupFinderBase.findByPrimaryKey(con,
            new UsergroupKey(tempUser.getGroupid()))).getUseucr())) {
      ucrBean = null;
      message = lang.getTranslation(langId,
          "ADMINUSERCENTREREL_NO_ACCESS_M");
      return;
    }
View Full Code Here

*/
public static Object findByPrimaryKey(Connection con, PrimaryKey key) throws SQLException {
PreparedStatement pStmt = null;
ResultSet rs = null;
UsergroupBean valueObject = null;
UsergroupKey primaryKey = (UsergroupKey) key;
try{
pStmt = con.prepareStatement(UsergroupBeanBase.SELECT_STATEMENT);
pStmt.setObject(1, primaryKey.getId());
rs = pStmt.executeQuery();
while (rs.next()){
valueObject = populate(rs);
valueObject.afterPopulate(con);
}
View Full Code Here

    addDefaultAnswer(user, ugr, uga);
   
    // sa.setStatus("fetched");
    uga.setStatus(AjaxWidgetAnswer.STATUS_FETCHED);
    uga.setUserGroup((UsergroupBean) UsergroupFinderBase
        .findByPrimaryKey(new UsergroupKey(ugr.getUserGroupId())));

    uga.setGroupRelations(GrouprelationFinder.findByUsergroupid(ugr.getUserGroupId()));
   
    uga.setUserGroups(UsergroupFinderBase.findAll());
    return uga;
View Full Code Here

    populateWithRequestData();

    // security check centre
    if (Integer.valueOf(0).equals(
        ((Usergroup) UsergroupFinderBase.findByPrimaryKey(con,
            new UsergroupKey(user.getGroupid()))).getUseucr())) {
      // nonUcrUsers
      /**
       * must be on the same centre as before<br/>
       * OR have ADMINMYSELF_CENTREID AND be in the same country<br/>
       * OR must have ADMINMYSELF_COUNTRYID
View Full Code Here

TOP

Related Classes of org.openqreg.bean.UsergroupKey

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.