Package it.eng.spagobi.analiticalmodel.functionalitytree.dao

Examples of it.eng.spagobi.analiticalmodel.functionalitytree.dao.ILowFunctionalityDAO


      // insert functionalities and association with object
      List functs = biobj.getFunctionalities();
      Iterator iterFunct = functs.iterator();
      while (iterFunct.hasNext()) {
        Integer functId = (Integer) iterFunct.next();
        ILowFunctionalityDAO lowFunctDAO = DAOFactory.getLowFunctionalityDAO();
        LowFunctionality funct = lowFunctDAO.loadLowFunctionalityByID(functId, false);
        if (funct.getCodType().equals(SpagoBIConstants.USER_FUNCTIONALITY_TYPE_CODE)) {
          logger.debug("User folder [" + funct.getPath() + "] will be not exported.");
          // if the folder is a personal folder, it is not exported
          continue;
        }
View Full Code Here


    }

    // recursively insert parent functionalities
    Integer parentId = funct.getParentId();
    if(parentId!=null){
      ILowFunctionalityDAO lowFunctDAO = DAOFactory.getLowFunctionalityDAO();
      LowFunctionality functPar = lowFunctDAO.loadLowFunctionalityByID(parentId, false);
      insertFunctionality(functPar, session);
    }
    logger.debug("OUT");

  }
View Full Code Here

     
      SessionContainer sessCont = getSessionContainer();
      SessionContainer permCont = sessCont.getPermanentContainer();
      IEngUserProfile profile = (IEngUserProfile)permCont.getAttribute(IEngUserProfile.ENG_USER_PROFILE);
     
      ILowFunctionalityDAO lfDao = DAOFactory.getLowFunctionalityDAO();
      if (nodeId.equalsIgnoreCase(ROOT_NODE_ID)) {
        //getting all I� level folders
        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)
        }
      } else {
        //getting children folders
        if(permission_on_folder!=null && permission_on_folder.equals(PERMISSION_CREATION)){
          folders = lfDao.loadUserFunctionalitiesFiltered(new Integer(nodeId), false, profile, PERMISSION_CREATION);
        }else{
          folders = lfDao.loadUserFunctionalities(new Integer(nodeId), false, profile)
        }
      }
      HttpServletRequest httpRequest = getHttpRequest();
      MessageBuilder m = new MessageBuilder();
      Locale locale = m.getLocale(httpRequest);
