{@link com.specmate.model.history.Change#isIsCreate Is Create}
@@ -25,6 +28,85 @@
* @generated
*/
public interface Change extends CDOObject {
+ /**
+ * Returns the value of the 'Object Name' attribute.
+ *
+ *
+ * If the meaning of the 'Object Name' attribute isn't clear,
+ * there really should be more of a description here...
+ *
+ *
+ * @return the value of the 'Object Name' attribute.
+ * @see #setObjectName(String)
+ * @see com.specmate.model.history.HistoryPackage#getChange_ObjectName()
+ * @model
+ * @generated
+ */
+ String getObjectName();
+
+ /**
+ * Sets the value of the '{@link com.specmate.model.history.Change#getObjectName Object Name}' attribute.
+ *
+ *
+ * @param value the new value of the 'Object Name' attribute.
+ * @see #getObjectName()
+ * @generated
+ */
+ void setObjectName(String value);
+
+ /**
+ * Returns the value of the 'Object Type' attribute.
+ * The default value is "".
+ *
+ *
+ * If the meaning of the 'Object Type' attribute isn't clear,
+ * there really should be more of a description here...
+ *
+ *
+ * @return the value of the 'Object Type' attribute.
+ * @see #setObjectType(String)
+ * @see com.specmate.model.history.HistoryPackage#getChange_ObjectType()
+ * @model default=""
+ * @generated
+ */
+ String getObjectType();
+
+ /**
+ * Sets the value of the '{@link com.specmate.model.history.Change#getObjectType Object Type}' attribute.
+ *
+ *
+ * @param value the new value of the 'Object Type' attribute.
+ * @see #getObjectType()
+ * @generated
+ */
+ void setObjectType(String value);
+
+ /**
+ * Returns the value of the 'Old Value' attribute.
+ *
+ *
+ * If the meaning of the 'Old Value' attribute isn't clear,
+ * there really should be more of a description here...
+ *
+ *
+ * @return the value of the 'Old Value' attribute.
+ * @see #setOldValue(String)
+ * @see com.specmate.model.history.HistoryPackage#getChange_OldValue()
+ * @model
+ * @generated
+ */
+ String getOldValue();
+
+ /**
+ * Sets the value of the '{@link com.specmate.model.history.Change#getOldValue Old Value}' attribute.
+ *
+ *
+ * @param value the new value of the 'Old Value' attribute.
+ * @see #getOldValue()
+ * @generated
+ */
+ void setOldValue(String value);
+
/**
* Returns the value of the 'New Value' attribute.
*
diff --git a/bundles/specmate-model-gen/src/com/specmate/model/history/HistoryEntry.java b/bundles/specmate-model-gen/src/com/specmate/model/history/HistoryEntry.java
index e78416c98..dbb2ff4f2 100644
--- a/bundles/specmate-model-gen/src/com/specmate/model/history/HistoryEntry.java
+++ b/bundles/specmate-model-gen/src/com/specmate/model/history/HistoryEntry.java
@@ -17,6 +17,7 @@
*
@@ -79,6 +80,22 @@ public interface HistoryEntry extends CDOObject {
*/
void setUser(String value);
+ /**
+ * Returns the value of the 'Deleted Objects' attribute list.
+ * The list contents are of type {@link java.lang.String}.
+ *
+ *
+ * If the meaning of the 'Deleted Objects' attribute list isn't clear,
+ * there really should be more of a description here...
+ *
+ *
+ * @return the value of the 'Deleted Objects' attribute list.
+ * @see com.specmate.model.history.HistoryPackage#getHistoryEntry_DeletedObjects()
+ * @model
+ * @generated
+ */
+ EList getDeletedObjects();
+
/**
* Returns the value of the 'Comment' attribute.
*
diff --git a/bundles/specmate-model-gen/src/com/specmate/model/history/HistoryPackage.java b/bundles/specmate-model-gen/src/com/specmate/model/history/HistoryPackage.java
index 04c806f41..933c80912 100644
--- a/bundles/specmate-model-gen/src/com/specmate/model/history/HistoryPackage.java
+++ b/bundles/specmate-model-gen/src/com/specmate/model/history/HistoryPackage.java
@@ -121,6 +121,15 @@ public interface HistoryPackage extends EPackage {
*/
int HISTORY_ENTRY__USER = 1;
+ /**
+ * The feature id for the 'Deleted Objects' attribute list.
+ *
+ *
+ * @generated
+ * @ordered
+ */
+ int HISTORY_ENTRY__DELETED_OBJECTS = 2;
+
/**
* The feature id for the 'Comment' attribute.
*
@@ -128,7 +137,7 @@ public interface HistoryPackage extends EPackage {
* @generated
* @ordered
*/
- int HISTORY_ENTRY__COMMENT = 2;
+ int HISTORY_ENTRY__COMMENT = 3;
/**
* The feature id for the 'Changes' containment reference list.
@@ -137,7 +146,7 @@ public interface HistoryPackage extends EPackage {
* @generated
* @ordered
*/
- int HISTORY_ENTRY__CHANGES = 3;
+ int HISTORY_ENTRY__CHANGES = 4;
/**
* The number of structural features of the 'Entry' class.
@@ -146,7 +155,7 @@ public interface HistoryPackage extends EPackage {
* @generated
* @ordered
*/
- int HISTORY_ENTRY_FEATURE_COUNT = 4;
+ int HISTORY_ENTRY_FEATURE_COUNT = 5;
/**
* The number of operations of the 'Entry' class.
@@ -167,6 +176,33 @@ public interface HistoryPackage extends EPackage {
*/
int CHANGE = 2;
+ /**
+ * The feature id for the 'Object Name' attribute.
+ *
+ *
+ * @generated
+ * @ordered
+ */
+ int CHANGE__OBJECT_NAME = 0;
+
+ /**
+ * The feature id for the 'Object Type' attribute.
+ *
+ *
+ * @generated
+ * @ordered
+ */
+ int CHANGE__OBJECT_TYPE = 1;
+
+ /**
+ * The feature id for the 'Old Value' attribute.
+ *
+ *
+ * @generated
+ * @ordered
+ */
+ int CHANGE__OLD_VALUE = 2;
+
/**
* The feature id for the 'New Value' attribute.
*
@@ -174,7 +210,7 @@ public interface HistoryPackage extends EPackage {
* @generated
* @ordered
*/
- int CHANGE__NEW_VALUE = 0;
+ int CHANGE__NEW_VALUE = 3;
/**
* The feature id for the 'Feature' attribute.
@@ -183,7 +219,7 @@ public interface HistoryPackage extends EPackage {
* @generated
* @ordered
*/
- int CHANGE__FEATURE = 1;
+ int CHANGE__FEATURE = 4;
/**
* The feature id for the 'Is Create' attribute.
@@ -192,7 +228,7 @@ public interface HistoryPackage extends EPackage {
* @generated
* @ordered
*/
- int CHANGE__IS_CREATE = 2;
+ int CHANGE__IS_CREATE = 5;
/**
* The feature id for the 'Is Delete' attribute.
@@ -201,7 +237,7 @@ public interface HistoryPackage extends EPackage {
* @generated
* @ordered
*/
- int CHANGE__IS_DELETE = 3;
+ int CHANGE__IS_DELETE = 6;
/**
* The number of structural features of the 'Change' class.
@@ -210,7 +246,7 @@ public interface HistoryPackage extends EPackage {
* @generated
* @ordered
*/
- int CHANGE_FEATURE_COUNT = 4;
+ int CHANGE_FEATURE_COUNT = 7;
/**
* The number of operations of the 'Change' class.
@@ -275,6 +311,17 @@ public interface HistoryPackage extends EPackage {
*/
EAttribute getHistoryEntry_User();
+ /**
+ * Returns the meta object for the attribute list '{@link com.specmate.model.history.HistoryEntry#getDeletedObjects Deleted Objects}'.
+ *
+ *
+ * @return the meta object for the attribute list 'Deleted Objects'.
+ * @see com.specmate.model.history.HistoryEntry#getDeletedObjects()
+ * @see #getHistoryEntry()
+ * @generated
+ */
+ EAttribute getHistoryEntry_DeletedObjects();
+
/**
* Returns the meta object for the attribute '{@link com.specmate.model.history.HistoryEntry#getComment Comment}'.
*
@@ -307,6 +354,39 @@ public interface HistoryPackage extends EPackage {
*/
EClass getChange();
+ /**
+ * Returns the meta object for the attribute '{@link com.specmate.model.history.Change#getObjectName Object Name}'.
+ *
+ *
+ * @return the meta object for the attribute 'Object Name'.
+ * @see com.specmate.model.history.Change#getObjectName()
+ * @see #getChange()
+ * @generated
+ */
+ EAttribute getChange_ObjectName();
+
+ /**
+ * Returns the meta object for the attribute '{@link com.specmate.model.history.Change#getObjectType Object Type}'.
+ *
+ *
+ * @return the meta object for the attribute 'Object Type'.
+ * @see com.specmate.model.history.Change#getObjectType()
+ * @see #getChange()
+ * @generated
+ */
+ EAttribute getChange_ObjectType();
+
+ /**
+ * Returns the meta object for the attribute '{@link com.specmate.model.history.Change#getOldValue Old Value}'.
+ *
+ *
+ * @return the meta object for the attribute 'Old Value'.
+ * @see com.specmate.model.history.Change#getOldValue()
+ * @see #getChange()
+ * @generated
+ */
+ EAttribute getChange_OldValue();
+
/**
* Returns the meta object for the attribute '{@link com.specmate.model.history.Change#getNewValue New Value}'.
*
@@ -418,6 +498,14 @@ interface Literals {
*/
EAttribute HISTORY_ENTRY__USER = eINSTANCE.getHistoryEntry_User();
+ /**
+ * The meta object literal for the 'Deleted Objects' attribute list feature.
+ *
+ *
+ * @generated
+ */
+ EAttribute HISTORY_ENTRY__DELETED_OBJECTS = eINSTANCE.getHistoryEntry_DeletedObjects();
+
/**
* The meta object literal for the 'Comment' attribute feature.
*
@@ -444,6 +532,30 @@ interface Literals {
*/
EClass CHANGE = eINSTANCE.getChange();
+ /**
+ * The meta object literal for the 'Object Name' attribute feature.
+ *
+ *
+ * @generated
+ */
+ EAttribute CHANGE__OBJECT_NAME = eINSTANCE.getChange_ObjectName();
+
+ /**
+ * The meta object literal for the 'Object Type' attribute feature.
+ *
+ *
+ * @generated
+ */
+ EAttribute CHANGE__OBJECT_TYPE = eINSTANCE.getChange_ObjectType();
+
+ /**
+ * The meta object literal for the 'Old Value' attribute feature.
+ *
+ *
+ * @generated
+ */
+ EAttribute CHANGE__OLD_VALUE = eINSTANCE.getChange_OldValue();
+
/**
* The meta object literal for the 'New Value' attribute feature.
*
diff --git a/bundles/specmate-model-gen/src/com/specmate/model/history/impl/ChangeImpl.java b/bundles/specmate-model-gen/src/com/specmate/model/history/impl/ChangeImpl.java
index ffd30bfca..452db6b49 100644
--- a/bundles/specmate-model-gen/src/com/specmate/model/history/impl/ChangeImpl.java
+++ b/bundles/specmate-model-gen/src/com/specmate/model/history/impl/ChangeImpl.java
@@ -17,6 +17,9 @@
* The following features are implemented:
*
*
@@ -130,6 +131,16 @@ public void setUser(String newUser) {
eDynamicSet(HistoryPackage.HISTORY_ENTRY__USER, HistoryPackage.Literals.HISTORY_ENTRY__USER, newUser);
}
+ /**
+ *
+ *
+ * @generated
+ */
+ @SuppressWarnings("unchecked")
+ public EList getDeletedObjects() {
+ return (EList)eDynamicGet(HistoryPackage.HISTORY_ENTRY__DELETED_OBJECTS, HistoryPackage.Literals.HISTORY_ENTRY__DELETED_OBJECTS, true, true);
+ }
+
/**
*
*
@@ -184,6 +195,8 @@ public Object eGet(int featureID, boolean resolve, boolean coreType) {
return getTimestamp();
case HistoryPackage.HISTORY_ENTRY__USER:
return getUser();
+ case HistoryPackage.HISTORY_ENTRY__DELETED_OBJECTS:
+ return getDeletedObjects();
case HistoryPackage.HISTORY_ENTRY__COMMENT:
return getComment();
case HistoryPackage.HISTORY_ENTRY__CHANGES:
@@ -207,6 +220,10 @@ public void eSet(int featureID, Object newValue) {
case HistoryPackage.HISTORY_ENTRY__USER:
setUser((String)newValue);
return;
+ case HistoryPackage.HISTORY_ENTRY__DELETED_OBJECTS:
+ getDeletedObjects().clear();
+ getDeletedObjects().addAll((Collection extends String>)newValue);
+ return;
case HistoryPackage.HISTORY_ENTRY__COMMENT:
setComment((String)newValue);
return;
@@ -232,6 +249,9 @@ public void eUnset(int featureID) {
case HistoryPackage.HISTORY_ENTRY__USER:
setUser(USER_EDEFAULT);
return;
+ case HistoryPackage.HISTORY_ENTRY__DELETED_OBJECTS:
+ getDeletedObjects().clear();
+ return;
case HistoryPackage.HISTORY_ENTRY__COMMENT:
setComment(COMMENT_EDEFAULT);
return;
@@ -254,6 +274,8 @@ public boolean eIsSet(int featureID) {
return getTimestamp() != TIMESTAMP_EDEFAULT;
case HistoryPackage.HISTORY_ENTRY__USER:
return USER_EDEFAULT == null ? getUser() != null : !USER_EDEFAULT.equals(getUser());
+ case HistoryPackage.HISTORY_ENTRY__DELETED_OBJECTS:
+ return !getDeletedObjects().isEmpty();
case HistoryPackage.HISTORY_ENTRY__COMMENT:
return COMMENT_EDEFAULT == null ? getComment() != null : !COMMENT_EDEFAULT.equals(getComment());
case HistoryPackage.HISTORY_ENTRY__CHANGES:
diff --git a/bundles/specmate-model-gen/src/com/specmate/model/history/impl/HistoryPackageImpl.java b/bundles/specmate-model-gen/src/com/specmate/model/history/impl/HistoryPackageImpl.java
index c215c65c2..8e104c351 100644
--- a/bundles/specmate-model-gen/src/com/specmate/model/history/impl/HistoryPackageImpl.java
+++ b/bundles/specmate-model-gen/src/com/specmate/model/history/impl/HistoryPackageImpl.java
@@ -196,17 +196,26 @@ public EAttribute getHistoryEntry_User() {
*
* @generated
*/
- public EAttribute getHistoryEntry_Comment() {
+ public EAttribute getHistoryEntry_DeletedObjects() {
return (EAttribute)historyEntryEClass.getEStructuralFeatures().get(2);
}
+ /**
+ *
+ *
+ * @generated
+ */
+ public EAttribute getHistoryEntry_Comment() {
+ return (EAttribute)historyEntryEClass.getEStructuralFeatures().get(3);
+ }
+
/**
*
*
* @generated
*/
public EReference getHistoryEntry_Changes() {
- return (EReference)historyEntryEClass.getEStructuralFeatures().get(3);
+ return (EReference)historyEntryEClass.getEStructuralFeatures().get(4);
}
/**
@@ -223,7 +232,7 @@ public EClass getChange() {
*
* @generated
*/
- public EAttribute getChange_NewValue() {
+ public EAttribute getChange_ObjectName() {
return (EAttribute)changeEClass.getEStructuralFeatures().get(0);
}
@@ -232,7 +241,7 @@ public EAttribute getChange_NewValue() {
*
* @generated
*/
- public EAttribute getChange_Feature() {
+ public EAttribute getChange_ObjectType() {
return (EAttribute)changeEClass.getEStructuralFeatures().get(1);
}
@@ -241,7 +250,7 @@ public EAttribute getChange_Feature() {
*
* @generated
*/
- public EAttribute getChange_IsCreate() {
+ public EAttribute getChange_OldValue() {
return (EAttribute)changeEClass.getEStructuralFeatures().get(2);
}
@@ -250,10 +259,37 @@ public EAttribute getChange_IsCreate() {
*
* @generated
*/
- public EAttribute getChange_IsDelete() {
+ public EAttribute getChange_NewValue() {
return (EAttribute)changeEClass.getEStructuralFeatures().get(3);
}
+ /**
+ *
+ *
+ * @generated
+ */
+ public EAttribute getChange_Feature() {
+ return (EAttribute)changeEClass.getEStructuralFeatures().get(4);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EAttribute getChange_IsCreate() {
+ return (EAttribute)changeEClass.getEStructuralFeatures().get(5);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EAttribute getChange_IsDelete() {
+ return (EAttribute)changeEClass.getEStructuralFeatures().get(6);
+ }
+
/**
*
*
@@ -288,10 +324,14 @@ public void createPackageContents() {
historyEntryEClass = createEClass(HISTORY_ENTRY);
createEAttribute(historyEntryEClass, HISTORY_ENTRY__TIMESTAMP);
createEAttribute(historyEntryEClass, HISTORY_ENTRY__USER);
+ createEAttribute(historyEntryEClass, HISTORY_ENTRY__DELETED_OBJECTS);
createEAttribute(historyEntryEClass, HISTORY_ENTRY__COMMENT);
createEReference(historyEntryEClass, HISTORY_ENTRY__CHANGES);
changeEClass = createEClass(CHANGE);
+ createEAttribute(changeEClass, CHANGE__OBJECT_NAME);
+ createEAttribute(changeEClass, CHANGE__OBJECT_TYPE);
+ createEAttribute(changeEClass, CHANGE__OLD_VALUE);
createEAttribute(changeEClass, CHANGE__NEW_VALUE);
createEAttribute(changeEClass, CHANGE__FEATURE);
createEAttribute(changeEClass, CHANGE__IS_CREATE);
@@ -334,10 +374,14 @@ public void initializePackageContents() {
initEClass(historyEntryEClass, HistoryEntry.class, "HistoryEntry", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEAttribute(getHistoryEntry_Timestamp(), ecorePackage.getELong(), "timestamp", null, 0, 1, HistoryEntry.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getHistoryEntry_User(), ecorePackage.getEString(), "user", null, 0, 1, HistoryEntry.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getHistoryEntry_DeletedObjects(), ecorePackage.getEString(), "deletedObjects", null, 0, -1, HistoryEntry.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getHistoryEntry_Comment(), ecorePackage.getEString(), "comment", null, 0, 1, HistoryEntry.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getHistoryEntry_Changes(), this.getChange(), null, "changes", null, 0, -1, HistoryEntry.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(changeEClass, Change.class, "Change", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEAttribute(getChange_ObjectName(), ecorePackage.getEString(), "objectName", null, 0, 1, Change.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getChange_ObjectType(), ecorePackage.getEString(), "objectType", "", 0, 1, Change.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getChange_OldValue(), ecorePackage.getEString(), "oldValue", null, 0, 1, Change.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getChange_NewValue(), ecorePackage.getEString(), "newValue", null, 0, 1, Change.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getChange_Feature(), ecorePackage.getEString(), "feature", null, 0, 1, Change.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getChange_IsCreate(), ecorePackage.getEBoolean(), "isCreate", null, 0, 1, Change.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
diff --git a/bundles/specmate-persistency-api/src/com/specmate/persistency/IChangeListener.java b/bundles/specmate-persistency-api/src/com/specmate/persistency/IChangeListener.java
index 16f12653a..af9b72362 100644
--- a/bundles/specmate-persistency-api/src/com/specmate/persistency/IChangeListener.java
+++ b/bundles/specmate-persistency-api/src/com/specmate/persistency/IChangeListener.java
@@ -10,7 +10,7 @@
public interface IChangeListener {
void changedObject(EObject object, EStructuralFeature feature, EChangeKind changeKind, Object oldValue,
- Object newValue);
+ Object newValue, String objectClassName);
void removedObject(EObject object);
diff --git a/bundles/specmate-persistency-api/src/com/specmate/persistency/ITransaction.java b/bundles/specmate-persistency-api/src/com/specmate/persistency/ITransaction.java
index b5da06d77..208b73ddb 100644
--- a/bundles/specmate-persistency-api/src/com/specmate/persistency/ITransaction.java
+++ b/bundles/specmate-persistency-api/src/com/specmate/persistency/ITransaction.java
@@ -10,6 +10,18 @@
*
*/
public interface ITransaction extends IView {
+ /*
+ * A comment can consist of several records. Each record consists of one or more
+ * fields. Each field consists of one or more data items.
+ *
+ * Example with the following records (username;deleted objects;comment):
+ * michael;Model1|CEGModel,Library Folder|Folder;deleted empty models
+ */
+
+ public static final String COMMENT_FIELD_SEPARATOR = ",";
+ public static final String COMMENT_DATA_SEPARATOR = "|";
+ public static final String COMMENT_RECORD_SEPARATOR = ";";
+
/** Rolls back changes made in this transaction since the last commit */
public void rollback();
diff --git a/bundles/specmate-persistency-cdo/src/com/specmate/persistency/cdo/internal/CDOPersistencyService.java b/bundles/specmate-persistency-cdo/src/com/specmate/persistency/cdo/internal/CDOPersistencyService.java
index 7a583a679..817aa9c3c 100644
--- a/bundles/specmate-persistency-cdo/src/com/specmate/persistency/cdo/internal/CDOPersistencyService.java
+++ b/bundles/specmate-persistency-cdo/src/com/specmate/persistency/cdo/internal/CDOPersistencyService.java
@@ -367,8 +367,8 @@ protected void detachedObject(CDOID id, int version) {
@Override
public void changedObject(CDOID id, EStructuralFeature feature, EChangeKind changeKind, Object oldValue,
- Object newValue, int index) {
- postEvent(view, id, null, 0, Collections.singletonMap(feature, newValue), changeKind, index);
+ Object newValue, int index, String objectClassName) {
+ postEvent(view, id, objectClassName, 0, Collections.singletonMap(feature, newValue), changeKind, index);
}
};
processor.process();
diff --git a/bundles/specmate-persistency-cdo/src/com/specmate/persistency/cdo/internal/DeltaProcessor.java b/bundles/specmate-persistency-cdo/src/com/specmate/persistency/cdo/internal/DeltaProcessor.java
index 29c475afe..cab373d94 100644
--- a/bundles/specmate-persistency-cdo/src/com/specmate/persistency/cdo/internal/DeltaProcessor.java
+++ b/bundles/specmate-persistency-cdo/src/com/specmate/persistency/cdo/internal/DeltaProcessor.java
@@ -47,53 +47,55 @@ public void process() {
for (CDORevisionKey key : data.getChangedObjects()) {
if (key instanceof CDORevisionDelta) {
CDORevisionDelta delta = (CDORevisionDelta) key;
+ // System.out.println(delta.getEClass().getName());
for (CDOFeatureDelta fDelta : delta.getFeatureDeltas()) {
- processDelta(delta.getID(), fDelta);
+ processDelta(delta.getID(), fDelta, delta.getEClass().getName());
}
}
}
}
- private void processDelta(CDOID id, CDOFeatureDelta delta) {
+ private void processDelta(CDOID id, CDOFeatureDelta delta, String objectClassName) {
if (delta.getType().equals(Type.LIST)) {
CDOListFeatureDelta listDelta = (CDOListFeatureDelta) delta;
ArrayList deltas = new ArrayList<>(listDelta.getListChanges());
for (CDOFeatureDelta nestedDelta : deltas) {
- processDelta(id, nestedDelta);
+ processDelta(id, nestedDelta, objectClassName);
}
return;
}
- processBasicDelta(id, delta);
+ processBasicDelta(id, delta, objectClassName);
}
- private void processBasicDelta(CDOID id, CDOFeatureDelta delta) {
+ private void processBasicDelta(CDOID id, CDOFeatureDelta delta, String objectClassName) {
switch (delta.getType()) {
case SET:
CDOSetFeatureDelta setDelta = (CDOSetFeatureDelta) delta;
changedObject(id, setDelta.getFeature(), EChangeKind.SET, setDelta.getOldValue(), setDelta.getValue(),
- setDelta.getIndex());
+ setDelta.getIndex(), objectClassName);
break;
case ADD:
CDOAddFeatureDelta addDelta = (CDOAddFeatureDelta) delta;
- changedObject(id, addDelta.getFeature(), EChangeKind.ADD, null, addDelta.getValue(), addDelta.getIndex());
+ changedObject(id, addDelta.getFeature(), EChangeKind.ADD, null, addDelta.getValue(), addDelta.getIndex(),
+ objectClassName);
break;
case REMOVE:
CDORemoveFeatureDelta removeDelta = (CDORemoveFeatureDelta) delta;
changedObject(id, removeDelta.getFeature(), EChangeKind.REMOVE, removeDelta.getValue(), null,
- removeDelta.getIndex());
+ removeDelta.getIndex(), objectClassName);
break;
case CLEAR:
CDOClearFeatureDelta clearDelta = (CDOClearFeatureDelta) delta;
- changedObject(id, clearDelta.getFeature(), EChangeKind.CLEAR, null, null, 0);
+ changedObject(id, clearDelta.getFeature(), EChangeKind.CLEAR, null, null, 0, objectClassName);
break;
}
}
protected abstract void changedObject(CDOID id, EStructuralFeature feature, EChangeKind changeKind, Object oldValue,
- Object newValue, int index);
+ Object newValue, int index, String objectClassName);
protected abstract void newObject(CDOID id, String className, Map featureMap);
diff --git a/bundles/specmate-persistency-cdo/src/com/specmate/persistency/cdo/internal/HistoryProviderImpl.java b/bundles/specmate-persistency-cdo/src/com/specmate/persistency/cdo/internal/HistoryProviderImpl.java
index 61686a074..689e93b63 100644
--- a/bundles/specmate-persistency-cdo/src/com/specmate/persistency/cdo/internal/HistoryProviderImpl.java
+++ b/bundles/specmate-persistency-cdo/src/com/specmate/persistency/cdo/internal/HistoryProviderImpl.java
@@ -13,20 +13,28 @@
import org.eclipse.emf.common.util.ECollections;
import org.eclipse.emf.common.util.TreeIterator;
import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.osgi.service.component.annotations.Component;
+import org.osgi.service.component.annotations.Reference;
+import org.osgi.service.log.LogService;
import com.specmate.common.SpecmateException;
+import com.specmate.model.base.BasePackage;
+import com.specmate.model.base.INamed;
import com.specmate.model.history.Change;
import com.specmate.model.history.History;
import com.specmate.model.history.HistoryEntry;
import com.specmate.model.history.HistoryFactory;
+import com.specmate.model.requirements.RequirementsPackage;
import com.specmate.persistency.IHistoryProvider;
+import com.specmate.persistency.IPersistencyService;
+import com.specmate.persistency.ITransaction;
import com.specmate.persistency.event.EChangeKind;
@Component(immediate = true)
public class HistoryProviderImpl implements IHistoryProvider {
+ private IPersistencyService persistency;
+ private LogService logService;
@Override
public History getHistory(EObject object) throws SpecmateException {
@@ -94,9 +102,10 @@ private History processHistory(CDOObject cdoObject, History history) {
HistoryEntry historyEntry = HistoryFactory.eINSTANCE.createHistoryEntry();
fillHistoryEntry(cdoObject, cdoHistoryElement, historyEntry);
- if (!historyEntry.getChanges().isEmpty()) {
+ if (!historyEntry.getChanges().isEmpty() || !historyEntry.getDeletedObjects().isEmpty()) {
history.getEntries().add(historyEntry);
}
+
}
return history;
}
@@ -106,17 +115,17 @@ private void fillHistoryEntry(CDOObject cdoObject, CDOCommitInfo cdoHistoryEleme
deltaProcessor.process();
historyEntry.getChanges().addAll(deltaProcessor.getChanges());
historyEntry.setTimestamp(cdoHistoryElement.getTimeStamp());
- extractUserInfo(cdoHistoryElement, historyEntry);
+ extractCommentInfo(cdoHistoryElement, historyEntry);
}
- private void extractUserInfo(CDOCommitInfo cdoHistoryElement, HistoryEntry historyEntry) {
+ private void extractCommentInfo(CDOCommitInfo cdoHistoryElement, HistoryEntry historyEntry) {
String comment = cdoHistoryElement.getComment();
if (comment == null || comment.length() == 0) {
return;
}
- String[] info = comment.split(";", 2);
+ String[] info = comment.split(ITransaction.COMMENT_RECORD_SEPARATOR);
if (info.length == 0) {
return;
}
@@ -124,7 +133,14 @@ private void extractUserInfo(CDOCommitInfo cdoHistoryElement, HistoryEntry histo
historyEntry.setUser(info[0]);
if (info.length == 2) {
- historyEntry.setComment(info[1]);
+ String[] deletedObjects = info[1].split(ITransaction.COMMENT_FIELD_SEPARATOR);
+ for (int i = 0; i < deletedObjects.length; i++) {
+ historyEntry.getDeletedObjects().add(deletedObjects[i]);
+ }
+ }
+
+ if (info.length == 3) {
+ historyEntry.setComment(info[2]);
}
}
@@ -161,32 +177,32 @@ public List getChanges() {
@Override
protected void changedObject(CDOID id, EStructuralFeature feature, EChangeKind changeKind, Object oldValue,
- Object newValue, int index) {
+ Object newValue, int index, String objectClassName) {
if (!id.equals(this.cdoId)) {
return;
}
- Change change = HistoryFactory.eINSTANCE.createChange();
- change.setFeature(feature.getName());
+ if (showChange(feature, changeKind)) {
+ String objectName = getObjectName(id);
+ if (objectName != null) {
+ Change change = HistoryFactory.eINSTANCE.createChange();
- if (feature instanceof EReference) {
- EReference ref = (EReference) feature;
- if (ref.isContainment() && changeKind.equals(EChangeKind.REMOVE)) {
- change.setIsDelete(true);
- change.setNewValue(oldValue.toString());
- } else if (ref.isContainment() && changeKind.equals(EChangeKind.ADD)) {
- change.setIsCreate(true);
- change.setNewValue(newValue.toString());
- } else {
- return;
+ if (newValue != null) {
+ change.setNewValue(newValue.toString());
+ }
+ if (oldValue != null) {
+ // For some reason, when this is retrieved by CDO, the object has no type
+ // information and lands here as a plain object which we cannot read as a
+ // string. Hence, for now, the clients should ignore these values.
+ change.setOldValue(oldValue.toString());
+ }
+
+ change.setObjectType(objectClassName);
+ change.setFeature(feature.getName());
+ change.setObjectName(objectName);
+ changes.add(change);
}
}
-
- if (newValue != null) {
- change.setNewValue(newValue.toString());
- }
-
- changes.add(change);
}
@Override
@@ -196,12 +212,15 @@ protected void newObject(CDOID id, String className, Map {
- // we just create a new change if we also have something to display, i.e. value
- if (v != null && v instanceof String) {
+ // For now, we are only interested in seeing the new objects' name in the
+ // history
+ if (k.getName().equals(BasePackage.Literals.INAMED__NAME.getName())) {
Change change = HistoryFactory.eINSTANCE.createChange();
change.setIsCreate(true);
change.setFeature(k.getName());
+ change.setObjectType(className);
change.setNewValue((String) v);
+ change.setObjectName((String) v);
changes.add(change);
}
});
@@ -209,13 +228,50 @@ protected void newObject(CDOID id, String className, Map void commit(T object) throws SpecmateException {
throw new SpecmateException("Attempt to commit when in read-only mode");
}
try {
+ List detachedObjects;
try {
notifyListeners();
- List detachedObjects = transaction.getChangeSetData().getDetachedObjects();
+ detachedObjects = transaction.getChangeSetData().getDetachedObjects();
for (CDOIDAndVersion id : detachedObjects) {
SpecmateEcoreUtil.unsetAllReferences(transaction.getObject(id.getID()));
}
@@ -79,7 +82,7 @@ private void commit(T object) throws SpecmateException {
transaction.rollback();
throw (new SpecmateException("Error while preparing commit, transaction rolled back", s));
}
- extractAndSetMetadata(object);
+ setMetadata(object, detachedObjects);
transaction.commit();
} catch (CommitException e) {
transaction.rollback();
@@ -123,13 +126,52 @@ public boolean isDirty() {
return transaction.isDirty();
}
- private void extractAndSetMetadata(T object) {
+ private void setMetadata(T object, List detachedObjects) {
+ StringBuilder comment = new StringBuilder();
+
+ String userName = extractUserName(object);
+ if (userName != null) {
+ comment.append(userName);
+ comment.append(extractDeletedObjects(detachedObjects));
+ }
+
+ transaction.setCommitComment(comment.toString());
+ }
+
+ private String extractUserName(T object) {
+ String userName = null;
+
if (object instanceof RestResult>) {
- String userName = ((RestResult>) object).getUserName();
- if (userName != null) {
- transaction.setCommitComment(userName);
+ userName = ((RestResult>) object).getUserName();
+ }
+
+ return userName;
+ }
+
+ private String extractDeletedObjects(List detachedObjects) {
+ StringBuilder names = new StringBuilder();
+
+ if (detachedObjects.size() > 0) {
+ names.append(COMMENT_RECORD_SEPARATOR);
+ boolean addDataSeparator = false;
+ for (CDOIDAndVersion cdoidv : detachedObjects) {
+ CDOObject obj = transaction.getObject(cdoidv.getID());
+ if (obj instanceof ISpecmateModelObject || obj instanceof com.specmate.model.processes.Process) {
+ INamed named = (INamed) obj;
+ if (addDataSeparator) {
+ names.append(COMMENT_FIELD_SEPARATOR);
+ }
+
+ names.append(named.getName());
+ names.append(COMMENT_DATA_SEPARATOR);
+ names.append(named.eClass().getName());
+ addDataSeparator = true;
+ }
}
}
+
+ names.append(COMMENT_RECORD_SEPARATOR);
+ return names.toString();
}
private void notifyListeners() throws SpecmateException {
@@ -155,12 +197,13 @@ protected void detachedObject(CDOID id, int version) {
@Override
public void changedObject(CDOID id, EStructuralFeature feature, EChangeKind changeKind, Object oldValue,
- Object newValue, int index) {
+ Object newValue, int index, String objectClassName) {
for (IChangeListener listener : changeListeners) {
if (newValue instanceof CDOID) {
newValue = transaction.getObject((CDOID) newValue);
}
- listener.changedObject(transaction.getObject(id), feature, changeKind, oldValue, newValue);
+ listener.changedObject(transaction.getObject(id), feature, changeKind, oldValue, newValue,
+ objectClassName);
}
}
diff --git a/web/src/app/model/Change.ts b/web/src/app/model/Change.ts
index 49ba28f46..b5d211533 100644
--- a/web/src/app/model/Change.ts
+++ b/web/src/app/model/Change.ts
@@ -10,6 +10,9 @@
public static className: string = "Change";
// Attributes
+ public objectName: EString;
+ public objectType: EString;
+ public oldValue: EString;
public newValue: EString;
public feature: EString;
public isCreate: EBoolean;
diff --git a/web/src/app/model/HistoryEntry.ts b/web/src/app/model/HistoryEntry.ts
index f1534da26..5a2850add 100644
--- a/web/src/app/model/HistoryEntry.ts
+++ b/web/src/app/model/HistoryEntry.ts
@@ -13,10 +13,11 @@
// Attributes
public timestamp: ELong;
public user: EString;
+ public deletedObjects: EString[];
public comment: EString;
// References
-
+
// Containment
public changes: Change[];
diff --git a/web/src/app/modules/actions/modules/common-controls/components/common-controls.component.ts b/web/src/app/modules/actions/modules/common-controls/components/common-controls.component.ts
index f59c11d99..a6348f17e 100644
--- a/web/src/app/modules/actions/modules/common-controls/components/common-controls.component.ts
+++ b/web/src/app/modules/actions/modules/common-controls/components/common-controls.component.ts
@@ -1,11 +1,7 @@
-import { Location } from '@angular/common';
-import { Component, Input, OnInit } from '@angular/core';
+import { Component } from '@angular/core';
import { SpecmateDataService } from '../../../../data/modules/data-service/services/specmate-data.service';
-import { ConfirmationModal } from '../../../../notification/modules/modals/services/confirmation-modal.service';
import { NavigatorService } from '../../../../navigation/modules/navigator/services/navigator.service';
-import { Config } from '../../../../../config/config';
import { ValidationService } from '../../../../forms/modules/validation/services/validation.service';
-import { IContainer } from '../../../../../model/IContainer';
import { TranslateService } from '@ngx-translate/core';
import { ServerConnectionService } from '../../../../common/modules/connection/services/server-connection-service';
diff --git a/web/src/app/modules/forms/modules/generic-form/components/form-checkbox-input.component.html b/web/src/app/modules/forms/modules/generic-form/components/form-checkbox-input.component.html
index 57f9269ba..f531c1889 100644
--- a/web/src/app/modules/forms/modules/generic-form/components/form-checkbox-input.component.html
+++ b/web/src/app/modules/forms/modules/generic-form/components/form-checkbox-input.component.html
@@ -1,10 +1,10 @@
{{errorMessage}}{{meta.longDesc}}
-
\ No newline at end of file
+
diff --git a/web/src/app/modules/forms/modules/generic-form/components/form-long-text-input.component.html b/web/src/app/modules/forms/modules/generic-form/components/form-long-text-input.component.html
index 4f8f34d5c..74a99ae8b 100644
--- a/web/src/app/modules/forms/modules/generic-form/components/form-long-text-input.component.html
+++ b/web/src/app/modules/forms/modules/generic-form/components/form-long-text-input.component.html
@@ -1,8 +1,8 @@
-
+
{{errorMessage}}{{meta.longDesc}}
-
\ No newline at end of file
+
diff --git a/web/src/app/modules/forms/modules/generic-form/components/form-single-selection-input.component.html b/web/src/app/modules/forms/modules/generic-form/components/form-single-selection-input.component.html
index c9dea9cfc..fcdaa2b98 100644
--- a/web/src/app/modules/forms/modules/generic-form/components/form-single-selection-input.component.html
+++ b/web/src/app/modules/forms/modules/generic-form/components/form-single-selection-input.component.html
@@ -1,5 +1,5 @@
-
\ No newline at end of file
+
diff --git a/web/src/app/modules/forms/modules/generic-form/components/form-text-input.component.html b/web/src/app/modules/forms/modules/generic-form/components/form-text-input.component.html
index 261985d44..b29f2c648 100644
--- a/web/src/app/modules/forms/modules/generic-form/components/form-text-input.component.html
+++ b/web/src/app/modules/forms/modules/generic-form/components/form-text-input.component.html
@@ -1,5 +1,5 @@