Skip to content

Commit

Permalink
Bug 572678 persist leased licenses under License Plan
Browse files Browse the repository at this point in the history
restore textual representation of floating subdomain entities


Signed-off-by: eparovyshnaya <[email protected]>
  • Loading branch information
eparovyshnaya committed Apr 8, 2021
1 parent ec8d468 commit 264f108
Show file tree
Hide file tree
Showing 19 changed files with 208 additions and 92 deletions.
1 change: 1 addition & 0 deletions bundles/org.eclipse.passage.lic.licenses.edit/.classpath
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src-gen"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>
Original file line number Diff line number Diff line change
Expand Up @@ -168,4 +168,13 @@
</message_arguments>
</filter>
</resource>
<resource path="src/org/eclipse/passage/lic/licenses/edit/ClosedPeriodPrinted.java" type="org.eclipse.passage.lic.licenses.edit.ClosedPeriodPrinted">
<filter id="643850349">
<message_arguments>
<message_argument value="ValidityPeriod"/>
<message_argument value="ClosedPeriodPrinted"/>
<message_argument value="ClosedPeriodPrinted(ValidityPeriod)"/>
</message_arguments>
</filter>
</resource>
</component>
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
# ArSysOp - initial API and implementation
###############################################################################

source.. = src-gen/
source.. = src-gen/,\
src/
output.. = bin/
bin.includes = .,\
icons/,\
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,20 @@ _UI_LicensePlanFeature_licensePlan_feature = License Plan
_UI_LicensePlan_text_pattern={1} ({0})
_UI_LicensePlanFeature_text_pattern={0} ({1})
_UI_FloatingLicensePack_type = Floating License Pack
_UI_LicenseRequisites_type_detailed = License issued for {0} over product {1} of version {2}
_UI_LicenseRequisites_type = License Requisites
_UI_ProductRef_type = Product Ref
_UI_ProductRef_type_detailed = Product {0} version {1}
_UI_FloatingServer_type = Floating Server
_UI_UserGrant_type = User Grant
_UI_UserGrant_type_detailed = User {0} authenticated by {1}: {2}
_UI_FeatureGrant_type = Feature Grant
_UI_FeatureGrant_type_detailed = Feature {0} {1} ({2}): {3} grants valid from {4} until {5} for {6} minutes
_UI_ValidityPeriod_type = Validity Period
_UI_ValidityPeriodClosed_type = Validity Period Closed
_UI_ValidityPeriodClosed_type_detailed=From {0} until {1}
_UI_EvaluationInstructions_type = Evaluation Instructions
_UI_EvaluationInstructions_type_detailed=Assess expression [{0}] by {1} environment
_UI_VersionMatch_type = Version Match
_UI_FloatingLicenseAccess_type = Floating License Access
_UI_FloatingServerConnection_type = Floating Server Connection
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@

import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.common.notify.Notification;

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

import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
import org.eclipse.emf.edit.provider.IItemLabelProvider;
Expand All @@ -30,11 +28,8 @@
import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
import org.eclipse.emf.edit.provider.ItemProviderAdapter;
import org.eclipse.emf.edit.provider.ViewerNotification;

import org.eclipse.passage.lic.licenses.edit.LicensesEditPlugin;

import org.eclipse.passage.lic.licenses.model.api.EvaluationInstructions;

import org.eclipse.passage.lic.licenses.model.meta.LicensesPackage;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,12 @@

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.common.util.ResourceLocator;

import org.eclipse.emf.ecore.EStructuralFeature;

import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
import org.eclipse.emf.edit.provider.IItemLabelProvider;
Expand All @@ -32,11 +30,11 @@
import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
import org.eclipse.emf.edit.provider.ItemProviderAdapter;
import org.eclipse.emf.edit.provider.ViewerNotification;

import org.eclipse.passage.lic.licenses.edit.ClosedPeriodPrinted;
import org.eclipse.passage.lic.licenses.edit.GetOrUnknown;
import org.eclipse.passage.lic.licenses.edit.LicensesEditPlugin;

import org.eclipse.passage.lic.licenses.model.api.FeatureGrant;

import org.eclipse.passage.lic.licenses.model.api.VersionMatch;
import org.eclipse.passage.lic.licenses.model.meta.LicensesFactory;
import org.eclipse.passage.lic.licenses.model.meta.LicensesPackage;

