02.egovFrame  Development Environment workshop I
Upcoming SlideShare
Loading in...5
×
 

02.egovFrame Development Environment workshop I

on

  • 684 views

eGovFrame - Framework for e-government

eGovFrame - Framework for e-government
Development Environment - Practice

Statistics

Views

Total Views
684
Views on SlideShare
683
Embed Views
1

Actions

Likes
0
Downloads
13
Comments
0

1 Embed 1

http://www.linkedin.com 1

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

02.egovFrame  Development Environment workshop I 02.egovFrame Development Environment workshop I Presentation Transcript

  • eGovFrame Lab Workbook Development Environment eGovFrame Center 2012 Page l 1 1
  • Development Environment 1. Development Environment Setup Composition of the Lab environment Configuration of the Lab environment 2. Development Environment Practice [LAB1] Create and run Sample Project [LAB2] Hello World Test [LAB3] Code Generation Page l 2 2
  • Composition of the Lab environment Development EnvironmentThe lab consists of the following environments  Install - Unzip eGovFrame-2.0zip under C: drive  Installed Software - JDK5.0 (1.5.0_22) & JDK6.0 (1.6.0_29) - Eclipse JEE Helios SR2 - Apache Tomcat 6.0.35 & 7.0.23 - Maven 2.2.1/Maven 3.0.3  Directory Information Directory Description bin • Executable file directory - jdk1.5.0 / jdk1.6.0 • JDK5.0(1.5.0_22), JDK6.0(1.6.0_29) - apache-tomcat-6.0.35 • Apache Tomcat 6 & 7 - apache-tomcat-7.0.23 - apache-maven-2.2.1 • Maven (MAVEN_HOME) • Eclipse JEE Helios SR2 (3.6.2) - eclipse • Include implementation tools plug-ins maven/repository • Maven Local Repository workspace • Eclipse project workspace Page l 3 3
  • Configuration Development EnvironmentCheck plug-in configuration through Window  Preference menu in Eclipse.  Check basic encoding (UTF-8) – General > Workspace Page l 4 4
  • Configuration Development EnvironmentCheck plug-in configuration through Window  Preference menu in Eclipse.  Check Maven(m2eclipse) configuration– Maven > User Settings Page l 5 5
  • Configuration Development EnvironmentCheck plug-in configuration through Window  Preference menu in Eclipse.  Check installed JRE – Java > Installed JREs Page l 6 6
  • Configuration Development EnvironmentCheck plug-in configuration through Window  Preference menu in Eclipse.  Check Apache Tomcat Server configuration – Server > Runtime Environments C:/eGovFrame-2.0/bin/apache-tomcat-6.0.35 Page l 7 7
  • Development Environment 1. Development Environment Setup Composition of the Lab environment Configuration of the Lab environment 2. Development Environment Practice [LAB1] Create and run Sample Project [LAB2] Hello World Test [LAB3] Code Generation Page l 8 8
  • [[LAB1] Generate Sample Project Development EnvironmentLearn the functionality of the tools as creating and running the sample project, based on the eGovFrameimplementation tools.  [Step 1-1] Select eGovFramework>start>New Web Project menu in Eclipse Select eGovFramework Web Project Page l 9 9
  • [LAB1] Generate Sample Project Development Environment  [Step 1-2] Input below data to project creation wizard in Eclipse and click „Next‟ button. Check „Generate Example‟ element, then click „Finish‟ button. Create a project. Element Input Data Remarks Project name lab101 Target Runtime Apache Tomcat 6.0 Dynamic Web 2.5 Automatic input Module Version Group Id egovlab Artifact Id lab101 Automatic input Version 1.0.0 Automatic input Example Code Generation Page l 10 10
  • [LAB1] Generate Sample Project Development Environment  [Step 1-3] Select the project and run „Maven > Update Project Configuration‟. It reflects the Maven configuration. Reflect Maven configuration setting Page l 11 11
  • [[LAB1] Generate Sample Project Development Environment  [Step 1-4] Run each phase in Maven lifecycle as running the project build. Select and run „Run As > Maven package‟ menu. Then check the build description on the console and build output which is war file under the „target‟ directory. Reflect Maven configuration Generate war file Page l 12 12
  • [LAB1] Generate Sample Project Development Environment  [Step 1-5] Run HSQL DB for project execution. Input and run „runHsqlDB.cmd‟ command which is under „DATABASE/db‟ directory in the project. 2 3 1 Page l 13 13
  • [LAB1] Generate Sample Project Development Environment  [Step 1-6] Select a project and run „Run As > Run on Server‟ menu. Run a project. Check features of the executed project. (Sample application URL : http://localhost:8080/lab101/) Page l 14 14
  • [LAB2] Hello World Test Development EnvironmentAs creating TestCase based on Maven project, learn test tool functions  [Step 2-1] Check LAB2 Maven basic project structure, create HelloWorldServiceTest with a Spring Test function package egovframework.guide.helloworld; import static org.junit.Assert.assertEquals; import javax.annotation.Resource; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations={"/context-helloworld.xml"}) public class HelloWorldServiceTest { private HelloWorldService helloworld; @Resource(name="helloworld") [ Maven based Project public void setHelloWorld(HelloWorldService hello) { this.helloworld = hello; Structure] } @Test public void SayHello() { assertEquals( "Hello egov framework!!!", helloworld.sayHello() ); } } [ Hello World TestCase] Page l 15 15
  • [LAB2] Hello World Test Development Environment  [Step 2-2] Run TestCase - Run test: : Select HelloWorldServiceTest class -> Run As -> JUnit Test  [Step 2-3] Check a test result Page l 16 16
  • [LAB3] Code Generation Development EnvironmentAs creating CRUD project based on Template, learn a Code Generation function.  [Step 3-1] Open lab103 project, connect to SampleDB HSQLDB in the Data Source Explorer.  [Step 3-2] As using “Show View” function from main menu, run eGovFramework > eGocFrame Templates View. Page l 17 17
  • [LAB3] Code Generation Development Environment  [Step 3-3] Select lab103 project, double click “eGovFrame Templates > CRUD > CRUD Program“ in the eGovFrame Template view.  [Step 3-4] Select PUBLIC > SAMPLE table and click “NEXT” button. Page l 18 18
  • [LAB3] Code Generation Development Environment  [Step 3-5] . Input directory information for automatically generation source code, and then click “Finish” button. Kildong, Hong 2012.10.10 Page l 19 19
  • [LAB3] Code Generation Development Environment  [Step 3-6] Open sql-map-config.xml file from egovframework.sqlmap.rte package in the src/main/resource, add created Sample_SQL.xml file. Page l 20 20
  • [LAB3] Code Generation Development Environment  [Step 3-7] Run the created project. Click lab103 > Run As > Run on Server  [Step 3-8] Check created project functions on the web browser. Page l 21 21