Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug 572650 upgrade licenses domain model #731

Merged
merged 3 commits into from
Apr 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions bundles/org.eclipse.passage.lbc.base/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ Require-Bundle: org.eclipse.osgi;bundle-version="0.0.0",
org.eclipse.passage.lic.net;bundle-version="0.0.0",
org.eclipse.passage.lic.licenses.model;bundle-version="0.0.0",
org.eclipse.emf.ecore.xmi;bundle-version="0.0.0",
org.eclipse.passage.lic.emf;bundle-version="1.0.100",
org.eclipse.passage.lic.oshi;bundle-version="1.0.1",
org.eclipse.passage.lic.emf;bundle-version="0.0.0",
org.eclipse.passage.lic.oshi;bundle-version="0.0.0",
org.apache.logging.log4j;bundle-version="2.8.2",
org.eclipse.passage.lic.equinox;bundle-version="1.0.201"
org.eclipse.passage.lic.equinox;bundle-version="0.0.0"
Export-Package: org.eclipse.passage.lbc.internal.base;x-friends:="org.eclipse.passage.lbc.jetty,org.eclipse.passage.lbc.base.tests,org.eclipse.passage.lic.hc.tests",
org.eclipse.passage.lbc.internal.base.acquire;x-friends:="org.eclipse.passage.lbc.base.tests,org.eclipse.passage.lic.hc.tests",
org.eclipse.passage.lbc.internal.base.api;x-internal:=true,
Expand Down
10 changes: 5 additions & 5 deletions bundles/org.eclipse.passage.lic.hc/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ Require-Bundle: org.apache.httpcomponents.httpcore;bundle-version="0.0.0",
org.eclipse.emf.ecore.xmi;bundle-version="0.0.0",
org.eclipse.osgi;bundle-version="0.0.0",
org.eclipse.osgi.services;bundle-version="0.0.0",
org.eclipse.passage.lic.api;bundle-version="1.0.201",
org.eclipse.passage.lic.base;bundle-version="1.0.0",
org.eclipse.passage.lic.emf;bundle-version="1.0.100",
org.eclipse.passage.lic.equinox;bundle-version="1.0.0",
org.eclipse.passage.lic.api;bundle-version="0.0.0",
org.eclipse.passage.lic.base;bundle-version="0.0.0",
org.eclipse.passage.lic.emf;bundle-version="0.0.0",
org.eclipse.passage.lic.equinox;bundle-version="0.0.0",
org.eclipse.passage.lic.net;bundle-version="0.0.0",
org.eclipse.passage.lic.licenses.model;bundle-version="1.1.0"
org.eclipse.passage.lic.licenses.model;bundle-version="0.0.0"
Export-Package: org.eclipse.passage.lic.internal.hc.remote;x-internal:=true,
org.eclipse.passage.lic.internal.hc.remote.impl;x-internal:=true,
org.eclipse.passage.lic.internal.hc.remote.impl.acquire;x-internal:=true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,27 +75,32 @@
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="FloatingLicensePack">
<eStructuralFeatures xsi:type="ecore:EReference" name="license" lowerBound="1"
eType="#//LicenseRequisites" containment="true"/>
eType="#//FloatingLicenseRequisites" containment="true"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="host" lowerBound="1" eType="#//FloatingServer"
containment="true"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="users" lowerBound="1" upperBound="-1"
eType="#//UserGrant" containment="true"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="features" lowerBound="1"
upperBound="-1" eType="#//FeatureGrant" containment="true" eOpposite="#//FeatureGrant/pack"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="LicenseRequisites">
<eClassifiers xsi:type="ecore:EClass" name="LicenseRequisites" abstract="true">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="identifier" lowerBound="1"
eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString" iD="true"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="issueDate" lowerBound="1"
eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EDate"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="company" lowerBound="1"
eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="plan" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="product" lowerBound="1"
eType="#//ProductRef" containment="true"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="valid" lowerBound="1" eType="#//ValidityPeriod"
containment="true"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="PersonalLicenseRequisites" eSuperTypes="#//LicenseRequisites">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="user" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="FloatingLicenseRequisites" eSuperTypes="#//LicenseRequisites">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="company" lowerBound="1"
eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="ProductRef" eSuperTypes="#//ProductRefDescriptor">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="product" lowerBound="1"
eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<component id="org.eclipse.passage.lic.licenses.edit" version="2">
<resource path="META-INF/MANIFEST.MF">
<filter id="929038356">
<filter id="927989779">
<message_arguments>
<message_argument value="1.0.201"/>
<message_argument value="org.eclipse.passage.lic.licenses.model"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Bundle-Copyright: %Bundle-Copyright
Bundle-Localization: plugin
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Require-Bundle: org.eclipse.core.runtime;bundle-version="0.0.0";x-installation:=greedy;resolution:=optional,
org.eclipse.passage.lic.licenses.model;bundle-version="1.1.0";visibility:=reexport,
org.eclipse.passage.lic.licenses.model;bundle-version="0.0.0";visibility:=reexport,
org.eclipse.emf.edit;bundle-version="0.0.0";visibility:=reexport
Import-Package: org.osgi.framework
Export-Package: org.eclipse.passage.lic.licenses.edit;x-internal:=true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,3 +135,8 @@ _UI_GrantAcqisition_feature_feature = Feature
_UI_GrantAcqisition_grant_feature = Grant
_UI_GrantAcqisition_user_feature = User
_UI_GrantAcqisition_created_feature = Created
_UI_ProductRefDescriptor_type = Product Ref Descriptor
_UI_PersonalLicenseRequisites_type = Personal License Requisites
_UI_FloatingLicenseRequisites_type = Floating License Requisites
_UI_PersonalLicenseRequisites_user_feature = User
_UI_FloatingLicenseRequisites_company_feature = Company
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,6 @@ public String getText(Object object) {
period.from(), period.until(), grant.getVivid() });
}


