Browse Source

Neue Admin-Maske #4

rpta_0.2_Release
Daniel Quathamer 8 months ago
parent
commit
a9e9d19a88
  1. 145
      src-modules/module/rpta/conf/rpta.xml
  2. 7
      src-modules/module/rpta/masken/45000_felderinfo.unl
  3. 2
      src-modules/module/rpta/masken/45000_masken_felder_bez.unl
  4. 48
      src-modules/module/rpta/masken/45000_maskeninfo.unl
  5. 8
      src-modules/module/rpta/masken/45040_felderinfo.unl
  6. 1
      src-modules/module/rpta/masken/45040_maske_system_bez.unl
  7. 8
      src-modules/module/rpta/masken/45040_masken_felder_bez.unl
  8. 121
      src-modules/module/rpta/masken/45040_maskeninfo.unl
  9. 1
      src-modules/module/rpta/masken/45040_sachgeb_maske_bez.unl
  10. 256
      src-modules/module/rpta/schluesseltabellen/rpta_column_layout_sos_stud_astat_rsz_fuellen.sql
  11. 1
      src-modules/module/rpta/schluesseltabellen/rpta_column_type.unl
  12. 3
      src-modules/module/rpta/schluesseltabellen/rpta_format_code.unl
  13. 14
      src-modules/module/rpta/schluesseltabellen/sachgebiete_fuellen.sql
  14. 3
      src-modules/module/rpta/schluesseltabellen/sachgebiete_loeschen.sql
  15. 449
      src-modules/module/rpta/schluesseltabellen/studierende_datenblatt_virtuell.sql
  16. 95
      src-modules/module/rpta/upgrade/rpta_upgrade_man.sql

145
src-modules/module/rpta/conf/rpta.xml

