click me  


  


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.

We 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:

Create an Oracle9i SCM Connection for the Repository Owner
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:
  Connection Name:  CUSTDB_JEFFREYH1_REPOSMANAGER
  User Name:        REPOS_MANAGER
  Password:         manager
Creating Initial (Shared) SCM Workarea
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.

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\TestingWA
After 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 1
    Name:           TestingWA
Screen 2
    Include Files:  From a Branch (MAIN)
Screen 3
    Download Folder:  
        C:\export\home\jeffreyh\Initial_Workareas\TestingWA
Screen 4
    Do you want to use this Workarea to work on a private branch?
        Yes, I want to work on a private branch
Create the JDeveloper Application (Workspace)
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.

At 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:
C:\> xcopy
      C:\JDeveloper\jdev\myworkareas\TestingWA
      C:\export\home\jeffreyh\Initial_Workareas\TestingWA /s /e
Option #2
This 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:

New Workspace Dialog Screen

    Directory Name:
    C:\export\home\jeffreyh\Initial_Workareas\TestingWA\TestingWS
	
    File Name:
    TestingWS.jws
New Project Dialog Screen
    Directory Name:
    C:\export\home\jeffreyh\Initial_Workareas\TestingWA\TestingWS\JavaProgrammingCODE

    File Name:
    JavaProgrammingCODE.jws
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.
Upload Initial Code
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:

  1. Click on the JDeveloper Workspace TestingWS

  2. From the JDeveloper menu, select "File -> Source Control -> Connect". In the "Connect to Oracle9i SCM" dialog, choose CUSTDB_JEFFREYH1_REPOSMANAGER.

  3. 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)".

  4. 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.
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:

  1. Single click on the TestingWS option in JDeveloper.

  2. Navigate to the pull down menu option "File -> Remove From Workspaces". Accept any warning dialogs.

  3. Now, go to the file system and remove the TestingWA and everything within it:
      rmdir C:\export\home\jeffreyh\Initial_Workareas\TestingWA /s
  4. In JDeveloper, if you have a connection open as REPOS_MANAGER, close it.

  5. Now open up the application "Repository Object Navigator" (RON). Login as the REPOS_MANAGER user.

  6. From within RON, open the navigator to "Private Workareas" and select the newly created "TestingWA" Workarea.

  7. 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.

  8. 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.

  9. 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:

  1. Create an Oracle9i SCM connection within JDeveloper called CUSTDB_JEFFREYH1_JEFFREYH. Sign in as the JEFFREYH user.

  2. Create a Workarea by right clicking on the Workareas icon and selecting "New Workarea...".

  3. Fill out the Workarea Wizard with the following options:

    Screen 1

    Name:              JEFFREYH_TestingWA
    Screen 2
    Include Files:     From a Shared Workarea
                       Hit the Browse button and select
                       TestingWA
    Screen 3
    Download Folder:   C:\export\home\jeffreyh\SCM_Workareas\TestingWA
    Screen 4
    Do you want to use this Workarea to work on a private branch?
                       Yes, I want to work on a private branch

Depending 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



Last modified on: Tuesday, 26-Jul-2005 18:36:21 EDT
Page Count: 6041