Skip to content

Commit

Permalink
Merge pull request #769 from eclipse-passage/572650-4
Browse files Browse the repository at this point in the history
Bug 572650 upgrade `licenses` domain model
  • Loading branch information
eparovyshnaya authored May 11, 2021
2 parents 9cb1bc8 + f810288 commit 06fd54a
Show file tree
Hide file tree
Showing 15 changed files with 47 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ _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 = Product Reference
_UI_ProductRef_type_detailed = Product {0} version {1}
_UI_FloatingServer_type = Floating Server
_UI_UserGrant_type = User Grant
Expand Down
2 changes: 1 addition & 1 deletion bundles/org.eclipse.passage.lic.licenses.edit/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<extension point="org.eclipse.emf.edit.itemProviderAdapterFactories">
<!-- @generated licenses. -->
<factory
uri="http://www.eclipse.org/passage/lic/licenses/1.1.0"
uri="http://www.eclipse.org/passage/lic/licenses/2.0.0"
class="org.eclipse.passage.lic.licenses.edit.providers.LicensesItemProviderAdapterFactory"
supportedTypes=
"org.eclipse.emf.edit.provider.IEditingDomainItemProvider
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,9 @@ public EditingDomain getEditingDomain() {

public ServiceInvocationResult<Boolean> loadSource(String source) {
URI uri = createURI(source);
ResourceSet resourceSet = editingDomain.getResourceSet();
Resource resource = resourceSet.createResource(uri);
ResourceSet set = editingDomain.getResourceSet();
Resource resource = createResource(uri);
set.getResources().add(resource);
try {
resource.load(getLoadOptions());
return new BaseServiceInvocationResult<>(true);
Expand All @@ -124,6 +125,8 @@ public ServiceInvocationResult<Boolean> loadSource(String source) {
}
}

protected abstract Resource createResource(URI uri);

public void unloadSource(String source) {
URI uri = createURI(source);
ResourceSet resourceSet = editingDomain.getResourceSet();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Manifest-Version: 1.0
Automatic-Module-Name: org.eclipse.passage.loc.features.core
Bundle-ManifestVersion: 2
Bundle-SymbolicName: org.eclipse.passage.loc.features.core
Bundle-Version: 1.0.0.qualifier
Bundle-Version: 2.0.0.qualifier
Bundle-Name: %Bundle-Name
Bundle-Vendor: %Bundle-Vendor
Bundle-Copyright: %Bundle-Copyright
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,16 @@
import java.util.Map;

import org.eclipse.core.runtime.Platform;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.osgi.util.NLS;
import org.eclipse.passage.lic.features.FeatureDescriptor;
import org.eclipse.passage.lic.features.FeatureSetDescriptor;
import org.eclipse.passage.lic.features.FeatureVersionDescriptor;
import org.eclipse.passage.lic.features.model.meta.FeaturesPackage;
import org.eclipse.passage.lic.features.model.util.FeaturesResourceImpl;
import org.eclipse.passage.lic.internal.equinox.events.EquinoxEvent;
import org.eclipse.passage.lic.internal.equinox.io.InstallationPath;
import org.eclipse.passage.loc.internal.emf.BaseDomainRegistry;
Expand Down Expand Up @@ -278,4 +281,9 @@ protected Path getResourceSetPath() throws Exception {
return passagePath.resolve(domainName);
}

@Override
protected final Resource createResource(URI uri) {
return new FeaturesResourceImpl(uri);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Manifest-Version: 1.0
Automatic-Module-Name: org.eclipse.passage.loc.licenses.core
Bundle-ManifestVersion: 2
Bundle-SymbolicName: org.eclipse.passage.loc.licenses.core
Bundle-Version: 0.6.103.qualifier
Bundle-Version: 2.0.0.qualifier
Bundle-Name: %Bundle-Name
Bundle-Vendor: %Bundle-Vendor
Bundle-Copyright: %Bundle-Copyright
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,16 @@
import java.util.Map;

import org.eclipse.core.runtime.Platform;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.osgi.util.NLS;
import org.eclipse.passage.lic.internal.equinox.events.EquinoxEvent;
import org.eclipse.passage.lic.internal.equinox.io.InstallationPath;
import org.eclipse.passage.lic.licenses.LicensePlanDescriptor;
import org.eclipse.passage.lic.licenses.model.meta.LicensesPackage;
import org.eclipse.passage.lic.licenses.model.util.LicensesResourceImpl;
import org.eclipse.passage.loc.internal.emf.BaseDomainRegistry;
import org.eclipse.passage.loc.internal.emf.DomainContentAdapter;
import org.eclipse.passage.loc.internal.emf.EditingDomainRegistry;
Expand Down Expand Up @@ -152,4 +155,9 @@ protected Path getResourceSetPath() throws Exception {
return passagePath.resolve(domainName);
}

@Override
protected final Resource createResource(URI uri) {
return new LicensesResourceImpl(uri);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Manifest-Version: 1.0
Automatic-Module-Name: org.eclipse.passage.loc.products.core
Bundle-ManifestVersion: 2
Bundle-SymbolicName: org.eclipse.passage.loc.products.core
Bundle-Version: 0.6.300.qualifier
Bundle-Version: 2.0.0.qualifier
Bundle-Name: %Bundle-Name
Bundle-Vendor: %Bundle-Vendor
Bundle-Copyright: %Bundle-Copyright
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@
import java.util.Map;

import org.eclipse.core.runtime.Platform;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.osgi.util.NLS;
import org.eclipse.passage.lic.internal.equinox.events.EquinoxEvent;
import org.eclipse.passage.lic.internal.equinox.io.InstallationPath;
Expand All @@ -32,6 +34,7 @@
import org.eclipse.passage.lic.products.ProductVersionDescriptor;
import org.eclipse.passage.lic.products.ProductVersionFeatureDescriptor;
import org.eclipse.passage.lic.products.model.meta.ProductsPackage;
import org.eclipse.passage.lic.products.model.util.ProductsResourceImpl;
import org.eclipse.passage.loc.internal.emf.BaseDomainRegistry;
import org.eclipse.passage.loc.internal.emf.DomainContentAdapter;
import org.eclipse.passage.loc.internal.emf.EditingDomainRegistry;
Expand Down Expand Up @@ -338,4 +341,9 @@ protected Path getResourceSetPath() throws Exception {
return passagePath.resolve(domainName);
}

@Override
protected final Resource createResource(URI uri) {
return new ProductsResourceImpl(uri);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Manifest-Version: 1.0
Automatic-Module-Name: org.eclipse.passage.loc.users.core
Bundle-ManifestVersion: 2
Bundle-SymbolicName: org.eclipse.passage.loc.users.core
Bundle-Version: 1.0.100.qualifier
Bundle-Version: 2.0.0.qualifier
Bundle-Name: %Bundle-Name
Bundle-Vendor: %Bundle-Vendor
Bundle-Copyright: %Bundle-Copyright
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,18 @@
import java.util.Map;

import org.eclipse.core.runtime.Platform;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.osgi.util.NLS;
import org.eclipse.passage.lic.internal.equinox.events.EquinoxEvent;
import org.eclipse.passage.lic.internal.equinox.io.InstallationPath;
import org.eclipse.passage.lic.users.UserDescriptor;
import org.eclipse.passage.lic.users.UserLicenseDescriptor;
import org.eclipse.passage.lic.users.UserOriginDescriptor;
import org.eclipse.passage.lic.users.model.meta.UsersPackage;
import org.eclipse.passage.lic.users.model.util.UsersResourceImpl;
import org.eclipse.passage.loc.internal.emf.BaseDomainRegistry;
import org.eclipse.passage.loc.internal.emf.DomainContentAdapter;
import org.eclipse.passage.loc.internal.emf.EditingDomainRegistry;
Expand Down Expand Up @@ -217,4 +220,9 @@ protected Path getResourceSetPath() throws Exception {
return passagePath.resolve(domainName);
}

@Override
protected final Resource createResource(URI uri) {
return new UsersResourceImpl(uri);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<feature
id="org.eclipse.passage.loc.features.feature"
label="%featureName"
version="0.8.0.qualifier"
version="2.0.0.qualifier"
provider-name="%providerName"
license-feature="org.eclipse.license"
license-feature-version="0.0.0">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<feature
id="org.eclipse.passage.loc.licenses.feature"
label="%featureName"
version="0.7.102.qualifier"
version="2.0.0.qualifier"
provider-name="%providerName"
license-feature="org.eclipse.license"
license-feature-version="0.0.0">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<feature
id="org.eclipse.passage.loc.products.feature"
label="%featureName"
version="0.7.200.qualifier"
version="2.0.0.qualifier"
provider-name="%providerName"
license-feature="org.eclipse.license"
license-feature-version="0.0.0">
Expand Down
2 changes: 1 addition & 1 deletion features/org.eclipse.passage.loc.users.feature/feature.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<feature
id="org.eclipse.passage.loc.users.feature"
label="%featureName"
version="0.7.101.qualifier"
version="2.0.0.qualifier"
provider-name="%providerName"
license-feature="org.eclipse.license"
license-feature-version="0.0.0">
Expand Down

0 comments on commit 06fd54a

Please sign in to comment.