diff --git a/plugins/org.obeonetwork.m2doc.genconf.editor/src/org/obeonetwork/m2doc/genconf/editor/wizard/GenerationFileNamesPage.java b/plugins/org.obeonetwork.m2doc.genconf.editor/src/org/obeonetwork/m2doc/genconf/editor/wizard/GenerationFileNamesPage.java index a819d8a0d..6a3797c3c 100644 --- a/plugins/org.obeonetwork.m2doc.genconf.editor/src/org/obeonetwork/m2doc/genconf/editor/wizard/GenerationFileNamesPage.java +++ b/plugins/org.obeonetwork.m2doc.genconf.editor/src/org/obeonetwork/m2doc/genconf/editor/wizard/GenerationFileNamesPage.java @@ -21,6 +21,7 @@ import org.eclipse.emf.common.util.URI; import org.eclipse.emf.ecore.EcorePackage; import org.eclipse.emf.ecore.impl.EStringToStringMapEntryImpl; +import org.eclipse.emf.ecore.resource.Resource; import org.eclipse.emf.ecore.resource.ResourceSet; import org.eclipse.emf.ecore.resource.URIConverter; import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl; @@ -537,6 +538,9 @@ private TemplateCustomProperties validatePage(final Generation gen, URI template final ResourceSetImpl defaultResourceSet = new ResourceSetImpl(); defaultResourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put("*", new XMIResourceFactoryImpl()); + defaultResourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap() + .putAll(Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap()); + final ResourceSet resourceSetForModel = M2DocUtils.createResourceSetForModels( new ArrayList(), queryEnvironment, defaultResourceSet, GenconfUtils.getOptions(gen)); diff --git a/plugins/org.obeonetwork.m2doc.genconf.editor/src/org/obeonetwork/m2doc/genconf/editor/wizard/NewGenerationWizard.java b/plugins/org.obeonetwork.m2doc.genconf.editor/src/org/obeonetwork/m2doc/genconf/editor/wizard/NewGenerationWizard.java index 8eefa152c..0136cb789 100644 --- a/plugins/org.obeonetwork.m2doc.genconf.editor/src/org/obeonetwork/m2doc/genconf/editor/wizard/NewGenerationWizard.java +++ b/plugins/org.obeonetwork.m2doc.genconf.editor/src/org/obeonetwork/m2doc/genconf/editor/wizard/NewGenerationWizard.java @@ -1,3 +1,14 @@ +/******************************************************************************* + * Copyright (c) 2018, 2023 Obeo. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v2.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v20.html + * + * Contributors: + * Obeo - initial API and implementation + * + *******************************************************************************/ package org.obeonetwork.m2doc.genconf.editor.wizard; import java.io.IOException; @@ -216,6 +227,9 @@ private void initializeVariableDefinition(Generation gen) { final ResourceSetImpl defaultResourceSet = new ResourceSetImpl(); defaultResourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put("*", new XMIResourceFactoryImpl()); + defaultResourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap() + .putAll(Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap()); + final ResourceSet resourceSetForModel = M2DocUtils.createResourceSetForModels(new ArrayList(), queryEnvironment, defaultResourceSet, GenconfUtils.getOptions(gen)); final List newDefinitions = GenconfUtils.getNewDefinitions(gen, properties); diff --git a/plugins/org.obeonetwork.m2doc.genconf.editor/src/org/obeonetwork/m2doc/genconf/editor/wizard/VariableAndOptionPage.java b/plugins/org.obeonetwork.m2doc.genconf.editor/src/org/obeonetwork/m2doc/genconf/editor/wizard/VariableAndOptionPage.java index 62ade2252..fed55b6d5 100644 --- a/plugins/org.obeonetwork.m2doc.genconf.editor/src/org/obeonetwork/m2doc/genconf/editor/wizard/VariableAndOptionPage.java +++ b/plugins/org.obeonetwork.m2doc.genconf.editor/src/org/obeonetwork/m2doc/genconf/editor/wizard/VariableAndOptionPage.java @@ -22,6 +22,7 @@ import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.ecore.EcorePackage; import org.eclipse.emf.ecore.impl.EStringToStringMapEntryImpl; +import org.eclipse.emf.ecore.resource.Resource; import org.eclipse.emf.ecore.resource.ResourceSet; import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl; import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl; @@ -655,6 +656,8 @@ private void updateEditingDomain(Generation gen) { final ResourceSetImpl defaultResourceSet = new ResourceSetImpl(); defaultResourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put("*", new XMIResourceFactoryImpl()); + defaultResourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap() + .putAll(Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap()); if (editingDomain != null) { M2DocUtils.cleanResourceSetForModels(queryEnvironment, editingDomain.getResourceSet());