summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2007-08-26 03:33:18 (EDT)
committerEike Stepper2007-08-26 03:33:18 (EDT)
commitb53060a00f42e47eecd01b28c4bd2892958a0da5 (patch)
tree4b00f72ba789490da1bf1203cdc5aae23071396c
parent99c61495150c20d4624c33c6b58b9be7efd2503d (diff)
downloadcdo-b53060a00f42e47eecd01b28c4bd2892958a0da5.zip
cdo-b53060a00f42e47eecd01b28c4bd2892958a0da5.tar.gz
cdo-b53060a00f42e47eecd01b28c4bd2892958a0da5.tar.bz2
*** empty log message ***
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Repository.java10
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/EMFUtil.java15
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/ModelUtil.java4
3 files changed, 25 insertions, 4 deletions
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Repository.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Repository.java
index dd89276..468b79c 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Repository.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Repository.java
@@ -31,6 +31,8 @@ import java.util.UUID;
*/
public class Repository extends Container implements IRepository
{
+ public static final String PROP_OVERRIDE_UUID = "overrideUUID";
+
public static final String PROP_SUPPORTING_AUDITS = "supportingAudits";
public static final String PROP_VERIFYING_REVISIONS = "verifyingRevisions";
@@ -82,7 +84,6 @@ public class Repository extends Container implements IRepository
this.name = name;
this.store = store;
- uuid = UUID.randomUUID().toString();
elements = new Object[] { packageManager, sessionManager, resourceManager, revisionManager, typeManager, store };
}
@@ -98,7 +99,12 @@ public class Repository extends Container implements IRepository
public String getUUID()
{
- // TODO Support overriding UUIDs through setProperties()
+ if (uuid == null)
+ {
+ String value = getProperties().get(PROP_OVERRIDE_UUID);
+ uuid = StringUtil.isEmpty(value) ? UUID.randomUUID().toString() : value;
+ }
+
return uuid;
}
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/EMFUtil.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/EMFUtil.java
index ed18052..3275acb 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/EMFUtil.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/EMFUtil.java
@@ -168,21 +168,32 @@ public final class EMFUtil
return result;
}
- public static List<EStructuralFeature> getPersistentFeatures(EList<EStructuralFeature> eFeatues)
+ public static List<EStructuralFeature> getPersistentFeatures(EList<EStructuralFeature> eFeatures)
{
List<EStructuralFeature> result = new ArrayList();
- for (EStructuralFeature feature : eFeatues)
+ for (EStructuralFeature feature : eFeatures)
{
if (feature.isTransient())
{
continue;
}
+ // TODO Make configurable via ExtPoint
if (feature == EcorePackage.eINSTANCE.getEClass_ESuperTypes())
{
continue;
}
+ if (feature == EcorePackage.eINSTANCE.getETypedElement_EType())
+ {
+ continue;
+ }
+
+ // if (feature == EcorePackage.eINSTANCE.getEGenericType_EClassifier())
+ // {
+ // continue;
+ // }
+
result.add(feature);
}
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/ModelUtil.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/ModelUtil.java
index 7ab37aa..4049e78 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/ModelUtil.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/ModelUtil.java
@@ -131,6 +131,10 @@ public final class ModelUtil
String name = ePackage.getName();
boolean dynamic = EMFUtil.isDynamicEPackage(ePackage);
// String ecore = dynamic ? EMFUtil.ePackageToString(ePackage) : null;
+ // TODO Serialize EcorePackage.eINSTANCE, too
+ // Current problem with EcorePackage.eINSTANCE is mutual modification of
+ // certain Ecore features (see newsgroup thread "eGenericSuperTypes" and
+ // EMFUtil.getPersistentFeatures()
String ecore = EcorePackage.eINSTANCE.getNsURI().equals(packageURI) ? null : EMFUtil.ePackageToString(ePackage);
CDOIDRange idRange = packageManager.getSession().registerEPackage(ePackage);