From 185a81621da4a20d72ff6fe927ffa4be675f16e0 Mon Sep 17 00:00:00 2001
From: Chrissi <christopher@hbsc-werner.de>
Date: Wed, 16 Oct 2019 13:18:48 +0200
Subject: [PATCH] =?UTF-8?q?modeljoin=20ecore=20angepasst=20und=20kleine=20?=
 =?UTF-8?q?=C3=A4nderungen=20die=20nur=20die=20ausgabe=20beeinflussen?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 assets/models/ModelJoinLibrary.ecore                 | 12 +++++-------
 .../model_sync/generator/PackageNames.scala          |  2 +-
 .../generator/conversion/EmfTypeTranslator.scala     |  4 ++--
 .../model_sync/generator/test/ApplicationTest.scala  |  4 ++--
 4 files changed, 10 insertions(+), 12 deletions(-)

diff --git a/assets/models/ModelJoinLibrary.ecore b/assets/models/ModelJoinLibrary.ecore
index 68671c4..d61f671 100644
--- a/assets/models/ModelJoinLibrary.ecore
+++ b/assets/models/ModelJoinLibrary.ecore
@@ -1,12 +1,12 @@
 <?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="EclipseLibrary" nsURI="http://www.example.org/eclipselibrary"
+    xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="eclipselibrary" nsURI="http://www.example.org/eclipselibrary"
     nsPrefix="elib">
-  <eClassifiers xsi:type="ecore:EClass" name="Item">
+  <eClassifiers xsi:type="ecore:EClass" name="Item" abstract="true">
     <eStructuralFeatures xsi:type="ecore:EAttribute" name="publicationDate" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EDate"/>
+    <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="Periodical" eSuperTypes="#//Item">
-    <eStructuralFeatures xsi:type="ecore:EAttribute" name="title" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
     <eStructuralFeatures xsi:type="ecore:EAttribute" name="issuesPerYear" lowerBound="1"
         eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
   </eClassifiers>
@@ -15,16 +15,14 @@
     <eLiterals name="ScienceFiction" value="1"/>
     <eLiterals name="Biography" value="2"/>
   </eClassifiers>
-  <eClassifiers xsi:type="ecore:EClass" name="CirculatingItem" eSuperTypes="#//Item"/>
+  <eClassifiers xsi:type="ecore:EClass" name="CirculatingItem" abstract="true" eSuperTypes="#//Item"/>
   <eClassifiers xsi:type="ecore:EClass" name="Book" eSuperTypes="#//CirculatingItem">
-    <eStructuralFeatures xsi:type="ecore:EAttribute" name="title" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
     <eStructuralFeatures xsi:type="ecore:EAttribute" name="pages" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
     <eStructuralFeatures xsi:type="ecore:EAttribute" name="category" eType="#//BookCategory"/>
     <eStructuralFeatures xsi:type="ecore:EReference" name="author" lowerBound="1"
         eType="#//Writer" eOpposite="#//Writer/books"/>
   </eClassifiers>
-  <eClassifiers xsi:type="ecore:EClass" name="AudioVisualItem" eSuperTypes="#//CirculatingItem">
-    <eStructuralFeatures xsi:type="ecore:EAttribute" name="title" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+  <eClassifiers xsi:type="ecore:EClass" name="AudioVisualItem" abstract="true" eSuperTypes="#//CirculatingItem">
     <eStructuralFeatures xsi:type="ecore:EAttribute" name="minutesLength" lowerBound="1"
         eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
     <eStructuralFeatures xsi:type="ecore:EAttribute" name="damaged" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/>
diff --git a/src/main/scala/org/rosi_project/model_sync/generator/PackageNames.scala b/src/main/scala/org/rosi_project/model_sync/generator/PackageNames.scala
index 96b9467..d16632e 100644
--- a/src/main/scala/org/rosi_project/model_sync/generator/PackageNames.scala
+++ b/src/main/scala/org/rosi_project/model_sync/generator/PackageNames.scala
@@ -4,7 +4,7 @@ object PackageNames {
   
   val multiInhertitanceWithTraits = false
   
-  val sourcePkgPrefix: String = "sum."
+  val sourcePkgPrefix: String = "" //sync. , sum.
   
   val viewPkgName: String = "view"
   val viewPostName: String = "View"
diff --git a/src/main/scala/org/rosi_project/model_sync/generator/conversion/EmfTypeTranslator.scala b/src/main/scala/org/rosi_project/model_sync/generator/conversion/EmfTypeTranslator.scala
index ec1ea7f..0fb4d44 100644
--- a/src/main/scala/org/rosi_project/model_sync/generator/conversion/EmfTypeTranslator.scala
+++ b/src/main/scala/org/rosi_project/model_sync/generator/conversion/EmfTypeTranslator.scala
@@ -15,7 +15,7 @@ import org.rosi_project.model_sync.generator.acr_model.types.PredefEcoreTypes
 object EmfTypeTranslator {
 
   private val typeMap: Map[String, SType] = Map(
-    "Double" -> PredefTypes.Double,
+    "Double" -> PredefTypes.Double, //map normal data types to its normal data types
     "Float" -> PredefTypes.Float,
     "Int" -> PredefTypes.Integer,
     "Char" -> PredefTypes.Char,
@@ -24,7 +24,7 @@ object EmfTypeTranslator {
     "Long" -> PredefTypes.Long,
     "Short" -> PredefTypes.Short,
     "String" -> PredefTypes.String,      
-    "EBoolean" -> PredefTypes.Boolean,
+    "EBoolean" -> PredefTypes.Boolean, //map EMF data types to its normal data types
     "EByte" -> PredefTypes.Byte,
     "EChar" -> PredefTypes.Char,
     "EDate" -> PredefTypes.Date,
diff --git a/src/main/scala/org/rosi_project/model_sync/generator/test/ApplicationTest.scala b/src/main/scala/org/rosi_project/model_sync/generator/test/ApplicationTest.scala
index a371980..783f243 100644
--- a/src/main/scala/org/rosi_project/model_sync/generator/test/ApplicationTest.scala
+++ b/src/main/scala/org/rosi_project/model_sync/generator/test/ApplicationTest.scala
@@ -8,12 +8,12 @@ import org.rosi_project.model_sync.generator.Creation
 object ApplicationTest extends App {
       
   //runTestLibrary(Creation.rolesum)
-  //runCombinedTest(Creation.rolecomb)
+  runCombinedTest(Creation.rolecomb)
   //runShrinkingModel(Creation.rolesum)
   //runTestAML(Creation.rolesum)
   
   //TTC Case examples
-  runTestEmfLibrary(Creation.rolecomb)
+  //runTestEmfLibrary(Creation.rolecomb)
   //runTTC2019(Creation.rolecomb)
   //runTTC2019(Creation.rolesync)  
   //runTTCLive2019(Creation.rolesync)
-- 
GitLab