Examples of SbiFunctions


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

    Session aSession = null;
    Transaction tx = null;
    try {
      aSession = getSession();
      tx = aSession.beginTransaction();
      SbiFunctions hibFunct = (SbiFunctions) aSession.load(SbiFunctions.class, functionalityID);
      Integer oldProg = hibFunct.getProg();
      Integer newProg = new Integer(oldProg.intValue() - 1);

      //String upperFolderHql = "from SbiFunctions s where s.prog = " + newProg.toString() +
      //  " and s.parentFunct.functId = " + hibFunct.getParentFunct().getFunctId().toString();
      String upperFolderHql = "from SbiFunctions s where s.prog = ? " +
      " and s.parentFunct.functId = ? " ;
      Query query = aSession.createQuery(upperFolderHql);
      query.setInteger(0, newProg.intValue());
      query.setInteger(1,  hibFunct.getParentFunct().getFunctId().intValue());
      SbiFunctions hibUpperFunct = (SbiFunctions) query.uniqueResult();
      if (hibUpperFunct == null) {
        logger.error("The function with prog [" + newProg + "] does not exist.");
        return;
      }

      hibFunct.setProg(newProg);
      hibUpperFunct.setProg(oldProg);

      tx.commit();
    } catch (HibernateException he) {
      logger.error( "HibernateException",he );
View Full Code Here

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


      Iterator it = hibList.iterator();
      //maintains functionalities that have the same user's role
      while (it.hasNext()) {
        SbiFunctions tmpFunc = (SbiFunctions) it.next();
        if(tmpFunc.getFunctTypeCd().equalsIgnoreCase("USER_FUNCT")){
          realResult.add(toLowFunctionality(tmpFunc, recoverBIObjects));
        }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();
View Full Code Here

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

        Query hibQueryPersonalFolder = aSession.createQuery("select f from SbiFunctions f where f.path like ? ");
        hibQueryPersonalFolder.setString(0, "/"+username);
        List hibListPersF = hibQueryPersonalFolder.list()
        Iterator it = hibListPersF.iterator();
        while (it.hasNext()) {
          SbiFunctions tmpFunc = (SbiFunctions) it.next();
          realResult.add(toLowFunctionality(tmpFunc, recoverBIObjects));
        }
      } else{
        hibQuery = aSession.createQuery("select sfr.id.function from SbiFuncRole sfr where "
        + "sfr.id.function.functTypeCd = 'LOW_FUNCT' and sfr.id.function.parentFunct.functId = ? "
        + "and sfr.stateCd = ? and sfr.id.role.name in (:roles) "                   
        + "order by sfr.id.function.parentFunct.functId, sfr.id.function.prog");
        hibQuery.setInteger(0, tmpParentId.intValue());
        hibQuery.setString(1,permission);
        hibQuery.setParameterList("roles", roles);
      }
      List hibList = hibQuery.list()
      Iterator it = hibList.iterator();
      while (it.hasNext()) {
        SbiFunctions tmpFunc = (SbiFunctions) it.next();
        realResult.add(toLowFunctionality(tmpFunc, recoverBIObjects));
      }
    } catch (HibernateException he) {
      logger.error( "HibernateException",he );
View Full Code Here

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

      tx = aSession.beginTransaction();
      tmpFunctId = functId;

      if(rootFolderID != null) {
        while (tmpFunctId.intValue() != rootFolderID.intValue()){
          SbiFunctions hibFunct = (SbiFunctions)aSession.load(SbiFunctions.class, tmpFunctId);
          tmpFunctId = (hibFunct.getParentFunct() != null)? hibFunct.getParentFunct().getFunctId(): null;
          realResult.add(toLowFunctionality(hibFunct, false));
        }

        SbiFunctions hibFunct = (SbiFunctions)aSession.load(SbiFunctions.class, rootFolderID);
        realResult.add(toLowFunctionality(hibFunct, false));
      } else {
        while (tmpFunctId != null){
          SbiFunctions hibFunct = (SbiFunctions)aSession.load(SbiFunctions.class, tmpFunctId);
          tmpFunctId = (hibFunct.getParentFunct() != null)? hibFunct.getParentFunct().getFunctId(): null;
          realResult.add(toLowFunctionality(hibFunct, false));
        }
      }

      tx.commit();
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.