[bugzilla 384447] Allowing to specify the CDO repository location through the Intent repository identifier.
diff --git a/plugins/org.eclipse.mylyn.docs.intent.client.synchronizer/src/org/eclipse/mylyn/docs/intent/client/synchronizer/synchronizer/IntentSynchronizer.java b/plugins/org.eclipse.mylyn.docs.intent.client.synchronizer/src/org/eclipse/mylyn/docs/intent/client/synchronizer/synchronizer/IntentSynchronizer.java
index a4838b2..e431e87 100644
--- a/plugins/org.eclipse.mylyn.docs.intent.client.synchronizer/src/org/eclipse/mylyn/docs/intent/client/synchronizer/synchronizer/IntentSynchronizer.java
+++ b/plugins/org.eclipse.mylyn.docs.intent.client.synchronizer/src/org/eclipse/mylyn/docs/intent/client/synchronizer/synchronizer/IntentSynchronizer.java
@@ -21,6 +21,7 @@
 import java.util.List;

 import java.util.Map;

 

+import org.eclipse.emf.cdo.util.InvalidURIException;

 import org.eclipse.emf.common.util.EList;

 import org.eclipse.emf.common.util.Monitor;

 import org.eclipse.emf.common.util.URI;

@@ -474,6 +475,8 @@
 				resource = resourceSet.getResource(externalURI, true);

 			} catch (WrappedException e) {

 				resource = null;

+			} catch (InvalidURIException e) {

+				resource = null;

 			}

 		}

 		return resource;

diff --git a/plugins/org.eclipse.mylyn.docs.intent.client.ui.cdo/src/org/eclipse/mylyn/docs/intent/client/ui/cdo/handlers/InitializeContent.java b/plugins/org.eclipse.mylyn.docs.intent.client.ui.cdo/src/org/eclipse/mylyn/docs/intent/client/ui/cdo/handlers/InitializeContent.java
index 7f4b123..67d4654 100644
--- a/plugins/org.eclipse.mylyn.docs.intent.client.ui.cdo/src/org/eclipse/mylyn/docs/intent/client/ui/cdo/handlers/InitializeContent.java
+++ b/plugins/org.eclipse.mylyn.docs.intent.client.ui.cdo/src/org/eclipse/mylyn/docs/intent/client/ui/cdo/handlers/InitializeContent.java
@@ -37,7 +37,7 @@
 	 * @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent)
 	 */
 	public Object execute(ExecutionEvent event) throws ExecutionException {
-		IntentRepositoryInitializer.initializeContent("cdo:/intent-server", "Document {}");
+		IntentRepositoryInitializer.initializeContent("cdo:/localhost:2036/intent-server", "Document {}");
 		IntentLogger.getInstance().log(LogType.INFO, "Content correctly initialized.");
 		return null;
 	}
