Package it.eng.spagobi.commons.metadata

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


   *
   * @return the new hibernate role object
   */
  public static SbiExtRoles makeNewSbiExtRole(SbiExtRoles role){
    logger.debug("IN");
    SbiExtRoles newRole = new SbiExtRoles();
    newRole.setCode(role.getCode());
    newRole.setDescr(role.getDescr());
    newRole.setName(role.getName());
    //newRole.setRoleType(role.getRoleType());
    //newRole.setRoleTypeCode(role.getRoleTypeCode());
    newRole.setSbiParuseDets(new HashSet());
    newRole.setSbiFuncRoles(new HashSet());
    newRole.setIsAbleToSaveIntoPersonalFolder(role.getIsAbleToSaveIntoPersonalFolder());
    newRole.setIsAbleToSaveRememberMe(role.getIsAbleToSaveRememberMe());
    newRole.setIsAbleToSeeMetadata(role.getIsAbleToSeeMetadata());
    newRole.setIsAbleToSeeNotes(role.getIsAbleToSeeNotes());
    newRole.setIsAbleToSeeSnapshots(role.getIsAbleToSeeSnapshots());
    newRole.setIsAbleToSeeSubobjects(role.getIsAbleToSeeSubobjects());
    newRole.setIsAbleToSeeViewpoints(role.getIsAbleToSeeViewpoints());
    newRole.setIsAbleToSendMail(role.getIsAbleToSendMail());
    newRole.setIsAbleToBuildQbeQuery(role.getIsAbleToBuildQbeQuery());
    logger.debug("OUT");
    return newRole;
  }
View Full Code Here


   *
   * @return the new hibernate role object
   */
  public static SbiExtRoles makeNewSbiExtRole(SbiExtRoles role, Integer id){
    logger.debug("IN");
    SbiExtRoles newRole = makeNewSbiExtRole(role);
    newRole.setExtRoleId(id);
    logger.debug("OUT");
    return newRole;
  }
View Full Code Here

      SbiParuse sbiparuse = parusedetid.getSbiParuse();
      SbiParuse newParuse = ImportUtilities.makeNewSbiParuse(sbiparuse, newParuseid);
      newParusedetid.setSbiParuse(newParuse);
    }
    if (newRoleid != null) {
      SbiExtRoles sbirole = parusedetid.getSbiExtRoles();
      SbiExtRoles newRole = ImportUtilities.makeNewSbiExtRole(sbirole, newRoleid);
      newParusedetid.setSbiExtRoles(newRole);
    }
    SbiParuseDet newParuseDet = new SbiParuseDet();
    newParuseDet.setId(newParusedetid);
    newParuseDet.setDefaultVal(parusedet.getDefaultVal());
View Full Code Here

      SbiFunctions sbifunct = functroleid.getFunction();
      SbiFunctions newFunct = ImportUtilities.makeNewSbiFunction(sbifunct, newFunctid);
      newFunctroleid.setFunction(newFunct);
    }
    if (newRoleid != null) {
      SbiExtRoles sbirole = functroleid.getRole();
      SbiExtRoles newRole = ImportUtilities.makeNewSbiExtRole(sbirole, newRoleid);
      newFunctroleid.setRole(newRole);
    }
    SbiFuncRole newFunctRole = new SbiFuncRole();
    newFunctRole.setId(newFunctroleid);
    logger.debug("OUT");
