Examples of FileHistory


Examples of br.com.jteam.jfcm.model.FileHistory

   * @see br.com.minaurod.fcm.gui.adapter.FileListPresentationContentAdapter#getHistory()
   */
  @SuppressWarnings("unchecked")
  public PresentationFileHistory getHistory()
  {
    FileHistory fileHistory = fileListContentService.getHistory();
    PresentationFileHistory presentationFileHistory = new PresentationFileHistory();
    for (File file : fileHistory) {
      presentationFileHistory.add(new PresentationFile(
        file.getName(),
        file.getPath(),
View Full Code Here

Examples of cc.concurrent.config.server.model.FileHistory

        String formatXml = XmlUtil.format(xml);

        int version = 1;
        String username = FlashRequestContext.getCurrentContext().getUsername();
        FileCurrent fileCurrent = new FileCurrent(appName, fileName, version, formatXml, comment, username, new Date(), 0, null, null);
        FileHistory fileHistory = new FileHistory(appName, fileName, version, formatXml, comment, username, new Date(), false, null, null);
        fileCurrentDao.addFileCurrent(fileCurrent);
        fileHistoryDao.addFileHistory(fileHistory);
    }
View Full Code Here

Examples of cc.concurrent.config.server.model.FileHistory

     * 某个版本的文件
     */
    @RequestMapping(value = "/{appName}/{fileName}/{version}", method = RequestMethod.GET)
    public String file(@PathVariable("appName") String appName, @PathVariable("fileName") String fileName,
                       @PathVariable("version") int version, Model model) {
        FileHistory fileHistory = fileService.getFileHistory(appName, fileName, version);
        model.addAttribute("appName", appName);
        model.addAttribute("fileName", fileName);
        model.addAttribute("version", version);
        model.addAttribute("fileHistory", fileHistory);
        return "file";
View Full Code Here

Examples of cc.concurrent.config.server.model.FileHistory

        checkArgument(oldFileCurrent.getVersion() == version, "only latest version can update");

        String username = FlashRequestContext.getCurrentContext().getUsername();
        FileCurrent fileCurrent = new FileCurrent(appName, fileName, version + 1, formatXml, comment, username, new Date(),
                oldFileCurrent.getLastPublishVersion(), oldFileCurrent.getLastPublisher(), oldFileCurrent.getLastPublishTime());
        FileHistory fileHistory = new FileHistory(appName, fileName, version + 1, formatXml, comment, username, new Date(), false, null, null);
        fileCurrentDao.updateFileCurrent(fileCurrent);
        fileHistoryDao.addFileHistory(fileHistory);
    }
View Full Code Here

Examples of cc.concurrent.config.server.model.FileHistory

     * 文件更新页
     */
    @RequestMapping(value = "/{appName}/{fileName}/{version}/update", method = RequestMethod.GET)
    public String updateFile(@PathVariable("appName") String appName, @PathVariable("fileName") String fileName,
                             @PathVariable("version") int version, Model model) {
        FileHistory fileHistory  = fileService.getFileHistory(appName, fileName, version);
        checkArgument(fileHistory.isLatest(), "only latest version can update");
        model.addAttribute("appName", appName);
        model.addAttribute("fileName", fileName);
        model.addAttribute("version", fileHistory.getVersion());
        model.addAttribute("xml", fileHistory.getXml());
        return "updateFile";
    }
View Full Code Here

Examples of cc.concurrent.config.server.model.FileHistory

    public void publishFile(String appName, String fileName, int version) {
        checkAppName(appName);
        FileCurrent fileCurrent = fileCurrentDao.getFileCurrent(appName, fileName);
        checkNotNull(fileCurrent);
        checkArgument(fileCurrent.getVersion() == version, "only latest version can update");
        FileHistory fileHistory = fileHistoryDao.getFileHistory(appName, fileName, version);
        checkNotNull(fileHistory);
        checkArgument(!fileHistory.isPublished(), "has published");

        String xml = fileHistory.getXml();
        String md5 = Md5Util.md5(xml);
        FilePublished filePublished = new FilePublished(appName, fileName, version, xml, md5);
        if (filePublishedDao.updateFilePublished(filePublished) == 0) {
            filePublishedDao.addFilePublished(filePublished);
        }
View Full Code Here

Examples of cc.concurrent.config.server.model.FileHistory

        return fileHistoryDao.getFileHistories(appName, fileName);
    }

    public FileHistory getFileHistory(String appName, String fileName, int version) {
        checkAppName(appName);
        FileHistory fileHistory = fileHistoryDao.getFileHistory(appName, fileName, version);
        checkNotNull(fileHistory, "app[%s] file[%s] version[%s] don't exsit", appName, fileName, version);

        FileCurrent fileCurrent = fileCurrentDao.getFileCurrent(appName, fileName);
        boolean isLatest = fileCurrent.getVersion() == version ? true : false;
        fileHistory.setLatest(isLatest);

        return fileHistory;
    }
View Full Code Here

Examples of cc.concurrent.config.server.model.FileHistory

        String sql = "select app_name, file_name, version, xml, comment, creator, create_time, is_published, publisher, publish_time " +
                "from config_file_history where app_name=? and file_name=? order by version desc";
        return getJdbcTemplate().query(sql, new Object[]{appName, fileName}, new RowMapper<FileHistory>() {
            @Override
            public FileHistory mapRow(ResultSet rs, int rowNum) throws SQLException {
                return new FileHistory(rs.getString(1), rs.getString(2), rs.getInt(3), rs.getString(4),
                        rs.getString(5), rs.getString(6), rs.getDate(7), rs.getBoolean(8), rs.getString(9), rs.getDate(10));
            }
        });
    }
View Full Code Here

Examples of cc.concurrent.config.server.model.FileHistory

        String sql = "select app_name, file_name, version, xml, comment, creator, create_time, is_published, publisher, publish_time " +
                "from config_file_history where app_name=? and file_name=? and version=?";
        List<FileHistory> r = getJdbcTemplate().query(sql, new Object[]{appName, fileName, version}, new RowMapper<FileHistory>() {
            @Override
            public FileHistory mapRow(ResultSet rs, int rowNum) throws SQLException {
                return new FileHistory(rs.getString(1), rs.getString(2), rs.getInt(3), rs.getString(4),
                        rs.getString(5), rs.getString(6), rs.getDate(7), rs.getBoolean(8), rs.getString(9), rs.getDate(10));
            }
        });
        return !r.isEmpty() ? r.get(0) : null;
    }
View Full Code Here

Examples of jline.console.history.FileHistory

        // We may not have the perms to read the history file...
        if( file.exists() && file.canRead() ) {
            // Override the FileHistory impl to trap failures due to the
            // user does not having write access to the history file.
            reader.setHistory(new FileHistory(file) {
                boolean failed = false;
                @Override
                public void flush() throws IOException {
                    if( !failed ) {
                        try {
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.