3. βοΈ Development Environment Setup
3.1 System Requirements
The development environment for HONGIKINGAN CMS uses the eGovFrame development environment as-is, and the environment information for configuration tools for program development and execution is as follows.
3.1.1 Basic Requirements
OS
- Windows 10, 7 or higher (Macx86_64/Arch64)
- Linux 64bit
IDE
- Eclipse 4.26 (2022-12)
JDK
- Development Environment: JDK 17 or higher required
- Runtime Environment: JDK 1.8
WAS
- Apache Tomcat 9
DBMS
- Choose one: Oracle, MySQL(MariaDB), CUBRID, MS-SQL, Tibero, PostgreSQL
Note
Development environment changes are possible depending on development conditions, but are not included in this guide.
3.1.2 Hardware Requirements
CPU
Dual-core or higher recommended
Memory
8GB or higher recommended
Disk
10GB or more free space recommended
3.2 Development Environment Configuration (Windows-based)
3.2.1 Case1 - Direct Configuration
- eGovFrame Development Environment
- Download eGovFrameDev-4.2.0-64bit
- JDK Installation
- Windows: Install JDK 17 or higher
- MacOS, Linux: Install JDK 17 or higher
- WAS Installation
- Download Apache Tomcat 9.x
- DBMS Installation
- Oracle / MySQL(MariaDB) / CUBRID / MS-SQL / Tibero
- Install the database to be used in the project using the pre-provided CMS DB Schema + data.
- DB server setup instructions are not provided in this manual.
- HONGIKINGAN CMS Source + DB Schema + DB data
3.2.2 Case2 - Configuration via CMS Package (Covered in this manual)
1. Prepare HONGIKINGAN CMS Developer Package (H-CMS-2.2.zip)
H-CMS-2.2.zip file structure:
- eclipse: eGovFrame development environment, eGovFrameDev-4.2.0-64bit
- maven: Repository + settings.xml
- util: Tomcat9 + OpenJDK-1.8, JDK17 (for development environment operation)
- workspace: HONGIKINGAN CMS source
- DB: Schema + data
- DOC: Guide documents, table specifications, operator manual
2. DBMS Installation
- Oracle / MySQL(MariaDB) / CUBRID / MS-SQL / Tibero / PostgreSQL
- Install the database to be used in the project using the pre-provided CMS DB Schema + data.
- DB server setup instructions are not provided in this manual.
3. Prepare Developer PC with "D:" drive volume
Installation Procedure:
- Extract HONGIKINGAN CMS package file to D:\ drive
- When extracted, the CMS path becomes "D:\H-CMS-2.2".
- (Be careful not to create a structure like D:\H-CMS-2.2\H-CMS-2.2\)
- Click "D:\H-CMS-2.2\Humanframe.lnk (shortcut)" icon to run CMS
- If D drive does not exist, extract to C drive and modify paths in main configuration files
3.3 Detailed Development Environment Setup Procedure
3.3.1 JDK Installation (Not required - included in package)
1. JDK Download
- Download and install JDK 17 or higher
2. Environment Variable Setup
- JAVA_HOME: JDK installation path (Package reference: D:\H-CMS-2.2\util\jdk-17.0.7)
- PATH: Add %JAVA_HOME%bin
3.3.2 Eclipse Execution
1. Eclipse Execution
- Run D:\H-CMS-2.2\Humanframe.lnk (shortcut) included in package
3. Maven Configuration
- Window > Preferences > Maven > User Settings
- Specify D:\H-CMS-2.2\maven\settings.xml file included in package
3.3.3 Database Configuration
1. Database Installation
- Choose and install: CUBRID(default), Oracle, MySQL(MariaDB), MS-SQL, Tibero, PostgreSQL
2. Schema and Data Import
- Execute schema scripts from DB folder included in package
- Execute initial data import scripts
3. Database Connection Configuration
- Modify database connection information in context-datasource.xml file
JNDI Configuration:
The default JNDI name used in CMS is "cmsdb". Related settings can be checked and changed in context-datasource.xml.
<Resource name="jdbc/cmsdb"
auth="Container"
type="javax.sql.DataSource"
maxTotal="20"
maxIdle="10"
maxWaitMillis="-1"
validationQuery="select 1"
testOnBorrow="false"
poolPreparedStatements="true"
username="cmsuser"
password="cmspassword"
driverClassName="cubrid.jdbc.driver.CUBRIDDriver"
url="jdbc:cubrid:localhost:33000:cmsdb:::?charset=utf-8&zeroDateTimeBehavior=round"/>
<Resource name="jdbc/cmsdb"
auth="Container"
type="javax.sql.DataSource"
maxTotal="100"
maxIdle="30"
maxWaitMillis="10000"
username="cmsuser"
password="cmspassword"
driverClassName="com.mysql.cj.jdbc.Driver"
url="jdbc:mysql://localhost:3306/cmsdb?serverTimezone=Asia/Seoul&characterEncoding=UTF-8"/>
<Resource name="jdbc/cmsdb"
auth="Container"
type="javax.sql.DataSource"
maxTotal="100"
maxIdle="30"
maxWaitMillis="10000"
username="cmsuser"
password="cmspassword"
driverClassName="oracle.jdbc.driver.OracleDriver"
url="jdbc:oracle:thin:@localhost:1521:XE"/>
3.3.4 WAS Configuration
1. Tomcat Configuration
- Use Tomcat9 included in package or install separately
- Add server to Eclipse: Window > Show View > Servers
- Add new server: Apache > Tomcat v9.0 Server
2. Project Deployment Configuration
- Add project to server
- Memory settings (minimum): -Xms512m -Xmx1024m
3.4 Main Configuration Files Guide
3.4.1 context-properties.xml
File that defines main property values of the application.
Main Configuration Items:
- GLOBAL_SITE_DOMAIN: Main site domain
- WEB_DIR: Web application directory
- THEME_PATH: Site theme directory
- FILE_UPLOAD_DIR: File upload directory
Optional Configuration Items (when purchased or used):
- EDITOR: Web editor settings
- GLOBAL_FILEPREVIEW_AT: File viewer usage (purchase option)
- DAUM_API_KEY: Kakao API key - JavaScript version (Issue: URL)
- GOOGLE_API_KEY: Google API key - JavaScript version (Issue: URL)
- RECAPTCHA_SITE_KEY: Google reCAPTCHA site key (Issue URL -- https://cloud.google.com/security/products/recaptcha )
- RECAPTCHA_SECRET_KEY: Google reCAPTCHA secret key (Issue URL -- https://cloud.google.com/security/products/recaptcha )
<!-- [Actual Code] humanframe/spring/context-properties.xml -->
<beans profile="local">
<bean name="propertiesService" class="org.egovframe.rte.fdl.property.impl.EgovPropertyServiceImpl" destroy-method="destroy">
<property name="properties">
<map>
<!-- global set -->
<entry key="GLOBAL_SITE_DOMAIN" value="https://developers.yooncoms.com" />
<entry key="WEB_DIR" value="D:/H-CMS-2.2/workspace/humanframe/humanframe.web/src/main/webapp" />
<entry key="FILE_UPLOAD_DIR" value="/data" />
<entry key="THEME_PATH" value="D:/H-CMS-2.2/workspace/humanframe/humanframe.web/src/main/webapp/WEB-INF/jsp/theme" />
<entry key="SESSION_ADMIN" value="HUMAN_ADMIN" />
<entry key="SESSION_MEMBER" value="HUMAN_MEMBER" />
<entry key="EDITOR" value="SMART" /> <!-- SMART, EDITORPLUS -->
<entry key="GLOBAL_FILEPREVIEW_AT" value="Y" />
<entry key="DAUM_API_KEY" value="Kakao API Key - JavaScript Version" />
<entry key="GOOGLE_API_KEY" value="Google API Key - JavaScript Version"/>
<entry key="RECAPTCHA_SITE_KEY" value="Google Site Key" />
<entry key="RECAPTCHA_SECRET_KEY" value="Google Secret Key" />
</map>
</property>
</bean>
</beans>
3.4.2 context-datasource.xml
File containing database connection configuration.
<!-- [Actual Code] humanframe/spring/context-datasource.xml -->
<beans profile="local">
<bean id="cmsDataSource" class="net.sf.log4jdbc.Log4jdbcProxyDataSource">
<constructor-arg ref="cmsDataSourceSpied" />
<property name="logFormatter">
<bean class="net.sf.log4jdbc.tools.Log4JdbcCustomFormatter">
<property name="loggingType" value="MULTI_LINE" />
<property name="sqlPrefix" value="### SQL : " />
</bean>
</property>
</bean>
<jee:jndi-lookup id="cmsDataSourceSpied" jndi-name="java:comp/env/jdbc/cmsdb" expected-type="javax.sql.DataSource" resource-ref="true" />
<jdbc:initialize-database data-source="cmsDataSource" enabled="false">
<jdbc:script location="classpath:database/schema.sql" encoding="utf-8" />
</jdbc:initialize-database>
<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="cmsDataSource"/>
</bean>
<tx:annotation-driven transaction-manager="transactionManager"/>
</beans>
3.4.3 Other Main Configuration Files
- context-mapper.xml: MyBatis configuration
- human-resource.xml: Resource-related configuration
- context-mail.xml: Mail sending related configuration
- web.xml: Web application basic configuration
<!-- [Actual Code] humanframe/spring/human-resource.xml -->
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd" >
<!-- humanframe system related configuration file -->
<properties>
<entry key="humanframe.dbType">cubrid</entry><!-- DB Type : altibase, cubrid, mysql, oracle, tibero -->
<entry key="humanframe.admin.path">humanmst</entry>
</properties>
3.5 Profile Configuration (Development/Test/Production)
HONGIKINGAN CMS can apply different configurations according to development, test, and production environments using Spring profiles.
Main Profiles:
- local: Local development environment
- dev: Test server environment
- prd: Production server environment
Spring Profile local Configuration Application
- Double-click the WEB server among Eclipse server items.
- Click the Open launch configuration item.
- Click the Arguments tab.
- Check the
-Dspring.profiles.active=localoption in the VM arguments window. Add if not present. - If D drive does not exist, set the path to C drive and directly modify the path by referring to the "Main Configuration Check" item.
3.6 Web Editor Configuration
HONGIKINGAN CMS supports SMART and EDITORPLUS as web editors, and uses SMART by default. It can be configured as follows.
<!-- [Actual Code] humanframe/spring/context-properties.xml -->
<entry key="EDITOR">SMART</entry> <!-- SMART , EDITORPLUS -->
<!--editor path -->
<entry key="UPLOAD_WEBEDITOR_DIR">C:/dev/workspace/humanframe/humanframe/humanframe.web/src/main/webapp/humanframe/global/kukudocs</entry>
<entry key="UPLOAD_WEBEDITOR_PATH">/humanframe/global/kukudocs</entry>
When using webeditorplus, you need to check the path configuration in the ImagePath.jsp file.
Check if the imagePhysicalPath variable matches the actual local folder path and modify if necessary. In particular, configuration is required after checking the absolute path of the actual server to be deployed.
<!-- [Actual Code] humanframe.web/src/main/webapp/webeditorplus/websource/jsp/ImagePath.jsp -->
<%
String imagePhysicalPath = "";
String activeProfiles = System.getProperty("spring.profiles.active");
if("local".equalsIgnoreCase(activeProfiles) || "dev".equalsIgnoreCase(activeProfiles)) {
imagePhysicalPath = "D:/H-CMS-2.2/workspace/humanframe";
} else {
imagePhysicalPath = "/home/tomcat/webapps/humanframe";
}
%>
3.7 Precautions for Development Environment Setup
- JDK Version Compatibility
- For development: Use JDK 11 or higher (Windows) or JDK 17 or higher (MacOS, Linux)
- Runtime environment: Developed based on JDK 1.8
- Database Configuration
- Check humanframe.dbType property in human-resource.xml file
- Configure according to the database being used (cubrid, oracle, mysql, mssql, tibero, postgresql)
- Character Encoding
- Project encoding: UTF-8
- JSP file encoding: UTF-8
- Database connection encoding: UTF-8
- Memory Configuration
- Adjust JVM memory settings according to development environment
- Default recommendation: -Xms512m -Xmx1024m
3.8 Project Execution and Initial Access
3.8.1 Project Execution
1. Project Build
- Maven > Update Project
- Project > Clean
2. Server Start
- Right-click server > Start
3. Access Verification
- Access http://localhost:8080/ in browser
- Admin: http://localhost:8080/humanmst/
3.8.2 Admin Login
Admin Initial Account Information
ID: cmsadmin / Password: 1111
- Enter ID and password, then click the login button to display the page dashboard.
- For descriptions of admin page functions, please refer to the admin manual.