Developers Guide for Oracle Application Development Framework - DOC
W
Description
Developers Guide for Oracle Application Development Framework document sample
Document Sample


State of Florida
Department of Environmental Protection
A Guide to Server Side Building
GDE-09061801.2.1
Date: April 6, 2010
Document Status: Final
Version: 2.1
Authored by: Office of Technology &
Information Services
Revision History
Date Description Version
4/6/2010 Corrected text on page 7, in Adding the log4j.properties File section. 2.0
Guide to Server Side Building
GDE-09061801.2.1
Table of Contents
REVISION HISTORY................................................................................................................................................. 2
PURPOSE ............................................................................................................................................................... 3
REQUESTING SETUP OF NEW APPLICATION STRUCTURE ........................................................................................ 3
REQUESTING BUILD ENVIRONMENT ACCESS.......................................................................................................... 3
SUBVERSION REPOSITORY USER ACCESS .............................................................................................................................3
APPLICATION GROUP ACCESS ...........................................................................................................................................3
BUILD ACCESS ...............................................................................................................................................................4
APPLICATION SERVER ENVIRONMENT ................................................................................................................... 4
SUBVERSION CODE REPOSITORY ........................................................................................................................... 4
CREATING A SUBVERSION CONNECTION IN ORACLE JDEVELOPER .............................................................................................4
Configuring the Connection ..................................................................................................................................4
CREATING A MAPPING TO SUBVERSION REPOSITORY SHARED LIBRARIES ...................................................................................5
SETUP OF MIDDLE TIER BUILD ENVIRONMENT ...................................................................................................... 6
BUILDING A PROJECT FOR DEPLOYMENT TO INTEGRATION ................................................................................... 6
ADDING CUSTOM COMPONENT LIBRARIES ..........................................................................................................................6
PREPARING A PROJECT FOR BUILD .....................................................................................................................................7
IMPORTING AN EXISTING PROJECT INTO SUBVERSION ..........................................................................................................11
EXECUTING A BUILD .....................................................................................................................................................12
RELEASING THE VERSION AND BETA DEPLOYMENT ..............................................................................................................14
PRODUCTION DEPLOYMENT............................................................................................................................................20
RETRIEVING AN EAR OR WAR FILE ....................................................................................................................................21
BIBLIOGRAPHY ..................................................................................................................................................... 23
Page ii of 24
Guide to Server Side Building
GDE-09061801.2.1
Purpose
This guide provides information to application developers on requesting access to the DEP build
environment. It also provides instructions on configuring applications for the development
environment, Oracle Portal and Oracle Identity Management-based infrastructure and security
framework, adding custom components to the server-side Subversion repository, executing a
build, and requesting portlet links and application deployment jobs.
Requesting Setup of New Application Structure
You must send a request to the DEP Office of Technology and Information Services (OTIS) for
access to server resources before checking a new application into the DEP Subversion repository,
building the application and deploying it in the DEP environment. The request process is
documented in the Java Application Deployment Standard (FL Dept. of Environmental
Protection, 2010).
The OTIS Middle Tier and Application Services support groups will process the request to
establish the code repository and application server access. See the Requesting Build
Environment Access section below.
Requesting Build Environment Access
The project lead developer can request Build Environment Access by sending a completed
Application Setup Request to the DEP Middle Tier support team at
MiddleTierOracle@dep.state.fl.us and svn_admin@dep.state.fl.us. The server security consists
of the Subversion Repository User, Application Group and Build Script access layers.
Subversion Repository User Access
All developers on a project must obtain a user account with user ID and password to access the
Subversion repository. These accounts are created based on the information entered on the
Application Setup Request.
Application Group Access
The Subversion support team has established Subversion/Continuum application groups to
protect application code from inadvertent overwrite. When user access is requested, the
appropriate application group for your application must be specified to be able to build the
application. See the Application Setup Request Template (FL Dept. of Environmental
Protection, 2010) for instructions on Subversion application groups.
Page 3 of 24
Guide to Server Side Building
GDE-09061801.2.1
Build Access
In order to execute the server build scripts for adding custom components and building
applications, the user must have a user id and access to the application group in the Continuum
product. It is recommended that Build access be obtained only for the developer(s) who will be
performing controlled builds.
Application Server Environment
All DEP Java based applications are accessed from the DEP Portal. Portal security is managed
by the Oracle Identity Management suite, which consists of self-registration for the public users,
and a LDAP based security implementation of access roles.
For hardware and application server component versions, refer to the IT Infrastructure
Environment Specification (FL Dept. of Environmental Protection, 2010). The software build
environment is defined in the Software Build Environment Standard (FL Dept. of
Environmental Protection, 2010).
Subversion Code Repository
All projects must maintain their source code in the DEP Subversion repository; source code must
be checked in nightly. For a developer to gain access to the repository, the application project
lead must complete an Application Setup Request form including the developer information and
the “role” (view only, build access, deploy access, deploy to Beta access, etc.) the developer will
be given in the group.
The Applications Development SVN repository administrator will create the appropriate
application directory, the application group (represents the team responsible for all applications
within that portion of the repository), and the developer accounts; the administrator will return
the information to the project lead. The project lead is responsible for disbursing the information
to his group.
Creating a Subversion Connection in Oracle JDeveloper
All projects are stored in Subversion (SVN) on the DEP SVN/Maven Build server, MTBLD, in
group directory inside the /maven/svnroot directory. The SVN connection settings in JDeveloper
are as follows:
Configuring the Connection
Choose the View Versioning Navigator menu option to display the navigator window.
Right click on the Subversion node and Choose New Repository Connection from the
menu. Complete the four sections of the window as follows:
Repository URL: The repository URL consists of the root of the repository.
To secure application code by development group, a
repository is created for each development group that
maintains code. In the example below, the repository root
Page 4 of 24
Guide to Server Side Building
GDE-09061801.2.1
is: svn://mtlbld.dep.state.fl.us/otis; which also identifies
the group maintaining the code as OTIS.
Connection Name: The Connection Name is free-form text that is displayed in
the JDeveloper Versioning Navigator.
User Name: The SVN account established for the developer by the SVN
administrator.
Password: The password for the developer SVN account for this
development group. This is generated by the SVN
administrator and returned to the application project lead at
time of setup. A separate username/password is generated
for a developer for each SVN repository to which they have
access.
After completeing the sections, click the Test Read Access button to verify the
connection. The Status text box will display if access is granted. If successful, click the
OK button to complete the addition of the connection.
Creating a Mapping to Subversion Repository Shared Libraries
The Subversion repository contains standard and enterprise jar files for use by all DEP
developers. It is recommended that all developers create a Windows mapping on their Y: drive
for dependencies, and add dependencies in the JDeveloper's .jpr file. Adding dependencies from
the shared location allows multiple developers to work on the same project without loss of linked
jars. Once mapped, you can add any dependent libraries to JDeveloper by browsing that drive.
Map the Y: drive on your PC to: \\mtbld\maven-continuum-jar-repository
Page 5 of 24
Guide to Server Side Building
GDE-09061801.2.1
Setup of Middle Tier Build Environment
The DEP development Middle Tier build environment has been established using the Apache
Continuum product. As stated above, a limited set of developers should have privileges to build
an application. The application project lead is responsible for identifying the set of developers
and listing them on the Application Setup Request form or requesting access for additional
developers via email to svn_admin@dep.state.fl.us. Authorized developers will log on to
Continuum using the supplied username/password at:
http://mtbld.dep.state.fl.us:8080/continuum
Once logged on, only the project groups will be displayed to which the developer has been given
access. The actions which they can perform are limited by the role (view only, build only, build
and deploy, release, deploy to beta, etc.).
Building a Project for Deployment to Integration
Adding Custom Component Libraries
Only the SVN Administrator has permissions to install custom component libraries into the
Maven repository. If you require custom components for your project, email the administrator at
svn_admin@dep.state.fl.us. Include the following in the email:
Group represents the Maven group name that the developer assigns to the jar.
Artifact represents the name of the jar file that is being installed.
Version represents the version of the jar that is being installed.
The administrator will install the jars and return email the UNIX Path of where the jar file is
currently located on MTBLD.
For example, the registered log4j-1.2.8.jar file can be located at:
/log4j/log4j/log4j-1.2.8.jar
To complete the installation process, the dependent project’s pom.xml file must be modified by
adding the associated dependency. Below is an example of the dependency for the example text
above.
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.8</version>
</dependency>
Page 6 of 24
Guide to Server Side Building
GDE-09061801.2.1
Preparing a Project for Build
Adding the weblogic.xml File
The DEP Middle Tier environment consists of Oracle Application Server running on
Weblogic. A weblogic.xml file must be placed in the /WEB-INF/ directory for use with
this server.
Example:
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<weblogic-web-app>
<container-descriptor>
<prefer-web-inf-classes>true</prefer-web-inf-classes>
</container-descriptor>
<context-root>DwrmOcp</context-root>
</weblogic-web-app>
Adding the log4j.properties File
The log4j.properties file configures the settings used to create and manage debugging log
files. If an application is coded to append to a log file, the files are stored in the /app-
logs/ directory on each server tier. To facilitate these logs, DEP has established server
environment variables to manage settings as found below. Place the file in the
/trunk/public_html/WEB-INF/classes directory (ex: dep-abc/trunk/public_html/WEB-
INF/log4j.properties) and then edit it, replacing the <context root> placeholder with the
name of your application.
log4j.rootLogger=${LOG_LEVEL}, R
log4j.appender.R=org.apache.log4j.RollingFileAppender
log4j.appender.R.File=${LOG_HOME}/<context root>.log
log4j.appender.R.MaxFileSize=${LOG_MAXFILESIZE}
# Number of backup files retained
log4j.appender.R.MaxBackupIndex=${LOG_MAXBACKUPINDEX}
log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%-d{MMM-dd-yyyy HH:mm:ss} %-
5p Logger:%c{1} (Class:%F Method:%M Line:%L) - %m%n
Page 7 of 24
Guide to Server Side Building
GDE-09061801.2.1
Creating the pom.xml File
The POM.XML is the Maven2 project object model, which is required to build the
project in the DEP environment. An initial default pom.xml file can be obtained from the
URL:
http://mtbld.dep.state.fl.us/files/example-pom.xml
Rename this file to pom.xml and place it at the root of your project (ex: dep-
abc/pom.xml) and then edit it, replacing the group id, artifact id, and version of your
project. The version must end with –SNAPSHOT to function with the DEP continuous
deployment/release process.
Example: The packaging can be "war", and the build script, which builds your
project, will encapsulate the war file in the necessary .ear file
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>dep</groupId>
<artifactId>dep-cri</artifactId>
<version>1.2.17-SNAPSHOT</version>
<packaging>war</packaging>
<dependencies>
…
</dependencies>
…
</project>
Mandatory Sections of the pom.xml File
You must also complete the mandatory sections to the POM for Developers, Mailing
Lists, Contributors, and externally required repositories per the specifications found on
http://maven.apache.org/pom.html sections 4 and 5
Adding Dependencies to the pom.xml File
All jar file dependencies must be added to the pom.xml. To add a dependency the
reference to the dependency must be specified in the pom.xml.
Example:
<dependency>
<groupId>dep</groupId>
<artifactId>securitymanager</artifactId>
<version>1.2.0</version>
</dependency>
Page 8 of 24
Guide to Server Side Building
GDE-09061801.2.1
1) Verify that the dependency exists on the MTBLD server, so that Maven2 can include
the dependency when the project is built. In the example above, the file exists at the
following location on the MTBLD, which can be accessed with Windows Explorer.
\\mtbld\maven-continuum-jar-repository\dep\securitymanager\1.2.0\securitymanager-
1.2.0.jar
2) The format of the file path in \\mtbld\maven-continuum-jar-repository in relation to
the dependency is as follows:
...\ group id \ artifact id \ artifact id - version .jar
3) You can verify if your dependency exists on the MTBLD server by searching for your
dependency using Windows search.
4) If the file exists, make sure that the dependency entry exists in your pom.xml. If the
file does not exist on MTBLD, follow the instruction found above in the Adding
Custom Library Components section.
5) Verify that the file can be accessed from Windows from the file path in step 2.
Adding the Oracle Security Manager Dependencies to the pom.xml and
web.xml Files
To enable security for your application, the following dependency must be included in
the project pom.xml.
<dependency>
<groupId>dep</groupId>
<artifactId>securitymanager</artifactId>
<version>1.2.0</version>
</dependency>
In the example above, the version used is 1.2.0. Make sure to use the latest version of
this jar file. You can find out the latest version by browsing the Subversion repository on
\\mtbld\maven-continuum-jar-repository.
Page 9 of 24
Guide to Server Side Building
GDE-09061801.2.1
Add the following filter and filter mapping to the web.xml found in the /WEB-INF/
directory. If you have more filters, ensure that all filter entries are listed first followed by
all filter mapping entries. The Authenticate filter should be the first filter listed.
…
<filter>
<filter-name>DeveloperFilter</filter-name>
<filter-class>dep.util.DeveloperFilter</filter-class>
<init-param>
<param-name>orclsamaccountname</param-name>
<param-value>developer name</param-value>
</init-param>
<init-param>
<param-name>email</param-name>
<param-value>developer email address</param-value>
</init-param>
<init-param>
<param-name>firstname</param-name>
<param-value>developer first name</param-value>
</init-param>
<init-param>
<param-name>middle</param-name>
<param-value>developer middle name</param-value>
</init-param>
<init-param>
<param-name>lastname</param-name>
<param-value>developer last name</param-value>
</init-param>
<init-param>
<param-name>fullname</param-name>
<param-value>developer full name</param-value>
</init-param>
<init-param>
<param-name>secondaryuid</param-name>
<param-value>developer portal logon</param-value>
</init-param>
<init-param>
<param-name>samaccount</param-name>
<param-value>developer portal logon</param-value>
</init-param>
<init-param>
<param-name>roles</param-name>
<param-value>developer app roles in format of Role:role level (example:
Lurker:10;Editor:20;Contributor:30)</param-value>
</init-param>
</filter>
Page 10 of 24
Guide to Server Side Building
GDE-09061801.2.1
<filter>
<filter-name>PublicFilter</filter-name>
<filter-class>dep.util.PublicFilter</filter-class>
</filter>
<filter>
<filter-name>AuthenticateFilter</filter-name>
<filter-class>dep.util.Authenticate</filter-class>
</filter>
<!-- when running on your PC, enable the developer filter. It creates a "UserInfoObject" in
session -->
<!-- when running on the SERVER, disable the DeveloperFilter mapping -->
<!--
<filter-mapping>
<filter-name>DeveloperFilter</filter-name>
<url-pattern>*</url-pattern>
</filter-mapping>
-->
<filter-mapping>
<filter-name>PublicFilter</filter-name>
<url-pattern>/public/*</url-pattern>
</filter-mapping>
<!-- When running the app on the server, ENABLE the Authenticate filter below -->
<!--To filter EVERYTHING, use <url-pattern>/*</url-pattern> -->
<filter-mapping>
<filter-name>AuthenticateFilter</filter-name>
<url-pattern>*.do</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>AuthenticateFilter</filter-name>
<url-pattern>*.jsp</url-pattern>
</filter-mapping>
…
Importing an Existing Project into Subversion
All developers with a Subversion account and with group access can save new project files into
the DEP Subversion repository for established projects. If an application project does not yet
exist in Subversion, only the Administrator can import a full project file into the Subversion
repository. See the Requesting Build Environment Access section above to request import of an
established application.
Page 11 of 24
Guide to Server Side Building
GDE-09061801.2.1
Executing a Build
To perform a Maven build for a project, you must first prepare and check it to the Subversion
repository. You must also have a Continuum account with access to the application project
group and permissions to build the application. This setup is requested by the Application
Project Lead for each developer within the team.
Once access is established, developers log onto Continuum at:
http://mtbld.dep.state.fl.us:8080/continuum
Once logged on, only the project groups will be displayed to which the developer has been given
access. The actions which they can perform are limited by the role (view only, build only, build
and deploy, release, deploy to beta, etc.).
Click the Project Group Name in which your project definitions are stored to drill-down to the
project to be built.
Page 12 of 24
Guide to Server Side Building
GDE-09061801.2.1
Next, click the Project Name to view the build definitions for the project.
The Continuum group administrator (established at the time of original SVN/Continuum setup as
listed on the setup request form) is responsible for creating the Integration build definitions for
each project in their project group. We recommended establishing four standard build
definitions for each project: Build and Deploy, Un-deploy, Deploy Only without Building,
and
Build Only with Reporting. The Continuum Build definition Goals and Arguments sections
determine which process occurs. The screenshot below documents those settings.
Once the definitions have been created, to perform a Build and Deploy, click the Build icon
next to the appropriate definition to begin the process.
Page 13 of 24
Guide to Server Side Building
GDE-09061801.2.1
To view the progress and build results, click the Build tab at the top of the screen.
Releasing the version and Beta deployment
To deploy the application to Beta, you must first build and deploy it to Integration and
thoroughly test. Toward the end of testing, the Project Lead must complete a MTT Migration
Beta/Prod request and submit it to the DEP Middle Tier support team at
MiddleTierOracle@dep.state.fl.us and svn_admin@dep.state.fl.us to establish the necessary
permissions and structure for Beta deployment. Once setup is complete, the Project Lead must
release the application development snapshot and then deploy to Beta. To release the
development snapshot, access the Continuum Project Group screen and click the Release icon
next to the appropriate project. The process consists of two parts: Prepare for release and
Perform release. Follow the screen steps to complete the release.
Page 14 of 24
Guide to Server Side Building
GDE-09061801.2.1
First, choose the Prepare project for release radio button and click Submit.
Next, complete the sections as follows:
Copy the username and password from the SCM Tag Base section (found after the // and
before mtbld – example: svn://username:pword@mtbld.dep.state.fl.us/otis/dwm-
stcm/tags) to the SCM Username and SCM Password sections respectively.
Remove the username and password from the SCM Tag Base section.
Choose Maven 2.1.0 from the Build Environment drop-down.
Click the Use Edit Mode check box.
Click the Submit button.
Page 15 of 24
Guide to Server Side Building
GDE-09061801.2.1
The next screen displays the status of the release process. When all statuses are complete,
you may view the output and then click the Done button.
Next, perform the project release by clicking the radio button next to Perform project release
and clicking the Submit button.
Page 16 of 24
Guide to Server Side Building
GDE-09061801.2.1
The Perform Release screen sets the process for auto-deployment to the Beta server. Leave the
default values and click the Submit button.
The next screen provides the output of the release and deployment process. When all statuses
are complete, you may view the output and then click the Done button.
Page 17 of 24
Guide to Server Side Building
GDE-09061801.2.1
The release version is created, saved in your SVN repository, your development version is
incremented to the next –SNAPSHOT version, and the project pom is updated with the new
version. Developers should accept the update from the SVN repository in JDeveloper at this
point so that they have the new version of the pom.
The next step is to deploy the released project to the Beta Middle Tier server. The Continuum
Project Lead will see a Beta Deployment Project Group in Continuum for each project for which
a MTT Beta Migration package has been submitted.
Page 18 of 24
Guide to Server Side Building
GDE-09061801.2.1
Open the Beta project group and click the Project Name to drill down to the Build Definition.
Next, click the Build icon next to the project name to begin the Beta deployment process.
Page 19 of 24
Guide to Server Side Building
GDE-09061801.2.1
To monitor the deployment process, choose the Builds tab. If the status is successful, a green
icon will be displayed .
Production deployment
To deploy the application to Production, you must first build and deploy it to Integration,
thoroughly test, release and deploy to Beta and thoroughly test. Toward the end of Beta testing,
the Project Lead must complete a MTT Migration Beta/Prod request and submit it to the DEP
Middle Tier support team at MiddleTierOracle@dep.state.fl.us and svn_admin@dep.state.fl.us to
establish the necessary permissions and structure for Production deployment. The version
released to Beta must be used for the production deployment. The request process is
documented in the Java Application Deployment Standard (FL Dept. of Environmental
Protection, 2010).
Page 20 of 24
Guide to Server Side Building
GDE-09061801.2.1
Retrieving an ear or war File
There are two available tools for retrieving an application ear/war file. The first option is found
in Continuum. To navigate and retrieve working copies:
Choose the appropriate Member Project from the Project Group list.
Click the Working Copy tab found at the top of the Project Information screen.
Drill down to the appropriate directory and click the ear/war link.
The second option utilizes the Tortoise SVN utility. The utility must first be downloaded and
installed; the installer is found at: http://tortoisesvn.net/downloads
Page 21 of 24
Guide to Server Side Building
GDE-09061801.2.1
Once installed, the Tortoise SVN option is displayed under the File menu in the Windows
Explorer. Choose the Repo-browser option to open a window into the SVN repository.
Tortoise will prompt for the repository URL for connection authentication:
svn://username:pword@mtbld.dep.state.fl.us/otis/. Enter the URL using the SVN username
and password provided to you by the SVN administrator and then click OK.
Page 22 of 24
Guide to Server Side Building
GDE-09061801.2.1
The repository browser displays all applications in your repository group. Navigate to the
appropriate project and drill down to locate the ear/war file. Highlight the file and right-click to
open or save to another location.
Bibliography
FL Department of Environmental Protection. (2010). Java Application Naming Standard.
Tallahassee: FL DEP.
FL Dept. of Environmental Protection. (2010). IT Infrastructure Environment Specification.
Tallahassee: FL DEP.
FL Dept. of Environmental Protection. (2010). Java Application Deployment Standard.
Tallahassee: FL DEP.
FL Dept. of Environmental Protection. (2010). Software Build Environment Standard.
Tallahassee: FL DEP.
Page 23 of 24
Related docs
Other docs by bsl20161
Get documents about "