diff --git a/plugins/org.eclipse.mylyn.docs.intent.client.ui.cdo/src/org/eclipse/mylyn/docs/intent/client/ui/cdo/handlers/LaunchAllClients.java b/plugins/org.eclipse.mylyn.docs.intent.client.ui.cdo/src/org/eclipse/mylyn/docs/intent/client/ui/cdo/handlers/LaunchAllClients.java
index d28fcc3..9133190 100644
--- a/plugins/org.eclipse.mylyn.docs.intent.client.ui.cdo/src/org/eclipse/mylyn/docs/intent/client/ui/cdo/handlers/LaunchAllClients.java
+++ b/plugins/org.eclipse.mylyn.docs.intent.client.ui.cdo/src/org/eclipse/mylyn/docs/intent/client/ui/cdo/handlers/LaunchAllClients.java
@@ -39,7 +39,7 @@
 	 */
 	public Object execute(ExecutionEvent event) throws ExecutionException {
 		try {
-			IntentCDOManager.getCDOManager("cdo:/intent-server").initializeClients();
+			IntentCDOManager.getCDOManager("cdo:/localhost:2036/intent-server").initializeClients();
 		} catch (RepositoryConnectionException e) {
 			IntentLogger.getInstance().logError(e);
 		} catch (ReadOnlyException e) {
diff --git a/plugins/org.eclipse.mylyn.docs.intent.client.ui.cdo/src/org/eclipse/mylyn/docs/intent/client/ui/cdo/handlers/ShowIndexHandler.java b/plugins/org.eclipse.mylyn.docs.intent.client.ui.cdo/src/org/eclipse/mylyn/docs/intent/client/ui/cdo/handlers/ShowIndexHandler.java
index d87c48f..f11a0d1 100644
--- a/plugins/org.eclipse.mylyn.docs.intent.client.ui.cdo/src/org/eclipse/mylyn/docs/intent/client/ui/cdo/handlers/ShowIndexHandler.java
+++ b/plugins/org.eclipse.mylyn.docs.intent.client.ui.cdo/src/org/eclipse/mylyn/docs/intent/client/ui/cdo/handlers/ShowIndexHandler.java
@@ -41,7 +41,8 @@
 	public Object execute(ExecutionEvent event) throws ExecutionException {
 		try {
 			IntentEditorOpener.openIntentEditor(
-					IntentRepositoryManager.INSTANCE.getRepository("cdo:/intent-server"), false);
+					IntentRepositoryManager.INSTANCE.getRepository("cdo:/localhost:2036/intent-server"),
+					false);
 		} catch (RepositoryConnectionException e) {
 			IntentLogger.getInstance().logError(e);
 		} catch (CoreException e) {
diff --git a/plugins/org.eclipse.mylyn.docs.intent.client.ui.cdo/src/org/eclipse/mylyn/docs/intent/client/ui/cdo/repository/IntentCDOBasedRepositoryManagerContribution.java b/plugins/org.eclipse.mylyn.docs.intent.client.ui.cdo/src/org/eclipse/mylyn/docs/intent/client/ui/cdo/repository/IntentCDOBasedRepositoryManagerContribution.java
index e854fc8..8b6afd6 100644
--- a/plugins/org.eclipse.mylyn.docs.intent.client.ui.cdo/src/org/eclipse/mylyn/docs/intent/client/ui/cdo/repository/IntentCDOBasedRepositoryManagerContribution.java
+++ b/plugins/org.eclipse.mylyn.docs.intent.client.ui.cdo/src/org/eclipse/mylyn/docs/intent/client/ui/cdo/repository/IntentCDOBasedRepositoryManagerContribution.java
@@ -12,6 +12,7 @@
 
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.mylyn.docs.intent.collab.cdo.repository.CDOConfig;
+import org.eclipse.mylyn.docs.intent.collab.cdo.repository.CDORepository;
 import org.eclipse.mylyn.docs.intent.collab.common.repository.contribution.IntentRepositoryManagerContribution;
 import org.eclipse.mylyn.docs.intent.collab.handlers.adapters.RepositoryStructurer;
 import org.eclipse.mylyn.docs.intent.collab.repository.Repository;
@@ -27,13 +28,15 @@
  */
 public class IntentCDOBasedRepositoryManagerContribution implements IntentRepositoryManagerContribution {
 
+	private static final String SLASH = "/";
+
 	/**
 	 * {@inheritDoc}
 	 * 
 	 * @see org.eclipse.mylyn.docs.intent.collab.common.repository.contribution.IntentRepositoryManagerContribution#canCreateRepository(java.lang.String)
 	 */
 	public boolean canCreateRepository(String identifier) {
-		return identifier.contains("cdo:/");
+		return identifier.startsWith(CDORepository.CDO_REPOSITORY_IDENTIFIER);
 	}
 
 	/**
@@ -42,6 +45,8 @@
 	 * @see org.eclipse.mylyn.docs.intent.collab.common.repository.contribution.IntentRepositoryManagerContribution#createRepository(java.lang.String)
 	 */
 	public Repository createRepository(String identifier) throws RepositoryConnectionException {
+		// Identifier should respect the following form:
+		// cdo:/REPOSITORYLOCATION/repoName (e.g. cdo:/localhost:2037/repo1)
 		String repositoryType = "org.eclipse.mylyn.docs.intent.collab.cdo.repository";
 		RepositoryCreator repositoryCreator;
 		try {
@@ -53,24 +58,88 @@
 				throw new RepositoryConnectionException("Cannot instantiate a repository of type:"
 						+ repositoryType);
 			}
-			CDOConfig config = new CDOConfig("localhost:1027", getRepositoryName(identifier));
-			return repositoryCreator.createRepository(config, repositoryStructurer);
+			String identifierWithoutPrefix = identifier.replaceFirst(
+					CDORepository.CDO_REPOSITORY_IDENTIFIER + SLASH, "").replaceFirst(
+					CDORepository.CDO_REPOSITORY_IDENTIFIER, "");
+			String[] fragments = identifierWithoutPrefix.split(SLASH);
+			if (fragments.length >= 2) {
+				String repositoryLocation = checkRepositoryLocation(fragments[0]);
+				String repositoryName = checkRepositoryName(fragments[1]);
+				CDOConfig config = new CDOConfig(repositoryLocation, repositoryName);
+				return repositoryCreator.createRepository(config, repositoryStructurer);
+			} else {
+				throw new RepositoryConnectionException(
+						"Invalid identifier for Intent repository '"
+								+ identifier
+								+ "': should be cdo:/REPOSITORY_LOCATION/REPOSITORY_NAME (e.g. cdo:/localhost:2036/repo1)");
+			}
 		} catch (CoreException e) {
 			throw new RepositoryConnectionException(e.getMessage());
 		}
 	}
 
 	/**
-	 * Returns the name of the repository contained by the given identifier.
+	 * Checks the repository name, and throw a {@link RepositoryConnectionException} if it is not correct.
 	 * 
-	 * @param identifier
-	 *            the identifier
-	 * @return the repository name
+	 * @param repositoryName
+	 *            the repositoryName extracted from Intent repository identifier
+	 * @return the repository name if correct
+	 * @throws RepositoryConnectionException
+	 *             if the repository name is not correct
 	 */
-	private String getRepositoryName(String identifier) {
-		String repositoryName = identifier.replaceFirst("cdo://", "").replaceFirst("cdo:/", "");
-		repositoryName = repositoryName.split("/")[0];
+	private String checkRepositoryName(String repositoryName) throws RepositoryConnectionException {
+		if (repositoryName.trim().length() == 0) {
+			throw new RepositoryConnectionException("Invalid Intent repositoy name '" + repositoryName + "'");
+		}
 		return repositoryName;
 	}
 
+	/**
+	 * Checks the repository location, and throw a {@link RepositoryConnectionException} if it is not correct.
+	 * 
+	 * @param repositoryLocation
+	 *            the repository location extracted from Intent repository identifier
+	 * @return the repository location if correct
+	 * @throws RepositoryConnectionException
+	 *             if the repository location is not correct
+	 */
+	private String checkRepositoryLocation(String repositoryLocation) throws RepositoryConnectionException {
+		if (repositoryLocation.split(":").length != 2) {
+			throw new RepositoryConnectionException("Invalid Intent repositoy location '"
+					+ repositoryLocation
+					+ "': should be IP_ADRESS:PORT_NUMBER (e.g. 'localhost:2036', '192.1.2.3:1038')");
+		}
+		return repositoryLocation;
+	}
+
+	/**
+	 * {@inheritDoc}
+	 * 
+	 * @see org.eclipse.mylyn.docs.intent.collab.common.repository.contribution.IntentRepositoryManagerContribution#normalizeIdentifier(java.lang.String)
+	 */
+	public String normalizeIdentifier(String identifier) {
+		String normalizedIdentifier = identifier;
+		// If the identifier starts with cdo:/
+		if (canCreateRepository(normalizedIdentifier)) {
+			// We return cdo:/REPOSITORY_NAME, so that we do not have to always give the repository location
+			String identifierWithoutPrefix = identifier.replaceFirst(
+					CDORepository.CDO_REPOSITORY_IDENTIFIER + SLASH, "").replaceFirst(
+					CDORepository.CDO_REPOSITORY_IDENTIFIER, "");
+			String[] fragments = identifierWithoutPrefix.split(SLASH);
+			if (fragments.length == 1) {
+				// If identifier is already cdo:/REPOSITORY_NAME
+				normalizedIdentifier = identifier;
+			} else {
+				// if identifier is cdo:/REPOSITORY_LOCATION/REPOSITORY_NAME[/...]
+				if ((fragments.length == 2) && (fragments[0].contains(":"))) {
+					normalizedIdentifier = CDORepository.CDO_REPOSITORY_IDENTIFIER + fragments[1];
+				} else {
+					if (fragments.length >= 2) {
+						normalizedIdentifier = CDORepository.CDO_REPOSITORY_IDENTIFIER + fragments[0];
+					}
+				}
+			}
+		}
+		return normalizedIdentifier;
+	}
 }
diff --git a/plugins/org.eclipse.mylyn.docs.intent.client.ui.ide/src/org/eclipse/mylyn/docs/intent/client/ui/ide/repository/IntentProjectBasedRepositoryManagerContribution.java b/plugins/org.eclipse.mylyn.docs.intent.client.ui.ide/src/org/eclipse/mylyn/docs/intent/client/ui/ide/repository/IntentProjectBasedRepositoryManagerContribution.java
index dcfc8b4..85917ea 100644
--- a/plugins/org.eclipse.mylyn.docs.intent.client.ui.ide/src/org/eclipse/mylyn/docs/intent/client/ui/ide/repository/IntentProjectBasedRepositoryManagerContribution.java
+++ b/plugins/org.eclipse.mylyn.docs.intent.client.ui.ide/src/org/eclipse/mylyn/docs/intent/client/ui/ide/repository/IntentProjectBasedRepositoryManagerContribution.java
@@ -39,16 +39,13 @@
 	}
 
 	/**
-	 * Creates the {@link Repository} associated to the given identifier.
+	 * {@inheritDoc}
 	 * 
-	 * @param identifier
-	 *            the repository identifier (can be an IProject name, a CDO Repository name...).
-	 * @return the {@link Repository} associated to the considered project
-	 * @throws RepositoryConnectionException
-	 *             if the {@link Repository} cannot be created
+	 * @see org.eclipse.mylyn.docs.intent.collab.common.repository.contribution.IntentRepositoryManagerContribution#createRepository(java.lang.String)
 	 */
-	public Repository createRepository(String identifier) throws RepositoryConnectionException {
+	public Repository createRepository(String repositoryIdentifier) throws RepositoryConnectionException {
 		Repository repository = null;
+		String identifier = normalizeIdentifier(repositoryIdentifier);
 		try {
 			IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(identifier);
 			if (project != null) {
@@ -56,19 +53,19 @@
 					if (!project.isOpen()) {
 						project.open(null);
 					}
-
+					RepositoryCreator repositoryCreator = null;
+					String repositoryType = null;
 					if (project.hasNature("org.eclipse.mylyn.docs.intent.client.ui.ide.intentNature")) {
-						String repositoryType = getRepositoryType(project);
-						RepositoryCreator repositoryCreator = RepositoryRegistry.INSTANCE
-								.getRepositoryCreator(repositoryType);
-						RepositoryStructurer repositoryStructurer = RepositoryRegistry.INSTANCE
-								.getRepositoryStructurer(repositoryType);
-						if (repositoryCreator == null) {
-							throw new RepositoryConnectionException(
-									"Cannot instantiate a repository of type:" + repositoryType);
-						}
-						repository = repositoryCreator.createRepository(project, repositoryStructurer);
+						repositoryType = getRepositoryType(project);
+						repositoryCreator = RepositoryRegistry.INSTANCE.getRepositoryCreator(repositoryType);
 					}
+					if (repositoryCreator == null) {
+						throw new RepositoryConnectionException("Cannot instantiate a repository of type:"
+								+ repositoryType);
+					}
+					RepositoryStructurer repositoryStructurer = RepositoryRegistry.INSTANCE
+							.getRepositoryStructurer(repositoryType);
+					repository = repositoryCreator.createRepository(project, repositoryStructurer);
 				}
 			}
 		} catch (CoreException e) {
@@ -77,6 +74,15 @@
 		return repository;
 	}
 
+	/**
+	 * Returns the repository type associated to the given {@link IProject}.
+	 * 
+	 * @param project
+	 *            an intent project
+	 * @return the repository type associated to the given {@link IProject}
+	 * @throws CoreException
+	 *             if project description cannot be properly accessed
+	 */
 	private static String getRepositoryType(IProject project) throws CoreException {
 		for (ICommand command : project.getDescription().getBuildSpec()) {
 			if ("org.eclipse.mylyn.docs.intent.client.ui.ide.intentBuilder".equals(command.getBuilderName())) {
@@ -86,4 +92,18 @@
 		return null;
 	}
 
+	/**
+	 * {@inheritDoc}
+	 * 
+	 * @see org.eclipse.mylyn.docs.intent.collab.common.repository.contribution.IntentRepositoryManagerContribution#normalizeIdentifier(java.lang.String)
+	 */
+	public String normalizeIdentifier(String identifier) {
+		String normalizedIdentifier = identifier;
+		if (identifier.startsWith("platform:/resource")) {
+			normalizedIdentifier = identifier.toString().replaceFirst("platform:/resource/", "");
+			normalizedIdentifier = normalizedIdentifier.split("/")[0];
+		}
+		return normalizedIdentifier;
+	}
+
 }
diff --git a/plugins/org.eclipse.mylyn.docs.intent.collab.cdo/src/org/eclipse/mylyn/docs/intent/collab/cdo/repository/CDORepository.java b/plugins/org.eclipse.mylyn.docs.intent.collab.cdo/src/org/eclipse/mylyn/docs/intent/collab/cdo/repository/CDORepository.java
index a064bfc..ae678b2 100644
--- a/plugins/org.eclipse.mylyn.docs.intent.collab.cdo/src/org/eclipse/mylyn/docs/intent/collab/cdo/repository/CDORepository.java
+++ b/plugins/org.eclipse.mylyn.docs.intent.collab.cdo/src/org/eclipse/mylyn/docs/intent/collab/cdo/repository/CDORepository.java
@@ -38,6 +38,10 @@
  * @author <a href="mailto:alex.lagarde@obeo.fr">Alex Lagarde</a>
  */
 public class CDORepository implements Repository {
+	/**
+	 * A constant used to identify cdo repositories.
+	 */
+	public static final String CDO_REPOSITORY_IDENTIFIER = "cdo:/";
 
 	/**
 	 * Connector to the repository.
@@ -222,4 +226,13 @@
 		// TODO Auto-generated method stub
 	}
 
+	/**
+	 * {@inheritDoc}
+	 * 
+	 * @see org.eclipse.mylyn.docs.intent.collab.repository.Repository#getIdentifier()
+	 */
+	public String getIdentifier() {
+		return CDO_REPOSITORY_IDENTIFIER + repositoryConfiguration.getRepositoryName();
+	}
+
 }
diff --git a/plugins/org.eclipse.mylyn.docs.intent.collab.common/src/org/eclipse/mylyn/docs/intent/collab/common/internal/IntentRepositoryManagerImpl.java b/plugins/org.eclipse.mylyn.docs.intent.collab.common/src/org/eclipse/mylyn/docs/intent/collab/common/internal/IntentRepositoryManagerImpl.java
index 9f92a86..894e3b9 100644
--- a/plugins/org.eclipse.mylyn.docs.intent.collab.common/src/org/eclipse/mylyn/docs/intent/collab/common/internal/IntentRepositoryManagerImpl.java
+++ b/plugins/org.eclipse.mylyn.docs.intent.collab.common/src/org/eclipse/mylyn/docs/intent/collab/common/internal/IntentRepositoryManagerImpl.java
@@ -66,9 +66,9 @@
 					.getRepositoryManagerContributions().iterator(); iterator.hasNext() && repository == null;) {

 				IntentRepositoryManagerContribution repositoryManagerContribution = iterator.next();

 				if (repositoryManagerContribution.canCreateRepository(normalizedIdentifier)) {

-					repository = repositoryManagerContribution.createRepository(normalizedIdentifier);

+					repository = repositoryManagerContribution.createRepository(identifier);

 					if (repository != null) {

-						repositoriesByProject.put(normalizedIdentifier, repository);

+						repositoriesByProject.put(repository.getIdentifier(), repository);

 					}

 				}

 			}

@@ -108,14 +108,14 @@
 	 *         platform:/resource/PROJECT_NAME/..., returns PROJECT_NAME

 	 */

 	private String normalizeIdentifier(String identifier) {

-		String normalizedIdentifier = identifier;

-		// If identifier is of the form platform:/resource/PROJECT_NAME/...

-		// we extract the IProject name

-		if (identifier.startsWith("platform:/resource")) {

-			normalizedIdentifier = identifier.toString().replaceFirst("platform:/resource/", "");

-			normalizedIdentifier = normalizedIdentifier.split("/")[0];

+		for (Iterator<IntentRepositoryManagerContribution> iterator = IntentRepositoryManagerContributionRegistry

+				.getRepositoryManagerContributions().iterator(); iterator.hasNext();) {

+			IntentRepositoryManagerContribution repositoryManagerContribution = iterator.next();

+			String normalizedIdentifier = repositoryManagerContribution.normalizeIdentifier(identifier);

+			if (!normalizedIdentifier.equals(identifier)) {

+				return normalizedIdentifier;

+			}

 		}

-		return normalizedIdentifier;

+		return identifier;

 	}

-

 }

diff --git a/plugins/org.eclipse.mylyn.docs.intent.collab.common/src/org/eclipse/mylyn/docs/intent/collab/common/repository/contribution/IntentRepositoryManagerContribution.java b/plugins/org.eclipse.mylyn.docs.intent.collab.common/src/org/eclipse/mylyn/docs/intent/collab/common/repository/contribution/IntentRepositoryManagerContribution.java
index 28a6db1..273eb74 100644
--- a/plugins/org.eclipse.mylyn.docs.intent.collab.common/src/org/eclipse/mylyn/docs/intent/collab/common/repository/contribution/IntentRepositoryManagerContribution.java
+++ b/plugins/org.eclipse.mylyn.docs.intent.collab.common/src/org/eclipse/mylyn/docs/intent/collab/common/repository/contribution/IntentRepositoryManagerContribution.java
@@ -42,4 +42,21 @@
 	 *             if the {@link Repository} cannot be created
 	 */
 	Repository createRepository(String identifier) throws RepositoryConnectionException;
+
+	/**
+	 * Returns the identifier if it cannot be normalized by this contribution, or the normalized form of the
+	 * given identifier otherwise. For example:
+	 * <ul>
+	 * <li>if identifier is of the form platform:/resource/PROJECT_NAME/..., returns PROJECT_NAME</li>
+	 * <li>if identifier is of the form cdo:/REPOSITORY_LOCATION/REPOSITORY_NAME/... returns
+	 * cdo:/REPOSITORY_NAME</li>
+	 * </ul>
+	 * 
+	 * @param identifier
+	 *            the identifier to normalize
+	 * @return the identifier if it cannot be normalized by this contribution, or the normalized form of the
+	 *         given identifier (e.g. if identifier is of the form platform:/resource/PROJECT_NAME/...,
+	 *         returns PROJECT_NAME) otherwise
+	 */
+	String normalizeIdentifier(String identifier);
 }
diff --git a/plugins/org.eclipse.mylyn.docs.intent.collab.ide/src/org/eclipse/mylyn/docs/intent/collab/ide/repository/WorkspaceRepository.java b/plugins/org.eclipse.mylyn.docs.intent.collab.ide/src/org/eclipse/mylyn/docs/intent/collab/ide/repository/WorkspaceRepository.java
index a2235ca..2becbc9 100644
--- a/plugins/org.eclipse.mylyn.docs.intent.collab.ide/src/org/eclipse/mylyn/docs/intent/collab/ide/repository/WorkspaceRepository.java
+++ b/plugins/org.eclipse.mylyn.docs.intent.collab.ide/src/org/eclipse/mylyn/docs/intent/collab/ide/repository/WorkspaceRepository.java
@@ -327,4 +327,13 @@
 		return workspaceAdapter;
 	}
 
+	/**
+	 * {@inheritDoc}
+	 * 
+	 * @see org.eclipse.mylyn.docs.intent.collab.repository.Repository#getIdentifier()
+	 */
+	public String getIdentifier() {
+		return workspaceConfig.getProject().getName();
+	}
+
 }
