- 1.7.6 초기 코드
[Tadpole.git] / com.hangum.tadpole.commons.sql / src / com / hangum / tadpole / engine / initialize / TadpoleHubStartupInitializer.java
blob211f9bbd6f2bd029912318fb51e5ae37a76380a9
1 /*******************************************************************************
2 * Copyright (c) 2017 hangum.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the GNU Lesser Public License v2.1
5 * which accompanies this distribution, and is available at
6 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
7 *
8 * Contributors:
9 * hangum - initial API and implementation
10 ******************************************************************************/
11 package com.hangum.tadpole.engine.initialize;
13 import java.sql.SQLException;
14 import java.util.Properties;
16 import org.apache.commons.lang.StringUtils;
18 import com.hangum.tadpole.commons.exception.TadpoleSQLManagerException;
19 import com.hangum.tadpole.commons.libs.core.define.PublicTadpoleDefine;
20 import com.hangum.tadpole.commons.util.LoadConfigFile;
21 import com.hangum.tadpole.engine.query.dao.system.UserInfoDataDAO;
22 import com.hangum.tadpole.engine.query.sql.TadpoleSystem_UserInfoData;
23 import com.hangum.tadpole.preference.define.AdminPreferenceDefine;
24 import com.hangum.tadpole.preference.define.GetAdminPreference;
26 /**
27 * Tadpole DB Hub system initialize
29 * @author hangum
32 public class TadpoleHubStartupInitializer {
34 /**
35 * initialize Tadpole Config file and load JDBC driver
37 public static void initializeLoadConfigAndJDBCDriver() {
38 // load default config file
39 LoadConfigFile.initializeConfigFile();
41 // load jdbc driver
42 JDBCDriverLoader.initializeJDBCDriver();
45 /**
46 * 시스템 초기 값을 설정합니다.
48 * @throws Exception
50 public static void initializeSystemValue() throws TadpoleSQLManagerException, SQLException {
51 /* define login type */
52 Properties prop = LoadConfigFile.getConfigFile();
53 String txtLoginMethod = StringUtils.trim(prop.getProperty("LOGIN_METHOD", AdminPreferenceDefine.SYSTEM_LOGIN_METHOD_VALUE));
54 UserInfoDataDAO userInfoDao = TadpoleSystem_UserInfoData.updateAdminValue(AdminPreferenceDefine.SYSTEM_LOGIN_METHOD, txtLoginMethod);
55 GetAdminPreference.updateAdminSessionData(AdminPreferenceDefine.SYSTEM_LOGIN_METHOD, userInfoDao);
57 /** 뷰에 보여주어야할 프러덕 필터 값을 가져온다 */
58 GetAdminPreference.updateAdminSessionData(AdminPreferenceDefine.SYSTEM_VIEW_PRODUCT_TYPE_FILTER,
59 new UserInfoDataDAO(PublicTadpoleDefine.systemAdminId, AdminPreferenceDefine.SYSTEM_VIEW_PRODUCT_TYPE_FILTER,
60 StringUtils.trim(prop.getProperty("tadpole.db.producttype.remove.filter", ""))
64 /** 뷰에 보여주어야할 그룹이름 필터 값을 가져온다 */
65 GetAdminPreference.updateAdminSessionData(AdminPreferenceDefine.SYSTEM_VIEW_GROUP_NAME_FILTER,
66 new UserInfoDataDAO(PublicTadpoleDefine.systemAdminId, AdminPreferenceDefine.SYSTEM_VIEW_GROUP_NAME_FILTER,
67 StringUtils.trim(prop.getProperty("tadpole.db.groupname.remove.filter", ""))
71 /** cert user info */
72 PublicTadpoleDefine.CERT_USER_INFO = StringUtils.trim(prop.getProperty("CERT_USER_INFO", ""));