Commit c1ec6c03 authored by Ådne Karstad's avatar Ådne Karstad

feat(validation): Add validation courseCodeNeedsToBeUnique

parent fb9a7741
......@@ -4,6 +4,7 @@
- Added a bunch of new examples in the model.
- Added mandatory- and elective courses to specialization. Referencing Course and one specialization can reference many courses in both attributes.
- Added validation courseCodeNeedsToBeUnique in order to find duplicates
## Simplifications
......
......@@ -17,36 +17,36 @@
selectedCourses="//@institutes.0/@courses.4 //@institutes.1/@courses.5 //@institutes.2/@courses.0 //@institutes.2/@courses.1 //@institutes.1/@courses.1"/>
<semesters
semester="3"
selectedCourses="//@institutes.0/@courses.5 //@institutes.2/@courses.2 //@institutes.2/@courses.3 //@institutes.0/@courses.13 //@institutes.1/@courses.6"/>
selectedCourses="//@institutes.0/@courses.5 //@institutes.2/@courses.2 //@institutes.2/@courses.3 //@institutes.0/@courses.12 //@institutes.1/@courses.6"/>
<semesters
semester="4"
season="Spring"
selectedCourses="//@institutes.1/@courses.7 //@institutes.0/@courses.9 //@institutes.0/@courses.10 //@institutes.0/@courses.3"/>
selectedCourses="//@institutes.1/@courses.7 //@institutes.0/@courses.8 //@institutes.0/@courses.9 //@institutes.0/@courses.3"/>
<semesters
semester="5"
selectedCourses="//@institutes.0/@courses.11 //@institutes.2/@courses.4 //@institutes.2/@courses.5 //@institutes.2/@courses.6 //@institutes.1/@courses.8"/>
selectedCourses="//@institutes.0/@courses.10 //@institutes.2/@courses.4 //@institutes.2/@courses.5 //@institutes.2/@courses.6 //@institutes.1/@courses.8"/>
<semesters
semester="6"
season="Spring"
selectedCourses="//@institutes.0/@courses.7 //@institutes.0/@courses.16 //@institutes.0/@courses.14 //@institutes.0/@courses.15"/>
selectedCourses="//@institutes.0/@courses.7 //@institutes.0/@courses.15 //@institutes.0/@courses.13 //@institutes.0/@courses.14"/>
<semesters
semester="7"
selectedCourses="//@institutes.3/@courses.0 //@institutes.0/@courses.6 //@institutes.0/@courses.12 //@institutes.0/@courses.2 //@institutes.0/@courses.19 //@institutes.0/@courses.21 //@institutes.0/@courses.23 //@institutes.0/@courses.24 //@institutes.0/@courses.20"/>
selectedCourses="//@institutes.3/@courses.0 //@institutes.0/@courses.6 //@institutes.0/@courses.11 //@institutes.0/@courses.2 //@institutes.0/@courses.16 //@institutes.0/@courses.18 //@institutes.0/@courses.19 //@institutes.0/@courses.20 //@institutes.0/@courses.17"/>
<semesters
semester="8"
season="Spring"
selectedCourses="//@institutes.2/@courses.13 //@institutes.2/@courses.7 //@institutes.2/@courses.8 //@institutes.2/@courses.9 //@institutes.2/@courses.10"/>
selectedCourses="//@institutes.2/@courses.12 //@institutes.2/@courses.7 //@institutes.2/@courses.8 //@institutes.2/@courses.9"/>
<semesters
semester="9"
selectedCourses="//@institutes.0/@courses.25 //@institutes.2/@courses.11 //@institutes.2/@courses.12"/>
selectedCourses="//@institutes.0/@courses.21 //@institutes.2/@courses.10 //@institutes.2/@courses.11"/>
<semesters
semester="10"
season="Spring"
selectedCourses="//@institutes.0/@courses.26"/>
selectedCourses="//@institutes.0/@courses.22"/>
<mandatoryCourses
courses="//@institutes.0/@courses.0 //@institutes.1/@courses.0 //@institutes.1/@courses.1 //@institutes.1/@courses.4 //@institutes.1/@courses.3 //@institutes.1/@courses.5 //@institutes.2/@courses.0 //@institutes.2/@courses.2 //@institutes.2/@courses.7 //@institutes.2/@courses.1 //@institutes.2/@courses.3 //@institutes.2/@courses.4 //@institutes.0/@courses.4 //@institutes.1/@courses.6 //@institutes.0/@courses.5 //@institutes.0/@courses.13 //@institutes.1/@courses.7 //@institutes.2/@courses.5 //@institutes.2/@courses.6 //@institutes.2/@courses.9 //@institutes.2/@courses.10 //@institutes.1/@courses.8 //@institutes.0/@courses.11 //@institutes.3/@courses.0 //@institutes.0/@courses.26 //@institutes.2/@courses.13"/>
courses="//@institutes.0/@courses.0 //@institutes.1/@courses.0 //@institutes.1/@courses.1 //@institutes.1/@courses.4 //@institutes.1/@courses.3 //@institutes.1/@courses.5 //@institutes.2/@courses.0 //@institutes.2/@courses.2 //@institutes.2/@courses.7 //@institutes.2/@courses.1 //@institutes.2/@courses.3 //@institutes.2/@courses.4 //@institutes.0/@courses.4 //@institutes.1/@courses.6 //@institutes.0/@courses.5 //@institutes.0/@courses.12 //@institutes.1/@courses.7 //@institutes.2/@courses.5 //@institutes.2/@courses.6 //@institutes.2/@courses.8 //@institutes.2/@courses.9 //@institutes.1/@courses.8 //@institutes.0/@courses.10 //@institutes.3/@courses.0 //@institutes.0/@courses.22 //@institutes.2/@courses.12"/>
<electiveCourses
courses="//@institutes.0/@courses.25 //@institutes.2/@courses.11 //@institutes.2/@courses.12 //@institutes.0/@courses.17 //@institutes.0/@courses.18 //@institutes.0/@courses.1 //@institutes.0/@courses.14 //@institutes.0/@courses.15 //@institutes.0/@courses.21 //@institutes.0/@courses.23 //@institutes.0/@courses.2 //@institutes.0/@courses.19 //@institutes.0/@courses.24 //@institutes.0/@courses.16"/>
courses="//@institutes.0/@courses.21 //@institutes.2/@courses.10 //@institutes.2/@courses.11 //@institutes.0/@courses.1 //@institutes.0/@courses.13 //@institutes.0/@courses.14 //@institutes.0/@courses.18 //@institutes.0/@courses.19 //@institutes.0/@courses.2 //@institutes.0/@courses.16 //@institutes.0/@courses.20 //@institutes.0/@courses.15"/>
</programs>
<programs
name="Master i informatikk"
......@@ -62,10 +62,10 @@
season="Spring"/>
<specialisation
name="Software"
mandatoryCourses="//@institutes.0/@courses.2 //@institutes.0/@courses.27 //@institutes.0/@courses.14 //@institutes.0/@courses.28"/>
mandatoryCourses="//@institutes.0/@courses.2 //@institutes.0/@courses.23 //@institutes.0/@courses.13 //@institutes.0/@courses.24"/>
<specialisation
name="Interaction Design, Game and Learning Technology"
mandatoryCourses="//@institutes.0/@courses.31 //@institutes.0/@courses.27 //@institutes.0/@courses.24 //@institutes.0/@courses.29"/>
mandatoryCourses="//@institutes.0/@courses.27 //@institutes.0/@courses.23 //@institutes.0/@courses.20 //@institutes.0/@courses.25"/>
<specialisation
name="Databases and Search"/>
<specialisation
......@@ -113,10 +113,6 @@
name="Operativssystemer"
credits="7.5"
level="ThirdYearCourse"/>
<courses
code="TDT4140"
name="Programvareutvikling"
credits="7.5"/>
<courses
code="TDT4145"
name="Datamodellering og databasesystemer"
......@@ -155,15 +151,6 @@
name="Informatikk prosjektarbeid II"
credits="7.5"
level="ThirdYearCourse"/>
<courses
code="IT2805"
name="Webteknologi"
credits="7.5"/>
<courses
code="IT2810"
name="Webutvikling"
credits="7.5"
level="ThirdYearCourse"/>
<courses
code="TDT4117"
name="Informasjonsgjenfinning"
......@@ -179,11 +166,6 @@
name="Programmeringsspråk"
credits="7.5"
level="ThirdYearCourse"/>
<courses
code="TDT4175"
name="Informasjonssystemer"
credits="7.5"
level="ThirdYearCourse"/>
<courses
code="TDT4237"
name="Programvaresikkerhet og personvern"
......@@ -318,11 +300,6 @@
name="Pedagogikk"
credits="15.0"
season="Spring"/>
<courses
code="PPU4614"
name="PPU4625"
level="SecoundDegreeCourse"
season="Spring"/>
<courses
code="PPU4625"
name="Fagdidaktikk 2 - informatikk"
......
......@@ -54,6 +54,12 @@
eType="#//Course"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Course">
<eAnnotations source="http://www.eclipse.org/emf/2002/Ecore">
<details key="constraints" value="courseCodeNeedsToBeUnique"/>
</eAnnotations>
<eAnnotations source="http://www.eclipse.org/acceleo/query/1.0">
<details key="courseCodeNeedsToBeUnique" value="self.eContainer().eContainer().institutes.courses.code -> select(i: String | i = self.code) -> size() &lt; 2"/>
</eAnnotations>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="code" eType="#//CourseCode"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="credits" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EFloat"/>
......
......@@ -62,6 +62,8 @@
<genClasses ecoreClass="spp.ecore#//Specialisation">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute spp.ecore#//Specialisation/name"/>
<genFeatures property="None" notify="false" createChild="false" ecoreFeature="ecore:EReference spp.ecore#//Specialisation/program"/>
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference spp.ecore#//Specialisation/mandatoryCourses"/>
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference spp.ecore#//Specialisation/electiveCourses"/>
</genClasses>
<genClasses ecoreClass="spp.ecore#//MandatoryCourses">
<genFeatures property="None" notify="false" createChild="false" ecoreFeature="ecore:EReference spp.ecore#//MandatoryCourses/program"/>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment