SlideShare a Scribd company logo
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 Environment


The 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 Environment


Check plug-in configuration through Window  Preference menu in Eclipse.
  Check basic encoding (UTF-8) – General > Workspace




                                                                                        Page l   4   4
Configuration                                                          Development Environment


Check plug-in configuration through Window  Preference menu in Eclipse.
  Check Maven(m2eclipse) configuration– Maven > User Settings




                                                                                        Page l   5   5
Configuration                                                          Development Environment


Check plug-in configuration through Window  Preference menu in Eclipse.

  Check installed JRE – Java > Installed JREs




                                                                                        Page l   6   6
Configuration                                                                   Development Environment


Check 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 Environment

Learn the functionality of the tools as creating and running the sample project, based on the eGovFrame
implementation 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 Environment

As 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 Environment

As 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

More Related Content

PDF
03.eGovFrame Runtime Environment Training Book Supplement
PDF
02. egovFrame Development Environment workshop II en(nexus&ci)
PDF
04.egovFrame Runtime Environment Workshop
PDF
02.egovFrame Development Environment training book
PDF
Maven nutshell
PPTX
Spring framework
PDF
The State of Java under Oracle at JCertif 2011
PDF
GlassFish & Java EE Business Update @ CEJUG
03.eGovFrame Runtime Environment Training Book Supplement
02. egovFrame Development Environment workshop II en(nexus&ci)
04.egovFrame Runtime Environment Workshop
02.egovFrame Development Environment training book
Maven nutshell
Spring framework
The State of Java under Oracle at JCertif 2011
GlassFish & Java EE Business Update @ CEJUG

What's hot (20)

PDF
GlassFish REST Administration Backend
PDF
OSGi-enabled Java EE Applications using GlassFish at JCertif 2011
PDF
Arun Gupta: London Java Community: Java EE 6 and GlassFish 3
PDF
Running your Java EE 6 applications in the Cloud
PDF
Understanding
PDF
The Java EE 7 Platform: Productivity & HTML5 at JavaOne Latin America 2012
PPT
JEE Course - JEE Overview
PDF
Apache DeltaSpike the CDI toolbox
KEY
Ejb 3.0 Runtime Environment
PPTX
Jboss Tutorial Basics
PDF
Java Summit Chennai: Java EE 7
PDF
Lo nuevo en Spring 3.0
PDF
Andrei Niculae - JavaEE6 - 24mai2011
PDF
JBoss started guide
PDF
Java EE 7 at JAX London 2011 and JFall 2011
PDF
The Java EE 7 Platform: Developing for the Cloud
PDF
TDC 2011: OSGi-enabled Java EE Application
PDF
JBoss AS / EAP and Java EE6
PPTX
Spring Framework Presantation Part 1-Core
PDF
Apache DeltaSpike
GlassFish REST Administration Backend
OSGi-enabled Java EE Applications using GlassFish at JCertif 2011
Arun Gupta: London Java Community: Java EE 6 and GlassFish 3
Running your Java EE 6 applications in the Cloud
Understanding
The Java EE 7 Platform: Productivity & HTML5 at JavaOne Latin America 2012
JEE Course - JEE Overview
Apache DeltaSpike the CDI toolbox
Ejb 3.0 Runtime Environment
Jboss Tutorial Basics
Java Summit Chennai: Java EE 7
Lo nuevo en Spring 3.0
Andrei Niculae - JavaEE6 - 24mai2011
JBoss started guide
Java EE 7 at JAX London 2011 and JFall 2011
The Java EE 7 Platform: Developing for the Cloud
TDC 2011: OSGi-enabled Java EE Application
JBoss AS / EAP and Java EE6
Spring Framework Presantation Part 1-Core
Apache DeltaSpike
Ad

Viewers also liked (6)

PPT
Kỹ năng tham gia Hội Chợ Triển Lãm Đà Nẵng Workshop P2
PPT
Kỹ năng tham gia Hội Chợ Triển Lãm Đà Nẵng Workshop P1
PDF
Thư viện trẻ sáng tạo - LCK - instruction storytime
PPTX
Twitter en classe
PPT
Nguyen Ly Ke Toan Chuong V
PPT
Nguyen Ly Ke Toan Chuong III
Kỹ năng tham gia Hội Chợ Triển Lãm Đà Nẵng Workshop P2
Kỹ năng tham gia Hội Chợ Triển Lãm Đà Nẵng Workshop P1
Thư viện trẻ sáng tạo - LCK - instruction storytime
Twitter en classe
Nguyen Ly Ke Toan Chuong V
Nguyen Ly Ke Toan Chuong III
Ad

Similar to 02.egovFrame Development Environment workshop I (20)

PDF
Part 2 java development
PDF
Jdc 2010 - Maven, Intelligent Projects
PPTX
JavaFX - Sketch Board to Production
PDF
Java, Eclipse, Maven & JSF tutorial
PDF
Part 1 workbench basics
PDF
Part 3 web development
KEY
Introduction To Maven2
PPTX
Selenium topic 4 - Selenium Web Driver Set Up
PPTX
Step by step - Selenium 3 web-driver - From Scratch
PPTX
Introduction to Maven
PPTX
Maven TestNg frame work (1) (1)
PDF
Part 6 debugging and testing java applications
PDF
Introduction to maven, its configuration, lifecycle and relationship to JS world
PDF
Part 5 running java applications
PPT
Maven Introduction
PPT
Testing Java Web Apps With Selenium
PPTX
Joget Workflow v6 Training Slides - 16 - Preparing Development Environment
PDF
Att lyckas med integration av arbetet från flera scrum team - Christophe Acho...
Part 2 java development
Jdc 2010 - Maven, Intelligent Projects
JavaFX - Sketch Board to Production
Java, Eclipse, Maven & JSF tutorial
Part 1 workbench basics
Part 3 web development
Introduction To Maven2
Selenium topic 4 - Selenium Web Driver Set Up
Step by step - Selenium 3 web-driver - From Scratch
Introduction to Maven
Maven TestNg frame work (1) (1)
Part 6 debugging and testing java applications
Introduction to maven, its configuration, lifecycle and relationship to JS world
Part 5 running java applications
Maven Introduction
Testing Java Web Apps With Selenium
Joget Workflow v6 Training Slides - 16 - Preparing Development Environment
Att lyckas med integration av arbetet från flera scrum team - Christophe Acho...

More from Chuong Nguyen (20)

PDF
HO CHI MINH CITY ECONOMIC FORUM HEF 2023 ENG FINAL - v1.pdf
PDF
DIỄN ĐÀN KINH TẾ TP. HỒ CHÍ MINH HEF 2023 VN FINAL Vietnamese Version.pdf
PPTX
2. THAM LUAN 02 - BO KH_CN Đánh giá sự phát triển của hệ sinh thái khởi nghi...
PPTX
2. THAM LUAN 02 - BO KH_CN EN - Đánh giá sự phát triển của hệ sinh thái khởi ...
PPTX
1. SO KHCN - VIE Xây dựng Đà nẵng thành trung tâm khởi nghiệp sáng tạo - Viet...
PPTX
03.THAM LUAN - Hệ sinh thái khởi nghiệp sáng tạo Queensland, Úc English
PPTX
4.THAM LUAN - HAN QUOC-VN Kinh nghiệm từ Hàn Quốc VI
PPTX
4. THAM LUAN - HAN QUOC - Kinh nghiệm từ Hàn Quốc EN
PPTX
1. SO KHCN - ENG - Xây dựng Đà nẵng thành trung tâm khởi nghiệp sáng tạo - EN...
PDF
The role of Innovation Ecosystem in supporting Startups go global [Mr. Yi Cha...
PPTX
DNES Google IO ext 2022 Báo cáo Hệ sinh thái khởi nghiệp đổi mới sáng tạo Việ...
PPTX
DNES - Thành đoàn - Chính sách hỗ trợ khởi nghiệp tại TP Đà Nẵng 2022
PPTX
Z0gravity Giải pháp quản lý dự án và quản lý danh mục dự án đầu tư - 2021
PDF
Dnes introduction Vietnam version 2021
PDF
DNES profile - introduction 2021 English version
PPTX
INVIETNAM - DANANG - HOI AN - TRAVEL GUIDE
PDF
Kiên tâm qua khủng hoảng - Chiến đấu và chiến thắng COVID-19
PDF
Vietnam in the digital era 2020
PDF
Customer experience and loyalty
PDF
Quan ly trai nghiem khach hang nielsen
HO CHI MINH CITY ECONOMIC FORUM HEF 2023 ENG FINAL - v1.pdf
DIỄN ĐÀN KINH TẾ TP. HỒ CHÍ MINH HEF 2023 VN FINAL Vietnamese Version.pdf
2. THAM LUAN 02 - BO KH_CN Đánh giá sự phát triển của hệ sinh thái khởi nghi...
2. THAM LUAN 02 - BO KH_CN EN - Đánh giá sự phát triển của hệ sinh thái khởi ...
1. SO KHCN - VIE Xây dựng Đà nẵng thành trung tâm khởi nghiệp sáng tạo - Viet...
03.THAM LUAN - Hệ sinh thái khởi nghiệp sáng tạo Queensland, Úc English
4.THAM LUAN - HAN QUOC-VN Kinh nghiệm từ Hàn Quốc VI
4. THAM LUAN - HAN QUOC - Kinh nghiệm từ Hàn Quốc EN
1. SO KHCN - ENG - Xây dựng Đà nẵng thành trung tâm khởi nghiệp sáng tạo - EN...
The role of Innovation Ecosystem in supporting Startups go global [Mr. Yi Cha...
DNES Google IO ext 2022 Báo cáo Hệ sinh thái khởi nghiệp đổi mới sáng tạo Việ...
DNES - Thành đoàn - Chính sách hỗ trợ khởi nghiệp tại TP Đà Nẵng 2022
Z0gravity Giải pháp quản lý dự án và quản lý danh mục dự án đầu tư - 2021
Dnes introduction Vietnam version 2021
DNES profile - introduction 2021 English version
INVIETNAM - DANANG - HOI AN - TRAVEL GUIDE
Kiên tâm qua khủng hoảng - Chiến đấu và chiến thắng COVID-19
Vietnam in the digital era 2020
Customer experience and loyalty
Quan ly trai nghiem khach hang nielsen

02.egovFrame Development Environment workshop I

  • 1. eGovFrame Lab Workbook Development Environment eGovFrame Center 2012 Page l 1 1
  • 2. 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
  • 3. Composition of the Lab environment Development Environment The 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
  • 4. Configuration Development Environment Check plug-in configuration through Window  Preference menu in Eclipse.  Check basic encoding (UTF-8) – General > Workspace Page l 4 4
  • 5. Configuration Development Environment Check plug-in configuration through Window  Preference menu in Eclipse.  Check Maven(m2eclipse) configuration– Maven > User Settings Page l 5 5
  • 6. Configuration Development Environment Check plug-in configuration through Window  Preference menu in Eclipse.  Check installed JRE – Java > Installed JREs Page l 6 6
  • 7. Configuration Development Environment Check 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
  • 8. 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
  • 9. [[LAB1] Generate Sample Project Development Environment Learn the functionality of the tools as creating and running the sample project, based on the eGovFrame implementation tools.  [Step 1-1] Select eGovFramework>start>New Web Project menu in Eclipse Select eGovFramework Web Project Page l 9 9
  • 10. [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
  • 11. [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
  • 12. [[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
  • 13. [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
  • 14. [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
  • 15. [LAB2] Hello World Test Development Environment As 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
  • 16. [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
  • 17. [LAB3] Code Generation Development Environment As 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
  • 18. [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
  • 19. [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
  • 20. [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
  • 21. [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