Now that we have Composer installed on Eclipse JEE we have an open tooling platform that we can extend. One such extension is Eclipse Team that provides a source control API that most source control vendors; cvs (comes with eclipse anyway), svn, perforce, starteam, etc, have integrated with. Right out of the box you can share your projects with other team members via most standard source control systems. For demonstration I’m going to use the Subversive SVN provider here but the others all work in a similar way.
As part of the scenario we will be playing out the role of two developers by switching between two workspaces.
Installing the SVN Provider
First thing first though we need to install the Subversive SVN team provider. Goto Help->Install New Software… Select Helios in the “Work with” drop down and type “svn” into the filter box. Select the Subversive SVN Team Provider (Incubation) and install it.
You will be prompted for the usual restart so go ahead and do that.
Configuring the Team Provider for Documentum
Next we need to tell the team provider what to checkin. You need to do this in the other workspace too and I will remind you to do so. Goto Window->Preferences…->Team->Ignored Resources.
Click Add Pattern… and add the following three patterns:-
Now repeat that adding the next two patterns:-
This tells all the team providers to ignore built artifact files (*.artifact), Documentum ARchives (*.dar) and all web service build artifacts. There is no point in checking these in.
Sharing a Project
We now assume the role of the first developer. He wants to share a project. With the Documentum Artifacts perspective open create a new Documentum project to share. As this is the first Documentum project in your workspace Composer will also create the core and the TCM reference project for you. As these two upstream projects are both referenced by your project you need to check these in too. This ensures your projects references will be satisfied when others check them out. This principal stands for any referenced projects that you may add too.
The core and tcm reference projects are hidden in the Documentum Artifacts perspective so open the Navigator view to show all three projects; Window->Show View->Navigator. Now you can see all three projects, select the core project first, right-click and select Team->Share Projects…
This will bring up the SVN Share Projects Wizard.
Enter the URL for your SVN repo and the login details. We can default everything else so just click Finish.
SVN will then pop up the Commit dialog allowing you can enter a comment for the commit and to review the set of files that will be commited. It is worth checking these to make sure there are no resources that should be ignored.
Click OK and the files will be added to the repository. Once that’s done, repeat this process for the TCM reference project and lastly for you project.
Once all three projects have been shared your workspace should look something like this:-
Note the little orange repository icon in the bottom left hand corner of all your folders and files. This is a visual indicator that these files are being managed with source control.
Import a Project
So now other developers are free to work on these projects too. Let’s have a look at how they might do that.
Switch to a new, empty workspace and show the Documentum Artifacts perspective. Now set up the ignored resources as we did earlier.
Now import the projects that were shared by developer one. Right-click in the Project Explorer and select Import->Import… to bring up the Import dialog. Find and expand the SVN category and select Project from SVN.
Click Next to launch the SVN Import dialog. On the first page enter the repository info as you did before. Click Next to bring up the Select Resource dialog.
Select the Browse button. Navigate to the DocumentumCoreProject and select it.
Click OK to confirm the selection and return to the previous dialog. Then click Finish to bring up the Check Out As dialog.
Accept the defaults on this dialog and Click Finish to start the import.
Once the core project has been imported repeat the same process for the tcm reference project next and finally for your project. Don’t forget the core and tcm reference projects won’t be visible in the Documentum Navigator so you can open one of the other navigator views to see them.
Once all three projects have been imported you should see something like this:-
Again, note the little orange repository icons indicating these projects are under source control.
Updating a Project
Naturally your developers are now going to update the project by adding new artifacts, editing others and possibly deleting some others still. This is all part of the natural life-cycle of the project.
So switch workspace back to the first developer and let’s make a couple of changes. Let’s add a new format artifact and edit the description of the dar folder install parameter. Your workspace should now look something like this.
Note the arrow (>) next to items that have been modified. And note also that these track all the way back up the tree to the project itself. And the little question mark on the format artifact indicating it is new. If you want to learn more about the SVN icons goto Window->Preferences->Team->SVN->Label Decorations for this dialog:-
Now submit these changes. The first thing we do is merge out; i.e. grab all the changes made by others whilst we have been working on our change. This ensures we are compatible and not blindly forcing a breaking change into the repository. Right-click on the project and select Team->Update. Obviously in this case no one else has made any changes yet. But typically at this stage we would resolve any conflicts and re-test
our changes to ensure they are still good. Then we know we are fit to check in. Right-click the project and select Team->Submit…
Add a submission comment and click OK. Note that the SVN modified indicators all disappear and your changes have been submitted into the
In the meantime the developer that imported the project is now making changes too. Let’s switch to his workspace and also make an edit to the description of the dar install folder parameter.
Resolving a Conflicting Change
You’ll notice that both developers have now changed the dar folder install parameter artifact. The second developer is going to be made aware of this when he attempts to check his changes in.
So still as the second developer do your merge out. Right-click on the project and select Team->Update. SVN will attempt to update your workspace. It will grab any new, non-conflicting changes and attempt to resolve any conflicts. It will update your project with the new format artifact. However, it will be unable to resolve the conflict that has arisen with the dar folder install parameter. You’ll be notified with the following dialog:-
Click OK to close the dialogs. Now right-click on the project and select Team->Synchronize with Repository. A dialog will pop-up asking if you want to open the Synchronize Perspective which is a collection of views for helping with synchronization tasks. Choose Yes and the perspective will open:-
Right-click on the dar folder install parameter, the artifact that has the conflict, and select Edit Conflict. This will open the XMI versions of the local and repository file highlighting the conflicts.
The developer uses this editor to resolve the conflict in the normal way. Once he is done he marks the file as merged by right-clicking on the artifact in the tree again and selecting Mark as Merged. The artifact will be removed the file from the Synchronize view:-
Lastly, he right-clicks on the project and selects Commit and his changes, merged with others, are committed to the source control system.
In today’s post we’ve taken a look at the Subversive SVN Team Provider for eclipse and demonstrated how it can be used with Composer, unmodified, to share Documentum projects amongst a team of developers through an SVN source control system.
The same basic theory holds true except for the subtle differences between providers feature sets. Over time I will try and demonstrate the same scenarios using CVS and Perforce.
In the meantime – Happy Composing!