-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[2011] Prevent 1.2.0 session opening without migration
Change-Id: I99028908a00b03a90cf65a9be352a4316f00c0ca Signed-off-by: Philippe DUL <philippe.dul@thalesgroup.com>
- Loading branch information
Showing
19 changed files
with
584 additions
and
201 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
117 changes: 117 additions & 0 deletions
117
common/plugins/org.polarsys.capella.common.platform.sirius.ted/schema/metadataProvider.exsd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
<?xml version='1.0' encoding='UTF-8'?> | ||
<!-- Schema file written by PDE --> | ||
<schema targetNamespace="org.polarsys.capella.common.platform.sirius.ted" xmlns="http://www.w3.org/2001/XMLSchema"> | ||
<annotation> | ||
<appInfo> | ||
<meta.schema plugin="org.polarsys.capella.common.platform.sirius.ted" id="metadataProvider" name="MetadataProvider"/> | ||
</appInfo> | ||
<documentation> | ||
Add capability to check consistency of loaded models on a Sirius Session created by org.polarsys.capella.common.platform.sirius.ted.SiriusSessionFactory | ||
</documentation> | ||
</annotation> | ||
|
||
<element name="extension"> | ||
<annotation> | ||
<appInfo> | ||
<meta.element /> | ||
</appInfo> | ||
</annotation> | ||
<complexType> | ||
<sequence> | ||
<element ref="metadataProvider"/> | ||
</sequence> | ||
<attribute name="point" type="string" use="required"> | ||
<annotation> | ||
<documentation> | ||
|
||
</documentation> | ||
</annotation> | ||
</attribute> | ||
<attribute name="id" type="string"> | ||
<annotation> | ||
<documentation> | ||
|
||
</documentation> | ||
</annotation> | ||
</attribute> | ||
<attribute name="name" type="string"> | ||
<annotation> | ||
<documentation> | ||
|
||
</documentation> | ||
<appInfo> | ||
<meta.attribute translatable="true"/> | ||
</appInfo> | ||
</annotation> | ||
</attribute> | ||
</complexType> | ||
</element> | ||
|
||
<element name="metadataProvider"> | ||
<complexType> | ||
<attribute name="class" type="string" use="required"> | ||
<annotation> | ||
<documentation> | ||
Add capability to check consistency of loaded models on a Sirius Session created by org.polarsys.capella.common.platform.sirius.ted.SiriusSessionFactory | ||
</documentation> | ||
<appInfo> | ||
<meta.attribute kind="java" basedOn=":org.polarsys.capella.common.platform.sirius.ted.IMetadataProvider"/> | ||
</appInfo> | ||
</annotation> | ||
</attribute> | ||
</complexType> | ||
</element> | ||
|
||
<annotation> | ||
<appInfo> | ||
<meta.section type="since"/> | ||
</appInfo> | ||
<documentation> | ||
[Enter the first release in which this extension point appears.] | ||
</documentation> | ||
</annotation> | ||
|
||
<annotation> | ||
<appInfo> | ||
<meta.section type="examples"/> | ||
</appInfo> | ||
<documentation> | ||
[Enter extension point usage example here.] | ||
</documentation> | ||
</annotation> | ||
|
||
<annotation> | ||
<appInfo> | ||
<meta.section type="apiinfo"/> | ||
</appInfo> | ||
<documentation> | ||
[Enter API information here.] | ||
</documentation> | ||
</annotation> | ||
|
||
<annotation> | ||
<appInfo> | ||
<meta.section type="implementation"/> | ||
</appInfo> | ||
<documentation> | ||
[Enter information about supplied implementation of this extension point.] | ||
</documentation> | ||
</annotation> | ||
|
||
<annotation> | ||
<appInfo> | ||
<meta.section type="copyright"/> | ||
</appInfo> | ||
<documentation> | ||
Copyright (c) 2018 THALES GLOBAL SERVICES. | ||
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 | ||
|
||
Contributors: | ||
Thales - initial API and implementation | ||
</documentation> | ||
</annotation> | ||
|
||
</schema> |
58 changes: 58 additions & 0 deletions
58
...orm.sirius.ted/src/org/polarsys/capella/common/platform/sirius/ted/IMetadataProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2018 THALES GLOBAL SERVICES. | ||
* 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 | ||
* | ||
* Contributors: | ||
* Thales - initial API and implementation | ||
*******************************************************************************/ | ||
package org.polarsys.capella.common.platform.sirius.ted; | ||
|
||
import org.eclipse.core.resources.IFile; | ||
import org.eclipse.core.runtime.IProgressMonitor; | ||
import org.eclipse.core.runtime.IStatus; | ||
import org.eclipse.emf.common.util.URI; | ||
import org.eclipse.emf.ecore.resource.Resource; | ||
import org.eclipse.emf.ecore.resource.ResourceSet; | ||
import org.eclipse.emf.transaction.TransactionalEditingDomain; | ||
import org.eclipse.sirius.business.api.session.Session; | ||
|
||
/** | ||
* Add capability to check consistency of loaded models on a Sirius Session | ||
* created by org.polarsys.capella.common.platform.sirius.ted.SiriusSessionFactory | ||
*/ | ||
public interface IMetadataProvider { | ||
|
||
/** | ||
* For a given model file (model, aird, afm), retrieve if the model is fully compatible with the current platform. | ||
* Checks current platform version and viewpoints. | ||
*/ | ||
public IStatus checkMetadata(IFile file); | ||
|
||
/** | ||
* For a given AFM file loaded in a resourceSet, retrieve if the model is fully compatible with the current platform. | ||
* Checks current platform version and viewpoints. | ||
*/ | ||
public IStatus checkMetadata(URI sessionResourceURI, ResourceSet set); | ||
|
||
/** | ||
* Register the given resource to the current session | ||
*/ | ||
public void registerMetadataResource(Resource resource, final Session session, final IProgressMonitor monitor); | ||
|
||
/** | ||
* Creates the AFM metadata resource</br> | ||
* (This resource will only be created when the aird resource does not exist yet, if the aird resource already exists | ||
* then a model migration shall be done) | ||
* | ||
* @param domain | ||
* @param resourceURI | ||
* @param monitor | ||
* @return the created resource (may be null if the resource does not belong to a Capella project) | ||
*/ | ||
public Resource createMetadataResource(TransactionalEditingDomain domain, URI resourceURI, | ||
IProgressMonitor monitor); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.