|
|
Creating an Oracle SCM Workarea and JDeveloper Workspace
by Jeff Hunter, Sr. Database Administrator
Introduction
The following example demonstrates the steps necessary to use JDeveloper and Oracle SCM in a multiple developer environment. In this example, we will create an initial filesystem setup with an Oracle SCM Workarea and a JDeveloper Workspace. The initial upload to the Oracle SCM repository will be performed by the REPOS_MANAGER (the Repository owner). We then make this a Shared Workarea by granting the appropriate privileges out to PUBLIC or to individual repository users.Create an Oracle9i SCM Connection for the Repository OwnerWe generally create a separate (private) Oracle SCM Workarea for every JDeveloper Workspace. Meaning, every JDeveloper Workspace will have a dedicated Oracle SCM Workarea. The new/initial JDeveloper Workspace will be attached to the initial Shared Workarea to enable cooperative development. When a developer needs to work on a JDeveloper application (Workspace) they will only be required to download/check-out a single Workarea.
The example will assume the following setup:
- Oracle SCM Client, server installation and JDeveloper are already installed and configured.
- JDeveloper already has Source Control enabled with Oracle SCM.
- All code will initially be owned by REPOS_MANAGER. This user is also considered the Repository Owner. The REPOS_MANAGER will grant access to each Workarea either to the PUBLIC role or to individual repository users thus making the Workarea shared.
- Two developers (also known as subordinate users) named JEFFREYH and MHUNTER will be used to simulate programmers working on an application registered in Oracle SCM as a Shared Workarea.
- A Workarea is created for each application. For the purpose of this example, and since we are using JDeveloper, and application will be considered a JDeveloper Workspace. (i.e. There will be an Oracle SCM Workarea for each JDeveloper Workspace!
- We will be creating an Oracle SCM Workarea and JDeveloper Workspace for the Testing Code Repository application. The names and directories for this example are noted below:
Initial (Shared) Oracle SCM Workarea NameTestingWAInitial (Shared) Oracle SCM Workarea DirectoryC:\export\home\jeffreyh\Initial_Workareas\TestingWAJDeveloper Workspace NameTestingWSJDeveloper Workspace DirectoryC:\export\home\jeffreyh\Initial_Workareas\TestingWA\TestingWS
Before creating the initial Oracle SCM Workarea, you will need to create an Oracle9i SCM Connection. In this example, we will create a connection as the Repository Owner REPOS_MANAGER for the purpose of creating the initial shared Workarea. We typically use the repository owner (REPOS_MANAGER) as the owner for ALL Workareas (applications). All Workareas will be made available to other developers in a sharable mode by granting to other Oracle SCM users or simply to the PUBLIC role so others can use it as a shared Workarea. The connection should have the following attributes:Creating Initial (Shared) SCM WorkareaConnection Name: CUSTDB_JEFFREYH1_REPOSMANAGER User Name: REPOS_MANAGER Password: manager
NOTE!!!!!!!: If this is not the first Oracle SCM Workarea to be created, there is a bug (at least that's what I'm calling it, while Oracle says it is inevitable by the nature of the SCM) that will associate (create a reference for) any of the other shared Workspaces for all shared Workareas for the user. (In this case the REPOS_MANAGER user.) After creating the new initial Workarea, it will try to associate and download other folders (Workspaces) in all shared Workareas. Simply let the process download. Delete the unwanted folder from the filesystem and open the Repository Object Navigator application (RON). Navigate to the newly created Workarea and right click on the unwanted folder. Select the option "Exclude from Workarea...". You should now continue, as the REPOS_MANAGER user, in creating the new Workspace for this dedicated Workarea.Create the JDeveloper Application (Workspace)Here is a quote from Oracle on the subject of downloaded all Workspaces within all shared Workareas:
"After doing some more research on the problem you are noticing, we found out that the issue is inevitable by the nature of the SCM. Since each Workarea was created by the same user account REPOS_MANAGER, all versioned stuff (containers, objects) would be visible in each created Workarea by the default Workarea rule. Private is the terms used to other users, not to the owner of the Workareas. To selectively see the objects in the Workareas, their rules must be modified as the you have done."We will place the initial Oracle SCM Workarea in the directory (below) and upload the initial code to the repository from this location.
C:\export\home\jeffreyh\Initial_Workareas\TestingWAAfter creating the Oracle9i SCM Connection for REPOS_MANAGER, sign in and create a new Workarea by right clicking on the Workarea icon. In our example, the Workarea will be called TestingWA using the following values:Screen 1Name: TestingWAScreen 2Include Files: From a Branch (MAIN)Screen 3Download Folder: C:\export\home\jeffreyh\Initial_Workareas\TestingWAScreen 4Do you want to use this Workarea to work on a private branch? Yes, I want to work on a private branch
In most cases, you will already have code that needs to be uploaded to Oracle SCM. In following with this example, we assume that we already have a JDeveloper Workspace called TestingWS.Upload Initial CodeAt this point, all you have is a Workarea defined within Oracle SCM (and JDeveloper) owned by REPOS_MANAGER. It is now time to put some initial code into the Workarea directory, and upload it to Oracle SCM. There are two options here, depending on whether you already have an application, or you simply need to create a skeleton directory.
Option #1
This option assumes you already have an application written in JDeveloper on your local files system. You could copy your entire JDeveloper application (the Workspace) into the newly created Oracle SCM directory. For example, if the JDeveloper application (Workspace) were called TestingWS, you would copy it as follows:Option #2C:\> xcopy C:\JDeveloper\jdev\myworkareas\TestingWA C:\export\home\jeffreyh\Initial_Workareas\TestingWA /s /eThis option assumes you do not already have an application written in JDeveloper. You could simply create the JDeveloper application (Workspace) by using the following. In JDeveloper, right click on the Workspaces icon and select "New Workspace". Create a Workspace named TestingWS and a Project. For the purpose of this example, the project will be called JavaProgrammingCODE as follows:Either option you used (above) to put your JDeveloper application (Workspace) into the TestingWA directory, it is now time to load this into Oracle SCM as an "Initial Load" of the application.New Workspace Dialog Screen
Directory Name: C:\export\home\jeffreyh\Initial_Workareas\TestingWA\TestingWS File Name: TestingWS.jwsNew Project Dialog ScreenDirectory Name: C:\export\home\jeffreyh\Initial_Workareas\TestingWA\TestingWS\JavaProgrammingCODE File Name: JavaProgrammingCODE.jws
IMPORTANT: Ensure that you are logged into the JDeveloper Oracle9i SCM as the REPOS_MANAGER repository user AND the TestingWA is selected as the default Workarea!Now, follow the steps described below to add (upload) the TestingWS application to the Oracle9i SCM Workarea called TestingWA:
At this point, you have uploaded your Initial application code into the Oracle SCM Repository as the REPOS_MANAGER user. It is important to note that you should not be working with your code as the REPOS_MANAGER user; you should instead be using an account like JEFFREYH or MHUNTER. To ensure this, you should clean up what was done as the REPOS_MANAGER user, and re-download your application code, while logged in as JEFFREYH. Follow the following steps:
- Click on the JDeveloper Workspace TestingWS
- From the JDeveloper menu, select "File -> Source Control -> Connect". In the "Connect to Oracle9i SCM" dialog, choose CUSTDB_JEFFREYH1_REPOSMANAGER.
- This will bring up the "Workarea for CUSTDB_JEFFREY_REPOSMANAGER" dialog. From here, select the TestingWA option and click OK. This will put the string (SCM) next to the TestingWA icon as follows: "Connections -> Oracle9i SCM -> CUSTDB_JEFFREYH1_REPOSMANAGER -> Workareas -> TestingWA (SCM)".
- Finally, right click on the JDeveloper Workspace TestingWS selection and choose: "Source Control -> Add". When the "Add Files to Oracle9i SCM" dialog appears, simply hit OK.
- Single click on the TestingWS option in JDeveloper.
- Navigate to the pull down menu option "File -> Remove From Workspaces". Accept any warning dialogs.
- Now, go to the file system and remove the TestingWA and everything within it:
rmdir C:\export\home\jeffreyh\Initial_Workareas\TestingWA /s- In JDeveloper, if you have a connection open as REPOS_MANAGER, close it.
- Now open up the application "Repository Object Navigator" (RON). Login as the REPOS_MANAGER user.
- From within RON, open the navigator to "Private Workareas" and select the newly created "TestingWA" Workarea.
- You now need to grant Access Rights to other repository users or to PUBLIC for the Workspace. Note that this will ONLY grant privileges to the Workspace, not any folders contained within the Workspace. From the menu, choose "File -> Access Rights -> Grant Access Rights". This will bring up the "Grant Access Rights for TestingWA" dialog. Choose the Repository Users to grant to plus the actual privileges you would like to grant.
- You now need to grant Access Rights to other repository users or to PUBLIC to the JDeveloper Workspace (TestingWS) that is contained within the TestingWA Workarea. Click on the TestingWS option, and choose "File -> Access Rights -> Grant Access Rights". This will bring up the "Grant Access Rights for TestingWS" dialog. Again, choose the Repository Users to grant to plus the actual privileges you would like to grant. NOTE: That you need to click the checkbox option "Recurse Sub-Containers" before hitting the Grant option.
- At this point, any of the Repository Users you granted to, should be able to create a Workarea within JDeveloper and work on this code.
Now within JDeveloper, create an Oracle9i SCM Connection as CUSTDB_JEFFREYH1_JEFFREYH. This will be one of the developers that will be working on the TestingWS application and the TestingWA SCM Workarea. Use the following steps in creating this connection:
- Create an Oracle9i SCM connection within JDeveloper called CUSTDB_JEFFREYH1_JEFFREYH. Sign in as the JEFFREYH user.
- Create a Workarea by right clicking on the Workareas icon and selecting "New Workarea...".
- Fill out the Workarea Wizard with the following options:
Screen 1
Name: JEFFREYH_TestingWAScreen 2Include Files: From a Shared Workarea Hit the Browse button and select TestingWAScreen 3Download Folder: C:\export\home\jeffreyh\SCM_Workareas\TestingWAScreen 4Do you want to use this Workarea to work on a private branch? Yes, I want to work on a private branchDepending on the size of the Workarea, the "Oracle9i SCM repository and file system synchronization" process can take awhile to complete. To view the status of the process, click the "Details>>" button.
Now that all of the files have been downloaded to you local workstation, simply open the following file in JDeveloper:
C:\export\home\jeffreyh\SCM_Workareas\TestingWA\TestingWS\TestingW