/**
* This handles model notifications by calling {@link #updateChildren} to update any cached
* children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors
super.collectNewChildDescriptors(newChildDescriptors, object);

newChildDescriptors.add(createChildParameter(LicensesPackage.eINSTANCE.getFloatingLicensePack_License(),
LicensesFactory.eINSTANCE.createLicenseRequisites()));
LicensesFactory.eINSTANCE.createFloatingLicenseRequisites()));

newChildDescriptors.add(createChildParameter(LicensesPackage.eINSTANCE.getFloatingLicensePack_Host(),
LicensesFactory.eINSTANCE.createFloatingServer()));
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
/*******************************************************************************
* Copyright (c) 2018, 2021 ArSysOp
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* https://www.eclipse.org/legal/epl-2.0/.
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* ArSysOp - initial API and implementation
*******************************************************************************/
package org.eclipse.passage.lic.licenses.edit.providers;

import java.util.Collection;
import java.util.List;
import java.util.Optional;

import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
import org.eclipse.emf.edit.provider.ViewerNotification;
import org.eclipse.passage.lic.licenses.model.api.FloatingLicenseRequisites;
import org.eclipse.passage.lic.licenses.model.api.ProductRef;
import org.eclipse.passage.lic.licenses.model.meta.LicensesPackage;

/**
* This is the item provider adapter for a {@link org.eclipse.passage.lic.licenses.model.api.FloatingLicenseRequisites} object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public class FloatingLicenseRequisitesItemProvider extends LicenseRequisitesItemProvider {
/**
* This constructs an instance from a factory and a notifier.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public FloatingLicenseRequisitesItemProvider(AdapterFactory adapterFactory) {
super(adapterFactory);
}

/**
* This returns the property descriptors for the adapted class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
if (itemPropertyDescriptors == null) {
super.getPropertyDescriptors(object);

addCompanyPropertyDescriptor(object);
}
return itemPropertyDescriptors;
}

/**
* This adds a property descriptor for the Company feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addCompanyPropertyDescriptor(Object object) {
itemPropertyDescriptors
.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
getResourceLocator(), getString("_UI_FloatingLicenseRequisites_company_feature"), //$NON-NLS-1$
getString("_UI_PropertyDescriptor_description", "_UI_FloatingLicenseRequisites_company_feature", //$NON-NLS-1$//$NON-NLS-2$
"_UI_FloatingLicenseRequisites_type"), //$NON-NLS-1$
LicensesPackage.eINSTANCE.getFloatingLicenseRequisites_Company(), true, false, false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
}

/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected boolean shouldComposeCreationImage() {
return true;
}

/**
* This returns the label text for the adapted class. <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated NOT
*/
@Override
public String getText(Object object) {
FloatingLicenseRequisites license = (FloatingLicenseRequisites) object;
String company = license.getCompany() == null ? "unknown" : license.getCompany(); //$NON-NLS-1$
String product = Optional.ofNullable(license.getProduct())//
.map(ProductRef::getProduct) //
.orElse("unknown"); //$NON-NLS-1$
String version = Optional.ofNullable(license.getProduct())//
.map(ProductRef::getVersion) //
.orElse("unknown"); //$NON-NLS-1$
return getString("_UI_LicenseRequisites_type_detailed", //$NON-NLS-1$
new Object[] { //
company, //
product, //
version });
}

