Package it.eng.spagobi.analiticalmodel.functionalitytree.bo

Examples of it.eng.spagobi.analiticalmodel.functionalitytree.bo.LowFunctionality


    boolean canTest = false;
    if(isAbleToExec(state, profile)) {

      Iterator folderIt = folders.iterator();
      while(folderIt.hasNext()){
        LowFunctionality folder =(LowFunctionality) folderIt.next();
        canTest = canTestInternal(folder, profile);
        if (canTest){
          logger.debug("OUT.return true");
          monitor.stop();
          return true;
View Full Code Here


    int visibleInstances = 0 ;
    if (initialPath != null && !initialPath.trim().equals("")) {
      Iterator folderIt = folders.iterator();
      while(folderIt.hasNext()){
        LowFunctionality folder =(LowFunctionality) folderIt.next();
        String folderPath = folder.getPath();
        if (folderPath.equalsIgnoreCase(initialPath) || folderPath.startsWith(initialPath + "/")) {
          visibleInstances++;
        }       
      }
    }else{
View Full Code Here

   * @return A boolean control value
   */
  public static boolean canExec(Integer folderId, IEngUserProfile profile) {
    Monitor monitor =MonitorFactory.start("spagobi.core.ObjectAccessVerifier.canExec");
    logger.debug("IN");
    LowFunctionality folder = null;
    try {
      folder = DAOFactory.getLowFunctionalityDAO().loadLowFunctionalityByID(folderId, false);
    } catch (Exception e) {
      logger.error("Exception in loadLowFunctionalityByID", e);

View Full Code Here

    } catch (EMFInternalError emfie) {
      logger.error("EMFInternalError in profile.getRoles", emfie);
      return false;
    }

    LowFunctionality funct = null;
    try {
      funct = DAOFactory.getLowFunctionalityDAO().loadLowFunctionalityByID(folderId, false);
    } catch (Exception e) {
      logger.error("Exception in loadLowFunctionalityByID", e);
      logger.debug("OUT. return false");
      return false;
    }
    Role[] testRoles = funct.getTestRoles();
    List testRoleNames = new ArrayList();
    for (int i = 0; i < testRoles.length; i++) {
      Role role = testRoles[i];
      testRoleNames.add(role.getName());
    }
View Full Code Here

      logger.debug("OUT. return false");
      monitor.stop();
      return false;
    }

    LowFunctionality funct = null;
    try {
      funct = DAOFactory.getLowFunctionalityDAO().loadLowFunctionalityByID(folderId, false);
    } catch (Exception e) {
      logger.error("EMFInternalError in loadLowFunctionalityByID", e);
      logger.debug("OUT. return false");
      monitor.stop();
      return false;
    }
    Role[] devRoles = funct.getDevRoles();
    List devRoleNames = new ArrayList();
    for (int i = 0; i < devRoles.length; i++) {
      Role role = devRoles[i];
      devRoleNames.add(role.getName());
    }
View Full Code Here

          if (!exists) {
            // create personal folder if it doesn't exist
            UserUtilities.createUserFunctionalityRoot(userProfile);
          }
          // load personal folder to get its id
          LowFunctionality lf = UserUtilities.loadUserFunctionalityRoot(userProfile);
          funcId = lf.getId();
        }
        functionalities.add(funcId);
      }   
      o.setFunctionalities(functionalities);
     
View Full Code Here

     
      String functID = getAttributeAsString(FOLDER_ID);   
      logger.debug("Parameter [" + FOLDER_ID + "] is equal to [" + functID + "]");
     
      //getting default folder (root)
      LowFunctionality rootFunct = DAOFactory.getLowFunctionalityDAO().loadRootLowFunctionality(false);
      if (functID == null || functID.equalsIgnoreCase(ROOT_NODE_ID)){
        isRoot = true;
        functID = String.valueOf(rootFunct.getId());
      }else if (functID.equalsIgnoreCase(rootFunct.getId().toString())) {
        isRoot = true;
      }
     
     
      SessionContainer sessCont = getSessionContainer();
      SessionContainer permCont = sessCont.getPermanentContainer();
      IEngUserProfile profile = (IEngUserProfile)permCont.getAttribute(IEngUserProfile.ENG_USER_PROFILE);
     
      LowFunctionality targetFunct = DAOFactory.getLowFunctionalityDAO().loadLowFunctionalityByID(new Integer(functID), false);
      isHome = "USER_FUNCT".equalsIgnoreCase( targetFunct.getCodType() );
   
      //getting children documents
      //LowFunctionality lowFunct = DAOFactory.getLowFunctionalityDAO().loadLowFunctionalityByID(functID, true);
      //objects = lowFunct.getBiObjects();
      List tmpObjects = DAOFactory.getBIObjectDAO().loadBIObjects(Integer.valueOf(functID), profile,isHome);
View Full Code Here

        if(permission_on_folder!=null && permission_on_folder.equals(PERMISSION_CREATION)){
          folders = lfDao.loadUserFunctionalitiesFiltered(null, false, profile, PERMISSION_CREATION);
          String userId = (String) ((UserProfile) profile).getUserId();
          // if user functionality does not exist, add it to the list but without creating it (it will be created if necessary)
          if (!DAOFactory.getLowFunctionalityDAO().checkUserRootExists(userId)) {
            LowFunctionality userFunct = getPersonalFolder((UserProfile) profile);
            folders.add(userFunct);
          }
        }else{
          folders = lfDao.loadUserFunctionalities(null, false, profile)
        }
View Full Code Here

   * @param profile The user profile
   * @return A LowFunctionality object with the data of a user functionality and id = -1
   */
  private LowFunctionality getPersonalFolder(UserProfile profile) {
    String userId = (String) profile.getUserId();
    LowFunctionality userFunct = new LowFunctionality();
      userFunct.setCode("ufr_" + userId);
      userFunct.setDescription("User Functionality Root");
      userFunct.setName(userId);
      userFunct.setPath("/" + userId);
      userFunct.setId(-1);
      return userFunct;
  }
View Full Code Here

    SessionContainer session = requestContainer.getSessionContainer();
    SessionContainer permanentSession = session.getPermanentContainer();
    profile = (IEngUserProfile) permanentSession.getAttribute(IEngUserProfile.ENG_USER_PROFILE);
    // loads first level functionalities
    functionDAO = DAOFactory.getLowFunctionalityDAO();
    LowFunctionality root = functionDAO.loadRootLowFunctionality(false);
    if (root == null) {
      logger.error("Missing root functionality!");
      throw new Exception("Missing root functionality!");
    }
    List firstLevelFunctions = functionDAO.loadChildFunctionalities(root.getId(), false);
    // filters the first level functionalities by the profile execution permission
    Iterator it = firstLevelFunctions.iterator();
    while (it.hasNext()) {
      LowFunctionality aFolder = (LowFunctionality) it.next();
      if (ObjectsAccessVerifier.canExec(aFolder, profile)) firtsLevelExecutableFolders.add(aFolder);
    }
    if (firtsLevelExecutableFolders.size() == 0) {
      logger.warn("The user has no executable folders");
      exit(response);
    }
   
    // finds the base folder between the filtered folders specified by request
    String folderPath = (String) request.getAttribute(TreeObjectsModule.PATH_SUBTREE);
    LowFunctionality baseFolder = null;
    if (folderPath != null) {
      it = firtsLevelExecutableFolders.iterator();
      while (it.hasNext()) {
        LowFunctionality aFolder = (LowFunctionality) it.next();
        if (aFolder.getPath().equals(folderPath)) {
          baseFolder = aFolder;
          break;
        }
      }
    }
View Full Code Here

TOP

Related Classes of it.eng.spagobi.analiticalmodel.functionalitytree.bo.LowFunctionality

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.