@ -16,14 +16,13 @@ rightname="CS_BIA_STANDARDREPORTS_ADMIN[RPTA]" /> @@ -16,14 +16,13 @@ rightname="CS_BIA_STANDARDREPORTS_ADMIN[RPTA]" />
<column name="tid" type="SERIAL" size="" default="" notnull="true" description="tid" isKey="true"/>
<column name="uniquename" type="VARCHAR" size="255" default="" notnull="true" description="Schlüssel" />
<column name="caption" type="VARCHAR" size="255" default="" notnull="" description="Bezeichnung" />
<column name="srcfieldname" type="VARCHAR" size="255" default="" notnull="" description="Quellfeld" />
<column name="targetfieldname" type="VARCHAR" size="255" default="" notnull="" description="Zielfeld" currentlyUsed="false" />
<column name="column_type" type="INTEGER" size="" default="" notnull="" description="Spaltentyp" ><comment>Physische Spalte/Logische Spalte/Lookup</comment></column>
<column name="srcfieldname" type="VARCHAR" size="255" default="" notnull="true" description="Feldname (Quelle)" />
<column name="targetfieldname" type="VARCHAR" size="255" default="" notnull="true" description="Feldname (Ziel)" />
<column name="column_type" type="INTEGER" size="" default="" notnull="true" description="Spaltentyp" ><comment>Physische Spalte/Logische Spalte/Lookup</comment></column>
<column name="col_function" type="TEXT" size="255" default="" notnull="" description="Funktion" ><comment>Bei logischen Spalten/Lookup</comment></column>
<column name="is_visible" type="SMALLINT" size="2" default="" notnull="" description="Sichtbare Spalte" ></column>
<column name="visible_size" type="SMALLINT" size="2" default="" notnull="" description="Breite in Zeichen" ><comment>Bei String-Spalten</comment></column>
<column name="is_aggregate" type="SMALLINT" size="2" default="" notnull="" description="Aggregierte Spalte" ></column>
<column name="resultset_id" type="INTEGER" size="255" default="" notnull="" description="Resultset" />
<column name="custom" type="INTEGER" size="255" default="1" notnull="" description="Manuell erstellt" ><comment>0 = Auslieferung</comment></column>
<column name="description" type="TEXT" size="255" default="" notnull="" description="Beschreibung" ><comment>Erläuterungstext</comment></column>
</columns>
@ -64,6 +63,30 @@ rightname="CS_BIA_STANDARDREPORTS_ADMIN[RPTA]" /> @@ -64,6 +63,30 @@ rightname="CS_BIA_STANDARDREPORTS_ADMIN[RPTA]" />
</primaryKeys>
<indexes>
</indexes>
</table>
<table name="rpta_format_code" thema="Berichtsassistent" typ="Schlüsseltabelle"
releaseUnload="empty">
<description>Zahlen- oder Datumsformat</description>
<columns>
<column name="tid" type="SERIAL" size="" default="" notnull="true" description="tid" isKey="true"/>
<column name="uniquename" type="VARCHAR" size="255" default="" notnull="true" description="Schlüssel" />
<column name="caption" type="VARCHAR" size="255" default="" notnull="" description="Bezeichnung" />
<column name="sql_code" type="VARCHAR" size="255" default="" notnull="" description="Bezeichnung" />
</columns>
<primaryKeys><rs>
<row>
<fld name='table_cat'>superx</fld>
<fld name='table_schem'>superx</fld>
<fld name='table_name'>rpta_format_code</fld>
<fld name='column_name'>tid</fld>
<fld name='key_seq'>1</fld>
<fld name='pk_name'>rpta_format_code_pk</fld>
</row>
</rs>
</primaryKeys>
<indexes>
</indexes>
</table>
<table name="rpta_column_layout" thema="Berichtsassistent" typ="Schlüsseltabelle"
@ -75,6 +98,8 @@ rightname="CS_BIA_STANDARDREPORTS_ADMIN[RPTA]" /> @@ -75,6 +98,8 @@ rightname="CS_BIA_STANDARDREPORTS_ADMIN[RPTA]" />
<column name="caption" type="VARCHAR" size="255" default="" notnull="" description="Bezeichnung" />
<column name="resultset_id" type="INTEGER" size="255" default="" notnull="" description="Resultset" />
<column name="whereclause" type="TEXT" size="255" default="" notnull="false" description="Bedingung (optional)" />
<column name="description" type="TEXT" size="255" default="" notnull="" description="Beschreibung" ><comment>Erläuterungstext</comment></column>
<column name="userinfo_id" type="INTEGER" size="255" default="" notnull="" description="Angelegt von" ></column>
</columns>
<primaryKeys><rs>
@ -122,8 +147,14 @@ rightname="CS_BIA_STANDARDREPORTS_ADMIN[RPTA]" /> @@ -122,8 +147,14 @@ rightname="CS_BIA_STANDARDREPORTS_ADMIN[RPTA]" />
<columns>
<column name="tid" type="SERIAL" size="" default="" notnull="true" description="tid" isKey="true"/>
<column name="column_id" type="INTEGER" size="255" default="" notnull="" description="Spalte" />
<column name="layout_id" type="INTEGER" size="255" default="" notnull="" description="Layout" />
<column name="sortnr" type="SMALLINT" size="2" default="" notnull="" description="Sortiernr." />
<column name="layout_id" type="INTEGER" size="255" default="" notnull="" description="Layout" isKey="true" />
<column name="sortnr" type="SMALLINT" size="2" default="" notnull="" description="Sortiernr." sortable="true"/>
<column name="is_visible" type="SMALLINT" size="2" default="" notnull="" description="Sichtbare Spalte" ></column>
<column name="visible_size" type="SMALLINT" size="2" default="" notnull="" description="Breite in Zeichen" ><comment>Bei String-Spalten</comment></column>
<column name="format_code_id" type="INTEGER" size="255" default="" notnull="" description="Format-Code" ><comment>Bei DECIMAL- und Datumsspalten</comment></column>
<column name="targetfieldname" type="VARCHAR" size="255" default="" notnull="" description="Zielfeld" currentlyUsed="false" />
<column name="caption" type="VARCHAR" size="255" default="" notnull="" description="Bezeichnung der Spalte" />
<column name="description" type="TEXT" size="255" default="" notnull="" description="Beschreibung" ><comment>Erläuterungstext</comment></column>
</columns>
<primaryKeys><rs>
@ -147,12 +178,12 @@ rightname="CS_BIA_STANDARDREPORTS_ADMIN[RPTA]" /> @@ -147,12 +178,12 @@ rightname="CS_BIA_STANDARDREPORTS_ADMIN[RPTA]" />
<columns>
<column name="tid" type="SERIAL" size="" default="" notnull="true" description="tid" isKey="true"/>
<column name="caption" type="VARCHAR" size="255" default="" notnull="" description="Bezeichnung" />
<column name="uniquename" type="VARCHAR" size="255" default="" notnull="" description="Bezeichnung" />
<column name="fieldclause" type="TEXT" size="255" default="" notnull="false" description="Defaultwert" />
<column name="joinclause" type="TEXT" size="255" default="" notnull="false" description="Defaultwert" />
<column name="whereclause" type="TEXT" size="255" default="" notnull="false" description="Einheit" />
<column name="uniquename" type="VARCHAR" size="255" default="" notnull="true" description="Schlüssel" />
<column name="fieldclause" type="TEXT" size="255" default="" notnull="false" description="Spalten (physisch)" />
<column name="joinclause" type="TEXT" size="255" default="" notnull="false" description="Tabellen (physisch)" />
<column name="whereclause" type="TEXT" size="255" default="" notnull="false" description="Bedingung" />
<column name="systeminfo_id" type="INTEGER" size="255"
default="" notnull="false" description="Quellsystem">
default="" notnull="true" description="Komponente">
</column>
</columns>
@ -167,7 +198,10 @@ rightname="CS_BIA_STANDARDREPORTS_ADMIN[RPTA]" /> @@ -167,7 +198,10 @@ rightname="CS_BIA_STANDARDREPORTS_ADMIN[RPTA]" />
</row>
</rs>
</primaryKeys>
<indexes>
<indexes><index name="ix_rpta_resultset" type="unique">
<index-column name="uniquename"/>
<index-column name="systeminfo_id"/>
</index>
</indexes>
</table>
<table name="rpta_report_property" thema="Berichtsassistent" typ="Datentabelle"
@ -221,13 +255,13 @@ parent="Berichtsassistent">Abfragen zur Administration von Berichtsassistent </t @@ -221,13 +255,13 @@ parent="Berichtsassistent">Abfragen zur Administration von Berichtsassistent </t
<path>$RPTA_PFAD/masken</path>
</src>
</maske>
<!--
<maske tid="45030" name="Tabellenverwaltung suchen" thema="Administration Berichtsassistent">
<description>Berichtsassistent verwalten</description>
<maske tid="45040" name="Spaltenlayouts verwalten" thema="Administration Berichtsassistent">
<description>Spaltenlayouts verwalten</description>
<src>
<path>$RPTA_PFAD/masken</path>
</src>
</maske>-->
</maske>
</masken>
<data-integrity>
@ -236,10 +270,15 @@ parent="Berichtsassistent">Abfragen zur Administration von Berichtsassistent </t @@ -236,10 +270,15 @@ parent="Berichtsassistent">Abfragen zur Administration von Berichtsassistent </t
displayType="select" visibleFields="caption" format="%s">
<relation-column from="tid" to="column_type" />
</relation>
x<relation from="rpta_resultset" to="rpta_column_layout" delete="FALSE"
<relation from="rpta_resultset" to="rpta_column_layout" delete="FALSE"
displayType="select" visibleFields="caption" format="%s">
<relation-column from="tid" to="resultset_id" />
</relation>
<relation from="userinfo" to="rpta_column_layout" delete="FALSE"
displayType="select" visibleFields="benutzer" format="%s">
<relation-column from="tid" to="userinfo_id" />
</relation>
<relation from="rpta_resultset" to="rpta_column" delete="FALSE"
displayType="select" visibleFields="caption" format="%s">
<relation-column from="tid" to="resultset_id" />
@ -258,7 +297,10 @@ x<relation from="rpta_resultset" to="rpta_column_layout" delete="FALSE" @@ -258,7 +297,10 @@ x<relation from="rpta_resultset" to="rpta_column_layout" delete="FALSE"
displayType="select" visibleFields="caption" format="%s">
<relation-column from="tid" to="column_id" />
</relation>
<relation from="rpta_format_code" to="rpta_column2layout" delete="FALSE"
displayType="select" visibleFields="caption" format="%s">
<relation-column from="tid" to="format_code_id" />
</relation>
</data-integrity>
</database>
@ -277,9 +319,16 @@ x<relation from="rpta_resultset" to="rpta_column_layout" delete="FALSE" @@ -277,9 +319,16 @@ x<relation from="rpta_resultset" to="rpta_column_layout" delete="FALSE"
<install>
<install-step name="Füllen der Modul-Tabellen">
<action error="stop">
<action>
<loadtable refresh="true" delimiter="^" header="false" tabname="rpta_column_type"><file path="$RPTA_PFAD/schluesseltabellen/rpta_column_type.unl"/></loadtable>
<loadtable refresh="true" delimiter="^" header="false" tabname="rpta_format_code"><file path="$RPTA_PFAD/schluesseltabellen/rpta_format_code.unl"/></loadtable>
</action>
<action>
<nativeaction sql="" scriptfile="$RPTA_PFAD/schluesseltabellen/sachgebiete_fuellen.sql" database=""/>
<nativeaction sql="" scriptfile="$RPTA_PFAD/schluesseltabellen/sx_stylesheets_einfuegen.sql" database=""/>
<nativeaction sql="" scriptfile="$RPTA_PFAD/schluesseltabellen/studierende_datenblatt_virtuell.sql" database=""/>
<nativeaction sql="" scriptfile="$RPTA_PFAD/schluesseltabellen/rpta_column_layout_sos_stud_astat_rsz_fuellen.sql" database=""/>
<nativeaction sql="" scriptfile="$RPTA_PFAD/schluesseltabellen/rpta_column_layout_sos_stud_astat_schnellmeldung_fuellen.sql" database=""/>
</action>
</install-step>
</install>
@ -289,7 +338,16 @@ x<relation from="rpta_resultset" to="rpta_column_layout" delete="FALSE" @@ -289,7 +338,16 @@ x<relation from="rpta_resultset" to="rpta_column_layout" delete="FALSE"
<upgrade-step>
<action error="stop">
<loadtable refresh="true" delimiter="^" header="false" tabname="rpta_column_type"><file path="$RPTA_PFAD/schluesseltabellen/rpta_column_type.unl"/></loadtable>
<loadtable refresh="true" delimiter="^" header="false" tabname="rpta_format_code"><file path="$RPTA_PFAD/schluesseltabellen/rpta_format_code.unl"/></loadtable>
</action>
<action>
<nativeaction sql="" scriptfile="$RPTA_PFAD/schluesseltabellen/sachgebiete_fuellen.sql" database=""/>
<nativeaction sql="" scriptfile="$RPTA_PFAD/schluesseltabellen/sx_stylesheets_einfuegen.sql" database=""/>
<nativeaction sql="" scriptfile="$RPTA_PFAD/upgrade/rpta_upgrade_man.sql" database=""/>
<nativeaction sql="" scriptfile="$RPTA_PFAD/schluesseltabellen/studierende_datenblatt_virtuell.sql" database=""/>
<nativeaction sql="" scriptfile="$RPTA_PFAD/schluesseltabellen/rpta_column_layout_sos_stud_astat_rsz_fuellen.sql" database=""/>
<nativeaction sql="" scriptfile="$RPTA_PFAD/schluesseltabellen/rpta_column_layout_sos_stud_astat_schnellmeldung_fuellen.sql" database=""/>
</action>
<action>
@ -300,6 +358,8 @@ x<relation from="rpta_resultset" to="rpta_column_layout" delete="FALSE" @@ -300,6 +358,8 @@ x<relation from="rpta_resultset" to="rpta_column_layout" delete="FALSE"
<uninstall-step name="Deinstalliere Schlüssel">
<action error="stop">
<nativeaction sql="" scriptfile="$RPTA_PFAD/schluesseltabellen/sachgebiete_loeschen.sql" database=""/>
</action>
@ -327,6 +387,7 @@ x<relation from="rpta_resultset" to="rpta_column_layout" delete="FALSE" @@ -327,6 +387,7 @@ x<relation from="rpta_resultset" to="rpta_column_layout" delete="FALSE"
<field-selection complete="false" />
<customfield name="tid" nullFieldValue="" />
<customfield name="caption" nullFieldValue="" visibleSize="30" />
<customfield name="uniquename" nullFieldValue="" visibleSize="30" />
<customfield type="link" name="Details" path="/superx/edit/rpta/rpta_column_layout_edit.jsp" linkid="tid"/>
</form>
@ -348,20 +409,52 @@ mode="full"> @@ -348,20 +409,52 @@ mode="full">
<field-selection complete="false" />
<customfield name="tid" />
<customfield name="caption" visibleSize="50" nullFieldValue="" />
<customfield name="uniquename" visibleSize="50" nullFieldValue="" />
<customfield name="resultset_id" visibleSize="50" nullFieldValue="" />
<customfield name="whereclause" visibleSize="50" nullFieldValue="" />
<customfield name="description" visibleSize="50" nullFieldValue="" />
<customfield name="Spalten" type="subform" multipart="false" autoUpdate="false"
maxRows="*" table="rpta_column2layout" parentField="tid" childField="layout_id"
orderBy="" allowNew="true"
mode="edit_delete">
orderBy="sortnr" allowNew="true"
mode="full">
<field-selection complete="false" />
<customfield name="layout_id" type="hidden" overrideValue="tid" />
<customfield name="column_id" nullFieldValue="" visibleSize="5" />
<customfield name="sortnr" nullFieldValue="" visibleSize="10" />
<customfield type="link" name="Details" path="/superx/edit/rpta/rpta_column_edit.jsp"
linkVar="tid" linkid="column_id" mandatoryFilter="" mandatoryFilterVar=""/>
<customfield type="link" name="Details" path="/superx/edit/rpta/rpta_column2layout_edit.jsp"
linkVar="tid" linkid="tid" mandatoryFilter="" mandatoryFilterVar=""/>
</customfield>
</form>
<form name="rpta_column2layout_edit"
table="rpta_column2layout"
path="/edit/rpta/rpta_column2layout_edit.jsp"
followUp=""
caption="Spaltenlayouts bearbeiten"
orderBy="sortnr"
gotoHt=""
helpfile=""
maxRows="1"
mode="full">
<description>In diesem Formular können Sie Spaltenlayouts verwalten.</description>
<filters>
<filter mandatory="true" type="equals">tid</filter>
</filters>
<field-selection complete="false" />
<customfield name="tid" />
<customfield name="caption" visibleSize="50" nullFieldValue="" />
<customfield name="column_id" visibleSize="50" nullFieldValue="" />
<customfield name="layout_id" visibleSize="50" nullFieldValue="" />
<customfield name="sortnr" visibleSize="50" nullFieldValue="" />
<customfield name="is_visible" visibleSize="50" nullFieldValue="" />
<customfield name="visible_size" visibleSize="50" nullFieldValue="" />
<customfield name="format_code_id" visibleSize="50" nullFieldValue="" />
<customfield name="description" visibleSize="50" nullFieldValue="" />
</form>
<form name="rpta_resultset_list"
table="rpta_resultset"
@ -379,6 +472,7 @@ mode="full"> @@ -379,6 +472,7 @@ mode="full">
<field-selection complete="false" />
<customfield name="tid" nullFieldValue="" />
<customfield name="caption" nullFieldValue="" visibleSize="30" />
<customfield name="uniquename" nullFieldValue="" visibleSize="30" />
<customfield type="link" name="Details" path="/superx/edit/rpta/rpta_resultset_edit.jsp" linkid="tid"/>
</form>
<form name="rpta_resultset_edit"
@ -399,6 +493,7 @@ mode="full"> @@ -399,6 +493,7 @@ mode="full">
<field-selection complete="false" />
<customfield name="tid" />
<customfield name="caption" visibleSize="50" nullFieldValue="" />
<customfield name="uniquename" nullFieldValue="" visibleSize="30" />
<customfield name="fieldclause" visibleSize="50" nullFieldValue="" />
<customfield name="joinclause" visibleSize="50" nullFieldValue="" />
<customfield name="whereclause" visibleSize="10" nullFieldValue="" />
@ -445,7 +540,9 @@ mode="full"> @@ -445,7 +540,9 @@ mode="full">
<customfield name="tid" />
<customfield name="caption" visibleSize="50" nullFieldValue="" />
<customfield name="uniquename" visibleSize="50" nullFieldValue="" />
<customfield name="resultset_id" visibleSize="50" nullFieldValue="" />
<customfield name="srcfieldname" visibleSize="50" nullFieldValue="" />
<customfield name="targetfieldname" visibleSize="50" nullFieldValue="" />
<customfield name="column_type" visibleSize="10" nullFieldValue="" />
<customfield name="col_function" visibleSize="100" nullFieldValue="" />
<customfield name="is_visible" visibleSize="10" nullFieldValue="" />