View Full Code Here

    Set roles = hibMenu.getSbiMenuRoles();   // roles of menu in database
    Iterator iterRoles = roles.iterator();
    while(iterRoles.hasNext()) {      // for each role retrieved in database
      SbiMenuRole hibMenuRole = (SbiMenuRole)iterRoles.next();

      SbiExtRoles hibRole =hibMenuRole.getSbiExtRoles();

      RoleDAOHibImpl roleDAO =  new RoleDAOHibImpl();
      Role role = roleDAO.toRole(hibRole);

      rolesList.add(role);
View Full Code Here

    for(int i=0; i<roles.length; i++) {
      Role role = roles[i];
      domainCdCriterrion = Expression.eq("extRoleId", role.getId());
      criteria = aSession.createCriteria(SbiExtRoles.class);
      criteria.add(domainCdCriterrion);
      SbiExtRoles hibRole = (SbiExtRoles)criteria.uniqueResult();

      SbiMenuRoleId sbiMenuRoleId = new SbiMenuRoleId();
      sbiMenuRoleId.setMenuId(hibMenu.getMenuId());
      sbiMenuRoleId.setExtRoleId(role.getId());
View Full Code Here

   *
   * @throws EMFUserError
   */
  private void importRoles() throws EMFUserError {
    logger.debug("IN");
    SbiExtRoles role = null;
    try {
      List exportedRoles = importer.getAllExportedSbiObjects(sessionExpDB, "SbiExtRoles", null);
      Iterator iterSbiRoles = exportedRoles.iterator();
      while (iterSbiRoles.hasNext()) {
        role = (SbiExtRoles) iterSbiRoles.next();
        Integer oldId = role.getExtRoleId();
        Map roleIdAss = metaAss.getRoleIDAssociation();
        Set roleIdAssSet = roleIdAss.keySet();
        if (roleIdAssSet.contains(oldId)) {
          metaLog.log("Exported role " + role.getName() + " not inserted"
              + " because it has been associated to an existing role or it has the same name "
              + " of an existing role");
          continue;
        }
        SbiExtRoles newRole = ImportUtilities.makeNewSbiExtRole(role);
        String roleCd = role.getRoleTypeCode();
        Map unique = new HashMap();
        unique.put("valuecd", roleCd);
        unique.put("domaincd", "ROLE_TYPE");
        SbiDomains existDom = (SbiDomains) importer.checkExistence(unique, sessionCurrDB, new SbiDomains());
        if (existDom != null) {
          newRole.setRoleType(existDom);
          newRole.setRoleTypeCode(existDom.getValueCd());
        }
        sessionCurrDB.save(newRole);
        metaLog.log("Inserted new role " + newRole.getName());
        Integer newId = newRole.getExtRoleId();
        metaAss.insertCoupleRole(oldId, newId);
      }
    } catch (Exception e) {
      if (role != null) {
        logger.error("Error while importing exported role with name [" + role.getName() + "].", e);
View Full Code Here

    }

    List exportedRoles = importer.getAllExportedSbiObjects(sessionExpDB, "SbiExtRoles", null);
    Iterator iterSbiRoles = exportedRoles.iterator();
    while (iterSbiRoles.hasNext()) {
      SbiExtRoles roleExp = (SbiExtRoles) iterSbiRoles.next();
      String roleName = roleExp.getName();
      Integer expRoleId = roleExp.getExtRoleId();
      Map rolesAss = metaAss.getRoleIDAssociation();
      Set keysExpRoleAss = rolesAss.keySet();
      if (keysExpRoleAss.contains(expRoleId))
        continue;
      Object existObj = importer.checkExistence(roleName, sessionCurrDB, new SbiExtRoles());
      if (existObj != null) {
        SbiExtRoles roleCurr = (SbiExtRoles) existObj;
        metaAss.insertCoupleRole(roleExp.getExtRoleId(), roleCurr.getExtRoleId());
        metaAss.insertCoupleRole(roleExp, roleCurr);
        metaLog.log("Found an existing Role " + roleCurr.getName() + " with "
            + "the same name of the exported role " + roleExp.getName());
      }
    }
    List exportedParuse = importer.getAllExportedSbiObjects(sessionExpDB, "SbiParuse", null);
    Iterator iterSbiParuse = exportedParuse.iterator();
View Full Code Here

      for (int i = 0; i < roles.length; i++) {
        String hql = "from SbiExtRoles ser where ser.name=?";
        Query query = aSession.createQuery(hql);
        query.setParameter(0, roles[i]);
        logger.debug("Read role of=" + roles[i]);
        SbiExtRoles spaobiRole = (SbiExtRoles) query.uniqueResult();
        if (spaobiRole != null) {
          String roleTypeCode = spaobiRole.getRoleType().getValueCd();
          if (!roleTypes.contains(roleTypeCode))
            roleTypes.add(roleTypeCode);
        } else {
          logger.warn("The role " + roles[i]
              + "doesn't exist in SBI_EXT_ROLES");
View Full Code Here

      JSONArray rolesJSON = new JSONArray();
      rolesJSON.put("roles");

      while(itRoles.hasNext()){
        JSONObject jsonRole = new JSONObject();
        SbiExtRoles extRole = (SbiExtRoles)itRoles.next();
        Integer roleId= extRole.getExtRoleId();

        jsonRole.put("name", extRole.getName());
        jsonRole.put("id", roleId);
        jsonRole.put("description", extRole.getDescr());
        rolesJSON.put(jsonRole);
     
      result.put("userRoles", rolesJSON);
     
      //attributes
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.