Package it.eng.spagobi.analiticalmodel.functionalitytree.metadata

Examples of it.eng.spagobi.analiticalmodel.functionalitytree.metadata.SbiFuncRole


      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);
      hibFunctRole.setStateCd(permissionCd);
      session.save(hibFunctRole);
      tx.commit();

    } catch (Exception e) {
      logger.error("Error while inserting function and role association into export database " , e);
View Full Code Here


      Integer roleid = (Integer) uniqueMap.get("roleid");
      Integer functionid = (Integer) uniqueMap.get("functionid");
      hql = "from SbiFuncRole fr where fr.id.state.valueId=" + stateid + " and fr.id.role.extRoleId = " + roleid
      + " and fr.id.function.functId = " + functionid;
      hqlQuery = sessionCurrDB.createQuery(hql);
      SbiFuncRole hibFunctRole = (SbiFuncRole) hqlQuery.uniqueResult();
      return hibFunctRole;
    } else if (hibObj instanceof SbiParuseDet) {
      Map uniqueMap = (Map) unique;
      Integer paruseid = (Integer) uniqueMap.get("paruseid");
      Integer roleid = (Integer) uniqueMap.get("roleid");
View Full Code Here

    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");
    return newFunctRole;
  }
View Full Code Here

   *
   * @throws EMFUserError
   */
  private void importFunctRoles() throws EMFUserError {
    logger.debug("IN");
    SbiFuncRole functrole = null;
    try {
      List exportedFunctRoles = importer.getAllExportedSbiObjects(sessionExpDB, "SbiFuncRole", null);
      Iterator iterSbiFunctRoles = exportedFunctRoles.iterator();
      while (iterSbiFunctRoles.hasNext()) {
        functrole = (SbiFuncRole) iterSbiFunctRoles.next();
        // get ids of exported role, function and state associzted
        Integer functid = functrole.getId().getFunction().getFunctId();
        Integer roleid = functrole.getId().getRole().getExtRoleId();
        Integer stateid = functrole.getId().getState().getValueId();
        // get association of roles and paruses
        Map functIdAss = metaAss.getFunctIDAssociation();
        Map roleIdAss = metaAss.getRoleIDAssociation();
        // try to get from association the id associate to the exported
        // metadata
        Integer newFunctid = (Integer) functIdAss.get(functid);
        Integer newRoleid = (Integer) roleIdAss.get(roleid);
        // build a new SbiFuncRole
        SbiFuncRole newFunctRole = ImportUtilities.makeNewSbiFunctRole(functrole, newFunctid, newRoleid);
        // get sbidomain of the current system
        String stateCd = functrole.getStateCd();
        Map uniqueDom = new HashMap();
        uniqueDom.put("valuecd", stateCd);
        uniqueDom.put("domaincd", SpagoBIConstants.PERMISSION_ON_FOLDER);
        SbiDomains existDom = (SbiDomains) importer.checkExistence(uniqueDom, sessionCurrDB, new SbiDomains());
        if (existDom != null) {
          newFunctRole.getId().setState(existDom);
          newFunctRole.setStateCd(existDom.getValueCd());
        }
        // check if the association between metadata already exist
        Map unique = new HashMap();
        unique.put("stateid", existDom.getValueId());
        unique.put("roleid", newRoleid);
        unique.put("functionid", newFunctid);
        Object existObj = importer.checkExistence(unique, sessionCurrDB, new SbiFuncRole());
        if (existObj == null) {
          sessionCurrDB.save(newFunctRole);
          metaLog.log("Inserted new association between function "
              + functrole.getId().getFunction().getName() + " and role "
              + functrole.getId().getRole().getName());
View Full Code Here

      updateSbiCommonInfo4Update(hibFunct);
     
      Set oldRoles = hibFunct.getSbiFuncRoles();
      Iterator iterOldRoles = oldRoles.iterator();
      while (iterOldRoles.hasNext()) {
        SbiFuncRole role = (SbiFuncRole) iterOldRoles.next();
        aSession.delete(role);
      }
      // save roles functionality
      Set functRoleToSave = new HashSet();
      functRoleToSave.addAll(saveRolesFunctionality(aSession, hibFunct,
View Full Code Here

      SbiExtRoles hibRole = (SbiExtRoles)criteria.uniqueResult();
      SbiFuncRoleId sbifuncroleid = new SbiFuncRoleId();
      sbifuncroleid.setFunction(hibFunct);
      sbifuncroleid.setState(permissionDomain);
      sbifuncroleid.setRole(hibRole);
      SbiFuncRole sbifuncrole = new SbiFuncRole();
      sbifuncrole.setId(sbifuncroleid);
      sbifuncrole.setStateCd(permissionDomain.getValueCd());
     
      updateSbiCommonInfo4Update(sbifuncrole);
     
      aSession.save(sbifuncrole);
      functRoleToSave.add(sbifuncrole);
View Full Code Here

      SbiFunctions hibFunct = (SbiFunctions) aSession.load(
          SbiFunctions.class, aLowFunctionality.getId());
      Set oldRoles = hibFunct.getSbiFuncRoles();
      Iterator iterOldRoles = oldRoles.iterator();
      while (iterOldRoles.hasNext()) {
        SbiFuncRole role = (SbiFuncRole) iterOldRoles.next();
        aSession.delete(role);
      }

      // update prog column in other functions
      //String hqlUpdateProg = "update SbiFunctions s set s.prog = (s.prog - 1) where s.prog > "
View Full Code Here

    Set roles = hibFunct.getSbiFuncRoles();
    if (roles!=null){
      logger.debug( "getSbiFuncRoles() size="+roles.size() );
      Iterator iterRoles = roles.iterator();
      while(iterRoles.hasNext()) {
        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();
View Full Code Here

        }else{
          Object[] tmpRole = tmpFunc.getSbiFuncRoles().toArray();
          for (int j=0; j <rolesIds.size(); j++){
            Integer principalRole = ((SbiExtRoles)rolesIds.get(j)).getExtRoleId();
            for (int i=0; i<tmpRole.length;i++){
              SbiFuncRole role = (SbiFuncRole) tmpRole[i];
              Integer localRoleId = ((SbiFuncRoleId)role.getId()).getRole().getExtRoleId();
              if (localRoleId != null && localRoleId.compareTo(principalRole) == 0){
                if (!existFunction(realResult, tmpFunc)){
                  realResult.add(toLowFunctionality(tmpFunc, recoverBIObjects));
                  break;
                }
View Full Code Here

TOP

Related Classes of it.eng.spagobi.analiticalmodel.functionalitytree.metadata.SbiFuncRole

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.