![]() |
![]() |
|
|
Assembling and Deploying Enterprise Applications
WebLogic Portal requires that you deploy all of your e-business resources within enterprise applications. Each enterprise application contains the following types of components (see Figure 5-1):
Figure 5-1 Your Enterprise Application
This topic describes how to assemble and deploy an enterprise application on a WebLogic Portal application server:
Create a Root Directory
Create a directory that serves as the root of your application. Choose a directory name that indicates the purpose and scope of the application. The name of the directory is not visible to customers who visit your site.
To support multiple developers in a development environment, you might deploy multiple instances of this enterprise application under different names on a single server. To do so, you must create multiple copies of the application's directory tree and rename the root directories for each instance. For example, you want to deploy multiple instances of an enterprise application whose root directory is name BankApp. You create two copies of the BankApp directory tree and change the root name of one tree to BankApp1 and the other to BankApp2. For more information, refer to Deploy Multiple Instances of an Application.
Create Deployment Descriptors
Each enterprise application uses two deployment descriptors: application.xml, which contains standard J2EE properties and application-config.xml, which contains properties that declare and configure JMX MBeans. WebLogic Portal uses MBeans to dynamically configure application services.
To create deployment descriptors for your enterprise application, do the following:
Copy Reference Files
The reference enterprise applications include deployment descriptors that declare the modules, security roles, and MBeans that are required to support WebLogic Portal.
To copy these files to your enterprise applications, do the following:
myApplication/META-INF
PORTAL_HOME/applications/wlcsApp/META-INF/application.xml
PORTAL_HOME/applications/wlcsApp/META-INF/application-config.xml
Modify application.xml
Open your application.xml in a text editor to make the following modifications:
For a general introduction to the elements in application.xml, refer to "application.xml Deployment Descriptor Elements" in the WebLogic Server Developing Applications guide.
Application Name
At the top of the application.xml file is a declaration of the name of the enterprise application. WebLogic Server displays this name in the WebLogic Server Administration Console. Your customers do not see this name.
To provide a unique name for your application, change the values in the following elements:
<application>
<display-name>name-of-your-application</display-name>
<description>optional-text-description</description>
Declarations for Web Applications
In application.xml you must declare each Web application that you copy into your enterprise application's directory tree. For information about copying Web applications and declaring them in application.xml, refer to the following sections:
Remove any <web> modules declaring Web applications that you are not including. Below is an example of a declaration for the catalogws Web application:
<module>
<web>
<web-uri>catalogws-webservice.war</web-uri>
<context-root>wlcsAppCatalogTool</context-root>
</web>
</module>
Declarations for EJBs
In application.xml you must declare each EJB that your application uses. For information on adding EJBs and declaring them in application.xml (and other deployment descriptors), refer to Add JAR Files.
Remove any <ejb> modules declaring EJBs that you are not including in your enterprise application.
Declarations of Security Roles
The application.xml file must declare all J2EE security roles that constituent Web applications use.
A WebLogic Portal application.xml file must declare all of the following security roles. Do not modify them: the EJBs and other components that support your applications expect these role names to be present in the application:
<security-role>
<description>Registered customers with role CustomerRole
</description>
<role-name>CustomerRole</role-name>
</security-role>
<security-role>
<description>Portal Administrators</description>
<role-name>AdminRole</role-name>
</security-role>
<security-role>
<description>Anonymous access</description>
<role-name>AnonymousRole</role-name>
</security-role>
<security-role>
<description>Administrative role for ebusiness</description>
<role-name>AdministrativeRole</role-name>
</security-role>
You can declare additional security roles to support your security scheme.
The weblogic.xml file for each Web application maps principals in the security realm to these J2EE security roles. For more information, refer to Security-Role Mappings.
The web.xml file for each Web application declares which role can access a set of secured resources. For more information, refer to Declarations of Secure JSPs.
Modify application-config.xml
The application-config.xml deployment descriptor declares MBeans and provides a persistent storage for their configuration data. Before you deploy your enterprise application, use a text editor to remove declarations for MBeans that configure services you do not use.
After you deploy your application, do not use a text editor to modify this file. Instead, use the WebLogic Server Administration Console to modify the MBean configurations. For more information, refer to Use the WebLogic Server Administration Console to Configure MBeans.
Similar to the JAR files and supporting Web applications, WebLogic Portal uses specific MBeans to support services. You can remove declarations for MBeans that configure services you do not use.
In all of the following XML elements, you can change the value of the name attribute to match your enterprise application, but it is not required.
The file contains declarations and configurations for the following MBeans:
Event Service
The following elements set parameters for the Event service:
<EventService
Listeners="com.bea.campaign.internal.CampaignEventListener"
Name="wlcsApp"
>
</EventService>
You can include any of the following values in the Listeners attribute (separate multiple values with a comma):
For more information about these properties, refer to "Persisting Tracking Behavior Data" in the Guide to Events and Behavior Tracking.
Behavior Tracking Service
The following elements set parameters for the Behavior Tracking service:
<BehaviorTracking
Name="wlcsApp"
MaxBufferSize="100"
SweepInterval="10"
SweepMaxTime="120"
DataSourceJndiName="weblogic.jdbc.jts.commercePool"
PersistedEventTypes="AddToCartEvent,BuyEvent,CampaignUserActivityEvent,
ClickContenEvent,ClickProductEvent,ClickCampaignEvent,DisplayContentEvent,
DisplayProductProductEvent,DisplayCampaignEvent,PurchaseCartEvent,
RemoveFromCartEvent,RuleEvent,SessionBeginEvent,SessionEndEvent,
SessionLoginEvent,UserRegistartionEvent"
>
</BehaviorTracking>
Campaign Service
The following element and its subelements configure the Campaign Service for all Web applications in the current enterprise application.
Note: If you include this element and subelements, your CLASSPATH variable must specify campaign_system.jar. For more information, refer to Add Directories to CLASSPATH.
<CampaignService
Name="wlcsApp"
GoalCheckTime="300000"
EmailBrowseBaseDir="campaigns/emails"
EmailURIExtensions="jsp,html,htm,txt"
>
<CampaignEventListener
Name="wlcsApp"
CampaignServiceJNDIName="${APPNAME}.
BEA_campaign.CampaignService"
>
</CampaignEventListener>
<MailAction
Name="wlcsApp"
DefaultFromAddress="acme@acme.com"
EmailPropertySet="CustomerProperties"
EmailPropertyName="Email"
OptInPropertySet="Demographics"
OptInPropertyName="Email_Opt_In"
>
</MailAction>
</CampaignService>
For more information about configuring campaigns to send email, refer to "Setting Up and Sending Email for Campaigns" in the Guide to Developing Campaign Infrastructure.
For information on configuring basic Mail Service features, refer to Mail Service.
The Scenario Service
The following element configures MBeans for the Scenario Service.
Note: If you include this element and subelements, your CLASSPATH variable must specify campaign_system.jar. For more information, refer to Add Directories to CLASSPATH.
<ScenarioService
Name="wlcsApp"
RulesSessionAttrNames="RulesRequestAttrNames"
>
</ScenarioService>
If you use Commerce services with your campaigns, include the following element:
<AttributeLoader
RequestLoaders="com.bea.commerce.ebusiness.campaign.ShoppingCartAttribute
/>
In addition to including the <AttributeLoader> element your application must deploy commerce_campaign_bridge_util.jar. For more information, refer to JARs for Campaign and Commerce Interaction.
Ad Service
The attributes and subelements in the AdService element support ad placeholders and the <ad:adTarget> JSP tag. The AdContentProvider element register Java classes that render the HTML necessary to display specific types of content (based on MIME type). If you create Java classes to display additional types of content, you must add a <AdContentProvider> element as described in "Supporting Additional MIME Types" under "Setting Up Ads for Campaigns" in the Guide to Developing Campaign Infrastructure.
The AdService element includes an EventTracker attribute. You can place any of the following values in the EventTracker attribute (separate multiple entries with a comma):
Below is an example of the <AdService> element:
<AdService
Name="wlcsApp"
DisplayFlushSize="10"
Rendering="com.bea.p13n.ad.AdContentProviderBase"
EventTracker="<AdEventTracker class name>"
AdClickThruURI="AdClickThru"
ShowDocURI="ShowDoc"
>
<AdContentProvider
Name="text"
Provider="com.bea.p13n.ad.render.TextContentProvider"
Properties=""
>
</AdContentProvider>
<AdContentProvider
Name="image"
Provider="com.bea.p13n.ad.render.ImageContentProvider"
Properties="AdClickThruURI=AdClickThru;ShowDocURI=ShowDoc"
>
</AdContentProvider>
<AdContentProvider
Name="application/x-shockwave-flash"
Provider="com.bea.p13n.ad.render.ShockwaveContentProvider"
Properties="ShowDocURI=ShowDoc"
>
</AdContentProvider>
</AdService>
Mail Service
The MailService element configures the basic features of the Mail Service:
<MailService
Name="wlcsApp"
SMTPHost="boulder"
>
</MailService>
Note: The Campaign Service uses the Mail Service to send email. The <CampaignService> element includes a subelement for configuring how campaigns use the Mail Service. For more information, refer to Campaign Service.
In addition to using campaigns to access the Mail Service, you can access and use the Mail Service from the com.bea.p13n.mail.MailManager command. For more information, refer to "Sending Bulk Mail" in the Guide to Developing Campaign Infrastructure.
Cache Service
The CacheManager element and its subelements declare named configurations for caches. When you create a cache, you can specify one of these configurations. The CacheFactory API spawns an MBean which, in turn, configures the cache on all nodes of a cluster.
For more information about configuring caches, refer to "Using Caches" in the Performance Tuning Guide.
Document Manager and Document Connection Pool
Use the DocumentManager element to configure the DocumentManager EJB, which does the following:
In the following example from a reference web.xml file, the Web application configures DocumentManager with all default values:
<DocumentManager
Name="default"
DocumentConnectionPoolName="default"
PropertyCase="none"
MetadataCaching="true"
MetadataCacheName="documentMetadataCache"
UserIdInCacheKey="false"
ContentCaching="true"
ContentCacheName="documentContentCache"
MaxCachedContentSize="32768"
>
</DocumentManager>
Use the DocumentConnectionPool element to configure a connection pool for the DocumentManager EJB. The DocumentManager uses this pool to maintain connections to the content management system, and thus reduce overhead for each time it accesses the system.
In the following example from a reference web.xml file, the Web application configures DocumentConnectionPool:
<DocumentConnectionPool
Name="default"
DriverName="com.bea.p13n.content.document.jdbc.Driver"
URL="jdbc:beasys:docmgmt:com.bea.p13n.content.document.
ref.RefDocumentProvider"
Properties="jdbc.dataSource=weblogic.jdbc.pool.commercePool;
schemaXML=C:/bea/Portal4.0/dmsBase/doc-schemas;
docBase=C:/bea/Portal4.0/dmsBase"
InitialCapacity="20"
MaxCapacity="20"
CapacityIncrement="0"
/>
For more information, refer to "Creating and Managing Content" in the Guide to Building Personalized Applications.
Entitlements Service
An entitlement segment is a visitor group based on common characteristics that allows a member of the group to view certain aspects of a portal. For example, if you create a portal that provides information about city council meeting in Los Angeles, you might want to define an entitlement group for that portlet that consists of visitors who live in Los Angeles county and are of voting age.
The Entitlements Service MBean specifies the JNDI name for the Rules Service, which it uses to evaluate whether a visitor belongs to a given entitlement group and to determine which resources the visitor can access.
<Entitlements
Name="wlcsApp"
RulesServiceJNDIName="BEA_personalization.RulesManager"
>
</Entitlements>
Commerce Pipeline
The following element declares an MBean for configuring a JDBC Pool. Commerce Pipeline Components use this JDBC pool to get sequence numbers for new orders (in CommitOrderPC) and when generating a transactionID for a payment transaction.
<CommercePipelineComponentSupport
JdbcPoolName="weblogic.jdbc.jts.commercePool"
/>
You must deploy this MBean if you use any Order-related Pipeline Components.
If you include this element, your CLASSPATH variable must specify commerce_system.jar. For more information, refer to Add Directories to CLASSPATH.
JDBC Helper Service
The JDBC Helper Service is the only means for services to explicitly establish a database connection. The process for getting a connection includes wait and retry functionality.
The service also provides Java classes (delegates) to coordinate the processing of CLOB data. Use the WebLogic Server Administration Console to specify the delegate class for your specific database type. For information on setting up the JDBC Helper for Oracle and SQL Server database types, refer to Part II, Deploying Your Business Data. For information on setting up the service for other database types that are supported for the current release, refer to PORTAL_HOME/db/readme.html.
<JdbcHelper Name="JdbcHelper"
JdbcHelperDelegate="@DATABASE_JDBC_HELPER@"
MaxRetries="-1"
MaxWaitTime="-1"
>
</JdbcHelper>
Tax and Payment Service Clients
The Tax Service client enables your WebLogic Portal application to contact a Web service that will calculate taxes for the orders on your site. WebLogic Portal provides a sample Web service application (taxWSApp). You must find a third party Web service to fulfill this function of your site. The following element in application-config.xml configures an MBean, which, in turn, you use to configure the Tax Service client.
You do not need to change this element in application-config.xml. Instead, use the WebLogic Server Administration Console to configure the Tax Service client. (Refer to Use the WebLogic Server Administration Console to Configure MBeans.)
<TaxServiceClient
Name="wlcsApp"
TaxCalculatorJNDIName="BEA_commerce.TaxCalculator"
TaxCalculatorWSDL= "http://localhost:7501/taxws/BEA_commerce.TaxWebService/wsdl.jsp"
Currency="USD"
ShipFromProvince="CO"
ShipFromCity="Boulder"
ShipFromPostalCode="80302"
ShipFromLocationCode="00"
ShipFromCountryCode="USA"
OrderOriginProvince="CO"
OrderOriginCity="Boulder"
OrderOriginPostalCode="80302"
OrderOriginLocationCode="00"
OrderOriginCountryCode="USA"
CompanyID="Company ID goes here"
BusinessLocationCode="Business Location code"
AVSReturnListOnZipFailure="false"
>
</TaxServiceClient>
The <TaxServiceClient> element specifies the JNDI name of the tax service (the Order and Payment service use this JNDI name to contact the Tax Service client), the location of your tax Web service application, and default values that WebLogic Portal provides as part of the tax calculation process. For more information on the Tax Service client, refer to "Taxation Services" in the Guide to Managing Purchases and Processing Orders.
The Payment Service client enables your WebLogic Portal application to contact a Web service that will confirm and complete credit card transactions for the orders on your site. WebLogic Portal provides a sample Web service application (paymentWSApp). You must find a third party Web service to fulfill this function of your site. The following element in application-config.xml configures an MBean, which, in turn, you use to configure the Payment Service client.
You do not need to change this element in application-config.xml. Instead, use the WebLogic Server Administration Console to configure the Payment Service client. (Refer to Use the WebLogic Server Administration Console to Configure MBeans.)
<PaymentServiceClient
Name="bankApp"
PaymentWebServiceWSDL=
"http://localhost:7501/paymentws/BEA_commerce.CreditCardWebService/wsdl.jsp"
DeferAuthorization="true"
PaymentModel="AUTO_MARK_AUTO_SETTLE"
>
</PaymentServiceClient>
The <PaymentServiceClient> element specifies the JNDI name of the payment service (the Order and Payment service use this JNDI name to contact the payment service) and an option to collect all credit card requests as a batch (DeferAuthorization="true"). For more information on the Payment Service, refer to "Payment Services" in the Guide to Managing Purchases and Processing Orders.
Use the WebLogic Server Administration Console to Configure MBeans
After you deploy your application, use only the WebLogic Server Administration Console to configure MBeans.
To configure MBeans, do the following:
http://hostname:port-number/console
For example, you started a server on a host named bonnie and it uses port 7001 as a listen-on port. Enter the following URL:
http://bonnie:7001/console
Figure 5-2 Configuring a Cache MBean
Add Your Web Application
Copy your Web application into the root directory of the enterprise application. In a development environment, we recommend that you deploy the Web application as an exploded directory tree. In this format, you can dynamically deploy additional or modified JSPs and other resources.
In a production environment, deploy the Web application as an archive file (WAR file).
In the application.xml deployment descriptor, use the following syntax to declare your Web application:
<module>
<web>
<web-uri>WAR-file or
root directory of a non-archived Web application
</web-uri>
<context-root>
name by which you want to access the Web application
</context-root>
</web>
</module>
Add Supporting Web Applications
Each WebLogic Portal uses supporting Web applications to manage the deployment and administration of application and business data. This section includes the following subsections:
Adding DataSync
The DataSync Web application makes data that the E-Business Control Center creates available to one or more enterprise applications. For more information, refer to How Application Data is Organized and Distributed.
To add the DataSync Web application, do the following:
<module>
<web>
<web-uri>datasync</web-uri>
<context-root>wlcsAppDataSync</context-root>
</web>
</module>
For example, for the Bank enterprise application, you specify <context-root>BankAppDataSync</context-root>. Then the following URL accesses the DataSync Web application within the Bank enterprise application: http://host-name:listen-port/BankAppDataSync
BAs use this address in the E-Business Control Center to synchronize their modifications with the BankApp application.
Adding DataSync in a Cluster
If you are assembling an enterprise application that you will use in a cluster, you must add two instances of the DataSync Web application to your enterprise application. One instance will be used by Managed Servers for configuring their own Master Data Repositories; the other instance will be used to synchronize data across the cluster.
Note: To reduce the risk associated with synchronizing application data and business policies across a live cluster, you can do the following to synchronize data:
To add two instances of the DataSync Web application, repeat the steps in the previous section, and provide a unique name for each DataSync Web application. For example, use the following names for the DataSync Web applications that you deploy in an enterprise application named Bank:
For information on configuring and deploying these applications in a cluster, refer to Deploy and Configure DataSync Web Applications for the Cluster.
Removing DataSync for Security
To prevent additions or modifications to the data that you have synchronized to your application, you can remove the DataSync Web application after you synchronize. For example:
For information about undeploying the DataSync Web application in a cluster, refer to Preventing Synchronization by Undeploying DataSync Web Applications.
Adding the WebLogic Portal Administration Tools and ToolSupport
Each enterprise application that you deploy must include the WebLogic Portal Administration Tools Web application, which maintains data in the RDBMS repository. For example, you use it to do the following:
In addition to the WebLogic Portal Administration Tools, you must also add the ToolSupport Web application.
To add the Web applications, do the following:
To modify the URI, do the following
<module>
<web>
<web-uri>tools</web-uri>
<context-root>tools</context-root>
</web>
</module>
<module>
<web>
<web-uri>toolSupport</web-uri>
<context-root>wlcsAppTool</context-root>
</web>
</module>
Adding Support for the E-Business Control Center
You can use the E-Business Control Center to browse some types of data that has been deployed to an application. To support this feature, you must deploy a set of helper Web applications:
Table 5-1 specifies the WAR-file and for each Web application.
For example, the following elements declare the catalogws-webservice.war:
<module>
<web>
<web-uri>catalogws-webservice.war</web-uri>
<context-root>wlcsAppCatalogTool</context-root>
</web>
</module>
Add JAR Files
The following sections describe the JARs that WebLogic Portal provides to support your Web application:
Determine which of these JARs you need based on the product you use. Then copy them to the root directory of your enterprise application.
If you created EJBs to extend functionality, copy the JAR that contains them to the root directory of your enterprise application as well.
JARs for Personalization Services
If you use personalization services, do the following:
Table 5-2 indicates ServiceName for each EJB.
JARs for Campaign Services
If you use campaign services, do the following:
JARs for Commerce Services
If you use commerce services, do the following:
commerce_util.jar. This JAR provides miscellaneous utilities for commerce services.
JARs for Campaign and Commerce Interaction
If you use campaigns and commerce services together, copy PORTAL_HOME/lib/commerce_campaign_bridge/ejb/ commerce_campaign_bridge_util.jar
to the root directory of your enterprise application.
This JAR provides the campaign service with access to discounts and the shopping cart.
JARs for Portal Services
If you use portal services, do the following:
Create an EAR File (Optional)
In a production environment, we recommend that you archive your enterprise application into an Enterprise Archive (EAR) file and deploy the EAR file.
Before you create an EAR file, do the following:
Use the Java jar command to archive your enterprise application. For more information, open a command shell and enter the jar command with no arguments. With this syntax, the JDK displays help for the command.
Deploy the Application
Use the WebLogic Server Administration Console to complete the following deployment tasks:
Installing an application via the WebLogic Server Administration Console also creates entries for that application in the domain's configuration file (/config/domain_name/config.xml). The domain's Administration Server also generates JMX Management Beans (MBeans) that enable configuration and monitoring of the application and application components.
Deploy an Application in the Exploded Directory Format
In a development environment, we recommend that you deploy your enterprise application and Web application in the exploded directory format. To do so, complete these steps:
Figure 5-3 Configure a New Application
Deploy an Application in the EAR File Format
To facilitate management of your resources in a production environment, we recommend that you deploy your enterprise application as an enterprise application archive (EAR). You cannot add or modify JSPs that are within an archived application. You can, however, use the E-Business Control Center to synchronize application data, use the WebLogic Portal Administration Tools to modify business data, and use the WebLogic Server Administration Console to modify MBean configurations for archived applications.
To archive and deploy an enterprise application, complete the following steps:
For troubleshooting purposes, after your archive your Web applications, you can deploy your enterprise application as an exploded directory that contains only JAR and WAR files. If you can access your WAR files, then you can move on to the following step.
Deploy Multiple Instances of an Application
In a development environment, we recommend that you deploy one instance of your enterprise application for each installation of the E-Business Control Center. Providing multiple application instances prevents Business Engineers who are using the E-Business Control Center from overwriting each other's work.
To deploy multiple copies of an application on a single server, do the following:
<module>
<web>
<web-uri>datasync</web-uri>
<context-root>datasync</context-root>
</web>
</module>
Note: The WebLogic Server Administration Console lists each instance of the Web applications and EJBs with the same name. The server successfully deploys the modules under different JNDI names. If you want to determine the enterprise application within which a particular module resides, click the module in the left pane of the WebLogic Server Administration Console. The right pane displays the pathname to the module.
Configure the JDBC Helper Service
The JDBC Helper Service is the only means for services to explicitly establish a database connection. The JDBC Helper Service enables services to explicitly establish a database connection and to coordinate the processing of CLOB data. To configure the JDBC Helper service for a Cloudscape RDBMS, do the following:
Note: For information on configuring a JDBC Helper Service for other database types, refer to Part II, Deploying Your Business Data. For Sybase, DB2, and SQL Server 7, the details for setting the JDBC Helper Service are documented in step 2.4 of the section "Update Settings for the JDBC Helper Service" in the <PORTAL_HOME>/db/readme.html file. No Delegate Class Name is required for Cloudscape databases.
![]() |
![]() |
![]() |
|
Copyright © 2001 BEA Systems, Inc. All rights reserved.
|