ParameterCatalogs.html 126 KB
Newer Older
2001
</div>
Kai-Holger Brassel's avatar
Kai-Holger Brassel committed
2002
2003
<div class="sect2">
<h3 id="truesummary"><a class="anchor" href="#truesummary"></a>Summary</h3>
2004
<div class="paragraph">
Kai-Holger Brassel's avatar
Kai-Holger Brassel committed
2005
<p>Congratulations on making it this far. What have we achieved?</p>
2006
2007
</div>
<div class="paragraph">
Kai-Holger Brassel's avatar
Kai-Holger Brassel committed
2008
2009
2010
2011
<p>We get to know the <em>Eclipse Modeling Tools</em> IDE and created a graphical Ecore data model with one catalog class and five classes/types of domain objects therein.
Classes have been defined by name, attributes, and relationships between them, often with cardinalities.
Whenever classes shared some attributes or relationships we factored these out into super classes.
An enumeration introduced a new attribute type as a set of named values.</p>
2012
</div>
Kai-Holger Brassel's avatar
Kai-Holger Brassel committed
2013
2014
2015
2016
2017
<div class="paragraph">
<p>From this data model, we issued commands to create Java code for representing the data in memory as well as to store and retrieve them on and from disk. Methods to create, read, update and delete data objects (CRUD) were generated, too.</p>
</div>
<div class="paragraph">
<p>We reflected on a good user interface for this data and used <em>EMF Forms</em> to model such an interface resulting in a full functional prototype.</p>
2018
</div>
Kai-Holger Brassel's avatar
Kai-Holger Brassel committed
2019
2020
2021
2022
<div class="paragraph">
<p>Lastly, we enhanced Eclipse, Ecore and <em>EMF Forms</em> with two plug-ins for modeling, editing and persisting physical quantities as numerical values with defined units.</p>
</div>
<div style="page-break-after: always;"></div>
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
</div>
</div>
</div>
<div class="sect1">
<h2 id="trueaccessing-and-using-parameter-catalogs"><a class="anchor" href="#trueaccessing-and-using-parameter-catalogs"></a>Accessing and Using Parameter Catalogs</h2>
<div class="sectionbody">
<div class="sect2">
<h3 id="trueaccessing-xml-catalogs"><a class="anchor" href="#trueaccessing-xml-catalogs"></a>Accessing XML-Catalogs</h3>
<div class="paragraph">
<div class="title">Add Ecore data model to a third-party Java application</div>
<p><strong>TBD</strong></p>
</div>
<div class="literalblock">
<div class="content">
<pre>import java.util.Collection;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
import org.eclipse.emf.ecore.util.EcoreUtil;
import de.hftstuttgart.energycomponents.EnCompPackage;
import de.hftstuttgart.energycomponents.HeatPump;</pre>
</div>
</div>
<div class="literalblock">
<div class="content">
<pre>ResourceSet resSet = new ResourceSetImpl();
Resource resource = resSet.getResource(URI.createURI("catalog.xml"), true);
Collection&lt;HeatPump&gt; allHeatPumps = EcoreUtil.getObjectsByType(
		resource.getContents(), EnCompPackage.eINSTANCE.getHeatPump());</pre>