7
src-modules/module/rpta/masken/45000_felderinfo.unl

@ -1,11 +1,9 @@ @@ -1,11 +1,9 @@
45000^Spaltenlayout^3000^350^-1^140^180^1^char^30^1^1^<<SQL>>SELECT \
uniquename,\
45000^Spaltenlayout^3000^350^-1^140^180^1^integer^30^1^1^<<SQL>>SELECT tid,\
caption,\
resultset_id\
FROM rpta_column_layout \
order by 2\
;^^<<SQL>>SELECT \
uniquename,\
;^^<<SQL>>SELECT tid,\
caption,\
resultset_id\
FROM rpta_column_layout \
@ -15,7 +13,6 @@ order by 2\ @@ -15,7 +13,6 @@ order by 2\
45002^Fächer^30^0^0^130^200^6^char^1000^0^12^<<SQL>> select tid,name,sortnr from sichten where art='Fächer-Sicht' order by 3,2;^ ^ ^
45003^Abschluss^40^0^0^100^200^3^char^1500^0^1^<<SQL>> select apnr, druck from cifx where key=35 order by 2;^ ^ ^
45004^bis Fachsemester^1000^300^-1^200^100^1^integer^30^0^0^^ ^ ^
45005^Spaltenlayouts bearbeiten^110^0^0^140^80^1^char^255^0^18^ ^ ^<<SQL>> select '../edit/rpta/rpta_column_layout_list.jsp' from xdummy;^
45006^Hochschulzugangsberechtigung^120^300^-1^200^200^1^sql^30^0^1^hs_zugangsber^apnr, eintrag^ ^
45007^Bis Semester^20^350^-1^140^80^1^integer^30^0^1^<<SQL>> select tid, eintrag from semester order by tid DESC;^ ^<<SQL>> select tid,eintrag from semester where today() between sem_beginn and sem_ende;^
45008^Staatsangehörigkeit^150^0^0^140^150^10^char^30^0^12^<<SQL>> select tid,name,sortnr from sichten where art='SOS-Staaten-Sicht' order by 3,2;^ ^ ^

