Package it.eng.spagobi.commons.bo

Examples of it.eng.spagobi.commons.bo.Role


      JSONArray rolesJSON = new JSONArray();
      //rolesJSON.put("roles");
     
      while(itAllRoles.hasNext()){
        JSONObject jsonRole = new JSONObject();
        Role role = (Role)itAllRoles.next();
        if(role!=null){
          Integer roleId = role.getId();
          jsonRole.put("name", role.getName());
          jsonRole.put("id", role.getId());
          jsonRole.put("description", role.getDescription());
          if(userRoles.contains(roleId)){
            jsonRole.put("checked", true);
          }else{
            jsonRole.put("checked", false);
          }
View Full Code Here


      Object[] arrRoles = lstRolesForUser.toArray();
      Integer levelItem = 1;     
      for (int i=0; i< arrRoles.length; i++){
        logger.debug("*** arrRoles[i]): " + arrRoles[i]);
        Role role = (Role)DAOFactory.getRoleDAO().loadByName((String)arrRoles[i]);
        if (role != null){ 
          //list final user menu
          List lstUserMenuItems  = DAOFactory.getMenuRolesDAO().loadMenuByRoleId(role.getId());
          if (lstUserMenuItems == null)
            logger.debug("Not found menu items for User Role " + (String)arrRoles[i] );
          else {
            for(int j=0; j<lstUserMenuItems.size(); j++){
              Menu tmpObj = (Menu)lstUserMenuItems.get(j);
View Full Code Here

    boolean found=false;
    for (Iterator iterator = profileRoles.iterator(); iterator.hasNext() && !found;) {
      String profileRole = (String) iterator.next();
      for(int i=0;i<menuRoles.length && !found;i++){
        Role menuRole=menuRoles[i];
        String menuRoleName=menuRole.getName();

        if(menuRoleName.equals(profileRole)){
          found=true;
        }
      }
View Full Code Here

   * @throws EMFUserError the EMF user error
   *
   * @see it.eng.spagobi.commons.dao.IRoleDAO#loadByID(java.lang.Integer)
   */
  public Role loadByID(Integer roleID) throws EMFUserError {
    Role toReturn = null;
    Session aSession = null;
    Transaction tx = null;
    try{
      aSession = getSession();
      tx = aSession.beginTransaction();
View Full Code Here

   * @throws EMFUserError the EMF user error
   *
   * @see it.eng.spagobi.commons.dao.IRoleDAO#loadByName(java.lang.String)
   */
  public Role loadByName(String roleName) throws EMFUserError {
    Role toReturn = null;
    Session aSession = null;
    Transaction tx = null;
    try{
      aSession = getSession();
      tx = aSession.beginTransaction();
View Full Code Here

   *
   * @return The corrispondent <code>Role</code> object
   */
  public Role toRole(SbiExtRoles hibRole){
      logger.debug( "IN.hibRole.getName()="+hibRole.getName() );
    Role role = new Role();
    role.setCode(hibRole.getCode());
    role.setDescription(hibRole.getDescr());
    role.setId(hibRole.getExtRoleId());
    role.setName(hibRole.getName());
    role.setIsAbleToSaveSubobjects(hibRole.getIsAbleToSaveSubobjects() == null || hibRole.getIsAbleToSaveSubobjects().booleanValue());
    role.setIsAbleToSeeSubobjects(hibRole.getIsAbleToSeeSubobjects() == null || hibRole.getIsAbleToSeeSubobjects().booleanValue());
    role.setIsAbleToSeeSnapshots(hibRole.getIsAbleToSeeSnapshots() == null || hibRole.getIsAbleToSeeSnapshots().booleanValue());
    role.setIsAbleToSeeViewpoints(hibRole.getIsAbleToSeeViewpoints() == null || hibRole.getIsAbleToSeeViewpoints().booleanValue());
    role.setIsAbleToSeeNotes(hibRole.getIsAbleToSeeNotes() == null || hibRole.getIsAbleToSeeNotes().booleanValue());
    role.setIsAbleToSeeMetadata(hibRole.getIsAbleToSeeMetadata() == null || hibRole.getIsAbleToSeeMetadata().booleanValue());
    role.setIsAbleToSaveMetadata(hibRole.getIsAbleToSaveMetadata() == null || hibRole.getIsAbleToSaveMetadata().booleanValue());
    role.setIsAbleToSendMail(hibRole.getIsAbleToSendMail() == null || hibRole.getIsAbleToSendMail().booleanValue());
    role.setIsAbleToSaveRememberMe(hibRole.getIsAbleToSaveRememberMe() == null || hibRole.getIsAbleToSaveRememberMe().booleanValue());
    role.setIsAbleToSaveIntoPersonalFolder(hibRole.getIsAbleToSaveIntoPersonalFolder() == null || hibRole.getIsAbleToSaveIntoPersonalFolder().booleanValue());
    role.setIsAbleToBuildQbeQuery(hibRole.getIsAbleToBuildQbeQuery() == null || hibRole.getIsAbleToBuildQbeQuery().booleanValue());
    role.setRoleTypeCD(hibRole.getRoleTypeCode());
    role.setRoleTypeID(hibRole.getRoleType().getValueId());
    logger.debug( "OUT" );
    return role;
  }
View Full Code Here

      toTransform = hibernateQuery.list();       
   
      if(toTransform != null){
        for (Iterator iterator = toTransform.iterator(); iterator.hasNext();) {
          SbiExtRoles hibRole = (SbiExtRoles) iterator.next();
          Role role = toRole(hibRole);
          toReturn.add(role);
        }
      } 
     
    } catch (HibernateException he) {
View Full Code Here

      roles = aLowFunctionality.getExecRoles();
    } else if(permission.equalsIgnoreCase(SpagoBIConstants.PERMISSION_ON_FOLDER_TO_CREATE)) {
      roles = aLowFunctionality.getCreateRoles();
    }
    for(int i=0; i<roles.length; i++) {
      Role role = roles[i];
      domainCdCriterrion = Expression.eq("name", role.getName());
      criteria = aSession.createCriteria(SbiExtRoles.class);
      criteria.add(domainCdCriterrion);
      SbiExtRoles hibRole = (SbiExtRoles)criteria.uniqueResult();
      SbiFuncRoleId sbifuncroleid = new SbiFuncRoleId();
      sbifuncroleid.setFunction(hibFunct);
View Full Code Here

        SbiFuncRole hibfuncrole = (SbiFuncRole)iterRoles.next();
        SbiExtRoles hibRole = hibfuncrole.getId().getRole();
        SbiDomains hibPermission = hibfuncrole.getId().getState();
        logger.debug( "hibfuncrole.getId().getRole().getName()="+hibRole.getName() );
        RoleDAOHibImpl roleDAO =  new RoleDAOHibImpl();
        Role role = roleDAO.toRole(hibRole);

        String state = hibPermission.getValueCd();
        if(state.equals(SpagoBIConstants.PERMISSION_ON_FOLDER_TO_DEVELOP)) {
          devRolesList.add(role);
        } else if(state.equals(SpagoBIConstants.PERMISSION_ON_FOLDER_TO_TEST)) {
View Full Code Here

      List roles = new ArrayList();
      logger.debug("Roles's number: " + roleStrs.size());
      while (roleIter.hasNext()) {
        String rolename = (String) roleIter.next();
        logger.debug("Rolename: " + rolename);
        Role role = DAOFactory.getRoleDAO().loadByName(rolename);
        if (role!=null)  {
          roles.add(role);
          logger.debug("Add Rolename ( " + rolename +") ");
        }
        else logger.debug("Rolename ( " + rolename +") doesn't exist in EXT_ROLES");
View Full Code Here

TOP

Related Classes of it.eng.spagobi.commons.bo.Role

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.