39 Working Productively in Teams

This chapter contains information about managing files in Oracle JDeveloper. It includes information about source control systems, namely CVS and Subversion.

This chapter includes the following sections:

39.1 Enabling Source Control on WebCenter Applications

You can use CVS or Subversion for source control in a WebCenter application, similar to the way you would use a source control system in any other development environment.

There are two ways to use CVS or Subversion: In Oracle JDeveloper, either click the Versioning menu or use the Versioning Navigator (click View - Versioning Navigator). The Versioning Navigator is shown in Figure 39-1.

Figure 39-1 Versioning Navigator

Description of Figure 39-1 follows
Description of "Figure 39-1 Versioning Navigator"

This section contains the following subsections:

For detailed information about CVS and Subversion, see the Oracle JDeveloper online help system and the "Using a Source Control System" section in the Oracle Application Development Framework Developer's Guide.

39.1.1 Importing Application Files into CVS

If you do not have your application files source controlled in CVS, then you must import them into CVS before you can get started.

To import application files into CVS:

  1. In Oracle JDeveloper, from the Versioning menu, select CVS and then Check Out Module.

    If you have a CVS connection, then you are taken directly to step 2. If you do not have a CVS connection, then you are prompted to create a connection, as follows:

    Note:

    An alternative way to create a CVS connection is to right-click CVS in the Versioning Navigator and select New CVS Connection. Any existing CVS connection is shown in the Versioning Navigator.
    1. If the Confirm Create Connection dialog appears, then click OK (Figure 39-2).

      Figure 39-2 Confirm Create Connection Dialog

      Description of Figure 39-2 follows
      Description of "Figure 39-2 Confirm Create Connection Dialog"

    2. In the Create CVS Connection wizard, on the Connection page, enter your connection information for CVS, then click Next (Figure 39-3).

      Figure 39-3 Create CVS Connection - Connection

      Description of Figure 39-3 follows
      Description of "Figure 39-3 Create CVS Connection - Connection"

    3. On the Root page (Figure 39-4), in the Value of CVSROOT field, enter a value for the CVSROOT. Click Next.

      Figure 39-4 Create CVS Connection - Root

      Description of Figure 39-4 follows
      Description of "Figure 39-4 Create CVS Connection - Root"

    4. On the Test page (Figure 39-5), click Test Connection. The Log In to CVS dialog displays, as shown in Figure 39-6.

      Figure 39-5 Create CVS Connection - Test Connection

      Description of Figure 39-5 follows
      Description of "Figure 39-5 Create CVS Connection - Test Connection"

      Figure 39-6 Log In to CVS Dialog

      Description of Figure 39-6 follows
      Description of "Figure 39-6 Log In to CVS Dialog"

    5. Enter your password, and then click OK.

    6. If the test is successful, then you should see something similar to Figure 39-7. Click Next.

      Figure 39-7 Create CVS Connection - Test Connection Success

      Description of Figure 39-7 follows
      Description of "Figure 39-7 Create CVS Connection - Test Connection Success"

    7. On the Name page, enter a value for Connection Name, as shown in Figure 39-8. Click Next.

      Figure 39-8 Create CVS Connection - Name

      Description of Figure 39-8 follows
      Description of "Figure 39-8 Create CVS Connection - Name"

    8. The Summary page displays with the connection information. Click Finish (Figure 39-9).

      Figure 39-9 Create CVS Connection - Summary

      Description of Figure 39-9 follows
      Description of "Figure 39-9 Create CVS Connection - Summary"

  2. On the Check Out from CVS page, enter the application path.

  3. Click OK to execute the import operation. You can see the connection now in the Application Navigator, as shown in Figure 39-10.

    Figure 39-10 Application Navigator with CVS Connection

    Description of Figure 39-10 follows
    Description of "Figure 39-10 Application Navigator with CVS Connection"

39.1.2 Creating a Subversion Repository

To create a Subversion repository:

  1. From the Versioning menu, choose Subversion, and then Create Repository. The Create Subversion Repository dialog displays (Figure 39-11).

    Figure 39-11 Create Subversion Repository

    Description of Figure 39-11 follows
    Description of "Figure 39-11 Create Subversion Repository"

  2. In the Create Subversion Connection dialog, enter connection details, and then click OK. (Figure 39-12)

    Note:

    An alternative way to create a connection is to right-click Subversion in the Versioning Navigator and select New Repository Connection.

    Figure 39-12 Create Subversion Connection

    Description of Figure 39-12 follows
    Description of "Figure 39-12 Create Subversion Connection"

  3. Later you can edit these pages on the Edit Subversion Connection page (Figure 39-13).

    Figure 39-13 Edit Subversion Connection

    Description of Figure 39-13 follows
    Description of "Figure 39-13 Edit Subversion Connection"

39.2 Understanding WebCenter Application Files Affected by Developers

An important aspect of working with any source control system is understanding which files are affected by any particular action. Without this knowledge, you may inadvertently corrupt the source by checking in or checking out either too few or too many files given the actions you are performing on the project. This section helps you understand what files are needed for the main actions you may perform while building a custom WebCenter application.

This section contains the following subsections:

39.2.1 Files Associated With Common Objects

The main objects with which you work in a WebCenter application are as follows:

  • Pages

  • Portlets

  • Services

  • Data controls

Each of these are fairly complex objects, made up of several different metadata files.

For information about page metadata files, see the "Introduction to the ADF Metadata Files" section in the Oracle Fusion Middleware Fusion Developer's Guide for Oracle Application Development Framework. For information about portlet and producer metadata files, see Appendix A, "Files for WebCenter Applications."

39.2.2 Developer Actions Affecting Metadata Files

Table 39-1 lists developer actions and the files that are affected by these actions. Take this information into account while managing your files in CVS or Subversion.

Table 39-1 Developer Actions Affecting Metadata Files

Action Files Affected

Creating or editing the following connection:

  • BPEL

  • Content Repository; for example, Oracle Content Server, Oracle Portal, file system

  • Database

  • Discussions

  • External Application

  • Instant Messaging and Presence

  • Mail

  • Oracle Secure Enterprise Search

  • Oracle PDK-Java Producer

  • WSRP Producer

Adds or updates:

  • app-root/.adf/META-INF/connections.xml with the connection

  • app-root/projectname/projectname.jpr with connection libraries

  • app-root/.adf/META-INF/adf-config.xml with service-level configuration, including the default connection

An external application connection, and all connections that require an external application connection (including Mail, Content Repository, and Instant Messaging and Presence) also add or update the following files:

  • app-root/src/META-INF/jps-config.xml with the credential store provider

  • app-root/src/META-INF/cwallet.sso with the user name and password

Note: All secure data specified for connections is stored in cwallet.sso, referenced in jps-config.xml. For example, the password for a database connection is stored in cwallet.sso.

Creating a content repository data control

Adds or updates following data control files under app-root/projectname/adfmsrc:

  • projectpackage/DataControls.dcx with the data control definition

  • projectpackage/dcname.xml with the data control structure

  • projectpackage/dcname/*.xml with data structure definitions used by the data control

  • app-root/projectname/adfmsrc/META-INF/adfm.xml with a pointer to the DCX file

  • app-root/projectname/adfmsrc/return.xml with the definition for default operations used on collections

Updates app-root/projectname/projectname.jpr with content repository libraries

Registering an Oracle PDK-Java or WSRP portlet producer

Adds or updates app-root/src/META-INF/jps-config.xml with the credential store provider

Adds:

  • Tag library

  • app-root/mds/producer.pxml (pertaining to the registered producer)

  • A number of files pertaining to the registered producer to app-root/mds/directory: producer

Adds or updates app-root/projectname/adfmsrc/projectpackagename/DataBindings.cpx with factory classes to data bindings

Updates:

  • app-root/.adf/META-INF/connections.xml with a connection to the producer and the URL connection associated with it

  • app-root/.adf/META-INF/adf-config.xml with configuration for the metadata repository and the credential store

  • app-root/projectname/src/META-INF/orion-application.xml with the WebCenter shared libraries

  • app-root/projectname/projectname.jpr with the libraries needed for any WebCenter application including external application libraries

  • app-root/projectname/public_html/WEB-INF/web.xml with the portlet servlets and filters and also external application automated login entries

Copies the keystore file to app-root/.adf/META-INF if the producer is WSRP and supports WS-Security

De-registering an Oracle PDK-Java or WSRP portlet producer

Updates app-root/.adf/META-INF/connections.xml to remove the producer and URL connection

Removes producer-related files from app-root/mds/

Note: Although the producer is removed from the application, you may need to manually remove the metadata files, portlet view tag, and portlet bindings from the application. Everything else should be left alone in case other producers rely on app-root/projectname/public_html/WEB-INF/web.xml or app-root/.adf/META-INF/adf-config.xml. The metadata files are removed by the deregister operation; however, any customizations on the producer side might need to be manually removed if the producer was not available during deregistration.

Adding or removing a portlet from a page

Adding or removing a portlet on a page from a portlet producer connection in the Resource Palette

When adding a portlet from a portlet producer in the Resource Palette, WebCenter first registers the producer with the application (if it is not registered already). See the "De-registering an Oracle PDK-Java or WSRP portlet producer" row for files affected. It then adds or removes the portlet from the page, affecting the files described in this row.

Adds or updates:

  • app-root/projectname/adfmsrc/projectpackagename/DataBindings.cpx with a new PageDef mapping (if it does not exist already)

  • app-root/projectname/public_html/WEB-INF/faces-config.xml (This happens whenever you add an Oracle ADF component, such as a portlet, to a page.)

  • adf-faces-config.xml (This happens whenever you add an Oracle ADF component to a page.)

  • app-root/projectname/public_html/WEB-INF/oracle-webservices.xml if the portlet is WSRP

Adds:

  • A number of files pertaining to the newly cloned portlet instance to app-root/mds/

  • A number of WSDL and XML files to app-root/projectname/public_html/WEB-INF/wsdl if the portlet is WSRP

Updates:

  • app-root/projectname/public_html/pagename.jspx with the <adfp:portlet> tag (JSF faces tags are replaced with Oracle ADF faces tags.)

  • app-root/projectname/adfmsrc/projectpackagename/pageDefs/pagenamePageDef.xml with the region binding and page variable definitions

  • app-root/projectname/public_html/WEB-INF/web.xml with secure-ref entries if the portlet is WSRP

Adding a task flow for the following service:

  • Announcements

  • Discussions

  • Documents

  • Links

  • Mail

  • Page

  • People Connections

  • Recent Activities

  • RSS Viewer

  • Search

  • Tags

  • Worklist

  • External Application

Dragging a file or folder from a content repository connection to a page

Dragging a content repository data control on a page

Updates:

  • app-root/projectname/public_html/pagename.jspx with appropriate ADF faces tags

  • app-root/projectname/adfmsrc/projectpackagename/pageDefs/pagenamePageDef.xml with the region binding

  • app-root/projectname/adfmsrc/projectpackagename/DataBindings.cpx with a listing of the page definitions

  • app-root/projectname/adfmsrc/META-INF/adfm.xml with a pointer to the data bindings file

  • app-root/.adf/META-INF/adf-config.xml with MDS configuration entries

  • app-root/projectname/projectname.jpr with service libraries, dependent libraries, and JSP tag libraries

  • app-root/projectname/public_html/WEB-INF/web.xml with ADF library, external application, and MDS configuration entries

Adds or updates all connection-related files for any service that requires connections

Copies over any required connection that was not present in the application, which updates app-root/.adf/META-INF/connections.xml and app-root/projectname/projectname.jpr

Note: The Recent Activities, Search, and Tags services add the search extension to adf-config.xml and create the sample service-definition.xml file. The service-definition.xml file lets developers define QueryManager implementations for their service.

Adding the following component or service on a page:

  • Customizable Components

  • Instant Messaging and Presence

  • Links

  • Tags

  • Oracle Composer

Updates:

  • app-root/.adf/META-INF/adf-config.xml with MDS configuration entries and resource catalog service

  • app-root/projectname/adfmsrc/projectpackagename/pageDefs/pagenamePageDef.xml with the region binding

  • app-root/projectname/adfmsrc/META-INF/adfm.xml with a pointer to the data bindings file

  • app-root/projectname/adfmsrc/projectpackagename/DataBindings.cpx with the task flow binding definition factory and pageDef entries

  • app-root/projectname/public_html/pagename.jspx with appropriate ADF faces tags

  • app-root/projectname/public_html/WEB-INF/faces-config.xml with the ADF Controller Phase Listener

  • app-root/projectname/public_html/WEB-INF/web.xml with ADF library, external application, and MDS configuration entries

  • app-root/projectname/projectname.jpr with service libraries and dependent libraries

Note: The projectname.jpr and web.xml files are updated if the service is dependent on an external application.

Note: The Tags service has a design time dependency on the Search service, so it also adds Search service libraries.

Creating a JSR 168 portlet application or adding a portlet to an existing application that uses JSP file

Adds or updates:

  • app-root/projectname/public_html/WEB-INF/portlet.xml

  • app-root/projectname/public_html/WEB-INF/oracle-portlet.xml

  • app-root/projectname/public_html/WEB-INF/web.xml

Adds Java and JSP source files for the portlet

Creating a JSR 168 portlet application or adding a portlet to an existing application that uses the ADF/JSPX option

A portlet application generated with this option uses the Oracle Portlet Bridge to access a Faces application.

Adds or updates:

  • app-root/projectname/public_html/WEB-INF/portlet.xml with configuration information for the portlet bridge

  • app-root/projectname/public_html/WEB-INF/oracle-portlet.xml with configuration information for the portlet bridge

  • app-root/projectname/public_html/WEB-INF/web.xml with configuration information for a Faces servlet

  • app-root/src/META-INF/orion-application.xml with shared library import statements for adf.oracle.domain and oracle.webcenter.skin

Adds:

  • Java and JSPX source files for the portlet

  • app-root/projectname/public_html/WEB-INF/faces-config.xml

Creating a PDK portlet producer application

Adds or updates:

  • app-root/projectname/public_html/WEB-INF/web.xml with producer servlet definitions and producer deployment details

  • service_id.properties with producer configuration attributes

  • app-root/src/META-INF/orion-application.xml with shared library import statements for oracle.portal

Adds Java and JSP files for the portlet

Registering a secure WSRP producer (WS-Security)

Updates app-root/.adf/META-INF/connections.xml with the secure producer connection definition

Notes: The connections.xml entry for a secure producer looks different in terms of how the security policy is stored. Instead of the whole security policy description, the security policy is just a URI (that is, a "pointer" to the policy in the policy repository).

The secure ref attributes in connections.xml are stored in the credential store (as defined by app-root/src/META-INF/jps-config.xml). The credential store configuration information (as defined by jps-config.xml) is stored in app-root/.adf/META-INF/adf-config.xml. At design time, the credential store is stored in an Oracle Wallet by default; that is, META-INF/cwallet.sso.

Configuring ADF Security for a project

Adds or updates:

  • app-root/projectname/public_html/WEB-INF/web.xml with login configuration, ADF authentication servlet, security constraints, logical roles and mappings

  • app-root/src/META-INF/jps-config.xml with identity store, credential store, policy store, anonymous provider, and login modules

  • app-root/.adf/META-INF/adf-config.xml with ADF identity store and credential store configuration

  • app-root/src/META-INF/jazn-data.xml with an XML identity store

  • app-root/src/META-INF/jazn-data.xml with application permissions


39.3 Implementing Common Requirements One Time

It is good practice for the project administrator to implement any common developer requirements one time and then check in that version for all to use. By planning ahead and having the administrator take care of these common requirements up front, you can reduce redundancy and error.

For example, suppose two developers need to add OmniPortlet on different pages of an application. If the project administrator has registered the OmniPortlet producer, then it is available for both of them to use. If not, then each developer likely registers the OmniPortlet producer separately, leading to unnecessary duplication and confusion.

Another example: suppose many developers need content from the same content repository. One person should set up and check in the needed connection first. Other developers then can simply reuse the same data control.

39.4 Portlet Producer Considerations

When working in a team environment, bear in mind the following considerations pertaining to portlet producers:

39.4.1 Portlet Producer Connections

When building an EAR file for your project, connections are loaded for the entire application rather than individual projects. For example, suppose you have an application with two projects: P1 and P2. P1 has 100 registered producers and P2 has no producers. When you build an EAR file for either project, all 100 of P1's producer connections are loaded into connections.xml. Note, though, that you can also edit connections.xml manually.

When you run the predeployment tool to create a targeted EAR file, all of the connections in connections.xml must be accessible. Hence, in our example, the generation of a targeted EAR file for either project would fail if any of the 100 portlet producer connections for P1 are unavailable for some reason. Given this behavior, you must carefully consider how you plan to subdivide your overall development effort into applications and projects.

39.4.2 Portlet Producer Name Clashes

While Oracle WebCenter Framework lets you register two portlet producers under the same name, it generally is better to avoid this situation. For example, if two developers working on the same application inadvertently register a portlet producer with the same name, then usually it is best to change one of the names to be unique. If you have two portlet producers registered under the same name, then it becomes very difficult to distinguish between them when debugging errors or performing administrative tasks on the portlet producers.

39.4.3 Combining Portlets from Different Portlet Producers

In some cases, you might have multiple developers building portlets and ultimately you want those portlets to be combined under a single portlet producer. The developers must be conscious of some potential issues.

  • Portlet names and JSP paths could clash. Portlet developers should use prearranged class package names and JSP paths to avoid naming clashes when portlets are combined within one portlet producer in one application.

  • When you create a JPS portlet in the Portlet wizard, the directory for the portlet modes defaults to portletn\html\mode_name, where n is a number that increments for each portlet you create. To avoid directory and file name clashes, portlet developers should change the directory name on the Content Type and Portlet Modes page of the Portlet wizard. Select the portlet mode and then change the directory name in the corresponding field to something unique.

  • When you combine portlets into one portlet producer, you must manually merge the portlet descriptor files, avoiding identifier clashes as you do so as follows:

    • JPS portlet identifiers in the portlet.xml and oracle-portlet.xml files are generated automatically starting from portlet1. When you manually merge multiple portlet descriptor files into one, you must change any portlet identifiers that clash with one another.

    • Similarly, the PDK-Java portlet identifiers in provider.xml are automatically generated starting from 1. When you manually merge multiple provider.xml files, you must change any portlet identifiers that clash with one another.

  • You must manually merge any web descriptor (web.xml) changes; for example, security role information.

  • For PDK-Java portlets, you also might need to manually merge .properties files.

  • When using many different portlets, parts of files might not be checked in properly because they are overwritten by someone else or because JDeveloper does not pick up the changed files correctly. For example, you might deploy an application with many types of portlets and see the following error in two of the three OmniPortlets:

    mdsId
    oracle/adf/portlet/OmniPortlet_1172537210873/ap/Portlet100_0b4156e9_0111_1000_
    8001_82235f273a39.pxml not found
     
    mdsId
    oracle/adf/portlet/OmniPortlet_1172537210873/ap/Portlet100_250498fc_0111_1000_
    8002_a9fe7286a54e.pxml not found
    

    If you receive error messages like these, then ensure that all *.pxml files from the development environment are copied over to the deployed environment.

  • Your portlet customizations might not appear in your deployed environment. Make sure that the content of the oracle\adf\portlet\<portletInstanceName>.pxml file is correct and that it refers to the proper *.pxml files.