2
src-modules/module/rpta/masken/45000_masken_felder_bez.unl

@ -3,13 +3,11 @@ @@ -3,13 +3,11 @@
45000^45002^
45000^45003^
45000^45004^
45000^45005^
45000^45006^
45000^45007^
45000^45008^
45000^45009^
45000^45011^
45000^45012^
45000^45013^
45000^45018^
45000^45022^

48
src-modules/module/rpta/masken/45000_maskeninfo.unl

@ -38,23 +38,25 @@ select L.uniquename,\ @@ -38,23 +38,25 @@ select L.uniquename,\
from rpta_resultset R, rpta_column_layout L\
where L.resultset_id=R.tid\
and R.uniquename='${basetable.name}'\
and L.uniquename=<<Spaltenlayout>>;\
and L.tid=<<Spaltenlayout>>;\
\
]]></sqlvar>\
<sqlvar name="columns" type="hashsequence"><![CDATA[\
SELECT C.srcfieldname as colname,\
SELECT C.srcfieldname,\
(case when string_not_null(C.targetfieldname)='' then C.srcfieldname else C.targetfieldname end) as targetfieldname,\
T.uniquename as coltype,\
C.is_aggregate,\
C.caption,\
C.is_visible,\
C.visible_size as visible_width,\
(case when string_not_null(CL.caption)='' then C.caption else CL.caption end) as caption,\
CL.is_visible,\
CL.visible_size as visible_width,\
(select F.sql_code from rpta_format_code F where F.tid=CL.format_code_id) as format_sql,\
C.col_function as colfunction,\
C.description\
(case when string_not_null(CL.description)='' then C.description else CL.description end) as description\
FROM rpta_column_layout L, rpta_column2layout CL, rpta_column C, rpta_column_type T\
where L.tid=CL.layout_id\
and C.tid=CL.column_id\
and T.tid=C.column_type\
and L.uniquename=<<Spaltenlayout>>\
and L.tid=<<Spaltenlayout>>\
order by CL.sortnr\
;\
]]></sqlvar>\
@ -75,6 +77,7 @@ order by CL.sortnr\ @@ -75,6 +77,7 @@ order by CL.sortnr\
/* <#assign filter = filter + " and '' || ca12_staat in "+Staatsangehörigkeit.allNeededKeysList /> --<<Staatsangehörigkeit>> */\
/* <#assign filter = filter + " and stg in "+Fächer.allNeededKeysList /> --<<Fächer>> */\
\
<#if columns?has_content>\
\
<#if basetable.is_virtual==1>\
\
@ -94,11 +97,13 @@ select \ @@ -94,11 +97,13 @@ select \
--zuerst die Basisdaten:\
<#foreach column in columns>\
<#if column.coltype="physicalColumn">\
${column.colname},\
${column.srcfieldname},\
<#elseif column.coltype="logicalColumn">\
${column.colfunction} as ${column.colname},\
${column.colfunction} as ${column.targetfieldname},\
<#elseif column.coltype="lookupColumn">\
(${column.colfunction}) as ${column.colname},\
(${column.colfunction}) as ${column.targetfieldname},\
<#elseif column.coltype="computedColumn">\
null::decimal(19,6) as ${column.targetfieldname},\
</#if>\
</#foreach>\
null::char(1) as dummycol\
@ -117,13 +122,13 @@ select \ @@ -117,13 +122,13 @@ select \
<#foreach column in columns>\
<#if column.is_aggregate==0>\
<#assign groupby=groupby+1 />\
${column.colname},\
${column.targetfieldname},\
</#if>\
</#foreach>\
--dann die Aggregate:\
<#foreach column in columns>\
<#if column.is_aggregate==1>\
sum(${column.colname}) as ${column.colname},\
<#if column.is_aggregate==1 && column.coltype!="computedColumn">\
sum(${column.targetfieldname}) as ${column.targetfieldname},\
</#if>\
</#foreach>\
null::char(1) as dummycol\
@ -139,7 +144,16 @@ group by\ @@ -139,7 +144,16 @@ group by\
\
select \
<#foreach column in columns>\
${column.colname}\
<#assign format_sql="" />\
<#if column.format_sql?string != "">\
<#assign format_sql=column.format_sql />\
</#if>\
\
<#if column.coltype=="computedColumn">\
(${column.colfunction})${format_sql} as ${column.targetfieldname}\
<#else>\
${column.targetfieldname}${format_sql}\
</#if>\
<#if column_has_next>,</#if>\
</#foreach>\
from tmp_stud2\
@ -154,7 +168,9 @@ drop table if exists ${basetable.runtime_tablename};\ @@ -154,7 +168,9 @@ drop table if exists ${basetable.runtime_tablename};\
</#if>\
\
\
drop table if exists tmp_stud;^--Freemarker Template\
drop table if exists tmp_stud;\
\
</#if> --wenn columns?has_content^--Freemarker Template\
XIL List\
sizable_columns horizontal_scrolling\
drop_and_delete movable_columns \
@ -165,4 +181,4 @@ Column CID=0 heading_text="${column.caption}" center_heading explanation="${colu @@ -165,4 +181,4 @@ Column CID=0 heading_text="${column.caption}" center_heading explanation="${colu
row_selectable heading_platform readonly\
width=${column.visible_width} text_size=60\
</#foreach>\
@@@^Studienfach^Anzahl bzw. Anteil^Datenblatt Studierendenstatistik^drop table if exists tmp_stud2; drop table if exists tmp_stud3;^^2^850^540^^1^^
@@@^Studienfach^Anzahl bzw. Anteil^Datenblatt Studierendenstatistik^drop table if exists tmp_stud2; drop table if exists tmp_stud3;^^2^850^540^^1^<<SQL>>SELECT description FROM rpta_column_layout where tid=<<Spaltenlayout>>;^

8
src-modules/module/rpta/masken/45040_felderinfo.unl

@ -0,0 +1,8 @@ @@ -0,0 +1,8 @@
45040^Benutzer/in^50^0^0^150^200^1^integer^200^0^1^<<SQL>> select tid,nvl(name,benutzer) from userinfo order by 2;^hidden^^
45041^Spaltenlayout^10^0^0^150^80^1^integer^200^0^1^<<SQL>> select tid,caption from rpta_column_layout where 1=1 /* and resultset_id=<<Virtuelle Tabelle>> */ order by 2;^^^
45042^Spaltenlayouts verwalten^110^0^0^140^80^1^char^255^0^18^ ^ ^<<SQL>> select '../edit/rpta/rpta_column_layout_list.jsp' from xdummy;^
45043^Stichwort^20^0^0^150^150^1^sql^50^0^0^^^^
45044^Komponente^1^0^0^150^200^1^integer^200^0^1^<<SQL>> select tid,name from systeminfo order by 2;^ ^^
45045^Virtuelle Tabellen bearbeiten^100^0^0^140^80^1^char^255^0^18^ ^ ^<<SQL>> select '../edit/rpta/rpta_resultset_list.jsp' from xdummy;^
45046^Virtuelle Tabelle^5^0^0^150^200^1^integer^200^0^1^<<SQL>> select tid,caption from rpta_resultset where 1=1 /* and systeminfo_id=<<Komponente>> */ order by 2;^^^
45047^Spaltentyp^200^0^0^150^200^1^integer^200^0^1^<<SQL>> select tid,caption from rpta_column_type order by 2;^^ ^

1
src-modules/module/rpta/masken/45040_maske_system_bez.unl

@ -0,0 +1 @@ @@ -0,0 +1 @@
45040^330^

8
src-modules/module/rpta/masken/45040_masken_felder_bez.unl

@ -0,0 +1,8 @@ @@ -0,0 +1,8 @@
45040^45040^
45040^45041^
45040^45042^
45040^45043^
45040^45044^
45040^45045^
45040^45046^
45040^45047^

121
src-modules/module/rpta/masken/45040_maskeninfo.unl

@ -0,0 +1,121 @@ @@ -0,0 +1,121 @@
45040^Spalten und Spaltenlayouts verwalten^--Autor: D. Quathamer\
--Datum: 15.3.2024\
--freemarker template\
create temp table tmp_rpta_column (\
ord smallint,\
tid INTEGER , \
uniquename varchar(255),\
caption varchar(255),\
srcfieldname varchar(255),\
column_type integer,\
column_type_str varchar(255),\
col_function text,\
is_aggregate smallint,\
resultset_id integer,\
resultset_str varchar(255),\
systeminfo_str varchar(255),\
custom integer ,\
description text,\
targetfieldname varchar(255),\
nextedit varchar(255)\
);\
insert into tmp_rpta_column (ord,\
tid,\
uniquename,\
caption,\
srcfieldname,\
column_type_str,\
col_function,\
is_aggregate,\
resultset_id,\
custom,\
description,\
targetfieldname,\
nextedit) \
select 1 as ord,\
C.tid,\
C.uniquename,\
C.caption,\
C.srcfieldname,\
T.caption as column_type,\
C.col_function,\
C.is_aggregate,\
C.resultset_id,\
C.custom,\
C.description,\
C.targetfieldname,\
('../edit/rpta/rpta_column_edit.jsp|tid=' || C.tid)::varchar(255)\
FROM rpta_column C, rpta_column_type T\
where T.tid=C.column_type\
/* and C.resultset_id=<<Virtuelle Tabelle>> */\
/* and C.caption like '%<<Stichwort>>%' */\
/* and C.tid in (select P.column_id from rpta_column2layout P where P.layout_id=<<Spaltenlayout>> )*/\
/* and C.resultset_id in (select R.tid from rpta_resultset R where R.systeminfo_id=<<Komponente>> )*/\
/* and C.column_type=<<Spaltentyp>> */\
;\
\
\
\
update tmp_rpta_column set resultset_str=R.caption\
from rpta_resultset R\
where R.tid=tmp_rpta_column.resultset_id;\
\
\
\
insert into tmp_rpta_column (ord,\
caption, \
nextedit) \
select 10, --ord\
'Neuer Eintrag',\
nvl(('../edit/qa/rpta_column_edit.jsp|tid=' || max(tid)+1)::varchar(255),'../edit/qa/rpta_column_edit.jsp'::varchar(255))\
from rpta_column\
;\
\
\
\
\
\
select \
caption,\
uniquename,\
resultset_str,\
srcfieldname,\
column_type_str,\
-- col_function,\
is_aggregate,\
custom,\
-- description,\
-- targetfieldname\
nextedit \
\
from tmp_rpta_column\
order by ord,caption ,uniquename\
;^XIL List\
drop_and_delete movable_columns sizable_columns horizontal_scrolling\
white_space_color=COLOR_WHITE fixed_columns=2\
min_heading_height=35\
Column CID=0 heading_text="Name" center_heading\
row_selectable col_selectable heading_platform readonly\
width=50 text_size=100\
Column CID=0 heading_text="Schlüssel" center_heading\
row_selectable col_selectable heading_platform readonly\
width=50 text_size=100\
Column CID=1 heading_text="Virtuelle Tabelle" center_heading\
row_selectable col_selectable heading_platform readonly\
width=150 text_size=200\
Column CID=1 heading_text="Quellfeld" center_heading\
row_selectable col_selectable heading_platform readonly\
width=10 text_size=200\
Column CID=1 heading_text="Spaltentyp" center_heading\
row_selectable col_selectable heading_platform readonly\
width=5 text_size=200\
Column CID=1 heading_text="Ist Aggregat?" center_heading\
row_selectable col_selectable heading_platform readonly\
width=5 text_size=200\
Column CID=1 heading_text="Individuelle Spalte" center_heading\
row_selectable col_selectable heading_platform readonly\
width=5 text_size=200\
Column CID=1 heading_text="Bearbeiten" center_heading\
row_selectable col_selectable heading_platform readonly\
width=5 text_size=200\
@@@^^^Spaltendefinitionen und deren Zuordnung zu Berichten verwalten.^drop table tmp_rpta_column;^^1^440^360^0^1^^

1
src-modules/module/rpta/masken/45040_sachgeb_maske_bez.unl

@ -0,0 +1 @@ @@ -0,0 +1 @@
331^45040^

256
src-modules/module/rpta/schluesseltabellen/rpta_column_layout_sos_stud_astat_rsz_fuellen.sql

@ -0,0 +1,256 @@ @@ -0,0 +1,256 @@
--freemarker template
<sqlvars>
<sqlvar name="sos_stud_astat_exists">
select count(*) from rpta_resultset where uniquename='sos_stud_astat';
</sqlvar>
</sqlvars>
<#assign rpta_column_layout = {"uniquename":"sos_stud_astat_rsz",
"caption":"MKW-Abfrage_Studierende_RSZ",
"rpta_resultset":"sos_stud_astat",
"whereclause":"fach_sem_zahl <= dim_studiengang_regel and dim_studiengang_regel between 1 and 20 and studiengang_nr <=2 and fach_nr <=4",
"description":"Fachbelegungen: 1. & 2. Studiengang; 1.-4. Fach; nur Studiengänge mit Angabe einer Regelstudienzeit"
}
/>
<#assign rpta_columns = [
{"uniquename":"sos_k_stort_astat",
"caption":"Hochschulnummer Statistik",
"srcfieldname":"sos_k_stort_astat",
"column_type":"physicalColumn",
"col_function":"",
"is_visible":"1",
"visible_size":"10",
"is_aggregate":"0",
"description":"Amtliche Standortnummer"
},
{"uniquename":"dim_studiengang_stg_astat",
"caption":"HSF-Schlüssel",
"srcfieldname":"dim_studiengang_stg_astat",
"column_type":"physicalColumn",
"col_function":"",
"is_visible":"1",
"visible_size":"10",
"is_aggregate":"0",
"description":"Amtliches Fach"
},
{"uniquename":"sos_k_stufrm_astat",
"caption":"Art des Studiums",
"srcfieldname":"sos_k_stufrm_astat",
"column_type":"physicalColumn",
"col_function":"",
"is_visible":"1",
"visible_size":"10",
"is_aggregate":"0",
"description":"Amtliche Studienform"
},
{"uniquename":"dim_studiengang_abschluss_astat",
"caption":"Abschlussschlüssel Statistik NRW",
"srcfieldname":"dim_studiengang_abschluss_astat",
"column_type":"physicalColumn",
"col_function":"",
"is_visible":"1",
"visible_size":"10",
"is_aggregate":"0",
"description":"Amtlicher Abschluss"
},
{"uniquename":"sos_k_stutyp_astat",
"caption":"Vollzeit / Teilzeit / ausbildungsintegriert / praxisintegriert / berufsintegriert",
"srcfieldname":"sos_k_stutyp_astat",
"column_type":"physicalColumn",
"col_function":"",
"is_visible":"1",
"visible_size":"10",
"is_aggregate":"0",
"description":"Amtlicher Studiumstyp"
},
{"uniquename":"dim_studiengang_regel",
"caption":"Angabe der Regelstudienzeit",
"srcfieldname":"dim_studiengang_regel",
"column_type":"physicalColumn",
"col_function":"",
"is_visible":"1",
"visible_size":"10",
"is_aggregate":"0",
"description":"Regelstudienzeit in Semestern"
},
{"uniquename":"summe",
"caption":"Anzahl der Studierenden in der Regelstudienzeit",
"srcfieldname":"summe",
"column_type":"physicalColumn",
"col_function":"sum",
"is_visible":"1",
"visible_size":"5",
"is_aggregate":"1",
"description":"Summe der Studierenden mit Fachsemester kleiner oder gleich der Regelstudienzeit"
}
]
/>
---ab hier nicht mehr ändern:
CREATE temp TABLE tmp_rpta_column
(
uniquename varchar(255) NOT NULL,
caption varchar(255),
srcfieldname varchar(255),
targetfieldname varchar(255),
column_type integer,
col_function text,
is_visible smallint,
visible_size smallint,
is_aggregate smallint,
resultset_id integer,
sortnr integer,
description TEXT
);
CREATE temp TABLE tmp_rpta_column_layout
(
uniquename varchar(255) NOT NULL,
caption varchar(255),
resultset_id integer,
whereclause text,
description text
);
insert into tmp_rpta_column_layout(
resultset_id,
uniquename,
caption,
whereclause,
description
)
select tid,
'${rpta_column_layout.uniquename}',
'${rpta_column_layout.caption}',
'${rpta_column_layout.whereclause}',
'${rpta_column_layout.description}'
FROM rpta_resultset
where uniquename='${rpta_column_layout.rpta_resultset}';
<#assign sortnr=0 />
<#foreach column in rpta_columns>
<#assign sortnr=sortnr +1 />
INSERT INTO tmp_rpta_column
(resultset_id,
uniquename,
caption,
srcfieldname,
targetfieldname,
column_type,
col_function,
is_visible,
visible_size,
is_aggregate,
sortnr,
description
)
select R.tid,
'${column.uniquename}',
'${column.caption}',
'${column.srcfieldname}',
<#if !column.targetfieldname?exists || column.targetfieldname=="">null::varchar <#else>'${column.targetfieldname}' </#if>,
T.tid as column_type,
'${column.col_function}',
${column.is_visible},
${column.visible_size},
${column.is_aggregate},
${sortnr*10},
'${column.description}'
FROM rpta_resultset R, rpta_column_type T
where R.uniquename='${rpta_column_layout.rpta_resultset}'
and T.uniquename='${column.column_type}';
</#foreach>
delete from rpta_column2layout
where layout_id in (select L.tid
from rpta_column_layout L,rpta_resultset R
where R.tid=L.resultset_id
and R.uniquename='${rpta_column_layout.rpta_resultset}'
and L.uniquename='${rpta_column_layout.uniquename}'
)
;
delete from rpta_column_layout
where resultset_id in (select tid
FROM rpta_resultset
where uniquename='${rpta_column_layout.rpta_resultset}')
and uniquename in (select uniquename from tmp_rpta_column_layout)
;
insert into rpta_column_layout
(uniquename,
caption,
resultset_id,
whereclause,
description)
select uniquename,
caption,
resultset_id,
whereclause,
description
FROM tmp_rpta_column_layout;
select * into temp tmp_rpta_column2 from rpta_column ;
INSERT INTO rpta_column
(resultset_id,
uniquename,
caption,
srcfieldname,
targetfieldname,
column_type,
col_function,
is_aggregate,
description,
custom
)
select
resultset_id,
uniquename,
caption,
srcfieldname,
targetfieldname,
column_type,
col_function,
is_aggregate,
description,
0 as custom
from tmp_rpta_column
where (resultset_id,uniquename) not in
(select T.resultset_id,T.uniquename
from tmp_rpta_column2 T)
;
drop table tmp_rpta_column2;
insert into rpta_column2layout(column_id,
layout_id,
sortnr,
is_visible,
visible_size,
caption,
description)
select C.tid as column_id,
L.tid as layout_id,
T.sortnr,
T.is_visible,
T.visible_size,
T.caption,
T.description
FROM rpta_column C, rpta_column_layout L, tmp_rpta_column T
where C.uniquename=T.uniquename
and C.resultset_id=T.resultset_id
and L.uniquename='${rpta_column_layout.uniquename}'
and L.resultset_id=T.resultset_id
;
drop table tmp_rpta_column;
drop TABLE tmp_rpta_column_layout;

1
src-modules/module/rpta/schluesseltabellen/rpta_column_type.unl

@ -1,3 +1,4 @@ @@ -1,3 +1,4 @@
1^physicalColumn^Physische Spalte^
2^logicalColumn^Logische Spalte^
3^lookupColumn^Lookup-Spalte^
4^computedColumn^Berechnete Spalte^

3
src-modules/module/rpta/schluesseltabellen/rpta_format_code.unl

@ -0,0 +1,3 @@ @@ -0,0 +1,3 @@
1^INTEGER^Ganzzahlig^::integer^
2^INT_NO_SEP^Ganzzahlig ohne 1000er Trenner^::varchar^
3^INT_PERCENT^Ganzzahlig %^::integer || ' %'^

14
src-modules/module/rpta/schluesseltabellen/sachgebiete_fuellen.sql

@ -0,0 +1,14 @@ @@ -0,0 +1,14 @@
--Das Sachgebiet 331 (RPTA Administr.) wird installiert
delete from sachgebiete where tid in (331);
insert into sachgebiete(tid,name) values (331,'Qualitätssicherung Administr.');
delete from group_sachgeb_bez where sachgebiete_id in (330,331)
and groupinfo_id in (select G.tid from groupinfo G where G.name='Administratoren' or G.name='superx') ;
insert into group_sachgeb_bez
select G.tid,330 from groupinfo G where G.name='Administratoren' or G.name='superx';
insert into group_sachgeb_bez
select G.tid,331 from groupinfo G where G.name='Administratoren' or G.name='superx';

