Examples of FileModel


Examples of com.extjs.gxt.samples.client.examples.model.FileModel

      files = f.listFiles(filter);
    }

    List<FileModel> models = new ArrayList<FileModel>();
    for (File f : files) {
      FileModel m = null;
      if (f.isDirectory()) {
        m = new FolderModel(f.getName(), f.getAbsolutePath());
      } else {
        m = new FileModel(f.getName(), f.getAbsolutePath());
        m.set("size", f.length());
        m.set("date", new Date(f.lastModified()));
      }

      if (idMap.containsKey(f)) {
        m.set("id", idMap.get(f));
      } else {
        String id = String.valueOf(counter++);
        idMap.put(f, id);
        m.set("id", id);
      }

      models.add(m);
    }
View Full Code Here

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

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

  }

  @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

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

    }
    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

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

      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

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

    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

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

  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

Examples of model.FileModel

          return;
        }
      }

      System.out.println("modelID = " + modelID);
      FileModel model = null;
      try {
        model = FileModelService.buildFileModel(modelID);
      } catch (Exception ex) {
        ex.printStackTrace();
      }
      projectReader.setDataSource(model);
      boolean result = projectReader.readProject();
      if (result == false) {
        JOptionPane.showInternalMessageDialog(uiJPanel, projectReader
            .getErrorInfo(), "������Ϣ����", JOptionPane.ERROR_MESSAGE);
        return;
      }
      String domainName = projectReader.getDomainName();
      String[] viewNameArray = projectReader.getViewNameArray();
      Drawing[] drawingArray = projectReader.getDrawingArray();
      GroupMap informationMap = projectReader.getInformationMap();
      FComponent featureModel = projectReader.getFeatureModel();

      ProjectImplementation pi = new ProjectImplementation();
      pi.setProjectId(modelID);
      pi.setProjectName(model.getName());
      pi.setDomainName(domainName);
      for (int i = 0; i < viewNameArray.length; i++)
        pi.addView(viewNameArray[i]);

      ProjectManagerImplementation pmi = null;
View Full Code Here

Examples of model.FileModel

        index += " " + drawingViews.length;
        for (int i = 0; i < drawingViews.length; i++) {
          index += " " + drawingViews[i].getDrawing().getTitle();
        }
        if (fileModel == null) {
          fileModel = new FileModel();
          fileModel.setId(project.getProjectId());
          fileModel.setName(project.getProjectName());
          fileModel.setIndex(index);
        }
        // begin д������ģ�������ļ�
View Full Code Here

Examples of model.FileModel

    box.setLayout(new BoxLayout(box,BoxLayout.PAGE_AXIS));
    final ButtonGroup group = new ButtonGroup();
    final int numbuts = models.size();
    final JRadioButton[]radioButtons = new JRadioButton[numbuts];
    for(int i = 0 ;i<numbuts;i++){
      FileModel fm = models.get(i);
      String text = fm.getId() + " " +fm.getName();
      radioButtons[i] = new JRadioButton(text);     
      group.add(radioButtons[i]);
      box.add(radioButtons[i]);
    }
    radioButtons[0].setSelected(true);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.