Package org.palo.viewapi.internal

Examples of org.palo.viewapi.internal.ExplorerTreeNode


//      addRemainingViewsToRootFolder(allViews, forUser);
//    } catch (OperationFailedException e) {
//      e.printStackTrace();
//    }
    FolderService folderService = ServiceProvider.getFolderService(forUser);
    ExplorerTreeNode folderRoot = folderService.getTreeRoot();
    ExplorerTreeNode[] kids = folderRoot.getChildren();
    boolean hasKids = kids != null && kids.length > 0;
    //it seems that root is always a StaticFolder...
    if (folderRoot instanceof StaticFolder) {
      XStaticFolder xRoot = new XStaticFolder(folderRoot.getId(),
          folderRoot.getName());
      xRoot.setHasChildren(hasKids);
      return new XObject[] {wrap(xRoot)};
    }
    return new XObject[0];
  }
View Full Code Here


    return allViews;
  }

  private final void removeViewsWhichAreInFolders(final List<View> allViews, AuthUser user) {
    FolderService folderService = ServiceProvider.getFolderService(user);
    ExplorerTreeNode folderRoot = folderService.getTreeRoot();
    FolderVisitor visitor = new FolderVisitor() {
      public boolean visit(ExplorerTreeNode folder) {
        if(folder instanceof FolderElement) {
          ParameterReceiver srcObj =
            ((FolderElement) folder).getSourceObject();
View Full Code Here

  private ExplorerTreeNode find(ExplorerTreeNode node, String id) {
    if (node.getId().equals(id)) {
      return node;
    }
    for (ExplorerTreeNode nd: node.getChildren()) {
      ExplorerTreeNode result = find(nd, id);
      if (result != null) {
        return result;
      }
    }
    return null;
View Full Code Here

  private XObject[] loadFolder(XStaticFolder xFolder, AuthUser user) {
    FolderService folderService = ServiceProvider.getFolderService(user);
    //ExplorerTreeNode folder = folderService.getTreeNode(xFolder.getId());
//    ExplorerTreeNode root = folderService.getTreeRoot();
//    ExplorerTreeNode folder = find(root, xFolder.getId());
    ExplorerTreeNode root = null;
    try {
      root = FolderModel.getInstance().load(user);
    } catch (PaloIOException e) {
      e.printStackTrace();
    }
    if (root == null) {
      return new XObject[0];
    }
    ExplorerTreeNode folder = find(root, xFolder.getId());
   
    ExplorerTreeNode[] children = folder.getChildren();
    XObject[] xChildren = new XObject[children.length];
//    ArrayList <XObjectWrapper> folders = new ArrayList<XObjectWrapper>();
//    ArrayList <XObjectWrapper> elements = new ArrayList<XObjectWrapper>();
    for (int i = 0; i < children.length; ++i) {
      ExplorerTreeNode child = children[i];
      if (child instanceof StaticFolder) {
        StaticFolder staticFolder = (StaticFolder) child;
        XStaticFolder xStaticFolder = new XStaticFolder(staticFolder
            .getId(), staticFolder.getName());
        xStaticFolder
View Full Code Here

          folderService.add(editorRole, fe);
        } catch (OperationFailedException e) {
          e.printStackTrace();
        }
      }
      ExplorerTreeNode nd = fe.getParent();
      while (nd != null) {
        if (!nd.hasRole(viewerRole) && isPublic) {
          try {
            folderService.add(viewerRole, nd);
          } catch (OperationFailedException e) {
            e.printStackTrace();
          }
        }
        if (!nd.hasRole(editorRole) && isEditable) {
          try {
            folderService.add(editorRole, nd);
          } catch (OperationFailedException e) {
            e.printStackTrace();
          }         
        }
        nd = nd.getParent();
      }
    } catch (SessionExpiredException e) {
      e.printStackTrace();
    }
View Full Code Here

  private final ExplorerTreeNode find(ExplorerTreeNode root, String id) {
    if (root.getId().equals(id)) {
      return root;
    }
    for (ExplorerTreeNode kid: root.getChildren()) {
      ExplorerTreeNode result = find(kid, id);
      if (result != null) {
        return result;
      }
    }
    return null;
View Full Code Here

      } catch (SQLException e) {
      }     
    }
   
    try {
      ExplorerTreeNode root = FolderModel.getInstance().load(getLoggedInUser(sessionId));
      FolderElement folderElement = (FolderElement) find(root, element.getId());
      try {
        CubeViewReader.CHECK_RIGHTS = false;
        assignViewerAndEditorRole(sessionId, folderElement, view, visible, editable);
      } catch (SQLException e) {
View Full Code Here

TOP

Related Classes of org.palo.viewapi.internal.ExplorerTreeNode

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.