diff --git a/plugins/org.eclipse.mylyn.docs.intent.collab/src/org/eclipse/mylyn/docs/intent/collab/repository/Repository.java b/plugins/org.eclipse.mylyn.docs.intent.collab/src/org/eclipse/mylyn/docs/intent/collab/repository/Repository.java
index e49a878..cdf277c 100644
--- a/plugins/org.eclipse.mylyn.docs.intent.collab/src/org/eclipse/mylyn/docs/intent/collab/repository/Repository.java
+++ b/plugins/org.eclipse.mylyn.docs.intent.collab/src/org/eclipse/mylyn/docs/intent/collab/repository/Repository.java
@@ -80,4 +80,13 @@
 	 */
 	void setRepositoryStructurer(RepositoryStructurer structurer);
 
+	/**
+	 * Returns the identier of this repository (e.g. 'myRepository' for a workspace repository,
+	 * 'cdo:/myRepository' for a cdo repository...).
+	 * 
+	 * @return the identier of this repository (e.g. 'myRepository' for a workspace repository,
+	 *         'cdo:/myRepository' for a cdo repository...)
+	 */
+	String getIdentifier();
+
 }
diff --git a/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/suite/UITestSuite.java b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/suite/UITestSuite.java
index 1a4c6ab..ea9102e 100644
--- a/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/suite/UITestSuite.java
+++ b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/suite/UITestSuite.java
@@ -60,6 +60,14 @@
 		final TestSuite suite = new TestSuite("Intent Global TestSuite");
 
 		/*
+		 * CDO related test Suite
+		 */
+		final TestSuite cdoSuite = new TestSuite("CDO integration tests");
+		suite.addTest(cdoSuite);
+
+		cdoSuite.addTestSuite(CDOIntegrationTest.class);
+
+		/*
 		 * Intent Technical Tests
 		 */
 		final TestSuite clientSuite = new TestSuite("Intent Client tests");