3
src-modules/module/rpta/schluesseltabellen/sachgebiete_loeschen.sql

@ -0,0 +1,3 @@ @@ -0,0 +1,3 @@
delete from sachgebiete where tid in (330,331);
delete from group_sachgeb_bez where sachgebiete_id in (330,331);
delete from user_sachgeb_bez where sachgebiete_id in (330,331);

449
src-modules/module/rpta/schluesseltabellen/studierende_datenblatt_virtuell.sql

@ -0,0 +1,449 @@ @@ -0,0 +1,449 @@
--freemarker template
<sqlvars>
<sqlvar name="sos_stg_aggr_exists">
select sp_table_exists('sos_stg_aggr') from xdummy;
</sqlvar>
<sqlvar name="fact_table_source" type="hash">
select name
from sx_tables where name ='sos_stg_aggr'
</sqlvar>
<sqlvar name="added_tables" type="hashsequence">
select 1::smallint as sortnr,
name, trim(name) ||'_' as prefix,
caption,
'dim_studiengang.tid=sos_stg_aggr.tid_stg' as joinclause
from sx_tables where name in ('dim_studiengang')
union
select 10::smallint as sortnr,
name, trim(name) ||'_' as prefix,
caption,
'dim_studiengang.stort=sos_k_stort.apnr' as joinclause
from sx_tables where name in ('sos_k_stort')
union
select 20::smallint as sortnr,
name, trim(name) ||'_' as prefix,
caption,
'sos_stg_aggr.stutyp=sos_k_stutyp.apnr' as joinclause
from sx_tables where name in ('sos_k_stutyp')
union
select 30::smallint as sortnr,
name, trim(name) ||'_' as prefix,
caption,
'sos_stg_aggr.stuart=sos_k_stuart.apnr' as joinclause
from sx_tables where name in ('sos_k_stuart')
union
select 40::smallint as sortnr,
name, trim(name) ||'_' as prefix,
caption,
'sos_stg_aggr.stufrm=sos_k_stufrm.apnr' as joinclause
from sx_tables where name in ('sos_k_stufrm')
union
select 50::smallint as sortnr,
name, trim(name) ||'_' as prefix,
caption,
'sos_stg_aggr.hrst=sos_k_hrst.apnr' as joinclause
from sx_tables where name in ('sos_k_hrst')
order by 1
</sqlvar>
<sqlvar name="fields_target" type="hashsequence"><![CDATA[
select tid, table_name,
name,
name as targetname
from sx_fields where table_name ='${fact_table_source.name}'
and currentlyused=1
<#foreach added_table in added_tables>
union
select tid,table_name,
name,
'${added_table.prefix}' || name as targetname
from sx_fields where table_name ='${added_table.name}'
and currentlyused=1
</#foreach>
order by 1
]]>
</sqlvar>
</sqlvars>
<#if sos_stg_aggr_exists==1>
<#assign fact_table_target = {"name":"sos_stud_astat", "caption":"Studierende (intern und amtlich)"}
/>
CREATE temp table tmp_tables(
name CHAR(255) ,
caption CHAR(255) ,
description CHAR(255) ,
table_type CHAR(255) ,
systeminfo_id INTEGER ,
systeminfo_orig INTEGER ,
thema CHAR(255) ,
sachgebiete_id CHAR(255)
);
CREATE temp TABLE tmp_fields(
tid serial NOT NULL,
table_name VARCHAR(255) not null,
name VARCHAR(255) not null,
caption VARCHAR(255) ,
description VARCHAR(255) ,
field_type VARCHAR(255) not null,
field_size VARCHAR(255) ,
field_not_null smallint,
currentlyused SMALLINT ,
is_primarykey SMALLINT default 0 ,
foreignkey_tab VARCHAR(255) ,
foreignkey_col VARCHAR(255) ,
foreignkey_int VARCHAR(255) ,
foreignkey_cap VARCHAR(255) ,
foreignkey_cond VARCHAR(255) ,
foreignkey_func VARCHAR(255) ,
check_integrity SMALLINT,
is_sum SMALLINT default 1,
foreignkey_uniquename VARCHAR(255)
);
--Vorbereitung:
UPDATE sx_tables
SET caption = 'Standorte'
WHERE name='sos_k_stort';
UPDATE sx_tables
SET caption = 'Studienart'
WHERE name = 'sos_k_stuart';
UPDATE sx_tables
SET caption = 'Studiumstyp'
WHERE name = 'sos_k_stutyp';
UPDATE sx_tables
SET caption = 'Studienform'
WHERE name = 'sos_k_stufrm';
UPDATE sx_tables
SET caption = 'Hörerstatus'
WHERE name = 'sos_k_hrst';
--drop view if exists sos_stud_astat;
drop VIEW sos_k_stutyp;
CREATE VIEW sos_k_stutyp
(
apnr,
druck,
astat
)
AS
SELECT cifx.apnr,
cifx.druck,
astat
FROM cifx
WHERE cifx.key = 40;
update sx_fields set
is_sum=0
where table_name='sos_stg_aggr'
and name!='summe';
update sx_fields set
is_sum=1
where table_name='sos_stg_aggr'
and name='summe';
insert into tmp_tables (
name,
caption,
description,
table_type,
systeminfo_id,
thema,
sachgebiete_id
)
select
'${fact_table_target.name}',
'${fact_table_target.caption}',
description,
table_type,
systeminfo_id,
thema,
sachgebiete_id
from sx_tables where name='${fact_table_source.name}'
;
insert into tmp_fields (table_name,
name,
caption,
description,
field_type,
field_size,
field_not_null,
currentlyused,
is_primarykey,
foreignkey_tab,
foreignkey_col,
foreignkey_int,
foreignkey_cap,
foreignkey_cond,
foreignkey_func,
check_integrity,
is_sum,
foreignkey_uniquename)
select '${fact_table_target.name}' as table_name,
name,
caption,
description,
field_type,
field_size,
field_not_null,
currentlyused,
is_primarykey,
foreignkey_tab,
foreignkey_col,
foreignkey_int,
foreignkey_cap,
foreignkey_cond,
foreignkey_func,
check_integrity,
is_sum,
foreignkey_uniquename
from sx_fields where table_name ='${fact_table_source.name}'
and currentlyused=1;
<#foreach added_table in added_tables>
insert into tmp_fields (table_name,
name,
caption,
description,
field_type,
field_size,
field_not_null,
currentlyused,
is_primarykey,
foreignkey_tab,
foreignkey_col,
foreignkey_int,
foreignkey_cap,
foreignkey_cond,
foreignkey_func,
check_integrity,
is_sum,
foreignkey_uniquename)
select '${fact_table_target.name}' as table_name,
'${added_table.prefix}' || name,
'${added_table.caption}: ' || caption,
description,
field_type,
field_size,
field_not_null,
currentlyused,
is_primarykey,
foreignkey_tab,
foreignkey_col,
foreignkey_int,
foreignkey_cap,
foreignkey_cond,
foreignkey_func,
check_integrity,
is_sum,
foreignkey_uniquename
from sx_fields where table_name ='${added_table.name}'
and currentlyused=1;
</#foreach>
CREATE temp TABLE tmp_rpta_resultset
(
caption varchar(255),
uniquename varchar(255),
fieldclause text,
joinclause text,
whereclause text,
systeminfo_id integer
);
insert into tmp_rpta_resultset(caption,
uniquename,
systeminfo_id)
select '${fact_table_target.caption}',
'${fact_table_target.name}',
7
;
update tmp_rpta_resultset set fieldclause='
<#foreach field_target in fields_target>
${field_target.table_name}.${field_target.name} as ${field_target.targetname},
</#foreach>
null::varchar as dummy',
joinclause='${fact_table_source.name}
<#foreach added_table in added_tables>
left outer join ${added_table.name} on (${added_table.joinclause})
</#foreach>';
select * into temp tmp_rs1
from rpta_resultset
;
update rpta_resultset set caption=T.caption,
fieldclause=T.fieldclause,
joinclause=T.joinclause,
whereclause=T.whereclause
from tmp_rpta_resultset T
where T.systeminfo_id=rpta_resultset.systeminfo_id
and T.uniquename=rpta_resultset.uniquename
;
insert into rpta_resultset(caption,
uniquename,
fieldclause,
joinclause,
whereclause,
systeminfo_id)
select caption,
uniquename,
fieldclause,
joinclause,
whereclause,
systeminfo_id
from tmp_rpta_resultset
where 0=(select count(*)
from tmp_rs1 T
where T.systeminfo_id=tmp_rpta_resultset.systeminfo_id
and T.uniquename=tmp_rpta_resultset.uniquename)
;
drop table tmp_rpta_resultset;
drop table tmp_rs1;
delete from sx_tables where name
in (select T.name from tmp_tables T);
insert into sx_tables (name,caption,description,table_type,systeminfo_id,systeminfo_orig,thema,sachgebiete_id)
select name,caption,description,table_type,systeminfo_id,systeminfo_orig,thema,sachgebiete_id
from tmp_tables;
delete from sx_fields where table_name
in (select T.table_name from tmp_fields T);
insert into sx_fields (table_name,name,caption,description,field_type,
field_size,
field_not_null,
currentlyUsed,
foreignkey_tab,
foreignkey_col,
foreignkey_cap,
foreignkey_int,
foreignkey_cond,
foreignkey_func,
check_integrity,
is_sum,
foreignkey_uniquename
)
select
F.table_name,F.name,F.caption,F.description,F.field_type,
F.field_size,
F.field_not_null,
F.currentlyUsed,
F.foreignkey_tab,
F.foreignkey_col,
F.foreignkey_cap,
F.foreignkey_int,
F.foreignkey_cond,
F.foreignkey_func,
F.check_integrity,
F.is_sum,
F.foreignkey_uniquename
from tmp_fields F;
drop table tmp_fields;
drop table tmp_tables;
--rpta_column füllen:
select * into temp tmp_rc1
from rpta_column;
create temp table tmp_rpta_column(
uniquename varchar(255) NOT NULL,
caption varchar(255),
srcfieldname varchar(255),
column_type integer,
col_function text,
is_aggregate smallint,
resultset_id integer,
description text,
custom integer default 0
);
insert into tmp_rpta_column( uniquename,
caption,
srcfieldname,
column_type,
col_function,
is_aggregate,
resultset_id,
description)
select F.name as uniquename,
F.caption,
F.name as srcfieldname,
1 as column_type,
(case when F.is_sum=1 then 'sum' else null::varchar end) as col_function,
(case when F.is_sum=1 then 1 else 0 end) as is_aggregate,
R.tid as resultset_id,
F.description
from sx_fields F, rpta_resultset R
where F.table_name='${fact_table_target.name}'
and R.uniquename='${fact_table_target.name}'
and F.currentlyused=1
;
update rpta_column set
caption=T.caption,
srcfieldname=T.srcfieldname,
column_type=T.column_type,
col_function=T.col_function,
is_aggregate=T.is_aggregate,
resultset_id=R.tid,
description=T.description,
custom=T.custom
from tmp_rpta_column T, rpta_resultset R
where T.uniquename=rpta_column.uniquename
and rpta_column.resultset_id=R.tid
and R.uniquename='${fact_table_target.name}'
;
insert into rpta_column( uniquename,
caption,
srcfieldname,
column_type,
col_function,
is_aggregate,
resultset_id,
description,
custom)
select T.uniquename,
T.caption,
T.srcfieldname,
T.column_type,
T.col_function,
T.is_aggregate,
R.tid as resultset_id,
T.description,
T.custom
from tmp_rpta_column T, rpta_resultset R
where R.uniquename='${fact_table_target.name}'
and 0=(select count(*) from tmp_rc1 C
where C.uniquename=T.uniquename
and C.resultset_id=R.tid)
;
drop table tmp_rpta_column;
drop table tmp_rc1;
</#if> --wenn sos_stg_aggr_exists=1

