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

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


  private boolean canBeMovedDown(LowFunctionality folder) {
    Integer parentId = folder.getParentId();
    Integer currentProg = folder.getProg();
    Iterator it = _objectsList.iterator();
    while (it.hasNext()) {
      LowFunctionality aFolder = (LowFunctionality) it.next();
      if (parentId.equals(aFolder.getParentId()) && currentProg.intValue() < aFolder.getProg().intValue())
        return true;
    }
    return false;
  }
View Full Code Here


    StringBuffer htmlStream = new StringBuffer();
    htmlStream.append("        <div class='UITabs'>\n");
    htmlStream.append("          <div class='first-tab-level' >\n");
    Iterator it = objectsList.iterator();
    while (it.hasNext()) {
      LowFunctionality folder = (LowFunctionality) it.next();
      String linkClass = "tab";
      if (folder.getPath().equals(initialPath)) linkClass = "tab selected";
      htmlStream.append("            <div class='" + linkClass + "'>\n");
      Map changeFolderUrlPars = new HashMap();
      changeFolderUrlPars.put(ObjectsTreeConstants.PAGE, ExecutionWorkspaceModule.MODULE_PAGE);
      changeFolderUrlPars.put(TreeObjectsModule.PATH_SUBTREE, folder.getPath());
      if(ChannelUtilities.isWebRunning()) {
        changeFolderUrlPars.put(SpagoBIConstants.WEBMODE, "TRUE");
      }
      String changeFolderUrl = urlBuilder.getUrl(httpRequest, changeFolderUrlPars);
      htmlStream.append("              <a href='" + changeFolderUrl + "'>\n");
      htmlStream.append("                " + folder.getName() + "\n");
      htmlStream.append("              </a>\n");
      htmlStream.append("            </div>\n");
    }
    htmlStream.append("");
    htmlStream.append("          </div>");
View Full Code Here

   
    htmlStream.append("        " + treeName + " = new dTree('" + treeName + "', '" + context + "');\n");
    htmlStream.append("            " + treeName + ".add(" + dTreeRootId + ",-1,'"+nameTree+"');\n");
    Iterator it = objectsList.iterator();
    while (it.hasNext()) {
      LowFunctionality folder = (LowFunctionality) it.next();
      if(folder.getName()!=null)
        logger.debug("functionality "+folder.getName());
      /* ********* start luca changes *************** */
      //boolean isUserFunct = folder.getPath().startsWith("/"+profile.getUserUniqueIdentifier());

      if (initialPath != null) {
        if (initialPath.equalsIgnoreCase(folder.getPath())) addItemForJSTree(htmlStream, folder, false, true);
        else addItemForJSTree(htmlStream, folder, false, false);
      } else {
        if (folder.getParentId() == null) addItemForJSTree(htmlStream, folder, true, false);
        else addItemForJSTree(htmlStream, folder, false, false);
      }
    }

    htmlStream.append("        document.getElementById('treeAdminObjTd" + requestIdentity + "').innerHTML = " + treeName + ";\n");
View Full Code Here

        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
