Daniel Quathamer
2 years ago
6 changed files with 555 additions and 57 deletions
@ -0,0 +1,132 @@
@@ -0,0 +1,132 @@
|
||||
#!/bin/bash |
||||
#Extraction Script for SuperX. |
||||
#Bitte nicht ändern, diese Datei ist automatisch generiert. |
||||
|
||||
SRC_PFAD=$SOS_LOAD_PFAD |
||||
if [ "$SRC_PFAD" = "" ] |
||||
then |
||||
SRC_PFAD=. |
||||
fi |
||||
|
||||
. ./$SRC_PFAD/SOS_ENV |
||||
|
||||
|
||||
if [ "$outFormat" = "" ] |
||||
then |
||||
outFormat=txt |
||||
fi |
||||
|
||||
DATUM=`cat $SRC_PFAD/superx.datum` |
||||
ERR=sos_v1_unload.err |
||||
|
||||
HEUTE=`date +'%d.%m.%Y'` |
||||
|
||||
echo "Letztes Update-Datum: " $DATUM >$ERR |
||||
echo "DATABASE: $DATABASE" >>$ERR |
||||
echo "VERSION: $VERSION" >>$ERR |
||||
echo "SX_CLIENT: $SX_CLIENT" >>$ERR |
||||
echo "1.2b^"$HEUTE"^" >$SRC_PFAD/unl/superx_unload_version.unl |
||||
|
||||
cd $SRC_PFAD >>$ERR 2>&1 |
||||
|
||||
CP=".:$JDBC_CLASSPATH:$XML_CLASSPATH" |
||||
|
||||
|
||||
cat /dev/null >unload_params.txt |
||||
|
||||
|
||||
if [ "$SOS_UNL_COMPLETE" = "" ] |
||||
then |
||||
SOS_UNL_COMPLETE="true" |
||||
export SOS_UNL_COMPLETE |
||||
fi |
||||
echo "Parameter SOS_UNL_COMPLETE: $SOS_UNL_COMPLETE" >>$ERR |
||||
echo "\$SOS_UNL_COMPLETE=$SOS_UNL_COMPLETE" >>unload_params.txt |
||||
|
||||
|
||||
if [ "$VERSION" = "" ] |
||||
then |
||||
VERSION="13" |
||||
export VERSION |
||||
fi |
||||
echo "Parameter VERSION: $VERSION" >>$ERR |
||||
echo "\$VERSION=$VERSION" >>unload_params.txt |
||||
|
||||
|
||||
if [ "$start_stud_sem" = "" ] |
||||
then |
||||
start_stud_sem="19911" |
||||
export start_stud_sem |
||||
fi |
||||
echo "Parameter start_stud_sem: $start_stud_sem" >>$ERR |
||||
echo "\$start_stud_sem=$start_stud_sem" >>unload_params.txt |
||||
|
||||
|
||||
if [ "$start_pruef_sem" = "" ] |
||||
then |
||||
start_pruef_sem="19911" |
||||
export start_pruef_sem |
||||
fi |
||||
echo "Parameter start_pruef_sem: $start_pruef_sem" >>$ERR |
||||
echo "\$start_pruef_sem=$start_pruef_sem" >>unload_params.txt |
||||
|
||||
|
||||
if [ "$SOS_UNL_ANON" = "" ] |
||||
then |
||||
SOS_UNL_ANON="false" |
||||
export SOS_UNL_ANON |
||||
fi |
||||
echo "Parameter SOS_UNL_ANON: $SOS_UNL_ANON" >>$ERR |
||||
echo "\$SOS_UNL_ANON=$SOS_UNL_ANON" >>unload_params.txt |
||||
|
||||
|
||||
if [ "$POS_PNR" = "" ] |
||||
then |
||||
POS_PNR="0" |
||||
export POS_PNR |
||||
fi |
||||
echo "Parameter POS_PNR: $POS_PNR" >>$ERR |
||||
echo "\$POS_PNR=$POS_PNR" >>unload_params.txt |
||||
|
||||
|
||||
if [ "$LAB_FILTER" = "" ] |
||||
then |
||||
LAB_FILTER=" AND (lab.panerk is null or lab.panerk != 'J') " |
||||
export LAB_FILTER |
||||
fi |
||||
echo "Parameter LAB_FILTER: $LAB_FILTER" >>$ERR |
||||
echo "\$LAB_FILTER=$LAB_FILTER" >>unload_params.txt |
||||
|
||||
|
||||
if [ "$STUDENT_FILTER" = "" ] |
||||
then |
||||
STUDENT_FILTER=" AND 1=1 " |
||||
export STUDENT_FILTER |
||||
fi |
||||
echo "Parameter STUDENT_FILTER: $STUDENT_FILTER" >>$ERR |
||||
echo "\$STUDENT_FILTER=$STUDENT_FILTER" >>unload_params.txt |
||||
|
||||
|
||||
if [ "$STUDENT_SOSPOS_FILTER" = "" ] |
||||
then |
||||
STUDENT_SOSPOS_FILTER=" AND 1=1 " |
||||
export STUDENT_SOSPOS_FILTER |
||||
fi |
||||
echo "Parameter STUDENT_SOSPOS_FILTER: $STUDENT_SOSPOS_FILTER" >>$ERR |
||||
echo "\$STUDENT_SOSPOS_FILTER=$STUDENT_SOSPOS_FILTER" >>unload_params.txt |
||||
|
||||
|
||||
echo "Parameter SOURCESYSTEM: $SOURCESYSTEM" >>$ERR |
||||
echo "\$SOURCESYSTEM=$SOURCESYSTEM" >>unload_params.txt |
||||
|
||||
#jdbc zum Entladen |
||||
if [ "$SX_CLIENT" = "jdbc" ] |
||||
then |
||||
java $JAVA_OPTS -cp $CP de.superx.bin.SxExtractor -logger:$LOGGER_PROPERTIES -dbproperties:$DB_PROPERTIES -xml:sos_v1_unload.xml -outFormat:$outFormat -delim:$DBDELIMITER -header:$header -database:$DATABASE -version:$VERSION -unload_params:unload_params.txt >>$ERR 2>&1 |
||||
|
||||
echo "Unload v1 beendet" |
||||
exit 0 |
||||
|
||||
fi |
||||
|
||||
|
@ -0,0 +1,190 @@
@@ -0,0 +1,190 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?> |
||||
<superx-unload version="4.0"> |
||||
<module id="sos" version="1.2b" systeminfo_id="7">SOS-Modul</module> |
||||
|
||||
<parameters> |
||||
<param name="SOS_UNL_COMPLETE" defaultValue="true" description="Komplett entladen"><comment>Sollen alle Datensätze entladen werden, oder nur die geänderten?(true,false).</comment></param> |
||||
<param name="VERSION" defaultValue="13" description="Datenbank-Version"><comment>SOSPOS-Version, möglich sind 6,7,8,9,10,11,12,13. Bei HISinOne wird sie automatisch gesetzt.</comment></param> |
||||
<param name="start_stud_sem" defaultValue="19911" description="Startsemester Studierende"><comment>Ab welchem Semester sollen Studierende entladen werden? z.B. 20011 für SS 2001</comment></param> |
||||
<param name="start_pruef_sem" defaultValue="19911" description="Startsemester Prüfungen"><comment>Ab welchem Semester sollen Prüfungen entladen werden? z.B. 20021 für SS 2002</comment></param> |
||||
<param name="SOS_UNL_ANON" defaultValue="false" description="Pseudonymisierung"><comment>Matrikelnummern pseudonymisieren (true, false). Muss bei Datenquelle HISinOne auf "false" gesetzt sein.</comment></param> |
||||
<param name="POS_PNR" defaultValue="0" ><comment>Welche Prüfungsnummern (Vor- Hauptprüfungen) sollen entladen werden? Wird bei Datenquelle HISinOne nicht ausgewertet.</comment></param> |
||||
<param name="LAB_FILTER" defaultValue=" AND (lab.panerk is null or lab.panerk != 'J') " ><comment>Weiterer Filter für Einzelprüfungen. Standardmäßig werden anerkannte Prüfungen nicht entladen. Wird bei Datenquelle HISinOne nicht ausgewertet.</comment></param> |
||||
<param name="STUDENT_FILTER" defaultValue=" AND 1=1 " ><comment>Filter für Studierende, um z.B. Teststudenten nicht zu entladen (nur HISinOne).</comment></param> |
||||
<param name="STUDENT_SOSPOS_FILTER" defaultValue=" AND 1=1 " ><comment>Filter für Studierende, um z.B. Teststudenten nicht zu entladen (nur sospos/co).</comment></param> |
||||
</parameters> |
||||
<sourcesystems> |
||||
<sourcesystem name="co" description="CampusOnline-Datenbank" /> |
||||
|
||||
</sourcesystems> |
||||
|
||||
<unload-job id="preparation2" extraction-table="" extraction-script="" database="" transfer-unload-file="" > |
||||
<comment> wichtige Konstanten aus SOS entladen, z.B. HISSOS-Version.</comment> |
||||
<!-- Ab der INFORMIX IDS 117 entfällt die database-Spezifika: --> |
||||
<extraction-sql sourcesystem="co" database="" version=""> |
||||
<![CDATA[ |
||||
|
||||
create table superx_sos (mtknr integer, mtknr_ldsg integer); |
||||
|
||||
]]> |
||||
</extraction-sql> |
||||
</unload-job> |
||||
|
||||
<unload-job id="preparation5" extraction-table="" extraction-script="" database="" transfer-unload-file="" > |
||||
<comment> wichtige Konstanten aus SOS entladen, z.B. HISSOS-Version.</comment> |
||||
|
||||
<extraction-sql sourcesystem="co" database="" version=""> |
||||
<![CDATA[ |
||||
insert into superx_sos(mtknr, mtknr_ldsg) |
||||
SELECT DISTINCT S.mtknr,S.mtknr |
||||
from sos S |
||||
where S.semester >= $start_stud_sem |
||||
|
||||
; |
||||
|
||||
]]> |
||||
</extraction-sql> |
||||
</unload-job> |
||||
|
||||
<unload-job id="sos_studenten" extraction-table="" extraction-script="" transfer-unload-file="unl/sos_studenten_v1.unl" > |
||||
<comment><comment>Studi-Sätze aus SOS. Die KFZ-Kennzeichen werden erst in SuperX umgeschlüsselt.</comment></comment> |
||||
|
||||
<extraction-sql sourcesystem="co" database="" version=""> |
||||
<![CDATA[ |
||||
|
||||
select superx_sos.mtknr_ldsg, |
||||
gebdat, |
||||
'',--gebort, |
||||
(CASE WHEN geschl='M' THEN '1' |
||||
when geschl='W' then '2' |
||||
else '' |
||||
end) as geschl, |
||||
exmdat, |
||||
status, |
||||
semester, |
||||
'' ,--poplz, |
||||
'' ,--poort, |
||||
immdat, |
||||
'' ,--beugrund as gdbu, |
||||
exmgrund as gdex, |
||||
staat, |
||||
'' as bland, |
||||
'' ,--hssem, |
||||
'' ,--urlsem, |
||||
hmkfzkz, |
||||
hmkfz, |
||||
semkfzkz, |
||||
semkfz, |
||||
hzbart, |
||||
hzbjahr, |
||||
hzbkfzkz, |
||||
hzbkfz, |
||||
hzbdatum, |
||||
hzbnote , |
||||
'' ,--hssemgewicht, |
||||
'' as urlsemgewicht, |
||||
erhskfz, |
||||
'' ,--erhsart, |
||||
erhssembrd, |
||||
erstsemhs, |
||||
'' ,--sperrart1, |
||||
'' ,--sperrart2, |
||||
'' ,--staatkez, |
||||
'' ,--ersthzbkfz, |
||||
'' ,--ersthzbkfzkz , |
||||
'',--ersthzbart |
||||
'',-- second_nationality, |
||||
'',-- practicalsemester, |
||||
'',-- kollegsemester, |
||||
'',-- discontinuation_sem_zahl, |
||||
'',-- studyrelatedjob, |
||||
'',-- studyrelatedinternship, |
||||
'',-- interruptiontype, |
||||
erhskfz,-- study_before_place_of_study, |
||||
'', -- study_before_country_of_study |
||||
'', --date AS org_role_valid_from, |
||||
'', -- date AS org_role_valid_to |
||||
'' AS sema, |
||||
'' AS gebasoll, |
||||
'' AS geba, |
||||
'' AS geba_sws, |
||||
'' AS ersthzbjahr, |
||||
'' AS ersthzbnote |
||||
FROM superx_sos,sos |
||||
where |
||||
sos.mtknr = superx_sos.mtknr |
||||
and sos.semester >= $start_stud_sem |
||||
; |
||||
|
||||
]]> |
||||
</extraction-sql> |
||||
</unload-job> |
||||
|
||||
<unload-job id="sos_faecher" extraction-table="" extraction-script="" transfer-unload-file="unl/sos_faecher_v1.unl" > |
||||
<comment>stg-Sätze aus sos</comment> |
||||
|
||||
<extraction-sql sourcesystem="co" database="" version=""> |
||||
<![CDATA[ |
||||
SELECT |
||||
S.mtknr_ldsg, |
||||
abschl, |
||||
stg, |
||||
'' ,--vert, |
||||
'' ,--schwp, |
||||
kzfa, |
||||
'' ,--fb, |
||||
pversion, |
||||
F.semester, |
||||
substr(F.stgnr,1,1), |
||||
substr(F.stgnr,length(F.stgnr),1), |
||||
F.status, |
||||
F.beugrund as gdbu, |
||||
F.endegrd as gdex, |
||||
F.stgsem, |
||||
F.hrst, |
||||
F.klinsem, |
||||
F.hssem, |
||||
'' ,--stuart, |
||||
'' ,--stutyp, |
||||
stufrm, |
||||
'' ,--stort, |
||||
F.ruebeudat, |
||||
'' ,--semgewicht, |
||||
'' ,--stggewicht, |
||||
'' ,--stgsemgewicht, |
||||
'' as hssemgewicht, |
||||
'' as urlsemgewicht, |
||||
'' ,--kohsem, |
||||
'' ,--lfdnr, |
||||
F.endedat, |
||||
F.anfdat, |
||||
'', --lepsem |
||||
'',-- -- district.astat nur h1 |
||||
'',-- -- country.astat nur h1 |
||||
'' , --Art der Promotion |
||||
'' as field_of_study, |
||||
primaerfach, |
||||
unikey, |
||||
null as individual_number_of_semesters, --individual RSZ |
||||
null as degree_program_id --Studiengang-ID |
||||
FROM stg F, superx_sos S |
||||
WHERE F.mtknr = S.mtknr |
||||
and F.status is not null |
||||
AND F.semester >= $start_stud_sem |
||||
; |
||||
]]> |
||||
</extraction-sql> |
||||
</unload-job> |
||||
|
||||
<unload-job id="finalize1" extraction-table="" extraction-script="" transfer-unload-file="" database="" version=""> |
||||
<comment>Beendigung</comment> |
||||
|
||||
<extraction-sql sourcesystem="co" database="" version=""> |
||||
<![CDATA[ |
||||
drop table superx_sos; |
||||
|
||||
]]> |
||||
</extraction-sql> |
||||
</unload-job> |
||||
|
||||
</superx-unload> |
@ -0,0 +1,127 @@
@@ -0,0 +1,127 @@
|
||||
--freemarker template |
||||
<#if SQLdialect='Postgres'> |
||||
<#assign texttype="text" /> |
||||
<#else> |
||||
EXECUTE PROCEDURE IFX_ALLOW_NEWLINE('T'); |
||||
<#assign texttype="lvarchar" /> |
||||
</#if> |
||||
<#assign newline="' |
||||
'" /> |
||||
|
||||
|
||||
create 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 (1, |
||||
'COSTAGE_TSG_GENERATE', |
||||
1, |
||||
'Teilstudiengänge Status aus MSG ausdehnen', |
||||
|
||||
310, |
||||
'',--doku link |
||||
0, |
||||
'1,Ja'|| ${newline} || '0,Nein', |
||||
'>0.3', |
||||
'Datenquelle, Entladestartzeitpunkt, -umfang', |
||||
310); |
||||
|
||||
|
||||
|
||||
--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)); |
||||
|
||||
|
||||
</#if> |
||||
|
||||
delete from tmp_konstanten where beschreibung in (select beschreibung from konstanten); |
||||
|
||||
|
||||
|
||||
insert into konstanten( apnr ,beschreibung, |
||||
defaultvalue, |
||||
description, |
||||
systeminfo_id, |
||||
doku_link, |
||||
read_only, |
||||
wertebereich, |
||||
ab_version, |
||||
gruppe, |
||||
sachgebiete_id ) |
||||
select 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; |
||||
|
Loading…
Reference in new issue