Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Basic Model with Building and TechnicalAsset #1

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions de.jena.mdo.model.exmple.asset/.classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-16">
<attributes>
<attribute name="module" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="aQute.bnd.classpath.container"/>
<classpathentry kind="src" output="bin" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>
23 changes: 23 additions & 0 deletions de.jena.mdo.model.exmple.asset/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>de.jena.mdo.model.exmple.asset</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>bndtools.core.bndbuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>bndtools.core.bndnature</nature>
</natures>
</projectDescription>
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
eclipse.preferences.version=1
encoding//.settings/org.eclipse.core.resources.prefs=UTF-8
encoding//.settings/org.eclipse.jdt.core.prefs=UTF-8
encoding//.settings/org.eclipse.jdt.ui.prefs=UTF-8
encoding//model/asset.ecore=UTF-8
encoding//model/asset.genmodel=UTF-8
encoding//src/test/component/Example.java=UTF-8
encoding//test/test/component/ExampleTest.java=UTF-8
encoding/bnd.bnd=UTF-8
encoding/launch.bndrun=UTF-8
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=16
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=16
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=16
10 changes: 10 additions & 0 deletions de.jena.mdo.model.exmple.asset/.settings/org.eclipse.jdt.ui.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
content_assist_proposals_background=255,255,255
content_assist_proposals_foreground=0,0,0
eclipse.preferences.version=1
org.eclipse.jdt.ui.formatterprofiles.version=13
org.eclipse.jdt.ui.javadoc=true
org.eclipse.jdt.ui.text.code_templates_migrated=true
org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?><templates><template autoinsert\="false" context\="gettercomment_context" deleted\="false" description\="Comment for getter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.gettercomment" name\="gettercomment">/**\r\n * Returns the ${bare_field_name}.\r\n * @return the ${bare_field_name}\r\n */</template><template autoinsert\="false" context\="settercomment_context" deleted\="false" description\="Comment for setter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.settercomment" name\="settercomment">/**\r\n * Sets the ${bare_field_name}.\r\n * @param ${param} the ${bare_field_name} to set\r\n */</template><template autoinsert\="false" context\="constructorcomment_context" deleted\="false" description\="Comment for created constructors" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment">/**\r\n * Creates a new instance.\r\n * ${tags}\r\n */</template><template autoinsert\="false" context\="filecomment_context" deleted\="false" description\="Comment for created Java files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.filecomment" name\="filecomment">/**\r\n * Copyright (c) 2012 - ${year} Data In Motion and others.\r\n * All rights reserved. \r\n * \r\n * This program and the accompanying materials are made available under the terms of the \r\n * Eclipse Public License v1.0 which accompanies this distribution, and is available at\r\n * http\://www.eclipse.org/legal/epl-v10.html\r\n * \r\n * Contributors\:\r\n * Data In Motion - initial API and implementation\r\n */</template><template autoinsert\="false" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\r\n * ${tags}\r\n * @author ${user}\r\n * @since ${date}\r\n */</template><template autoinsert\="false" context\="fieldcomment_context" deleted\="false" description\="Comment for fields" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment">/** ${field} */</template><template autoinsert\="false" context\="overridecomment_context" deleted\="false" description\="Comment for overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.overridecomment" name\="overridecomment">/* \r\n * (non-Javadoc)\r\n * ${see_to_overridden}\r\n */</template><template autoinsert\="true" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodcomment" name\="methodcomment">/**\r\n * ${tags}\r\n */</template><template autoinsert\="true" context\="delegatecomment_context" deleted\="false" description\="Comment for delegate methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.delegatecomment" name\="delegatecomment">/**\r\n * ${tags}\r\n * ${see_to_target}\r\n */</template><template autoinsert\="true" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.newtype" name\="newtype">${filecomment}\r\n${package_declaration}\r\n\r\n${typecomment}\r\n${type_declaration}</template><template autoinsert\="true" context\="classbody_context" deleted\="false" description\="Code in new class type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.classbody" name\="classbody">\r\n</template><template autoinsert\="true" context\="interfacebody_context" deleted\="false" description\="Code in new interface type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.interfacebody" name\="interfacebody">\r\n</template><template autoinsert\="true" context\="enumbody_context" deleted\="false" description\="Code in new enum type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.enumbody" name\="enumbody">\r\n</template><template autoinsert\="true" context\="annotationbody_context" deleted\="false" description\="Code in new annotation type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.annotationbody" name\="annotationbody">\r\n</template><template autoinsert\="true" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.catchblock" name\="catchblock">// ${todo} Auto-generated catch block\r\n${exception_var}.printStackTrace();</template><template autoinsert\="true" context\="methodbody_context" deleted\="false" description\="Code in created method stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodbody" name\="methodbody">// ${todo} Auto-generated method stub\r\n${body_statement}</template><template autoinsert\="true" context\="constructorbody_context" deleted\="false" description\="Code in created constructor stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorbody" name\="constructorbody">${body_statement}\r\n// ${todo} Auto-generated constructor stub</template><template autoinsert\="true" context\="getterbody_context" deleted\="false" description\="Code in created getters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><template autoinsert\="true" context\="setterbody_context" deleted\="false" description\="Code in created setters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.setterbody" name\="setterbody">${field} \= ${param};</template></templates>
spelling_locale_initialized=true
useAnnotationsPrefPage=true
useQuickDiffPrefPage=true
20 changes: 20 additions & 0 deletions de.jena.mdo.model.exmple.asset/bnd.bnd
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# sets the usually required buildpath using the bnd library, you can extend it with the normal -buildpath to your liking
-library: enable-emf

