Вы находитесь на странице: 1из 25

Server

Intent
Required libraries
Directory structure
Deployed shared libraries
Deployed web applications
Server configuration file
Eclipse run configuration
Ant tasks

Server:
Intent

To locate and describe:


The libraries of the EBX server
The deployment to the EBX server
The configuration of the EBX server

Server:
Required libraries
The EBX server is an Apache Tomcat web server
The EBX Server project requires the following libraries:
to build and serve web applications
Apache Tomcat
to use the main EBX web applications
EBX Core
to send workflow emails (required by EBX Core)
Sun JavaMail
to handle email data (required by Sun JavaMail)
Sun JAF
Note: For further details about the Apache Tomcat library,
refer to the Apache Tomcat documentation

Server:
Directory structure
The EBX Server project contains the following directories:
to contain the web server configuration files
conf
to import or export EBX data files
data
to deploy shared libraries
lib
to collect the web server log files
logs
to deploy web applications
webapps
to store the web server cache files
work
Note: The data directory can be used in subsequent chapters,
for example to export a data set table into a file
See illustration
4

Server:
Directory structure

Server:
Deployed shared libraries

The lib directory contains the following deployed shared libraries:


to access the EBX public APIJAR from EBX Core
ebx.jar
to drive the H2 database JAR from EBX Core
h2.jar
to send workflow emails JAR from Sun JavaMail
mail.jar
to handle email data JAR from Sun JAF
activation.jar
Note: EBX web applications use mail.jar and activation.jar,
to send workflow emails to users within workflow executions

See illustration
6

Server:
Deployed shared libraries

Server:
Deployed web applications

The webapps directory contains the following deployed web applications:


to initialize the EBX web applications
ebx.war
to provide the EBX schemas
ebx-root.war
to provide the EBX user interface
ebx-manager.war
to provide the EBX data modeler
ebx-dma.war
to provide the EBX data services
ebx-dataservices.war
Note: For development convenience, the programming solutions are
deployed by referencing their project in the server configuration file
See illustration
8

Server:
Deployed web applications

Server:
Server configuration file

The conf directory contains the following configuration file:


to configure the Apache Tomcat web server
server.xml

See illustration
10

Server:
Server configuration file

11

Server:
Server configuration file

The server.xml file registers the following web applications:


to deploy all EBX web applications
EBX Server / webapps / *
to deploy a programming solution
Store Module / webapp
to deploy a programming solution
Store Portal / webapp
to deploy a programming solution
Store Service / webapp
Note: The crossContext parameter must be set to true for ebx.war,
to let this web application access resources of other web applications

12

Server:
server.xml
<Server port="8005" shutdown="SHUTDOWN">
...
<Host name="localhost" appBase="webapps" workDir="work" unpackWARs="true" autoDeploy="false">
<Context path="/ebx" docBase="./ebx.war" crossContext="true" />
<Context path="/StoreModule" docBase="../../Store Module/webapp" />
<Context path="/StorePortal" docBase="../../Store Portal/webapp" />
<Context path="/StoreService" docBase="../../Store Service/webapp" />
</Host>
...
</Server>

13

Server:
Eclipse run configuration

The root directory contains the following run configurations:


to start the EBX server in default mode
Start Default Server.launch
to start the EBX server in portal mode
Start Portal Server.launch
to stop the EBX server
Stop Server.launch
Note: The portal mode is used only in the Portal Integration chapter,
to integrate EBX graphical components into a web portal

See illustration
14

Server:
Eclipse run configuration

15

Server:
Eclipse run configuration

16

Server:
Eclipse run configuration

17

Server:
Eclipse run configuration

18

Server:
Ant tasks

The root directory contains the following Ant files:


to define various automatic tasks
build.xml
to specify input parameter values for the tasks
build.properties

See illustration
19

Server:
Ant tasks

20

Server:
Ant tasks

The build.xml file defines the following Ant tasks:


to clean the project
clean-project
to deploy the EBX Core to the EBX Server
deploy-ebx-core
to deploy the Sun libraries to the EBX Server
deploy-sun-libraries
to start the EBX Server in default mode
start-default-server
to start the EBX Server in portal mode
start-portal-server
to stop the EBX Server
stop-server

