Browse Source

Initial commit.

master
Pierre Gaufillet 7 years ago
commit
93878ac5e6
  1. 1
      features/com.irtsaintexupery.capella2aadl-feature/.gitignore
  2. 17
      features/com.irtsaintexupery.capella2aadl-feature/.project
  3. 13
      features/com.irtsaintexupery.capella2aadl-feature/build.properties
  4. 27
      features/com.irtsaintexupery.capella2aadl-feature/feature.properties
  5. 47
      features/com.irtsaintexupery.capella2aadl-feature/feature.xml
  6. 30
      features/com.irtsaintexupery.capella2aadl-feature/pom.xml
  7. 1
      features/com.irtsaintexupery.epl/.gitignore
  8. 17
      features/com.irtsaintexupery.epl/.project
  9. 6
      features/com.irtsaintexupery.epl/build.properties
  10. 261
      features/com.irtsaintexupery.epl/epl-v10.html
  11. 150
      features/com.irtsaintexupery.epl/feature.properties
  12. 20
      features/com.irtsaintexupery.epl/feature.xml
  13. 107
      features/com.irtsaintexupery.epl/license.html
  14. 18
      features/com.irtsaintexupery.epl/pom.xml
  15. 7
      plugins/com.irtsaintexupery.capella2aadl.ui/.classpath
  16. 2
      plugins/com.irtsaintexupery.capella2aadl.ui/.gitignore
  17. 28
      plugins/com.irtsaintexupery.capella2aadl.ui/.project
  18. 6
      plugins/com.irtsaintexupery.capella2aadl.ui/.settings/org.eclipse.jdt.core.prefs
  19. 21
      plugins/com.irtsaintexupery.capella2aadl.ui/META-INF/MANIFEST.MF
  20. 9
      plugins/com.irtsaintexupery.capella2aadl.ui/build.properties
  21. BIN
      plugins/com.irtsaintexupery.capella2aadl.ui/icons/Capella2aadl16x16.png
  22. BIN
      plugins/com.irtsaintexupery.capella2aadl.ui/icons/Capella2aadl16x16.xcf
  23. 15
      plugins/com.irtsaintexupery.capella2aadl.ui/plugin.properties
  24. 49
      plugins/com.irtsaintexupery.capella2aadl.ui/plugin.xml
  25. 17
      plugins/com.irtsaintexupery.capella2aadl.ui/pom.xml
  26. 68
      plugins/com.irtsaintexupery.capella2aadl.ui/src/com/irtsaintexupery/capella2aadl/ui/Activator.java
  27. 92
      plugins/com.irtsaintexupery.capella2aadl.ui/src/com/irtsaintexupery/capella2aadl/ui/common/GenerateAll.java
  28. 120
      plugins/com.irtsaintexupery.capella2aadl.ui/src/com/irtsaintexupery/capella2aadl/ui/popupMenus/Capella2AADLTransformer.java
  29. 7
      plugins/com.irtsaintexupery.capella2aadl/.classpath
  30. 3
      plugins/com.irtsaintexupery.capella2aadl/.gitignore
  31. 50
      plugins/com.irtsaintexupery.capella2aadl/.project
  32. 26
      plugins/com.irtsaintexupery.capella2aadl/META-INF/MANIFEST.MF
  33. 17
      plugins/com.irtsaintexupery.capella2aadl/build.properties
  34. 14
      plugins/com.irtsaintexupery.capella2aadl/plugin.properties
  35. 60
      plugins/com.irtsaintexupery.capella2aadl/pom.xml
  36. 69
      plugins/com.irtsaintexupery.capella2aadl/src/com/irtsaintexupery/capella2aadl/Activator.java
  37. 407
      plugins/com.irtsaintexupery.capella2aadl/src/com/irtsaintexupery/capella2aadl/main/Capella2aadl.java
  38. 234
      plugins/com.irtsaintexupery.capella2aadl/src/com/irtsaintexupery/capella2aadl/main/capella2aadl.mtl
  39. 73
      plugins/com.irtsaintexupery.capella2aadl/src/com/irtsaintexupery/capella2aadl/requests/Bus.java
  40. 22
      plugins/com.irtsaintexupery.capella2aadl/src/com/irtsaintexupery/capella2aadl/requests/Capella2AADLException.java
  41. 493
      plugins/com.irtsaintexupery.capella2aadl/src/com/irtsaintexupery/capella2aadl/requests/ComponentExchangeUtils.java
  42. 637
      plugins/com.irtsaintexupery.capella2aadl/src/com/irtsaintexupery/capella2aadl/requests/PhysicalLinkUtils.java
  43. 75
      plugins/com.irtsaintexupery.capella2aadl/src/com/irtsaintexupery/capella2aadl/requests/capella2aadl_queries.mtl
  44. 2
      releng/com.irtsaintexupery.capella2aadl.repository/.gitignore
  45. 11
      releng/com.irtsaintexupery.capella2aadl.repository/.project
  46. 17
      releng/com.irtsaintexupery.capella2aadl.repository/category.xml
  47. 17
      releng/com.irtsaintexupery.capella2aadl.repository/pom.xml
  48. 17
      releng/com.irtsaintexupery.parent/.project
  49. 159
      releng/com.irtsaintexupery.parent/pom.xml

1
features/com.irtsaintexupery.capella2aadl-feature/.gitignore vendored

@ -0,0 +1 @@ @@ -0,0 +1 @@
/target/

17
features/com.irtsaintexupery.capella2aadl-feature/.project

@ -0,0 +1,17 @@ @@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>com.irtsaintexupery.capella2aadl-feature</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.pde.FeatureBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.FeatureNature</nature>
</natures>
</projectDescription>

13
features/com.irtsaintexupery.capella2aadl-feature/build.properties

@ -0,0 +1,13 @@ @@ -0,0 +1,13 @@
###############################################################################
# Copyright (c) 2015, 2016 IRT AESE (IRT Saint Exupery).
# 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:
# Bassem Ouni and Pierre Gaufillet (IRT Saint Exupéry) - initial API and implementation
#
###############################################################################
bin.includes = feature.xml,\
feature.properties

27
features/com.irtsaintexupery.capella2aadl-feature/feature.properties

@ -0,0 +1,27 @@ @@ -0,0 +1,27 @@
###############################################################################
# Copyright (c) 2015, 2016 IRT AESE (IRT Saint Exupery).
# 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:
# Bassem Ouni and Pierre Gaufillet (IRT Saint Exupéry) - initial API and implementation
#
###############################################################################
featureName=Capella2AADL
providerName=IRT AESE (IRT Saint Exupéry)
description=Capella2AADL is a model transformation from Capella physical\n\
architecture to an abstract AADL architecture.\n\
Its goal is to make the transition between system engineering\n\
and hardware and software engineering easier.
copyright=\
Copyright (c) 2000, 2017 IRT AESE (IRT Saint Exupéry).\n\
All rights reserved. This program and the accompanying materials\n\
are made available under the terms of the Eclipse Public License v1.0\n\
which accompanies this distribution, and is available at\n\
http://www.eclipse.org/legal/epl-v10.html\n

47
features/com.irtsaintexupery.capella2aadl-feature/feature.xml

@ -0,0 +1,47 @@ @@ -0,0 +1,47 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2015, 2017 IRT AESE (IRT Saint Exupery).
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:
Bassem Ouni and Pierre Gaufillet (IRT Saint Exupéry) - initial API and implementation
-->
<feature
id="com.irtsaintexupery.capella2aadl"
label="%featureName"
version="1.1.2.qualifier"
provider-name="%providerName"
license-feature="com.irtsaintexupery.epl"
license-feature-version="1.0.0.qualifier">
<description>
%description
</description>
<copyright url="http://www.irt-saintexupery.com">
%copyright
</copyright>
<license url="%licenseURL">
%license
</license>
<plugin
id="com.irtsaintexupery.capella2aadl"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
<plugin
id="com.irtsaintexupery.capella2aadl.ui"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
</feature>

30
features/com.irtsaintexupery.capella2aadl-feature/pom.xml

@ -0,0 +1,30 @@ @@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2015, 2017 IRT AESE (IRT Saint Exupery).
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:
Bassem Ouni and Pierre Gaufillet (IRT Saint Exupéry) - initial API and implementation
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.irtsaintexupery</groupId>
<artifactId>parent</artifactId>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../../releng/com.irtsaintexupery.parent</relativePath>
</parent>
<groupId>com.irtsaintexupery.features</groupId>
<artifactId>com.irtsaintexupery.capella2aadl</artifactId>
<version>1.1.2-SNAPSHOT</version>
<packaging>eclipse-feature</packaging>
</project>

1
features/com.irtsaintexupery.epl/.gitignore vendored

@ -0,0 +1 @@ @@ -0,0 +1 @@
/target

17
features/com.irtsaintexupery.epl/.project

@ -0,0 +1,17 @@ @@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>com.irtsaintexupery.epl</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.pde.FeatureBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.FeatureNature</nature>
</natures>
</projectDescription>

6
features/com.irtsaintexupery.epl/build.properties

@ -0,0 +1,6 @@ @@ -0,0 +1,6 @@
bin.includes = feature.xml,\
license.html,\
epl-v10.html,\
feature.properties,\
build.properties

261
features/com.irtsaintexupery.epl/epl-v10.html

@ -0,0 +1,261 @@ @@ -0,0 +1,261 @@
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Eclipse Public License - Version 1.0</title>
<style type="text/css">
body {
size: 8.5in 11.0in;
margin: 0.25in 0.5in 0.25in 0.5in;
tab-interval: 0.5in;
}
p {
margin-left: auto;
margin-top: 0.5em;
margin-bottom: 0.5em;
}
p.list {
margin-left: 0.5in;
margin-top: 0.05em;
margin-bottom: 0.05em;
}
</style>
</head>
<body lang="EN-US">
<h2>Eclipse Public License - v 1.0</h2>
<p>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE
PUBLIC LICENSE (&quot;AGREEMENT&quot;). ANY USE, REPRODUCTION OR
DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS
AGREEMENT.</p>
<p><b>1. DEFINITIONS</b></p>
<p>&quot;Contribution&quot; means:</p>
<p class="list">a) in the case of the initial Contributor, the initial
code and documentation distributed under this Agreement, and</p>
<p class="list">b) in the case of each subsequent Contributor:</p>
<p class="list">i) changes to the Program, and</p>
<p class="list">ii) additions to the Program;</p>
<p class="list">where such changes and/or additions to the Program
originate from and are distributed by that particular Contributor. A
Contribution 'originates' from a Contributor if it was added to the
Program by such Contributor itself or anyone acting on such
Contributor's behalf. Contributions do not include additions to the
Program which: (i) are separate modules of software distributed in
conjunction with the Program under their own license agreement, and (ii)
are not derivative works of the Program.</p>
<p>&quot;Contributor&quot; means any person or entity that distributes
the Program.</p>
<p>&quot;Licensed Patents&quot; mean patent claims licensable by a
Contributor which are necessarily infringed by the use or sale of its
Contribution alone or when combined with the Program.</p>
<p>&quot;Program&quot; means the Contributions distributed in accordance
with this Agreement.</p>
<p>&quot;Recipient&quot; means anyone who receives the Program under
this Agreement, including all Contributors.</p>
<p><b>2. GRANT OF RIGHTS</b></p>
<p class="list">a) Subject to the terms of this Agreement, each
Contributor hereby grants Recipient a non-exclusive, worldwide,
royalty-free copyright license to reproduce, prepare derivative works
of, publicly display, publicly perform, distribute and sublicense the
Contribution of such Contributor, if any, and such derivative works, in
source code and object code form.</p>
<p class="list">b) Subject to the terms of this Agreement, each
Contributor hereby grants Recipient a non-exclusive, worldwide,
royalty-free patent license under Licensed Patents to make, use, sell,
offer to sell, import and otherwise transfer the Contribution of such
Contributor, if any, in source code and object code form. This patent
license shall apply to the combination of the Contribution and the
Program if, at the time the Contribution is added by the Contributor,
such addition of the Contribution causes such combination to be covered
by the Licensed Patents. The patent license shall not apply to any other
combinations which include the Contribution. No hardware per se is
licensed hereunder.</p>
<p class="list">c) Recipient understands that although each Contributor
grants the licenses to its Contributions set forth herein, no assurances
are provided by any Contributor that the Program does not infringe the
patent or other intellectual property rights of any other entity. Each
Contributor disclaims any liability to Recipient for claims brought by
any other entity based on infringement of intellectual property rights
or otherwise. As a condition to exercising the rights and licenses
granted hereunder, each Recipient hereby assumes sole responsibility to
secure any other intellectual property rights needed, if any. For
example, if a third party patent license is required to allow Recipient
to distribute the Program, it is Recipient's responsibility to acquire
that license before distributing the Program.</p>
<p class="list">d) Each Contributor represents that to its knowledge it
has sufficient copyright rights in its Contribution, if any, to grant
the copyright license set forth in this Agreement.</p>
<p><b>3. REQUIREMENTS</b></p>
<p>A Contributor may choose to distribute the Program in object code
form under its own license agreement, provided that:</p>
<p class="list">a) it complies with the terms and conditions of this
Agreement; and</p>
<p class="list">b) its license agreement:</p>
<p class="list">i) effectively disclaims on behalf of all Contributors
all warranties and conditions, express and implied, including warranties
or conditions of title and non-infringement, and implied warranties or
conditions of merchantability and fitness for a particular purpose;</p>
<p class="list">ii) effectively excludes on behalf of all Contributors
all liability for damages, including direct, indirect, special,
incidental and consequential damages, such as lost profits;</p>
<p class="list">iii) states that any provisions which differ from this
Agreement are offered by that Contributor alone and not by any other
party; and</p>
<p class="list">iv) states that source code for the Program is available
from such Contributor, and informs licensees how to obtain it in a
reasonable manner on or through a medium customarily used for software
exchange.</p>
<p>When the Program is made available in source code form:</p>
<p class="list">a) it must be made available under this Agreement; and</p>
<p class="list">b) a copy of this Agreement must be included with each
copy of the Program.</p>
<p>Contributors may not remove or alter any copyright notices contained
within the Program.</p>
<p>Each Contributor must identify itself as the originator of its
Contribution, if any, in a manner that reasonably allows subsequent
Recipients to identify the originator of the Contribution.</p>
<p><b>4. COMMERCIAL DISTRIBUTION</b></p>
<p>Commercial distributors of software may accept certain
responsibilities with respect to end users, business partners and the
like. While this license is intended to facilitate the commercial use of
the Program, the Contributor who includes the Program in a commercial
product offering should do so in a manner which does not create
potential liability for other Contributors. Therefore, if a Contributor
includes the Program in a commercial product offering, such Contributor
(&quot;Commercial Contributor&quot;) hereby agrees to defend and
indemnify every other Contributor (&quot;Indemnified Contributor&quot;)
against any losses, damages and costs (collectively &quot;Losses&quot;)
arising from claims, lawsuits and other legal actions brought by a third
party against the Indemnified Contributor to the extent caused by the
acts or omissions of such Commercial Contributor in connection with its
distribution of the Program in a commercial product offering. The
obligations in this section do not apply to any claims or Losses
relating to any actual or alleged intellectual property infringement. In
order to qualify, an Indemnified Contributor must: a) promptly notify
the Commercial Contributor in writing of such claim, and b) allow the
Commercial Contributor to control, and cooperate with the Commercial
Contributor in, the defense and any related settlement negotiations. The
Indemnified Contributor may participate in any such claim at its own
expense.</p>
<p>For example, a Contributor might include the Program in a commercial
product offering, Product X. That Contributor is then a Commercial
Contributor. If that Commercial Contributor then makes performance
claims, or offers warranties related to Product X, those performance
claims and warranties are such Commercial Contributor's responsibility
alone. Under this section, the Commercial Contributor would have to
defend claims against the other Contributors related to those
performance claims and warranties, and if a court requires any other
Contributor to pay any damages as a result, the Commercial Contributor
must pay those damages.</p>
<p><b>5. NO WARRANTY</b></p>
<p>EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS
PROVIDED ON AN &quot;AS IS&quot; BASIS, WITHOUT WARRANTIES OR CONDITIONS
OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION,
ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY
OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
responsible for determining the appropriateness of using and
distributing the Program and assumes all risks associated with its
exercise of rights under this Agreement , including but not limited to
the risks and costs of program errors, compliance with applicable laws,
damage to or loss of data, programs or equipment, and unavailability or
interruption of operations.</p>
<p><b>6. DISCLAIMER OF LIABILITY</b></p>
<p>EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT
NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING
WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR
DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED
HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.</p>
<p><b>7. GENERAL</b></p>
<p>If any provision of this Agreement is invalid or unenforceable under
applicable law, it shall not affect the validity or enforceability of
the remainder of the terms of this Agreement, and without further action
by the parties hereto, such provision shall be reformed to the minimum
extent necessary to make such provision valid and enforceable.</p>
<p>If Recipient institutes patent litigation against any entity
(including a cross-claim or counterclaim in a lawsuit) alleging that the
Program itself (excluding combinations of the Program with other
software or hardware) infringes such Recipient's patent(s), then such
Recipient's rights granted under Section 2(b) shall terminate as of the
date such litigation is filed.</p>
<p>All Recipient's rights under this Agreement shall terminate if it
fails to comply with any of the material terms or conditions of this
Agreement and does not cure such failure in a reasonable period of time
after becoming aware of such noncompliance. If all Recipient's rights
under this Agreement terminate, Recipient agrees to cease use and
distribution of the Program as soon as reasonably practicable. However,
Recipient's obligations under this Agreement and any licenses granted by
Recipient relating to the Program shall continue and survive.</p>
<p>Everyone is permitted to copy and distribute copies of this
Agreement, but in order to avoid inconsistency the Agreement is
copyrighted and may only be modified in the following manner. The
Agreement Steward reserves the right to publish new versions (including
revisions) of this Agreement from time to time. No one other than the
Agreement Steward has the right to modify this Agreement. The Eclipse
Foundation is the initial Agreement Steward. The Eclipse Foundation may
assign the responsibility to serve as the Agreement Steward to a
suitable separate entity. Each new version of the Agreement will be
given a distinguishing version number. The Program (including
Contributions) may always be distributed subject to the version of the
Agreement under which it was received. In addition, after a new version
of the Agreement is published, Contributor may elect to distribute the
Program (including its Contributions) under the new version. Except as
expressly stated in Sections 2(a) and 2(b) above, Recipient receives no
rights or licenses to the intellectual property of any Contributor under
this Agreement, whether expressly, by implication, estoppel or
otherwise. All rights in the Program not expressly granted under this
Agreement are reserved.</p>
<p>This Agreement is governed by the laws of the State of New York and
the intellectual property laws of the United States of America. No party
to this Agreement will bring a legal action under this Agreement more
than one year after the cause of action arose. Each party waives its
rights to a jury trial in any resulting litigation.</p>
</body>
</html>

150
features/com.irtsaintexupery.epl/feature.properties

@ -0,0 +1,150 @@ @@ -0,0 +1,150 @@
###############################################################################
# Copyright (c) 2015 IRT AESE (IRT Saint Exupery).
# 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:
# Bassem Ouni and Pierre Gaufillet (IRT Saint Exupéry) - initial API and implementation
#
###############################################################################
# "copyright" property - text of the "Feature Update Copyright"
copyright=\
Copyright (c) 2000, 2017 IRT AESE (IRT Saint Exupéry).\n\
All rights reserved. This program and the accompanying materials\n\
are made available under the terms of the Eclipse Public License v1.0\n\
which accompanies this distribution, and is available at\n\
http://www.eclipse.org/legal/epl-v10.html\n
# "licenseURL" property - URL of the "Feature License"
# do not translate value - just change to point to a locale-specific HTML page
licenseURL=license.html
# "license" property - text of the "Feature Update License"
# should be plain text version of license agreement pointed to be "licenseURL"
license=\
IRT AESE (IRT Saint Exupéry) Software User Agreement\n\
August 17, 2017\n\
\n\
Usage Of Content\n\
\n\
THE IRT AESE (IRT SAINT EXUPERY) MAKES AVAILABLE SOFTWARE, DOCUMENTATION,\n\
INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY\n\
"CONTENT"). USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF\n\
THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR\n\
NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU\n\
AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED BY THIS AGREEMENT\n\
AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS\n\
OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE\n\
TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS\n\
OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED\n\
BELOW, THEN YOU MAY NOT USE THE CONTENT.\n\
\n\
Applicable Licenses\n\
\n\
Unless otherwise indicated, all Content made available by the\n\
IRT AESE (IRT Saint Exupéry) is provided to you under the terms and conditions of\n\
the Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is provided\n\
with this Content and is also available at http://www.eclipse.org/legal/epl-v10.html.\n\
For purposes of the EPL, "Program" will mean the Content.\n\
\n\
Content includes, but is not limited to, source code, object code,\n\
documentation and other files maintained in the IRT AESE (IRT Saint Exupéry) source code\n\
repository ("Repository") in software modules ("Modules") and made available\n\
as downloadable archives ("Downloads").\n\
\n\
\t- Content may be structured and packaged into modules to facilitate delivering,\n\
\t extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"),\n\
\t plug-in fragments ("Fragments"), and features ("Features").\n\
\t- Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java(TM) ARchive)\n\
\t in a directory named "plugins".\n\
\t- A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.\n\
\t Each Feature may be packaged as a sub-directory in a directory named "features".\n\
\t Within a Feature, files named "feature.xml" may contain a list of the names and version\n\
\t numbers of the Plug-ins and/or Fragments associated with that Feature.\n\
\t- Features may also include other Features ("Included Features"). Within a Feature, files\n\
\t named "feature.xml" may contain a list of the names and version numbers of Included Features.\n\
\n\
The terms and conditions governing Plug-ins and Fragments should be\n\
contained in files named "about.html" ("Abouts"). The terms and\n\
conditions governing Features and Included Features should be contained\n\
in files named "license.html" ("Feature Licenses"). Abouts and Feature\n\
Licenses may be located in any directory of a Download or Module\n\
including, but not limited to the following locations:\n\
\n\
\t- The top-level (root) directory\n\
\t- Plug-in and Fragment directories\n\
\t- Inside Plug-ins and Fragments packaged as JARs\n\
\t- Sub-directories of the directory named "src" of certain Plug-ins\n\
\t- Feature directories\n\
\n\
Note: if a Feature made available by the IRT AESE (IRT Saint Exupéry) is installed using the\n\
Provisioning Technology (as defined below), you must agree to a license ("Feature \n\
Update License") during the installation process. If the Feature contains\n\
Included Features, the Feature Update License should either provide you\n\
with the terms and conditions governing the Included Features or inform\n\
you where you can locate them. Feature Update Licenses may be found in\n\
the "license" property of files named "feature.properties" found within a Feature.\n\
Such Abouts, Feature Licenses, and Feature Update Licenses contain the\n\
terms and conditions (or references to such terms and conditions) that\n\
govern your use of the associated Content in that directory.\n\
\n\
THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER\n\
TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.\n\
SOME OF THESE OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):\n\
\n\
\t- Eclipse Distribution License Version 1.0 (available at http://www.eclipse.org/licenses/edl-v1.0.html)\n\
\t- Common Public License Version 1.0 (available at http://www.eclipse.org/legal/cpl-v10.html)\n\
\t- Apache Software License 1.1 (available at http://www.apache.org/licenses/LICENSE)\n\
\t- Apache Software License 2.0 (available at http://www.apache.org/licenses/LICENSE-2.0)\n\
\t- Mozilla Public License Version 1.1 (available at http://www.mozilla.org/MPL/MPL-1.1.html)\n\
\n\
IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR\n\
TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License\n\
is provided, please contact the IRT AESE (IRT Saint Exupéry) to determine what terms and conditions\n\
govern that particular Content.\n\
\n\
\n\Use of Provisioning Technology\n\
\n\
The IRT AESE (IRT Saint Exupéry) makes available provisioning software, examples of which include,\n\
but are not limited to, p2 and the Eclipse Update Manager ("Provisioning Technology") for\n\
the purpose of allowing users to install software, documentation, information and/or\n\
other materials (collectively "Installable Software"). This capability is provided with\n\
the intent of allowing such users to install, extend and update Eclipse-based products.\n\
Information about packaging Installable Software is available at\n\
http://eclipse.org/equinox/p2/repository_packaging.html ("Specification").\n\
\n\
You may use Provisioning Technology to allow other parties to install Installable Software.\n\
You shall be responsible for enabling the applicable license agreements relating to the\n\
Installable Software to be presented to, and accepted by, the users of the Provisioning Technology\n\
in accordance with the Specification. By using Provisioning Technology in such a manner and\n\
making it available in accordance with the Specification, you further acknowledge your\n\
agreement to, and the acquisition of all necessary rights to permit the following:\n\
\n\
\t1. A series of actions may occur ("Provisioning Process") in which a user may execute\n\
\t the Provisioning Technology on a machine ("Target Machine") with the intent of installing,\n\
\t extending or updating the functionality of an Eclipse-based product.\n\
\t2. During the Provisioning Process, the Provisioning Technology may cause third party\n\
\t Installable Software or a portion thereof to be accessed and copied to the Target Machine.\n\
\t3. Pursuant to the Specification, you will provide to the user the terms and conditions that\n\
\t govern the use of the Installable Software ("Installable Software Agreement") and such\n\
\t Installable Software Agreement shall be accessed from the Target Machine in accordance\n\
\t with the Specification. Such Installable Software Agreement must inform the user of the\n\
\t terms and conditions that govern the Installable Software and must solicit acceptance by\n\
\t the end user in the manner prescribed in such Installable Software Agreement. Upon such\n\
\t indication of agreement by the user, the provisioning Technology will complete installation\n\
\t of the Installable Software.\n\
\n\
Cryptography\n\
\n\
Content may contain encryption software. The country in which you are\n\
currently may have restrictions on the import, possession, and use,\n\
and/or re-export to another country, of encryption software. BEFORE\n\
using any encryption software, please check the country's laws,\n\
regulations and policies concerning the import, possession, or use, and\n\
re-export of encryption software, to see if this is permitted.\n\
\n\
Java and all Java-based trademarks are trademarks of Oracle Corporation in the United States, other countries, or both.\n
########### end of license property ##########################################

20
features/com.irtsaintexupery.epl/feature.xml

@ -0,0 +1,20 @@ @@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<feature
id="com.irtsaintexupery.epl"
label="EPL license for IRT Saint Exupéry"
version="1.0.0.qualifier"
provider-name="IRT AESE (IRT Saint Exupéry)">
<description>
EPL license for IRT AESE (IRT Saint Exupéry).
</description>
<copyright url="http://www.irt-saintexupery.com">
%copyright
</copyright>
<license url="%licenseURL">
%license
</license>
</feature>

107
features/com.irtsaintexupery.epl/license.html

@ -0,0 +1,107 @@ @@ -0,0 +1,107 @@
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>IRT AESE (IRT Saint Exupéry) Software User Agreement</title>
</head>
<body lang="EN-US">
<h2>IRT AESE (IRT Saint Exupéry) Software User Agreement</h2>
<p>August 17, 2017</p>
<h3>Usage Of Content</h3>
<p>THE IRT AESE (IRT SAINT EXUPERY) MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS
(COLLECTIVELY &quot;CONTENT&quot;). USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND
CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE
OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR
NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND
CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.</p>
<h3>Applicable Licenses</h3>
<p>Unless otherwise indicated, all Content made available by the IRT AESE (IRT Saint Exupéry) is provided to you under the terms and conditions of the Eclipse Public License Version 1.0
(&quot;EPL&quot;). A copy of the EPL is provided with this Content and is also available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
<p>Content includes, but is not limited to, source code, object code, documentation and other files maintained in the IRT AESE (IRT Saint Exupéry) source code
repository (&quot;Repository&quot;) in software modules (&quot;Modules&quot;) and made available as downloadable archives (&quot;Downloads&quot;).</p>
<ul>
<li>Content may be structured and packaged into modules to facilitate delivering, extending, and upgrading the Content. Typical modules may include plug-ins (&quot;Plug-ins&quot;), plug-in fragments (&quot;Fragments&quot;), and features (&quot;Features&quot;).</li>
<li>Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java&trade; ARchive) in a directory named &quot;plugins&quot;.</li>
<li>A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material. Each Feature may be packaged as a sub-directory in a directory named &quot;features&quot;. Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of the Plug-ins
and/or Fragments associated with that Feature.</li>
<li>Features may also include other Features (&quot;Included Features&quot;). Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of Included Features.</li>
</ul>
<p>The terms and conditions governing Plug-ins and Fragments should be contained in files named &quot;about.html&quot; (&quot;Abouts&quot;). The terms and conditions governing Features and
Included Features should be contained in files named &quot;license.html&quot; (&quot;Feature Licenses&quot;). Abouts and Feature Licenses may be located in any directory of a Download or Module
including, but not limited to the following locations:</p>
<ul>
<li>The top-level (root) directory</li>
<li>Plug-in and Fragment directories</li>
<li>Inside Plug-ins and Fragments packaged as JARs</li>
<li>Sub-directories of the directory named &quot;src&quot; of certain Plug-ins</li>
<li>Feature directories</li>
</ul>
<p>Note: if a Feature made available by the IRT AESE (IRT Saint Exupéry) is installed using the Provisioning Technology (as defined below), you must agree to a license (&quot;Feature Update License&quot;) during the
installation process. If the Feature contains Included Features, the Feature Update License should either provide you with the terms and conditions governing the Included Features or
inform you where you can locate them. Feature Update Licenses may be found in the &quot;license&quot; property of files named &quot;feature.properties&quot; found within a Feature.
Such Abouts, Feature Licenses, and Feature Update Licenses contain the terms and conditions (or references to such terms and conditions) that govern your use of the associated Content in
that directory.</p>
<p>THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE
OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</p>
<ul>
<li>Eclipse Distribution License Version 1.0 (available at <a href="http://www.eclipse.org/licenses/edl-v10.html">http://www.eclipse.org/licenses/edl-v1.0.html</a>)</li>
<li>Common Public License Version 1.0 (available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>)</li>
<li>Apache Software License 1.1 (available at <a href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</a>)</li>
<li>Apache Software License 2.0 (available at <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>)</li>
<li>Mozilla Public License Version 1.1 (available at <a href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</a>)</li>
</ul>
<p>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License is provided, please
contact the IRT AESE (IRT Saint Exupéry) to determine what terms and conditions govern that particular Content.</p>
<h3>Use of Provisioning Technology</h3>
<p>The IRT AESE (IRT Saint Exupéry) makes available provisioning software, examples of which include, but are not limited to, p2 and the Eclipse
Update Manager (&quot;Provisioning Technology&quot;) for the purpose of allowing users to install software, documentation, information and/or
other materials (collectively &quot;Installable Software&quot;). This capability is provided with the intent of allowing such users to
install, extend and update Eclipse-based products. Information about packaging Installable Software is available at <a
href="http://eclipse.org/equinox/p2/repository_packaging.html">http://eclipse.org/equinox/p2/repository_packaging.html</a>
(&quot;Specification&quot;).</p>
<p>You may use Provisioning Technology to allow other parties to install Installable Software. You shall be responsible for enabling the
applicable license agreements relating to the Installable Software to be presented to, and accepted by, the users of the Provisioning Technology
in accordance with the Specification. By using Provisioning Technology in such a manner and making it available in accordance with the
Specification, you further acknowledge your agreement to, and the acquisition of all necessary rights to permit the following:</p>
<ol>
<li>A series of actions may occur (&quot;Provisioning Process&quot;) in which a user may execute the Provisioning Technology
on a machine (&quot;Target Machine&quot;) with the intent of installing, extending or updating the functionality of an Eclipse-based
product.</li>
<li>During the Provisioning Process, the Provisioning Technology may cause third party Installable Software or a portion thereof to be
accessed and copied to the Target Machine.</li>
<li>Pursuant to the Specification, you will provide to the user the terms and conditions that govern the use of the Installable
Software (&quot;Installable Software Agreement&quot;) and such Installable Software Agreement shall be accessed from the Target
Machine in accordance with the Specification. Such Installable Software Agreement must inform the user of the terms and conditions that govern
the Installable Software and must solicit acceptance by the end user in the manner prescribed in such Installable Software Agreement. Upon such
indication of agreement by the user, the provisioning Technology will complete installation of the Installable Software.</li>
</ol>
<h3>Cryptography</h3>
<p>Content may contain encryption software. The country in which you are currently may have restrictions on the import, possession, and use, and/or re-export to
another country, of encryption software. BEFORE using any encryption software, please check the country's laws, regulations and policies concerning the import,
possession, or use, and re-export of encryption software, to see if this is permitted.</p>
<p><small>Java and all Java-based trademarks are trademarks of Oracle Corporation in the United States, other countries, or both.</small></p>
</body>
</html>

18
features/com.irtsaintexupery.epl/pom.xml

@ -0,0 +1,18 @@ @@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.irtsaintexupery</groupId>
<artifactId>parent</artifactId>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../../releng/com.irtsaintexupery.parent</relativePath>
</parent>
<groupId>com.irtsaintexupery.features</groupId>
<artifactId>com.irtsaintexupery.epl</artifactId>
<packaging>eclipse-feature</packaging>
<version>1.0.0-SNAPSHOT</version>
</project>

7
plugins/com.irtsaintexupery.capella2aadl.ui/.classpath

@ -0,0 +1,7 @@ @@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>

2
plugins/com.irtsaintexupery.capella2aadl.ui/.gitignore vendored

@ -0,0 +1,2 @@ @@ -0,0 +1,2 @@
/bin
/target/

28
plugins/com.irtsaintexupery.capella2aadl.ui/.project

@ -0,0 +1,28 @@ @@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>com.irtsaintexupery.capella2aadl.ui</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>

6
plugins/com.irtsaintexupery.capella2aadl.ui/.settings/org.eclipse.jdt.core.prefs

@ -0,0 +1,6 @@ @@ -0,0 +1,6 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
org.eclipse.jdt.core.compiler.compliance=1.5
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.5

21
plugins/com.irtsaintexupery.capella2aadl.ui/META-INF/MANIFEST.MF

@ -0,0 +1,21 @@ @@ -0,0 +1,21 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: com.irtsaintexupery.capella2aadl.ui;singleton:=true
Bundle-Version: 1.1.1.qualifier
Bundle-Activator: com.irtsaintexupery.capella2aadl.ui.Activator
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
org.eclipse.core.resources,
com.irtsaintexupery.capella2aadl,
org.eclipse.emf.ecore,
org.eclipse.emf.ecore.xmi,
org.eclipse.ocl,
org.eclipse.ocl.ecore,
org.eclipse.acceleo.model,
org.eclipse.acceleo.engine
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-ActivationPolicy: lazy
Eclipse-LazyStart: true

9
plugins/com.irtsaintexupery.capella2aadl.ui/build.properties

@ -0,0 +1,9 @@ @@ -0,0 +1,9 @@
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
plugin.properties,\
.,\
plugin.xml,\
icons/
bin.excludes = icons/Capella2aadl16x16.xcf

BIN
plugins/com.irtsaintexupery.capella2aadl.ui/icons/Capella2aadl16x16.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 779 B

BIN
plugins/com.irtsaintexupery.capella2aadl.ui/icons/Capella2aadl16x16.xcf

Binary file not shown.

15
plugins/com.irtsaintexupery.capella2aadl.ui/plugin.properties

@ -0,0 +1,15 @@ @@ -0,0 +1,15 @@
###############################################################################
# Copyright (c) 2015, 2016 IRT AESE (IRT Saint Exupery).
# 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:
# Bassem Ouni and Pierre Gaufillet (IRT Saint Exupéry) - initial API and implementation
#
###############################################################################
#
pluginName = Capella2AADL UI
providerName = IRT AESE (IRT Saint Exupéry)

49
plugins/com.irtsaintexupery.capella2aadl.ui/plugin.xml

@ -0,0 +1,49 @@ @@ -0,0 +1,49 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.2"?>
<!--
Copyright (c) 2015, 2016 IRT AESE (IRT Saint Exupery).
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:
Bassem Ouni and Pierre Gaufillet (IRT Saint Exupéry) - initial API and implementation
-->
<plugin>
<extension
point="org.eclipse.ui.menus">
<menuContribution
allPopups="false"
locationURI="popup:org.eclipse.ui.popup.any?after=additions">
<command
commandId="com.irtsaintexupery.capella2aadl.translate"
icon="icons/Capella2aadl16x16.png"
style="push">
<visibleWhen
checkEnabled="false">
<with
variable="activeMenuSelection">
<iterate
ifEmpty="false"
operator="and">
<adapt
type="org.eclipse.core.resources.IFile">
</adapt>
</iterate>
</with>
</visibleWhen>
</command>
</menuContribution>
</extension>
<extension
point="org.eclipse.ui.commands">
<command
defaultHandler="com.irtsaintexupery.capella2aadl.ui.popupMenus.Capella2AADLTransformer"
id="com.irtsaintexupery.capella2aadl.translate"
name="Transform Capella into AADL">
</command>
</extension>
</plugin>

17
plugins/com.irtsaintexupery.capella2aadl.ui/pom.xml

@ -0,0 +1,17 @@ @@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.irtsaintexupery</groupId>
<artifactId>parent</artifactId>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../../releng/com.irtsaintexupery.parent</relativePath>
</parent>
<artifactId>com.irtsaintexupery.capella2aadl.ui</artifactId>
<packaging>eclipse-plugin</packaging>
<version>1.1.1-SNAPSHOT</version>
</project>

68
plugins/com.irtsaintexupery.capella2aadl.ui/src/com/irtsaintexupery/capella2aadl/ui/Activator.java

@ -0,0 +1,68 @@ @@ -0,0 +1,68 @@
/*******************************************************************************
* Copyright (c) 2008, 2012 Obeo.
* 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:
* Obeo - initial API and implementation
*******************************************************************************/
package com.irtsaintexupery.capella2aadl.ui;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;
/**
* The activator class controls the plug-in life cycle.
*/
public class Activator extends AbstractUIPlugin {
/**
* The plug-in ID.
*/
public static final String PLUGIN_ID = "com.irtsaintexupery.capella2aadl.ui";
/**
* The shared instance.
*/
private static Activator plugin;
/**
* The constructor.
*/
public Activator() {
}
/**{@inheritDoc}
*
* @see org.eclipse.core.runtime.Plugin#start(org.osgi.framework.BundleContext)
* @generated
*/
@Override
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
}
/**{@inheritDoc}
*
* @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext)
* @generated
*/
@Override
public void stop(BundleContext context) throws Exception {
plugin = null;
super.stop(context);
}
/**
* Returns the shared instance.
*
* @return the shared instance
*/
public static Activator getDefault() {
return plugin;
}
}