Expand Down Expand Up @@ -194,18 +192,25 @@ 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
*
* @generated NOT
*/
@Override
public String getText(Object object) {
String label = ((FeatureGrant) object).getIdentifier();
return label == null || label.length() == 0 ? getString("_UI_FeatureGrant_type") : //$NON-NLS-1$
getString("_UI_FeatureGrant_type") + " " + label; //$NON-NLS-1$ //$NON-NLS-2$
FeatureGrant grant = (FeatureGrant) object;
String feature = new GetOrUnknown(grant.getFeature()).get();
Optional<VersionMatch> match = Optional.of(grant.getVersion());
String version = match.map(VersionMatch::getVersion).orElse("unknown"); //$NON-NLS-1$
String rule = match.map(VersionMatch::getRule).orElse("unknown"); //$NON-NLS-1$
ClosedPeriodPrinted period = new ClosedPeriodPrinted(grant.getValid());
return getString("_UI_FeatureGrant_type_detailed", //$NON-NLS-1$
new Object[] { feature, version, rule, grant.getCapacity(), //
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 @@ -17,11 +17,8 @@

import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.common.notify.Notification;

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

import org.eclipse.emf.ecore.EStructuralFeature;

import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
import org.eclipse.emf.edit.provider.IItemLabelProvider;
Expand All @@ -32,11 +29,8 @@
import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
import org.eclipse.emf.edit.provider.ItemProviderAdapter;
import org.eclipse.emf.edit.provider.ViewerNotification;

import org.eclipse.passage.lic.licenses.edit.LicensesEditPlugin;

import org.eclipse.passage.lic.licenses.model.api.FloatingLicenseAccess;

import org.eclipse.passage.lic.licenses.model.meta.LicensesFactory;
import org.eclipse.passage.lic.licenses.model.meta.LicensesPackage;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,8 @@

import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.common.notify.Notification;

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

import org.eclipse.emf.ecore.EStructuralFeature;

import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
import org.eclipse.emf.edit.provider.IItemLabelProvider;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
Expand All @@ -30,11 +27,8 @@
import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
import org.eclipse.emf.edit.provider.ItemProviderAdapter;
import org.eclipse.emf.edit.provider.ViewerNotification;

import org.eclipse.passage.lic.licenses.edit.LicensesEditPlugin;

import org.eclipse.passage.lic.licenses.model.api.FloatingLicensePack;

import org.eclipse.passage.lic.licenses.model.meta.LicensesFactory;
import org.eclipse.passage.lic.licenses.model.meta.LicensesPackage;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,8 @@

import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.common.notify.Notification;

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

import org.eclipse.emf.ecore.EStructuralFeature;

import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
import org.eclipse.emf.edit.provider.IItemLabelProvider;
Expand All @@ -32,11 +29,8 @@
import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
import org.eclipse.emf.edit.provider.ItemProviderAdapter;
import org.eclipse.emf.edit.provider.ViewerNotification;

import org.eclipse.passage.lic.licenses.edit.LicensesEditPlugin;

import org.eclipse.passage.lic.licenses.model.api.FloatingServerConnection;

import org.eclipse.passage.lic.licenses.model.meta.LicensesFactory;
import org.eclipse.passage.lic.licenses.model.meta.LicensesPackage;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,8 @@

import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.common.notify.Notification;

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

import org.eclipse.emf.ecore.EStructuralFeature;

import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
import org.eclipse.emf.edit.provider.IItemLabelProvider;
Expand All @@ -32,11 +29,8 @@
import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
import org.eclipse.emf.edit.provider.ItemProviderAdapter;
import org.eclipse.emf.edit.provider.ViewerNotification;

import org.eclipse.passage.lic.licenses.edit.LicensesEditPlugin;

import org.eclipse.passage.lic.licenses.model.api.FloatingServer;

import org.eclipse.passage.lic.licenses.model.meta.LicensesFactory;
import org.eclipse.passage.lic.licenses.model.meta.LicensesPackage;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@

import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.common.notify.Notification;

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

import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
import org.eclipse.emf.edit.provider.IItemLabelProvider;
Expand All @@ -30,11 +28,8 @@
import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
import org.eclipse.emf.edit.provider.ItemProviderAdapter;
import org.eclipse.emf.edit.provider.ViewerNotification;

import org.eclipse.passage.lic.licenses.edit.LicensesEditPlugin;

import org.eclipse.passage.lic.licenses.model.api.GrantAcqisition;

import org.eclipse.passage.lic.licenses.model.meta.LicensesPackage;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,12 @@

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.common.util.ResourceLocator;

import org.eclipse.emf.ecore.EStructuralFeature;

import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
import org.eclipse.emf.edit.provider.IItemLabelProvider;
Expand All @@ -32,11 +30,9 @@
import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
import org.eclipse.emf.edit.provider.ItemProviderAdapter;
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 @@ -194,18 +190,29 @@ 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
*
* @generated NOT
*/
@Override
public String getText(Object object) {
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$
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 });
}


/**
* 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 @@ -17,9 +17,7 @@

import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.common.notify.Notification;

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

import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
import org.eclipse.emf.edit.provider.IItemLabelProvider;
Expand All @@ -30,11 +28,9 @@
import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
import org.eclipse.emf.edit.provider.ItemProviderAdapter;
import org.eclipse.emf.edit.provider.ViewerNotification;

import org.eclipse.passage.lic.licenses.edit.GetOrUnknown;
import org.eclipse.passage.lic.licenses.edit.LicensesEditPlugin;

import org.eclipse.passage.lic.licenses.model.api.ProductRef;

import org.eclipse.passage.lic.licenses.model.meta.LicensesPackage;

/**
Expand Down Expand Up @@ -126,16 +122,20 @@ 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
*
* @generated NOT
*/
@Override
public String getText(Object object) {
String label = ((ProductRef) object).getProduct();
return label == null || label.length() == 0 ? getString("_UI_ProductRef_type") : //$NON-NLS-1$
getString("_UI_ProductRef_type") + " " + label; //$NON-NLS-1$ //$NON-NLS-2$
ProductRef product = (ProductRef) object;
return getString("_UI_ProductRef_type_detailed", //$NON-NLS-1$
new Object[] { //
new GetOrUnknown(product.getProduct()).get(), //
new GetOrUnknown(product.getVersion()).get() //
});

}

/**
Expand Down
Loading

0 comments on commit 264f108

Please sign in to comment.