# The code generation takes a bit of time and makes the build a bit slower.
# It might be a good idea to put comments around it, when you don't need it
#-generate:\
# model/asset.genmodel;\
# generate=geckoEMF;\
# genmodel=model/asset.genmodel;\
# output=src
# Add this attribute to find some logging information
# logfile=test.log;\

# If this is not done with a instruction namespace, bnd would think you like
# to take full control over whats exported and imported and will ignore @Export
# Bundle Annotations
-includeresource.model: model=model

Bundle-Version: 1.0.0.SNAPSHOT

50 changes: 50 additions & 0 deletions de.jena.mdo.model.exmple.asset/model/asset.ecore
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<?xml version="1.0" encoding="UTF-8"?>
<ecore:EPackage xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="asset" nsURI="http://udp.jena.de/asset/1.0" nsPrefix="asset">
<eClassifiers xsi:type="ecore:EClass" name="Building" eSuperTypes="#//Asset #//Adressable #//PhysicalAsset #//TechnicalAsset">
<eStructuralFeatures xsi:type="ecore:EReference" name="buildingMetaData" lowerBound="1"
eType="#//BuildingMetaData" containment="true"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Adress">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="street" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="zip" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="district" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="country" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="streetNumber" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="streetNumberExt" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Identifyer">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="uuid" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="leadingDataSource" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="leadingDataSourceId" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Asset" abstract="true" interface="true">
<eStructuralFeatures xsi:type="ecore:EReference" name="id" lowerBound="1" eType="#//Identifyer"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="title" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Adressable" abstract="true" interface="true">
<eStructuralFeatures xsi:type="ecore:EReference" name="adress" eType="#//Adress"
containment="true"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="TechnicalAsset" eSuperTypes="#//Asset #//PhysicalAsset">
<eStructuralFeatures xsi:type="ecore:EReference" name="technicalAssetMetaData"
eType="#//TechnicalAssetMetaData"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="BuildingMetaData">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="monumentConservation" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="barrierFree" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="GeoLocation">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="geometry" eType="#//Geometry"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="moveable" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="date" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EDate"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EDataType" name="Geometry" instanceClassName="java.lang.String"/>
<eClassifiers xsi:type="ecore:EClass" name="PhysicalAsset" abstract="true" interface="true"
eSuperTypes="#//Asset">
<eStructuralFeatures xsi:type="ecore:EReference" name="geoLocation" eType="#//GeoLocation"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="TechnicalAssetMetaData">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="serialNumber" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
</eClassifiers>
</ecore:EPackage>
52 changes: 52 additions & 0 deletions de.jena.mdo.model.exmple.asset/model/asset.genmodel
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<?xml version="1.0" encoding="UTF-8"?>
<genmodel:GenModel xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" modelDirectory="/de.jena.mdo.model.exmple.asset/src" modelPluginID="de.jena.mdo.model.exmple.asset"
modelName="asset" rootExtendsClass="org.eclipse.emf.ecore.impl.MinimalEObjectImpl$Container"
importerID="org.eclipse.emf.importer.ecore" complianceLevel="8.0" suppressGenModelAnnotations="false"
copyrightFields="false" operationReflection="true" importOrganizing="true" oSGiCompatible="true">
<foreignModel>asset.ecore</foreignModel>
<genPackages prefix="Asset" basePackage="de.jena.mdo.model.exmple.asset" resource="XMI"
disposableProviderFactory="true" ecorePackage="asset.ecore#/">
<genDataTypes ecoreDataType="asset.ecore#//Geometry"/>
<genClasses ecoreClass="asset.ecore#//Building">
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference asset.ecore#//Building/buildingMetaData"/>
</genClasses>
<genClasses ecoreClass="asset.ecore#//Adress">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute asset.ecore#//Adress/street"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute asset.ecore#//Adress/zip"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute asset.ecore#//Adress/district"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute asset.ecore#//Adress/country"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute asset.ecore#//Adress/streetNumber"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute asset.ecore#//Adress/streetNumberExt"/>
</genClasses>
<genClasses ecoreClass="asset.ecore#//Identifyer">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute asset.ecore#//Identifyer/uuid"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute asset.ecore#//Identifyer/leadingDataSource"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute asset.ecore#//Identifyer/leadingDataSourceId"/>
</genClasses>
<genClasses image="false" ecoreClass="asset.ecore#//Asset">
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference asset.ecore#//Asset/id"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute asset.ecore#//Asset/title"/>
</genClasses>
<genClasses image="false" ecoreClass="asset.ecore#//Adressable">
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference asset.ecore#//Adressable/adress"/>
</genClasses>
<genClasses ecoreClass="asset.ecore#//TechnicalAsset">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute asset.ecore#//TechnicalAsset/serialNumber"/>
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference asset.ecore#//TechnicalAsset/technicalAssetMetaData"/>
</genClasses>
<genClasses ecoreClass="asset.ecore#//BuildingMetaData">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute asset.ecore#//BuildingMetaData/monumentConservation"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute asset.ecore#//BuildingMetaData/barrierFree"/>
</genClasses>
<genClasses ecoreClass="asset.ecore#//GeoLocation">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute asset.ecore#//GeoLocation/geometry"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute asset.ecore#//GeoLocation/moveable"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute asset.ecore#//GeoLocation/date"/>
</genClasses>
<genClasses image="false" ecoreClass="asset.ecore#//PhysicalAsset">
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference asset.ecore#//PhysicalAsset/geoLocation"/>
</genClasses>
<genClasses ecoreClass="asset.ecore#//TechnicalAssetMetaData"/>
</genPackages>
</genmodel:GenModel>
8 changes: 2 additions & 6 deletions de.jena.mdo.model.registration/.classpath
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11">
<attributes>
<attribute name="module" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="aQute.bnd.classpath.container"/>
<classpathentry kind="src" output="bin" path="src"/>
<classpathentry kind="src" output="bin_test" path="test">
<attributes>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11"/>
<classpathentry kind="src" output="bin" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>