</div>
</div>
<div class="paragraph">
<p>catalog.xml muss durch den richtigen Pfad zum XML-Katalog ersetzt werden.</p>
</div>
<div class="paragraph">
<div class="title">Load XML Data Catalog and Access Corresponding Java Objects in Code</div>
<p><strong>TBD</strong></p>
</div>
<div class="paragraph">
<div class="title">Access from Python?</div>
<p><strong>TBD</strong></p>
</div>
</div>
<div class="sect2">
<h3 id="truecreate-insel-models-with-handlebars-templates"><a class="anchor" href="#truecreate-insel-models-with-handlebars-templates"></a>Create Insel Models with Handlebars Templates</h3>
<div class="paragraph">
<p>Handlebar templates to access data catalogs and create/parameterize textual simulation models.</p>
</div>
<div class="paragraph">
<div class="title">Parameterization of blocks</div>
<p><strong>TBD</strong></p>
</div>
<div class="paragraph">
<div class="title">Creation of submodels, e.g. computing parameterized functions</div>
<p><strong>TBD</strong></p>
</div>
<div style="page-break-after: always;"></div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="truebuild-parameter-catalog-applications-with-eclipse-tycho"><a class="anchor" href="#truebuild-parameter-catalog-applications-with-eclipse-tycho"></a>Build (Parameter Catalog) Applications with Eclipse Tycho</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Three plugins so for for the content and UI.</p>
</div>
<div class="paragraph">
<p>Missing: Deployable application and inclusion to third party libraries.</p>
</div>
<div class="paragraph">
<p>Building an application "around" the three plugins for Ecore data model and UI specification model.</p>
</div>
<div class="paragraph">
<p>See template.</p>
</div>
<div class="sect2">
<h3 id="truecreate-an-eclipse-application"><a class="anchor" href="#truecreate-an-eclipse-application"></a>Create an Eclipse Application</h3>
<div class="paragraph">
<p><strong>TBD</strong></p>
</div>
</div>
<div class="sect2">
<h3 id="trueuse-maven-and-tycho-as-build-system"><a class="anchor" href="#trueuse-maven-and-tycho-as-build-system"></a>Use Maven and Tycho as Build System</h3>
<div class="paragraph">
<div class="title">Install Maven Support</div>
<p>We are going to create a complete Eclipse desktop application from generated code.
We also want to deploy this application for Linux, macOS and Windows operating systems.
Eclipse offers several approaches for compiling and deploying such an application, traditionally with <em>Ant</em> scripts.</p>
</div>
<div class="paragraph">
<p>Creation and maintenance of these scripts turned out to be tedious and error prone.
For quite some years now, the proposed&#8201;&#8212;&#8201;and mostly supported&#8201;&#8212;&#8201;method for building Eclipse applications is to use <em>Maven</em> build system, more specifically, a couple of Maven plug-ins, subsumed under the name <em>Tycho</em>.</p>
</div>
<div class="paragraph">
<p>Many Eclipse platforms have Maven support <a href="https://www.eclipse.org/m2e/"><em>M2Eclipse</em></a> already built in, not so our <em>Eclipse Modeling Tools</em>.
But don&#8217;t worry: Installation of required Eclipse feature is easy and straight forward.
And, by the way, you will acquire the indispensable skill of how to install new plug-ins/features to Eclipse.</p>
</div>
<div class="paragraph">
<p>First, tell your Eclipse installation where to look for the new software.
Execute <code>Help &#8594; Install new Software&#8230;&#8203;</code> to invoke dialog <em>Available Software</em> and press <code>Add&#8230;&#8203;</code>.
Sub-dialog <code>Add Repository</code> pops up.</p>
</div>
<div class="imageblock thumb">
<div class="content">
<img src="ParameterCatalogs2Images/InstallMaven1.gif" alt="InstallMaven1">
</div>
Kai-Holger Brassel's avatar
Kai-Holger Brassel committed
2131
<div class="title">Figure 24. Add update site m2e</div>
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
</div>
<div class="paragraph">
<p>In there provide <code>m2e</code> as name and</p>
</div>
<div class="literalblock">
<div class="content">
<pre>http://download.eclipse.org/technology/m2e/releases</pre>
</div>
</div>
<div class="paragraph">
<p>as location.
Kai-Holger Brassel's avatar
Kai-Holger Brassel committed
2143
After confirmation with <code>Add</code>, choose the new site to <code>Work with:</code> Eclipse now looks up the site for available software.</p>
2144
2145
2146
2147
2148
</div>
<div class="imageblock thumb">
<div class="content">
<img src="ParameterCatalogs2Images/InstallMaven2.gif" alt="InstallMaven2">
</div>
Kai-Holger Brassel's avatar
Kai-Holger Brassel committed
2149
<div class="title">Figure 25. Choose features to install</div>
2150
2151
</div>
<div class="paragraph">
Kai-Holger Brassel's avatar
Kai-Holger Brassel committed
2152
<p>Provided <code>Group items by category</code> is checked, above features are displayed. Check all features and confirm all following questions about licenses and security concerns.
2153
2154
2155
2156
2157
2158
2159
After download is complete&#8201;&#8212;&#8201;it can take a few minutes&#8201;&#8212;&#8201;restart Eclipse.
Verify that Maven version 3.6.3 or above is now installed in <code>Window &#8594; Preferences&#8230;&#8203;</code> (or <code>Eclipse &#8594; Preferences&#8230;&#8203;</code> on macOS) under <code>Maven &#8594; Installations</code>.</p>
</div>
<div class="imageblock thumb">
<div class="content">
<img src="ParameterCatalogs2Images/InstallMaven3.gif" alt="InstallMaven3" width="400">
</div>
Kai-Holger Brassel's avatar
Kai-Holger Brassel committed
2160
<div class="title">Figure 26. Check Maven installation</div>
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
</div>
<div class="paragraph">
<div class="title">"Mavenize" projects</div>
<p><strong>TBD</strong></p>
</div>
<div class="paragraph">
<div class="title">Build and Deploy with Tycho</div>
<p><strong>TBD</strong></p>
</div>
<div class="paragraph">
<div class="title">Add third party Java libraries</div>
<p><strong>TBD</strong></p>
</div>
<div class="paragraph">
<p>"Correct" way to add third party Java libraries as plugins</p>
</div>
<div class="paragraph">
<p>Example Indriya</p>
</div>
</div>
<div class="sect2">
<h3 id="truedeploy-to-p2-repository"><a class="anchor" href="#truedeploy-to-p2-repository"></a>Deploy to P2 Repository</h3>
<div class="paragraph">
<p><strong>TBD</strong></p>
</div>
</div>
<div class="sect2">
<h3 id="trueversioning-and-collaboration"><a class="anchor" href="#trueversioning-and-collaboration"></a>Versioning and Collaboration</h3>
<div class="paragraph">
<p><strong>TBD</strong></p>
</div>
</div>
</div>
</div>
</div>
<div id="footnotes">
<hr>
<div class="footnote" id="_footnotedef_1">
<a href="#_footnoteref_1">1</a>. A similar approach is in use to standardize extensions to CityGML via so called application domain extensions (ADE) like the energy ADE for exchanging energy related data.
</div>
<div class="footnote" id="_footnotedef_2">
<a href="#_footnoteref_2">2</a>. A comparable, but completely different approach would be to combine several web applications and services via portal software in web browsers.
</div>
<div class="footnote" id="_footnotedef_3">
<a href="#_footnoteref_3">3</a>. The notion of an Eclipse package has nothing to do with Java packages.
</div>
<div class="footnote" id="_footnotedef_4">
<a href="#_footnoteref_4">4</a>. Projects possess one or more <em>natures</em> used to define a project&#8217;s principal type.
</div>
<div class="footnote" id="_footnotedef_5">
<a href="#_footnoteref_5">5</a>. Or even work on the same workspace provided in the cloud, see <a href="https://www.eclipse.org/che/technology/">Eclipse Che</a>.
</div>
<div class="footnote" id="_footnotedef_6">
<a href="#_footnoteref_6">6</a>. AdoptOpenJDK recently joined the Eclipse foundation and soon will change its name to <em>Adoptium</em> for legal reasons.
</div>
<div class="footnote" id="_footnotedef_7">
Kai-Holger Brassel's avatar
Kai-Holger Brassel committed
2217
<a href="#_footnoteref_7">7</a>. <a href="https://en.wikipedia.org/wiki/Reverse_domain_name_notation" class="bare">https://en.wikipedia.org/wiki/Reverse_domain_name_notation</a>
2218
</div>
2219
<div class="footnote" id="_footnotedef_8">
Kai-Holger Brassel's avatar
Kai-Holger Brassel committed
2220
<a href="#_footnoteref_8">8</a>. <a href="https://wiki.eclipse.org/Naming_Conventions#Eclipse_Workspace_Projects" class="bare">https://wiki.eclipse.org/Naming_Conventions#Eclipse_Workspace_Projects</a>
2221
</div>
2222
2223
2224
</div>
<div id="footer">
<div id="footer-text">
Kai-Holger Brassel's avatar
Kai-Holger Brassel committed
2225
Last updated 2021-04-18 11:27:10 +0200
2226
2227
2228
2229
2230
2231
2232
</div>
</div>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.15.6/styles/github.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.15.6/highlight.min.js"></script>
<script>hljs.initHighlighting()</script>
</body>
</html>
For faster browsing, not all history is shown. View entire blame