Commit 36c5337e authored by Dominique Marcadet's avatar Dominique Marcadet

use NsIdentification to get doc

parent 7b91b77b
......@@ -149,9 +149,6 @@ public class LNClassesItemProvider extends NsdObjectItemProvider {
protected void collectNewChildDescriptors( Collection< Object > newChildDescriptors, Object object ) {
super.collectNewChildDescriptors( newChildDescriptors, object );
newChildDescriptors.add( createChildParameter( NsdPackage.Literals.LN_CLASSES__ABSTRACT_LN_CLASS,
NsdFactory.eINSTANCE.createAbstractLNClass() ) );
newChildDescriptors.add( createChildParameter( NsdPackage.Literals.LN_CLASSES__LN_CLASS,
NsdFactory.eINSTANCE.createLNClass() ) );
}
......
......@@ -227,29 +227,6 @@ public class NsdItemProviderAdapterFactory extends NsdAdapterFactory
return abbreviationsItemProvider;
}
/**
* This keeps track of the one adapter used for all {@link fr.centralesupelec.edf.riseclipse.iec61850.nsd.AbstractLNClass} instances.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected AbstractLNClassItemProvider abstractLNClassItemProvider;
/**
* This creates an adapter for a {@link fr.centralesupelec.edf.riseclipse.iec61850.nsd.AbstractLNClass}.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Adapter createAbstractLNClassAdapter() {
if( abstractLNClassItemProvider == null ) {
abstractLNClassItemProvider = new AbstractLNClassItemProvider( this );
}
return abstractLNClassItemProvider;
}
/**
* This keeps track of the one adapter used for all {@link fr.centralesupelec.edf.riseclipse.iec61850.nsd.ApplicableServiceNS} instances.
* <!-- begin-user-doc -->
......@@ -595,29 +572,6 @@ public class NsdItemProviderAdapterFactory extends NsdAdapterFactory
return docItemProvider;
}
/**
* This keeps track of the one adapter used for all {@link fr.centralesupelec.edf.riseclipse.iec61850.nsd.DocumentedClass} instances.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected DocumentedClassItemProvider documentedClassItemProvider;
/**
* This creates an adapter for a {@link fr.centralesupelec.edf.riseclipse.iec61850.nsd.DocumentedClass}.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Adapter createDocumentedClassAdapter() {
if( documentedClassItemProvider == null ) {
documentedClassItemProvider = new DocumentedClassItemProvider( this );
}
return documentedClassItemProvider;
}
/**
* This keeps track of the one adapter used for all {@link fr.centralesupelec.edf.riseclipse.iec61850.nsd.Enumeration} instances.
* <!-- begin-user-doc -->
......@@ -1170,29 +1124,6 @@ public class NsdItemProviderAdapterFactory extends NsdAdapterFactory
return subDataObjectItemProvider;
}
/**
* This keeps track of the one adapter used for all {@link fr.centralesupelec.edf.riseclipse.iec61850.nsd.TitledClass} instances.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected TitledClassItemProvider titledClassItemProvider;
/**
* This creates an adapter for a {@link fr.centralesupelec.edf.riseclipse.iec61850.nsd.TitledClass}.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Adapter createTitledClassAdapter() {
if( titledClassItemProvider == null ) {
titledClassItemProvider = new TitledClassItemProvider( this );
}
return titledClassItemProvider;
}
/**
* This returns the root adapter factory that contains this factory.
* <!-- begin-user-doc -->
......@@ -1304,7 +1235,6 @@ public class NsdItemProviderAdapterFactory extends NsdAdapterFactory
if( serviceTypeItemProvider != null ) serviceTypeItemProvider.dispose();
if( abbreviationItemProvider != null ) abbreviationItemProvider.dispose();
if( abbreviationsItemProvider != null ) abbreviationsItemProvider.dispose();
if( abstractLNClassItemProvider != null ) abstractLNClassItemProvider.dispose();
if( applicableServiceNSItemProvider != null ) applicableServiceNSItemProvider.dispose();
if( applicableServicesItemProvider != null ) applicableServicesItemProvider.dispose();
if( basicTypeItemProvider != null ) basicTypeItemProvider.dispose();
......@@ -1320,7 +1250,6 @@ public class NsdItemProviderAdapterFactory extends NsdAdapterFactory
if( dataObjectItemProvider != null ) dataObjectItemProvider.dispose();
if( dataSetMemberOfItemProvider != null ) dataSetMemberOfItemProvider.dispose();
if( docItemProvider != null ) docItemProvider.dispose();
if( documentedClassItemProvider != null ) documentedClassItemProvider.dispose();
if( enumerationItemProvider != null ) enumerationItemProvider.dispose();
if( enumerationsItemProvider != null ) enumerationsItemProvider.dispose();
if( functionalConstraintItemProvider != null ) functionalConstraintItemProvider.dispose();
......@@ -1345,7 +1274,6 @@ public class NsdItemProviderAdapterFactory extends NsdAdapterFactory
if( serviceTypeRealizationsItemProvider != null ) serviceTypeRealizationsItemProvider.dispose();
if( subDataAttributeItemProvider != null ) subDataAttributeItemProvider.dispose();
if( subDataObjectItemProvider != null ) subDataObjectItemProvider.dispose();
if( titledClassItemProvider != null ) titledClassItemProvider.dispose();
}
}
......@@ -171,7 +171,7 @@
eType="#//ServiceNS" transient="true" unsettable="true" resolveProxies="false"
eOpposite="#//ServiceNS/abbreviations"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="AbstractLNClass" eSuperTypes="#//AnyLNClass">
<eClassifiers xsi:type="ecore:EClass" name="AbstractLNClass" abstract="true" eSuperTypes="#//AnyLNClass">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="name" value="tAbstractLNClass"/>
<details key="kind" value="elementOnly"/>
......@@ -927,7 +927,7 @@
ordered="false" upperBound="-1" eType="#//AgPresenceConditionDerivedStatistics"
transient="true" unsettable="true" resolveProxies="false" eOpposite="#//AgPresenceConditionDerivedStatistics/refersToDsPresCondArgsDoc"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="DocumentedClass" eSuperTypes="#//NsdObject">
<eClassifiers xsi:type="ecore:EClass" name="DocumentedClass" abstract="true" eSuperTypes="#//NsdObject">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="name" value="tDocumentedClass"/>
<details key="kind" value="empty"/>
......@@ -1867,7 +1867,7 @@
ordered="false" eType="#//DataAttribute" transient="true" unsettable="true"
resolveProxies="false" eOpposite="#//DataAttribute/referredBySubDataObjectAsMaxIndexAttribute"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="TitledClass" eSuperTypes="#//DocumentedClass">
<eClassifiers xsi:type="ecore:EClass" name="TitledClass" abstract="true" eSuperTypes="#//DocumentedClass">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="name" value="tTitledClass"/>
<details key="kind" value="empty"/>
......
......@@ -36,7 +36,8 @@ import org.eclipse.emf.common.util.EList;
* </ul>
*
* @see fr.centralesupelec.edf.riseclipse.iec61850.nsd.NsdPackage#getAbstractLNClass()
* @model extendedMetaData="name='tAbstractLNClass' kind='elementOnly'"
* @model abstract="true"
* extendedMetaData="name='tAbstractLNClass' kind='elementOnly'"
* annotation="http://www.eclipse.org/emf/2002/Ecore constraints='nameAttributeRequired'"
* annotation="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot nameAttributeRequired='Tuple {\n\tmessage : String = \'The name attribute is required\',\n\tstatus : Boolean = \n\t\t\tself.name &lt;&gt; null\n}.status'"
* @generated
......@@ -105,6 +106,7 @@ public interface AbstractLNClass extends AnyLNClass {
* @model opposite="abstractLNClass" resolveProxies="false" unsettable="true" ordered="false"
* @generated
*/
@Override
LNClasses getParentLNClasses();
/**
......
......@@ -35,7 +35,8 @@ package fr.centralesupelec.edf.riseclipse.iec61850.nsd;
* </ul>
*
* @see fr.centralesupelec.edf.riseclipse.iec61850.nsd.NsdPackage#getDocumentedClass()
* @model extendedMetaData="name='tDocumentedClass' kind='empty'"
* @model abstract="true"
* extendedMetaData="name='tDocumentedClass' kind='empty'"
* @generated
*/
public interface DocumentedClass extends NsdObject {
......
......@@ -92,15 +92,6 @@ public interface NsdFactory extends EFactory {
*/
Abbreviations createAbbreviations();
/**
* Returns a new object of class '<em>Abstract LN Class</em>'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return a new object of class '<em>Abstract LN Class</em>'.
* @generated
*/
AbstractLNClass createAbstractLNClass();
/**
* Returns a new object of class '<em>Applicable Service NS</em>'.
* <!-- begin-user-doc -->
......@@ -236,15 +227,6 @@ public interface NsdFactory extends EFactory {
*/
Doc createDoc();
/**
* Returns a new object of class '<em>Documented Class</em>'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return a new object of class '<em>Documented Class</em>'.
* @generated
*/
DocumentedClass createDocumentedClass();
/**
* Returns a new object of class '<em>Enumeration</em>'.
* <!-- begin-user-doc -->
......@@ -461,15 +443,6 @@ public interface NsdFactory extends EFactory {
*/
SubDataObject createSubDataObject();
/**
* Returns a new object of class '<em>Titled Class</em>'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return a new object of class '<em>Titled Class</em>'.
* @generated
*/
TitledClass createTitledClass();
/**
* Returns the package supported by this factory.
* <!-- begin-user-doc -->
......
......@@ -32,7 +32,8 @@ package fr.centralesupelec.edf.riseclipse.iec61850.nsd;
* </ul>
*
* @see fr.centralesupelec.edf.riseclipse.iec61850.nsd.NsdPackage#getTitledClass()
* @model extendedMetaData="name='tTitledClass' kind='empty'"
* @model abstract="true"
* extendedMetaData="name='tTitledClass' kind='empty'"
* annotation="http://www.eclipse.org/emf/2002/Ecore constraints='titleIDAttributeRequired'"
* annotation="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot titleIDAttributeRequired='Tuple {\n\tmessage : String = \'The titleID attribute is required\',\n\tstatus : Boolean = \n\t\t\tself.titleID &lt;&gt; null\n}.status'"
* @generated
......
......@@ -23,6 +23,7 @@ import fr.centralesupelec.edf.riseclipse.iec61850.nsd.Abbreviation;
import fr.centralesupelec.edf.riseclipse.iec61850.nsd.Abbreviations;
import fr.centralesupelec.edf.riseclipse.iec61850.nsd.Doc;
import fr.centralesupelec.edf.riseclipse.iec61850.nsd.NsdPackage;
import fr.centralesupelec.edf.riseclipse.iec61850.nsd.util.NsIdentification;
import fr.centralesupelec.edf.riseclipse.iec61850.nsd.util.NsdResourceSetImpl;
import fr.centralesupelec.edf.riseclipse.util.IRiseClipseConsole;
......@@ -583,7 +584,7 @@ public class AbbreviationImpl extends NsdObjectImpl implements Abbreviation {
if( isSetDescID() ) {
if( this.eResource().getResourceSet() instanceof NsdResourceSetImpl ) {
Doc doc = (( NsdResourceSetImpl ) this.eResource().getResourceSet() ).findDoc( getDescID() );
Doc doc = (( NsdResourceSetImpl ) this.eResource().getResourceSet() ).findDoc( new NsIdentification( getParentAbbreviations().getParentNS() ), getDescID() );
if( doc != null ) setRefersToDoc( doc );
}
}
......
......@@ -52,7 +52,7 @@ import org.eclipse.emf.ecore.util.InternalEList;
*
* @generated
*/
public class AbstractLNClassImpl extends AnyLNClassImpl implements AbstractLNClass {
public abstract class AbstractLNClassImpl extends AnyLNClassImpl implements AbstractLNClass {
/**
* The default value of the '{@link #getName() <em>Name</em>}' attribute.
* <!-- begin-user-doc -->
......
......@@ -24,6 +24,7 @@ import fr.centralesupelec.edf.riseclipse.iec61850.nsd.AnyLNClass;
import fr.centralesupelec.edf.riseclipse.iec61850.nsd.DataObject;
import fr.centralesupelec.edf.riseclipse.iec61850.nsd.LNClasses;
import fr.centralesupelec.edf.riseclipse.iec61850.nsd.NsdPackage;
import fr.centralesupelec.edf.riseclipse.iec61850.nsd.util.NsIdentification;
import fr.centralesupelec.edf.riseclipse.util.IRiseClipseConsole;
import fr.centralesupelec.edf.riseclipse.util.RiseClipseFatalException;
......@@ -520,7 +521,7 @@ public abstract class AnyLNClassImpl extends TitledClassImpl implements AnyLNCla
if( isSetBase() ) {
String messagePrefix = "[NSD links] while resolving link from AnyLNClass (name: " + getName()
+ ", NS id: " + getParentLNClasses().getParentNS().getId() + ", line: " + getLineNumber() + "): ";
+ ", NS id: " + getParentLNClasses().getParentNS().getId() + ", line: " + getLineNumber() + "): ";
// This code assumes that the referred AbstractLNClass is in the same NS
// TODO: check that it is right
......@@ -532,9 +533,10 @@ public abstract class AnyLNClassImpl extends TitledClassImpl implements AnyLNCla
.ifPresent( abstractLNClass -> setRefersToAbstractLNClass( abstractLNClass ) );
if( isSetRefersToAbstractLNClass() ) {
console.info( "[NSD links] AbstractLNClass (name: " + getBase() + ") refers by AnyLNClass (name: " + getName()
+ ") in NS (id:" + getParentLNClasses().getParentNS().getId() + ") found in NS (id:"
+ getRefersToAbstractLNClass().getParentLNClasses().getParentNS().getId() + ")" );
console.info(
"[NSD links] AbstractLNClass (name: " + getBase() + ") refers by AnyLNClass (name: " + getName()
+ ") in NS (id:" + getParentLNClasses().getParentNS().getId() + ") found in NS (id:"
+ getRefersToAbstractLNClass().getParentLNClasses().getParentNS().getId() + ")" );
}
else {
console.warning( messagePrefix + "AbstractLNClass (name: " + getBase() + ") not found" );
......@@ -544,4 +546,9 @@ public abstract class AnyLNClassImpl extends TitledClassImpl implements AnyLNCla
return false;
}
@Override
protected NsIdentification getNsIdentification() {
return new NsIdentification( getParentLNClasses().getParentNS() );
}
} //AnyLNClassImpl
......@@ -24,6 +24,7 @@ import fr.centralesupelec.edf.riseclipse.iec61850.nsd.BasicType;
import fr.centralesupelec.edf.riseclipse.iec61850.nsd.BasicTypes;
import fr.centralesupelec.edf.riseclipse.iec61850.nsd.Doc;
import fr.centralesupelec.edf.riseclipse.iec61850.nsd.NsdPackage;
import fr.centralesupelec.edf.riseclipse.iec61850.nsd.util.NsIdentification;
import fr.centralesupelec.edf.riseclipse.iec61850.nsd.util.NsdResourceSetImpl;
import fr.centralesupelec.edf.riseclipse.util.IRiseClipseConsole;
......@@ -651,7 +652,8 @@ public class BasicTypeImpl extends NsdObjectImpl implements BasicType {
if( isSetDescID() ) {
if( this.eResource().getResourceSet() instanceof NsdResourceSetImpl ) {
Doc doc = ( ( NsdResourceSetImpl ) this.eResource().getResourceSet() ).findDoc( getDescID() );
Doc doc = ( ( NsdResourceSetImpl ) this.eResource().getResourceSet() )
.findDoc( new NsIdentification( getParentBasicTypes().getParentNS() ), getDescID() );
if( doc != null ) setRefersToDoc( doc );
}
}
......
......@@ -26,6 +26,7 @@ import fr.centralesupelec.edf.riseclipse.iec61850.nsd.DataObject;
import fr.centralesupelec.edf.riseclipse.iec61850.nsd.NsdPackage;
import fr.centralesupelec.edf.riseclipse.iec61850.nsd.ServiceParameter;
import fr.centralesupelec.edf.riseclipse.iec61850.nsd.SubDataObject;
import fr.centralesupelec.edf.riseclipse.iec61850.nsd.util.NsIdentification;
import java.util.Collection;
......@@ -1119,4 +1120,9 @@ public class CDCImpl extends TitledClassImpl implements CDC {
return result.toString();
}
@Override
protected NsIdentification getNsIdentification() {
return new NsIdentification( getParentCDCs().getParentNS() );
}
} //CDCImpl
......@@ -20,11 +20,13 @@
package fr.centralesupelec.edf.riseclipse.iec61850.nsd.impl;
import fr.centralesupelec.edf.riseclipse.iec61850.nsd.AgAttributeType;
import fr.centralesupelec.edf.riseclipse.iec61850.nsd.AgNSIdentification;
import fr.centralesupelec.edf.riseclipse.iec61850.nsd.ConstructedAttribute;
import fr.centralesupelec.edf.riseclipse.iec61850.nsd.ConstructedAttributes;
import fr.centralesupelec.edf.riseclipse.iec61850.nsd.NsdPackage;
import fr.centralesupelec.edf.riseclipse.iec61850.nsd.ServiceTypeRealizations;
import fr.centralesupelec.edf.riseclipse.iec61850.nsd.SubDataAttribute;
import fr.centralesupelec.edf.riseclipse.iec61850.nsd.util.NsIdentification;
import java.util.Collection;
......@@ -537,4 +539,16 @@ public class ConstructedAttributeImpl extends TitledClassImpl implements Constru
return result.toString();
}
@Override
protected NsIdentification getNsIdentification() {
AgNSIdentification ns = null;
if( getParentConstructedAttributes() != null ) {
ns = getParentConstructedAttributes().getParentNS();
}
if(( ns == null ) && ( getParentServiceTypeRealizations() != null ) ) {
ns = getParentServiceTypeRealizations().getParentServiceNS();
}
return new NsIdentification( ns );
}
} //ConstructedAttributeImpl
......@@ -38,6 +38,7 @@ import fr.centralesupelec.edf.riseclipse.iec61850.nsd.NsdPackage;
import fr.centralesupelec.edf.riseclipse.iec61850.nsd.PresenceCondition;
import fr.centralesupelec.edf.riseclipse.iec61850.nsd.SubDataObject;
import fr.centralesupelec.edf.riseclipse.iec61850.nsd.util.NsIdentification;
import fr.centralesupelec.edf.riseclipse.iec61850.nsd.util.NsdResourceSetImpl;
import fr.centralesupelec.edf.riseclipse.util.IRiseClipseConsole;
......@@ -3701,11 +3702,18 @@ public class DataAttributeImpl extends DocumentedClassImpl implements DataAttrib
if( isSetPresCondArgsID() ) {
if( this.eResource().getResourceSet() instanceof NsdResourceSetImpl ) {
Doc doc = ( ( NsdResourceSetImpl ) this.eResource().getResourceSet() ).findDoc( getPresCondArgsID() );
Doc doc = ( ( NsdResourceSetImpl ) this.eResource().getResourceSet() ).findDoc( getNsIdentification(),
getPresCondArgsID() );
if( doc != null ) setRefersToPresCondArgsDoc( doc );
}
}
return false;
}
@Override
protected NsIdentification getNsIdentification() {
return new NsIdentification( getParentCDC().getParentCDCs().getParentNS() );
}
} //DataAttributeImpl
......@@ -31,6 +31,7 @@ import fr.centralesupelec.edf.riseclipse.iec61850.nsd.NS;
import fr.centralesupelec.edf.riseclipse.iec61850.nsd.NsdPackage;
import fr.centralesupelec.edf.riseclipse.iec61850.nsd.PresenceCondition;
import fr.centralesupelec.edf.riseclipse.iec61850.nsd.util.NsIdentification;
import fr.centralesupelec.edf.riseclipse.iec61850.nsd.util.NsdResourceSetImpl;
import fr.centralesupelec.edf.riseclipse.util.IRiseClipseConsole;
......@@ -2189,7 +2190,7 @@ public class DataObjectImpl extends DocumentedClassImpl implements DataObject {
NS ns = getParentAnyLNClass().getParentLNClasses().getParentNS();
String messagePrefix = "[NSD links] while resolving link from DataObject (name: " + getName()
+ ", NS id: " + ns.getId() + ", line: " + getLineNumber() + "): ";
+ ", NS id: " + ns.getId() + ", line: " + getLineNumber() + "): ";
if( isSetType() ) {
CDC foundCDC = ns.findCDC( getType(), console );
......@@ -2226,7 +2227,8 @@ public class DataObjectImpl extends DocumentedClassImpl implements DataObject {
}
else {
setRefersToPresenceConditionDerivedStatistics( foundPC );
console.info( "[NSD links] PresenceCondition (name: " + getDsPresCond() + ") refers by DataObject (name: "
console.info( "[NSD links] PresenceCondition (name: " + getDsPresCond()
+ ") refers by DataObject (name: "
+ getName() + ") in NS (id:" + getParentAnyLNClass().getParentLNClasses().getParentNS().getId()
+ ") found in NS (id:"
+ getRefersToPresenceConditionDerivedStatistics().getParentPresenceConditions().getParentNS()
......@@ -2237,19 +2239,26 @@ public class DataObjectImpl extends DocumentedClassImpl implements DataObject {
if( isSetPresCondArgsID() ) {
if( this.eResource().getResourceSet() instanceof NsdResourceSetImpl ) {
Doc doc = (( NsdResourceSetImpl ) this.eResource().getResourceSet() ).findDoc( getPresCondArgsID() );
Doc doc = ( ( NsdResourceSetImpl ) this.eResource().getResourceSet() ).findDoc( getNsIdentification(),
getPresCondArgsID() );
if( doc != null ) setRefersToPresCondArgsDoc( doc );
}
}
if( isSetDsPresCondArgsID() ) {
if( this.eResource().getResourceSet() instanceof NsdResourceSetImpl ) {
Doc doc = (( NsdResourceSetImpl ) this.eResource().getResourceSet() ).findDoc( getDsPresCondArgsID() );
Doc doc = ( ( NsdResourceSetImpl ) this.eResource().getResourceSet() ).findDoc( getNsIdentification(),
getDsPresCondArgsID() );
if( doc != null ) setRefersToDsPresCondArgsDoc( doc );
}
}
return false;
return false;
}
@Override
protected NsIdentification getNsIdentification() {
return new NsIdentification( getParentAnyLNClass().getParentLNClasses().getParentNS() );
}
} //DataObjectImpl
......@@ -24,7 +24,7 @@ import fr.centralesupelec.edf.riseclipse.iec61850.nsd.DependsOn;
import fr.centralesupelec.edf.riseclipse.iec61850.nsd.NS;
import fr.centralesupelec.edf.riseclipse.iec61850.nsd.NsdPackage;
import fr.centralesupelec.edf.riseclipse.iec61850.nsd.PubStage;
import fr.centralesupelec.edf.riseclipse.iec61850.nsd.util.NSIdentification;
import fr.centralesupelec.edf.riseclipse.iec61850.nsd.util.NsIdentification;
import fr.centralesupelec.edf.riseclipse.iec61850.nsd.util.NsdResourceSetImpl;
import fr.centralesupelec.edf.riseclipse.util.IRiseClipseConsole;
......@@ -910,16 +910,18 @@ public class DependsOnImpl extends NsdObjectImpl implements DependsOn {
public boolean buildExplicitLinks( IRiseClipseConsole console, boolean forceUpdate ) {
if( super.buildExplicitLinks( console, forceUpdate ) ) return true;
String messagePrefix = "[NSD links] while resolving link from DependsOn (NS id: " + new NSIdentification( getParentNS() ) + ", line: " + getLineNumber() + "): ";
String messagePrefix = "[NSD links] while resolving link from DependsOn (NS id: "
+ new NsIdentification( getParentNS() ) + ", line: " + getLineNumber() + "): ";
NSIdentification identification = new NSIdentification( getId(), getVersion(), getRevision(), getRelease() );
NsIdentification identification = new NsIdentification( getId(), getVersion(), getRevision(), getRelease() );
NS ns = ( ( NsdResourceSetImpl ) eResource().getResourceSet() ).getNS( identification );
if( ns == null ) {
console.warning( messagePrefix + "NS (id: " + identification + ") not found" );
}
else {
setRefersToNS( ns );
console.info( "[NSD links] NS (id: " + identification + ") refers by DependsOn in NS (id:" + new NSIdentification( getParentNS() ) + ") found" );
console.info( "[NSD links] NS (id: " + identification + ") refers by DependsOn in NS (id:"
+ new NsIdentification( getParentNS() ) + ") found" );
}
return false;
}
......
......@@ -22,6 +22,7 @@ package fr.centralesupelec.edf.riseclipse.iec61850.nsd.impl;
import fr.centralesupelec.edf.riseclipse.iec61850.nsd.Doc;
import fr.centralesupelec.edf.riseclipse.iec61850.nsd.DocumentedClass;
import fr.centralesupelec.edf.riseclipse.iec61850.nsd.NsdPackage;
import fr.centralesupelec.edf.riseclipse.iec61850.nsd.util.NsIdentification;
import fr.centralesupelec.edf.riseclipse.iec61850.nsd.util.NsdResourceSetImpl;
import fr.centralesupelec.edf.riseclipse.util.IRiseClipseConsole;
......@@ -49,7 +50,7 @@ import org.eclipse.emf.ecore.impl.ENotificationImpl;
*
* @generated
*/
public class DocumentedClassImpl extends NsdObjectImpl implements DocumentedClass {
public abstract class DocumentedClassImpl extends NsdObjectImpl implements DocumentedClass {
/**
* The default value of the '{@link #isDeprecated() <em>Deprecated</em>}' attribute.
* <!-- begin-user-doc -->
......@@ -594,10 +595,11 @@ public class DocumentedClassImpl extends NsdObjectImpl implements DocumentedClas
@Override
public boolean buildExplicitLinks( IRiseClipseConsole console, boolean forceUpdate ) {
if( super.buildExplicitLinks( console, forceUpdate ) ) return true;
if( isSetDescID() ) {
if( this.eResource().getResourceSet() instanceof NsdResourceSetImpl ) {
Doc doc = (( NsdResourceSetImpl ) this.eResource().getResourceSet() ).findDoc( getDescID() );
Doc doc = ( ( NsdResourceSetImpl ) this.eResource().getResourceSet() ).findDoc( getNsIdentification(),
getDescID() );
if( doc != null ) setRefersToDoc( doc );
}
}
......@@ -605,4 +607,6 @@ public class DocumentedClassImpl extends NsdObjectImpl implements DocumentedClas
return false;
}
protected abstract NsIdentification getNsIdentification();
} //DocumentedClassImpl
......@@ -25,6 +25,7 @@ import fr.centralesupelec.edf.riseclipse.iec61850.nsd.Enumerations;
import fr.centralesupelec.edf.riseclipse.iec61850.nsd.Literal;
import fr.centralesupelec.edf.riseclipse.iec61850.nsd.NS;
import fr.centralesupelec.edf.riseclipse.iec61850.nsd.NsdPackage;
import fr.centralesupelec.edf.riseclipse.iec61850.nsd.util.NsIdentification;
import fr.centralesupelec.edf.riseclipse.util.IRiseClipseConsole;
import java.util.Collection;
......@@ -806,4 +807,9 @@ public class EnumerationImpl extends TitledClassImpl implements Enumeration {
return false;
}
@Override
protected NsIdentification getNsIdentification() {
return new NsIdentification( getParentEnumerations().getParentNS() );
}
} //EnumerationImpl
......@@ -25,6 +25,7 @@ import fr.centralesupelec.edf.riseclipse.iec61850.nsd.Doc;
import fr.centralesupelec.edf.riseclipse.iec61850.nsd.FunctionalConstraint;
import fr.centralesupelec.edf.riseclipse.iec61850.nsd.FunctionalConstraints;
import fr.centralesupelec.edf.riseclipse.iec61850.nsd.NsdPackage;
import fr.centralesupelec.edf.riseclipse.iec61850.nsd.util.NsIdentification;
import fr.centralesupelec.edf.riseclipse.iec61850.nsd.util.NsdResourceSetImpl;
import fr.centralesupelec.edf.riseclipse.util.IRiseClipseConsole;
......@@ -903,10 +904,11 @@ public class FunctionalConstraintImpl extends NsdObjectImpl implements Functiona
@Override
public boolean buildExplicitLinks( IRiseClipseConsole console, boolean forceUpdate ) {
if( super.buildExplicitLinks( console, forceUpdate ) ) return true;
if( isSetDescID() ) {
if( this.eResource().getResourceSet() instanceof NsdResourceSetImpl ) {
Doc doc = (( NsdResourceSetImpl ) this.eResource().getResourceSet() ).findDoc( getDescID() );
Doc doc = ( ( NsdResourceSetImpl ) this.eResource().getResourceSet() )
.findDoc( new NsIdentification( getParentFunctionalConstraints().getParentNS() ), getDescID() );
if( doc != null ) setRefersToDoc( doc );
}
}
......
......@@ -22,6 +22,7 @@ package fr.centralesupelec.edf.riseclipse.iec61850.nsd.impl;
import fr.centralesupelec.edf.riseclipse.iec61850.nsd.LNClass;
import fr.centralesupelec.edf.riseclipse.iec61850.nsd.LNClasses;
import fr.centralesupelec.edf.riseclipse.iec61850.nsd.NsdPackage;
import fr.centralesupelec.edf.riseclipse.iec61850.nsd.util.NsIdentification;
import org.eclipse.emf.common.notify.Notification;
......
......@@ -22,6 +22,7 @@ package fr.centralesupelec.edf.riseclipse.iec61850.nsd.impl;
import fr.centralesupelec.edf.riseclipse.iec61850.nsd.Enumeration;
import fr.centralesupelec.edf.riseclipse.iec61850.nsd.Literal;
import fr.centralesupelec.edf.riseclipse.iec61850.nsd.NsdPackage;
import fr.centralesupelec.edf.riseclipse.iec61850.nsd.util.NsIdentification;
import org.eclipse.emf.common.notify.Notification;
......@@ -424,4 +425,9 @@ public class LiteralImpl extends DocumentedClassImpl implements Literal {
return result.toString();
}
@Override
protected NsIdentification getNsIdentification() {
return new NsIdentification( getParentEnumeration().getParentEnumerations().getParentNS() );
}
} //LiteralImpl
......@@ -42,6 +42,7 @@ import fr.centralesupelec.edf.riseclipse.iec61850.nsd.NsdPackage;
import fr.centralesupelec.edf.riseclipse.iec61850.nsd.PresenceCondition;
import fr.centralesupelec.edf.riseclipse.iec61850.nsd.PresenceConditions;
import fr.centralesupelec.edf.riseclipse.iec61850.nsd.PubStage;
import fr.centralesupelec.edf.riseclipse.iec61850.nsd.util.NsIdentification;
import fr.centralesupelec.edf.riseclipse.iec61850.nsd.util.NsdResourceSetImpl;
import fr.centralesupelec.edf.riseclipse.util.IRiseClipseConsole;
import java.lang.reflect.InvocationTargetException;
......@@ -1846,7 +1847,8 @@ public class NSImpl extends CopyrightedImpl implements NS {
* @generated NOT
*/
@Override
public ConstructedAttribute findConstructedAttribute( String constructedAttributeName, IRiseClipseConsole console ) {
public ConstructedAttribute findConstructedAttribute( String constructedAttributeName,
IRiseClipseConsole console ) {
if( isSetConstructedAttributes() ) {
ConstructedAttribute found = getConstructedAttributes().getConstructedAttribute().stream()
.filter( ca -> ca.getName().equals( constructedAttributeName ) ).findAny().orElse( null );
......@@ -2923,7 +2925,8 @@ public class NSImpl extends CopyrightedImpl implements NS {
if( isSetDescID() ) {
if( this.eResource().getResourceSet() instanceof NsdResourceSetImpl ) {
Doc doc = ( ( NsdResourceSetImpl ) this.eResource().getResourceSet() ).findDoc( getDescID() );
Doc doc = ( ( NsdResourceSetImpl ) this.eResource().getResourceSet() )
.findDoc( new NsIdentification( this ), getDescID() );
if( doc != null ) setRefersToDoc( doc );
}
}
......
......@@ -90,8 +90,6 @@ public class NsdFactoryImpl extends EFactoryImpl implements NsdFactory {
return createAbbreviation();
case NsdPackage.ABBREVIATIONS:
return createAbbreviations();
case NsdPackage.ABSTRACT_LN_CLASS:
return createAbstractLNClass();
case NsdPackage.APPLICABLE_SERVICE_NS:
return createApplicableServiceNS();