@@ -110,14 +118,6 @@
 		updatesSuite.addTestSuite(DragAndDropTest.class);
 		uiTestSuite.addTest(updatesSuite);
 
-		/*
-		 * CDO related test Suite
-		 */
-		final TestSuite cdoSuite = new TestSuite("CDO integration tests");
-		suite.addTest(cdoSuite);
-
-		cdoSuite.addTestSuite(CDOIntegrationTest.class);
-
 		return suite;
 	}
 
diff --git a/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/cdo/CDOIntegrationTest.java b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/cdo/CDOIntegrationTest.java
index 284979a..0a6d4c3 100644
--- a/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/cdo/CDOIntegrationTest.java
+++ b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/cdo/CDOIntegrationTest.java
@@ -47,7 +47,7 @@
 
 		// Some remote user modifies the intent document by adding a chapter
 		final RepositoryAdapter remoteUser = IntentRepositoryManager.INSTANCE.getRepository(
-				"cdo:/myIntentProject").createRepositoryAdapter();
+				getIntentRepositoryIdentifier()).createRepositoryAdapter();
 		remoteUser.openSaveContext();
 		remoteUser.execute(new IntentCommand() {
 
diff --git a/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/cdo/util/AbstractIntentCDOTest.java b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/cdo/util/AbstractIntentCDOTest.java
index 1a8deee..46135b5 100644
--- a/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/cdo/util/AbstractIntentCDOTest.java
+++ b/tests/org.eclipse.mylyn.docs.intent.client.ui.test/src/org/eclipse/mylyn/docs/intent/client/ui/test/unit/cdo/util/AbstractIntentCDOTest.java
@@ -63,8 +63,7 @@
 	@Override
 	protected void setUpIntentProject(String projectName, String intentDocumentPath,
 			boolean listenForRepository) {
-		super.setUpIntentProject("cdo:/" + INTENT_REPOSITORY_NAME + "/" + projectName, intentDocumentPath,
-				listenForRepository);
+		super.setUpIntentProject(getIntentRepositoryIdentifier(), intentDocumentPath, listenForRepository);
 	}
 
 	/**
@@ -96,6 +95,15 @@
 	}
 
 	/**
+	 * Returns the repository identifier associated to the current test.
+	 * 
+	 * @return the repository identifier associated to the current test
+	 */
+	protected final String getIntentRepositoryIdentifier() {
+		return "cdo:/" + IntentCDORepository.getServerLocation() + "/" + INTENT_REPOSITORY_NAME;
+	}
+
+	/**
 	 * {@inheritDoc}
 	 * 
 	 * @see org.eclipse.mylyn.docs.intent.client.ui.test.util.AbstractIntentUITest#additionalSetUpOperations()
diff --git a/tests/org.eclipse.mylyn.docs.intent.test.server/src/org/eclipse/mylyn/docs/intent/test/server/IntentCDORepository.java b/tests/org.eclipse.mylyn.docs.intent.test.server/src/org/eclipse/mylyn/docs/intent/test/server/IntentCDORepository.java
index 49c7ed9..15b5477 100644
--- a/tests/org.eclipse.mylyn.docs.intent.test.server/src/org/eclipse/mylyn/docs/intent/test/server/IntentCDORepository.java
+++ b/tests/org.eclipse.mylyn.docs.intent.test.server/src/org/eclipse/mylyn/docs/intent/test/server/IntentCDORepository.java
@@ -116,4 +116,13 @@
 			repository = null;
 		}
 	}
+
+	/**
+	 * Returns the server location.
+	 * 
+	 * @return the server location (e.g. localhost:2037)
+	 */
+	public static String getServerLocation() {
+		return SERVER_LOCATION + ":" + SERVER_PORT_NUMBER;
+	}
 }