diff --git a/build.xml b/build.xml new file mode 100644 index 0000000..63d8ee8 --- /dev/null +++ b/build.xml @@ -0,0 +1,81 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src-modules/module/promstat/conf/excludes.txt b/src-modules/module/promstat/conf/excludes.txt new file mode 100644 index 0000000..67402d4 --- /dev/null +++ b/src-modules/module/promstat/conf/excludes.txt @@ -0,0 +1,10 @@ +rohdaten/LM_ENV +rohdaten/*.properties +preparation.sql +finalize.sql +rohdaten/*.err +*.log +*.err +rohdaten/unl/* +conf/customize.sql +conf/*.log diff --git a/src-modules/module/promstat/conf/includes.txt b/src-modules/module/promstat/conf/includes.txt new file mode 100644 index 0000000..e3f139c --- /dev/null +++ b/src-modules/module/promstat/conf/includes.txt @@ -0,0 +1,3 @@ +doku/promstat_modul/promstat.html +WEB-INF/conf/edustore/db/bin/SQL_ENV_promstat.sam + diff --git a/src-modules/module/promstat/conf/promstat.xml b/src-modules/module/promstat/conf/promstat.xml new file mode 100644 index 0000000..9f87181 --- /dev/null +++ b/src-modules/module/promstat/conf/promstat.xml @@ -0,0 +1,310 @@ + + + + + + + + + + Dies ist die Faktentabelle für Promotionsvorhaben aus dem Vorsystem (das wird zunächst nur HISinOne sein) + + + + + + + Leistung, die zur Aufnahme einer Promotion berechtigt + + Amtlicher Statistikschlüssel des Bundes für den Abschluß + Schlüssel für die Meldung an das Land + + + + + Teilnahme an einem strukturierten Promotionsprogramm + Beschäftigungsverhältnis an der Hochschule der Promotion + + + + + + + Wert des amtlichen Schluessels, welcher das Geschlecht abbildet + Wert des amtlichen Schluessels fuer erste Staatsangehoerigkeit + Wert des amtlichen Schluessels fuer zweite Staatsangehoerigkeit + Datum des ersten Erwerbs einer Hochschulzulassungsberechtigung + Jahr des ersten Erwerbs einer Hochschulzulassungsberechtigung + amtlicher Schluessel Art der ersten Hochschulzulassungsberechtigung + amtlicher Schluessel Kreis des Erwerbs der ersten Hochschulzulassungsberechtigung + amtlicher Schluessel Staat des Erwerbs der ersten Hochschulzulassungsberechtigung + + + + + + + + + + + + + + +
+ + + + + + + + + + + + +$PROMSTAT_PFAD/masken + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/src-modules/module/promstat/datentabellen/vacuum_pg.sql b/src-modules/module/promstat/datentabellen/vacuum_pg.sql new file mode 100644 index 0000000..36cf210 --- /dev/null +++ b/src-modules/module/promstat/datentabellen/vacuum_pg.sql @@ -0,0 +1,22 @@ + +select * from xdummy; + +--bei Postgres in HIS1 laufen alle Scripte in Transaktionen, daher muss man +--für vacuum erst committen + +commit; + +vacuum lm_exam_unit; +vacuum lm_exam_unit_studies; +vacuum lm_accreditation_neu; +vacuum lm_konto_pro_fs; +vacuum lm_unit; +vacuum lm_unitrelation; +vacuum lm_examrelation; +vacuum lm_examination; +vacuum lm_ects_soll_neu; +vacuum lm_ects_soll; +vacuum lm_pruefrout; + + + diff --git a/src-modules/module/promstat/hilfstabellen/promstat_docprogram_aggr_fuellen.sql b/src-modules/module/promstat/hilfstabellen/promstat_docprogram_aggr_fuellen.sql new file mode 100644 index 0000000..dc78c76 --- /dev/null +++ b/src-modules/module/promstat/hilfstabellen/promstat_docprogram_aggr_fuellen.sql @@ -0,0 +1,120 @@ + + +truncate table promstat_docprogram_aggr; + +insert into promstat_docprogram_aggr( person_id, + degree_program_id, + doctoral_program_id, + sem_rueck_beur_ein, + examplan_id, + course_of_study_id, + astat_bund, + astat_land, + k_type_of_doctorate, + gueltig_von, + gueltig_bis, + finished, + structured_doctoral_program_id, + stu_employment_business_id, + stu_employment_startdate, + stu_employment_enddate, + k_examform_id, + k_examform_un, + k_place_of_studies_astat, + geschlecht_astat, + staatsangehoerigkeit_1_astat, + staatsangehoerigkeit_2_astat, + hzb_datum, + hzb_jahr, + hzb_type_astat, + hzb_kreis_astat, + hzb_staat_astat, + first_external_semester, + first_external_year, + first_external_country_astat, + first_external_university_astat, + summe + ) + SELECT P.his_person_id, +P.degree_program_id, +P.doctoral_program_id, +P.sem_rueck_beur_ein, +P.examplan_id, +P.course_of_study_id, +substring(P.astat_bund from 1 for 10), +P.astat_land, +P.k_type_of_doctorate, +P.gueltig_von, +P.gueltig_bis, +P.finished, +P.structured_doctoral_program_id, +P.stu_employment_business_id, +P.stu_employment_startdate, +P.stu_employment_enddate, +P.k_examform_id, +P.k_examform_un, +P.k_place_of_studies_astat, +D.geschlecht_astat, +D.staatsangehoerigkeit_1_astat, +D.staatsangehoerigkeit_2_astat, +D.hzb_datum, +year(D.hzb_datum), +substring(D.hzb_type_astat from 1 for 10), +val(D.hzb_kreis_astat), +val(D.hzb_staat_astat), +D.first_external_semester, +val(substring('' || D.first_external_semester from 1 for 4)) as first_external_year, +val(D.first_external_country_astat), +substring(first_external_university_astat from 1 for 10), +count(*) + +FROM prom_promotionen P left outer join prom_promovierende D +on (P.his_person_id=D.his_person_id) +group by 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31 + ; + +update promstat_docprogram_aggr set prev_exam_university_astat=A.ext_university_astat, +prev_exam_country_astat=val(ext_country_astat), +prev_exam_degree_land=substring(ext_degree_land_astat from 1 for 10), +prev_exam_degree_bund=substring(ext_degree_bund_astat from 1 for 10) +from prom_abschlusspruefungen A +where A.examplan_id=promstat_docprogram_aggr.examplan_id +; + +update promstat_docprogram_aggr set prev_exam_semester=E.sem_der_pruefung +from lm_examplan E +where E.id=promstat_docprogram_aggr.examplan_id; + +--nur wenn lm_examplan nichts findet: + +update promstat_docprogram_aggr set prev_exam_semester=S.tid +from prom_abschlusspruefungen A, semester S +where promstat_docprogram_aggr.prev_exam_semester is null +and A.examplan_id=promstat_docprogram_aggr.examplan_id +and A.examination_date between S.sem_beginn and S.sem_ende +; + +update promstat_docprogram_aggr set prev_exam_year=val(substring('' || prev_exam_semester from 1 for 4)) +; + +update promstat_docprogram_aggr set +prev_exam_degree_land=substring(int_degree_land_astat from 1 for 10) +from prom_abschlusspruefungen A +where A.examplan_id=promstat_docprogram_aggr.examplan_id +and promstat_docprogram_aggr.prev_exam_degree_land is null +; + +update promstat_docprogram_aggr set +prev_exam_degree_bund=substring(int_degree_bund_astat from 1 for 10) +from prom_abschlusspruefungen A +where A.examplan_id=promstat_docprogram_aggr.examplan_id +and promstat_docprogram_aggr.prev_exam_degree_bund is null +; + +-- update promstat_docprogram_aggr set abschluss_astat_bund=substring(abschluss_astat_bund from 3 for 2) +-- where length(abschluss_astat_bund)=4; +-- +-- update promstat_docprogram_aggr set abschluss_astat_bund=substring(abschluss_astat_bund from 2 for 2) +-- where length(abschluss_astat_bund)=3; +-- + diff --git a/src-modules/module/promstat/masken/46000_felderinfo.unl b/src-modules/module/promstat/masken/46000_felderinfo.unl new file mode 100644 index 0000000..c61aa24 --- /dev/null +++ b/src-modules/module/promstat/masken/46000_felderinfo.unl @@ -0,0 +1,15 @@ +46000^Fächer^4^0^0^170^200^1^char^30^0^12^<> select tid,name,sortnr from sichten where art='KENN-Fächer-Sicht' order by sortnr,name;^ ^^ +46001^Seit Semester^2^0^0^170^150^1^integer^30^0^1^<> select tid, druck from kenn_semester order by tid DESC;^^<> select tid,druck from kenn_semester where today() between sem_beginn and sem_ende;^ +46002^Registriernummer^100^350^-1^150^180^1^integer^200^0^0^^{InputCheck:matrikelnummern}^^ +46003^Geschlecht^13^0^0^170^100^1^integer^30^0^1^<> SELECT apnr,druck FROM kenn_geschl order by 2^^^ +46005^bis Fachsemester^20^0^0^170^20^1^integer^30^0^0^^hidden^^ +46006^Staatsangehörigkeit^11^0^0^170^120^1^sql^30^0^1^<> select '!=0','Alle ohne Deutschland' from xdummy union select '=0','Deutsch' from xdummy order by 2;^^^ +46011^Status^12^0^0^170^200^1^sql^30^0^1^<> select apnr,eintrag from kenn_status order by 2^hidden^^ +46013^ab Fachsemester^19^0^0^170^20^1^integer^30^0^0^^hidden^^ +46014^Weitere Tabellen^123^0^0^140^140^10^char^30^0^1^<> select name,string_not_null(caption) || ' - ' || name from sx_tables where name in ('xy') order by 2^^^ +46015^Felder^125^0^0^150^190^10^char^2550^0^1^<> select trim(F.table_name) || '.' || F.name,trim(T.caption) || ':' || trim(F.caption) || ' - ' || trim(F.name) from sx_fields F, sx_tables T where F.table_name=T.name and F.currentlyused=1 and (F.table_name ='promstat_docprogram_aggr' /* or F.table_name in (<>) */)\ + order by 2;^^^ +46016^Schlüssel anzeigen^150^0^0^100^100^1^integer^30^1^1^<> select 1,'Ja' from xdummy union select 0,'Nein' from xdummy^^<> select 1,'Ja' from xdummy^ +46017^Bis Semester^3^0^0^170^150^1^integer^30^0^1^<> select tid, druck from kenn_semester order by tid DESC;^^<> select tid,druck from kenn_semester where today() between sem_beginn and sem_ende;^ +46018^tablestylesheet^120^0^0^100^200^1^char^200^1^1^<> select distinct filename,X.caption from sx_stylesheets X,sx_mask_style S where X.tid=S.stylesheet_id and S.maskeninfo_id=46000^^<> select distinct filename,X.caption from sx_stylesheets X,sx_mask_style S where X.tid=S.stylesheet_id and S.maskeninfo_id=46000 and S.ord=1^ +46019^Ausgabeformat^2001^0^0^100^150^1^char^200^1^1^<> select element_value,description from menu_element where element='Ausgabeformat' and nature::smallint<100 order by nature::smallint^^<> select element_value,description from menu_element where element='Ausgabeformat' and description='HTML'^ diff --git a/src-modules/module/promstat/masken/46000_maske_system_bez.unl b/src-modules/module/promstat/masken/46000_maske_system_bez.unl new file mode 100644 index 0000000..d074567 --- /dev/null +++ b/src-modules/module/promstat/masken/46000_maske_system_bez.unl @@ -0,0 +1 @@ +46000^350^ diff --git a/src-modules/module/promstat/masken/46000_masken_felder_bez.unl b/src-modules/module/promstat/masken/46000_masken_felder_bez.unl new file mode 100644 index 0000000..c2a967e --- /dev/null +++ b/src-modules/module/promstat/masken/46000_masken_felder_bez.unl @@ -0,0 +1,14 @@ +46000^46000^ +46000^46001^ +46000^46002^ +46000^46003^ +46000^46005^ +46000^46006^ +46000^46011^ +46000^46013^ +46000^46014^ +46000^46015^ +46000^46016^ +46000^46017^ +46000^46018^ +46000^46019^ diff --git a/src-modules/module/promstat/masken/46000_maskeninfo.unl b/src-modules/module/promstat/masken/46000_maskeninfo.unl new file mode 100644 index 0000000..25c5830 --- /dev/null +++ b/src-modules/module/promstat/masken/46000_maskeninfo.unl @@ -0,0 +1,122 @@ +46000^Promotionsvorhaben Datenblatt^--Freemarker Template\ +--ram excelexport\ +<#include "SQL_lingua_franca"/>\ +<#include "SuperX_general"/>\ +--<#include "SQL_multitable_output"/> \ +\ +\ +>,"<>",.vars["Weitere TabellenObject"].allKeys)}\ + \ + )\ + order by 2;]]>\ +\ +>,"<>",.vars["Weitere TabellenObject"].allKeys)} )\ +and foreignkey_tab in ('promstat_docprogram_aggr'\ + ${DatenblattTables(<>,"<>",.vars["Weitere TabellenObject"].allKeys)})\ +;]]>\ +\ +>,"<>",.vars["Weitere TabellenObject"].allKeys)}\ + )\ + and currentlyused=1\ + ${DatenblattFields(<>,"<>",FelderObject.allKeys)}\ + order by 2,3;]]>\ +\ +>,"<>",.vars["Weitere TabellenObject"].allKeys)}\ + )\ + and currentlyused=1\ + ${DatenblattFields(<>,"<>",FelderObject.allKeys)}\ + order by 2,3;]]>\ +\ +\ +\ +<@generate_multitable_list />\ +<@generate_field_list_multitable aggregationsfeld="summe" aggregatfunktion="sum(" />\ +<@generate_foreign_fields_multitable />\ +\ +\ +<#assign filter="\ +/* and sem_rueck_beur_ein <= <> */\ +/* and sem_rueck_beur_ein >= <> */\ +/* and fach_sem_zahl <= <> */\ +/* and fach_sem_zahl >= <> */\ +/* and hssem <= <> */\ +/* and abschluss in (<>) */\ +/* and kz_fach = <> */\ +/* and promstat_docprogram_aggr.his_person_id in (select P.his_person_id from prom_promovierende P where P.geschlecht_astat = <>) */\ +/* and kz_rueck_beur_ein in(<>) */\ +/* and promstat_docprogram_aggr.his_person_id in (select P.his_person_id from prom_promovierende P where P.staatsangehoerigkeit_1_astat <>) */\ +/* and promstat_docprogram_aggr.his_person_id in (select P.his_person_id from prom_promovierende P where P.registrationnumber= <>) */\ +" />\ +\ +/* \ +<#assign filter = filter + " and (promstat_docprogram_aggr.astat_bund in "+Fächer.allNeededKeysList /> --<> */\ +\ +\ +\ + <@generate_resultset_multitable tabellen=table_list\ +p_show_keys=<>\ +p_field_list_select=field_list_select\ +p_foreign_fields=foreign_fields\ +p_filter=filter\ +p_field_list_groupby=field_list_groupby\ +p_join_clause=join_clause\ +/>^--Freemarker Template \ +\ +\ +SELECT caption,\ + foreignkey_tab,\ + description as strukturStr\ + from sx_fields\ + where table_name in ('promstat_docprogram_aggr'\ + ${DatenblattTables(<>,"<>",.vars["Weitere TabellenObject"].allKeys)}\ + )\ +\ + and currentlyused=1\ +${DatenblattFields(<>,"<>",FelderObject.allKeys)}\ +\ +order by 1;\ +\ +\ +XIL List\ + sizable_columns horizontal_scrolling\ + white_space_color=COLOR_WHITE fixed_columns=1\ + min_heading_height=35\ +<#assign i=1 />\ +<#if get_felder?has_content >\ +<#foreach myfield in get_felder>\ +<#assign i=i+1 />\ +Column CID=${i} heading_text="${myfield.key}" explanation="${myfield.strukturStr}" center_heading\ + row_selectable col_selectable rightJust heading_platform readonly\ + width=20\ +<#if myfield.name != ''>\ +<#assign i=i+1 />\ +Column CID=${i} heading_text="${myfield.key}\\n(Schlüssel)" explanation="Schlüssel des Feldes ${myfield.key}" center_heading\ + row_selectable col_selectable rightJust heading_platform readonly\ + width=20\ + \ +\ +\ +@@@^Studienfach^Anzahl bzw. Anteil^Statistik der Promotionsvorhaben und Merkmalen der Promivierenden HZB früheres Studium^drop table tmp_tabelle;^studallg.dat^1^850^600^0^1^<> select 'Letzte Lieferung: ' || date_str(max(datum)) from kenn_lieferung where (1 =0 /* or hs_nr::char(10) in (<>) */ /* or hs_nr::char(10) in (select key_apnr from organigramm where parent in (<>)) */ /* or <>='0' */ ) and kennzahl ='STDI'^ diff --git a/src-modules/module/promstat/masken/46000_sachgeb_maske_bez.unl b/src-modules/module/promstat/masken/46000_sachgeb_maske_bez.unl new file mode 100644 index 0000000..d3bc964 --- /dev/null +++ b/src-modules/module/promstat/masken/46000_sachgeb_maske_bez.unl @@ -0,0 +1 @@ +350^46000^ diff --git a/src-modules/module/promstat/promstat_modul_entfernen.x b/src-modules/module/promstat/promstat_modul_entfernen.x new file mode 100755 index 0000000..d194f92 --- /dev/null +++ b/src-modules/module/promstat/promstat_modul_entfernen.x @@ -0,0 +1,5 @@ +#!/bin/bash +echo "------------------------------------------------------------" +echo +module_drop.x lm $LM_PFAD + diff --git a/src-modules/module/promstat/promstat_modul_erzeugen.x b/src-modules/module/promstat/promstat_modul_erzeugen.x new file mode 100755 index 0000000..d7a2241 --- /dev/null +++ b/src-modules/module/promstat/promstat_modul_erzeugen.x @@ -0,0 +1,4 @@ +#!/bin/bash + +module_install.x lm $LM_PFAD + diff --git a/src-modules/module/promstat/promstat_update.x b/src-modules/module/promstat/promstat_update.x new file mode 100755 index 0000000..6c70aae --- /dev/null +++ b/src-modules/module/promstat/promstat_update.x @@ -0,0 +1,65 @@ +#!/bin/bash + +#Arbeitsverzeichnis fuer crontab +PFAD=$2 +if [ "$PFAD" != "" ] +then + +cd $PFAD + +fi +#Umgebung einlesen: +if [ "$LM_PFAD" = "" ] +then +echo "ACHTUNG: Die Umgebungsvariable LM_PFAD ist nicht gesetzt. Bitte prüfen Sie $SUPERX_DIR/db/bin/SQL_ENV" + +exit 1 + +fi +if [ "$LM_ERRORMAIL" != "" ] +then +ERRORMAIL=$LM_ERRORMAIL +export ERRORMAIL +fi +if [ "$LM_LOGMAIL" != "" ] +then +LOGMAIL=$LM_LOGMAIL +export LOGMAIL +fi +if [ "$LM_BACKUP" != "" ] +then +MODULE_BACKUP=$LM_BACKUP +export MODULE_BACKUP +fi + +#hier geht es los +#runAndCheck.x path command (EXIT_ON_ERROR|CONT_ON_ERROR) (SEND_ERRORMAIL|NO_ERRORMAIL) (SEND_LOGMAIL|NO_LOGMAIL) [description] " +echo "lm-Update startet" >$LM_ERRORDAT +#Tagesdatum für Systeminfo +date +'%d.%m.%Y' > $LM_LOAD_PFAD/superx.datum + +runAndCheck.x $LM_PFAD "module_etl.x lm $LM_PFAD $LM_LOAD_PFAD" EXIT_ON_ERROR SEND_ERRORMAIL SEND_LOGMAIL "LM update$MANDANTID" +cat $LM_PFAD/L_LM_update$MANDANTID.log >>$LM_ERRORDAT + + +fgrep -s "not found" $LM_ERRORDAT +FLAG1=$? +fgrep -i -s "error" $LM_ERRORDAT +FLAG2=$? +fgrep -i -s "nicht gefunden" $LM_ERRORDAT +FLAG3=$? +if [ $FLAG1 -eq 0 -o $FLAG2 -eq 0 -o $FLAG3 -eq 0 ] +then + echo "Fehler beim LM-Update " + echo "---------------------------------------" + echo "Fehlerprotokoll in $LM_ERRORDAT" + echo "---------------------------------------" + cp $LM_LOAD_PFAD/superx.datum.alt $LM_LOAD_PFAD/superx.datum +else + echo "LM-Update erfolgreich" +fi + +echo "---------------------------Beginn Prüfroutine-----------------------------------" >>$LM_ERRORDAT +#cat $LM_PFAD/L_lm_Test$MANDANTID.log >>$LM_ERRORDAT +pruefmail.x $LM_PFAD/L_lm_Test$MANDANTID.log $ERRORMAIL + diff --git a/src-modules/module/promstat/rohdaten/PROMSTAT_ENV.sam b/src-modules/module/promstat/rohdaten/PROMSTAT_ENV.sam new file mode 100644 index 0000000..0fa85fc --- /dev/null +++ b/src-modules/module/promstat/rohdaten/PROMSTAT_ENV.sam @@ -0,0 +1,2 @@ + +#bitte einen symbolischen Link auf die SOS_ENV setzen diff --git a/src-modules/module/promstat/rohdaten/promstat_unload.xml b/src-modules/module/promstat/rohdaten/promstat_unload.xml new file mode 100644 index 0000000..5e540f8 --- /dev/null +++ b/src-modules/module/promstat/rohdaten/promstat_unload.xml @@ -0,0 +1,1131 @@ + + +LM-Modul + + +SOSPOS-Version, möglich ist 13 (gilt für alle Versionen). Bei HISinOne wird sie automatisch gesetzt. + Wenn ja, dann ist der Wert ein Filter für die H1-Tabelle k_adresstag mit alias AT, z.B. "AT.hiskey_id=8", wenn nein, dann ist er "1=0" +Wird bei Datenquelle HISinOne ausgewertet. + Wenn ja, dann ist der Wert "true", wenn nein, dann ist es "false". + Wenn ja, dann ist der Wert "true", wenn nein, dann ist es "false". + + + + + + + + + PNR Konstanten aus POS entladen + + + + + + + + + + + + + + + + PNR Konstanten aus POS entladen + + + + + + + += tmp_lm_course_of_study.valid_to +or D.valid_to is null +or ( D.valid_from is null and tmp_lm_course_of_study.valid_from is null) +) +); +--wenn degree nicht ermittelt werden kann, dann ohne Historisierung +update tmp_lm_course_of_study set degree_id=(select min(D.id) from degree D +where D.lid=tmp_lm_course_of_study.degree_lid +) +where degree_id is null +; +--subject +update tmp_lm_course_of_study set subject_id=(select D.id from subject D +where D.lid=tmp_lm_course_of_study.subject_lid +and (D.valid_from <= tmp_lm_course_of_study.valid_from +or D.valid_from is null +or ( D.valid_from is null and tmp_lm_course_of_study.valid_from is null) +) +and (D.valid_to >= tmp_lm_course_of_study.valid_to +or D.valid_to is null +or ( D.valid_from is null and tmp_lm_course_of_study.valid_from is null) +) +); +--wenn subject nicht ermittelt werden kann, dann ohne Historisierung +update tmp_lm_course_of_study set subject_id=(select min(D.id) from subject D +where D.lid=tmp_lm_course_of_study.subject_lid +) +where subject_id is null +; +--major_field_of_study +update tmp_lm_course_of_study set major_field_of_study_id=(select D.id from major_field_of_study D +where D.lid=tmp_lm_course_of_study.major_field_of_study_lid +and (D.valid_from <= tmp_lm_course_of_study.valid_from +or D.valid_from is null +or ( D.valid_from is null and tmp_lm_course_of_study.valid_from is null) +) +and (D.valid_to >= tmp_lm_course_of_study.valid_to +or D.valid_to is null +or ( D.valid_from is null and tmp_lm_course_of_study.valid_from is null) +) +); +--course_specialization_lid +update tmp_lm_course_of_study set course_specialization_id=(select D.id from course_specialization D +where D.lid=tmp_lm_course_of_study.course_specialization_lid +and (D.valid_from <= tmp_lm_course_of_study.valid_from +or D.valid_from is null +or ( D.valid_from is null and tmp_lm_course_of_study.valid_from is null) +) +and (D.valid_to >= tmp_lm_course_of_study.valid_to +or D.valid_to is null +or ( D.valid_from is null and tmp_lm_course_of_study.valid_from is null) +) +); +--orgunit +update tmp_lm_course_of_study set orgunit_id=(select D.id from orgunit D +where D.lid=tmp_lm_course_of_study.orgunit_lid +and (D.valid_from <= tmp_lm_course_of_study.valid_from +or D.valid_from is null +or ( D.valid_from is null and tmp_lm_course_of_study.valid_from is null) +) +and (D.valid_to >= tmp_lm_course_of_study.valid_to +or D.valid_to is null +or ( D.valid_from is null and tmp_lm_course_of_study.valid_from is null) +) +); +--wenn Studiengang heute gültig ist und orgunit historisiert, nimmt er den aktuellen FB +update tmp_lm_course_of_study set orgunit_id=(select D.id from orgunit D +where D.lid=tmp_lm_course_of_study.orgunit_lid +and current_date between D.valid_from and D.valid_to) +where current_date between valid_from and valid_to +and orgunit_id is null; + + +--teachingunit_orgunit_lid + +update tmp_lm_course_of_study set teachingunit_orgunit_id=(select D.id from orgunit D +where D.lid=tmp_lm_course_of_study.teachingunit_orgunit_lid +and (D.valid_from <= tmp_lm_course_of_study.valid_from +or D.valid_from is null +or ( D.valid_from is null and tmp_lm_course_of_study.valid_from is null) +) +and (D.valid_to >= tmp_lm_course_of_study.valid_to +or D.valid_to is null +or ( D.valid_from is null and tmp_lm_course_of_study.valid_from is null) +) +) +where teachingunit_orgunit_lid is not null; + +--wenn Studiengang heute gültig ist und orgunit historisiert, nimmt er aktuelle LE +update tmp_lm_course_of_study set teachingunit_orgunit_id=(select D.id from orgunit D +where D.lid=tmp_lm_course_of_study.teachingunit_orgunit_lid +and current_date between D.valid_from and D.valid_to) +where current_date between valid_from and valid_to +and teachingunit_orgunit_id is null; + + +--k_field_of_study +update tmp_lm_course_of_study set k_field_of_study_id=(select S.k_field_of_study_id +from subject S +where S.id=tmp_lm_course_of_study.subject_id) +where k_field_of_study_id is null; +--hochprojizieren auf Fächergruppe +update tmp_lm_course_of_study set k_field_of_study_id=(select K.parent_id +from k_field_of_study K +where K.id=tmp_lm_course_of_study.k_field_of_study_id); + +--is_historized=1 wenn es mehrere Studiengänge pro LID gibt +update tmp_lm_course_of_study set is_historized=1 +where 1 < (select count(*) from course_of_study C +where C.lid=tmp_lm_course_of_study.lid); + +create index tmp_lm_i_tc1 on tmp_lm_course_of_study(lid); + +]]> + + + + + + + wichtige Konstanten aus SOS entladen, z.B. HISSOS-Version. + + + + + + + + + + + + +Pruefungsordnungsdaten + + + + + + + + + + + + +Pruefungsordnungsdaten + + + + + + + + + + + + +Studiengänge + + + + + + + + + + + + + + +Pruefungsordnungsdaten + + + + + + + + + + + + + +Pruefungsdaten + + + + + + + + + + + + + +Pruefungsordnungsdaten + + + + + + + + + + + + +Pruefungsdaten + + + + + + + + + + + + + +Prüfernamen + + + + + + + + + + + + + + + +Pruefungsdaten + + + + + + + + + + + + +Anerkennungsdaten + + + + + + + + + + + + + + +Schlüsseltabelle cifx + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Beendigung + + + + + + + + + + + diff --git a/src-modules/module/promstat/schluesseltabellen/captions_fuellen.sql b/src-modules/module/promstat/schluesseltabellen/captions_fuellen.sql new file mode 100644 index 0000000..1961efa --- /dev/null +++ b/src-modules/module/promstat/schluesseltabellen/captions_fuellen.sql @@ -0,0 +1,102 @@ +--freemarker template +delete from sx_captions where id like 'doku_16000%'; +delete from sx_captions where id like 'doku_16020%'; +delete from sx_captions where id like 'doku_16040%'; +delete from sx_captions where id like 'doku_16060%'; +delete from sx_captions where id like 'doku_16100%'; +delete from sx_captions where id like 'doku_16120%'; +delete from sx_captions where id like 'doku_16140%'; +delete from sx_captions where id like 'doku_16160%'; +delete from sx_captions where id like 'doku_16180%'; +delete from sx_captions where id like 'doku_16200%'; +delete from sx_captions where id like 'doku_16220%'; +delete from sx_captions where id like 'doku_16240%'; +delete from sx_captions where id like 'doku_16260%'; +delete from sx_captions where id like 'doku_16280%'; +delete from sx_captions where id like 'doku_16300%'; +delete from sx_captions where id like 'doku_16340%'; +delete from sx_captions where id like 'doku_16360%'; +delete from sx_captions where id like 'doku_16380%'; +delete from sx_captions where id like 'doku_16400%'; +delete from sx_captions where id like 'doku_16450%'; +delete from sx_captions where id like 'doku_16470%'; +delete from sx_captions where id like 'doku_16490%'; +delete from sx_captions where id like 'doku_16530%'; +delete from sx_captions where id like 'doku_16550%'; +delete from sx_captions where id like 'doku_16570%'; +delete from sx_captions where id like 'doku_16590%'; +delete from sx_captions where id like 'doku_16610%'; +delete from sx_captions where id like 'doku_16630%'; +delete from sx_captions where id like 'doku_16650%'; +delete from sx_captions where id like 'doku_16690%'; +delete from sx_captions where id like 'doku_16710%'; +delete from sx_captions where id like 'doku_16730%'; +delete from sx_captions where id like 'doku_16750%'; +delete from sx_captions where id like 'doku_16770%'; + +delete from sx_captions where id like 'sos_doku_benutzer_url%'; +delete from sx_captions where id like 'sos_doku_admin_url%'; +delete from sx_captions where id like 'einzelpruefungen_doku_benutzer_url%'; +delete from sx_captions where id like 'studierende_doku_benutzer_url%'; +delete from sx_captions where id like 'pruefungen_doku_benutzer_url%'; +delete from sx_captions where id like 'abschlusspruefungen_doku_benutzer_url%'; +delete from sx_captions where id like 'sos_astat_doku_url%'; + + +--Für Update Felderinfo mit neuen Spalten +--Prüfungen/ Studierene 120 +--delete from sx_captions where table_name like 'felderinfo%' and sachgebiete_id=120; +--Abschlusspruefungen 16 +--delete from sx_captions where table_name like 'felderinfo%' and sachgebiete_id=16; +--Einzelpruefungen 34 +--delete from sx_captions where table_name like 'felderinfo%' and sachgebiete_id=34; + +--in tmp_captions stehen release captions: +--Löschung der release captions nach id bzw. felderinfo, Feldname, tid: +--z.B. id=sos_auslaender_w_absol +--oder table_name=felderinfo und field_name=Seit Semester +delete from tmp_captions where +--Löschung der release captions nach id +(id is not null +and id in (select id from sx_captions where id is not null)) +--Löschung der release captions nach felderinfo, Feldname: , tid: +or ( +id is null and record_no is null and field_name is not null and field_name in +(select field_name from sx_captions where field_name is not null +--Wenn keine record_no, dann gilt es für alle Felder mit dem Namen +and record_no is null)); + +--record_no abfangen, wenn vorhanden +delete from tmp_captions +where id is null and field_name is not null +--Wenn record_no gefüllt: +and record_no is not null +and (trim(field_name) || record_no in (select trim(field_name) || record_no from sx_captions +where field_name is not null +and record_no is not null)); + + +<#if SQLdialect='Postgres'> +select sp_update_sequence('sx_captions'); + + +insert into sx_captions ( id,table_name,field_name,record_no,locale,contents_short,contents_long, equalitystatus,sachgebiete_id +<#if TableFieldExists?exists && TableFieldExists('sx_captions','doku_link')> +,doku_link + +<#if TableFieldExists?exists && TableFieldExists('sx_captions','export_to_glossar')> +,export_to_glossar + +) +select id,table_name,field_name,record_no,locale,contents_short,contents_long, equalitystatus,sachgebiete_id +<#if TableFieldExists?exists && TableFieldExists('sx_captions','doku_link')> +,doku_link + +<#if TableFieldExists?exists && TableFieldExists('sx_captions','export_to_glossar')> +,export_to_glossar + +from tmp_captions; + +drop table tmp_captions; + + diff --git a/src-modules/module/promstat/schluesseltabellen/captions_fuellen.x b/src-modules/module/promstat/schluesseltabellen/captions_fuellen.x new file mode 100755 index 0000000..46a3472 --- /dev/null +++ b/src-modules/module/promstat/schluesseltabellen/captions_fuellen.x @@ -0,0 +1,34 @@ +#/bin/sh + +DOQUERY "create table tmp_captions +( +id CHAR(200) , +table_name CHAR(200) , +field_name CHAR(200) , +record_no INTEGER , +locale CHAR(10) , +contents_short CHAR(255) , +contents_long text , +equalitystatus SMALLINT , +sachgebiete_id INTEGER, +doku_link character varying(255), +export_to_glossar integer DEFAULT 1 +)" + +sx_auto_upload_table.x tmp_captions "./lm_captions.unl" + +DOQUERY "delete from tmp_captions where (id is not null +and id in (select id from sx_captions where id is not null)) +or (id is null and field_name is not null and field_name in (select field_name from sx_captions where field_name is not null));" + +if [ "$DATABASE" = "POSTGRES" ] +then +DOQUERY "select sp_update_sequence('sx_captions');" +fi + +DOQUERY "insert into sx_captions ( id,table_name,field_name,record_no,locale,contents_short,contents_long, equalitystatus,sachgebiete_id,doku_link,export_to_glossar) +select id,table_name,field_name,record_no,locale,contents_short,contents_long, equalitystatus,sachgebiete_id,doku_link,export_to_glossar from tmp_captions;" + +DOQUERY "drop table tmp_captions;" + + diff --git a/src-modules/module/promstat/schluesseltabellen/promstat_captions.unl b/src-modules/module/promstat/schluesseltabellen/promstat_captions.unl new file mode 100644 index 0000000..e69de29 diff --git a/src-modules/module/promstat/schluesseltabellen/promstat_feste_konstanten_entfernen.sql b/src-modules/module/promstat/schluesseltabellen/promstat_feste_konstanten_entfernen.sql new file mode 100644 index 0000000..3eb6b03 --- /dev/null +++ b/src-modules/module/promstat/schluesseltabellen/promstat_feste_konstanten_entfernen.sql @@ -0,0 +1,7 @@ + + +delete from konstanten where systeminfo_id=350; + + + + diff --git a/src-modules/module/promstat/schluesseltabellen/promstat_feste_konstanten_fuellen.sql b/src-modules/module/promstat/schluesseltabellen/promstat_feste_konstanten_fuellen.sql new file mode 100644 index 0000000..9f8fc66 --- /dev/null +++ b/src-modules/module/promstat/schluesseltabellen/promstat_feste_konstanten_fuellen.sql @@ -0,0 +1,103 @@ +--freemarker template +<#if SQLdialect='Postgres'> +<#assign texttype="text" /> +<#else> +EXECUTE PROCEDURE IFX_ALLOW_NEWLINE('T'); +<#assign texttype="lvarchar" /> + +<#assign newline="' +'" /> + +create temp table tmp_konstanten + ( + tid serial, + apnr integer, + beschreibung char(255), + defaultvalue integer, + description ${texttype}, + systeminfo_id integer, + doku_link varchar(255), + read_only integer, + wertebereich varchar(250), + ab_version varchar(10), + gruppe varchar(255), + sachgebiete_id integer + ); + + +insert into tmp_konstanten(apnr, beschreibung, defaultvalue, description, systeminfo_id, doku_link, read_only, wertebereich, ab_version, gruppe, sachgebiete_id) +values (6,'PROMSTAT_Quellsystem', 6,'Anzeige der Datenquelle für die BI-Komponente', +350, '', +1,'6 = HISinOne', '8.0', 'Datenquelle, Entladestartzeitpunkt, -umfang', 350); + +--vorhandene Schlüssel Metadaten updaten: + +<#if SQLdialect='Postgres'> +--Postgres Dialekt: +update konstanten set defaultvalue=T.defaultvalue, +description=T.description, +systeminfo_id=T.systeminfo_id , +doku_link=T.doku_link, +read_only=T.read_only , +wertebereich=T.wertebereich, +ab_version=T.ab_version, +gruppe=T.gruppe , +sachgebiete_id=T.sachgebiete_id +from tmp_konstanten T +where T.beschreibung=konstanten.beschreibung; + +<#else> + +--Informix Dialekt: +update konstanten set (defaultvalue, + description, + systeminfo_id, + doku_link, + read_only, + wertebereich, + ab_version, + gruppe, + sachgebiete_id) + = ((select + defaultvalue, + description, + systeminfo_id, + doku_link, + read_only, + wertebereich, + ab_version, + gruppe, + sachgebiete_id +from tmp_konstanten T +where T.beschreibung=konstanten.beschreibung)) +where beschreibung in ( +select T.beschreibung +from tmp_konstanten T) +; + + + + +select 'vorh. Konstanten apnrs bleiben erhalten' from xdummy; + +delete from tmp_konstanten where beschreibung in (select beschreibung from konstanten); + + +create temp table tmp_hilf (tid integer); +insert into tmp_hilf select max(tid) from konstanten; +update tmp_hilf set tid=0 where tid is null; + +insert into konstanten(tid , apnr ,beschreibung, defaultvalue, description, systeminfo_id, doku_link, read_only, wertebereich, ab_version, gruppe, sachgebiete_id ) +select H.tid+K.tid , K.apnr ,K.beschreibung, K.defaultvalue, K.description, K.systeminfo_id, K.doku_link, K.read_only, K.wertebereich, K.ab_version, K.gruppe, K.sachgebiete_id from tmp_konstanten K, tmp_hilf H; + + +drop table tmp_konstanten; + +drop table tmp_hilf; + +--Konstante LM_ECTS_SOLL_SRC auf Wert von SOS setzen, wenn noch nicht gesetzt: +update konstanten set apnr=1 +where beschreibung='LM_ECTS_SOLL_SRC' +and apnr=2 +and 0< (select count(*) from konstanten K2 where K2.beschreibung='SOS_ECTS_SOLL_SRC' and K2.apnr=1); + diff --git a/src-modules/module/promstat/schluesseltabellen/sx_stylesheets_einfuegen.sql b/src-modules/module/promstat/schluesseltabellen/sx_stylesheets_einfuegen.sql new file mode 100755 index 0000000..0f1c2ed --- /dev/null +++ b/src-modules/module/promstat/schluesseltabellen/sx_stylesheets_einfuegen.sql @@ -0,0 +1,165 @@ +--Freemarker Template +--Achtung: Macro fügt Inhalte ein +--Bitte nur Freemarker Variablen füllen + +<#assign masken = [ +{"mask":"46000", "filename":"tabelle_html_datenblatt.xsl", "ord":"1"} +] /> + +<#assign stylesheet = [ + +] /> +<#assign stylesheet_field = [ + +] /> + +--Hier eventuell notwendige delete's auf die Tabellen sx_mask_style, sx_stylesheets oder stylesheet_field einfügen. + +--Achtung: ab hier nicht ändern, Mutterdatei ist $SUPERX_DIR/db/module/sos/schluesseltabellen/sx_stylesheets_fuellen.sql + <@sx_stylesheets_insert +m_masken=masken +m_stylesheet=stylesheet +m_stylesheet_field=stylesheet_field +/> + + +<#macro sx_stylesheets_insert m_masken m_stylesheet m_stylesheet_field> + +--Sicherstellen, dass keine Duplikate vorkommen: +--#################################################################################################### +<#foreach column in m_masken> +delete from sx_mask_style where maskeninfo_id=${column.mask} and stylesheet_id in (select tid from sx_stylesheets where filename ='${column.filename}') and ord=${column.ord}; + + +<#foreach column in m_stylesheet_field> +delete from stylesheet_field where stylesheet_id in (select tid from sx_stylesheets where filename ='${column.filename}'); + + + + + +-- Stylesheets füllen +--#################################################################################################### +create temp table tmp_stylesheets ( +tid serial not null, +filename CHAR(255) , +caption CHAR(255) , +description CHAR(255) , +relation CHAR(10) , +useragent CHAR(255) , +contenttype CHAR(200) , +is_generic smallint +); + +create temp table tmp_hilf (tid integer); +insert into tmp_hilf select max(tid) from sx_stylesheets; +update tmp_hilf set tid=1 where tid is null; + +<#assign counter_tid = 1 /> +<#foreach column in m_stylesheet> +insert into tmp_stylesheets (tid,filename,caption,description,relation,contenttype,is_generic) +select max(tid)+${counter_tid},'${column.filename}', +'${column.caption}', + '${column.description}', + '${column.relation}', +'${column.contenttype}', +${column.is_generic} +from tmp_hilf; +<#assign counter_tid = counter_tid + 1 /> + + +<#if TableFieldExists?exists && TableFieldExists('sx_stylesheets','is_generic')> +update sx_stylesheets set is_generic=1 +where filename in (select T.filename from tmp_stylesheets T where T.is_generic=1); + + + +--delete für tml_stylesheets hinzugefügt #ak 06.03.2013 +delete from tmp_stylesheets where filename in (select filename from sx_stylesheets); + + +insert into sx_stylesheets (tid, +filename, caption, description, relation, useragent, contenttype +<#if TableFieldExists?exists && TableFieldExists('sx_stylesheets','is_generic')> +,is_generic + +) +SELECT tid, filename, caption, description, relation, useragent, contenttype +<#if TableFieldExists?exists && TableFieldExists('sx_stylesheets','is_generic')> +,is_generic + +FROM tmp_stylesheets; + +drop table tmp_stylesheets; + + +-- Mask Style füllen +--#################################################################################################### +create temp table tmp_mask_style ( +tid serial not null, +maskeninfo_id INTEGER , +stylesheet_id INTEGER , +ord SMALLINT, +filename char(255) +); + +delete from tmp_hilf; +insert into tmp_hilf select max(tid) from sx_mask_style; +update tmp_hilf set tid=1 where tid is null; + +<#assign counter_tid = 1 /> +<#foreach column in m_masken> +insert into tmp_mask_style (tid,maskeninfo_id,ord,filename) +select max(tid)+${counter_tid},${column.mask},${column.ord},'${column.filename}' from tmp_hilf; + +update tmp_mask_style set stylesheet_id=(select max(tid) from sx_stylesheets where filename='${column.filename}') +where filename='${column.filename}'; +<#assign counter_tid = counter_tid + 1 /> + + +insert into sx_mask_style ( tid, maskeninfo_id, stylesheet_id, ord) +SELECT tid, maskeninfo_id, stylesheet_id, ord +FROM tmp_mask_style; + +drop table tmp_mask_style; + + +--Field zu Stylesheet Zuordnungen: +--#################################################################################################### +CREATE temp TABLE tmp_stylesheet_field +( +tid serial NOT NULL, +stylesheet_id INTEGER, +tablename char(255), +fieldname char(255), +filename char(255) +); + +delete from tmp_hilf; +insert into tmp_hilf select max(tid) from stylesheet_field; +update tmp_hilf set tid=1 where tid is null; + +<#assign counter_tid = 1 /> +<#foreach column in m_stylesheet_field> +INSERT INTO tmp_stylesheet_field (tid, filename, tablename, fieldname) +select max(tid)+${counter_tid}, '${column.filename}', '${column.tablename}', '${column.fieldname}' from tmp_hilf; + +update tmp_stylesheet_field set stylesheet_id=(select max(tid) from sx_stylesheets where filename='${column.filename}') +where filename='${column.filename}'; +<#assign counter_tid = counter_tid + 1 /> + + +insert into stylesheet_field ( tid, stylesheet_id, tablename, fieldname) +SELECT tid, stylesheet_id, tablename, fieldname +FROM tmp_stylesheet_field; + +drop table tmp_stylesheet_field; +drop table tmp_hilf; + +<#if SQLdialect='Postgres'> +select sp_update_sequence('sx_stylesheets'); +select sp_update_sequence('sx_mask_style'); +select sp_update_sequence('stylesheet_field'); + + + diff --git a/src-modules/module/promstat/upgrade/lm_upgrade_man.sql b/src-modules/module/promstat/upgrade/lm_upgrade_man.sql new file mode 100644 index 0000000..0a78a27 --- /dev/null +++ b/src-modules/module/promstat/upgrade/lm_upgrade_man.sql @@ -0,0 +1,15 @@ + +--Freemarker Template +<#if '${SQLdialect}'='Postgres' > + +alter table lm_ects_soll alter column pversion type varchar(255); +alter table lm_ects_soll_neu alter column pversion type varchar(255); +alter table lm_accreditation_neu alter column k_accreditationtype_id type varchar(255); + + +<#if '${SQLdialect}'='Informix' > +--nun Informix: +alter table lm_ects_soll modify(pversion varchar(255)); +alter table lm_ects_soll_neu modify(pversion varchar(255)); +alter table lm_accreditation_neu modify(k_accreditationtype_id varchar(255)); + diff --git a/superx/WEB-INF/conf/edustore/db/bin/SQL_ENV_promstat.sam b/superx/WEB-INF/conf/edustore/db/bin/SQL_ENV_promstat.sam new file mode 100644 index 0000000..70fede5 --- /dev/null +++ b/superx/WEB-INF/conf/edustore/db/bin/SQL_ENV_promstat.sam @@ -0,0 +1,14 @@ +#Beispielumgebung für das PROMSTAT-Modul: + +#SUPERX_MODULE=$SUPERX_DIR/db/module +#SUPERX_ROHDATEN=rohdaten + +PROMSTAT_PFAD=$SUPERX_MODULE/promstat; export PROMSTAT_PFAD +PROMSTAT_ERRORDAT=$PROMSTAT_PFAD/promstat_update.err; export PROMSTAT_ERRORDAT +#Hier stehen die Rohdaten (im Unterverzeichnis unl) +PROMSTAT_LOAD_PFAD=$PROMSTAT_PFAD/$SUPERX_ROHDATEN; export PROMSTAT_LOAD_PFAD +PROMSTAT_ERRORMAIL=$ERRORMAIL; export PROMSTAT_ERRORMAIL +PROMSTAT_LOGMAIL=$LOGMAIL; export PROMSTAT_LOGMAIL + + +