/*  OpenOlap viewer
 *  パッケージ名：openolap.viewer.controller
 *  ファイル：RenewHtmlActCommand.java
 *  説明：
 *
 *  作成日: 2004/01/19
 */
package openolap.viewer.controller;

import java.io.IOException;

import javax.servlet.ServletException;

import openolap.viewer.common.CommonSettings;
import openolap.viewer.dao.ColorDAO;
import openolap.viewer.dao.DAOFactory;
import openolap.viewer.dao.ReportDAO;

/**
 *  クラス：RenewHtmlActCommand
 *  説明：
 */
public class RenewHtmlActCommand implements Command {

	private final String registColorSettingsMode = "registColorSetings";


	public String execute(RequestHelper helper, CommonSettings commonSettings)
		throws ServletException, IOException {

		String mode = (String)helper.getRequest().getParameter("mode");
		if( registColorSettingsMode.equals(mode) ) {

			// 軸の配置情報を更新
			ReportDAO reportDAO = DAOFactory.getDAOFactory().getReportDAO(null);
			reportDAO.registAxisPosition(helper, commonSettings);

			// 色設定情報を更新
			ColorDAO colorDAO = DAOFactory.getDAOFactory().getColorDAO(null);
			colorDAO.registColor(helper, commonSettings);

		}
		return "/spread/spread.html";
	}

}