92
plugins/com.irtsaintexupery.capella2aadl.ui/src/com/irtsaintexupery/capella2aadl/ui/common/GenerateAll.java

@ -0,0 +1,92 @@ @@ -0,0 +1,92 @@
/*******************************************************************************
* Copyright (c) 2008, 2012 Obeo.
* 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:
* Obeo - initial API and implementation
*******************************************************************************/
package com.irtsaintexupery.capella2aadl.ui.common;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.emf.common.util.BasicMonitor;
import org.eclipse.emf.common.util.URI;
/**
* Main entry point of the 'Capella2aadl' generation module.
*/
public class GenerateAll {
/**
* The model URI.
*/
private URI modelURI;
/**
* The output folder.
*/
private IContainer targetFolder;
/**
* The other arguments.
*/
List<? extends Object> arguments;
/**
* Constructor.
*
* @param modelURI
* is the URI of the model.
* @param targetFolder
* is the output folder
* @param arguments
* are the other arguments
* @throws IOException
* Thrown when the output cannot be saved.
* @generated
*/
public GenerateAll(URI modelURI, IContainer targetFolder, List<? extends Object> arguments) {
this.modelURI = modelURI;
this.targetFolder = targetFolder;
this.arguments = arguments;
}
/**
* Launches the generation.
*
* @param monitor
* This will be used to display progress information to the user.
* @throws IOException
* Thrown when the output cannot be saved.
* @generated
*/
public void doGenerate(IProgressMonitor monitor) throws IOException {
if (!targetFolder.getLocation().toFile().exists()) {
targetFolder.getLocation().toFile().mkdirs();
}
// final URI template0 = getTemplateURI("com.irtsaintexupery.capella2aadl", new Path("/com/irtsaintexupery/capella2aadl/main/capella2aadl.emtl"));
// com.irtsaintexupery.capella2aadl.main.Capella2aadl gen0 = new com.irtsaintexupery.capella2aadl.main.Capella2aadl(modelURI, targetFolder.getLocation().toFile(), arguments) {
// protected URI createTemplateURI(String entry) {
// return template0;
// }
//};
//gen0.doGenerate(BasicMonitor.toMonitor(monitor));
monitor.subTask("Loading...");
com.irtsaintexupery.capella2aadl.main.Capella2aadl gen0 = new com.irtsaintexupery.capella2aadl.main.Capella2aadl(modelURI, targetFolder.getLocation().toFile(), arguments);
monitor.worked(1);
String generationID = org.eclipse.acceleo.engine.utils.AcceleoLaunchingUtil.computeUIProjectID("com.irtsaintexupery.capella2aadl", "com.irtsaintexupery.capella2aadl.main.Capella2aadl", modelURI.toString(), targetFolder.getFullPath().toString(), new ArrayList<String>());
gen0.setGenerationID(generationID);
gen0.doGenerate(BasicMonitor.toMonitor(monitor));
}
}

120
plugins/com.irtsaintexupery.capella2aadl.ui/src/com/irtsaintexupery/capella2aadl/ui/popupMenus/Capella2AADLTransformer.java

@ -0,0 +1,120 @@ @@ -0,0 +1,120 @@
/*******************************************************************************
* Copyright (c) 2015, 2016 IRT AESE (IRT Saint Exupery).
* 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:
* Bassem Ouni and Pierre Gaufillet (IRT Saint Exupéry) - initial API and implementation
*
*******************************************************************************/
package com.irtsaintexupery.capella2aadl.ui.popupMenus;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.emf.common.util.URI;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.handlers.HandlerUtil;
import com.irtsaintexupery.capella2aadl.ui.Activator;
import com.irtsaintexupery.capella2aadl.ui.common.GenerateAll;
public class Capella2AADLTransformer extends AbstractHandler {
public Object execute(ExecutionEvent event) throws ExecutionException {
ISelection selection = HandlerUtil.getActiveWorkbenchWindow(event).getActivePage().getSelection();
if (selection != null & selection instanceof IStructuredSelection) {
IStructuredSelection strucSelection = (IStructuredSelection) selection;
for (Object element : strucSelection.toList()) {
if (element instanceof IFile) {
final IFile input_file = (IFile) element;
IRunnableWithProgress operation = new IRunnableWithProgress() {
public void run(IProgressMonitor monitor) {
try {
try {
IContainer target = input_file.getProject().getFolder("aadl-gen");
if (target.exists()) {
// Clean up target folder of its aadl
// files
for (IResource f : target.members()) {
String ext = f.getFileExtension();
if (ext != null ? ext.equals("aadl") : false)
f.delete(true, null);
}
}
} finally {
input_file.getProject().refreshLocal(IResource.DEPTH_INFINITE, null);
}
} catch (CoreException e) {
IStatus status = new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.getMessage(), e);
Activator.getDefault().getLog().log(status);
}
try {
URI modelURI = URI.createPlatformResourceURI(input_file.getFullPath().toString(), true);
IContainer target = input_file.getProject().getFolder("aadl-gen");
GenerateAll generator = new GenerateAll(modelURI, target, getArguments());
generator.doGenerate(monitor);
} catch (IOException e) {
IStatus status = new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.getMessage(), e);
Activator.getDefault().getLog().log(status);
} finally {
try {
input_file.getProject().refreshLocal(IResource.DEPTH_INFINITE, monitor);
} catch (CoreException e) {
IStatus status = new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.getMessage(), e);
Activator.getDefault().getLog().log(status);
}
}
}
};
try {
PlatformUI.getWorkbench().getProgressService().run(true, true, operation);
} catch (InvocationTargetException e) {
IStatus status = new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.getMessage(), e);
Activator.getDefault().getLog().log(status);
} catch (InterruptedException e) {
IStatus status = new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.getMessage(), e);
Activator.getDefault().getLog().log(status);
}
}
}
}
return null;
}
/**
* Computes the arguments of the generator.
*
* @return the arguments
* @generated
*/
protected List<? extends Object> getArguments() {
return new ArrayList<String>();
}
}

7
plugins/com.irtsaintexupery.capella2aadl/.classpath

@ -0,0 +1,7 @@ @@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" output="bin" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>

3
plugins/com.irtsaintexupery.capella2aadl/.gitignore vendored

@ -0,0 +1,3 @@ @@ -0,0 +1,3 @@
/tasks
/bin
/target/

50
plugins/com.irtsaintexupery.capella2aadl/.project

@ -0,0 +1,50 @@ @@ -0,0 +1,50 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>com.irtsaintexupery.capella2aadl</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.acceleo.ide.ui.acceleoBuilder</name>
<arguments>
<dictionary>
<key>compilation.kind</key>
<value>compilation.platform.resource</value>
</dictionary>
<dictionary>
<key>compliance</key>
<value>pragmatic</value>
</dictionary>
<dictionary>
<key>resource.kind</key>
<value>xmi</value>
</dictionary>
<dictionary>
<key>trim-position</key>
<value>false</value>
</dictionary>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.acceleo.ide.ui.acceleoNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.pde.PluginNature</nature>
</natures>
</projectDescription>

26
plugins/com.irtsaintexupery.capella2aadl/META-INF/MANIFEST.MF

@ -0,0 +1,26 @@ @@ -0,0 +1,26 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: com.irtsaintexupery.capella2aadl
Bundle-Version: 1.2.2.qualifier
Bundle-Activator: com.irtsaintexupery.capella2aadl.Activator
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Require-Bundle: org.eclipse.core.runtime,
org.polarsys.capella.core.data.gen;bundle-version="1.1.0",
org.eclipse.emf.ecore,
org.eclipse.emf.ecore.xmi,
org.eclipse.ocl,
org.eclipse.ocl.ecore,
org.eclipse.acceleo.common;bundle-version="3.3.0",
org.eclipse.acceleo.model;bundle-version="3.3.0",
org.eclipse.acceleo.profiler;bundle-version="3.3.0",
org.eclipse.acceleo.engine;bundle-version="3.3.0",
com.google.guava,
org.polarsys.capella.common.libraries.gen;bundle-version="1.1.0"
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Bundle-ActivationPolicy: lazy
Eclipse-LazyStart: true
Export-Package: com.irtsaintexupery.capella2aadl.main,
com.irtsaintexupery.capella2aadl.requests

17
plugins/com.irtsaintexupery.capella2aadl/build.properties

@ -0,0 +1,17 @@ @@ -0,0 +1,17 @@
###############################################################################
# Copyright (c) 2015 IRT AESE (IRT Saint Exupery).
# 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:
# Bassem Ouni and Pierre Gaufillet (IRT Saint Exupéry) - initial API and implementation
#
###############################################################################
source.. = src/
output.. = bin/
bin.includes = plugin.properties, META-INF/,\
.
jre.compilation.profile = JavaSE-1.7

14
plugins/com.irtsaintexupery.capella2aadl/plugin.properties

@ -0,0 +1,14 @@ @@ -0,0 +1,14 @@
###############################################################################
# Copyright (c) 2015, 2016 IRT AESE (IRT Saint Exupery).
# 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:
# Bassem Ouni and Pierre Gaufillet (IRT Saint Exupéry) - initial API and implementation
#
###############################################################################
pluginName = Capella2AADL
providerName = IRT AESE (IRT Saint Exupéry)

60
plugins/com.irtsaintexupery.capella2aadl/pom.xml

@ -0,0 +1,60 @@ @@ -0,0 +1,60 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2015, 2017 IRT AESE (IRT Saint Exupery).
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:
Bassem Ouni and Pierre Gaufillet (IRT Saint Exupéry) - initial API and implementation
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.irtsaintexupery</groupId>
<artifactId>parent</artifactId>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../../releng/com.irtsaintexupery.parent</relativePath>
</parent>
<artifactId>com.irtsaintexupery.capella2aadl</artifactId>
<packaging>eclipse-plugin</packaging>
<version>1.2.2-SNAPSHOT</version>
<build>
<plugins>
<plugin>
<groupId>org.eclipse.acceleo</groupId>
<artifactId>org.eclipse.acceleo.maven</artifactId>
<configuration>
<useBinaryResources>false</useBinaryResources>
<usePlatformResourcePath>true</usePlatformResourcePath>
<acceleoProject>
<root>${project.basedir}</root>
<entries>
<entry>
<input>src</input>
<output>target/classes</output>
</entry>
</entries>
</acceleoProject>
<packagesToRegister>
<packageToRegister>org.eclipse.emf.ecore.EcorePackage</packageToRegister>
<packageToRegister>org.polarsys.capella.core.data.pa.PaPackage</packageToRegister>
<packageToRegister>org.polarsys.capella.core.data.cs.CsPackage</packageToRegister>
<packageToRegister>org.polarsys.capella.core.data.capellacore.CapellacorePackage</packageToRegister>
<packageToRegister>org.polarsys.capella.core.data.capellamodeller.CapellamodellerPackage</packageToRegister>
<packageToRegister>org.polarsys.capella.common.libraries.LibrariesPackage</packageToRegister>
<packageToRegister>org.polarsys.capella.core.data.capellacommon.CapellacommonPackage</packageToRegister>
<packageToRegister>org.polarsys.capella.core.data.capellacore.CapellacorePackage</packageToRegister>
</packagesToRegister>
</configuration>
</plugin>
</plugins>
</build>
</project>

69
plugins/com.irtsaintexupery.capella2aadl/src/com/irtsaintexupery/capella2aadl/Activator.java

@ -0,0 +1,69 @@ @@ -0,0 +1,69 @@
/*******************************************************************************
* Copyright (c) 2015, 2017 IRT AESE (IRT Saint Exupery).
* 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:
* Bassem Ouni and Pierre Gaufillet (IRT Saint Exupéry) - initial API and implementation
*
*******************************************************************************/
package com.irtsaintexupery.capella2aadl;
import org.eclipse.core.runtime.Plugin;
import org.osgi.framework.BundleContext;
/**
* The activator class controls the plug-in life cycle.
*/
public class Activator extends Plugin {
/**
* The plug-in ID.
*/
public static final String PLUGIN_ID = "com.irtsaintexupery.capella2aadl";
/**
* The shared instance.
*/
private static Activator plugin;
/**
* The constructor.
*/
public Activator() {
}
/**
* {@inheritDoc}
*
* @see org.eclipse.core.runtime.Plugin#start(org.osgi.framework.BundleContext)
*/
@Override
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
}
/**
* {@inheritDoc}
*
* @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext)
*/
@Override
public void stop(BundleContext context) throws Exception {
plugin = null;
super.stop(context);
}
/**
* Returns the shared instance.
*
* @return the shared instance
*/
public static Activator getDefault() {
return plugin;
}
}

407
plugins/com.irtsaintexupery.capella2aadl/src/com/irtsaintexupery/capella2aadl/main/Capella2aadl.java

