View
26
Download
0
Category
Preview:
Citation preview
Created by Erich, Lorman 04 / 2009, Contact : elorman@dezadata.cz
How to use Tomcat for ADF Application
Software Requirements ............................................................................................................... 1 Application technology specification .......................................................................................... 1 Getting started ............................................................................................................................. 2 Create Model ............................................................................................................................... 5 Create View ............................................................................................................................... 11 Deploy on Tomcat ..................................................................................................................... 21 Setup tomcat .............................................................................................................................. 22
Software RequirementsOracle JDeveloper 11gJava 1.6.xxxApache Tomcat 6.0.18
Based on HR Demo databáze (hr/hr)
Application technology specificationFussion Web ApplicationADF Bussines Components
1
Created by Erich, Lorman 04 / 2009, Contact : elorman@dezadata.cz
Getting startedClick on New application, Choose Fussion Web Application
Application name -> ADFTomcatDemoPrefix -> demo.fussion
<next>
Project name model, adf bussines komponent
<next>
2
Created by Erich, Lorman 04 / 2009, Contact : elorman@dezadata.cz
Keep as it is
<next>
Project viewcontroller , adf bussines komponent
<next>
3
Created by Erich, Lorman 04 / 2009, Contact : elorman@dezadata.cz
Keep as it is
<finish>
Now your screen should look like this
4
Created by Erich, Lorman 04 / 2009, Contact : elorman@dezadata.cz
Create Model
Add Entity
Right click Model, new
Bussines tier, adf bussines components, bussines components from tables
<ok>
5
Created by Erich, Lorman 04 / 2009, Contact : elorman@dezadata.cz
Connection, + (create databáze connection)
Setup as on screen
<ok>
Back on screen initialize bussines components object
<ok>
6
Created by Erich, Lorman 04 / 2009, Contact : elorman@dezadata.cz
Entity objects, nextUpdatable view object, next
Read-only view objectsQuery, select Countries
<next>
Application module
<next>
7
Created by Erich, Lorman 04 / 2009, Contact : elorman@dezadata.cz
Diagram<next>
Summary
<finish>
Click on Web.xml, open source view and comment out JpsFilter filter and mapping node as described on picture below
8
Created by Erich, Lorman 04 / 2009, Contact : elorman@dezadata.cz
Click on AppModule in project inspector
in settings window click edit for Appmodule Local
9
Created by Erich, Lorman 04 / 2009, Contact : elorman@dezadata.cz
Set connection type as JDBC DataSource, name it java:comp/env/jdbc/hr
Proceed same steps for AppModuleShared, then click OK
Model part of our application is now ready.
10
Created by Erich, Lorman 04 / 2009, Contact : elorman@dezadata.cz
Create View
Open from ViewController faces-config.xml, your screen should look like this
From komponent patlete / components / JSF Page grap to view
Name it demo.jspx
11
Created by Erich, Lorman 04 / 2009, Contact : elorman@dezadata.cz
Right click on demo.jspx, create page
<ok>
From data controls / appmoduleDataControl / CoutriesView1 drag on center screenCreate ADF read-only table, enable row selection, sorting
<ok>
12
Created by Erich, Lorman 04 / 2009, Contact : elorman@dezadata.cz
Build project,your screen should look like this
Setup ApplicationView controller, project properties, deployment
Edit
13
Created by Erich, Lorman 04 / 2009, Contact : elorman@dezadata.cz
General
War Options
14
Created by Erich, Lorman 04 / 2009, Contact : elorman@dezadata.cz
web files
web files - contributors
15
Created by Erich, Lorman 04 / 2009, Contact : elorman@dezadata.cz
web files - filters
Web – Inf/ classes
16
Created by Erich, Lorman 04 / 2009, Contact : elorman@dezadata.cz
Web – Inf/ classes / contributors
Web – Inf/ classes / filters
17
Created by Erich, Lorman 04 / 2009, Contact : elorman@dezadata.cz
Web – inf / Lib
Web – inf / Lib / contributors (nothing to do)
18
Created by Erich, Lorman 04 / 2009, Contact : elorman@dezadata.cz
Web – inf / Lib / filters (remove all)
Profile Dependencies
19
Created by Erich, Lorman 04 / 2009, Contact : elorman@dezadata.cz
Platform
Tomcat 6.x
<ok><ok>
20
Created by Erich, Lorman 04 / 2009, Contact : elorman@dezadata.cz
Deploy on Tomcat
• Add context.xml to /adftomcatdemo/viewcontroller/public_html/META-INF/• Setup in context.xml connection• url, user, password, databasename, port• Create war
Right click on view controller, deploy, adftomcat … , to War file
Copy war to webapps directory
21
Created by Erich, Lorman 04 / 2009, Contact : elorman@dezadata.cz
Setup tomcat
Copy libraries from list to Tomcat lib directory
adf-controller-api.jaradf-controller.jaradf-controller-rt-common.jaradf-faces-databinding-rt.jaradflibfilter.jaradflogginghandler.jaradfm.jaradfmweb.jaradf-pageflow-dtrt.jaradf-pageflow-fwk.jaradf-pageflow-impl.jaradf-pageflow-rc.jaradf-richclient-api-11.jaradf-richclient-impl-11.jaradf-share-base.jaradf-share-ca.jaradf-share-support.jarannotations-api.jarcache.jarcatalina-ant.jarcatalina-ha.jarcatalina.jarcatalina-tribes.jarcommons-el.jardb-ca.jardms.jardvt-faces.jardvt-jclient.jardvt-utils.jarel-api.jarfmw_audit.jaridentitystore.jarinspect4.jarjasper-el.jarjasper.jarjasper-jdt.jarjavatools-nodeps.jarjavax.management.j2ee_1.0.jarjewt4.jarjmxframework.jarjmxspi.jarjps-api.jarjps-common.jarjps-ee.jarjps-internal.jarjps-unsupported-api.jarjsf-api.jarjsf-ri.jar
22
Created by Erich, Lorman 04 / 2009, Contact : elorman@dezadata.cz
jsp-api.jarjstl.jarkniznice.txtmdsrt.jarojdbc6.jaroracle-el.jaroraclepki.jaroracle.xdb_11.1.0.6.0.jarorg.apache.commons.beanutils_1.6.jarorg.apache.commons.collections_3.1.jarorg.apache.commons.logging_1.0.4.jarosdt_cert.jarosdt_core.jarservlet-api.jarshare.jarstandard.jartomcat-coyote.jartomcat-dbcp.jartomcat-i18n-es.jartomcat-i18n-fr.jartomcat-i18n-ja.jartrinidad-api.jartrinidad-impl.jarwls-api.jarxercesImpl.jarxmlef.jarxml.jarxmlparserv2.jar
Edit /conf/server.xml
Add data ressource node
<GlobalNamingResources> <Resource name="UserDatabase" auth="Container"
type="org.apache.catalina.UserDatabase" description="User database that can be updated and saved" factory="org.apache.catalina.users.MemoryUserDatabaseFactory" pathname="conf/tomcat-users.xml"/>
<Resource name="jdbc/hr" auth="Container" type="oracle.jdbc.pool.OracleDataSource" driverClassName="oracle.jdbc.driver.OracleDriver" factory="oracle.jdbc.pool.OracleDataSourceFactory" url="jdbc:oracle:thin:@localhost:1521:xe" user="hr" password="hr" maxActive="20" maxIdle="10" maxWait="-1"/>
</GlobalNamingResources>
23
Created by Erich, Lorman 04 / 2009, Contact : elorman@dezadata.cz
Edit /conf/context.xml
add resource link
<ResourceLink global="jdbc/hr" name="jdbc/hr" type="oracle.jdbc.pool.OracleDataSource"/>
Start tomcat
/bin/startup.sh
Application should be visible at <<warname>>/faces/demo.jspx
24
Recommended