/**
* This handles model notifications by calling {@link #updateChildren} to update any cached
* children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void notifyChanged(Notification notification) {
updateChildren(notification);

switch (notification.getFeatureID(FloatingLicenseRequisites.class)) {
case LicensesPackage.FLOATING_LICENSE_REQUISITES__COMPANY:
fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
return;
default:
super.notifyChanged(notification);
return;
}
}

/**
* This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
* that can be created under this object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
super.collectNewChildDescriptors(newChildDescriptors, object);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

import java.util.Collection;
import java.util.List;
import java.util.Optional;

import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.common.notify.Notification;
Expand All @@ -32,7 +31,6 @@
import org.eclipse.emf.edit.provider.ViewerNotification;
import org.eclipse.passage.lic.licenses.edit.LicensesEditPlugin;
import org.eclipse.passage.lic.licenses.model.api.LicenseRequisites;
import org.eclipse.passage.lic.licenses.model.api.ProductRef;
import org.eclipse.passage.lic.licenses.model.meta.LicensesFactory;
import org.eclipse.passage.lic.licenses.model.meta.LicensesPackage;

Expand Down Expand Up @@ -67,7 +65,6 @@ public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {

addIdentifierPropertyDescriptor(object);
addIssueDatePropertyDescriptor(object);
addCompanyPropertyDescriptor(object);
addPlanPropertyDescriptor(object);
}
return itemPropertyDescriptors;
Expand Down Expand Up @@ -105,22 +102,6 @@ protected void addIssueDatePropertyDescriptor(Object object) {
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
}

/**
* This adds a property descriptor for the Company feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addCompanyPropertyDescriptor(Object object) {
itemPropertyDescriptors
.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
getResourceLocator(), getString("_UI_LicenseRequisites_company_feature"), //$NON-NLS-1$
getString("_UI_PropertyDescriptor_description", "_UI_LicenseRequisites_company_feature", //$NON-NLS-1$//$NON-NLS-2$
"_UI_LicenseRequisites_type"), //$NON-NLS-1$
LicensesPackage.eINSTANCE.getLicenseRequisites_Company(), true, false, false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
}

/**
* This adds a property descriptor for the Plan feature.
* <!-- begin-user-doc -->
Expand Down Expand Up @@ -190,29 +171,18 @@ protected boolean shouldComposeCreationImage() {
}

/**
* This returns the label text for the adapted class. <!-- begin-user-doc -->
* This returns the label text for the adapted class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated NOT
* @generated
*/
@Override
public String getText(Object object) {
LicenseRequisites license = (LicenseRequisites) object;
String company = license.getCompany() == null ? "unknown" : license.getCompany(); //$NON-NLS-1$
String product = Optional.ofNullable(license.getProduct())//
.map(ProductRef::getProduct) //
.orElse("unknown"); //$NON-NLS-1$
String version = Optional.ofNullable(license.getProduct())//
.map(ProductRef::getVersion) //
.orElse("unknown"); //$NON-NLS-1$
return getString("_UI_LicenseRequisites_type_detailed", //$NON-NLS-1$
new Object[] { //
company, //
product, //
version });
String label = ((LicenseRequisites) object).getIdentifier();
return label == null || label.length() == 0 ? getString("_UI_LicenseRequisites_type") : //$NON-NLS-1$
getString("_UI_LicenseRequisites_type") + " " + label; //$NON-NLS-1$ //$NON-NLS-2$
}


/**
* This handles model notifications by calling {@link #updateChildren} to update any cached
* children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
Expand All @@ -227,7 +197,6 @@ public void notifyChanged(Notification notification) {
switch (notification.getFeatureID(LicenseRequisites.class)) {
case LicensesPackage.LICENSE_REQUISITES__IDENTIFIER:
case LicensesPackage.LICENSE_REQUISITES__ISSUE_DATE:
case LicensesPackage.LICENSE_REQUISITES__COMPANY:
case LicensesPackage.LICENSE_REQUISITES__PLAN:
fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
return;
Expand Down
Loading