Package org.palo.viewapi.services

Examples of org.palo.viewapi.services.FolderService


//    try {
//      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(),
View Full Code Here


    }
  }
 
  private final void deleteContentof(String sessionId, ExplorerTreeNode folder)
      throws OperationFailedException, SessionExpiredException {
    FolderService folderService = ServiceProvider
        .getFolderService(getLoggedInUser(sessionId));
    for (ExplorerTreeNode child : folder.getChildren()) {
      if (child instanceof StaticFolder) {
        deleteFolder(sessionId, folderService, (StaticFolder) child);
      }
      folderService.delete(child);
    }
  }
View Full Code Here

        permission(Right.CREATE).build();
      roleMgmt.insert(editorRole);
    }
   
    try {
      FolderService folderService = ServiceProvider
        .getFolderService(getLoggedInUser(sessionId));
      if (!fe.hasRole(viewerRole) && isPublic) {
        try {
          folderService.add(viewerRole, fe);
        } catch (OperationFailedException e) {
          e.printStackTrace();
        }
      }
      if (!fe.hasRole(editorRole) && isEditable) {
        try {
          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();
View Full Code Here

  }
 
  private final void saveRoot(String sessionId, ExplorerTreeNode root) throws SessionExpiredException {
    try {
      AuthUser user = getLoggedInUser(sessionId);
      FolderService folderService = ServiceProvider.getFolderService(user);   
      Role viewerRole = null;
      for (Role role: user.getRoles()) {
        if (role.getName().equalsIgnoreCase("viewer")) {
          viewerRole = role;
          break;
        }
      }
      if (viewerRole == null) {
        for (Group g: user.getGroups()) {
          for (Role role: g.getRoles()) {
            if (role.getName().equalsIgnoreCase("viewer")) {
              viewerRole = role;
              break;
            }
          }
        }
      }
      if (viewerRole != null) {
        ensureRoles(folderService, root, viewerRole);
      } else {
      }
      FolderModel.getInstance().save(user, root);
      folderService.save(root);
    } catch (OperationFailedException e) {
      e.printStackTrace();
    } catch (PaloIOException e) {
      e.printStackTrace();
    }
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

    }
    return null;
  }
 
  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 {
View Full Code Here

TOP

Related Classes of org.palo.viewapi.services.FolderService

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.