95
src-modules/module/rpta/upgrade/rpta_upgrade_man.sql

@ -0,0 +1,95 @@ @@ -0,0 +1,95 @@
--Freemarker Template
<#if '${SQLdialect}'='Postgres' >
alter table rpta_resultset alter column fieldclause type text;
alter table rpta_resultset alter column joinclause type text;
alter table rpta_resultset alter column whereclause type text;
</#if>
--update current sos module to most recent version:
update sx_fields set is_sum=0
where table_name in ('dim_studiengang','sos_stg_aggr','sos_k_stort','sos_k_stuart','sos_k_stutyp','sos_k_stufrm')
and name !='summe';
UPDATE sx_tables
SET caption = 'Standorte'
WHERE name='sos_k_stort';
UPDATE sx_tables
SET caption = 'Studienart'
WHERE name = 'sos_k_stuart';
UPDATE sx_tables
SET caption = 'Studiumstyp'
WHERE name = 'sos_k_stutyp';
UPDATE sx_tables
SET caption = 'Studienform'
WHERE name = 'sos_k_stufrm';
CREATE OR REPLACE VIEW sos_k_stutyp
(
apnr,
druck,
astat
)
AS
SELECT cifx.apnr,
cifx.druck,
astat
FROM cifx
WHERE cifx.key = 40;
select * into temp tmp_sos_k_stutyp_astat
from sx_fields where table_name='sos_k_stutyp'
and name='astat';
INSERT INTO sx_fields
(
table_name,
name,
caption,
description,
field_type,
field_size,
field_not_null,
currentlyused,
is_primarykey,
foreignkey_tab,
foreignkey_col,
foreignkey_int,
foreignkey_cap,
foreignkey_cond,
foreignkey_func,
check_integrity,
is_sum,
foreignkey_uniquename
)
select
'sos_k_stutyp',
'astat',
'astat',
'',
'CHAR',
'150',
0,
1,
0,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
0,
1,
NULL
from xdummy
where 0=(select count(*)
from tmp_sos_k_stutyp_astat);
drop table tmp_sos_k_stutyp_astat;
Loading…
Cancel
Save