View Full Code Here

        biobjdao.eraseBIObject(obj, fId);
        logger.debug("Object deleted by administrator")
      }
      else
      {
        ILowFunctionalityDAO functDAO = DAOFactory.getLowFunctionalityDAO();
        LowFunctionality lowFunc = functDAO.loadLowFunctionalityByID(fId, false);

        if(lowFunc==null){
          logger.error("Functionality does not exist");
          throw new Exception("Functionality does not exist");         
        }
View Full Code Here

            logger.error("Error to delete Document", e);
            throw new SpagoBIServiceException(SERVICE_NAME, "Error to delete Document", e);
          }
        } else {
          String userId = ((UserProfile)userProfile).getUserId().toString();
          ILowFunctionalityDAO functDAO = DAOFactory.getLowFunctionalityDAO();
          LowFunctionality lowFunc = functDAO.loadLowFunctionalityByID(iFunc, false);

          if(lowFunc==null){
            logger.error("Functionality does not exist");
            throw new Exception("Functionality does not exist");         
          }
View Full Code Here

    }

    private void initialize() {
  logger.debug("IN");
  try {
      ILowFunctionalityDAO functionalityDAO = DAOFactory.getLowFunctionalityDAO();
      List functions = functionalityDAO.loadAllLowFunctionalities(false);
      if (functions != null && functions.size() > 0) {
    logger.debug("Tree already initialized");

      } else {
    List nodes = _config.getAttributeAsList("TREE_INITIAL_STRUCTURE.NODE");
    Iterator it = nodes.iterator();
    while (it.hasNext()) {
        SourceBean node = (SourceBean) it.next();
        String code = (String) node.getAttribute("code");
        String name = (String) node.getAttribute("name");
        String description = (String) node.getAttribute("description");
        String codeType = (String) node.getAttribute("codeType");
        String parentPath = (String) node.getAttribute("parentPath");
        LowFunctionality functionality = new LowFunctionality();
        functionality.setCode(code);
        functionality.setName(name);
        functionality.setDescription(description);
        functionality.setCodType(codeType);
        functionality.setPath(parentPath + "/" + code);
        if (parentPath != null && !parentPath.trim().equals("")) {
      // if it is not the root load the id of the parent path
      LowFunctionality parentFunctionality = functionalityDAO.loadLowFunctionalityByPath(parentPath,
        false);
      functionality.setParentId(parentFunctionality.getId());
        } else {
      // if it is the root the parent path id is set to null
      functionality.setParentId(null);
        }
        // sets no permissions
        functionality.setDevRoles(new Role[0]);
        functionality.setExecRoles(new Role[0]);
        functionality.setTestRoles(new Role[0]);
        functionality.setCreateRoles(new Role[0]);
        functionalityDAO.insertLowFunctionality(functionality, null);
    }
      }
  } catch (EMFUserError e) {
      logger.error("EMFUserError", e);
View Full Code Here

  public SDKFunctionality getDocumentsAsTree(String initialPath) {
    logger.debug("IN: initialPath = [" + initialPath + "]");
    SDKFunctionality toReturn = null;
    try {
      IEngUserProfile profile = getUserProfile();
      ILowFunctionalityDAO functionalityDAO = DAOFactory.getLowFunctionalityDAO();
      LowFunctionality initialFunctionality = null;
      if (initialPath == null || initialPath.trim().equals("")) {
        // loading root functionality, everybody can see it
        initialFunctionality = functionalityDAO.loadRootLowFunctionality(false);
      } else {
        initialFunctionality = functionalityDAO.loadLowFunctionalityByPath(initialPath, false);
      }
      boolean canSeeFunctionality = ObjectsAccessVerifier.canSee(initialFunctionality, profile);
      if (canSeeFunctionality) {
        toReturn = new SDKObjectsConverter().fromLowFunctionalityToSDKFunctionality(initialFunctionality);
        setFunctionalityContent(toReturn);
View Full Code Here

  private void delFunctionality(SourceBean request, String mod,
      SourceBean response) throws EMFUserError, SourceBeanException {
    try {
      if (typeFunct.equals("LOW_FUNCT")) {
        String path = (String) request.getAttribute(PATH);
        ILowFunctionalityDAO funcdao = DAOFactory
            .getLowFunctionalityDAO();
        LowFunctionality funct = funcdao.loadLowFunctionalityByPath(
            path, false);
        SessionContainer permSess = getRequestContainer()
            .getSessionContainer().getPermanentContainer();
        IEngUserProfile profile = (IEngUserProfile) permSess
            .getAttribute(IEngUserProfile.ENG_USER_PROFILE);
        funcdao.eraseLowFunctionality(funct, profile);
      }
    } catch (EMFUserError eex) {
      EMFErrorHandler errorHandler = getErrorHandler();
      errorHandler.addError(eex);
      return;
View Full Code Here

     */
    public static boolean userFunctionalityRootExists(String username) throws Exception {
  boolean exists = false;
  try {
    logger.debug("****  username checked: " + username);
      ILowFunctionalityDAO functdao = DAOFactory.getLowFunctionalityDAO();
      exists = functdao.checkUserRootExists(username);
  } catch (Exception e) {
    logger.error("Error while checking user functionality root existence", e);
      throw new Exception("Unable to check user functionality existence", e);
  }
  return exists;
View Full Code Here

      userFunct.setCode("ufr_" + userId);
      userFunct.setDescription("User Functionality Root");
      userFunct.setName(userId);
      userFunct.setPath("/" + userId);
      //userFunct.setExecRoles(rolesArr);
      ILowFunctionalityDAO functdao = DAOFactory.getLowFunctionalityDAO();
      functdao.insertUserFunctionality(userFunct);
  } catch (Exception e) {
     logger.error("Error while creating user functionality root", e);
      throw new Exception("Unable to create user functionality root", e);
  }finally{
    logger.debug("OUT");
View Full Code Here

TOP

Related Classes of it.eng.spagobi.analiticalmodel.functionalitytree.dao.ILowFunctionalityDAO

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.