@ -0,0 +1,407 @@ @@ -0,0 +1,407 @@
/*******************************************************************************
* Copyright (c) 2015, 2017 IRT AESE (IRT Saint Exupery).
* 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:
* Bassem Ouni and Pierre Gaufillet (IRT Saint Exupéry) - initial API and implementation
*
*******************************************************************************/
package com.irtsaintexupery.capella2aadl.main;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.acceleo.engine.event.IAcceleoTextGenerationListener;
import org.eclipse.acceleo.engine.generation.strategy.IAcceleoGenerationStrategy;
import org.eclipse.acceleo.engine.service.AbstractAcceleoGenerator;
import org.eclipse.emf.common.util.BasicMonitor;
import org.eclipse.emf.common.util.Monitor;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.resource.ResourceSet;
/**
* Entry point of the 'Capella2aadl' generation module.
*
* @generated
*/
public class Capella2aadl extends AbstractAcceleoGenerator {
/**
* The name of the module.
*
* @generated
*/
public static final String MODULE_FILE_NAME = "/com/irtsaintexupery/capella2aadl/main/capella2aadl";
/**
* The name of the templates that are to be generated.
*
* @generated
*/
public static final String[] TEMPLATE_NAMES = { "generateProject" };
/**
* The list of properties files from the launch parameters (Launch configuration).
*
* @generated
*/
private List<String> propertiesFiles = new ArrayList<String>();
/**
* Allows the public constructor to be used. Note that a generator created
* this way cannot be used to launch generations before one of
* {@link #initialize(EObject, File, List)} or
* {@link #initialize(URI, File, List)} is called.
* <p>
* The main reason for this constructor is to allow clients of this
* generation to call it from another Java file, as it allows for the
* retrieval of {@link #getProperties()} and
* {@link #getGenerationListeners()}.
* </p>
*
* @generated
*/
public Capella2aadl() {
// Empty implementation
}
/**
* This allows clients to instantiates a generator with all required information.
*
* @param modelURI
* URI where the model on which this generator will be used is located.
* @param targetFolder
* This will be used as the output folder for this generation : it will be the base path
* against which all file block URLs will be resolved.
* @param arguments
* If the template which will be called requires more than one argument taken from the model,
* pass them here.
* @throws IOException
* This can be thrown in three scenarios : the module cannot be found, it cannot be loaded, or
* the model cannot be loaded.
* @generated
*/
public Capella2aadl(URI modelURI, File targetFolder,
List<? extends Object> arguments) throws IOException {
initialize(modelURI, targetFolder, arguments);
}
/**
* This allows clients to instantiates a generator with all required information.
*
* @param model
* We'll iterate over the content of this element to find Objects matching the first parameter
* of the template we need to call.
* @param targetFolder
* This will be used as the output folder for this generation : it will be the base path
* against which all file block URLs will be resolved.
* @param arguments
* If the template which will be called requires more than one argument taken from the model,
* pass them here.
* @throws IOException
* This can be thrown in two scenarios : the module cannot be found, or it cannot be loaded.
* @generated
*/
public Capella2aadl(EObject model, File targetFolder,
List<? extends Object> arguments) throws IOException {
initialize(model, targetFolder, arguments);
}
/**
* This can be used to launch the generation from a standalone application.
*
* @param args
* Arguments of the generation.
* @generated
*/
public static void main(String[] args) {
try {
if (args.length < 2) {
System.out.println("Arguments not valid : {model, folder}.");
} else {
URI modelURI = URI.createFileURI(args[0]);
File folder = new File(args[1]);
List<String> arguments = new ArrayList<String>();
/*
* If you want to change the content of this method, do NOT forget to change the "@generated"
* tag in the Javadoc of this method to "@generated NOT". Without this new tag, any compilation
* of the Acceleo module with the main template that has caused the creation of this class will
* revert your modifications.
*/
/*
* Add in this list all the arguments used by the starting point of the generation
* If your main template is called on an element of your model and a String, you can
* add in "arguments" this "String" attribute.
*/
Capella2aadl generator = new Capella2aadl(modelURI, folder, arguments);
/*
* Add the properties from the launch arguments.
* If you want to programmatically add new properties, add them in "propertiesFiles"
* You can add the absolute path of a properties files, or even a project relative path.
* If you want to add another "protocol" for your properties files, please override
* "getPropertiesLoaderService(AcceleoService)" in order to return a new property loader.
* The behavior of the properties loader service is explained in the Acceleo documentation
* (Help -> Help Contents).
*/
for (int i = 2; i < args.length; i++) {
generator.addPropertiesFile(args[i]);
}
generator.doGenerate(new BasicMonitor());
}
} catch (IOException e) {
e.printStackTrace();
}
}
/**
* Launches the generation described by this instance.
*
* @param monitor
* This will be used to display progress information to the user.
* @throws IOException
* This will be thrown if any of the output files cannot be saved to disk.
* @generated
*/
@Override
public void doGenerate(Monitor monitor) throws IOException {
/*
* TODO if you wish to change the generation as a whole, override this. The default behavior should
* be sufficient in most cases. If you want to change the content of this method, do NOT forget to
* change the "@generated" tag in the Javadoc of this method to "@generated NOT". Without this new tag,
* any compilation of the Acceleo module with the main template that has caused the creation of this
* class will revert your modifications. If you encounter a problem with an unresolved proxy during the
* generation, you can remove the comments in the following instructions to check for problems. Please
* note that those instructions may have a significant impact on the performances.
*/
//org.eclipse.emf.ecore.util.EcoreUtil.resolveAll(model);
/*
* If you want to check for potential errors in your models before the launch of the generation, you
* use the code below.
*/
//if (model != null && model.eResource() != null) {
// List<org.eclipse.emf.ecore.resource.Resource.Diagnostic> errors = model.eResource().getErrors();
// for (org.eclipse.emf.ecore.resource.Resource.Diagnostic diagnostic : errors) {
// System.err.println(diagnostic.toString());
// }
//}
super.doGenerate(monitor);
}
/**
* If this generator needs to listen to text generation events, listeners can be returned from here.
*
* @return List of listeners that are to be notified when text is generated through this launch.
* @generated
*/
@Override
public List<IAcceleoTextGenerationListener> getGenerationListeners() {
List<IAcceleoTextGenerationListener> listeners = super.getGenerationListeners();
/*
* TODO if you need to listen to generation event, add listeners to the list here. If you want to change
* the content of this method, do NOT forget to change the "@generated" tag in the Javadoc of this method
* to "@generated NOT". Without this new tag, any compilation of the Acceleo module with the main template
* that has caused the creation of this class will revert your modifications.
*/
return listeners;
}
/**
* If you need to change the way files are generated, this is your entry point.
* <p>
* The default is {@link org.eclipse.acceleo.engine.generation.strategy.DefaultStrategy}; it generates
* files on the fly. If you only need to preview the results, return a new
* {@link org.eclipse.acceleo.engine.generation.strategy.PreviewStrategy}. Both of these aren't aware of
* the running Eclipse and can be used standalone.
* </p>
* <p>
* If you need the file generation to be aware of the workspace (A typical example is when you wanna
* override files that are under clear case or any other VCS that could forbid the overriding), then
* return a new {@link org.eclipse.acceleo.engine.generation.strategy.WorkspaceAwareStrategy}.
* <b>Note</b>, however, that this <b>cannot</b> be used standalone.
* </p>
* <p>
* All three of these default strategies support merging through JMerge.
* </p>
*
* @return The generation strategy that is to be used for generations launched through this launcher.
* @generated
*/
@Override
public IAcceleoGenerationStrategy getGenerationStrategy() {
return super.getGenerationStrategy();
}
/**
* This will be called in order to find and load the module that will be launched through this launcher.
* We expect this name not to contain file extension, and the module to be located beside the launcher.
*
* @return The name of the module that is to be launched.
* @generated
*/
@Override
public String getModuleName() {
return MODULE_FILE_NAME;
}
/**
* If the module(s) called by this launcher require properties files, return their qualified path from
* here.Take note that the first added properties files will take precedence over subsequent ones if they
* contain conflicting keys.
*
* @return The list of properties file we need to add to the generation context.
* @see java.util.ResourceBundle#getBundle(String)
* @generated
*/
@Override
public List<String> getProperties() {
/*
* If you want to change the content of this method, do NOT forget to change the "@generated"
* tag in the Javadoc of this method to "@generated NOT". Without this new tag, any compilation
* of the Acceleo module with the main template that has caused the creation of this class will
* revert your modifications.
*/
/*
* TODO if your generation module requires access to properties files, add their qualified path to the list here.
*
* Properties files can be located in an Eclipse plug-in or in the file system (all Acceleo projects are Eclipse
* plug-in). In order to use properties files located in an Eclipse plugin, you need to add the path of the properties
* files to the "propertiesFiles" list:
*
* final String prefix = "platform:/plugin/";
* final String pluginName = "org.eclipse.acceleo.module.sample";
* final String packagePath = "/org/eclipse/acceleo/module/sample/properties/";
* final String fileName = "default.properties";
* propertiesFiles.add(prefix + pluginName + packagePath + fileName);
*
* With this mechanism, you can load properties files from your plugin or from another plugin.
*
* You may want to load properties files from the file system, for that you need to add the absolute path of the file:
*
* propertiesFiles.add("C:\Users\MyName\MyFile.properties");
*
* If you want to let your users add properties files located in the same folder as the model:
*
* if (EMFPlugin.IS_ECLIPSE_RUNNING && model != null && model.eResource() != null) {
* propertiesFiles.addAll(AcceleoEngineUtils.getPropertiesFilesNearModel(model.eResource()));
* }
*
* To learn more about Properties Files, have a look at the Acceleo documentation (Help -> Help Contents).
*/
return propertiesFiles;
}
/**
* Adds a properties file in the list of properties files.
*
* @param propertiesFile
* The properties file to add.
* @generated
* @since 3.1
*/
@Override
public void addPropertiesFile(String propertiesFile) {
this.propertiesFiles.add(propertiesFile);
}
/**
* This will be used to get the list of templates that are to be launched by this launcher.
*
* @return The list of templates to call on the module {@link #getModuleName()}.
* @generated
*/
@Override
public String[] getTemplateNames() {
return TEMPLATE_NAMES;
}
/**
* This can be used to update the resource set's package registry with all needed EPackages.
*
* @param resourceSet
* The resource set which registry has to be updated.
* @generated
*/
@Override
public void registerPackages(ResourceSet resourceSet) {
super.registerPackages(resourceSet);
/*
* If you want to change the content of this method, do NOT forget to change the "@generated"
* tag in the Javadoc of this method to "@generated NOT". Without this new tag, any compilation
* of the Acceleo module with the main template that has caused the creation of this class will
* revert your modifications.
*/
/*
* If you need additional package registrations, you can register them here. The following line
* (in comment) is an example of the package registration for UML.
*
* You can use the method "isInWorkspace(Class c)" to check if the package that you are about to
* register is in the workspace.
*
* To register a package properly, please follow the following conventions:
*
* If the package is located in another plug-in, already installed in Eclipse. The following content should
* have been generated at the beginning of this method. Do not register the package using this mechanism if
* the metamodel is located in the workspace.
*
* if (!isInWorkspace(UMLPackage.class)) {
* // The normal package registration if your metamodel is in a plugin.
* resourceSet.getPackageRegistry().put(UMLPackage.eNS_URI, UMLPackage.eINSTANCE);
* }
*
* If the package is located in another project in your workspace, the plugin containing the package has not
* been register by EMF and Acceleo should register it automatically. If you want to use the generator in
* stand alone, the regular registration (seen a couple lines before) is needed.
*
* To learn more about Package Registration, have a look at the Acceleo documentation (Help -> Help Contents).
*/
}
/**
* This can be used to update the resource set's resource factory registry with all needed factories.
*
* @param resourceSet
* The resource set which registry has to be updated.
* @generated
*/
@Override
public void registerResourceFactories(ResourceSet resourceSet) {
super.registerResourceFactories(resourceSet);
/*
* If you want to change the content of this method, do NOT forget to change the "@generated"
* tag in the Javadoc of this method to "@generated NOT". Without this new tag, any compilation
* of the Acceleo module with the main template that has caused the creation of this class will
* revert your modifications.
*/
/*
* TODO If you need additional resource factories registrations, you can register them here. the following line
* (in comment) is an example of the resource factory registration for UML.
*
* If you want to use the generator in stand alone, the resource factory registration will be required.
*
* To learn more about the registration of Resource Factories, have a look at the Acceleo documentation (Help -> Help Contents).
*/
// resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put(UMLResource.FILE_EXTENSION, UMLResource.Factory.INSTANCE);
}
}

234
plugins/com.irtsaintexupery.capella2aadl/src/com/irtsaintexupery/capella2aadl/main/capella2aadl.mtl