21

Server:
build.properties
libraries
libraries.ebx-core
libraries.ebx-core.lib
libraries.ebx-core.webapps
libraries.ebx-addons
libraries.sun-mail.jar
libraries.sun-activation.jar

=
=
=
=
=
=
=

../Libraries
${libraries}/EBX Core/ebx_CD_5.4.0.0907
${libraries.ebx-core}/ebx.software/lib
${libraries.ebx-core}/ebx.software/webapps/wars-packaging
${libraries}/EBX Add-Ons
${libraries}/Sun JavaMail/javamail-1.2/mail.jar
${libraries}/Sun JAF/jaf-1.0.2/activation.jar

server.lib
server.logs
server.webapps
server.work

=
=
=
=

./lib
./logs
./webapps
./work

catalina.base
catalina.home
catalina.classpath

= .
= ${libraries}/Apache Tomcat/apache-tomcat-7.0.42
= ${catalina.home}/bin/bootstrap.jar:
${catalina.home}/bin/tomcat-juli.jar

ebx.home
ebx-default.properties
ebx-portal.properties

= ../EBX Home
= ${ebx.home}/ebx-default.properties
= ${ebx.home}/ebx-portal.properties

run.jvm.arguments
debug.jvm.arguments

= -Xmx512M
= -Xmx512M -Xdebug
-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=1234

22

Server:
build.xml
<project name="EBX Server" default="reset-project" basedir=".">
<property file="${basedir}/build.properties" />
...
<target name="reset-project" description="Reset the project"
depends="clean-project, deploy-ebx-core, deploy-sun-libraries">
</target>
<target name="clean-project" description="Clean the project" depends="">
<delete includeemptydirs="true" >
<fileset dir="${server.lib}"
includes="**/*"/>
<fileset dir="${server.logs}"
includes="**/*"/>
<fileset dir="${server.webapps}" includes="**/*"/>
<fileset dir="${server.work}"
includes="**/*"/>
</delete>
</target>

23

Server:
build.xml
<target name="deploy-ebx-core" description="Deploy the EBX Core to the EBX Server">
<copy todir="${server.lib}" flatten="true">
<fileset id="ebx-core.jars" dir="${libraries.ebx-core.lib}" includes="**/*.jar"/>
</copy>
<copy todir="${server.webapps}" flatten="true">
<fileset id="ebx-core.wars" dir="${libraries.ebx-core.webapps}" includes="**/*.war"/>
</copy>
</target>
<target name="deploy-sun-libraries" description="Deploy the Sun libraries to the EBX Server">
<copy todir="${server.lib}" flatten="true">
<fileset id="sun-mail.jar" file="${libraries.sun-mail.jar}"/>
</copy>
<copy todir="${server.lib}" flatten="true">
<fileset id="sun-activation.jar" file="${libraries.sun-activation.jar}"/>
</copy>
</target>

24

Server:
build.xml
<target name="start-default-server" description="Start the EBX Server in default mode">
<java classname="org.apache.catalina.startup.Bootstrap" fork="true">
<sysproperty key="ebx.home"
value="${ebx.home}" />
<sysproperty key="ebx.properties" value="${ebx-default.properties}" />
<sysproperty key="catalina.home" value="${catalina.home}" />
<sysproperty key="catalina.base" value="${catalina.base}" />
<jvmarg line="${run.jvm.arguments}" />
<classpath path="${catalina.classpath}" />
<arg value="start" />
</java>
</target>
...
<target name="stop-server" description="Stop the EBX Server" depends="">
<java classname="org.apache.catalina.startup.Bootstrap" fork="true">
<sysproperty key="catalina.home" value="${catalina.home}" />
<sysproperty key="catalina.base" value="${catalina.base}" />
<jvmarg line="${run.jvm.arguments}" />
<classpath path="${catalina.classpath}" />
<arg value="stop" />
</java>
</target>
</project>

25

Вам также может понравиться