From eb7cd731f6d584468f60e5460465d4861c657e84 Mon Sep 17 00:00:00 2001 From: Elena Parovyshnaia Date: Sun, 15 Aug 2021 17:05:12 +0300 Subject: [PATCH 1/2] Bug 575166 License Agreement management: license issuing Roll back FeatureVersion.agreements reference addition. Product-related agreements cannot be associated with FeatureVersion in order to be implanted to an issued license: one of base Passage use cases is to update a separate feature (install newer version, probably with new set of Agreements) in scope of an old license (version range allows). It is decided to protect Requirement gathering with product-related agreements. Signed-off-by: eparovyshnaya --- .../model/features.ecore | 6 --- .../providers/FeatureVersionItemProvider.java | 19 -------- .../model/features.genmodel | 1 - .../features/model/api/FeatureVersion.java | 19 -------- .../model/impl/FeatureVersionImpl.java | 46 ------------------- .../model/impl/FeaturesPackageImpl.java | 15 ------ .../features/model/meta/FeaturesPackage.java | 24 +--------- .../util/FeaturesResourceFactoryImpl.java | 2 +- .../model/util/FeaturesResourceImpl.java | 2 +- .../features/FeatureVersionDescriptor.java | 7 --- 10 files changed, 3 insertions(+), 138 deletions(-) diff --git a/bundles/org.eclipse.passage.lic.features.ecore/model/features.ecore b/bundles/org.eclipse.passage.lic.features.ecore/model/features.ecore index 9e02ac5ca..25fe15145 100644 --- a/bundles/org.eclipse.passage.lic.features.ecore/model/features.ecore +++ b/bundles/org.eclipse.passage.lic.features.ecore/model/features.ecore @@ -33,11 +33,5 @@ - - -
- - diff --git a/bundles/org.eclipse.passage.lic.features.edit/src-gen/org/eclipse/passage/lic/features/edit/providers/FeatureVersionItemProvider.java b/bundles/org.eclipse.passage.lic.features.edit/src-gen/org/eclipse/passage/lic/features/edit/providers/FeatureVersionItemProvider.java index 668a486c6..db494fbcd 100644 --- a/bundles/org.eclipse.passage.lic.features.edit/src-gen/org/eclipse/passage/lic/features/edit/providers/FeatureVersionItemProvider.java +++ b/bundles/org.eclipse.passage.lic.features.edit/src-gen/org/eclipse/passage/lic/features/edit/providers/FeatureVersionItemProvider.java @@ -67,7 +67,6 @@ public List getPropertyDescriptors(Object object) { addVersionPropertyDescriptor(object); addNewsPropertyDescriptor(object); - addAgreementsPropertyDescriptor(object); } return itemPropertyDescriptors; } @@ -106,23 +105,6 @@ protected void addNewsPropertyDescriptor(Object object) { ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); } - /** - * This adds a property descriptor for the Agreements feature. - * - * - * @since 2.0 - * @generated - */ - protected void addAgreementsPropertyDescriptor(Object object) { - itemPropertyDescriptors - .add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), - getResourceLocator(), getString("_UI_FeatureVersion_agreements_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_FeatureVersion_agreements_feature", //$NON-NLS-1$//$NON-NLS-2$ - "_UI_FeatureVersion_type"), //$NON-NLS-1$ - FeaturesPackage.eINSTANCE.getFeatureVersion_Agreements(), true, false, false, - ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); - } - /** * This returns Feature.gif. * @@ -187,7 +169,6 @@ public void notifyChanged(Notification notification) { switch (notification.getFeatureID(FeatureVersion.class)) { case FeaturesPackage.FEATURE_VERSION__VERSION: case FeaturesPackage.FEATURE_VERSION__NEWS: - case FeaturesPackage.FEATURE_VERSION__AGREEMENTS: fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); return; default: diff --git a/bundles/org.eclipse.passage.lic.features.model/model/features.genmodel b/bundles/org.eclipse.passage.lic.features.model/model/features.genmodel index ac96aee34..ced5709bb 100644 --- a/bundles/org.eclipse.passage.lic.features.model/model/features.genmodel +++ b/bundles/org.eclipse.passage.lic.features.model/model/features.genmodel @@ -39,7 +39,6 @@ - diff --git a/bundles/org.eclipse.passage.lic.features.model/src-gen/org/eclipse/passage/lic/features/model/api/FeatureVersion.java b/bundles/org.eclipse.passage.lic.features.model/src-gen/org/eclipse/passage/lic/features/model/api/FeatureVersion.java index f284c23a7..a55fad3e2 100644 --- a/bundles/org.eclipse.passage.lic.features.model/src-gen/org/eclipse/passage/lic/features/model/api/FeatureVersion.java +++ b/bundles/org.eclipse.passage.lic.features.model/src-gen/org/eclipse/passage/lic/features/model/api/FeatureVersion.java @@ -12,8 +12,6 @@ *******************************************************************************/ package org.eclipse.passage.lic.features.model.api; -import org.eclipse.emf.common.util.EList; - import org.eclipse.emf.ecore.EObject; import org.eclipse.passage.lic.features.FeatureVersionDescriptor; @@ -30,7 +28,6 @@ *
  • {@link org.eclipse.passage.lic.features.model.api.FeatureVersion#getVersion Version}
  • *
  • {@link org.eclipse.passage.lic.features.model.api.FeatureVersion#getFeature Feature}
  • *
  • {@link org.eclipse.passage.lic.features.model.api.FeatureVersion#getNews News}
  • - *
  • {@link org.eclipse.passage.lic.features.model.api.FeatureVersion#getAgreements Agreements}
  • * * * @see org.eclipse.passage.lic.features.model.meta.FeaturesPackage#getFeatureVersion() @@ -109,20 +106,4 @@ public interface FeatureVersion extends EObject, FeatureVersionDescriptor { */ void setNews(String value); - /** - * Returns the value of the 'Agreements' attribute list. - * The list contents are of type {@link java.lang.String}. - * - * - * - * @since 2.0 - * - * @return the value of the 'Agreements' attribute list. - * @see org.eclipse.passage.lic.features.model.meta.FeaturesPackage#getFeatureVersion_Agreements() - * @model - * @generated - */ - @Override - EList getAgreements(); - } // FeatureVersion diff --git a/bundles/org.eclipse.passage.lic.features.model/src-gen/org/eclipse/passage/lic/features/model/impl/FeatureVersionImpl.java b/bundles/org.eclipse.passage.lic.features.model/src-gen/org/eclipse/passage/lic/features/model/impl/FeatureVersionImpl.java index 19a9effd6..5d93bbc39 100644 --- a/bundles/org.eclipse.passage.lic.features.model/src-gen/org/eclipse/passage/lic/features/model/impl/FeatureVersionImpl.java +++ b/bundles/org.eclipse.passage.lic.features.model/src-gen/org/eclipse/passage/lic/features/model/impl/FeatureVersionImpl.java @@ -12,21 +12,15 @@ *******************************************************************************/ package org.eclipse.passage.lic.features.model.impl; -import java.util.Collection; import java.util.Objects; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.common.notify.NotificationChain; - -import org.eclipse.emf.common.util.EList; - import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.impl.ENotificationImpl; import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; - -import org.eclipse.emf.ecore.util.EDataTypeUniqueEList; import org.eclipse.emf.ecore.util.EcoreUtil; import org.eclipse.passage.lic.features.model.api.Feature; @@ -45,7 +39,6 @@ *
  • {@link org.eclipse.passage.lic.features.model.impl.FeatureVersionImpl#getVersion Version}
  • *
  • {@link org.eclipse.passage.lic.features.model.impl.FeatureVersionImpl#getFeature Feature}
  • *
  • {@link org.eclipse.passage.lic.features.model.impl.FeatureVersionImpl#getNews News}
  • - *
  • {@link org.eclipse.passage.lic.features.model.impl.FeatureVersionImpl#getAgreements Agreements}
  • * * * @generated @@ -91,17 +84,6 @@ public class FeatureVersionImpl extends MinimalEObjectImpl.Container implements */ private String news = NEWS_EDEFAULT; - /** - * The cached value of the '{@link #getAgreements() Agreements}' attribute list. - * - * - * @see #getAgreements() - * @since 2.0 - * @generated - * @ordered - */ - protected EList agreements; - /** * * @@ -222,21 +204,6 @@ public void setNews(String newNews) { } } - /** - * - * - * @since 2.0 - * @generated - */ - @Override - public EList getAgreements() { - if (agreements == null) { - agreements = new EDataTypeUniqueEList(String.class, this, - FeaturesPackage.FEATURE_VERSION__AGREEMENTS); - } - return agreements; - } - /** * * @@ -300,8 +267,6 @@ public Object eGet(int featureID, boolean resolve, boolean coreType) { return getFeature(); case FeaturesPackage.FEATURE_VERSION__NEWS: return getNews(); - case FeaturesPackage.FEATURE_VERSION__AGREEMENTS: - return getAgreements(); default: return super.eGet(featureID, resolve, coreType); } @@ -325,10 +290,6 @@ public void eSet(int featureID, Object newValue) { case FeaturesPackage.FEATURE_VERSION__NEWS: setNews((String) newValue); return; - case FeaturesPackage.FEATURE_VERSION__AGREEMENTS: - getAgreements().clear(); - getAgreements().addAll((Collection) newValue); - return; default: super.eSet(featureID, newValue); return; @@ -352,9 +313,6 @@ public void eUnset(int featureID) { case FeaturesPackage.FEATURE_VERSION__NEWS: setNews(NEWS_EDEFAULT); return; - case FeaturesPackage.FEATURE_VERSION__AGREEMENTS: - getAgreements().clear(); - return; default: super.eUnset(featureID); return; @@ -375,8 +333,6 @@ public boolean eIsSet(int featureID) { return getFeature() != null; case FeaturesPackage.FEATURE_VERSION__NEWS: return !Objects.equals(NEWS_EDEFAULT, news); - case FeaturesPackage.FEATURE_VERSION__AGREEMENTS: - return agreements != null && !agreements.isEmpty(); default: return super.eIsSet(featureID); } @@ -397,8 +353,6 @@ public String toString() { result.append(version); result.append(", news: "); //$NON-NLS-1$ result.append(news); - result.append(", agreements: "); //$NON-NLS-1$ - result.append(agreements); result.append(')'); return result.toString(); } diff --git a/bundles/org.eclipse.passage.lic.features.model/src-gen/org/eclipse/passage/lic/features/model/impl/FeaturesPackageImpl.java b/bundles/org.eclipse.passage.lic.features.model/src-gen/org/eclipse/passage/lic/features/model/impl/FeaturesPackageImpl.java index 9b3d84085..45b3bf5b7 100644 --- a/bundles/org.eclipse.passage.lic.features.model/src-gen/org/eclipse/passage/lic/features/model/impl/FeaturesPackageImpl.java +++ b/bundles/org.eclipse.passage.lic.features.model/src-gen/org/eclipse/passage/lic/features/model/impl/FeaturesPackageImpl.java @@ -333,17 +333,6 @@ public EAttribute getFeatureVersion_News() { return (EAttribute) featureVersionEClass.getEStructuralFeatures().get(2); } - /** - * - * - * @since 2.0 - * @generated - */ - @Override - public EAttribute getFeatureVersion_Agreements() { - return (EAttribute) featureVersionEClass.getEStructuralFeatures().get(3); - } - /** * * @@ -398,7 +387,6 @@ public void createPackageContents() { createEAttribute(featureVersionEClass, FEATURE_VERSION__VERSION); createEReference(featureVersionEClass, FEATURE_VERSION__FEATURE); createEAttribute(featureVersionEClass, FEATURE_VERSION__NEWS); - createEAttribute(featureVersionEClass, FEATURE_VERSION__AGREEMENTS); } /** @@ -484,9 +472,6 @@ public void initializePackageContents() { !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute(getFeatureVersion_News(), ecorePackage.getEString(), "news", null, 0, 1, FeatureVersion.class, //$NON-NLS-1$ !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getFeatureVersion_Agreements(), ecorePackage.getEString(), "agreements", null, 0, -1, //$NON-NLS-1$ - FeatureVersion.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, - !IS_DERIVED, IS_ORDERED); // Create resource createResource(eNS_URI); diff --git a/bundles/org.eclipse.passage.lic.features.model/src-gen/org/eclipse/passage/lic/features/model/meta/FeaturesPackage.java b/bundles/org.eclipse.passage.lic.features.model/src-gen/org/eclipse/passage/lic/features/model/meta/FeaturesPackage.java index 44dae59be..e6303077e 100644 --- a/bundles/org.eclipse.passage.lic.features.model/src-gen/org/eclipse/passage/lic/features/model/meta/FeaturesPackage.java +++ b/bundles/org.eclipse.passage.lic.features.model/src-gen/org/eclipse/passage/lic/features/model/meta/FeaturesPackage.java @@ -333,16 +333,6 @@ public interface FeaturesPackage extends EPackage { */ int FEATURE_VERSION__NEWS = FEATURE_VERSION_DESCRIPTOR_FEATURE_COUNT + 2; - /** - * The feature id for the 'Agreements' attribute list. - * - * - * @since 2.0 - * @generated - * @ordered - */ - int FEATURE_VERSION__AGREEMENTS = FEATURE_VERSION_DESCRIPTOR_FEATURE_COUNT + 3; - /** * The number of structural features of the 'Feature Version' class. * @@ -350,7 +340,7 @@ public interface FeaturesPackage extends EPackage { * @generated * @ordered */ - int FEATURE_VERSION_FEATURE_COUNT = FEATURE_VERSION_DESCRIPTOR_FEATURE_COUNT + 4; + int FEATURE_VERSION_FEATURE_COUNT = FEATURE_VERSION_DESCRIPTOR_FEATURE_COUNT + 3; /** * The number of operations of the 'Feature Version' class. @@ -567,18 +557,6 @@ public interface FeaturesPackage extends EPackage { */ EAttribute getFeatureVersion_News(); - /** - * Returns the meta object for the attribute list '{@link org.eclipse.passage.lic.features.model.api.FeatureVersion#getAgreements Agreements}'. - * - * - * @return the meta object for the attribute list 'Agreements'. - * @see org.eclipse.passage.lic.features.model.api.FeatureVersion#getAgreements() - * @see #getFeatureVersion() - * @since 2.0 - * @generated - */ - EAttribute getFeatureVersion_Agreements(); - /** * Returns the factory that creates the instances of the model. * diff --git a/bundles/org.eclipse.passage.lic.features.model/src-gen/org/eclipse/passage/lic/features/model/util/FeaturesResourceFactoryImpl.java b/bundles/org.eclipse.passage.lic.features.model/src-gen/org/eclipse/passage/lic/features/model/util/FeaturesResourceFactoryImpl.java index 9d6fb8f3a..28e503798 100644 --- a/bundles/org.eclipse.passage.lic.features.model/src-gen/org/eclipse/passage/lic/features/model/util/FeaturesResourceFactoryImpl.java +++ b/bundles/org.eclipse.passage.lic.features.model/src-gen/org/eclipse/passage/lic/features/model/util/FeaturesResourceFactoryImpl.java @@ -22,7 +22,7 @@ * * @see org.eclipse.passage.lic.features.model.util.FeaturesResourceImpl * @generated NOT - * @since 1.1 + * @since 2.0 */ public class FeaturesResourceFactoryImpl extends ResourceFactoryImpl { /** diff --git a/bundles/org.eclipse.passage.lic.features.model/src-gen/org/eclipse/passage/lic/features/model/util/FeaturesResourceImpl.java b/bundles/org.eclipse.passage.lic.features.model/src-gen/org/eclipse/passage/lic/features/model/util/FeaturesResourceImpl.java index 7743576f3..1864ccc9b 100644 --- a/bundles/org.eclipse.passage.lic.features.model/src-gen/org/eclipse/passage/lic/features/model/util/FeaturesResourceImpl.java +++ b/bundles/org.eclipse.passage.lic.features.model/src-gen/org/eclipse/passage/lic/features/model/util/FeaturesResourceImpl.java @@ -24,7 +24,7 @@ * * @see org.eclipse.passage.lic.features.model.util.FeaturesResourceFactoryImpl * @generated NOT - * @since 1.1 + * @since 2.0 */ public class FeaturesResourceImpl extends XMIResourceImpl { /** diff --git a/bundles/org.eclipse.passage.lic.features/src/org/eclipse/passage/lic/features/FeatureVersionDescriptor.java b/bundles/org.eclipse.passage.lic.features/src/org/eclipse/passage/lic/features/FeatureVersionDescriptor.java index 803ebb865..382de8349 100644 --- a/bundles/org.eclipse.passage.lic.features/src/org/eclipse/passage/lic/features/FeatureVersionDescriptor.java +++ b/bundles/org.eclipse.passage.lic.features/src/org/eclipse/passage/lic/features/FeatureVersionDescriptor.java @@ -12,8 +12,6 @@ *******************************************************************************/ package org.eclipse.passage.lic.features; -import java.util.List; - /** *

    * The "Feature Version" is a state of your "Feature" @@ -43,9 +41,4 @@ public interface FeatureVersionDescriptor { FeatureDescriptor getFeature(); - /** - * @since 2.0 - */ - List getAgreements(); - } From 3327aa464603531fd463c8ec31211d13653fe63e Mon Sep 17 00:00:00 2001 From: Elena Parovyshnaia Date: Sun, 15 Aug 2021 17:14:44 +0300 Subject: [PATCH 2/2] Bug 575166 License Agreement management: license issuing Keep versions Signed-off-by: eparovyshnaya --- .../lic/features/model/util/FeaturesResourceFactoryImpl.java | 2 +- .../passage/lic/features/model/util/FeaturesResourceImpl.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bundles/org.eclipse.passage.lic.features.model/src-gen/org/eclipse/passage/lic/features/model/util/FeaturesResourceFactoryImpl.java b/bundles/org.eclipse.passage.lic.features.model/src-gen/org/eclipse/passage/lic/features/model/util/FeaturesResourceFactoryImpl.java index 28e503798..9d6fb8f3a 100644 --- a/bundles/org.eclipse.passage.lic.features.model/src-gen/org/eclipse/passage/lic/features/model/util/FeaturesResourceFactoryImpl.java +++ b/bundles/org.eclipse.passage.lic.features.model/src-gen/org/eclipse/passage/lic/features/model/util/FeaturesResourceFactoryImpl.java @@ -22,7 +22,7 @@ * * @see org.eclipse.passage.lic.features.model.util.FeaturesResourceImpl * @generated NOT - * @since 2.0 + * @since 1.1 */ public class FeaturesResourceFactoryImpl extends ResourceFactoryImpl { /** diff --git a/bundles/org.eclipse.passage.lic.features.model/src-gen/org/eclipse/passage/lic/features/model/util/FeaturesResourceImpl.java b/bundles/org.eclipse.passage.lic.features.model/src-gen/org/eclipse/passage/lic/features/model/util/FeaturesResourceImpl.java index 1864ccc9b..7743576f3 100644 --- a/bundles/org.eclipse.passage.lic.features.model/src-gen/org/eclipse/passage/lic/features/model/util/FeaturesResourceImpl.java +++ b/bundles/org.eclipse.passage.lic.features.model/src-gen/org/eclipse/passage/lic/features/model/util/FeaturesResourceImpl.java @@ -24,7 +24,7 @@ * * @see org.eclipse.passage.lic.features.model.util.FeaturesResourceFactoryImpl * @generated NOT - * @since 2.0 + * @since 1.1 */ public class FeaturesResourceImpl extends XMIResourceImpl { /**