Package org.palo.viewapi.internal

Examples of org.palo.viewapi.internal.ExplorerTreeNode


  /** generated */
  private static final long serialVersionUID = -3585310214177526866L;

  public XStaticFolder loadFolderRoot(String sessionId) throws SessionExpiredException {
    ExplorerTreeNode folderRoot = null;
    try {
      folderRoot = FolderModel.getInstance().load(getLoggedInUser(sessionId));
    } catch (PaloIOException e) {     
    }
    if (folderRoot == null) {
      return null;
    }
    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 xRoot;
    }
    return null;
  }
View Full Code Here


  }

  public XStaticFolder createFolder(String sessionId, String name, XStaticFolder xParent)
      throws DbOperationFailedException, SessionExpiredException {
    try {
      ExplorerTreeNode root = FolderModel.getInstance().load(getLoggedInUser(sessionId));
      FolderService folderService = ServiceProvider
          .getFolderService(getLoggedInUser(sessionId));
      ExplorerTreeNode parentNode = find(root, xParent.getId());
//      ExplorerTreeNode parentNode = folderService.getTreeNode(xParent
//          .getId());
      StaticFolder staticFolder = folderService.createStaticFolder(name,
          parentNode, null);
//      folderService.save(staticFolder.getRoot());
View Full Code Here

  }

  public void deleteFolder(String sessionId, XStaticFolder xFolder)
      throws DbOperationFailedException, SessionExpiredException {
    try {
      ExplorerTreeNode root = FolderModel.getInstance().load(getLoggedInUser(sessionId));
      FolderService folderService = ServiceProvider
          .getFolderService(getLoggedInUser(sessionId));
      ExplorerTreeNode folder = find(root, xFolder.getId());
//      FolderService folderService = ServiceProvider
//          .getFolderService(getLoggedInUser());
//      ExplorerTreeNode folder = folderService
//          .getTreeNode(xFolder.getId());
      if (folder != null) {
View Full Code Here

  }

  public void deleteFolderElement(String sessionId, XFolderElement xFolderElement)
      throws DbOperationFailedException, SessionExpiredException {
    try {
      ExplorerTreeNode root = FolderModel.getInstance().load(getLoggedInUser(sessionId));
      FolderService folderService = ServiceProvider
          .getFolderService(getLoggedInUser(sessionId));
      ExplorerTreeNode folder = find(root, xFolderElement.getId());
     
//      FolderService folderService = ServiceProvider
//          .getFolderService(getLoggedInUser());
//      ExplorerTreeNode folder = folderService.getTreeNode(xFolderElement
//          .getId());
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

      boolean isPublic, boolean isEditable) throws DbOperationFailedException,
      SessionExpiredException {
    FolderElement fe = null;
    try {
//      CubeViewReader.CHECK_RIGHTS = false;
      ExplorerTreeNode root = FolderModel.getInstance().load(getLoggedInUser(sessionId));
      FolderService folderService = ServiceProvider
          .getFolderService(getLoggedInUser(sessionId))
      ExplorerTreeNode parent = find(root, parentFolder.getId());
      fe = folderService.createFolderElement(xView.getName(),
          parent, null);
      View view = getView(sessionId, xView);
      try {
        assignViewerAndEditorRole(sessionId, fe, view, isPublic, isEditable);
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

 
  public final void move(String sessionId, XObject[] xObjects,
      XStaticFolder toXFolder) throws DbOperationFailedException,
      SessionExpiredException {
    try {
      ExplorerTreeNode root = FolderModel.getInstance().load(getLoggedInUser(sessionId));
      FolderService folderService = ServiceProvider
          .getFolderService(getLoggedInUser(sessionId));
      ExplorerTreeNode folder = find(root, toXFolder.getId());
      for (XObject xObject: xObjects) {
        ExplorerTreeNode folderElement = find(root, xObject.getId());
        folderElement.setParent(folder);
      }
     
      saveRoot(sessionId, root);
    } catch (PaloIOException ope) {
      ope.printStackTrace();
View Full Code Here

      SessionExpiredException {
    FolderService folderService = ServiceProvider
        .getFolderService(getLoggedInUser(sessionId));     
//      ExplorerTreeNode folder = folderService.getTreeNode(xFolderElement
//          .getId());
    ExplorerTreeNode root = null;
    try {
      root = FolderModel.getInstance().load(getLoggedInUser(sessionId));
    } catch (PaloIOException e) {
      // TODO Auto-generated catch block
    }
    if (root == null) {
      return;
    }
    ExplorerTreeNode folder = find(root, xFolderElement.getId());
    if (folder != null) {
      folderService.setName(newName, folder);
      //folderService.save(folder.getRoot());
      saveRoot(sessionId, root);
    }
View Full Code Here

      throw new DbOperationFailedException("Not enough rights to rename folder '" +
          folder.getName() + "'.");
    }
    //    ExplorerTreeNode folder = folderService.getTreeNode(xFolderElement
    //        .getId());
    ExplorerTreeNode root = null;
    try {
      root = FolderModel.getInstance().load(getLoggedInUser(sessionId));
    } catch (PaloIOException e) {
      //   TODO Auto-generated catch block
    }
    if (root == null) {
      return;
    }
    ExplorerTreeNode fold = find(root, folder.getId());
    if (fold != null) {
      folderService.setName(newName, fold);
      saveRoot(sessionId, root);
    }
  }
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.