@ -0,0 +1,234 @@ @@ -0,0 +1,234 @@
[comment encoding = UTF-8 /]
[**
* Copyright (c) 2015, 2017 IRT AESE (IRT Saint Exupery).
* 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:
* Bassem Ouni and Pierre Gaufillet (IRT Saint Exupéry) - initial API and implementation
*
*/]
[module capella2aadl('http://www.polarsys.org/capella/core/pa/1.1.0','http://www.polarsys.org/capella/core/core/1.1.0','http://www.polarsys.org/capella/core/modeller/1.1.0','http://www.polarsys.org/capella/common/libraries/1.1.0','http://www.polarsys.org/capella/common/core/1.1.0','http://www.polarsys.org/capella/core/common/1.1.0', 'http://www.polarsys.org/capella/core/cs/1.1.0', 'http://www.polarsys.org/capella/core/fa/1.1.0')]
[import com::irtsaintexupery::capella2aadl::requests::capella2aadl_queries /]
[template public generateProject(aProject: Project)]
[comment @main/]
[transformCapellaPhysicalLinksIntoAADLBusTopology(aProject)/]
[transformCapellaComponentExchangeIntoAADLConnections(aProject)/]
[for(cat: String | getBusNames(aProject))][generateBus(cat)/][/for]
[for(component: PhysicalComponent | PhysicalComponent.allInstances())][generatePhysicalComponent(component)/][/for]
[/template]
[**
* The documentation of the template generatePhysicalComponent.
* @param aPhysicalComponent
*/]
[template public generatePhysicalComponent(aPhysicalComponent : PhysicalComponent)]
[let PcName : String = aPhysicalComponent.name.replaceAll(' ', '_') ]
[if(not aPhysicalComponent.hasPropertyValue('isBus'))]
[file ((PcName + '.aadl').toLower(), false, 'UTF-8')]
package [PcName/]
public
[for(name: String | aPhysicalComponent.ownedPhysicalComponents->select(nature = PhysicalComponentNature::NODE).name->asSet()->union(getSyntheticPorts(aPhysicalComponent).getBusTypeForPort()->asSet())->sortedBy(s: String | s))]
with [name.replaceAll(' ', '_')/]; renames [name.replaceAll(' ', '_')/]::all;
[/for]
[for(processor: PhysicalComponent | aPhysicalComponent.ownedPhysicalComponents->select(kind=PhysicalComponentKind::SOFTWARE_EXECUTION_UNIT))]
[let processorPart: Part = Part.allInstances()->select(abstractType=processor)->any(eContainer()=aPhysicalComponent and name=processor.name)]
[let deployedParts: Sequence(Part) = processorPart.ownedDeploymentLinks.deployedElement]
[for(part: Part | deployedParts->sortedBy(name))]
with [part.abstractType.name.replaceAll(' ', '_')/]; renames [part.abstractType.name.replaceAll(' ', '_')/]::all;
[/for]
[/let][/let]
[/for]
[if(aPhysicalComponent.nature = PhysicalComponentNature::BEHAVIOR)]
[generateBehavior(aPhysicalComponent)/]
[else]
[generateNode(aPhysicalComponent)/]
[/if]
end [PcName/];
[/file]
[/if][/let][/template]
[template public generateBehavior(aPhysicalComponent : PhysicalComponent)]
[let PcName : String = aPhysicalComponent.name.replaceAll(' ', '_') ]
process [PcName/]
[if(aPhysicalComponent.ownedFeatures->filter(ComponentPort)->notEmpty())]
features
[for(port1: ComponentPort | aPhysicalComponent.ownedFeatures->filter(ComponentPort)->sortedBy(name))]
[if(port1.kind=ComponentPortKind::FLOW)] [port1.name.replaceAll(' ', '_')/]: [port1.orientation.getPortDirection()/] feature;[/if]
[/for][/if]
end [PcName/];
process implementation [PcName/].impl
end [PcName/].impl;
[/let]
[/template]
[template public generateNode(aPhysicalComponent : PhysicalComponent)]
[if(aPhysicalComponent.kind=PhysicalComponentKind::SOFTWARE_EXECUTION_UNIT)]
[generateProcessor(aPhysicalComponent)/]
[elseif(aPhysicalComponent.kind=PhysicalComponentKind::HARDWARE)]
[generateDevice(aPhysicalComponent)/]
[else]
[generateSystem(aPhysicalComponent)/]
[/if][/template]
[template public generateProcessor(aPhysicalComponent : PhysicalComponent)]
[let PcName : String = aPhysicalComponent.name.replaceAll(' ', '_') ]
processor [PcName/]
[if(getSyntheticPorts(aPhysicalComponent)->notEmpty())]
features
[for(pport: PhysicalPort | getSyntheticPorts(aPhysicalComponent)->sortedBy(name))]
[pport.name.toLowerCase().replaceAll(' ', '_')/]: requires bus access [getBusTypeForPort(pport).replaceAll(' ', '_')/].impl;
[/for][/if]
end [PcName/];
processor implementation [PcName/].impl
end [PcName/].impl;
[/let]
[/template]
[template public generateDevice(aPhysicalComponent : PhysicalComponent)]
[let PcName : String = aPhysicalComponent.name.replaceAll(' ', '_') ]
device [PcName/]
[if(getSyntheticPorts(aPhysicalComponent)->union(getComponentVirtualBehaviorPort(aPhysicalComponent))->notEmpty())]
features
[for(pport: PhysicalPort | getSyntheticPorts(aPhysicalComponent)->sortedBy(name))]
[pport.name.toLowerCase().replaceAll(' ', '_')/]: requires bus access [getBusTypeForPort(pport).replaceAll(' ', '_')/].impl;
[/for]
[for(pport: PhysicalPort | getComponentVirtualBehaviorPort(aPhysicalComponent)->sortedBy(name))]
[pport.name.toLowerCase().replaceAll(' ', '_')/]: [pport.getStringPropertyValue('orientation')/] feature;
[/for]
[/if]
end [PcName/];
device implementation [PcName/].impl
end [PcName/].impl;
[/let]
[/template]
[template public generateBus(name : String)]
[let busName: String = name.replaceAll(' ', '_')]
[file ((busName + '.aadl').toLower(), false, 'UTF-8')]
package [busName/]
public
bus [busName/]
end [busName/];
bus implementation [busName/].impl
end [busName/].impl;
end [busName/];
[/file][/let]
[/template]
[template public generateSystem(aPhysicalComponent : PhysicalComponent)]
[let PcName : String = aPhysicalComponent.name.replaceAll(' ', '_') ]
system [PcName/]
[if(getSyntheticPorts(aPhysicalComponent)->union(getComponentVirtualBehaviorPort(aPhysicalComponent))->notEmpty())]
features
[for(pport: PhysicalPort | getSyntheticPorts(aPhysicalComponent)->sortedBy(name))]
[pport.name.toLowerCase().replaceAll(' ', '_')/]: requires bus access [getBusTypeForPort(pport).replaceAll(' ', '_')/].impl;
[/for]
[for(pport: PhysicalPort | getComponentVirtualBehaviorPort(aPhysicalComponent)->sortedBy(name))]
[pport.name.toLowerCase().replaceAll(' ', '_')/]: [pport.getStringPropertyValue('orientation')/] feature;
[/for]
[/if]
end [PcName/];
system implementation [PcName/].impl
[if(aPhysicalComponent.ownedPhysicalComponents->select(nature = PhysicalComponentNature::NODE)->notEmpty())]
subcomponents
[for(bus: PhysicalComponent | aPhysicalComponent.ownedPhysicalComponents->select(nature = PhysicalComponentNature::NODE)->sortedBy(name))]
[if(not bus.hasPropertyValue('isBus'))]
[bus.name.toLower().replaceAll(' ', '_')/]_part: [getAADLNature(bus)/] [bus.name.replaceAll(' ', '_')/].impl;
[else]
[bus.getStringPropertyValue('busName').toLower().replaceAll(' ', '_')/]: [getAADLNature(bus)/] [bus.name.replaceAll(' ', '_')/].impl;
[/if]
[/for]
[for(processor: PhysicalComponent | aPhysicalComponent.ownedPhysicalComponents->select(kind=PhysicalComponentKind::SOFTWARE_EXECUTION_UNIT)->sortedBy(name))]
[let processorPart: Part = Part.allInstances()->select(abstractType=processor)->any(eContainer()=aPhysicalComponent and name=processor.name)]
[let deployedParts: Sequence(Part) = processorPart.ownedDeploymentLinks.deployedElement]
[for(part: Part | deployedParts->sortedBy(name))]
[part.name.toLower().replaceAll(' ', '_')/]_part: process [part.abstractType.name.replaceAll(' ', '_')/].impl;
[/for]
[/let][/let]
[/for]
[/if]
[if(getSyntheticLinks(aPhysicalComponent)->union(getComponentVirtualBehaviorLink(aPhysicalComponent))->notEmpty())]
connections
-- Bus accesses
[for(link: PhysicalLink | getSyntheticLinks(aPhysicalComponent)->sortedBy(name))]
[let pp1: PhysicalPort = link.linkEnds->at(1).oclAsType(PhysicalPort)]
[let pp2: PhysicalPort = link.linkEnds->at(2).oclAsType(PhysicalPort)]
[let linkEnd_1_container: String = if(pp1.eContainer() <> aPhysicalComponent) then pp1.eContainer().oclAsType(PhysicalComponent).name.toLower().replaceAll(' ', '_') else '' endif]
[let linkEnd_2_container: String = if(pp2.eContainer() <> aPhysicalComponent) then pp2.eContainer().oclAsType(PhysicalComponent).name.toLower().replaceAll(' ', '_') else '' endif]
[if(not pp2.eContainer().oclAsType(PhysicalComponent).hasPropertyValue('isBus'))]
[link.name.toLower().replaceAll(' ', '_')/]_connection: bus access [if(linkEnd_1_container<>'')][linkEnd_1_container/]_part.[/if][pp1.name.toLower().replaceAll(' ', '_')/] -> [if(linkEnd_2_container<>'')][linkEnd_2_container/]_part.[/if][pp2.name.toLower().replaceAll(' ', '_')/];
[else]
[link.name.toLower().replaceAll(' ', '_')/]_connection: bus access [if(linkEnd_1_container<>'')][linkEnd_1_container/]_part.[/if][pp1.name.toLower().replaceAll(' ', '_')/] -> [pp2.eContainer().oclAsType(PhysicalComponent).getStringPropertyValue('busName').toLower().replaceAll(' ', '_')/];
[/if]
[/let][/let][/let][/let]
[/for]
-- Logical connections
[for(link: PhysicalLink | getComponentVirtualBehaviorLink(aPhysicalComponent)->sortedBy(name))]
[let pp1: PhysicalPort = link.linkEnds->at(1).oclAsType(PhysicalPort)]
[let pp2: PhysicalPort = link.linkEnds->at(2).oclAsType(PhysicalPort)]
[let linkEnd_1_container: String = if(pp1.eContainer() <> aPhysicalComponent) then pp1.eContainer().oclAsType(PhysicalComponent).name.toLower().replaceAll(' ', '_') else '' endif]
[let linkEnd_2_container: String = if(pp2.eContainer() <> aPhysicalComponent) then pp2.eContainer().oclAsType(PhysicalComponent).name.toLower().replaceAll(' ', '_') else '' endif]
[link.name.toLower().replaceAll(' ', '_')/]_connection: feature [if(linkEnd_1_container<>'')][linkEnd_1_container/]_part.[/if][pp1.name.toLower().replaceAll(' ', '_')/] -> [if(linkEnd_2_container<>'')][linkEnd_2_container/]_part.[/if][pp2.name.toLower().replaceAll(' ', '_')/];
[/let][/let]
[/let][/let]
[/for]
[/if]
[let processors: OrderedSet(PhysicalComponent) = aPhysicalComponent.ownedPhysicalComponents->select(kind=PhysicalComponentKind::SOFTWARE_EXECUTION_UNIT)]
[let parts: Bag(DeployableElement) = Part.allInstances()->select(processors->includes(abstractType) and eContainer()=aPhysicalComponent).ownedDeploymentLinks.deployedElement]
[let buses: OrderedSet(PhysicalComponent) = aPhysicalComponent.ownedPhysicalComponents->select(nature = PhysicalComponentNature::NODE and hasPropertyValue('isBus'))->sortedBy(name)]
[let links: Sequence(PhysicalLink) = getAllocatedVirtualBehaviorLink(aPhysicalComponent)->select(l: PhysicalLink | buses->select(b: PhysicalComponent | b.getStringPropertyValue('busName') = l.getStringPropertyValue('allocatedToBus'))->notEmpty())]
[comment]
-- processors: [processors.name->sep(', ')/]
-- parts: [parts.name->sep(', ')/]
-- buses: [buses.getStringPropertyValue('busName')->sep(', ')/]
-- links: [links.name->sep(', ')/]
-- links allocatedToBus: [links.getStringPropertyValue('allocatedToBus')->sep(', ')/]
[/comment]
[if(parts->notEmpty() or links->notEmpty())]
properties
[for(processor: PhysicalComponent | processors->sortedBy(name))]
[for(processorPart: Part | Part.allInstances()->select(abstractType=processor and eContainer()=aPhysicalComponent)->sortedBy(name))]
[let deployedParts: Sequence(Part) = processorPart.ownedDeploymentLinks.deployedElement]
[for(part: Part | deployedParts->sortedBy(name))]
Actual_Processor_Binding => (reference ([processorPart.name.toLower().replaceAll(' ', '_')/]_part)) applies to [part.name.toLower().replaceAll(' ', '_')/]_part;
[/for]
[/let]
[/for]
[/for]
[for(bus: PhysicalComponent | buses)]
[for(link: PhysicalLink | links->select(l: PhysicalLink | bus.getStringPropertyValue('busName') = l.getStringPropertyValue('allocatedToBus')))]
Actual_Connection_Binding => (reference ([bus.getStringPropertyValue('busName').toLower().replaceAll(' ', '_')/])) applies to [getVirtualBehaviorLinkRelativeInstancePath(link, aPhysicalComponent)/]_connection;
[/for]
[/for]
[/if]
[/let][/let][/let][/let]
end [PcName/].impl;
[/let][/template]

73
plugins/com.irtsaintexupery.capella2aadl/src/com/irtsaintexupery/capella2aadl/requests/Bus.java

