# Integrating with Source Control Systems

WebLogic Workshop integrates directly with the following source control systems: CVS, Perforce, and IBM Rational ClearCase. Once you have added the files in your WebLogic Workshop application to a respository managed by one of these source control products, you can check files in and out using commands available in WebLogic Workshop.

## Enabling Source Control Integration in WebLogic Workshop

If you are part of a team development project and the application you are working on is already in a source control repository, you can simply point at that repository from WebLogic Workshop to enable source control integration from within the IDE. After you enable source control integration, the source control module's commands are available to you in WebLogic Workshop. For example, when you right-click on a file you will see a menu item for the name of the source control module (CVS, Perforce, or ClearCase), and beneath that menu item, the commands available for working with the file.

For more information on enabling source control integration with one of these source control systems, see Source Control Integration with CVS, Source Control Integration with Perforce, or Source Control Integration with ClearCase.

To Configure WebLogic Workshop for Source Control Integration

1. Configure your source control system as advised by your system administrator. In most cases you will need at least a client configuration that specifies how your computer interfaces with the source control system.
2. From the Tools menu, select Application Properties.
3. Click the Source Control tab.
4. From the Source control module drop-down, select Perforce, CVS, or ClearCase.
5. Set the properties for the source control module to map to the configuration on your computer.

If you want to enable source control integration only for a project within your application, or if you have different projects within different source control repositories, you can specify source control settings at the project level. From the Tools menu, choose Project Properties--><projectname>, click the Source Control tab, and clear the Use application's source control settings option.

## Using Source Control Commands from WebLogic Workshop

Once you've configured Workshop for source control integration, you can perform commands against individual files in your application or project. There are two ways to execute source control commands:

- Right-click the file and choose the name of the source control system you're using -- CVS, Perforce, or ClearCase. The commands available for that file are listed on the submenu.
- Open the file in WebLogic Workshop. From the Tools menu, choose your source control system; the available commands are listed on the submenu.

## Which Files Should You Add to Source Control?

There are a lot of files in a WebLogic Workshop application, and not all of them need to be checked in. The files which should be checked in are those that are not modified by the build process. These files include source files and some other files that are created with the project but never modified. The project can be built while any of these are read-only (for source control systems that govern read/write access), so that you only have to check out the files that you wish to modify.

The files to add to source control are:

- The .work file that represents the application. It appears at the root of the application directory.
- All source files that you have added or modified -- JWS, JCX, JSX, JSP, and so on.
- Any XML schema files that you have added to the Schemas project.
- The files in the Resources folder in a web project.
- Any JAR files that you have added to the Modules folder. These files are stored at the root of your application in the file system.
- Any JAR files that you have added to the Libraries folder. These files are stored in the APP-INF/lib folder in the file system.
- The following files in the WEB-INF folder in a web project: web.xml, weblogic.xml, wlw-config.xml.
- The global.app file in the WEB-INF/src/global folder.
- The tag libraries that appear in the WEB-INF folder in a web project, if you have page flows and JSP files in your project. These files end with the .tld and .tldx extensions.
- The JAR files that appear in the WEB-INF/lib folder in a web project.

The files that are modified by the build process -- compiled classes, for example -- do not need to be added to source control. You can add them, but you'll have to check all of them out each time you build your application. And since many of them are binary files and can't be modified directly, you don't gain anything by keeping them under source control; if you're developing your application as part of a team, putting these files under source control is likely to generate confusion for team members.

The files that you do not need to add to source control are:

- Files in the .workshop directory beneath the base application directory
- Files in the META-INF directory
- Files in the WEB-INF/.pageflow-struts-generated directory in a web application project
- Files in the WEB-INF/classes directory in a web application project
- Files in the WEB-INF/lib directory in a web application project
- JAR files that are generated from a project in your application

## Modifying the .work File Under Source Control

There is currently no way to check out the .work file manually from within WebLogic Workshop in the same way that you can check out other files in your application. However, if the .work file is read-only, and you make a change that requires modifying the .work file, WebLogic Workshop will prompt you to check it out.

Changes to your application which modify the .work file include:

- Adding, importing, or deleting a project
- Changing settings in the Application Properties dialog.
- Changing settings in the Project Properties dialog.

Note: You should be careful about checking in the modified .work file when you are working in a team development environment. When you save the file, WebLogic Workshop may change the server.path variable within the file from a relative path to an absolute path to the server directory on your computer. Since it's unlikely that other users have the exact same absolute path on their computers, the application may not function properly after they sync to your change. Unless you specifically want to check in a change to the .work file, you generally want to revert your changes rather than checking them in. A good way to know is to perform a diff operation between the file that's in the source control repository and the modified file on your local computer. If you do want to check in changes to the .work file, you may need to edit the .work file manually using a text editor to change the server.path variable back to a relative path value.

## Related Topics

Source Control Integration with ClearCase

Source Control Integration with CVS

Source Control Integration with Perforce

WebLogic Portal Team Development Guide