summaryrefslogtreecommitdiffstats
path: root/winery/org.eclipse.winery.generators.ia
diff options
context:
space:
mode:
Diffstat (limited to 'winery/org.eclipse.winery.generators.ia')
-rw-r--r--winery/org.eclipse.winery.generators.ia/.gitignore9
-rw-r--r--winery/org.eclipse.winery.generators.ia/about.html155
-rw-r--r--winery/org.eclipse.winery.generators.ia/about_files/Apache-LICENSE-2.0.txt202
-rw-r--r--winery/org.eclipse.winery.generators.ia/about_files/CDDL-v1.1.txt129
-rw-r--r--winery/org.eclipse.winery.generators.ia/about_files/LICENSE-logback.txt15
-rw-r--r--winery/org.eclipse.winery.generators.ia/about_files/LICENSE-slf4j-api.txt21
-rw-r--r--winery/org.eclipse.winery.generators.ia/pom.xml103
-rw-r--r--winery/org.eclipse.winery.generators.ia/src/main/java/org/eclipse/winery/generators/ia/Generator.java393
-rw-r--r--winery/org.eclipse.winery.generators.ia/src/main/resources/template/java/AbstractIAService.java.template86
-rw-r--r--winery/org.eclipse.winery.generators.ia/src/main/resources/template/java/TemplateService.java.template17
-rw-r--r--winery/org.eclipse.winery.generators.ia/src/main/resources/template/project/README.txt61
-rw-r--r--winery/org.eclipse.winery.generators.ia/src/main/resources/template/project/pom.xml251
-rw-r--r--winery/org.eclipse.winery.generators.ia/src/main/resources/template/project/src/main/webapp/WEB-INF/beans.xml16
-rw-r--r--winery/org.eclipse.winery.generators.ia/src/main/resources/template/project/src/main/webapp/WEB-INF/web.xml33
-rw-r--r--winery/org.eclipse.winery.generators.ia/src/test/java/META-INF/MANIFEST.MF3
-rw-r--r--winery/org.eclipse.winery.generators.ia/src/test/java/org/eclipse/winery/generators/ia/Test.java148
16 files changed, 1642 insertions, 0 deletions
diff --git a/winery/org.eclipse.winery.generators.ia/.gitignore b/winery/org.eclipse.winery.generators.ia/.gitignore
new file mode 100644
index 0000000..bfe7d2a
--- /dev/null
+++ b/winery/org.eclipse.winery.generators.ia/.gitignore
@@ -0,0 +1,9 @@
+.classpath
+/.gradle
+.settings
+.project
+/.sonar
+/bin
+/build
+/src/main/resources/rebel.xml
+/target
diff --git a/winery/org.eclipse.winery.generators.ia/about.html b/winery/org.eclipse.winery.generators.ia/about.html
new file mode 100644
index 0000000..b02b906
--- /dev/null
+++ b/winery/org.eclipse.winery.generators.ia/about.html
@@ -0,0 +1,155 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>January 24, 2014</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in (&ldquo;Content&rdquo;). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+<a href="http://www.eclipse.org/legal/epl-v10.html">Eclipse Public License Version 1.0 (&ldquo;EPL&rdquo;)</a>
+and <a href="http://www.opensource.org/licenses/apache2.0.php">Apache License Version 2.0</a>.
+A copy of the EPL is available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>
+and a copy of the Apache License Version 2.0 is available at <a href="http://www.opensource.org/licenses/apache2.0.php">http://www.opensource.org/licenses/apache2.0.php</a>.
+You may elect to redistribute this code under either of these licenses.
+For purposes of the EPL, &ldquo;Program&rdquo; will mean the Content.
+</p>
+
+<p>
+If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party (&ldquo;Redistributor&rdquo;) and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor&rsquo;s license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL and Apache License 2.0 still apply to any source code
+in the Content and such source code may be obtained at <a href="http://www.eclipse.org">http://www.eclipse.org</a>.
+</p>
+
+<h3>Third Party Content</h3>
+
+<h4>Java Libraries</h4>
+
+<h5>Apache Commons IO &ndash; Version 2.4</h5>
+<table>
+ <tr>
+ <td>URL</td>
+ <td><a href="http://commons.apache.org/proper/commons-io/">http://commons.apache.org/proper/commons-io/</a></td>
+ </tr>
+ <tr>
+ <td>License</td>
+ <td>Apache 2.0. A copy of the license is contained in the file <a href="about_files/Apache-LICENSE-2.0.txt" target="_blank">Apache-LICENSE-2.0.txt</a> and is also available at <a href="http://www.apache.org/licenses/LICENSE-2.0" target="_blank">http://www.apache.org/licenses/LICENSE-2.0</a></td>
+ </tr>
+</table>
+
+<h5>Apache Commons Lang3 &ndash; Version 3.1</h5>
+<table>
+ <tr>
+ <td>URL</td>
+ <td><a href="http://commons.apache.org/proper/commons-lang/">http://commons.apache.org/proper/commons-lang/</a></td>
+ </tr>
+ <tr>
+ <td>License</td>
+ <td>Apache 2.0. A copy of the license is contained in the file <a href="about_files/Apache-LICENSE-2.0.txt" target="_blank">Apache-LICENSE-2.0.txt</a> and is also available at <a href="http://www.apache.org/licenses/LICENSE-2.0" target="_blank">http://www.apache.org/licenses/LICENSE-2.0</a></td>
+ </tr>
+</table>
+
+<h5>JSP Standard Tag Library &ndash; Version 1.2</h5>
+<table>
+ <tr>
+ <td>URL</td>
+ <td><a href="https://jstl.java.net/">https://jstl.java.net/</a></td>
+ </tr>
+ <tr>
+ <td>License</td>
+ <td>CDDL and GPL with classpath exception (<a href="https://jersey.java.net/license.html" target="_blank">https://jersey.java.net/license.html</a>).
+ The Eclipse Foundation elects to include this software in this distribution under the CDDL license.
+ A copy of the license is available at <a href="about_files/CDDL-v1.1.txt" target="_blank">CDDL-v1.1.txt</a>.</td>
+ </tr>
+</table>
+
+<h5>Logback Classic &ndash; Version 1.1.1</h5>
+<table>
+ <tr>
+ <td>URL</td>
+ <td><a href="http://logback.qos.ch/">http://logback.qos.ch/</a></td>
+ </tr>
+ <tr>
+ <td>License</td>
+ <td>EPL/LGPL dual license.
+ EPL: <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+ LGPL v2.1: <a href="http://www.gnu.org/licenses/old-licenses/lgpl-2.1">http://www.gnu.org/licenses/old-licenses/lgpl-2.1</a>.
+ A copy of the license is contained in the file <a href="about_files/LICENSE-logback.txt" target="_blank">LICENSE-logback.txt</a> and is also available at <a href="http://logback.qos.ch/license.html" target="_blank">http://logback.qos.ch/license.html</a>.
+ The Eclipse Foundation elects to include this software in this distribution under the EPL license.</td>
+ </tr>
+</table>
+
+<h5>Logback Core &ndash; Version 1.1.1</h5>
+<table>
+ <tr>
+ <td>URL</td>
+ <td><a href="http://logback.qos.ch/">http://logback.qos.ch/</a></td>
+ </tr>
+ <tr>
+ <td>License</td>
+ <td>EPL/LGPL dual license.
+ EPL: <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+ LGPL v2.1: <a href="http://www.gnu.org/licenses/old-licenses/lgpl-2.1">http://www.gnu.org/licenses/old-licenses/lgpl-2.1</a>.
+ A copy of the license is contained in the file <a href="about_files/LICENSE-logback.txt" target="_blank">LICENSE-logback.txt</a> and is also available at <a href="http://logback.qos.ch/license.html" target="_blank">http://logback.qos.ch/license.html</a>.
+ The Eclipse Foundation elects to include this software in this distribution under the EPL license.</td>
+ </tr>
+</table>
+
+<h5>SLF4J: slf4j-api &ndash; Version 1.7.6</h5>
+<table>
+ <tr>
+ <td>URL</td>
+ <td><a href="http://www.slf4j.org/">http://www.slf4j.org/</a></td>
+ </tr>
+ <tr>
+ <td>License</td>
+ <td>MIT. A copy of the license is contained in the file <a href="about_files/LICENSE-slf4j-api.txt" target="_blank">LICENSE-slf4j-api.txt</a> and is also available at <a href="http://www.slf4j.org/license.html" target="_blank">http://www.slf4j.org/license.html</a></td>
+ </tr>
+</table>
+
+<h5>SLF4J: jcl-over-slf4j &ndash; Version 1.7.6</h5>
+<table>
+ <tr>
+ <td>URL</td>
+ <td><a href="http://www.slf4j.org/legacy.html">http://www.slf4j.org/legacy.html</a></td>
+ </tr>
+ <tr>
+ <td>License</td>
+ <td>Apache 2.0. A copy of the license is contained in the file <a href="about_files/Apache-LICENSE-2.0.txt" target="_blank">Apache-LICENSE-2.0.txt</a> and is also available at <a href="http://www.apache.org/licenses/LICENSE-2.0" target="_blank">http://www.apache.org/licenses/LICENSE-2.0</a></td>
+ </tr>
+</table>
+
+<h5>Winery: org.eclipse.winery.model.tosca &ndash; Version 0.1.20</h5>
+<table>
+ <tr>
+ <td>URL</td>
+ <td><a href="http://eclipse.org/winery/">http://eclipse.org/winery/</a></td>
+ </tr>
+ <tr>
+ <td>License</td>
+ <td>EPL/Apache 2.0. A copy of the licenses is contained in the files <a href="../LICENSE-ASL.txt" target="_blank">LICENSE-ASL.txt</a> and <a href="../LICENSE-EPL.txt" target="_blank">LICENSE-EPL.txt</a>. A copy of the EPL is available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a> and a copy of the Apache License Version 2.0 is available at <a href="http://www.opensource.org/licenses/apache2.0.php">http://www.opensource.org/licenses/apache2.0.php</a>.</td>
+ </tr>
+</table>
+
+<h5>xz for Java &ndash; Version 1.3</h5>
+<table>
+ <tr>
+ <td>URL</td>
+ <td><a href="http://tukaani.org/xz/java.html">http://tukaani.org/xz/java.html</a></td>
+ </tr>
+ <tr>
+ <td>License</td>
+ <td>Public domain. A copy of the license is available at <a href="http://tukaani.org/xz/java.html" target="_blank">http://tukaani.org/xz/java.html</a></td>
+ </tr>
+</table>
+
+</body>
+</html> \ No newline at end of file
diff --git a/winery/org.eclipse.winery.generators.ia/about_files/Apache-LICENSE-2.0.txt b/winery/org.eclipse.winery.generators.ia/about_files/Apache-LICENSE-2.0.txt
new file mode 100644
index 0000000..d645695
--- /dev/null
+++ b/winery/org.eclipse.winery.generators.ia/about_files/Apache-LICENSE-2.0.txt
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" 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. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/winery/org.eclipse.winery.generators.ia/about_files/CDDL-v1.1.txt b/winery/org.eclipse.winery.generators.ia/about_files/CDDL-v1.1.txt
new file mode 100644
index 0000000..7cc8719
--- /dev/null
+++ b/winery/org.eclipse.winery.generators.ia/about_files/CDDL-v1.1.txt
@@ -0,0 +1,129 @@
+COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL - Version 1.1)
+1. Definitions.
+
+ 1.1. “Contributor” means each individual or entity that creates or contributes to the creation of Modifications.
+
+ 1.2. “Contributor Version” means the combination of the Original Software, prior Modifications used by a Contributor (if any), and the Modifications made by that particular Contributor.
+
+ 1.3. “Covered Software” means (a) the Original Software, or (b) Modifications, or (c) the combination of files containing Original Software with files containing Modifications, in each case including portions thereof.
+
+ 1.4. “Executable” means the Covered Software in any form other than Source Code.
+
+ 1.5. “Initial Developer” means the individual or entity that first makes Original Software available under this License.
+
+ 1.6. “Larger Work” means a work which combines Covered Software or portions thereof with code not governed by the terms of this License.
+
+ 1.7. “License” means this document.
+
+ 1.8. “Licensable” means having the right to grant, to the maximum extent possible, whether at the time of the initial grant or subsequently acquired, any and all of the rights conveyed herein.
+
+ 1.9. “Modifications” means the Source Code and Executable form of any of the following:
+
+ A. Any file that results from an addition to, deletion from or modification of the contents of a file containing Original Software or previous Modifications;
+
+ B. Any new file that contains any part of the Original Software or previous Modification; or
+
+ C. Any new file that is contributed or otherwise made available under the terms of this License.
+
+ 1.10. “Original Software” means the Source Code and Executable form of computer software code that is originally released under this License.
+
+ 1.11. “Patent Claims” means any patent claim(s), now owned or hereafter acquired, including without limitation, method, process, and apparatus claims, in any patent Licensable by grantor.
+
+ 1.12. “Source Code” means (a) the common form of computer software code in which modifications are made and (b) associated documentation included in or with such code.
+
+ 1.13. “You” (or “Your”) means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License. For legal entities, “You” includes any entity which controls, is controlled by, or is under common control with You. For purposes of this definition, “control” means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of more than fifty percent (50%) of the outstanding shares or beneficial ownership of such entity.
+
+2. License Grants.
+
+ 2.1. The Initial Developer Grant.
+
+ Conditioned upon Your compliance with Section 3.1 below and subject to third party intellectual property claims, the Initial Developer hereby grants You a world-wide, royalty-free, non-exclusive license:
+
+ (a) under intellectual property rights (other than patent or trademark) Licensable by Initial Developer, to use, reproduce, modify, display, perform, sublicense and distribute the Original Software (or portions thereof), with or without Modifications, and/or as part of a Larger Work; and
+
+ (b) under Patent Claims infringed by the making, using or selling of Original Software, to make, have made, use, practice, sell, and offer for sale, and/or otherwise dispose of the Original Software (or portions thereof).
+
+ (c) The licenses granted in Sections 2.1(a) and (b) are effective on the date Initial Developer first distributes or otherwise makes the Original Software available to a third party under the terms of this License.
+
+ (d) Notwithstanding Section 2.1(b) above, no patent license is granted: (1) for code that You delete from the Original Software, or (2) for infringements caused by: (i) the modification of the Original Software, or (ii) the combination of the Original Software with other software or devices.
+
+ 2.2. Contributor Grant.
+
+ Conditioned upon Your compliance with Section 3.1 below and subject to third party intellectual property claims, each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license:
+
+ (a) under intellectual property rights (other than patent or trademark) Licensable by Contributor to use, reproduce, modify, display, perform, sublicense and distribute the Modifications created by such Contributor (or portions thereof), either on an unmodified basis, with other Modifications, as Covered Software and/or as part of a Larger Work; and
+
+ (b) under Patent Claims infringed by the making, using, or selling of Modifications made by that Contributor either alone and/or in combination with its Contributor Version (or portions of such combination), to make, use, sell, offer for sale, have made, and/or otherwise dispose of: (1) Modifications made by that Contributor (or portions thereof); and (2) the combination of Modifications made by that Contributor with its Contributor Version (or portions of such combination).
+
+ (c) The licenses granted in Sections 2.2(a) and 2.2(b) are effective on the date Contributor first distributes or otherwise makes the Modifications available to a third party.
+
+ (d) Notwithstanding Section 2.2(b) above, no patent license is granted: (1) for any code that Contributor has deleted from the Contributor Version; (2) for infringements caused by: (i) third party modifications of Contributor Version, or (ii) the combination of Modifications made by that Contributor with other software (except as part of the Contributor Version) or other devices; or (3) under Patent Claims infringed by Covered Software in the absence of Modifications made by that Contributor.
+
+3. Distribution Obligations.
+
+ 3.1. Availability of Source Code.
+
+ Any Covered Software that You distribute or otherwise make available in Executable form must also be made available in Source Code form and that Source Code form must be distributed only under the terms of this License. You must include a copy of this License with every copy of the Source Code form of the Covered Software You distribute or otherwise make available. You must inform recipients of any such Covered Software in Executable form as to how they can obtain such Covered Software in Source Code form in a reasonable manner on or through a medium customarily used for software exchange.
+
+ 3.2. Modifications.
+
+ The Modifications that You create or to which You contribute are governed by the terms of this License. You represent that You believe Your Modifications are Your original creation(s) and/or You have sufficient rights to grant the rights conveyed by this License.
+
+ 3.3. Required Notices.
+
+ You must include a notice in each of Your Modifications that identifies You as the Contributor of the Modification. You may not remove or alter any copyright, patent or trademark notices contained within the Covered Software, or any notices of licensing or any descriptive text giving attribution to any Contributor or the Initial Developer.
+
+ 3.4. Application of Additional Terms.
+
+ You may not offer or impose any terms on any Covered Software in Source Code form that alters or restricts the applicable version of this License or the recipients’ rights hereunder. You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Covered Software. However, you may do so only on Your own behalf, and not on behalf of the Initial Developer or any Contributor. You must make it absolutely clear that any such warranty, support, indemnity or liability obligation is offered by You alone, and You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of warranty, support, indemnity or liability terms You offer.
+
+ 3.5. Distribution of Executable Versions.
+
+ You may distribute the Executable form of the Covered Software under the terms of this License or under the terms of a license of Your choice, which may contain terms different from this License, provided that You are in compliance with the terms of this License and that the license for the Executable form does not attempt to limit or alter the recipient’s rights in the Source Code form from the rights set forth in this License. If You distribute the Covered Software in Executable form under a different license, You must make it absolutely clear that any terms which differ from this License are offered by You alone, not by the Initial Developer or Contributor. You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of any such terms You offer.
+
+ 3.6. Larger Works.
+
+ You may create a Larger Work by combining Covered Software with other code not governed by the terms of this License and distribute the Larger Work as a single product. In such a case, You must make sure the requirements of this License are fulfilled for the Covered Software.
+
+4. Versions of the License.
+
+ 4.1. New Versions.
+
+ Oracle is the initial license steward and may publish revised and/or new versions of this License from time to time. Each version will be given a distinguishing version number. Except as provided in Section 4.3, no one other than the license steward has the right to modify this License.
+
+ 4.2. Effect of New Versions.
+
+ You may always continue to use, distribute or otherwise make the Covered Software available under the terms of the version of the License under which You originally received the Covered Software. If the Initial Developer includes a notice in the Original Software prohibiting it from being distributed or otherwise made available under any subsequent version of the License, You must distribute and make the Covered Software available under the terms of the version of the License under which You originally received the Covered Software. Otherwise, You may also choose to use, distribute or otherwise make the Covered Software available under the terms of any subsequent version of the License published by the license steward.
+
+ 4.3. Modified Versions.
+
+ When You are an Initial Developer and You want to create a new license for Your Original Software, You may create and use a modified version of this License if You: (a) rename the license and remove any references to the name of the license steward (except to note that the license differs from this License); and (b) otherwise make it clear that the license contains terms which differ from this License.
+
+5. DISCLAIMER OF WARRANTY.
+
+COVERED SOFTWARE IS PROVIDED UNDER THIS LICENSE ON AN “AS IS” BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE COVERED SOFTWARE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED SOFTWARE IS WITH YOU. SHOULD ANY COVERED SOFTWARE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY COVERED SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
+6. TERMINATION.
+
+ 6.1. This License and the rights granted hereunder will terminate automatically if You fail to comply with terms herein and fail to cure such breach within 30 days of becoming aware of the breach. Provisions which, by their nature, must remain in effect beyond the termination of this License shall survive.
+
+ 6.2. If You assert a patent infringement claim (excluding declaratory judgment actions) against Initial Developer or a Contributor (the Initial Developer or Contributor against whom You assert such claim is referred to as “Participant”) alleging that the Participant Software (meaning the Contributor Version where the Participant is a Contributor or the Original Software where the Participant is the Initial Developer) directly or indirectly infringes any patent, then any and all rights granted directly or indirectly to You by such Participant, the Initial Developer (if the Initial Developer is not the Participant) and all Contributors under Sections 2.1 and/or 2.2 of this License shall, upon 60 days notice from Participant terminate prospectively and automatically at the expiration of such 60 day notice period, unless if within such 60 day period You withdraw Your claim with respect to the Participant Software against such Participant either unilaterally or pursuant to a written agreement with Participant.
+
+ 6.3. If You assert a patent infringement claim against Participant alleging that the Participant Software directly or indirectly infringes any patent where such claim is resolved (such as by license or settlement) prior to the initiation of patent infringement litigation, then the reasonable value of the licenses granted by such Participant under Sections 2.1 or 2.2 shall be taken into account in determining the amount or value of any payment or license.
+
+ 6.4. In the event of termination under Sections 6.1 or 6.2 above, all end user licenses that have been validly granted by You or any distributor hereunder prior to termination (excluding licenses granted to You by any distributor) shall survive termination.
+
+7. LIMITATION OF LIABILITY.
+
+UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED SOFTWARE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY RESULTING FROM SUCH PARTY’S NEGLIGENCE TO THE EXTENT APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU.
+8. U.S. GOVERNMENT END USERS.
+
+The Covered Software is a “commercial item,” as that term is defined in 48 C.F.R. 2.101 (Oct. 1995), consisting of “commercial computer software” (as that term is defined at 48 C.F.R. § 252.227-7014(a)(1)) and “commercial computer software documentation” as such terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48 C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all U.S. Government End Users acquire Covered Software with only those rights set forth herein. This U.S. Government Rights clause is in lieu of, and supersedes, any other FAR, DFAR, or other clause or provision that addresses Government rights in computer software under this License.
+9. MISCELLANEOUS.
+
+This License represents the complete agreement concerning subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. This License shall be governed by the law of the jurisdiction specified in a notice contained within the Original Software (except to the extent applicable law, if any, provides otherwise), excluding such jurisdiction’s conflict-of-law provisions. Any litigation relating to this License shall be subject to the jurisdiction of the courts located in the jurisdiction and venue specified in a notice contained within the Original Software, with the losing party responsible for costs, including, without limitation, court costs and reasonable attorneys’ fees and expenses. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not apply to this License. You agree that You alone are responsible for compliance with the United States export administration regulations (and the export control laws and regulation of any other countries) when You use, distribute or otherwise make available any Covered Software.
+10. RESPONSIBILITY FOR CLAIMS.
+
+As between Initial Developer and the Contributors, each party is responsible for claims and damages arising, directly or indirectly, out of its utilization of rights under this License and You agree to work with Initial Developer and Contributors to distribute such responsibility on an equitable basis. Nothing herein is intended or shall be deemed to constitute any admission of liability.
+NOTICE PURSUANT TO SECTION 9 OF THE COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL)
+
+The code released under the CDDL shall be governed by the laws of the State of California (excluding conflict-of-law provisions). Any litigation relating to this License shall be subject to the jurisdiction of the Federal Courts of the Northern District of California and the state courts of the State of California, with venue lying in Santa Clara County, California. \ No newline at end of file
diff --git a/winery/org.eclipse.winery.generators.ia/about_files/LICENSE-logback.txt b/winery/org.eclipse.winery.generators.ia/about_files/LICENSE-logback.txt
new file mode 100644
index 0000000..b4fe24e
--- /dev/null
+++ b/winery/org.eclipse.winery.generators.ia/about_files/LICENSE-logback.txt
@@ -0,0 +1,15 @@
+Logback LICENSE
+---------------
+
+Logback: the reliable, generic, fast and flexible logging framework.
+Copyright (C) 1999-2012, QOS.ch. All rights reserved.
+
+This program and the accompanying materials are dual-licensed under
+either the terms of the Eclipse Public License v1.0 as published by
+the Eclipse Foundation
+
+ or (per the licensee's choosing)
+
+under the terms of the GNU Lesser General Public License version 2.1
+as published by the Free Software Foundation.
+
diff --git a/winery/org.eclipse.winery.generators.ia/about_files/LICENSE-slf4j-api.txt b/winery/org.eclipse.winery.generators.ia/about_files/LICENSE-slf4j-api.txt
new file mode 100644
index 0000000..37050c9
--- /dev/null
+++ b/winery/org.eclipse.winery.generators.ia/about_files/LICENSE-slf4j-api.txt
@@ -0,0 +1,21 @@
+ Copyright (c) 2004-2013 QOS.ch
+ All rights reserved.
+
+ Permission is hereby granted, free of charge, to any person obtaining
+ a copy of this software and associated documentation files (the
+ "Software"), to deal in the Software without restriction, including
+ without limitation the rights to use, copy, modify, merge, publish,
+ distribute, sublicense, and/or sell copies of the Software, and to
+ permit persons to whom the Software is furnished to do so, subject to
+ the following conditions:
+
+ The above copyright notice and this permission notice shall be
+ included in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/winery/org.eclipse.winery.generators.ia/pom.xml b/winery/org.eclipse.winery.generators.ia/pom.xml
new file mode 100644
index 0000000..ccdf43b
--- /dev/null
+++ b/winery/org.eclipse.winery.generators.ia/pom.xml
@@ -0,0 +1,103 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/*******************************************************************************
+ * Copyright (c) 2013 University of Stuttgart.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * and the Apache License 2.0 which both accompany this distribution,
+ * and are available at http://www.eclipse.org/legal/epl-v10.html
+ * and http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Contributors:
+ * Tobias Binz - initial API and implementation and/or initial documentation
+ *******************************************************************************/
+-->
+<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>org.eclipse.winery</groupId>
+ <artifactId>winery</artifactId>
+ <version>0.1.37-SNAPSHOT</version>
+ </parent>
+ <artifactId>org.eclipse.winery.generators.ia</artifactId>
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ </properties>
+ <dependencies>
+ <dependency>
+ <groupId>org.eclipse.winery</groupId>
+ <artifactId>org.eclipse.winery.common</artifactId>
+ <version>0.1.37-SNAPSHOT</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>ch.qos.logback</groupId>
+ <artifactId>logback-classic</artifactId>
+ <version>1.1.1</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>jcl-over-slf4j</artifactId>
+ <version>1.7.6</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.winery</groupId>
+ <artifactId>org.eclipse.winery.model.tosca</artifactId>
+ <version>0.1.21-SNAPSHOT</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-compress</artifactId>
+ <version>1.6</version>
+ <scope>compile</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>org.tukaani</groupId>
+ <artifactId>xz</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <!-- Version 1.3 is approved by Eclipse, Version 1.4 is not -->
+ <groupId>org.tukaani</groupId>
+ <artifactId>xz</artifactId>
+ <version>1.3</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ <version>2.4</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.11</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>3.1</version>
+ <configuration>
+ <source>1.7</source>
+ <target>1.7</target>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.16</version>
+ <configuration>
+ <skipTests>true</skipTests>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/winery/org.eclipse.winery.generators.ia/src/main/java/org/eclipse/winery/generators/ia/Generator.java b/winery/org.eclipse.winery.generators.ia/src/main/java/org/eclipse/winery/generators/ia/Generator.java
new file mode 100644
index 0000000..571d42c
--- /dev/null
+++ b/winery/org.eclipse.winery.generators.ia/src/main/java/org/eclipse/winery/generators/ia/Generator.java
@@ -0,0 +1,393 @@
+/*******************************************************************************
+ * Copyright (c) 2013,2015 University of Stuttgart.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * and the Apache License 2.0 which both accompany this distribution,
+ * and are available at http://www.eclipse.org/legal/epl-v10.html
+ * and http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Contributors:
+ * Tobias Binz - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.winery.generators.ia;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.nio.charset.Charset;
+import java.nio.file.Files;
+import java.nio.file.OpenOption;
+import java.nio.file.Path;
+import java.nio.file.StandardCopyOption;
+import java.nio.file.StandardOpenOption;
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.List;
+import java.util.jar.JarEntry;
+import java.util.jar.JarFile;
+
+import org.apache.commons.compress.archivers.ArchiveEntry;
+import org.apache.commons.compress.archivers.ArchiveOutputStream;
+import org.apache.commons.compress.archivers.ArchiveStreamFactory;
+import org.apache.commons.compress.archivers.zip.ZipArchiveEntry;
+import org.apache.commons.compress.utils.IOUtils;
+import org.apache.commons.io.FileUtils;
+import org.eclipse.winery.model.tosca.TBoolean;
+import org.eclipse.winery.model.tosca.TInterface;
+import org.eclipse.winery.model.tosca.TOperation;
+import org.eclipse.winery.model.tosca.TParameter;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class Generator {
+
+ private static final Logger logger = LoggerFactory.getLogger(Generator.class);
+
+ // Placeholder applicable for all files
+ public static final String PLACEHOLDER_JAVA_PACKAGE = "IA_PACKAGE";
+ public static final String PLACEHOLDER_NAMESPACE = "IA_NAMESPACE";
+ public static final String PLACEHOLDER_CLASS_NAME = "IA_CLASS_NAME";
+ public static final String PLACEHOLDER_IA_ARTIFACT_TEMPLATE_UPLOAD_URL = "IA_ARTIFACT_TEMPLATE_UPLOAD_URL";
+
+ // Placeholders in Java Service Files
+ public static final String PLACEHOLDER_GENERATED_WEBSERVICE_METHODS = "GENERATED_WEBSERVICE_METHODS";
+
+ // Template folder relative to resources folder in this project
+ public static final String TEMPLATE_PROJECT_FOLDER = "template/project";
+ public static final String TEMPLATE_JAVA_FOLDER = "template/java";
+
+ private static final String TEMPLATE_JAVA_ABSTRACT_IA_SERVICE = "AbstractIAService.java.template";
+ private static final String TEMPLATE_JAVA_TEMPLATE_SERVICE = "TemplateService.java.template";
+
+ private final TInterface tinterface;
+ private final File workingDir;
+ private final File outDir;
+ private final String name;
+ private final String javaPackage;
+ private final String namespace;
+ private final URL iaArtifactTemplateUploadUrl;
+
+
+ /**
+ * Creates a new IA Generator instance for the given {@link TInterface}.
+ *
+ * @param tinterface TOSCA interface to generate the IA for
+ * @param packageAndNamespace Package to be used for the generated Java
+ * code, e.g. 'org.opentosca.ia'. To generate the respective
+ * Namespace for the Web Service the components of the package
+ * are reverted, prepended with 'http://' and appended with '/'.
+ * This is provided by the user in a textfield in the Winery UI.
+ * @param iaArtifactTemplateUploadUrl The URL to which the generated IA
+ * should be posted.
+ * @param name unique and valid name to be used for the generated maven
+ * project name, java project name, class name, port type name.
+ * @param workingDir working directory to generate the files. This directory
+ * also will contain the ZIP file with the Eclipse project after
+ * generating it.
+ */
+ public Generator(TInterface tinterface, String packageAndNamespace, URL iaArtifactTemplateUploadUrl, String name, File workingDir) {
+ super();
+ this.tinterface = tinterface;
+ this.javaPackage = packageAndNamespace;
+ this.iaArtifactTemplateUploadUrl = iaArtifactTemplateUploadUrl;
+ this.name = name;
+ this.workingDir = new File(workingDir.getAbsolutePath() + File.separator + this.name);
+ this.outDir = new File(workingDir.getAbsolutePath());
+
+ if (this.workingDir.exists()) {
+ Generator.logger.error("Workdir " + this.workingDir + " already exits. This might lead to corrupted results if it is not empty!");
+ }
+
+ // Generate Namespace
+ String[] splitPkg = this.javaPackage.split("\\.");
+ String tmpNamespace = "http://";
+ for (int i = splitPkg.length - 1; i >= 0; i--) {
+ tmpNamespace += splitPkg[i];
+ // Add '.' if it is not the last iterations
+ if (i != 0) {
+ tmpNamespace += ".";
+ }
+ }
+ this.namespace = tmpNamespace += "/";
+ }
+
+ /**
+ * Generates the IA project.
+ *
+ * @return The ZIP file containing the maven/eclipse project to be
+ * downloaded by the user.
+ */
+ public File generateProject() {
+
+ try {
+ Path workingDirPath = this.workingDir.toPath();
+ Files.createDirectories(workingDirPath);
+
+ // directory to store the template files to generate the java files from
+ Path javaTemplateDir = workingDirPath.resolve("../java");
+ Files.createDirectories(javaTemplateDir);
+
+ // Copy template project and template java files
+ String s = this.getClass().getResource("").getPath();
+ if (s.contains("jar!")) {
+ Generator.logger.trace("we work on a jar file");
+ Generator.logger.trace("Location of the current class: {}", s);
+
+ // we have a jar file
+ // format: file:/location...jar!...path-in-the-jar
+ // we only want to have location :)
+ int excl = s.lastIndexOf("!");
+ s = s.substring(0, excl);
+ s = s.substring("file:".length());
+
+ try (JarFile jf = new JarFile(s);) {
+ Enumeration<JarEntry> entries = jf.entries();
+ while (entries.hasMoreElements()) {
+ JarEntry je = entries.nextElement();
+ String name = je.getName();
+ if (name.startsWith(Generator.TEMPLATE_PROJECT_FOLDER + "/") && (name.length() > (Generator.TEMPLATE_PROJECT_FOLDER.length() + 1))) {
+ // strip "template/" from the beginning to have paths without "template" starting relatively from the working dir
+ name = name.substring(Generator.TEMPLATE_PROJECT_FOLDER.length() + 1);
+ if (je.isDirectory()) {
+ // directory found
+ Path dir = workingDirPath.resolve(name);
+ Files.createDirectory(dir);
+ } else {
+ Path file = workingDirPath.resolve(name);
+ try (InputStream is = jf.getInputStream(je);) {
+ Files.copy(is, file, StandardCopyOption.REPLACE_EXISTING);
+ }
+ }
+ } else if (name.startsWith(Generator.TEMPLATE_JAVA_FOLDER + "/") && (name.length() > (Generator.TEMPLATE_JAVA_FOLDER.length() + 1))) {
+ if (!je.isDirectory()) {
+ // we copy the file directly into javaTemplateDir
+ File f = new File(name);
+ Path file = javaTemplateDir.resolve(f.getName());
+ try (InputStream is = jf.getInputStream(je);) {
+ Files.copy(is, file, StandardCopyOption.REPLACE_EXISTING);
+ }
+ }
+ }
+ }
+ }
+ } else {
+ // we're running in debug mode, we can work on the plain file system
+ File templateProjectDir = new File(this.getClass().getResource("/" + Generator.TEMPLATE_PROJECT_FOLDER).getFile());
+ FileUtils.copyDirectory(templateProjectDir, this.workingDir);
+
+ File javaTemplatesDir = new File(this.getClass().getResource("/" + Generator.TEMPLATE_JAVA_FOLDER).getFile());
+ FileUtils.copyDirectory(javaTemplatesDir, javaTemplateDir.toFile());
+ }
+
+ // Create Java Code Folder
+ String[] splitPkg = this.javaPackage.split("\\.");
+ String javaFolderString = this.workingDir.getAbsolutePath() + File.separator + "src" + File.separator + "main" + File.separator + "java";
+ for (int i = 0; i < splitPkg.length; i++) {
+ javaFolderString += File.separator + splitPkg[i];
+ }
+
+ // Copy TEMPLATE_JAVA_ABSTRACT_IA_SERVICE
+ Path templateAbstractIAService = javaTemplateDir.resolve(Generator.TEMPLATE_JAVA_ABSTRACT_IA_SERVICE);
+ File javaAbstractIAService = new File(javaFolderString + File.separator + "AbstractIAService.java");
+ Files.createDirectories(javaAbstractIAService.toPath().getParent());
+ Files.copy(templateAbstractIAService, javaAbstractIAService.toPath(), StandardCopyOption.REPLACE_EXISTING);
+
+ // Copy and rename TEMPLATE_JAVA_TEMPLATE_SERVICE
+ Path templateJavaService = javaTemplateDir.resolve(Generator.TEMPLATE_JAVA_TEMPLATE_SERVICE);
+ File javaService = new File(javaFolderString + File.separator + this.name + ".java");
+ Files.createDirectories(javaService.toPath().getParent());
+ Files.copy(templateJavaService, javaService.toPath(), StandardCopyOption.REPLACE_EXISTING);
+
+ this.generateJavaFile(javaService);
+ this.updateFilesRecursively(this.workingDir);
+ return this.packageProject();
+
+ } catch (Exception e) {
+ e.printStackTrace();
+ return null;
+ }
+ }
+
+ private void generateJavaFile(File javaService) throws IOException {
+
+ // Generate methods
+ StringBuilder sb = new StringBuilder();
+
+ for (TOperation op : this.tinterface.getOperation()) {
+ // Annotations
+ sb.append("\t@WebMethod\n");
+ sb.append("\t@SOAPBinding\n");
+ sb.append("\t@Oneway\n");
+
+ // Signatur
+ String operationReturn = "void";
+ sb.append("\tpublic " + operationReturn + " " + op.getName() + "(\n");
+
+ // Parameter
+ boolean first = true;
+ if (op.getInputParameters() != null) {
+ for (TParameter parameter : op.getInputParameters().getInputParameter()) {
+ String parameterName = parameter.getName();
+
+ if (first) {
+ first = false;
+ sb.append("\t\t");
+ } else {
+ sb.append(",\n\t\t");
+ }
+
+ // Generate @WebParam
+ sb.append("@WebParam(name=\"" + parameterName + "\", targetNamespace=\"" + this.namespace + "\") ");
+
+ // Handle required and optional parameters using @XmlElement
+ if (parameter.getRequired().equals(TBoolean.YES)) {
+ sb.append("@XmlElement(required=true)");
+ } else {
+ sb.append("@XmlElement(required=false)");
+ }
+
+ sb.append(" String " + parameterName);
+ }
+ }
+ sb.append("\n\t) {\n");
+
+ // If there are output parameters we generate the respective HashMap
+ boolean outputParamsExist = (op.getOutputParameters() != null) && (!op.getOutputParameters().getOutputParameter().isEmpty());
+ if (outputParamsExist) {
+ sb.append("\t\t// This HashMap holds the return parameters of this operation.\n");
+ sb.append("\t\tfinal HashMap<String,String> returnParameters = new HashMap<String, String>();\n\n");
+ }
+
+ sb.append("\t\t// TODO: Implement your operation here.\n");
+
+ // Generate code to set output parameters
+ if (outputParamsExist) {
+ for (TParameter outputParam : op.getOutputParameters().getOutputParameter()) {
+ sb.append("\n\n\t\t// Output Parameter '" + outputParam.getName() + "' ");
+ if (outputParam.getRequired().equals(TBoolean.YES)) {
+ sb.append("(required)");
+ } else {
+ sb.append("(optional)");
+ }
+ sb.append("\n\t\t// TODO: Set " + outputParam.getName() + " parameter here.");
+ sb.append("\n\t\t// Do NOT delete the next line of code. Set \"\" as value if you want to return nothing or an empty result!");
+ sb.append("\n\t\treturnParameters.put(\"" + outputParam.getName() + "\", \"TODO\");");
+ }
+ sb.append("\n\n\t\tsendResponse(returnParameters);\n");
+ }
+
+ sb.append("\t}\n\n");
+ }
+
+ // Read file and replace placeholders
+ Charset cs = Charset.defaultCharset();
+ List<String> lines = new ArrayList<>();
+ for (String line : Files.readAllLines(javaService.toPath(), cs)) {
+ // Replace web service method
+ line = line.replaceAll(Generator.PLACEHOLDER_GENERATED_WEBSERVICE_METHODS, sb.toString());
+ lines.add(line);
+ }
+
+ // Write file
+ OpenOption[] options = new OpenOption[] {StandardOpenOption.WRITE, StandardOpenOption.TRUNCATE_EXISTING};
+ Files.write(javaService.toPath(), lines, cs, options);
+ }
+
+ /**
+ * Iterates recursively through all the files in the project working
+ * directory and tries to replace the global placeholders.
+ *
+ * @param folderOrFile to start with
+ */
+ private void updateFilesRecursively(File folderOrFile) {
+ if (folderOrFile.isFile()) {
+
+ if (folderOrFile.getAbsolutePath().endsWith(".jar")) {
+ return;
+ }
+
+ Generator.logger.trace("Updating file " + folderOrFile);
+
+ try {
+ // Read file and replace placeholders
+ Charset cs = Charset.defaultCharset();
+ List<String> lines = new ArrayList<>();
+ for (String line : Files.readAllLines(folderOrFile.toPath(), cs)) {
+ line = line.replaceAll(Generator.PLACEHOLDER_CLASS_NAME, this.name);
+ line = line.replaceAll(Generator.PLACEHOLDER_JAVA_PACKAGE, this.javaPackage);
+ line = line.replaceAll(Generator.PLACEHOLDER_NAMESPACE, this.namespace);
+ line = line.replaceAll(Generator.PLACEHOLDER_IA_ARTIFACT_TEMPLATE_UPLOAD_URL, this.iaArtifactTemplateUploadUrl.toString());
+ lines.add(line);
+ }
+
+ // Write file
+ OpenOption[] options = new OpenOption[] {StandardOpenOption.WRITE, StandardOpenOption.TRUNCATE_EXISTING};
+ Files.write(folderOrFile.toPath(), lines, cs, options);
+
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+
+ } else {
+ Generator.logger.trace("Updating folder " + folderOrFile);
+ for (File childFile : folderOrFile.listFiles()) {
+ this.updateFilesRecursively(childFile);
+ }
+ }
+ }
+
+ /**
+ * Packages the generated project into a ZIP file which is stored in outDir
+ * and has the name of the Project.
+ *
+ * @return ZIP file
+ */
+ private File packageProject() {
+ try {
+ File packagedProject = new File(this.outDir.getAbsoluteFile() + File.separator + this.name + ".zip");
+ FileOutputStream fileOutputStream = new FileOutputStream(packagedProject);
+ final ArchiveOutputStream zos = new ArchiveStreamFactory().createArchiveOutputStream("zip", fileOutputStream);
+
+ this.addFilesRecursively(this.workingDir.getAbsoluteFile(), this.workingDir.getAbsoluteFile().getAbsolutePath() + File.separator, zos);
+
+ zos.finish();
+ zos.close();
+
+ return packagedProject;
+
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ return null;
+ }
+
+ /**
+ * Recursive Helper function for packageProject()
+ *
+ * @param folderOrFile to add into the archive
+ * @param baseDir
+ * @param zos ArchiveOutputStream to add the files to
+ */
+ private void addFilesRecursively(File folderOrFile, String baseDir, ArchiveOutputStream zos) {
+ if (folderOrFile.isFile()) {
+ String nameOfFileInZip = folderOrFile.getAbsolutePath().replace(baseDir, "");
+ Generator.logger.trace("Adding " + folderOrFile + " as " + nameOfFileInZip);
+ ArchiveEntry archiveEntry = new ZipArchiveEntry(nameOfFileInZip);
+ try (InputStream is = new FileInputStream(folderOrFile)) {
+ zos.putArchiveEntry(archiveEntry);
+ IOUtils.copy(is, zos);
+ zos.closeArchiveEntry();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ } else {
+ Generator.logger.trace("Adding folder " + folderOrFile);
+ for (File childFile : folderOrFile.listFiles()) {
+ this.addFilesRecursively(childFile, baseDir, zos);
+ }
+ }
+ }
+}
diff --git a/winery/org.eclipse.winery.generators.ia/src/main/resources/template/java/AbstractIAService.java.template b/winery/org.eclipse.winery.generators.ia/src/main/resources/template/java/AbstractIAService.java.template
new file mode 100644
index 0000000..4d4d2a4
--- /dev/null
+++ b/winery/org.eclipse.winery.generators.ia/src/main/resources/template/java/AbstractIAService.java.template
@@ -0,0 +1,86 @@
+package IA_PACKAGE;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map.Entry;
+
+import javax.annotation.Resource;
+import javax.xml.ws.WebServiceContext;
+
+import org.apache.cxf.headers.Header;
+import org.apache.cxf.helpers.CastUtils;
+import org.apache.cxf.jaxws.context.WrappedMessageContext;
+import org.apache.cxf.message.Message;
+import org.w3c.dom.Node;
+
+import org.eclipse.winery.highlevelrestapi.HighLevelRestApi;
+
+public abstract class AbstractIAService {
+
+ @Resource
+ private WebServiceContext context;
+
+ protected void sendResponse (HashMap<String,String> returnParameters) {
+
+ // Extract message
+ WrappedMessageContext wrappedContext = (WrappedMessageContext) context.getMessageContext();
+ Message message = wrappedContext.getWrappedMessage();
+
+ // Extract headers from message
+ List<Header> headers = CastUtils.cast((List<?>) message.get(Header.HEADER_LIST));
+
+ // Find ReplyTo and MessageID SOAP Header
+ String replyTo = null;
+ String messageID = null;
+ for (Header iter : headers) {
+
+ Object headerObject = iter.getObject();
+
+ // Unmarshall to org.w3c.dom.Node
+ if (headerObject instanceof Node) {
+ Node node = (Node) headerObject;
+ String localPart = iter.getName().getLocalPart();
+ String content = node.getTextContent();
+
+ // Extract ReplyTo Header value
+ if ("ReplyTo".equals(localPart)) {
+ replyTo = content;
+ }
+
+ // Extract MessageID Header value
+ if ("MessageID".equals(localPart)) {
+ messageID = content;
+ }
+ }
+ }
+
+ // Create asynchronous SOAP Response Message
+ StringBuilder builder = new StringBuilder();
+
+ builder.append("<soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/' xmlns:sch='http://siserver.org/schema'>");
+ builder.append(" <soapenv:Header/>");
+ builder.append(" <soapenv:Body>");
+ builder.append(" <sch:invokeResponse>");
+ builder.append(" <sch:MessageID>" + messageID + "</sch:MessageID>");
+
+ // Insert return parameters into asynchronous SOAP Response Message
+ for (Entry<String, String> paramIter : returnParameters.entrySet()) {
+
+ String key = paramIter.getKey();
+ String value = paramIter.getValue();
+
+ builder.append(" <" + key + ">" + value + "</" + key +">");
+ }
+
+ builder.append(" </sch:invokeResponse>");
+ builder.append(" </soapenv:Body>");
+ builder.append("</soapenv:Envelope>");
+
+ // Send SOAP Response Message back to requester
+ if(replyTo == null) {
+ System.err.println("No 'ReplyTo' header found!\nTherefore, reply message is printed here:\n" + builder.toString());
+ } else {
+ HighLevelRestApi.Post(replyTo, builder.toString(), "");
+ }
+ }
+}
diff --git a/winery/org.eclipse.winery.generators.ia/src/main/resources/template/java/TemplateService.java.template b/winery/org.eclipse.winery.generators.ia/src/main/resources/template/java/TemplateService.java.template
new file mode 100644
index 0000000..692905e
--- /dev/null
+++ b/winery/org.eclipse.winery.generators.ia/src/main/resources/template/java/TemplateService.java.template
@@ -0,0 +1,17 @@
+package IA_PACKAGE;
+
+import java.util.HashMap;
+
+import javax.jws.Oneway;
+import javax.jws.WebMethod;
+import javax.jws.WebParam;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+import javax.xml.bind.annotation.XmlElement;
+
+@WebService
+public class IA_CLASS_NAME extends AbstractIAService {
+
+GENERATED_WEBSERVICE_METHODS
+
+} \ No newline at end of file
diff --git a/winery/org.eclipse.winery.generators.ia/src/main/resources/template/project/README.txt b/winery/org.eclipse.winery.generators.ia/src/main/resources/template/project/README.txt
new file mode 100644
index 0000000..bce220d
--- /dev/null
+++ b/winery/org.eclipse.winery.generators.ia/src/main/resources/template/project/README.txt
@@ -0,0 +1,61 @@
+###########################################################################
+GENERATED IMPLEMENTATION ARTIFACT SKELETON FOR IA_CLASS_NAME
+
+Interface Name: IA_CLASS_NAME
+Namespace: IA_NAMESPACE
+Java Package: IA_PACKAGE
+URL: IA_ARTIFACT_TEMPLATE_UPLOAD_URL../
+###########################################################################
+
+##### Preconditions
+To develop and build this Implementation Artifact you need Maven and Eclipse.
++ How to install maven is described at the end of this file
++ If you use an Eclipse workspace for the first time with a maven project you've to run this command before starting eclipse:
+ mvn -Declipse.workspace="<your_workspace_location>" eclipse:configure-workspace
+ - When using Windows: Make sure you replace '\' (backslashes) with '/' ('slashes')
+ - It doesn't hurt to run it multiple times
+ - This command must not be executed in a particular folder
+
+##### Preparations
++ Unzip the archive generated by Winery into a location of your choice.
++ Note: All following maven commands are executed on a shell in the root folder of the Implementation Artifact.
+
+##### Create eclipse project
+- Run: mvn eclipse:eclipse
+- Open Eclipse
+- 'File' -> 'Import' -> 'Existing Project into Workspace' -> click 'Next'
+- Click 'Browse' and select folder where you unzipped the generated Implementation Artifact
+- Select the project from the list and click 'Finish'
+
+##### Test your Implementation Artifact
+- Run: mvn clean package tomcat7:run-war
+ (more information: http://tomcat.apache.org/maven-plugin-trunk/tomcat7-maven-plugin/plugin-info.html)
+- Open this page to see the list of available services: http://localhost:9090/services/
+- This page also links the WSDL
+- With the WSDL your're able to test your IA using SOAPui or other tools.
+
+##### Upload your Implementation Artifact
+You have to options to do this:
+
+### 1) Automatically (to the Winery instance this IA project was generated with)
+- Run: mvn deploy
+- The WAR is directly uploaded into the correct ArtifactTemplate. Previous versions are overwritten.
+
+### 2) Manually
+- Run: mvn clean package
+- Locate the WAR file in the /target folder
+- Open Winery in your browser, locate the NodeType and then click through to the Implementation of the respective Interface, its Implementation Artifacts and lastly to the ArtifactTemplate representing this IA.
+- Upload the WAR file by clicking on the "Attach file..." button
+
+
+##### Install Maven
+- Download latest release of Maven: http://maven.apache.org/download.cgi (Binary zip)
+- Unzip into directory of your choice
+- Set environment variables (in system environment variables, not the ones for the user account):
+ + Check that the variables JAVA_HOME and JRE_HOME are set. If not create them and enter the path to your JDK, e.g., C:\Program Files (x86)\Java\jdk1.6.0_21
+ + Create the following environment variables
+ M2_HOME = C:\Path\where\your\maven\was\unzipped\to (no backslash at the end)
+ M2 = %M2_HOME%\bin
+ MAVEN_OPTS = -Xms256m -Xmx512m
+ + Append ;%M2% to the 'Path' environment variable. Make sure to separate the new entry with a semicolon (;) from the last one.
+- After that you have to open a new command line windows (if you already opened one) to let the changes take effect. \ No newline at end of file
diff --git a/winery/org.eclipse.winery.generators.ia/src/main/resources/template/project/pom.xml b/winery/org.eclipse.winery.generators.ia/src/main/resources/template/project/pom.xml
new file mode 100644
index 0000000..1a0b715
--- /dev/null
+++ b/winery/org.eclipse.winery.generators.ia/src/main/resources/template/project/pom.xml
@@ -0,0 +1,251 @@
+<?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/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>IA_PACKAGE</groupId>
+ <artifactId>IA_CLASS_NAME</artifactId>
+ <packaging>war</packaging>
+ <version>1.0-SNAPSHOT</version>
+ <name>Implementation Artifact IA_CLASS_NAME</name>
+
+ <repositories>
+ <repository>
+ <id>2471.de</id>
+ <url>http://2471.de/maven2</url>
+ </repository>
+ </repositories>
+
+ <properties>
+ <run.HttpPort>9090</run.HttpPort>
+ <winery.upload.url>IA_ARTIFACT_TEMPLATE_UPLOAD_URL</winery.upload.url>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <cxf.version>2.7.6</cxf.version>
+ <highlevelrestapi.version>0.1.6</highlevelrestapi.version>
+ </properties>
+
+ <dependencies>
+ <!-- LIBRARIES ADDED FOR IMPLEMENTATION ARTIFACT IMPLEMENTATION -->
+
+
+ <!-- END - LIBRARIES ADDED FOR IMPLEMENTATION ARTIFACT IMPLEMENTATION -->
+
+ <dependency>
+ <groupId>org.eclipse.winery</groupId>
+ <artifactId>org.eclipse.winery.highlevelrestapi</artifactId>
+ <version>${highlevelrestapi.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.5</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-web</artifactId>
+ <version>3.0.7.RELEASE</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context</artifactId>
+ <version>3.0.7.RELEASE</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-rt-frontend-jaxws</artifactId>
+ <version>${cxf.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-rt-frontend-simple</artifactId>
+ <version>${cxf.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-rt-transports-http</artifactId>
+ <version>${cxf.version}</version>
+ </dependency>
+ </dependencies>
+ <build>
+ <finalName>IA_CLASS_NAME</finalName>
+ <plugins>
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>3.0</version>
+ <configuration>
+ <source>1.6</source>
+ <target>1.6</target>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-eclipse-plugin</artifactId>
+ <version>2.9</version>
+ <configuration>
+ <downloadSources>false</downloadSources>
+ <downloadJavadocs>true</downloadJavadocs>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-java2ws-plugin</artifactId>
+ <version>${cxf.version}</version>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-rt-frontend-jaxws</artifactId>
+ <version>${cxf.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-rt-frontend-simple</artifactId>
+ <version>${cxf.version}</version>
+ </dependency>
+ </dependencies>
+ <executions>
+ <execution>
+ <id>process-classes</id>
+ <phase>process-classes</phase>
+ <configuration>
+ <className>IA_PACKAGE.IA_CLASS_NAME</className>
+ <outputFile>${basedir}/src/main/webapp/wsdl/IA_CLASS_NAME.wsdl</outputFile>
+ <genWsdl>true</genWsdl>
+ <verbose>true</verbose>
+ </configuration>
+ <goals>
+ <goal>java2ws</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-war-plugin</artifactId>
+ <version>2.3</version>
+ <configuration>
+ <webXml>src/main/webapp/WEB-INF/web.xml</webXml>
+ </configuration>
+ </plugin>
+
+ <!-- Inspired by: http://giallone.blogspot.de/2013/02/post-file-to-web-page-as-part-of-maven.html -->
+ <plugin>
+ <groupId>org.codehaus.gmaven</groupId>
+ <artifactId>gmaven-plugin</artifactId>
+ <version>1.4</version>
+ <dependencies>
+ <dependency>
+ <groupId>org.codehaus.gmaven.runtime</groupId>
+ <artifactId>gmaven-runtime-1.7</artifactId>
+ <version>1.2</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.httpcomponents</groupId>
+ <artifactId>httpmime</artifactId>
+ <version>4.2.1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.httpcomponents</groupId>
+ <artifactId>httpcore</artifactId>
+ <version>4.2.1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.httpcomponents</groupId>
+ <artifactId>httpclient</artifactId>
+ <version>4.2.1</version>
+ </dependency>
+ </dependencies>
+ <executions>
+ <execution>
+ <id>upload2winery</id>
+ <!-- In this mvn phase... -->
+ <phase>deploy</phase>
+ <!-- ...run the execute goal of this plugin -->
+ <goals>
+ <goal>execute</goal>
+ </goals>
+ <configuration>
+ <providerSelection>1.7</providerSelection>
+ <source>
+ import org.apache.http.impl.client.DefaultHttpClient
+ import org.apache.http.client.methods.HttpPost
+ import org.apache.http.entity.mime.MultipartEntity
+ import org.apache.http.entity.mime.content.FileBody
+
+ // Get WAR file
+ def name = "target/${project.build.finalName}.war"
+ println "Archive file: $name"
+ def f = new File(name)
+
+ // POST file
+ DefaultHttpClient httpclient = new DefaultHttpClient()
+ println "Upload URL: ${winery.upload.url}"
+ def post = new HttpPost("${winery.upload.url}")
+ def entity = new MultipartEntity()
+ def fileBody = new FileBody(f)
+ entity.addPart("files[]", fileBody)
+ post.setEntity(entity)
+
+ // Process response
+ def response = httpclient.execute(post)
+ def status = response.getStatusLine()
+ if( !(status ==~ /.*Created.*/) )
+ fail("IA upload to Winery FAILED, please upload manually. (HTTP status code: $status)" )
+ else
+ println "IA upload finished sucessfully (HTTP status code $status)"
+ </source>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+ </plugins>
+
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.tomcat.maven</groupId>
+ <artifactId>tomcat7-maven-plugin</artifactId>
+ <version>2.1</version>
+ <configuration>
+ <!-- http port -->
+ <port>${run.HttpPort}</port>
+ <!-- application path always starts with / -->
+ <path>/</path>
+ <!-- if you want to use test dependencies rather than only runtime -->
+ <useTestClasspath>false</useTestClasspath>
+ </configuration>
+ </plugin>
+
+ <!-- Disable default install phase, because we don't install into maven
+ repo but into Winery (during deploy phase). -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-install-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>default-install</id>
+ <phase>none</phase>
+ </execution>
+ </executions>
+ </plugin>
+
+ <!-- Disable default deploy phase, because we don't deploy into remote
+ maven repo but into remote Winery. -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-deploy-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>default-deploy</id>
+ <phase>none</phase>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+
+ </build>
+</project> \ No newline at end of file
diff --git a/winery/org.eclipse.winery.generators.ia/src/main/resources/template/project/src/main/webapp/WEB-INF/beans.xml b/winery/org.eclipse.winery.generators.ia/src/main/resources/template/project/src/main/webapp/WEB-INF/beans.xml
new file mode 100644
index 0000000..2a926f2
--- /dev/null
+++ b/winery/org.eclipse.winery.generators.ia/src/main/resources/template/project/src/main/webapp/WEB-INF/beans.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jaxws="http://cxf.apache.org/jaxws"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd">
+ <import resource="classpath:META-INF/cxf/cxf.xml" />
+ <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
+ <import resource="classpath:META-INF/cxf/cxf-servlet.xml" />
+ <jaxws:endpoint xmlns:tns="IA_NAMESPACE"
+ id="IA_CLASS_NAME" implementor="IA_PACKAGE.IA_CLASS_NAME"
+ wsdlLocation="wsdl/IA_CLASS_NAME.wsdl" endpointName="tns:IA_CLASS_NAMEPort"
+ serviceName="tns:IA_CLASS_NAMEService" address="/IA_CLASS_NAMEPort">
+ <jaxws:features>
+ <bean class="org.apache.cxf.feature.LoggingFeature" />
+ </jaxws:features>
+ </jaxws:endpoint>
+</beans>
diff --git a/winery/org.eclipse.winery.generators.ia/src/main/resources/template/project/src/main/webapp/WEB-INF/web.xml b/winery/org.eclipse.winery.generators.ia/src/main/resources/template/project/src/main/webapp/WEB-INF/web.xml
new file mode 100644
index 0000000..f7bd1bf
--- /dev/null
+++ b/winery/org.eclipse.winery.generators.ia/src/main/resources/template/project/src/main/webapp/WEB-INF/web.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0">
+ <display-name>IA_CLASS_NAME</display-name>
+ <welcome-file-list>
+ <welcome-file>index.html</welcome-file>
+ <welcome-file>index.htm</welcome-file>
+ <welcome-file>index.jsp</welcome-file>
+ <welcome-file>default.html</welcome-file>
+ <welcome-file>default.htm</welcome-file>
+ <welcome-file>default.jsp</welcome-file>
+ </welcome-file-list>
+ <servlet>
+ <description>Apache CXF Endpoint</description>
+ <display-name>cxf</display-name>
+ <servlet-name>cxf</servlet-name>
+ <servlet-class>org.apache.cxf.transport.servlet.CXFServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>cxf</servlet-name>
+ <url-pattern>/services/*</url-pattern>
+ </servlet-mapping>
+ <session-config>
+ <session-timeout>60</session-timeout>
+ </session-config>
+ <context-param>
+ <param-name>contextConfigLocation</param-name>
+ <param-value>WEB-INF/beans.xml</param-value>
+ </context-param>
+ <listener>
+ <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
+ </listener>
+</web-app>
diff --git a/winery/org.eclipse.winery.generators.ia/src/test/java/META-INF/MANIFEST.MF b/winery/org.eclipse.winery.generators.ia/src/test/java/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..254272e
--- /dev/null
+++ b/winery/org.eclipse.winery.generators.ia/src/test/java/META-INF/MANIFEST.MF
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Class-Path:
+
diff --git a/winery/org.eclipse.winery.generators.ia/src/test/java/org/eclipse/winery/generators/ia/Test.java b/winery/org.eclipse.winery.generators.ia/src/test/java/org/eclipse/winery/generators/ia/Test.java
new file mode 100644
index 0000000..73d4127
--- /dev/null
+++ b/winery/org.eclipse.winery.generators.ia/src/test/java/org/eclipse/winery/generators/ia/Test.java
@@ -0,0 +1,148 @@
+/*******************************************************************************
+ * Copyright (c) 2013 University of Stuttgart.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * and the Apache License 2.0 which both accompany this distribution,
+ * and are available at http://www.eclipse.org/legal/epl-v10.html
+ * and http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Contributors:
+ * Tobias Binz - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.winery.generators.ia;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.nio.file.Files;
+import java.nio.file.Path;
+
+import org.eclipse.winery.model.tosca.ObjectFactory;
+import org.eclipse.winery.model.tosca.TInterface;
+import org.eclipse.winery.model.tosca.TNodeType;
+import org.eclipse.winery.model.tosca.TOperation;
+import org.eclipse.winery.model.tosca.TOperation.InputParameters;
+import org.eclipse.winery.model.tosca.TOperation.OutputParameters;
+import org.eclipse.winery.model.tosca.TParameter;
+import org.junit.BeforeClass;
+
+public class Test {
+
+ private static Path WORKING_DIR;
+
+
+ @BeforeClass
+ public static void initializeWorkingDir() throws IOException {
+ Test.WORKING_DIR = Files.createTempDirectory("IAGenerator");
+ }
+
+ @org.junit.Test
+ public void testInOut() throws MalformedURLException {
+ ObjectFactory f = new ObjectFactory();
+
+ TInterface tinterface = f.createTInterface();
+ tinterface.setName("http://www.example.org/interfaces/lifecycle");
+
+ TOperation op1 = f.createTOperation();
+ op1.setName("Op1InOut");
+ tinterface.getOperation().add(op1);
+ InputParameters op1InputParameters = f.createTOperationInputParameters();
+
+ TParameter op1ip1 = f.createTParameter();
+ op1ip1.setName("op1ip1");
+ op1ip1.setType("xs:string");
+ op1InputParameters.getInputParameter().add(op1ip1);
+ TParameter op1ip2 = f.createTParameter();
+ op1ip2.setName("op1ip2");
+ op1ip2.setType("xs:string");
+ op1InputParameters.getInputParameter().add(op1ip2);
+ op1.setInputParameters(op1InputParameters);
+
+ OutputParameters op1OutputParameters = f.createTOperationOutputParameters();
+ TParameter op1op1 = f.createTParameter();
+ op1op1.setName("op1op1");
+ op1op1.setType("xs:string");
+ op1OutputParameters.getOutputParameter().add(op1op1);
+ TParameter op1op2 = f.createTParameter();
+ op1op2.setName("op1op2");
+ op1op1.setType("xs:string");
+ op1OutputParameters.getOutputParameter().add(op1op2);
+ op1.setOutputParameters(op1OutputParameters);
+
+ TNodeType nodeType = f.createTNodeType();
+ nodeType.setName("test");
+ nodeType.setTargetNamespace("http://asd.com");
+
+ Generator gen = new Generator(tinterface, "org.opentosca.ia", new URL("http://asd.com"), "testname", Test.WORKING_DIR.toFile());
+ File generateProject = gen.generateProject();
+ System.out.println(generateProject);
+ }
+
+ @org.junit.Test
+ public void testMultipleOperationsInOrOut() throws MalformedURLException {
+ ObjectFactory f = new ObjectFactory();
+
+ TInterface tinterface = f.createTInterface();
+ tinterface.setName("TestInOrOut");
+
+ TOperation opIn = f.createTOperation();
+ opIn.setName("OpIn");
+ tinterface.getOperation().add(opIn);
+
+ InputParameters op1InputParameters = f.createTOperationInputParameters();
+ TParameter op1ip1 = f.createTParameter();
+ op1ip1.setName("op1ip1");
+ op1ip1.setType("xs:string");
+ op1InputParameters.getInputParameter().add(op1ip1);
+ TParameter op1ip2 = f.createTParameter();
+ op1ip2.setName("op1ip2");
+ op1ip2.setType("xs:string");
+ op1InputParameters.getInputParameter().add(op1ip2);
+ opIn.setInputParameters(op1InputParameters);
+
+ TOperation opOut = f.createTOperation();
+ opOut.setName("OpOut");
+ tinterface.getOperation().add(opOut);
+
+ OutputParameters op1OutputParameters = f.createTOperationOutputParameters();
+ TParameter op1op1 = f.createTParameter();
+ op1op1.setName("op1op1");
+ op1op1.setType("xs:string");
+ op1OutputParameters.getOutputParameter().add(op1op1);
+ TParameter op1op2 = f.createTParameter();
+ op1op2.setName("op1op2");
+ op1op1.setType("xs:string");
+ op1OutputParameters.getOutputParameter().add(op1op2);
+ opOut.setOutputParameters(op1OutputParameters);
+
+ TNodeType nodeType = f.createTNodeType();
+ nodeType.setName("test");
+ nodeType.setTargetNamespace("http://asd.com");
+
+ Generator gen = new Generator(tinterface, "org.opentosca.ia", new URL("http://asd.com"), "testname", Test.WORKING_DIR.toFile());
+ File generateProject = gen.generateProject();
+ System.out.println(generateProject);
+ }
+
+ @org.junit.Test
+ public void testNoParams() throws MalformedURLException {
+ ObjectFactory f = new ObjectFactory();
+
+ TInterface tinterface = f.createTInterface();
+ tinterface.setName("TestNoParams");
+
+ TOperation opIn = f.createTOperation();
+ opIn.setName("OpNoParams");
+ tinterface.getOperation().add(opIn);
+
+ TNodeType nodeType = f.createTNodeType();
+ nodeType.setName("test");
+ nodeType.setTargetNamespace("http://asd.com");
+
+ Generator gen = new Generator(tinterface, "org.opentosca.ia", new URL("http://asd.com"), "testname", Test.WORKING_DIR.toFile());
+ File generateProject = gen.generateProject();
+ System.out.println(generateProject);
+ }
+
+}