Package it.eng.spagobi.commons.metadata

Examples of it.eng.spagobi.commons.metadata.SbiExtRoles


      List roles = new ArrayList();
      Iterator iterRolesSB = rolesSB.iterator();
     
      IRoleDAO roleDAO = DAOFactory.getRoleDAO();
      while (iterRolesSB.hasNext()) {
        SbiExtRoles roleSB = (SbiExtRoles) iterRolesSB.next();

          roles.add(roleSB.getName());
      }
      HashMap attributes = new HashMap();
      ArrayList<SbiUserAttributes> attribs = DAOFactory.getSbiUserDAO().loadSbiUserAttributesById(user.getId());
      if(attribs != null){
        Iterator iterAttrs = attribs.iterator();
View Full Code Here


    try {
      Query hibQuery = session.createQuery(" from SbiExtRoles");
      List hibList = hibQuery.list();
      Iterator it = hibList.iterator();
      while (it.hasNext()) {
        SbiExtRoles hibRole = (SbiExtRoles) it.next();
        Role role = new Role();
        role.setCode(hibRole.getCode());
        role.setDescription(hibRole.getDescr());
        role.setId(hibRole.getExtRoleId());
        role.setName(hibRole.getName());
        role.setRoleTypeCD(hibRole.getRoleTypeCode());
        role.setRoleTypeID(hibRole.getRoleType().getValueId());
        roles.add(role);
      }
    } catch (HibernateException he) {
      logger.error("Error while getting exported roles ", he);
      throw new EMFUserError(EMFErrorSeverity.ERROR, "8004", "component_impexp_messages");
View Full Code Here

      return hibPar;
    } else if (hibObj instanceof SbiExtRoles) {
      String roleName = (String) unique;
      hql = "from SbiExtRoles er where er.name = '" + roleName + "'";
      hqlQuery = sessionCurrDB.createQuery(hql);
      SbiExtRoles hibRole = (SbiExtRoles) hqlQuery.uniqueResult();
      return hibRole;
    } else if (hibObj instanceof SbiObjects) {
      String label = (String) unique;
      hql = "from SbiObjects obj where obj.label = '" + label + "'";
      hqlQuery = sessionCurrDB.createQuery(hql);
View Full Code Here

          // insert into user associations
          try{
            Object existingRoleObj = impManager.getExistingObject(new Integer(roleAssociateId), SbiExtRoles.class);
            Object exportedRoleObj = impManager.getExportedObject(new Integer(expRoleId), SbiExtRoles.class);
            if( (existingRoleObj!=null) && (exportedRoleObj!=null) ) {
              SbiExtRoles existingRole = (SbiExtRoles)existingRoleObj;
              SbiExtRoles exportedRole = (SbiExtRoles)exportedRoleObj;
              UserAssociationsKeeper usrAssKeep = impManager.getUserAssociation();
              String expRoleName = exportedRole.getName();
              String exiRoleName = existingRole.getName();
              usrAssKeep.recordRoleAssociation(expRoleName, exiRoleName);
            } else {
              throw new Exception("hibernate object of existing or exported role not recovered");
            }
View Full Code Here

        return;
      }
      // built key
      SbiParuseDetId hibParuseDetId = new SbiParuseDetId();
      SbiParuse hibParuse = (SbiParuse)session.load(SbiParuse.class, parUse.getUseID());
      SbiExtRoles hibExtRole = (SbiExtRoles)session.load(SbiExtRoles.class, role.getId());
      hibParuseDetId.setSbiExtRoles(hibExtRole);
      hibParuseDetId.setSbiParuse(hibParuse);
      SbiParuseDet hibParuseDet = new SbiParuseDet(hibParuseDetId);
      session.save(hibParuseDet);
      tx.commit();
View Full Code Here

      Query hibQuery = session.createQuery(" from SbiExtRoles where extRoleId = " + role.getId());
      List hibList = hibQuery.list();
      if(!hibList.isEmpty()) {
        return;
      }
      SbiExtRoles hibRole = new SbiExtRoles(role.getId());
      hibRole.setCode(role.getCode());
      hibRole.setDescr(role.getDescription());
      hibRole.setName(role.getName());
      SbiDomains roleType = (SbiDomains)session.load(SbiDomains.class, role.getRoleTypeID());
      hibRole.setRoleType(roleType);
      hibRole.setRoleTypeCode(role.getRoleTypeCD());
      hibRole.setIsAbleToSaveIntoPersonalFolder(new Boolean(role.isAbleToSaveIntoPersonalFolder()));
      hibRole.setIsAbleToSaveRememberMe(new Boolean(role.isAbleToSaveRememberMe()));
      hibRole.setIsAbleToSeeMetadata(new Boolean(role.isAbleToSeeMetadata()));
      hibRole.setIsAbleToSeeNotes(new Boolean(role.isAbleToSeeNotes()));;
      hibRole.setIsAbleToSeeSnapshots(new Boolean(role.isAbleToSeeSnapshots()));
      hibRole.setIsAbleToSeeSubobjects(new Boolean(role.isAbleToSeeSubobjects()));
      hibRole.setIsAbleToSeeViewpoints(new Boolean(role.isAbleToSeeViewpoints()));
      hibRole.setIsAbleToSendMail(new Boolean(role.isAbleToSendMail()));
      hibRole.setIsAbleToBuildQbeQuery(role.isAbleToBuildQbeQuery());
      session.save(hibRole);
      tx.commit();
    } catch (Exception e) {
      logger.error("Error while inserting role into export database " , e);
      throw new EMFUserError(EMFErrorSeverity.ERROR, "8005", "component_impexp_messages");
View Full Code Here

        return;
      }
      // built key
      SbiFuncRoleId hibFuncRoleId = new SbiFuncRoleId();
      SbiFunctions hibFunct = (SbiFunctions)session.load(SbiFunctions.class, funct.getId());
      SbiExtRoles hibRole = (SbiExtRoles)session.load(SbiExtRoles.class, role.getId());
      SbiDomains hibPermission = (SbiDomains)session.load(SbiDomains.class, permissionId);
      hibFuncRoleId.setFunction(hibFunct);
      hibFuncRoleId.setRole(hibRole);
      hibFuncRoleId.setState(hibPermission);
      SbiFuncRole hibFunctRole = new SbiFuncRole(hibFuncRoleId);
View Full Code Here

      // Recreate Relations with sbi_paruse_det
      List newRoles = aParameterUse.getAssociatedRoles();
      SbiParuseDet hibParUseDet = null;
      SbiParuseDetId hibParUseDetId = null;

      SbiExtRoles tmpExtRole = null;
      Set parUseDetsToSave = new HashSet();
      for (int i = 0; i < newRoles.size(); i++) {
        hibParUseDetId = new SbiParuseDetId();
        hibParUseDetId.setSbiParuse(hibParuse);
        tmpExtRole = (SbiExtRoles) aSession.load(SbiExtRoles.class,
View Full Code Here

      // Recreate Relations with sbi_paruse_det
      List newRoles = aParameterUse.getAssociatedRoles();
      SbiParuseDet hibParUseDet = null;
      SbiParuseDetId hibParUseDetId = null;

      SbiExtRoles tmpExtRole = null;
      Set parUseDetsToSave = new HashSet();
      for (int i=0; i < newRoles.size(); i++){
        hibParUseDetId = new SbiParuseDetId();
        hibParUseDetId.setSbiParuse(hibParuse);
        tmpExtRole = (SbiExtRoles)aSession.load(SbiExtRoles.class, ((Role)newRoles.get(i)).getId());
View Full Code Here

        if (user!=null)sbiUserId=user.getId();
        List lstRoles = userDao.loadSbiUserRolesById(sbiUserId);
        boolean isAdminUser = false;

        for (int i=0; i<lstRoles.size(); i++){
          SbiExtRoles tmpRole = (SbiExtRoles)lstRoles.get(i);
          Role role = DAOFactory.getRoleDAO().loadByID(tmpRole.getExtRoleId());
          if (role.getName().equals(strAdminPatter)){
            isAdminUser = true;
            logger.debug("User is administrator. Checks on the password are not applied !");
            break;
          }
View Full Code Here

TOP

Related Classes of it.eng.spagobi.commons.metadata.SbiExtRoles

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.