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

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


   
    htmlStream.append("<SCRIPT language='JavaScript' src='"+renderResponse.encodeURL(renderRequest.getContextPath() + "/js/prototype/javascripts/prototype.js" )+"'></SCRIPT>");
    htmlStream.append("<SCRIPT language='JavaScript' src='"+renderResponse.encodeURL(renderRequest.getContextPath() + "/js/menu.js" )+"'></SCRIPT>");
    htmlStream.append("<SCRIPT language='JavaScript' src='"+renderResponse.encodeURL(renderRequest.getContextPath() + "/js/spagobi.js" )+"'></SCRIPT>");
   
    LowFunctionality root = findRoot();
    List childs = findChilds(root);
    if(!childs.isEmpty()) {
      generateMenu(root, childs, htmlStream, true, 0);
      processChilds(childs, htmlStream, jsStream, 1);
    }
View Full Code Here


  private void processChilds(List childs, StringBuffer htmlStream, StringBuffer jsStream, int level) {
    Iterator iterChilds = childs.iterator();
    while(iterChilds.hasNext()) {
      Object obj = iterChilds.next();
      if(obj instanceof LowFunctionality) {
        LowFunctionality folder = (LowFunctionality)obj;
        List folderchilds = findChilds(folder);
        if(!folderchilds.isEmpty()) {
          jsStream.append("  menulevels[menulevels.length] = new Array('"+folder.getId()+"', '"+level+"');\n");
          processChilds(folderchilds, htmlStream, jsStream, level + 1);
          generateMenu(folder, folderchilds, htmlStream, false, level);
        }
      }
    }
View Full Code Here

  private void addMenuItemHtmlCode(List menuobjs, StringBuffer htmlStream, int level) {
    Iterator iterChilds = menuobjs.iterator();
    while(iterChilds.hasNext()) {
      Object obj = iterChilds.next();
      if(obj instanceof LowFunctionality) {
        LowFunctionality folderchild = (LowFunctionality)obj;
        String imgFolder = PortletUtilities.createPortletURLForResource(httpRequest, "/img/treefolder.gif");
        htmlStream.append("      <tr valign='middle' height='30' id='menu_link_"+folderchild.getId()+"' class='menuItem' " +
                      "             onmouseover=\"openmenu('"+folderchild.getId()+"', event);overHandler(this, '"+level+"', event, '"+folderchild.getId()+"');\" " +
                      "             onmouseout=\"outHandler(this, event);checkclosemenu('"+folderchild.getId()+"', event);\" >  \n");
        htmlStream.append("        <td style='vertical-align:middle;' width='40' align='center' valign='middle' >\n");
        htmlStream.append("          <img width='20' height='20' src=\""+imgFolder+"\" /> \n");
        htmlStream.append("        </td>\n");
        htmlStream.append("        <td style='vertical-align:middle;'>\n");
        htmlStream.append("          <a class='menuLink' href='javascript:void(0)' >"+folderchild.getName()+"</a>\n");
        htmlStream.append("        </td>\n");
        htmlStream.append("        <td style='vertical-align:middle;' id='menu_link_last_"+folderchild.getId()+"' width='25' align='center'>\n");
        htmlStream.append("          <span class='menuArrow'>&gt;&gt;</span>\n");
        htmlStream.append("        </td>\n");
        htmlStream.append("      </tr>  \n");
      } else if (obj instanceof BIObject) {
        BIObject biobj = (BIObject)obj;
View Full Code Here

    // add biobjects
    roots.addAll(father.getBiObjects());
    // add child folders
    Iterator iterFolder1 = objectsList.iterator();
    while(iterFolder1.hasNext()){
      LowFunctionality folder1 = (LowFunctionality)iterFolder1.next();
      Integer parId = folder1.getParentId();
      if(parId.equals(father.getId())) {
        roots.add(folder1);
      }
    }
    return roots;
View Full Code Here

    return roots;
  }
 
 
  private LowFunctionality findRoot() {
    LowFunctionality root = null;
    Iterator iterFolder1 = objectsList.iterator();
    while(iterFolder1.hasNext()){
      LowFunctionality folder1 = (LowFunctionality)iterFolder1.next();
      Integer parId = folder1.getParentId();
      Iterator iterFolder2 = objectsList.iterator();
      boolean hasFather = false;
      while(iterFolder2.hasNext()) {
        LowFunctionality folder2 = (LowFunctionality)iterFolder2.next();
        if(folder2.getId().equals(parId)){
          hasFather = true;
        }
      }
      if(!hasFather) {
        root = folder1;
View Full Code Here

    }    */  
       htmlStream.append("        treeExecObj = new dTree('treeExecObj');\n");
       htmlStream.append("            treeExecObj.add(" + dTreeRootId + ",-1,'"+nameTree+"');\n");
       Iterator it = objectsList.iterator();
       while (it.hasNext()) {
         LowFunctionality folder = (LowFunctionality) it.next();
         if (initialPath != null) {
           if (initialPath.equalsIgnoreCase(folder.getPath())) addItemForJSTree(htmlStream, folder, true);
           else addItemForJSTree(htmlStream, folder, false);
         } else {
           if (folder.getParentId() == null) addItemForJSTree(htmlStream, folder, true);
           else addItemForJSTree(htmlStream, folder, false);
         }
       }
      //htmlStream.append("        document.write(treeExecObj);\n");
       htmlStream.append("        document.getElementById('treeMenuObjTd" + requestIdentity + "').innerHTML = treeExecObj;\n");
View Full Code Here

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

    // loading contained functionalities
    List containedFunctionalitiesList = DAOFactory.getLowFunctionalityDAO().loadChildFunctionalities(parentFunctionality.getId(), false);
    List visibleFunctionalitiesList = new ArrayList();
    for (Iterator it = containedFunctionalitiesList.iterator(); it.hasNext();) {
      LowFunctionality lowFunctionality = (LowFunctionality) it.next();
      boolean canSeeFunctionality = ObjectsAccessVerifier.canSee(lowFunctionality, profile);
      if (canSeeFunctionality) {
        SDKFunctionality childFunctionality = new SDKObjectsConverter().fromLowFunctionalityToSDKFunctionality(lowFunctionality);
        visibleFunctionalitiesList.add(childFunctionality);
        // recursion
View Full Code Here

      Engine qbeEngine =  lstQbeEngines.get(0);
      obj.setEngine(qbeEngine);
     
      //sets the default functionality (personal folder). 
      List functionalities = new ArrayList();
      LowFunctionality funct = null;
      funct = DAOFactory.getLowFunctionalityDAO().loadLowFunctionalityByPath("/" + userId , false);
      if (funct != null){
        functionalities.add(funct.getId());
        obj.setFunctionalities(functionalities);
      } else {
        //the personal folder doesn't exist yet. It creates it, and uses it.
        UserUtilities.createUserFunctionalityRoot(profile);
        logger.error("Error while retrieving Functionality identifier.");
        funct = DAOFactory.getLowFunctionalityDAO().loadLowFunctionalityByPath("/" + userId , false);
        functionalities.add(funct.getId());
        obj.setFunctionalities(functionalities);
      }
      //sets the template's content
      ObjTemplate objTemplate = new ObjTemplate();
      objTemplate.setActive(new Boolean(true));
View Full Code Here

   *
   * @see it.eng.spagobi.analiticalmodel.functionalitytree.dao.ILowFunctionalityDAO#loadLowFunctionalityByID(java.lang.Integer)
   */
  public LowFunctionality loadLowFunctionalityByID(Integer functionalityID, boolean recoverBIObjects) throws EMFUserError {
    logger.debug( "IN" );
    LowFunctionality funct = null;
    Session aSession = null;
    Transaction tx = null;
    try {
      aSession = getSession();
      tx = aSession.beginTransaction();
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.