Examples of UsercentrerelBean


Examples of org.openqreg.bean.UsercentrerelBean

            // Users centre is inactive, try to find an active one
            Map<String, UsercentrerelBean> ucrMap = null;
            ucrMap = UsercentrerelFinder.findByUseridReturnMap(user
                .getId());
            Iterator<String> it = ucrMap.keySet().iterator();
            UsercentrerelBean ucrBean = null;
            String tempCentreid = null;
            while (it.hasNext()) { // Loop users all centres
              tempCentreid = it.next();
              ucrBean = ucrMap.get(tempCentreid);
              if (new Integer(1).equals(ucrBean.getStatus())) {
                Dispatcher.logger.log(
                    Level.INFO,
                    "loginUser(): users centre inactive: "
                        + user.getCentreid()
                        + ", moved to: "
                        + ucrBean.getCentreid()
                        + ", userid: " + userId);
                // Active centre found, set info to user
                user.setCentreid(ucrBean.getCentreid());
                user.setGroupid(ucrBean.getGroupid());
                break;
              }
            }
          }
          user.setPrevTslastlogin(user.getTslastlogin());
View Full Code Here

Examples of org.openqreg.bean.UsercentrerelBean

            // Users centre is inactive, try to find an active one
            Map<String, UsercentrerelBean> ucrMap = null;
            ucrMap = UsercentrerelFinder.findByUseridReturnMap(user
                .getId());
            Iterator<String> it = ucrMap.keySet().iterator();
            UsercentrerelBean ucrBean = null;
            String tempCentreid = null;
            while (it.hasNext()) { // Loop users all centres
              tempCentreid = it.next();
              ucrBean = ucrMap.get(tempCentreid);
              if (new Integer(1).equals(ucrBean.getStatus())) {
                Dispatcher.logger.log(
                    Level.INFO,
                    "loginUser(): users centre inactive: "
                        + user.getCentreid()
                        + ", moved to: "
                        + ucrBean.getCentreid()
                        + ", userid: " + userId);
                // Active centre found, set info to user
                user.setCentreid(ucrBean.getCentreid());
                user.setGroupid(ucrBean.getGroupid());
                break;
              }
            }
          }
          user.setPrevTslastlogin(user.getTslastlogin());
View Full Code Here

Examples of org.openqreg.bean.UsercentrerelBean

    if (null == centreId) {
      return null;
    }

    // get ucrBean for the user on this centreId
    UsercentrerelBean ucrUC = (UsercentrerelBean) UsercentrerelFinderBase
        .findByPrimaryKey(con, new UsercentrerelKey(user.getId(),
            centreId));

    // ucrBean exists for this user on the centreId, user is ucrUser
    if (null != ucrUC) {
      return ucrUC.getGroupid();
    }

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

Examples of org.openqreg.bean.UsercentrerelBean

      // No center having current id was found.
      return false;
    }

    // get ucrBean for the user on this centreId
    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) {
      // UsercentrerelBean does not exist,
      // The user has access to a subset of all centres, but not the
      // current centreId
      return false;
View Full Code Here

Examples of org.openqreg.bean.UsercentrerelBean

      throws SQLException {
    /**
     * get ucrBean for the on current (any centre is ok, as there should
     * never be a mix of ucr and nonUcr rights for one user)
     */
    UsercentrerelBean ucrUC = (UsercentrerelBean) UsercentrerelFinderBase
        .findByPrimaryKey(con,
            new UsercentrerelKey(user.getId(), user.getCentreid()));

    // ucrBean exists for this user on the centreId, user is ucrUser
    if (null != ucrUC) {
View Full Code Here

Examples of org.openqreg.bean.UsercentrerelBean

    if (null == centreId) {
      return false;
    }

    // get ucrBean for the user on this centreId
    UsercentrerelBean ucrUC = (UsercentrerelBean) UsercentrerelFinderBase
        .findByPrimaryKey(con, new UsercentrerelKey(user.getId(),
            centreId));

    // ucrBean exists for this user on the centreId, user is ucrUser
    if (null != ucrUC) {
View Full Code Here

Examples of org.openqreg.bean.UsercentrerelBean

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

Examples of org.openqreg.bean.UsercentrerelBean

* @throws SQLException
*/
public static Collection<UsercentrerelBean> findAll(Connection con) throws SQLException {
PreparedStatement pStmt = null;
ResultSet rs = null;
UsercentrerelBean valueObject = null;
Collection<UsercentrerelBean> col = Collections.synchronizedList(new ArrayList<UsercentrerelBean>());
try{
pStmt = con.prepareStatement(FIND_ALL_STATEMENT);
rs = pStmt.executeQuery();
while (rs.next()){
valueObject = populate(rs);
valueObject.afterPopulate(con);
col.add(valueObject);
}
return col;
}finally{
if(null!=rs){
View Full Code Here

Examples of org.openqreg.bean.UsercentrerelBean

* @throws SQLException
*/
public static Object findByPrimaryKey(Connection con, PrimaryKey key) throws SQLException {
PreparedStatement pStmt = null;
ResultSet rs = null;
UsercentrerelBean valueObject = null;
UsercentrerelKey primaryKey = (UsercentrerelKey) key;
try{
pStmt = con.prepareStatement(UsercentrerelBeanBase.SELECT_STATEMENT);
pStmt.setObject(1, primaryKey.getUserid());
pStmt.setObject(2, primaryKey.getCentreid());
rs = pStmt.executeQuery();
while (rs.next()){
valueObject = populate(rs);
valueObject.afterPopulate(con);
}
return valueObject;
}finally{
if(null!=rs){
rs.close();
View Full Code Here

Examples of org.openqreg.bean.UsercentrerelBean

      message = lang.getTranslation(langId,
          "ADMINUSERCENTREREL_NO_ACCESS_M");
      return;
    }

    ucrBean = new UsercentrerelBean();
    // populate userToEdit from request(fetch)
    populateWithRequestData();
    // check not yourself, right to update gruop, correct centre
    // Tie new user to centre in usercentrerel table
    ucrBean.setCentreid(user.getCentreid());
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.