@ -0,0 +1,73 @@ @@ -0,0 +1,73 @@
/*******************************************************************************
* Copyright (c) 2015, 2017 IRT AESE (IRT Saint Exupery).
* 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:
* Bassem Ouni and Pierre Gaufillet (IRT Saint Exupéry) - initial API and implementation
*
*******************************************************************************/
package com.irtsaintexupery.capella2aadl.requests;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
import org.polarsys.capella.core.data.capellamodeller.Project;
public class Bus {
private String name;
private String type;
private static Map<String, int[]> busCounters = null;
public static Set<String> getBusNames(Project project) {
return busCounters.keySet();
}
public static Bus createIncrementedNameFromCategory(String type) {
if(busCounters == null) {
init();
}
if (!busCounters.containsKey(type)) {
busCounters.put(type, new int[] { 1 });
} else {
busCounters.get(type)[0]++;
}
return new Bus(type + "_" + busCounters.get(type)[0], type);
}
private Bus(String aName) {
name = aName;
}
private Bus(String aName, String aType) {
name = aName;
type = aType;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public static void init() {
busCounters = new HashMap<String, int[]>();
}
}

22
plugins/com.irtsaintexupery.capella2aadl/src/com/irtsaintexupery/capella2aadl/requests/Capella2AADLException.java

@ -0,0 +1,22 @@ @@ -0,0 +1,22 @@
/*******************************************************************************
* Copyright (c) 2015, 2017 IRT AESE (IRT Saint Exupery).
* 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:
* Bassem Ouni and Pierre Gaufillet (IRT Saint Exupéry) - initial API and implementation
*
*******************************************************************************/
package com.irtsaintexupery.capella2aadl.requests;
public class Capella2AADLException extends Exception {
private static final long serialVersionUID = 1089748525850510492L;
public Capella2AADLException(String message) {
super(message);
}
}

493
plugins/com.irtsaintexupery.capella2aadl/src/com/irtsaintexupery/capella2aadl/requests/ComponentExchangeUtils.java

@ -0,0 +1,493 @@ @@ -0,0 +1,493 @@
/*******************************************************************************
* Copyright (c) 2015, 2017 IRT AESE (IRT Saint Exupery).
* 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:
* Bassem Ouni and Pierre Gaufillet (IRT Saint Exupéry) - initial API and implementation
*
*******************************************************************************/
package com.irtsaintexupery.capella2aadl.requests;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.util.EcoreUtil;
import org.polarsys.capella.common.data.modellingcore.AbstractType;
import org.polarsys.capella.common.helpers.EcoreUtil2;
import org.polarsys.capella.core.data.capellacore.CapellacoreFactory;
import org.polarsys.capella.core.data.capellacore.ModellingArchitecture;
import org.polarsys.capella.core.data.capellacore.StringPropertyValue;
import org.polarsys.capella.core.data.capellamodeller.Project;
import org.polarsys.capella.core.data.capellamodeller.SystemEngineering;
import org.polarsys.capella.core.data.cs.AbstractDeploymentLink;
import org.polarsys.capella.core.data.cs.CsFactory;
import org.polarsys.capella.core.data.cs.DeployableElement;
import org.polarsys.capella.core.data.cs.Part;
import org.polarsys.capella.core.data.cs.PhysicalLink;
import org.polarsys.capella.core.data.cs.PhysicalPort;
import org.polarsys.capella.core.data.fa.ComponentExchange;
import org.polarsys.capella.core.data.fa.ComponentPort;
import org.polarsys.capella.core.data.fa.ComponentPortAllocation;
import org.polarsys.capella.core.data.fa.OrientationPortKind;
import org.polarsys.capella.core.data.pa.PaFactory;
import org.polarsys.capella.core.data.pa.PhysicalArchitecture;
import org.polarsys.capella.core.data.pa.PhysicalComponent;
import org.polarsys.capella.core.data.pa.PhysicalComponentKind;
import org.polarsys.capella.core.data.pa.PhysicalComponentNature;
import com.google.common.collect.ArrayListMultimap;
import com.google.common.collect.Multimap;
import com.google.common.collect.Multimaps;
/**
* This class provides various static methods for transforming Capella physical
* architecture into a preliminary but yet complete AADL model. The main
* transformation consists in moving from the 1 to 1 communication model used by
* {@link ComponentExchange} to a bus oriented topology closer to AADL bus
* accesses
*
*/
public class ComponentExchangeUtils {
/**
* This map provides the list of dummy {@link PhysicalComponent}
* representing deployed bahevior nodes for each {@link PhysicalComponent}
*/
private static ArrayListMultimap<PhysicalComponent, PhysicalComponent> componentVirtualBehaviorNode;
private static ArrayListMultimap<PhysicalComponent, PhysicalPort> componentVirtualBehaviorPort;
private static ArrayListMultimap<PhysicalComponent, PhysicalLink> componentVirtualBehaviorLink;
private static Multimap<PhysicalLink, PhysicalComponent> virtualBehaviorLinkComponent = null;
private static ArrayListMultimap<String, PhysicalLink> allocationOfVirtualLinkToPhysicalComponent;
private static Map<ComponentPort, PhysicalPort> allocationOfComponentPortToPhysicalPort;
private static List<PhysicalLink> allocatedVirtualBehaviorLink;
/**
* @param pc
* @return
*/
public static List<PhysicalComponent> getComponentVirtualBehaviorNode(PhysicalComponent pc) {
return componentVirtualBehaviorNode.get(pc);
}
/**
* @param pc
* @return
*/
public static List<PhysicalPort> getComponentVirtualBehaviorPort(PhysicalComponent pc) {
return componentVirtualBehaviorPort.get(pc);
}
/**
* @param pc
* @return
*/
public static List<PhysicalLink> getComponentVirtualBehaviorLink(PhysicalComponent pc) {
return componentVirtualBehaviorLink.get(pc);
}
/**
* @param link
* @return
*/
public static Collection<PhysicalComponent> getVirtualBehaviorLinkComponent(PhysicalLink link) {
if(virtualBehaviorLinkComponent == null) {
virtualBehaviorLinkComponent = Multimaps.invertFrom(componentVirtualBehaviorLink, ArrayListMultimap.<PhysicalLink, PhysicalComponent>create());
// System.out.println("Reversing component/link map...");
// for(PhysicalLink l: virtualBehaviorLinkComponent.keySet()) {
// System.out.println(l.getName() + ":");
// for(PhysicalComponent c: virtualBehaviorLinkComponent.get(l)) {
// System.out.println("\t" + c.getName());
// }
// }
}
return virtualBehaviorLinkComponent.get(link);
}
/**
* @param pc
* @return
*/
public static List<PhysicalLink> getAllocatedVirtualBehaviorLink() {
return allocatedVirtualBehaviorLink;
}
public static void transformCapellaComponentExchangeIntoAADLConnections(Project project) throws Capella2AADLException {
// Get the physical architecture from Project in Capella model
List<ModellingArchitecture> architectures = ((SystemEngineering) (project.getOwnedModelRoots().get(0))).getOwnedArchitectures();
PhysicalArchitecture physicalArchitecture = null;
for (ModellingArchitecture architecture : architectures) {
if (architecture instanceof PhysicalArchitecture) {
physicalArchitecture = (PhysicalArchitecture) architecture;
break;
}
}
// If no physical architecture has been found, the transformation
// doesn't apply
if (physicalArchitecture == null) {
throw new Capella2AADLException("Physical Architecture not found.");
}
PhysicalComponent physicalSystem = physicalArchitecture.getOwnedPhysicalComponent();
// Index the PhysicalComponent parts (nature NODE, kind
// SOFTWARE_EXECUTION_UNIT)
System.out.println("CPU/Device parts:");
List<Part> hardwareParts = new ArrayList<>();
allocationOfComponentPortToPhysicalPort = new HashMap<>();
for (Iterator<EObject> it = physicalSystem.eAllContents(); it.hasNext();) {
EObject eo = it.next();
if (eo instanceof Part) {
Part part = (Part) eo;
AbstractType abstractType = part.getAbstractType();
if (abstractType instanceof PhysicalComponent) {
PhysicalComponent typeComponent = (PhysicalComponent) abstractType;
if ((typeComponent.getKind().equals(PhysicalComponentKind.SOFTWARE_EXECUTION_UNIT) || typeComponent.getKind().equals(
PhysicalComponentKind.HARDWARE))
&& typeComponent.getNature().equals(PhysicalComponentNature.NODE)) {
hardwareParts.add(part);
System.out.println("\t" + PhysicalLinkUtils.getFullQualifiedName(part) + " (" + part.getAbstractType().getName() + ")");
}
}
}
if(eo instanceof ComponentPortAllocation) {
ComponentPortAllocation cpa = (ComponentPortAllocation) eo;
allocationOfComponentPortToPhysicalPort.put((ComponentPort) cpa.getTargetElement(), (PhysicalPort) cpa.getSourceElement());
}
}
System.out.println();
System.out.println("Deployed components:");
// Build a Behavioral node to CPU/device part map
Map<PhysicalComponent, Part> behaviourNode2Part = new HashMap<>();
for (Part part : hardwareParts) {
for (AbstractDeploymentLink deployableLink : part.getOwnedDeploymentLinks()) {
DeployableElement deployableElement = deployableLink.getDeployedElement();
if (deployableElement instanceof Part) {
Part deployedPart = (Part) deployableElement;
AbstractType deployedPartType = deployedPart.getAbstractType();
if (deployedPartType instanceof PhysicalComponent) {
PhysicalComponent deployedPhysicalComponent = (PhysicalComponent) deployedPartType;
behaviourNode2Part.put(deployedPhysicalComponent, part);
System.out.println("\t" + deployedPhysicalComponent.getName() + " is deployed on " + PhysicalLinkUtils.getFullQualifiedName(part));
}
}
}
}
System.out.println();
componentVirtualBehaviorNode = ArrayListMultimap.create();
componentVirtualBehaviorPort = ArrayListMultimap.create();
componentVirtualBehaviorLink = ArrayListMultimap.create();
allocationOfVirtualLinkToPhysicalComponent = ArrayListMultimap.create();
allocatedVirtualBehaviorLink = new ArrayList<>();
virtualBehaviorLinkComponent = null;
// Fow now let's consider ComponentExchanges are all in the root
// physical system
for (ComponentExchange ce : physicalSystem.getOwnedComponentExchanges()) {
// First determine which PhysicalComponent is the virtual parent of
// the ports' containers
ComponentPort sourcePort = (ComponentPort) ce.getSource();
ComponentPort targetPort = (ComponentPort) ce.getTarget();
// Re-orient the link if needed. The sourcePort must really be the sender
if(sourcePort.getOrientation().equals(OrientationPortKind.IN)) {
ComponentPort tmpPort = targetPort;
targetPort = sourcePort;
sourcePort = tmpPort;
}
boolean physicalComponentCleanUpNeeded = false;
System.out.println("Processing ComponentExchange " + PhysicalLinkUtils.getFullQualifiedName(sourcePort) + " <-> "
+ PhysicalLinkUtils.getFullQualifiedName(targetPort));
PhysicalComponent sourcePortContainer = (PhysicalComponent) sourcePort.eContainer();
PhysicalComponent targetPortContainer = (PhysicalComponent) targetPort.eContainer();
System.out.println("\tsourcePortContainer: " + PhysicalLinkUtils.getFullQualifiedName(sourcePortContainer));
System.out.println("\ttargetPortContainer: " + PhysicalLinkUtils.getFullQualifiedName(targetPortContainer));
// Search now the PhysicalComponent part (nature NODE, kind
// SOFTWARE_EXECUTION_UNIT) referencing these containers
// The parent of this part/type is the virtual parent of the
// ports' containers
Part virtualSourcePortParentPart = behaviourNode2Part.get(sourcePortContainer);
Part virtualTargetPortParentPart = behaviourNode2Part.get(targetPortContainer);
PhysicalComponent virtualSourcePortGrandParent = null;
PhysicalComponent virtualTargetPortGrandParent = null;
if (virtualSourcePortParentPart != null) {
switch (((PhysicalComponent) behaviourNode2Part.get(sourcePortContainer).getAbstractType()).getKind()) {
case SOFTWARE_EXECUTION_UNIT: {
virtualSourcePortGrandParent = (PhysicalComponent) behaviourNode2Part.get(sourcePortContainer).eContainer();
break;
}
case HARDWARE: {
virtualSourcePortGrandParent = (PhysicalComponent) behaviourNode2Part.get(sourcePortContainer).getAbstractType();
break;
}
default: {
throw new Capella2AADLException("Unknown PhysicalComponent kind");
}
}
}
if (virtualTargetPortParentPart != null) {
switch (((PhysicalComponent) behaviourNode2Part.get(targetPortContainer).getAbstractType()).getKind()) {
case SOFTWARE_EXECUTION_UNIT: {
virtualTargetPortGrandParent = (PhysicalComponent) behaviourNode2Part.get(targetPortContainer).eContainer();
break;
}
case HARDWARE: {
virtualTargetPortGrandParent = (PhysicalComponent) behaviourNode2Part.get(targetPortContainer).getAbstractType();
break;
}
default: {
throw new Capella2AADLException("Unknown PhysicalComponent kind");
}
}
}
if (virtualSourcePortGrandParent != null && virtualTargetPortGrandParent != null) {
System.out.println("\tvirtualSourcePortGrandParent: " + PhysicalLinkUtils.getFullQualifiedName(virtualSourcePortGrandParent));
System.out.println("\tvirtualTargetPortGrandParent: " + PhysicalLinkUtils.getFullQualifiedName(virtualTargetPortGrandParent));
PhysicalComponent virtualSourcePortParent = null;
PhysicalComponent virtualTargetPortParent = null;
switch (((PhysicalComponent) behaviourNode2Part.get(sourcePortContainer).getAbstractType()).getKind()) {
case SOFTWARE_EXECUTION_UNIT: {
virtualSourcePortParent = PaFactory.eINSTANCE.createPhysicalComponent(sourcePortContainer.getName());
componentVirtualBehaviorNode.put(virtualSourcePortGrandParent, virtualSourcePortParent);
virtualSourcePortGrandParent.getOwnedPhysicalComponents().add(virtualSourcePortParent);
physicalComponentCleanUpNeeded = true;
break;
}
case HARDWARE: {
// Connect directly to the device
virtualSourcePortParent = virtualSourcePortGrandParent;
break;
}
default: {
throw new Capella2AADLException("Unknown PhysicalComponent kind");
}
}
switch (((PhysicalComponent) behaviourNode2Part.get(targetPortContainer).getAbstractType()).getKind()) {
case SOFTWARE_EXECUTION_UNIT: {
virtualTargetPortParent = PaFactory.eINSTANCE.createPhysicalComponent(targetPortContainer.getName());
componentVirtualBehaviorNode.put(virtualTargetPortGrandParent, virtualTargetPortParent);
virtualTargetPortGrandParent.getOwnedPhysicalComponents().add(virtualTargetPortParent);
physicalComponentCleanUpNeeded = true;
break;
}
case HARDWARE: {
// Connect directly to the device
virtualTargetPortParent = virtualTargetPortGrandParent;
break;
}
default: {
throw new Capella2AADLException("Unknown PhysicalComponent kind");
}
}
// Add tip ports
// And the property "orientation" provides the orientation of
// the port
StringPropertyValue outOrientationProperty = CapellacoreFactory.eINSTANCE.createStringPropertyValue("orientation");
outOrientationProperty.setValue("out");
StringPropertyValue inOrientationProperty = CapellacoreFactory.eINSTANCE.createStringPropertyValue("orientation");
inOrientationProperty.setValue("in");
PhysicalPort virtualSourcePort = CsFactory.eINSTANCE.createPhysicalPort(sourcePort.getName());
PhysicalPort virtualTargetPort = CsFactory.eINSTANCE.createPhysicalPort(targetPort.getName());
virtualSourcePort.getOwnedPropertyValues().add(outOrientationProperty);
virtualTargetPort.getOwnedPropertyValues().add(inOrientationProperty);
componentVirtualBehaviorPort.put(virtualSourcePortParent, virtualSourcePort);
componentVirtualBehaviorPort.put(virtualTargetPortParent, virtualTargetPort);
// BEWARE: here the orginal PhysicalComponent representing a
// device is directly modified.
// This strategy would impact the bus topology transformation.
// Therefore, the ComponentExchange processing
// shall be done AFTER the bus topology.
virtualSourcePortParent.getOwnedFeatures().add(virtualSourcePort);
virtualTargetPortParent.getOwnedFeatures().add(virtualTargetPort);
// Create virtualLink
PhysicalLink link = CsFactory.eINSTANCE.createPhysicalLink(ce.getName());
link.getLinkEnds().add(virtualSourcePort);
link.getLinkEnds().add(virtualTargetPort);
// Extracting allocation to bus
Set<Bus> allocatingBuses = new HashSet<Bus>();
Bus lastAllocatingBus = null;
Bus tmpBus = PhysicalLinkUtils.getBusForPort(allocationOfComponentPortToPhysicalPort.get(sourcePort));
if (tmpBus != null) {
lastAllocatingBus = tmpBus;
allocatingBuses.add(lastAllocatingBus);
}
tmpBus = PhysicalLinkUtils.getBusForPort(allocationOfComponentPortToPhysicalPort.get(targetPort));
if (tmpBus != null) {
lastAllocatingBus = tmpBus;
allocatingBuses.add(lastAllocatingBus);
}
if(allocatingBuses.size() > 1)
{
// Error : a link cannot be allocated to several buses
throw new Capella2AADLException("Ports " + PhysicalLinkUtils.getFullQualifiedName(sourcePort) + " and " + PhysicalLinkUtils.getFullQualifiedName(targetPort) + " shall be allocated to the same bus");
}
if(allocatingBuses.isEmpty())
{
// Error : a link shall be allocated to one bus
throw new Capella2AADLException("Ports " + PhysicalLinkUtils.getFullQualifiedName(sourcePort) + " or " + PhysicalLinkUtils.getFullQualifiedName(targetPort) + " shall be allocated to a bus");
}
synthesizePortsAndLinks(link, lastAllocatingBus);
if (physicalComponentCleanUpNeeded) {
virtualTargetPortGrandParent.getOwnedPhysicalComponents().remove(virtualTargetPortParent);
virtualSourcePortGrandParent.getOwnedPhysicalComponents().remove(virtualSourcePortParent);
}
}
}
}
private static void synthesizePortsAndLinks(PhysicalLink link, Bus bus) throws Capella2AADLException {
// This algorithm only works if link is between a tip port and the bus
// port.
// In this situation, the bus is always contained in the closest common
// ancestor of all tip ports and links are always exclusively ascending
// in the hierarchy.
// Note: in Capella models, the grand parent of a PhysicalPort cannot be
// null
PhysicalPort sourcePort, targetPort;
// Origin and destination ports (links are not oriented)
sourcePort = (PhysicalPort) link.getLinkEnds().get(0);
targetPort = (PhysicalPort) link.getLinkEnds().get(1);
System.out.println(PhysicalLinkUtils.getFullQualifiedName(sourcePort) + " <-> " + PhysicalLinkUtils.getFullQualifiedName(targetPort));
PhysicalPort lastPort1 = createBottomUpLinks(sourcePort, targetPort, link.getName(), OrientationPortKind.OUT);
PhysicalPort lastPort2 = createBottomUpLinks(targetPort, sourcePort, link.getName(), OrientationPortKind.IN);
// Now take care of the final case where ancestor = busPortGrandParent.
// Here ports have already been created and it may only be needed to
// connect ports. The algorithm is exactly the same as above.
createSyntheticLink(link.getName(), lastPort1, lastPort2, (PhysicalComponent) EcoreUtil2.getCommonAncestor(sourcePort, targetPort), bus);
}
public static PhysicalPort createBottomUpLinks(PhysicalPort sourcePort, PhysicalPort targetport, String name, OrientationPortKind orientation) throws Capella2AADLException {
PhysicalComponent ancestor = (PhysicalComponent) sourcePort.eContainer().eContainer();
PhysicalComponent targetPortGrandParent = (PhysicalComponent) targetport.eContainer().eContainer();
PhysicalPort origin = sourcePort;
PhysicalPort syntheticPhysicalPort;
while (!EcoreUtil.isAncestor(ancestor, targetPortGrandParent)) {
syntheticPhysicalPort = CsFactory.eINSTANCE.createPhysicalPort(name);
componentVirtualBehaviorPort.put(ancestor, syntheticPhysicalPort);
ancestor.getOwnedFeatures().add(syntheticPhysicalPort);
// And the property "orientation" provides the orientation of the
// port
StringPropertyValue orientationProperty = CapellacoreFactory.eINSTANCE.createStringPropertyValue("orientation");
switch(orientation) {
case IN:
orientationProperty.setValue("in");
createSyntheticLink(name, syntheticPhysicalPort, origin, ancestor);
break;
case OUT:
orientationProperty.setValue("out");
createSyntheticLink(name, origin, syntheticPhysicalPort, ancestor);
break;
default:
throw new Capella2AADLException("Unknown orientation");
}
syntheticPhysicalPort.getOwnedPropertyValues().add(orientationProperty);
System.out.println("Create port " + PhysicalLinkUtils.getFullQualifiedName(syntheticPhysicalPort));
// Move the origin to the syntheticPort, reset syntheticPort and
// move ancestor one step upward in the hierarchy
origin = syntheticPhysicalPort;
ancestor = (PhysicalComponent) ancestor.eContainer();
}
return origin;
}
/**
* This method creates a {@link PhysicalLink} between {@link PhysicalPort}
* <code>origin</code> and <code>destination</code> and stores it in
* {@link PhysicalComponent} <code>ancestor</code> only if no such link
* already exists.
*
* @param prefix
* Name of the new link
* @param origin
* Port of origin
* @param destination
* Port of destination
* @param ancestor
* Container of the new link
*/
private static void createSyntheticLink(String prefix, PhysicalPort origin, PhysicalPort destination, PhysicalComponent ancestor) {
createSyntheticLink(prefix, origin, destination, ancestor, null);
}
private static void createSyntheticLink(String prefix, PhysicalPort origin, PhysicalPort destination, PhysicalComponent ancestor, Bus allocatedTo) {
boolean needToCreateNewLink = true;
for (PhysicalLink l : componentVirtualBehaviorLink.get(ancestor)) {
if ((l.getLinkEnds().get(0).equals(destination) && l.getLinkEnds().get(1).equals(origin))
|| (l.getLinkEnds().get(0).equals(origin) && l.getLinkEnds().get(1).equals(destination))) {
needToCreateNewLink = false;
break;
}
}
if (needToCreateNewLink) {
PhysicalLink syntheticPhysicalLink = CsFactory.eINSTANCE.createPhysicalLink(prefix + "_" + (componentVirtualBehaviorLink.get(ancestor).size() + 1));
syntheticPhysicalLink.getLinkEnds().add(origin);
syntheticPhysicalLink.getLinkEnds().add(destination);
componentVirtualBehaviorLink.put(ancestor, syntheticPhysicalLink);
if(allocatedTo != null) {
// The property "allocatedToBus" provides the name of the bus instance the link is allocated to
StringPropertyValue busName = CapellacoreFactory.eINSTANCE.createStringPropertyValue("allocatedToBus");
busName.setValue(allocatedTo.getName());
syntheticPhysicalLink.getOwnedPropertyValues().add(busName);
allocationOfVirtualLinkToPhysicalComponent.put(allocatedTo.getName(), syntheticPhysicalLink);
allocatedVirtualBehaviorLink.add(syntheticPhysicalLink);
}
System.out.println("Create synthetic link: " + PhysicalLinkUtils.getFullQualifiedName(origin) + " <-> "
+ PhysicalLinkUtils.getFullQualifiedName(destination));
}
}
}

637
plugins/com.irtsaintexupery.capella2aadl/src/com/irtsaintexupery/capella2aadl/requests/PhysicalLinkUtils.java

@ -0,0 +1,637 @@ @@ -0,0 +1,637 @@
/*******************************************************************************
* Copyright (c) 2015, 2017 IRT AESE (IRT Saint Exupery).
* 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:
* Bassem Ouni and Pierre Gaufillet (IRT Saint Exupéry) - initial API and implementation
*
*******************************************************************************/
package com.irtsaintexupery.capella2aadl.requests;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.util.EcoreUtil;
import org.polarsys.capella.common.helpers.EcoreUtil2;
import org.polarsys.capella.core.data.capellacore.AbstractPropertyValue;
import org.polarsys.capella.core.data.capellacore.BooleanPropertyValue;
import org.polarsys.capella.core.data.capellacore.CapellaElement;
import org.polarsys.capella.core.data.capellacore.CapellacoreFactory;
import org.polarsys.capella.core.data.capellacore.Feature;
import org.polarsys.capella.core.data.capellacore.ModellingArchitecture;
import org.polarsys.capella.core.data.capellacore.NamedElement;
import org.polarsys.capella.core.data.capellacore.StringPropertyValue;
import org.polarsys.capella.core.data.capellamodeller.Project;
import org.polarsys.capella.core.data.capellamodeller.SystemEngineering;
import org.polarsys.capella.core.data.cs.AbstractPhysicalLinkEnd;
import org.polarsys.capella.core.data.cs.CsFactory;
import org.polarsys.capella.core.data.cs.PhysicalLink;
import org.polarsys.capella.core.data.cs.PhysicalPort;
import org.polarsys.capella.core.data.pa.PaFactory;
import org.polarsys.capella.core.data.pa.PhysicalArchitecture;
import org.polarsys.capella.core.data.pa.PhysicalComponent;
import org.polarsys.capella.core.data.pa.PhysicalComponentNature;
import com.google.common.collect.ArrayListMultimap;
import com.google.common.collect.BiMap;
import com.google.common.collect.HashBiMap;
/**
* This class provides various static methods for transforming Capella physical
* architecture into a preliminary but yet complete AADL model. The main
* transformation consists in moving from the 1 to 1 communication model used by
* {@link PhysicalLink} to a bus oriented topology closer to AADL bus accesses
*
*/
public class PhysicalLinkUtils {
/**
* Reversible map between deduced buses and origin/destination
* {@link PhysicalPort}
*/
private static BiMap<Bus, Set<PhysicalPort>> bus2TipPorts = null;
/**
* Cross-reference from {@link PhysicalPort} to {@link PhysicalLink}
* connected to these ports
*/
private static ArrayListMultimap<PhysicalPort, PhysicalLink> port2link = null;
/**
* All {@link PhysicalLink} in the model
*/
private static List<PhysicalLink> physicalLinks = null;
/**
* List of {@link PhysicalPort} to synthesize for each
* {@link PhysicalComponent}
*/
private static ArrayListMultimap<PhysicalComponent, PhysicalPort> componentSyntheticPorts = null;
/**
* Cross-reference from {@link PhysicalPort} to the bus they are connected
* to
*/
private static Map<PhysicalPort, Bus> componentSyntheticPorts2Bus = null;
/**
* List of {@link PhysicalLink} to synthesize for each
* {@link PhysicalComponent}
*/
private static ArrayListMultimap<PhysicalComponent, PhysicalLink> componentSyntheticLinks = null;
/**
* Numbering counter for default bus types
*/
private static int defaultBusTypeCounter;
/**
* @param pc
* target {@link PhysicalComponent}
* @return the list of synthetic ports for component <code>pc</code>
*/
public static List<PhysicalPort> getSyntheticPorts(PhysicalComponent pc) {
return componentSyntheticPorts.get(pc);
}
/**
* @param pc
* target {@link PhysicalComponent}
* @return the list of synthetic links for component <code>pc</code>
*/
public static List<PhysicalLink> getSyntheticLinks(PhysicalComponent pc) {
return componentSyntheticLinks.get(pc);
}
/**
* @param port
* target {@link PhysicalPort}
* @return the type name of the bus connected to <code>port</code>
*/
public static String getBusTypeForPort(PhysicalPort port) {
return componentSyntheticPorts2Bus.get(port).getType();
}
/**
* @param port
* target {@link PhysicalPort}
* @return the bus connected to <code>port</code>
*/
public static Bus getBusForPort(PhysicalPort port) {
return componentSyntheticPorts2Bus.get(port);
}
/**
* This methode analyses the data flows and hierarchy of
* {@link PhysicalComponent} of the physical architecture and synthesizes a
* corresponding bus topology.
*
* @param project
* Capella {@link Project} that is analyzed
* @throws Capella2AADLException
*/
public static void transformCapellaPhysicalLinksIntoAADLBusTopology(Project project) throws Capella2AADLException {
// (Re-)init Bus class attributes and bus type counter
Bus.init();
defaultBusTypeCounter = 1;
// Get the physical architecture from Project in Capella model
List<ModellingArchitecture> architectures = ((SystemEngineering) (project.getOwnedModelRoots().get(0))).getOwnedArchitectures();
PhysicalArchitecture physicalArchitecture = null;
for (ModellingArchitecture architecture : architectures) {
if (architecture instanceof PhysicalArchitecture) {
physicalArchitecture = (PhysicalArchitecture) architecture;
break;
}
}
// If no physical architecture has been found, the transformation
// doesn't apply
if (physicalArchitecture == null) {
throw new Capella2AADLException("Physical Architecture not found.");
}
PhysicalComponent physicalSystem = physicalArchitecture.getOwnedPhysicalComponent();
// Visit the model and connect internally PhysicalPorts of PhysicalComponents
// when they share the same virtualConnection string property value
// Thanks to the preprocessing, it is possible to consider low level
// communication device like transceivers, routers, switch, etc. as physically connecting
// some of their ports.
for (Iterator<EObject> it = physicalSystem.eAllContents(); it.hasNext();) {
EObject eo = it.next();
if (eo instanceof PhysicalComponent) {
PhysicalComponent pc = (PhysicalComponent) eo;
ArrayListMultimap<String, PhysicalPort> map = ArrayListMultimap.create();
for(Feature feature: pc.getOwnedFeatures()) {
if (feature instanceof PhysicalPort) {
PhysicalPort pp = (PhysicalPort) feature;
for(AbstractPropertyValue pv: pp.getAppliedPropertyValues()) {
if(pv.getName().equals("virtualConnection")) {
map.put(((StringPropertyValue) pv).getValue(), pp);
}
}
}
}
// Now that the list of ports is known, create a chain with all ports of each virtualConnection
for(String virtualConnection: map.keySet()) {
int counter = 1;
Iterator<PhysicalPort> pp_it = map.get(virtualConnection).iterator();
PhysicalPort origin = pp_it.next();
PhysicalPort dest = null;
PhysicalLink link = null;
while(pp_it.hasNext()) {
dest = pp_it.next();
link = CsFactory.eINSTANCE.createPhysicalLink(virtualConnection + "_" + counter);
link.getLinkEnds().add(origin);
link.getLinkEnds().add(dest);
PhysicalComponent parentComponent = (PhysicalComponent) origin.eContainer();
parentComponent.getOwnedPhysicalLinks().add(link);
System.out.println("Creating virtual connection "
+ virtualConnection + "_" + counter + " in "
+ getFullQualifiedName(parentComponent) + ": "
+ origin.getName() + " <-> " + dest.getName());
if(pp_it.hasNext()) {
origin = dest;
}
}
}
}
}
// Extract the list of physical ports, physical links and a cross
// reference between
// physical ports and physical links
physicalLinks = new ArrayList<PhysicalLink>();
port2link = ArrayListMultimap.create();
for (Iterator<EObject> it = physicalSystem.eAllContents(); it.hasNext();) {
EObject eo = it.next();
if (eo instanceof PhysicalLink) {
PhysicalLink link = (PhysicalLink) eo;
physicalLinks.add(link);
port2link.put((PhysicalPort) link.getLinkEnds().get(0), link);
port2link.put((PhysicalPort) link.getLinkEnds().get(1), link);
}
}
// Now extract the origin and destination ports (aka tipPorts) for each
// set of links (PhysicalLink) connected through ports (PhysicalPort)
bus2TipPorts = HashBiMap.create();
// Each PhysicalLink shall be visited once. Initialize the list of links
// to visit
List<PhysicalLink> linksToVisit = new ArrayList<PhysicalLink>(physicalLinks);
// allConnectedLinks is a list of sets of PhysicalLink connected by
// PhysicalPorts. Sets of links are never connected. Each set will lead
// to an AADL bus instance
ArrayDeque<Set<PhysicalLink>> allConnectedLinks = new ArrayDeque<Set<PhysicalLink>>();
Set<PhysicalPort> ports;
while (!linksToVisit.isEmpty()) {
ports = new HashSet<>();
allConnectedLinks.add(extractConnectedPhysicalLinks(linksToVisit.get(0), ports));
// Now that connected links and ports have been discovered, identify
// the type of the bus. By convention, this type is hold by a
// PhysicalLinkCategory associated with at least one connected link
String categoryName = null;
for (PhysicalLink l : allConnectedLinks.peekLast()) {
if (!l.getCategories().isEmpty()) {
categoryName = l.getCategories().get(0).getName();
break;
}
}
// If no category has been found, use a default name
if (categoryName == null) {
categoryName = "BusType_" + defaultBusTypeCounter;
defaultBusTypeCounter++;
}
// Gather all these information together
// the bus instance is named by its category + an increment
Bus bus = Bus.createIncrementedNameFromCategory(categoryName);
// Associate the bus with its tip ports
bus2TipPorts.put(bus, ports);
// all the connected links has been visited in the process. They can
// be removed at once from the list of links that still need to be
// visited.
linksToVisit.removeAll(allConnectedLinks.peekLast());
}
printTipPorts2Bus();
// Now that the original topology of PhysicalLinks is known, synthesize
// a new one compatible with AADL. By convention, a new
// PhysicalComponent with specific key/values will be created in the
// lowest ancestor of all tip ports.
componentSyntheticPorts = ArrayListMultimap.create();
componentSyntheticLinks = ArrayListMultimap.create();
// Initialize the list of synthetic ports with the tip ports
// Only one port / component / bus should be kept
componentSyntheticPorts2Bus = new HashMap<>();
for (Set<PhysicalPort> sp : bus2TipPorts.inverse().keySet()) {
for (PhysicalPort p : sp) {
if (!componentSyntheticPorts.containsValue(p)) {
componentSyntheticPorts2Bus.put(p, bus2TipPorts.inverse().get(sp));
componentSyntheticPorts.put((PhysicalComponent) p.eContainer(), p);
}
}
}
for (Bus bus : bus2TipPorts.keySet()) {
// First discover the closest common ancestor of all tipPorts
PhysicalComponent commonAncestor = (PhysicalComponent) EcoreUtil2.getCommonAncestor(bus2TipPorts.get(bus));
// Create the PhysicalComponent that will play the role of bus
// instance
PhysicalComponent busPhysicalComponent = PaFactory.eINSTANCE.createPhysicalComponent(bus.getType());
busPhysicalComponent.setNature(PhysicalComponentNature.NODE);
// The property "isBus" acts as a marker to process differently this
// PhysicalComponent in Acceleo
BooleanPropertyValue isBus = CapellacoreFactory.eINSTANCE.createBooleanPropertyValue("isBus");
isBus.setValue(true);
busPhysicalComponent.getOwnedPropertyValues().add(isBus);
// And the property "busName" provides the name of the bus instance
StringPropertyValue busName = CapellacoreFactory.eINSTANCE.createStringPropertyValue("busName");
busName.setValue(bus.getName());
busPhysicalComponent.getOwnedPropertyValues().add(busName);
// Add a port to the bus instance to connect synthetic links to it
PhysicalPort port = CsFactory.eINSTANCE.createPhysicalPort("bus_port");
busPhysicalComponent.getOwnedFeatures().add(port);
// And finally add the bus instance to the common ancestor
commonAncestor.getOwnedPhysicalComponents().add(busPhysicalComponent);
// Synthesize now the new PhysicalLinks. It is done in 2 steps:
// 1- Create a link from tip port to bus_port
// 2- Split this link into segments that don't cross
// PhysicalComponent boundaries
// The second step involves synthesize intermediate PhysicalPorts on
// intermediate PhysicalComponents
for (PhysicalPort p : bus2TipPorts.get(bus)) {
PhysicalLink l = CsFactory.eINSTANCE.createPhysicalLink(bus.getName());
l.getLinkEnds().add(p);
l.getLinkEnds().add(port);
synthesizePortsAndLinks(l, bus);
}
}
System.out.println();
printSyntheticPorts();
printSyntheticLinks();
System.out.println();
}
/**
* Print synthetic links by {@link PhysicalComponent} on stdout for
* debugging purpose
*/
private static void printSyntheticLinks() {
System.out.println("\nSynthetic Links:");
for (PhysicalComponent c : componentSyntheticLinks.keySet()) {
System.out.println(getFullQualifiedName(c) + ":");
for (PhysicalLink l : componentSyntheticLinks.get(c)) {
System.out.println("\t" + getFullQualifiedName(l.getLinkEnds().get(0)) + " <-> " + getFullQualifiedName(l.getLinkEnds().get(1)));
}
}
}
/**
* Print synthetic ports by {@link PhysicalComponent} on stdout for
* debugging purpose
*/
private static void printSyntheticPorts() {
System.out.println("Synthetic Ports:");
for (PhysicalComponent c : componentSyntheticPorts.keySet()) {
System.out.println(getFullQualifiedName(c) + ":");
for (PhysicalPort p : componentSyntheticPorts.get(c)) {
System.out.println("\t" + getFullQualifiedName(p));
}
}
}
/**
* This method analyzes the {@link PhysicalLink} link and if required splits
* it into several links connected by new intermediate ports that don't
* violate the encapsulation principle of AADL.
*
* @param link
* the link that will be analyzed
* @param bus
* the bus <code>link</code> connects to
*/
private static void synthesizePortsAndLinks(PhysicalLink link, Bus bus) {
// This algorithm only works if link is between a tip port and the bus
// port.
// In this situation, the bus is always contained in the closest common
// ancestor of all tip ports and links are always exclusively ascending
// in the hierarchy.
// Note: in Capella models, the grand parent of a PhysicalPort cannot be
// null
PhysicalPort tipPort, bus_port;
// Origin and destination ports (links are not oriented)
tipPort = (PhysicalPort) link.getLinkEnds().get(0);
bus_port = (PhysicalPort) link.getLinkEnds().get(1);
System.out.println(getFullQualifiedName(tipPort) + " <-> " + getFullQualifiedName(bus_port));
PhysicalComponent ancestor = (PhysicalComponent) tipPort.eContainer().eContainer();
PhysicalComponent busPortGrandParent = (PhysicalComponent) bus_port.eContainer().eContainer();
PhysicalPort origin = tipPort;
PhysicalPort syntheticPhysicalPort = null;
while (!ancestor.equals(busPortGrandParent)) {
// Ancestor needs one and only one Physical port to connect to the
// bus. If a such port already exists, use it rather than create a
// new one.
for (PhysicalPort p : componentSyntheticPorts.get(ancestor)) {
if (componentSyntheticPorts2Bus.containsKey(p)) {
if (componentSyntheticPorts2Bus.get(p).equals(bus)) {
syntheticPhysicalPort = p;
System.out.println("Component " + getFullQualifiedName(ancestor) + " already contains the synthetic port " + getFullQualifiedName(p)
+ " for bus " + bus.getName());
break;
}
}
}
// No port connected to the bus has been found. Create a new one.
if (syntheticPhysicalPort == null) {
syntheticPhysicalPort = CsFactory.eINSTANCE.createPhysicalPort(link.getName());
componentSyntheticPorts.put(ancestor, syntheticPhysicalPort);
componentSyntheticPorts2Bus.put(syntheticPhysicalPort, bus);
ancestor.getOwnedFeatures().add(syntheticPhysicalPort);
System.out.println("Component " + getFullQualifiedName(ancestor) + " doesn't contain a synthetic port for bus " + bus.getName()
+ ": create port " + getFullQualifiedName(syntheticPhysicalPort));
}
createSyntheticLink(link.getName(), origin, syntheticPhysicalPort, ancestor);
// Move the origin to the syntheticPort, reset syntheticPort and
// move ancestor one step upward in the hierarchy
origin = syntheticPhysicalPort;
syntheticPhysicalPort = null;
ancestor = (PhysicalComponent) ancestor.eContainer();
}
// Now take care of the final case where ancestor = busPortGrandParent.
// Here ports have already been created and it may only be needed to
// connect ports. The algorithm is exactly the same as above.
createSyntheticLink(link.getName(), origin, bus_port, ancestor);
}
/**
* This method creates a {@link PhysicalLink} between {@link PhysicalPort}
* <code>origin</code> and <code>destination</code> and stores it in
* {@link PhysicalComponent} <code>ancestor</code> only if no such link
* already exists.
*
* @param prefix
* Name of the new link
* @param origin
* Port of origin
* @param destination
* Port of destination
* @param ancestor
* Container of the new link
*/
private static void createSyntheticLink(String prefix, PhysicalPort origin, PhysicalPort destination, PhysicalComponent ancestor) {
boolean needToCreateNewLink = true;
for (PhysicalLink l : componentSyntheticLinks.get(ancestor)) {
if ((l.getLinkEnds().get(0).equals(destination) && l.getLinkEnds().get(1).equals(origin))
|| (l.getLinkEnds().get(0).equals(origin) && l.getLinkEnds().get(1).equals(destination))) {
needToCreateNewLink = false;
break;
}
}
if (needToCreateNewLink) {
PhysicalLink syntheticPhysicalLink = CsFactory.eINSTANCE.createPhysicalLink(prefix + "_" + (componentSyntheticLinks.get(ancestor).size() + 1));
syntheticPhysicalLink.getLinkEnds().add(origin);
syntheticPhysicalLink.getLinkEnds().add(destination);
componentSyntheticLinks.put(ancestor, syntheticPhysicalLink);
System.out.println("Create synthetic link: " + getFullQualifiedName(origin) + " <-> " + getFullQualifiedName(destination));
}
}
/**
* Print origin/destination ports by bus on stdout for debugging purpose
*/
private static void printTipPorts2Bus() {
for (Bus b : bus2TipPorts.keySet()) {
System.out.println(b.getName() + ": " + b.getType());
for (PhysicalPort p : bus2TipPorts.get(b))
System.out.println("\t" + getFullQualifiedName(p));
System.out.println("");
}
}
/**
* This method returns the list of {@link PhysicalLink} connected by
* {@link PhysicalPort} from <code>link</code> along with the list of
* origin/destination ports.
*
* @param link
* the link that is analyzed
* @param tipPorts
* the list of origin/destination ports
* @return
*/
private static Set<PhysicalLink> extractConnectedPhysicalLinks(PhysicalLink link, Set<PhysicalPort> tipPorts) {
Set<PhysicalLink> connectedLinks = new HashSet<PhysicalLink>();
extractConnectedPhysicalLinks(link, connectedLinks, tipPorts);
return connectedLinks;
}
/**
* This method returns the list of {@link PhysicalLink} connected by
* {@link PhysicalPort} from <code>link</code> and updates the list of
* origin/destination ports + the list of visited links.
*
* @param link
* the link that is analyzed
* @param visitedLinks
* the list of links already analyzed.
* <em>This list is updated by the method.</em>
* @param tipPorts
* the list of origin/destination ports.
* <em>This list is updated by the method.</em>
*/
private static void extractConnectedPhysicalLinks(PhysicalLink link, Set<PhysicalLink> visitedLinks, Set<PhysicalPort> tipPorts) {
// link is about to be analyzed. Add it to the list of visited links
visitedLinks.add(link);
// The principle of this method is to explore recursively each link
// connected to the origin or destination port of link
List<PhysicalLink> linksToVisit = new ArrayList<>();
// First, determine for each port connected to link if it is a tip.
// A port is a tip if its container either contains all containers of
// the
// other ports or none of them.
for (AbstractPhysicalLinkEnd le : link.getLinkEnds()) {
PhysicalPort p = (PhysicalPort) le;
linksToVisit.addAll(port2link.get(p));
Set<PhysicalComponent> portsParents = new HashSet<>();
for (PhysicalLink l : port2link.get(p)) {
PhysicalPort oppositePort;
// Consider only the opposite port of p on link l
if (l.getLinkEnds().get(0).equals(le)) {
oppositePort = (PhysicalPort) l.getLinkEnds().get(1);
} else {
oppositePort = (PhysicalPort) l.getLinkEnds().get(0);
}
portsParents.add((PhysicalComponent) oppositePort.eContainer());
}
PhysicalComponent pParent = (PhysicalComponent) p.eContainer();
boolean allParentsAreInsidePContainer = true;
boolean allParentsAreOutsidePContainer = true;
for (PhysicalComponent c : portsParents) {
if (!EcoreUtil.isAncestor(pParent, c))
allParentsAreInsidePContainer = false;
else
allParentsAreOutsidePContainer = false;
}
if (allParentsAreInsidePContainer || allParentsAreOutsidePContainer)
tipPorts.add(p);
}
// Remove already visited links and continue exploration with neighbor
// links
linksToVisit.removeAll(visitedLinks);
for (PhysicalLink l : linksToVisit) {
extractConnectedPhysicalLinks(l, visitedLinks, tipPorts);
}
};
/**
* Returns the path from root {@link PhysicalComponent} using '::' separator
* as the fully qualified name of <code>object</code>.
* <p>
* eg: <code>getFullQualifiedName(subsubsystem_3)</code> returns
* <code>Root::system_1::subsystem_2::subsubsystem_3</code>
*
* @param object
* the targeted object
* @return the fully qualified name of <code>object</code>
*/
public static String getFullQualifiedName(EObject object) {
EObject parent = object.eContainer();
if (!(parent instanceof PhysicalComponent))
return ((NamedElement) object).getName();
else
return getFullQualifiedName((PhysicalComponent) parent) + "::" + ((NamedElement) object).getName();
}
/**
* Returns the instance path of <code>target</code> from origin {@link PhysicalComponent} using '.' separator.
* <p>
* eg: <code>getVirtualBehaviorLinkRelativeInstancePath(subsubsystem_3, root_system)</code> returns
* <code>system_1_part.subsystem_2_part.subsubsystem_3</code>
*
* Used for <code>Actual_Connection_Binding</code> when the bus instance is not in the same container.
*
* @param target
* @param origin
* @return
*/
public static String getVirtualBehaviorLinkRelativeInstancePath(CapellaElement target, PhysicalComponent origin) {
EObject parent = null;
if(target instanceof PhysicalLink) {
Collection<PhysicalComponent> parents = ComponentExchangeUtils.getVirtualBehaviorLinkComponent((PhysicalLink) target);
if(parents.size() == 1) {
parent = (CapellaElement) parents.toArray() [0];
}
} else {
parent = target.eContainer();
}
if (parent.equals(origin)) {
return ((NamedElement) target).getName().toLowerCase().replace(' ', '_');
} else {
if (!(parent instanceof PhysicalComponent))
return null; // TODO Improve error handling
else
return getVirtualBehaviorLinkRelativeInstancePath((PhysicalComponent) parent,
origin) + "_part." + ((NamedElement) target).getName().toLowerCase().replace(' ', '_');
}
}
}

75
plugins/com.irtsaintexupery.capella2aadl/src/com/irtsaintexupery/capella2aadl/requests/capella2aadl_queries.mtl

@ -0,0 +1,75 @@ @@ -0,0 +1,75 @@
[comment encoding = UTF-8 /]
[**
* Copyright (c) 2015, 2017 IRT AESE (IRT Saint Exupery).
* 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:
* Bassem Ouni and Pierre Gaufillet (IRT Saint Exupéry) - initial API and implementation
*
*/]
[module capella2aadl_queries('http://www.polarsys.org/capella/core/pa/1.1.0','http://www.polarsys.org/capella/core/core/1.1.0','http://www.polarsys.org/capella/core/modeller/1.1.0','http://www.polarsys.org/capella/common/libraries/1.1.0','http://www.polarsys.org/capella/common/core/1.1.0','http://www.polarsys.org/capella/core/common/1.1.0', 'http://www.polarsys.org/capella/core/cs/1.1.0', 'http://www.polarsys.org/capella/core/fa/1.1.0')]
[**
* The documentation of the query getPortDirection.
* @param anOrientationPortKind
*/]
[query public getPortDirection(o : OrientationPortKind) : String = if(o=OrientationPortKind::IN) then 'in' else if(o=OrientationPortKind::OUT) then 'out' else '' endif endif/]
[query public getAADLNature(sc: PhysicalComponent) : String = if(sc.ownedPropertyValues->select(name='isBus')->notEmpty()) then 'bus' else if(sc.kind=PhysicalComponentKind::SOFTWARE_EXECUTION_UNIT) then 'processor' else if (sc.kind=PhysicalComponentKind::HARDWARE) then 'device' else if(sc.nature = PhysicalComponentNature::BEHAVIOR) then 'process' else 'system' endif endif endif endif/]
[query public getStringPropertyValue(ce: CapellaElement, key: String) : String = ce.ownedPropertyValues->select(name=key)->at(1).oclAsType(StringPropertyValue).value/]
[query public hasPropertyValue(ce: CapellaElement, key: String) : Boolean = ce.ownedPropertyValues->select(name=key)->notEmpty()/]
[query public transformCapellaPhysicalLinksIntoAADLBusTopology(project: Project) : OclVoid =
invoke('com.irtsaintexupery.capella2aadl.requests.PhysicalLinkUtils', 'transformCapellaPhysicalLinksIntoAADLBusTopology(org.polarsys.capella.core.data.capellamodeller.Project)', Sequence{project})
/]
[query public transformCapellaComponentExchangeIntoAADLConnections(project: Project) : OclVoid =
invoke('com.irtsaintexupery.capella2aadl.requests.ComponentExchangeUtils', 'transformCapellaComponentExchangeIntoAADLConnections(org.polarsys.capella.core.data.capellamodeller.Project)', Sequence{project})
/]
[query public getFullQualifiedName(elt: NamedElement) : String =
invoke('com.irtsaintexupery.capella2aadl.requests.PhysicalLinkUtils', 'getFullQualifiedName(org.polarsys.capella.core.data.capellacore.NamedElement)', Sequence{elt})
/]
[query public getVirtualBehaviorLinkRelativeInstancePath(target: CapellaElement, origin: PhysicalComponent) : String =
invoke('com.irtsaintexupery.capella2aadl.requests.PhysicalLinkUtils', 'getVirtualBehaviorLinkRelativeInstancePath(org.polarsys.capella.core.data.capellacore.CapellaElement, org.polarsys.capella.core.data.pa.PhysicalComponent)', Sequence{target, origin})
/]
[query public getBusNames(project: Project) : Set(String) =
invoke('com.irtsaintexupery.capella2aadl.requests.Bus', 'getBusNames(org.polarsys.capella.core.data.capellamodeller.Project)', Sequence{project})
/]
[query public getSyntheticPorts(pc: PhysicalComponent) : Sequence(PhysicalPort) =
invoke('com.irtsaintexupery.capella2aadl.requests.PhysicalLinkUtils', 'getSyntheticPorts(org.polarsys.capella.core.data.pa.PhysicalComponent)', Sequence{pc})
/]
[query public getSyntheticLinks(pc: PhysicalComponent) : Sequence(PhysicalLink) =
invoke('com.irtsaintexupery.capella2aadl.requests.PhysicalLinkUtils', 'getSyntheticLinks(org.polarsys.capella.core.data.pa.PhysicalComponent)', Sequence{pc})
/]
[query public getBusTypeForPort(pp: PhysicalPort) : String =
invoke('com.irtsaintexupery.capella2aadl.requests.PhysicalLinkUtils', 'getBusTypeForPort(org.polarsys.capella.core.data.cs.PhysicalPort)', Sequence{pp})
/]
[query public getComponentVirtualBehaviorPort(pc: PhysicalComponent) : Sequence(PhysicalPort) =
invoke('com.irtsaintexupery.capella2aadl.requests.ComponentExchangeUtils', 'getComponentVirtualBehaviorPort(org.polarsys.capella.core.data.pa.PhysicalComponent)', Sequence{pc})
/]
[query public getComponentVirtualBehaviorLink(pc: PhysicalComponent) : Sequence(PhysicalLink) =
invoke('com.irtsaintexupery.capella2aadl.requests.ComponentExchangeUtils', 'getComponentVirtualBehaviorLink(org.polarsys.capella.core.data.pa.PhysicalComponent)', Sequence{pc})
/]
[query public getBusVirtualBehaviorLink(bus: String) : Sequence(PhysicalLink) =
invoke('com.irtsaintexupery.capella2aadl.requests.ComponentExchangeUtils', 'getBusVirtualBehaviorLink(String)', Sequence{bus})
/]
[query public getAllocatedVirtualBehaviorLink(pc: PhysicalComponent) : Sequence(PhysicalLink) =
invoke('com.irtsaintexupery.capella2aadl.requests.ComponentExchangeUtils', 'getAllocatedVirtualBehaviorLink()', Sequence{pc})
/]

2
releng/com.irtsaintexupery.capella2aadl.repository/.gitignore vendored

@ -0,0 +1,2 @@ @@ -0,0 +1,2 @@
/target/
/bin/

11
releng/com.irtsaintexupery.capella2aadl.repository/.project

@ -0,0 +1,11 @@ @@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>com.irtsaintexupery.capella2aadl.repository</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
</buildSpec>
<natures>
</natures>
</projectDescription>

17
releng/com.irtsaintexupery.capella2aadl.repository/category.xml

@ -0,0 +1,17 @@ @@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<site>
<feature url="features/com.irtsaintexupery.capella2aadl_1.1.2.qualifier.jar" id="com.irtsaintexupery.capella2aadl" version="1.1.2.qualifier">
<category name="Capella transformations"/>
</feature>
<feature url="features/com.irtsaintexupery.capella2aadl.source_1.1.2.qualifier.jar" id="com.irtsaintexupery.capella2aadl.source" version="1.1.2.qualifier">
<category name="Capella transformations"/>
</feature>
<feature url="features/com.irtsaintexupery.epl_1.0.0.qualifier.jar" id="com.irtsaintexupery.epl" version="1.0.0.qualifier">
<category name="Capella transformations"/>
</feature>
<category-def name="Capella transformations" label="Capella transformations">
<description>
Features providing transformations from Capella to other modeling languages.
</description>
</category-def>
</site>

17
releng/com.irtsaintexupery.capella2aadl.repository/pom.xml

@ -0,0 +1,17 @@ @@ -0,0 +1,17 @@
<?xml version="1.0"?>
<project
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.irtsaintexupery</groupId>
<artifactId>parent</artifactId>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../../releng/com.irtsaintexupery.parent</relativePath>
</parent>
<artifactId>com.irtsaintexupery.capella2aadl.repository</artifactId>
<packaging>eclipse-repository</packaging>
</project>

17
releng/com.irtsaintexupery.parent/.project

@ -0,0 +1,17 @@ @@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>com.irtsaintexupery.parent</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
</natures>
</projectDescription>

159
releng/com.irtsaintexupery.parent/pom.xml

@ -0,0 +1,159 @@ @@ -0,0 +1,159 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.irtsaintexupery</groupId>
<artifactId>parent</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>pom</packaging>
<modules>
<module>../../features/com.irtsaintexupery.epl</module>
<module>../../plugins/com.irtsaintexupery.capella2aadl</module>
<module>../../features/com.irtsaintexupery.capella2aadl-feature</module>
<module>../../plugins/com.irtsaintexupery.capella2aadl.ui</module>
<module>../../releng/com.irtsaintexupery.capella2aadl.repository</module>
</modules>
<properties>
<tycho-version>0.26.0</tycho-version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<repositories>
<repository>
<id>Mars</id>
<layout>p2</layout>
<url>http://download.eclipse.org/releases/mars/201602261000/</url>
</repository>
<repository>
<id>Capella-1.1.x</id>
<layout>p2</layout>
<url>https://hudson.polarsys.org/capella/job/capella-v1.1.x/lastSuccessfulBuild/artifact/result/publish/org.polarsys.capella/site.p2/</url>
</repository>
<repository>
<id>Orbit-R20160221192158</id>
<layout>p2</layout>
<url>http://download.eclipse.org/tools/orbit/downloads/drops/R20160221192158/repository/</url>
</repository>
<repository>
<id>Kitalpha-1.1.x</id>
<layout>p2</layout>
<url>https://hudson.polarsys.org/kitalpha/job/Kitalpha-v1.1.x/lastSuccessfulBuild/artifact/result/publish/kitalpha_runtime/site.p2/</url>
</repository>
<repository>
<id>Sirius-4.1.1</id>
<layout>p2</layout>
<url>http://download.eclipse.org/sirius/updates/releases/4.1.1/mars</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>Maven</id>
<url>https://repo.maven.apache.org/maven2</url>
</pluginRepository>
<pluginRepository>
<id>Eclipse - Acceleo Snapshots</id>
<url>https://repo.eclipse.org/content/repositories/acceleo-snapshots</url>
</pluginRepository>
<pluginRepository>
<id>Eclipse - Acceleo Releases</id>
<url>https://repo.eclipse.org/content/repositories/acceleo-releases</url>
</pluginRepository>
</pluginRepositories>
<build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho.extras</groupId>
<artifactId>tycho-source-feature-plugin</artifactId>
<version>${tycho-version}</version>
<executions>
<execution>
<id>source-feature</id>
<phase>package</phase>
<goals>
<goal>source-feature</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-p2-plugin</artifactId>
<version>${tycho-version}</version>
<executions>
<execution>
<id>attach-p2-metadata</id>
<phase>package</phase>
<goals>
<goal>p2-metadata</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-maven-plugin</artifactId>
<version>${tycho-version}</version>
<extensions>true</extensions>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-source-plugin</artifactId>
<version>${tycho-version}</version>
<executions>
<execution>
<id>plugin-source</id>
<goals>
<goal>plugin-source</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>target-platform-configuration</artifactId>
<version>${tycho-version}</version>
<configuration>
<environments>
<environment>
<os>win32</os>
<ws>win32</ws>
<arch>x86</arch>
</environment>
<environment>
<os>linux</os>
<ws>gtk</ws>
<arch>x86_64</arch>
</environment>
<environment>
<os>macosx</os>
<ws>cocoa</ws>
<arch>x86_64</arch>
</environment>
</environments>
</configuration>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.eclipse.acceleo</groupId>
<artifactId>org.eclipse.acceleo.maven</artifactId>
<version>3.6.4</version>
<executions>
<execution>
<id>acceleo-compile</id>
<phase>compile</phase>
<goals>
<goal>acceleo-compile</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
Loading…
Cancel
Save