Commit 5a0f067d authored by Dominique Marcadet's avatar Dominique Marcadet

Merge branch '30-update-metamodel-to-new-resource-resourceset-design' into 'master'

Resolve "update metamodel to new Resource/ResourceSet design"

Closes #30

See merge request RiseClipseGroup/RiseClipseMetamodel_SCL2003!25
parents cd89939b a9e38618
......@@ -47,6 +47,7 @@
<meta_model
name="IEC61850 SCL v2.1"
resourceFactory="fr.centralesupelec.edf.riseclipse.iec61850.scl.util.SclResourceFactoryImpl"
resourceSetFactory="fr.centralesupelec.edf.riseclipse.iec61850.scl.util.SclResourceSetFactory"
uri="http://www.iec.ch/61850/2003/SCL">
</meta_model>
</extension>
......
......@@ -55,7 +55,7 @@ public class SclResourceImpl extends XMLResourceImpl implements IRiseClipseResou
}
@Override
public void finalizeLoad( boolean ignore_unresolved_reference ) {
public void finalizeLoad( IRiseClipseConsole console ) {
if( getContents().size() > 0 ) {
ExplicitLinkResolver scl = ( ExplicitLinkResolver ) getContents().get( 0 );
scl.resolveLinks();
......
/**
* Copyright (c) 2019 CentraleSupélec & EDF.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* This file is part of the RiseClipse tool
*
* Contributors:
* Computer Science Department, CentraleSupélec
* EDF R&D
* Contacts:
* dominique.marcadet@centralesupelec.fr
* aurelie.dehouck-neveu@edf.fr
* Web site:
* http://wdi.supelec.fr/software/RiseClipse/
*
*/
package fr.centralesupelec.edf.riseclipse.iec61850.scl.util;
import fr.centralesupelec.edf.riseclipse.util.IRiseClipseConsole;
import fr.centralesupelec.edf.riseclipse.util.IRiseClipseResourceSet;
import fr.centralesupelec.edf.riseclipse.util.RiseClipseResourceSetFactory;
public class SclResourceSetFactory extends RiseClipseResourceSetFactory {
/* (non-Javadoc)
* @see fr.centralesupelec.edf.riseclipse.util.RiseClipseResourceSetFactory#createResourceSet()
*/
@Override
public IRiseClipseResourceSet createResourceSet( boolean strictContent, IRiseClipseConsole console ) {
// TODO Auto-generated method stub
return new SclResourceSetImpl( strictContent, console );
}
}
/**
* Copyright (c) 2019 CentraleSupélec & EDF.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* This file is part of the RiseClipse tool
*
* Contributors:
* Computer Science Department, CentraleSupélec
* EDF R&D
* Contacts:
* dominique.marcadet@centralesupelec.fr
* aurelie.dehouck-neveu@edf.fr
* Web site:
* http://wdi.supelec.fr/software/RiseClipse/
*
*/
package fr.centralesupelec.edf.riseclipse.iec61850.scl.util;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import org.eclipse.emf.ecore.resource.Resource;
import fr.centralesupelec.edf.riseclipse.iec61850.scl.SCL;
import fr.centralesupelec.edf.riseclipse.util.AbstractRiseClipseConsole;
import fr.centralesupelec.edf.riseclipse.util.IRiseClipseConsole;
import fr.centralesupelec.edf.riseclipse.util.RiseClipseResourceSet;
@SuppressWarnings( "unused" )
public class SclResourceSetImpl extends RiseClipseResourceSet {
public SclResourceSetImpl( boolean strictContent, IRiseClipseConsole console ) {
super( strictContent, console );
}
/* (non-Javadoc)
* @see fr.centralesupelec.edf.riseclipse.util.RiseClipseResourceSet#finalizeLoad(fr.centralesupelec.edf.riseclipse.util.IRiseClipseConsole)
*/
@Override
public void finalizeLoad( IRiseClipseConsole console ) {
buildExplicitLinks( console );
}
private void buildExplicitLinks( IRiseClipseConsole console ) {
for( Resource resource : getResources() ) {
if( resource instanceof SclResourceImpl ) {
SCL scl = ( SCL ) resource.getContents().get( 0 );
scl.resolveLinks();
}
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment