Click OK to exit the Edit WAR Deployment Profile Properties dialog. In the New Gallery, expand General, select Deployment Profiles and then MAR

Deploying an ADF Java EE Application 8-11

2. In the New Gallery, expand General, select Deployment Profiles and then WAR

File , and click OK. If you don’t see Deployment Profiles in the Categories tree, click the All Technologies tab. 3. In the Create Deployment Profile -- WAR File dialog, enter a name for the project deployment profile and click OK. 4. In the Edit WAR Deployment Profile Properties dialog, choose items in the left pane to open dialog pages in the right pane. Configure the profile by setting property values in the pages of the dialog. ■ If you have customization classes in your application, they must be loaded from the EAR-level application class loader and not from the WAR. You will later add these customization classes to the EAR. By default, customization classes are added to the model projects WAR class path. So for each WAR, you must exclude the customization classes. If you created your customization classes in an extension project of the application, be sure to deselect any customization class archive on the Library Dependencies page of the WAR deployment profile for each view controller project. If you created your customization classes in the model project of the application, deselect any customization classes on the File Groups WEB-INFclasses Filters page of the WAR deployment profile for each view controller project. If you are using a customization.properties file, it should also be deselected. ■ You might also want to change the Java EE web context root setting choose General in the left pane. By default, when Use Project’s Java EE Web Context Root is selected, the associated value is set to the project name, for example, Application1-Project1-context-root . You need to change this if you want users to use a different name to access the application. If you are using custom JAAS LoginModule for authentication with JAZN, the context root name also defines the application name that is used to look up the JAAS LoginModule.

5. Click OK to exit the Edit WAR Deployment Profile Properties dialog.

6. Click OK again to exit the Project Properties dialog.

7. Repeat Steps 1 through 7 for all web projects that you want to deploy.

8.3.2.3 Creating a MAR Deployment Profile

If you have seeded customizations or base metadata that you want to place in the MDS repository, you need to create a MAR deployment profile. The namespace configuration under mds-config for MAR content in the adf-config.xml file is generated based on your selections in the MAR Deployment Profile Properties dialog. Although uncommon, an enterprise application packaged in an EAR can contain multiple web application projects packaged in multiple WARs, but the metadata for all these web applications will be packaged into a single metadata archive MAR. The metadata contributed by each of these individual web applications can be global available for all the web applications or local to that particular web application. 8-12 Java EE Developers Guide for Oracle Application Development Framework To avoid name conflicts for metadata with global scope, make sure that all metadata objects and elements have unique names across all the web application projects that form part of the enterprise application. To avoid name conflicts and to ensure that the metadata for a particular web application remains local to that application, you can define a web-app-root for that web application project. The web-app-root is an element in the adf-settings.xml file for a web application project. The adf-settings.xml file should be kept in the META-INF directory under the public_html directory for the web project. Example 8–1 shows the contents of a sample adf-settings.xml file. Example 8–1 web-app-root Element in the adf-settings.xml File ?xml version=1.0 encoding=UTF-8 ? adf-settings xmlns=http:xmlns.oracle.comadfsettings xmlns:wap=http:xmlns.oracle.comadfsharehttpconfig wap:adf-web-config xmlns=http:xmlns.oracle.comadfsharehttpconfig web-app-root rootName=order wap:adf-web-config adf-settings In this example, the adf-settings.xml file has a web-app-root element that defines rootName as order. If your enterprise application has only one web application project, there is no need to define a web-app-root element. If your enterprise application has multiple web application projects, you should supply a web-app-root for all the web applications except one, without which the deployment will fail. For example, if you have web-application1 , web-application2, and web-application3, two of these web application projects must define a web-app-root to preclude any name conflicts. JDeveloper creates an auto-generated MAR when the Enable User Customizations and Across Sessions using MDS options are selected in the ADF View page of the Project Properties dialog or when you explicitly specify the deployment target directory in the adf-config.xml file. By default, only the customizations in ADF view and ADF Model are included in the MAR. If the Java EE application has customizations in other directories, you must create a custom MAR profile that includes those directories. Before you begin: Create an MDS repository for your customization requirements to deploy metadata using the MAR deployment profile. To create a MAR deployment profile: 1. In the Application Navigator, right-click the application and choose New. You will create a MAR profile if you want to include customizations.

2. In the New Gallery, expand General, select Deployment Profiles and then MAR

File, and click OK. If you don’t see Deployment Profiles in the Categories tree, click the All Technologies tab. 3. In the Create Deployment Profile -- MAR File dialog, enter a name for the MAR deployment profile and click OK. Deploying an ADF Java EE Application 8-13 4. In the Edit MAR Deployment Profile Properties dialog, choose items in the left pane to open dialog pages in the right pane. Figure 8–2 shows a sample User Metadata directory tree. Figure 8–2 Selecting Items for the MAR Deployment Profiles Note the following important points: ■ To include all customizations, you need only create a file group with the desired directories. ■ To include files from other than ADF Model and ADF view, create a new file group under User Metadata with the desired directories and explicitly select the required content in the Directories page. ■ ADF Model and ADF view directories are added by default. No further action is required to package the ADF Model and ADF view customizations into the MAR. ADF view content is added to HTML Root dir, while ADF Model content is added to User Metadata. If your application has other customization directories, such as from an EJB project, you must add those directories. ■ To include the base metadata in the MDS repository, you need to explicitly select these directories in the dialog. When you select the base document to be included in the MAR, you also select specific packages. When you select one package, all the documents including subpackages under that package will be used. When you select a package, you cannot deselect individual items under that package. 8-14 Java EE Developers Guide for Oracle Application Development Framework ■ If a dependent ADF library JAR for the project contains seeded customizations, they will automatically be added to the MAR during MAR packaging. They will not appear in the MAR profile. ■ If ADF Library customizations were created in the context of the consuming project, those customizations would appear in the MAR profile dialog by default.

5. Click OK to exit the Edit MAR Deployment Profile Properties dialog.