Package com.taobao.zeus.web.platform.client.module.filemanager

Examples of com.taobao.zeus.web.platform.client.module.filemanager.FileModel


      throw new RuntimeException("权限不足");
    }
  }
 
  private FileModel convert(FileDescriptor fd){
    FileModel fm=new FileModel();
    fm.setContent(fd.getContent());
    fm.setFolder(fd.isFolder());
    fm.setId(fd.getId());
    fm.setName(fd.getName());
    fm.setParentId(fd.getParent());
    fm.setOwner(fd.getOwner());
    if(LoginUser.getUser().getUid().equals(fd.getOwner())){
      fm.setAdmin(true);
    }else{
      fm.setAdmin(false);
    }
    return fm;
  }
View Full Code Here


  }

  @Override
  public FileClientBean getUserFiles() {
    List<FileDescriptor> files=fileManager.getUserFiles(LoginUser.getUser().getUid());
    FileModel root=new FileModel();
    root.setName("根节点,不展示");
    FileClientBean bean=new FileClientBean(root);
    for(FileDescriptor fd:files){
      FileClientBean nodebean=new FileClientBean(convert(fd));
      nodebean.setParent(bean);
      bean.addSubFile(nodebean);
View Full Code Here

    }
    return bean;
  }
 
  private void recursion(FileClientBean parent){
    FileModel model=parent.getFileModel();
    if(model.isFolder()){
      List<FileDescriptor> fds=fileManager.getSubFiles(model.getId());
      for(FileDescriptor fd:fds){
        FileClientBean bean=new FileClientBean(convert(fd));
        bean.setParent(parent);
        parent.addSubFile(bean);
        recursion(bean);
View Full Code Here

      for(ZeusUser zu:users){
        //没有公共文档则不返回该用户
        if(!hasCommonFiles(zu)){
          continue;
        }
        FileModel model=new FileModel();
        model.setAdmin(false);
        model.setFolder(true);
        model.setId(zu.getUid());
        model.setName(zu.getName()+"("+zu.getUid()+")");
        model.setOwner(zu.getUid());
       
        result.add(model);
      }
    }else if(fm.getId().contains("\\")){
      List<FileDescriptor> files=fileManager.getUserFiles(fm.getId());
      for(FileDescriptor fd:files){
        if(fd.getName().equalsIgnoreCase(FileManager.SHARE)){
          FileModel model=new FileModel();
          model.setAdmin(false);
          model.setFolder(fd.isFolder());
          model.setId(fd.getId());
          model.setName(fd.getName());
          model.setOwner(fd.getOwner());
          model.setParentId(fm.getId());
          result.add(model);
        }
      }
    }else{
      List<FileDescriptor> files=fileManager.getSubFiles(fm.getId());
      for(FileDescriptor fd:files){
        FileModel model=convert(fd);
        result.add(model);
      }
    }
    return result;
  }
View Full Code Here

    this.context=context;
    wordView=new WordViewImpl(context,this);
    context.getPlatformBus().addHandler(FileUpdateEvent.TYPE, new FileUpdateHandler(){
      @Override
      public void onFileUpdate(FileUpdateEvent event) {
        FileModel model=event.getModel();
        wordView.updateFileName(model);
      }
    });
    context.getPlatformBus().registPlaceHandler(this);
    // 打开上传关闭时打开的文档
View Full Code Here

  public void go(HasWidgets hasWidgets) {
    hasWidgets.add(getWordView().asWidget());
    context.getPlatformBus().addHandler(OpenFileEvent.TYPE, new OpenFileEvent.OpenFileHandler(){
      @Override
      public void onOpenFile(OpenFileEvent event) {
        FileModel model=event.getModel();
        if(!model.isFolder()){
          open(model.getId(), null);
          if(model.getOwner().equals(context.getUser().getUid())){
            History.newItem(new PlacePath().toApp(App.Document)
                .toDocType(DocType.MyDoc)
                .toDocId(model.getId()).create().getToken(), false);
          }else{
            History.newItem(new PlacePath().toApp(App.Document)
                .toDocType(DocType.SharedDoc)
                .toDocId(model.getId())
                .create().getToken(), false);
          }
        }
      }
    });
View Full Code Here

TOP

Related Classes of com.taobao.zeus.web.platform.client.module.filemanager.FileModel

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.