View Full Code Here

      int index = path.lastIndexOf("/");
      String parentPath = path.substring(0, index);
      response.setAttribute(AdmintoolsConstants.PATH_PARENT, parentPath);
      response.setAttribute(AdmintoolsConstants.MODALITY, modality);
      if (typeFunct.equals("LOW_FUNCT")) {
        LowFunctionality funct = DAOFactory.getLowFunctionalityDAO()
            .loadLowFunctionalityByPath(path, false);
        response.setAttribute(FUNCTIONALITY_OBJ, funct);
      }
    } catch (EMFUserError eex) {
      EMFErrorHandler errorHandler = getErrorHandler();
View Full Code Here

   */
  private void modDettaglioFunctionality(SourceBean request, String mod,
      SourceBean response) throws EMFUserError, SourceBeanException {
    try {
      // **********************************************************************
      LowFunctionality lowFunct = recoverLowFunctionalityDetails(request,
          mod);
      response.setAttribute(FUNCTIONALITY_OBJ, lowFunct);
      response.setAttribute(AdmintoolsConstants.MODALITY, mod);
      EMFErrorHandler errorHandler = getErrorHandler();
      // if(mod.equalsIgnoreCase(AdmintoolsConstants.DETAIL_INS)) {
      // String pathParent =
      // (String)request.getAttribute(AdmintoolsConstants.PATH_PARENT);
      // response.setAttribute(AdmintoolsConstants.PATH_PARENT,
      // pathParent);
      // }

      // if there are some validation errors into the errorHandler does
      // not write into DB
      Collection errors = errorHandler.getErrors();
      if (errors != null && errors.size() > 0) {
        Iterator iterator = errors.iterator();
        while (iterator.hasNext()) {
          Object error = iterator.next();
          if (error instanceof EMFValidationError) {
            Integer parentFolderId = lowFunct.getParentId();
            LowFunctionality parentFolder = null;
            if (parentFolderId != null) {
              parentFolder = DAOFactory.getLowFunctionalityDAO()
                  .loadLowFunctionalityByID(parentFolderId,
                      false);
            }
            if (parentFolder == null) {
              throw new Exception("Parent folder not available.");
            } else {
              response.setAttribute(
                  AdmintoolsConstants.PATH_PARENT,
                  parentFolder.getPath());
            }
            return;
          }
        }
      }
View Full Code Here

    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);
View Full Code Here

          .getAttribute(AdmintoolsConstants.PATH_PARENT);
      response.setAttribute(AdmintoolsConstants.MODALITY, modality);
      response.setAttribute(AdmintoolsConstants.PATH_PARENT, pathParent);

      if (typeFunct.equals("LOW_FUNCT")) {
        LowFunctionality funct = new LowFunctionality();
        funct.setDescription("");
        funct.setId(new Integer(0));
        funct.setCode("");
        funct.setName("");
        LowFunctionality parentFunct = DAOFactory
            .getLowFunctionalityDAO().loadLowFunctionalityByPath(
                pathParent, false);
        Role[] execRoles = new Role[0];
        Role[] devRoles = new Role[0];
        Role[] testRoles = new Role[0];
        Role[] createRoles = new Role[0];
        if (parentFunct != null) {
          execRoles = parentFunct.getExecRoles();
          devRoles = parentFunct.getDevRoles();
          testRoles = parentFunct.getTestRoles();
          createRoles = parentFunct.getCreateRoles();
        }
        funct.setTestRoles(testRoles);
        funct.setDevRoles(devRoles);
        funct.setExecRoles(execRoles);
        funct.setCreateRoles(createRoles);
View Full Code Here

      String idRoleStr = (String) createAttrsList.get(i);
      createRoles[i] = DAOFactory.getRoleDAO().loadByID(
          new Integer(idRoleStr));
    }

    LowFunctionality lowFunct = null;

    if (mod.equalsIgnoreCase(AdmintoolsConstants.DETAIL_INS)) {
      String pathParent = (String) request
          .getAttribute(AdmintoolsConstants.PATH_PARENT);
      LowFunctionality parentFunct = DAOFactory.getLowFunctionalityDAO()
          .loadLowFunctionalityByPath(pathParent, false);
      if (parentFunct == null) {
        EMFValidationError error = new EMFValidationError(
            EMFErrorSeverity.ERROR,
            AdmintoolsConstants.PATH_PARENT, "1002", new Vector());
        getErrorHandler().addError(error);
      }
      String newPath = pathParent + "/" + code;
      // SourceBean dataLoad = new SourceBean("dataLoad");
      LowFunctionality funct = DAOFactory.getLowFunctionalityDAO()
          .loadLowFunctionalityByPath(newPath, false);
      if (funct != null) {
        HashMap params = new HashMap();
        params.put(AdmintoolsConstants.PAGE,
            BIObjectsModule.MODULE_PAGE);
        // params.put(SpagoBIConstants.ACTOR,
        // SpagoBIConstants.ADMIN_ACTOR);
        params.put(SpagoBIConstants.OPERATION,
            SpagoBIConstants.FUNCTIONALITIES_OPERATION);
        EMFValidationError error = new EMFValidationError(
            EMFErrorSeverity.ERROR, "code", "1005", new Vector(),
            params);
        getErrorHandler().addError(error);
      }
      if (DAOFactory.getLowFunctionalityDAO().existByCode(code) != null) {
        EMFValidationError error = new EMFValidationError(
            EMFErrorSeverity.ERROR, "code", "1027");
        getErrorHandler().addError(error);
      }
      lowFunct = new LowFunctionality();
      lowFunct.setCode(code);
      lowFunct.setDescription(description);
      lowFunct.setName(name);
      lowFunct.setPath(newPath);
      lowFunct.setDevRoles(devRoles);
View Full Code Here

    List childs = DAOFactory.getLowFunctionalityDAO()
        .loadSubLowFunctionalities(parentPath, false);
    if (childs.size() != 0) {
      Iterator i = childs.iterator();
      while (i.hasNext()) {
        LowFunctionality childNode = (LowFunctionality) i.next();
        String childPath = childNode.getPath();
        // LowFunctionality lowFuncParent =
        // DAOFactory.getLowFunctionalityDAO().loadLowFunctionalityByPath(parentPath);
        LowFunctionality lowFuncChild = DAOFactory
            .getLowFunctionalityDAO().loadLowFunctionalityByPath(
                childPath, false);
        if (lowFuncChild != null) {
          // control childs permissions and fathers permissions
          // remove from childs those persmissions that are not
          // present in the fathers
          // control for test Roles
          Role[] testChildRoles = lowFuncChild.getTestRoles();
          // Role[] testParentRoles = lowFuncParent.getTestRoles();
          // ArrayList newTestChildRoles = new ArrayList();
          // HashMap rolesToErase = new HashMap();
          for (int j = 0; j < testChildRoles.length; j++) {
            String rule = testChildRoles[j].getId().toString();
            if (!isParentRule(rule, lowFuncParent,
                SpagoBIConstants.PERMISSION_ON_FOLDER_TO_TEST)) {
              ArrayList roles = new ArrayList();
              roles.add(0, lowFuncChild.getId());
              roles.add(1, testChildRoles[j].getId());
              roles.add(
                  2,
                  SpagoBIConstants.PERMISSION_ON_FOLDER_TO_TEST);
              rolesToErase.add(roles);
              lowFuncChild = eraseRolesFromFunctionality(
                  lowFuncChild,
                  rule,
                  SpagoBIConstants.PERMISSION_ON_FOLDER_TO_TEST);
              // rolesToErase.put(lowFuncChild.getId(),testChildRoles[j].getId());
              // DAOFactory.getLowFunctionalityDAO().deleteFunctionalityRole(lowFuncChild,testChildRoles[j].getId());
            }
          }
          // control for development roles
          Role[] devChildRoles = lowFuncChild.getDevRoles();
          // Role[] devParentRoles = lowFuncParent.getDevRoles();
          // ArrayList newDevChildRoles = new ArrayList();
          for (int j = 0; j < devChildRoles.length; j++) {
            String rule = devChildRoles[j].getId().toString();
            if (!isParentRule(
                rule,
                lowFuncParent,
                SpagoBIConstants.PERMISSION_ON_FOLDER_TO_DEVELOP)) {
              ArrayList roles = new ArrayList();
              roles.add(0, lowFuncChild.getId());
              roles.add(1, devChildRoles[j].getId());
              roles.add(
                  2,
                  SpagoBIConstants.PERMISSION_ON_FOLDER_TO_DEVELOP);
              rolesToErase.add(roles);
              lowFuncChild = eraseRolesFromFunctionality(
                  lowFuncChild,
                  rule,
                  SpagoBIConstants.PERMISSION_ON_FOLDER_TO_DEVELOP);
              // rolesToErase.put(lowFuncChild.getId(),devChildRoles[j].getId());
              // DAOFactory.getLowFunctionalityDAO().deleteFunctionalityRole(lowFuncChild,devChildRoles[j].getId());
            }
          }
          // control for execution roles
          Role[] execChildRoles = lowFuncChild.getExecRoles();
          // Role[] execParentRoles = lowFuncParent.getExecRoles();
          // ArrayList newExecChildRoles = new ArrayList();
          for (int j = 0; j < execChildRoles.length; j++) {
            String rule = execChildRoles[j].getId().toString();
            if (!isParentRule(
                rule,
                lowFuncParent,
                SpagoBIConstants.PERMISSION_ON_FOLDER_TO_EXECUTE)) {
              ArrayList roles = new ArrayList();
              roles.add(0, lowFuncChild.getId());
              roles.add(1, execChildRoles[j].getId());
              roles.add(
                  2,
                  SpagoBIConstants.PERMISSION_ON_FOLDER_TO_EXECUTE);
              rolesToErase.add(roles);
              lowFuncChild = eraseRolesFromFunctionality(
                  lowFuncChild,
                  rule,
                  SpagoBIConstants.PERMISSION_ON_FOLDER_TO_EXECUTE);
              // rolesToErase.put(lowFuncChild.getId(),execChildRoles[j].getId());
              // DAOFactory.getLowFunctionalityDAO().deleteFunctionalityRole(lowFuncChild,execChildRoles[j].getId());
            }
          }
          // control for development roles
          Role[] createChildRoles = lowFuncChild.getCreateRoles();
          for (int j = 0; j < createChildRoles.length; j++) {
            String rule = createChildRoles[j].getId().toString();
            if (!isParentRule(rule, lowFuncParent,
                SpagoBIConstants.PERMISSION_ON_FOLDER_TO_CREATE)) {
              ArrayList roles = new ArrayList();
              roles.add(0, lowFuncChild.getId());
              roles.add(1, createChildRoles[j].getId());
              roles.add(
                  2,
                  SpagoBIConstants.PERMISSION_ON_FOLDER_TO_CREATE);
              rolesToErase.add(roles);
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.