Examples of CmsFile


Examples of com.jeecms.cms.entity.assist.CmsFile

  public CmsFile save(CmsFile bean) {
    return dao.save(bean);
  }

  public void saveFileByPath(String filepath, String name, Boolean valid) {
    CmsFile attFile=new CmsFile();
    attFile.setFilePath(filepath);
    attFile.setFileName(name);
    attFile.setFileIsvalid(valid);
    save(attFile);
  }
View Full Code Here

Examples of com.jeecms.cms.entity.assist.CmsFile

    attFile.setFileIsvalid(valid);
    save(attFile);
  }

  public void updateFileByPath(String path, Boolean valid, Content c) {
    CmsFile file;
    file=findByPath(path);
    if(file!=null){
      file.setContent(c);
      file.setFileIsvalid(valid);
      update(file);
    }
  }
View Full Code Here

Examples of com.jeecms.cms.entity.assist.CmsFile

      } else {
        files = parent.listFiles();
      }
      Arrays.sort(files, new FileComparator());
      List<FileWrap> list = new ArrayList<FileWrap>(files.length);
      CmsFile file;
      for (File f : files) {
        file=fileMng.findByPath(f.getName());
        if(file!=null){
          list.add(new FileWrap(f, realPathResolver.get(""),null,file.getFileIsvalid()));
        }else{
          list.add(new FileWrap(f, realPathResolver.get(""),null,false));
        }
      }
      return list;
View Full Code Here

Examples of com.jeecms.cms.entity.assist.CmsFile

    if (parent.exists()) {
      File[] files;
      files = parent.listFiles();
      Arrays.sort(files, new FileComparator());
      List<FileWrap> list = new ArrayList<FileWrap>(files.length);
      CmsFile file;
      for (File f : files) {
        file=fileMng.findByPath(f.getName());
        if(valid!=null){
          if(file!=null){
            if(file.getFileIsvalid().equals(valid)){
              list.add(new FileWrap(f, realPathResolver.get(""),null,valid));
            }
          }else{
            if(valid.equals(false)){
              list.add(new FileWrap(f, realPathResolver.get(""),null,false));
            }
          }
        }else{
          if(file!=null){
            list.add(new FileWrap(f, realPathResolver.get(""),null,file.getFileIsvalid()));
          }else{
            list.add(new FileWrap(f, realPathResolver.get(""),null,false));
          }
        }
      }
View Full Code Here

Examples of com.jeecms.cms.entity.assist.CmsFile

    }
  }


  public CmsFile findById(Integer id) {
    CmsFile entity = get(id);
    return entity;
  }
View Full Code Here

Examples of com.jeecms.cms.entity.assist.CmsFile

    getSession().save(bean);
    return bean;
  }

  public CmsFile deleteById(Integer id) {
    CmsFile entity = super.get(id);
    if (entity != null) {
      getSession().delete(entity);
    }
    return entity;
  }
View Full Code Here

Examples of com.jeecms.cms.entity.assist.CmsFile

    }
    return entity;
  }
 
  public CmsFile deleteByPath(String path) {
    CmsFile entity = findByPath(path);
    if (entity != null) {
      getSession().delete(entity);
    }
    return entity;
  }
View Full Code Here

Examples of com.jeecms.cms.entity.assist.CmsFile

  }
 
  public void updateFileByContent(Content bean,Boolean valid){
    Set<CmsFile>files;
    Iterator<CmsFile>it;
    CmsFile tempFile;
    //处理附件
    files=bean.getFiles();
    it=files.iterator();
    while(it.hasNext()){
      tempFile=it.next();
      tempFile.setFileIsvalid(valid);
      fileMng.update(tempFile);
    }
  }
View Full Code Here

Examples of org.opencms.file.CmsFile

    LOG.debug("getConfiguration() contains: " + getConfiguration());
   
    List<CmsSelectWidgetOption> options = new ArrayList<CmsSelectWidgetOption>();
    try {
      // Load the xmlcontent containing the options
      CmsFile xmlfile = cms.readFile(cms.readResource(getConfiguration()));
      xmlcontent = CmsXmlContentFactory.unmarshal(cms, xmlfile);
     
      // loop through the options
      CmsXmlContentValueSequence seq = xmlcontent.getValueSequence("Option", locale);
      int count = seq.getElementCount();
View Full Code Here

Examples of org.opencms.file.CmsFile

    }
   
    Iterator<String> paths = searchPaths.iterator();
    String path, propertyFile, key;
    Properties props;
    CmsFile file;
    while (paths.hasNext()) {
      path = paths.next();
      propertyFile = cms.getRequestContext().removeSiteRoot(path.concat("/").concat(propertyFileName));
      if (cms.existsResource(propertyFile)) {
        file = cms.readFile(propertyFile);
        props = new Properties();
        props.load(new ByteArrayInputStream(file.getContents()));
       
        Iterator<Object> keys = props.keySet().iterator();
        while (keys.hasNext()) {
          key = (String) keys.next();
          if (!properties.containsKey(key) || allowOverwrite) {
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.