Browse Source

Weiterentwicklung xcube, Testcube

xcube0.1
Meikel Bisping 2 years ago
parent
commit
7399d9526d
  1. 69
      src-modules/module/xcube/conf/xcube.xml
  2. 227
      src-modules/module/xcube/masken/999990060.sql
  3. 156
      src-modules/module/xcube/masken/999990060.sql.bak
  4. 44
      src-modules/module/xcube/masken/999990060_felderinfo.unl
  5. 1
      src-modules/module/xcube/masken/999990060_maske_system_bez.unl
  6. 23
      src-modules/module/xcube/masken/999990060_masken_felder_bez.unl
  7. 266
      src-modules/module/xcube/masken/999990060_maskeninfo.unl
  8. 1
      src-modules/module/xcube/masken/999990060_sachgeb_maske_bez.unl
  9. 26
      src-modules/module/xcube/schluesseltabellen/xcube_dims_install.sql
  10. 66
      src-modules/module/xcube/schluesseltabellen/xcube_install.sql

69
src-modules/module/xcube/conf/xcube.xml

@ -2,36 +2,47 @@ @@ -2,36 +2,47 @@
<!--<!DOCTYPE module SYSTEM "../../../conf/superx-module.dtd">-->
<module name="xcube" version="0.1" sachgebiet_id="1000" sachgebiet="xcube" systeminfo_id="1000" system="xcube" thema="Datenwürfel" thema_parent="">
<database name="superx" version="2.1" system="superx">
<table name="xcube_dims">
<columns><column name="id" type ="VARCHAR" size ="255" default ="" notnull ="false" />
<table name="xcube">
<columns>
<column name="tid" type ="SERIAL" size ="" default ="" notnull ="true" isKey="true"/>
<column name="uniquename" type ="VARCHAR" size ="255" default ="" notnull ="false" />
<column name="name" type ="VARCHAR" size ="255" default ="" notnull ="false" />
<column name="sachgebiet" type ="INTEGER" size ="" default ="" notnull ="true" />
<column name="table_name" type ="VARCHAR" size ="255" default ="" notnull ="false" />
<column name="maskeninfo_id" type ="INTEGER" size ="10" default ="" notnull ="true" />
<column name="restriction" type ="TEXT" size ="" default ="" notnull ="false" />
</columns>
</table>
<table name="xcube_kennzahl">
<columns>
<column name="tid" type ="SERIAL" size ="" default ="" notnull ="true" isKey="true"/>
<column name="xcube" type ="VARCHAR" size ="255" default ="" notnull ="false" />
<column name="maskeninfo_id" type ="INTEGER" size ="10" default ="" notnull ="true" />
<column name="apnr" type ="VARCHAR" size ="255" default ="" notnull ="false" />
<column name="name" type ="VARCHAR" size ="255" default ="" notnull ="false" />
<column name="sort1" type ="INTEGER" size ="10" default ="" notnull ="false" />
<column name="parent" type ="VARCHAR" size ="255" default ="" notnull ="false" />
<column name="strukturstr" type ="VARCHAR" size ="2147483647" default ="" notnull ="false" />
<column name="aggrfunction" type ="TEXT" size ="" default ="" notnull ="false" />
<column name="restriction" type ="TEXT" size ="" default ="" notnull ="false" />
<column name="is_default" type ="SMALLINT" size ="5" default ="" notnull ="false" />
<column name="sortnr" type ="SMALLINT" size ="5" default ="" notnull ="false" />
</columns>
<indexes></indexes>
<primaryKeys><rs>
</rs></primaryKeys>
<foreignKeys></foreignKeys>
<importedKeys></importedKeys>
<privileges><rs>
</rs></privileges>
</table>
<table name="xcube_dimconfig">
<columns><column name="maskeninfo_id" type ="INTEGER" size ="10" default ="" notnull ="true" />
<columns>
<column name="tid" type ="SERIAL" size ="" default ="" notnull ="true" isKey="true"/>
<column name="xcube" type ="VARCHAR" size ="255" default ="" notnull ="false" />
<column name="maskeninfo_id" type ="INTEGER" size ="10" default ="" notnull ="true" />
<column name="table_name" type ="VARCHAR" size ="255" default ="" notnull ="false" />
<column name="name" type ="VARCHAR" size ="255" default ="" notnull ="false" />
<column name="generic_dimension" type ="VARCHAR" size ="255" default ="" notnull ="false" />
<!-- <column name="generic_dimension" type ="VARCHAR" size ="255" default ="" notnull ="false" /> -->
<column name="is_sicht" type ="SMALLINT" size ="5" default ="" notnull ="false" />
<column name="is_rowdim" type ="SMALLINT" size ="5" default ="" notnull ="false" />
<column name="is_coldim" type ="SMALLINT" size ="5" default ="" notnull ="false" />
<column name="is_secondrowdim" type ="SMALLINT" size ="5" default ="" notnull ="false" />
<column name="is_rowdefault" type ="SMALLINT" size ="5" default ="" notnull ="false" />
<column name="is_coldefault" type ="SMALLINT" size ="5" default ="" notnull ="false" />
<column name="is_coldim" type ="SMALLINT" size ="5" default ="" notnull ="false" />
<column name="is_secondcoldim" type ="SMALLINT" size ="5" default ="" notnull ="false" />
<column name="specific_restriction" type ="VARCHAR" size ="255" default ="" notnull ="false" />
<column name="tid" type ="INTEGER" size ="10" default ="" notnull ="true" />
<column name="specific_2ndcol_restriction" type ="VARCHAR" size ="255" default ="" notnull ="false" />
<column name="is_coldefault" type ="SMALLINT" size ="5" default ="" notnull ="false" />
<!-- <column name="specific_restriction" type ="VARCHAR" size ="255" default ="" notnull ="false" />
<column name="specific_2ndcol_restriction" type ="VARCHAR" size ="255" default ="" notnull ="false" />-->
<column name="sortfield" type ="VARCHAR" size ="255" default ="" notnull ="false" />
</columns>
<indexes></indexes>
@ -43,6 +54,26 @@ @@ -43,6 +54,26 @@
</rs></privileges>
</table>
<table name="xcube_dims">
<columns>
<column name="id" type ="VARCHAR" size ="255" default ="" notnull ="false" />
<column name="apnr" type ="VARCHAR" size ="255" default ="" notnull ="false" />
<column name="parent" type ="VARCHAR" size ="255" default ="" notnull ="false" />
<column name="name" type ="VARCHAR" size ="255" default ="" notnull ="false" />
<column name="strukturstr" type ="VARCHAR" size ="2000" default ="" notnull ="false" />
<column name="strukturint" type ="INTEGER" size ="" default ="" notnull ="false" />
<column name="sort1" type ="INTEGER" size ="10" default ="" notnull ="false" />
</columns>
<indexes></indexes>
<primaryKeys><rs>
</rs></primaryKeys>
<foreignKeys></foreignKeys>
<importedKeys></importedKeys>
<privileges><rs>
</rs></privileges>
</table>
<functions>
</functions>

227
src-modules/module/xcube/masken/999990060.sql

@ -0,0 +1,227 @@ @@ -0,0 +1,227 @@
--freemarker template
-- Maskenfelder -Leere Zeilen ausblenden, leere SPalten ausblenden?
<sqlvars>
<sqlvar name="table_name">select table_name from xcube where maskeninfo_id=${Maskennummer}</sqlvar>
<sqlvar name="aggrfunction">select aggrfunction from xcube_kennzahl where maskeninfo_id=${Maskennummer} and tid=<<Kennzahl>></sqlvar>
<sqlvar name="aggrfunction_restriction">select nvl(restriction,''::char(1)) from xcube_kennzahl where maskeninfo_id=${Maskennummer} and tid=<<Kennzahl>></sqlvar>
<sqlvar name="restriction" type="string"><![CDATA[<sximport>select restriction from xcube where maskeninfo_id=<<Maskennummer>></sximport>]]></sqlvar>
<sqlvar name="coldef" type="hash"><![CDATA[select F.name,F.caption,F.foreignkey_tab,F.foreignkey_col,
F.foreignkey_cap,nvl(F.foreignkey_cond,''::varchar(1)) as foreignkey_cond,
--nvl(C.specific_restriction,''::varchar(1)) as specific_restriction,
C.sortfield,C.is_sicht
from sx_fields F,xcube_dimconfig C where C.table_name=F.table_name and F.name=C.name
and C.maskeninfo_id=${Maskennummer}
and F.name=<<Ansicht in Ergebnisspalten>>]]>
</sqlvar>
<sqlvar name="nichtsicht_ergspalten" type='hashsequence'><![CDATA[
<#if coldef.is_sicht=0>
select distinct ${coldef.foreignkey_col} as apnr,${coldef.foreignkey_cap} as name,
1::smallint as detailgesamtsort,${coldef.sortfield} as tmp_sortfield
from ${coldef.foreignkey_tab} where
1=1
<#if coldef.foreignkey_cond!=''> and ${coldef.foreignkey_cond} </#if>
--{coldef.specific_restriction}
--ausblenden von Spalten, die gar nicht in konkretem Teilergebnis vorkommen
<#if "<<Leere Spalten ausblenden>>"="'ja'">
and ${coldef.foreignkey_col}::varchar(255) in (select distinct ${coldef.name}::varchar(255) from ${table_name} where
${restriction}
)
</#if>
union
select 'gesamt','Gesamt',2::smallint as detailgesamtsort,null as tmp_sortfield from xdummy
order by detailgesamtsort,tmp_sortfield,name;
<#else>
select 'Sichtspalten aktiv' from xdummy;
</#if>
]]>
</sqlvar>
<sqlvar name="rowdef" type="hash"><![CDATA[select F.name,F.caption,C.is_sicht,foreignkey_tab,foreignkey_col,foreignkey_cap,
nvl(F.foreignkey_cond,''::varchar(1)) as foreignkey_cond,
--nvl(C.specific_restriction,''::varchar(1)) as specific_restriction,
C.sortfield
from sx_fields F,xcube_dimconfig C where F.table_name=C.table_name and F.name=C.name
and C.maskeninfo_id=${Maskennummer} and F.name=<<Ansicht in Ergebniszeilen>>]]>
</sqlvar>
--nur bei wenn Ergzeilen_def nicht vom Typ Sicht relevant
<sqlvar name="nichtsicht_ergzeilen" type='hashsequence'><![CDATA[
<#if rowdef.is_sicht=0>
select 1::smallint as level, ${rowdef.foreignkey_col}::varchar(255) as key,--hier wird zur Vereinheitlichung mit Sichten Bezeichung "key" für eigentlichen Schluessel benoetigt
${rowdef.foreignkey_cap} as name,${rowdef.sortfield} as tmp_sortfield from ${rowdef.foreignkey_tab}
where 1=1
<#if rowdef.foreignkey_cond!=''> and ${rowdef.foreignkey_cond} </#if>
--{rowdef.specific_restriction}
union
select 2,'gesamt','Gesamt',null as ${rowdef.sortfield} from xdummy
order by level,tmp_sortfield;
<#else>
select 'nicht relevant' from xdummy;</#if>
]]>
</sqlvar>
<sqlvar name="zweiteRowDef" type="hash"><![CDATA[
<#if "<<2.Ansicht in Zeilen>>"!="">
select F.name,F.caption,C.is_sicht,foreignkey_tab,foreignkey_col,foreignkey_cap,
nvl(F.foreignkey_cond,''::varchar(1)) as foreignkey_cond,
--nvl(C.specific_restriction,''::varchar(1)) as specific_restriction,
C.sortfield
from sx_fields F,xcube_dimconfig C where F.table_name=C.table_name and F.name=C.name
and C.maskeninfo_id=${Maskennummer} and F.name=<<2.Ansicht in Zeilen>>
<#else>
select 'keine zweite RowDef' from xdummy;
</#if>
]]>
</sqlvar>
--nur bei wenn Ergzeilen_def nicht vom Typ Sicht relevant
<sqlvar name="zweiteRow_nichtsicht_ergzeilen" type='hashsequence'><![CDATA[
<#if "<<2.Ansicht in Zeilen>>"!=""&&zweiteRowDef.is_sicht=0>
select 1::smallint as level, ${zweiteRowDef.foreignkey_col}::varchar(255) as key,--hier wird zur Vereinheitlichung mit Sichten Bezeichung "key" für eigentlichen Schluessel benoetigt
${zweiteRowDef.foreignkey_cap} as name,${zweiteRowDef.sortfield} as tmp_sortfield from ${zweiteRowDef.foreignkey_tab}
where 1=1
<#if zweiteRowDef.foreignkey_cond!=''> and ${zweiteRowDef.foreignkey_cond} </#if>
--{zweiteRowDef.specific_restriction}
union
select 2,'gesamt','Gesamt',null as ${zweiteRowDef.sortfield} from xdummy
order by level,tmp_sortfield;
<#else>
select 'nicht relevant' from xdummy;</#if>
]]>
</sqlvar>
</sqlvars>
create temp table tmp_rohdaten (
colattrib varchar(255), <@addcomment comment=coldef.caption/>
rowattrib varchar(255), <@addcomment comment=rowdef.caption/>
row2attrib varchar(255),
value decimal(17,5));
insert into tmp_rohdaten (colattrib,rowattrib,<#if "<<2.Ansicht in Zeilen>>"!="">row2attrib, </#if> value)
select ${coldef.name}::varchar(255),
${rowdef.name}::varchar(255),
<#if "<<2.Ansicht in Zeilen>>"!="">${zweiteRowDef.name}::varchar(255),</#if>
${aggrfunction}
from
${table_name}
where
${restriction}
<#if (aggrfunction_restriction?length>0)> and ${aggrfunction_restriction} </#if>
group by 1,2 <#if "<<2.Ansicht in Zeilen>>"!="">,${zweiteRowDef.name}</#if> ;
create index ix_tmp_roh1 on tmp_rohdaten (colattrib,rowattrib,row2attrib);
<#if coldef.is_sicht&gt;0>
<#assign ergspalten=.vars[coldef.caption].elements/>
<#else>
<#assign ergspalten=nichtsicht_ergspalten/>
</#if>
create temp table tmp_erg (
ebene integer,
col1 varchar(255),
name varchar(255),
<#if "<<2.Ansicht in Zeilen>>"!="">col2 varchar(255),</#if>
<#assign i=0/>
<#foreach spalte in ergspalten>
<#assign i=i+1/>
c${i} decimal(17,5) default 0, <@addcomment comment=spalte.name/>
</#foreach>
sortnr integer
) <@informixnolog/>;
create index ix_tmp_erg on tmp_erg (sortnr);
<#if rowdef.is_sicht&gt;0>
<#assign zeilendef=.vars[rowdef.caption].elements/> --ermittelt des SichtObjekts anhand des Feldnames (aus felderinfo)
<#else>
<#assign zeilendef=nichtsicht_ergzeilen/>
</#if>
<#assign sortnr=0/>
<#foreach zeile in zeilendef>
<#if "<<2.Ansicht in Zeilen>>"!="">
<#foreach zeile2 in zweiteRow_nichtsicht_ergzeilen>
<#assign sortnr=sortnr+1/>
insert into tmp_erg (ebene,col1,name,col2,sortnr)
values (${zeile.level},'${zeile.key}','${zeile.name}','${zeile2.name}',${sortnr});
<#assign i=0/>
<#foreach spalte in ergspalten>
<#assign i=i+1/>
<@updateval i=i col=spalte row=zeile row2=zeile2 sortnr=sortnr/>
</#foreach>
</#foreach>
<#else>
<#assign sortnr=sortnr+1/>
insert into tmp_erg (ebene,col1,name,sortnr)
values (${zeile.level},'${zeile.key}','${zeile.name}',${sortnr});
<#assign i=0/>
<#foreach spalte in ergspalten>
<#assign i=i+1/>
<@updateval i=i col=spalte row=zeile row2='' sortnr=sortnr/>
</#foreach>
</#if>
</#foreach>
<#macro updateval i col row row2 sortnr>
update tmp_erg T set c${i}=
(select nvl(sum(value),0) from tmp_rohdaten R where 1=1
<#if coldef.is_sicht==1>
and R.colattrib in ${col.subkeys}
<#else>
--TODO Sicht=2
<#if col.apnr!='gesamt'>
and R.colattrib='${col.apnr}'
</#if>
</#if>
<#if rowdef.is_sicht==1>
and R.rowattrib in ${row.subkeys}
<#elseif rowdef.is_sicht==2>
and ( ${row.strukturStr?replace('$1',' R.rowattrib')} )
<#else>
<#if row.key!='gesamt'> and R.rowattrib='${row.key}' </#if>
</#if>
<#if row2?is_hash> and R.row2attrib='${row2.key}' </#if>
) where T.sortnr='${sortnr}'
;
</#macro>
drop table tmp_rohdaten;
<#if "<<Leere Zeilen ausblenden>>"="'ja'">
delete from tmp_erg where
<#assign i=0/>
<#foreach spalte in ergspalten>
<#assign i=i+1/>
c${i}=0 <#if spalte_has_next> and </#if>
</#foreach>;
</#if>
<#if "<<Ansicht in Ergebniszeilen>>"="'institution'">
update tmp_erg set name=replace(name,col1||' - ','');
update tmp_erg set col1=(select max(uniquename) from organigramm where col1=trim(key_apnr))
where substring(col1 from 1 for 1)='_';
--vorher war ggfs _3 zu O005030, auch O005030 in Namen ersetzen
update tmp_erg set name=replace(name,col1||' - ','');
</#if>
select
<#if rowdef.is_sicht&gt;0>ebene,col1,</#if>
name,
<#if "<<2.Ansicht in Zeilen>>"!="">col2,</#if>
<#assign i=0/>
<#foreach spalte in ergspalten>
<#assign i=i+1/>
c${i} <#if spalte_has_next>,</#if>
</#foreach>
from tmp_erg order by sortnr;

156
src-modules/module/xcube/masken/999990060.sql.bak

@ -0,0 +1,156 @@ @@ -0,0 +1,156 @@
--freemarker template
<sqlvars>
<sqlvar name="table_name">select table_name from xcube where maskeninfo_id=${Maskennummer}</sqlvar>
<sqlvar name="function">select function from xcube_kennzahl where maskeninfo_id=${Maskennummer} and tid=<<Kennzahl>></sqlvar>
<sqlvar name="restriction" type="string"><![CDATA[<sximport>select restriction from xcube where maskeninfo_id=<<Maskennummer>></sximport>]]></sqlvar>
<sqlvar name="coldef" type="hash"><![CDATA[select F.name,F.caption,F.foreignkey_tab,F.foreignkey_col,
F.foreignkey_cap,nvl(F.foreignkey_cond,''::varchar(1)) as foreignkey_cond,
nvl(C.specific_restriction,''::varchar(1)) as specific_restriction,
C.sortfield
from sx_fields F,xcube_dimconfig C where C.table_name=F.table_name and F.name=C.name
and C.maskeninfo_id=${Maskennummer}
and F.name=<<Ansicht in Ergebnisspalten>>]]>
</sqlvar>
<sqlvar name="ergspalten" type='hashsequence'><![CDATA[
select distinct ${coldef.foreignkey_col} as apnr,${coldef.foreignkey_cap} as name,
1::smallint as detailgesamtsort,${coldef.sortfield}
from ${coldef.foreignkey_tab} where
1=1
<#if coldef.foreignkey_cond!=''> and ${coldef.foreignkey_cond} </#if>
${coldef.specific_restriction}
--ausblenden von Spalten, die gar nicht in konkretem Teilergebnis vorkommen
--and ${coldef.foreignkey_col} in (select distinct ${coldef.name} from ${tablename} where
--Hier allgemeine Einschränkungen
--jahr=<<Jahr>>
--)
union
select 'gesamt','Gesamt',2::smallint as detailgesamtsort,null as ${coldef.sortfield} from xdummy
order by detailgesamtsort,${coldef.sortfield},name;
]]>
</sqlvar>
<sqlvar name="rowdef" type="hash"><![CDATA[select F.name,F.caption,C.is_sicht,foreignkey_tab,foreignkey_col,foreignkey_cap,
nvl(F.foreignkey_cond,''::varchar(1)) as foreignkey_cond,
nvl(C.specific_restriction,''::varchar(1)) as specific_restriction
from sx_fields F,xcube_dimconfig C where F.table_name=C.table_name and F.name=C.name
and C.maskeninfo_id=${Maskennummer} and F.name=<<Ansicht in Ergebniszeilen>>]]>
</sqlvar>
--nur bei wenn Ergzeilen_def nicht vom Typ Sicht relevant
<sqlvar name="nichtsicht_ergzeilen" type='hashsequence'><![CDATA[
<#if rowdef.is_sicht=0>
select 1::smallint as level, ${rowdef.foreignkey_col}::varchar(255) as key,--hier wird zur Vereinheitlichung mit Sichten Bezeichung "key" für eigentlichen Schluessel benoetigt
${rowdef.foreignkey_cap} as name from ${rowdef.foreignkey_tab}
where 1=1
<#if rowdef.foreignkey_cond!=''> and ${rowdef.foreignkey_cond} </#if>
${rowdef.specific_restriction}
union
select 2,'gesamt','Gesamt' from xdummy
order by level,name;
<#else>
select 'nicht relevant' from xdummy;</#if>
]]>
</sqlvar>
</sqlvars>
create temp table tmp_rohdaten (
colattrib varchar(255), <@addcomment comment=coldef.caption/>
rowattrib varchar(255), <@addcomment comment=rowdef.caption/>
value decimal(17,5));
insert into tmp_rohdaten (colattrib,rowattrib,value)
select ${coldef.name}::varchar(255),
${rowdef.name}::varchar(255), ${function}
from
${table_name}
where
${restriction}
group by 1,2;
create index ix_tmp_roh1 on tmp_rohdaten (colattrib,rowattrib);
create temp table tmp_erg (
ebene integer,
col1 varchar(255),
name varchar(255),
<#assign i=0/>
<#foreach spalte in ergspalten>
<#assign i=i+1/>
c${i} decimal(17,5) default 0, <@addcomment comment=spalte.name/>
</#foreach>
sortnr integer
) <@informixnolog/>;
<#assign sortnr=0/>
<#if rowdef.is_sicht==1>
<#assign zeilendef=.vars[rowdef.caption].elements/> --ermittel des SichtObjekts anhand des Feldnames (aus felderinfo)
<#else>
<#assign zeilendef=nichtsicht_ergzeilen/>
</#if>
<#foreach zeile in zeilendef>
<#assign sortnr=sortnr+1/>
insert into tmp_erg (ebene,col1,name,sortnr)
values (${zeile.level},'${zeile.key}','${zeile.name}',${sortnr});
<#assign i=0/>
<#foreach spalte in ergspalten>
<#assign i=i+1/>
<@updateval i=i col=spalte row=zeile art='gesamt'/>
</#foreach>
</#foreach>
<#macro updateval i col row art>
update tmp_erg T set c${i}=
(select nvl(sum(value),0) from tmp_rohdaten R where 1=1
<#if col.apnr!='gesamt'>
and R.colattrib='${col.apnr}'
</#if>
<#if rowdef.is_sicht==1>
and R.rowattrib in ${row.subkeys}
<#else>
<#if row.key!='gesamt'> and R.rowattrib='${row.key}' </#if>
</#if>
) where T.col1='${row.key}'
;
</#macro>
drop table tmp_rohdaten;
--Leerzeilen entfernen
delete from tmp_erg where
<#assign i=0/>
<#foreach spalte in ergspalten>
<#assign i=i+1/>
c${i}=0 <#if spalte_has_next> and </#if>
</#foreach>;
<#if "<<Ansicht in Ergebniszeilen>>"="'institution'">
update tmp_erg set name=replace(name,col1||' - ','');
update tmp_erg set col1=(select max(uniquename) from organigramm where col1=trim(key_apnr))
where substring(col1 from 1 for 1)='_';
--vorher war ggfs _3 zu O005030, auch O005030 in Namen ersetzen
update tmp_erg set name=replace(name,col1||' - ','');
</#if>
select
<#if rowdef.is_sicht==1>ebene,col1,</#if>
name,
<#assign i=0/>
<#foreach spalte in ergspalten>
<#assign i=i+1/>
c${i}::integer <#if spalte_has_next>,</#if>
</#foreach>
from tmp_erg order by sortnr;

44
src-modules/module/xcube/masken/999990060_felderinfo.unl

@ -0,0 +1,44 @@ @@ -0,0 +1,44 @@
999990060^Köpfe oder Fälle ?^0^0^0^140^150^1^sql^70^0^1^<<SQL>> select apnr, eintrag from koepfe_oder_faelle order by 2^apnr, eintrag^<<SQL>> select apnr, eintrag from koepfe_oder_faelle where eintrag='Köpfe';^
999990061^Semester^3^0^0^140^80^3^integer^30^0^1^<<SQL>> select tid, eintrag from semester order by tid DESC;^Eintrag^<<SQL>> select tid,eintrag from semester where today() between sem_beginn and sem_ende;^
999990062^Stichtag^1^350^-1^140^100^1^sql^30^0^1^<<SQL>> select tid, name from sos_stichtag where stichtagsart='Studierende';^^<<SQL>> select tid, name from sos_stichtag where stichtagsart='Studierende' and appl_key='0';^
999990063^Staatsangehörigkeit^36^0^0^130^150^10^char^30^0^12^<<SQL>> select tid,name,sortnr from sichten where art='SOS-Staaten-Sicht' order by 3,2;^^^
999990064^Status^14^350^-1^140^180^1^sql^30^0^1^<<SQL>> select apnr,eintrag from sos_status order by 2^^<<SQL>> select apnr,eintrag from sos_status where eintrag='Alle ohne Beurl.';^
999990065^Hörerstatus^33^0^0^140^170^1^sql^30^0^1^<<SQL>> select apnr, eintrag from hoererstatus order by 2^apnr, eintrag^<<SQL>> select apnr, eintrag from hoererstatus where eintrag='alle';^
999990066^Weitere Tabellen^123^0^0^140^140^10^char^30^0^999^<<SQL>> \
--freemarker template\
select name,string_not_null(caption) || ' - ' || name from sx_tables where name in (<#if "<<Köpfe oder Fälle ?>>"?index_of("S.gewichtung")==-1>'dim_studiengang'<#else>'dim_studiengang_gew'</#if>,'ikfz_bland_sem','ikfz_bland_hm','ikfz_bland_hzb','dim_staat', 'dim_person_attribute_aggr', 'semester')\
<#if <<tablestylesheet>>!='tabelle_html_datenblatt.xsl'>\
and name in (select distinct tablename from stylesheet_field where stylesheet_id in (select tid from sx_stylesheets where filename=<<tablestylesheet>>)) \
</#if>\
order by 2^^^
999990067^bis Fachsemester^35^350^-1^140^100^1^integer^30^0^0^^^^
999990069^Bis Semester^4^350^-1^140^80^1^integer^30^0^999^<<SQL>> select tid, eintrag from semester order by tid DESC;^Eintrag^<<SQL>> select tid,eintrag from semester where today() between sem_beginn and sem_ende;^
999990070^Filter Studierende^119^0^0^140^150^1^sql^20^0^1^<<SQL>> SELECT id,caption from sx_repository where aktiv =1 and today() between gueltig_seit and gueltig_bis and art='SOS_STUD_FILTER' order by 2;^^^
999990071^Geschlecht^37^0^0^140^80^1^integer^30^0^1^<<SQL>> SELECT apnr,druck FROM cif where key = 9003 and apnr between 1 and 4 order by 1;^^^
999990072^Felder^125^0^0^150^190^10^char^30^0^999^<<SQL>>\
--freemarker template\
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\
--Pseudonyme eingeschaltet:\
and (F.name != 'matrikel_nr' or 0=(select \
count(*) from konstanten where beschreibung='SOS_MTKNR_EXT'\
and apnr=1)) \
<#if <<tablestylesheet>>='tabelle_html_datenblatt.xsl'>\
and (F.table_name ='sos_stg_aggr'\
/* or F.table_name in (<<Weitere Tabellen>>) */) \
<#else>\
and trim(F.table_name) || '.' || F.name in (select trim(tablename)||'.'||trim(fieldname) from stylesheet_field where stylesheet_id in \
(select tid from sx_stylesheets where filename=<<tablestylesheet>>))\
</#if>\
order by 2;^^^
999990073^Studiengang^6^0^0^140^150^50^char^30^0^12^<<SQL>> select tid,name,sortnr from sichten where art in ('SOS-Kostenstellen-Sicht', 'SOS-Studiengang-Sicht') order by 3,2;^^^
999990074^Schlüssel anzeigen^150^0^0^100^100^1^integer^30^1^999^<<SQL>> select 1,'Ja' from xdummy union select 0,'Nein' from xdummy^^<<SQL>> select 1,'Ja' from xdummy^
999990075^Ansicht in Ergebniszeilen^121^0^0^100^200^1^char^200^1^1^<<SQL>> select F.name,F.caption from sx_fields F,xcube_dimconfig C where F.table_name=C.table_name and F.name=C.name and is_rowdim=1 and C.maskeninfo_id=${Maskennummer} order by 1^^<<SQL>> select F.name,F.caption from sx_fields F,xcube_dimconfig C where F.table_name=C.table_name and F.name=C.name and is_rowdefault=1 and C.maskeninfo_id=${Maskennummer} order by 1^
999990076^Ansicht in Ergebnisspalten^2001^0^0^100^150^1^char^200^1^1^<<SQL>> select F.name,F.caption from sx_fields F,xcube_dimconfig C where F.table_name=C.table_name and F.name=C.name and is_coldim=1 and C.maskeninfo_id=${Maskennummer} order by 1^^<<SQL>> select F.name,F.caption from sx_fields F,xcube_dimconfig C where F.table_name=C.table_name and F.name=C.name and is_coldefault=1 and C.maskeninfo_id=${Maskennummer} order by 1^
999990077^Zivilstatus^41^350^-1^140^180^1^sql^30^0^13^<<SQL>> select attributevalue from personattribute_value_list where personattributetype_id = (select personattributetype_id from personattributetype where attributevalue = 'Status');^^^
999990078^Jahrgang^42^350^-1^140^180^1^sql^30^0^13^<<SQL>> select attributevalue from personattribute_value_list where personattributetype_id = (select personattributetype_id from personattributetype where attributevalue = 'Jahrgang');^^^
999990079^Leere Zeilen ausblenden^130^350^-1^140^80^1^char^30^0^1^<<SQL>> select 'ja','ja' from xdummy union select 'nein','nein' from xdummy^ ^<<SQL>> select 'ja','ja' from xdummy^
999990080^Leere Spalten ausblenden^2020^0^0^100^100^1^char^30^0^1^<<SQL>> select 'ja','ja' from xdummy union select 'nein','nein' from xdummy^^<<SQL>> select 'ja','ja' from xdummy^
999990081^Abschluss^7^0^0^140^170^5^char^30^0^1^<<SQL>> select abint,dtxt from k_abint order by 2;^^^
999990082^Kennzahl^3000^350^-1^150^180^1^integer^200^1^1^<<SQL>> select tid,name from xcube_kennzahl where maskeninfo_id=${Maskennummer} order by sortnr,name;^{InputCheck:matrikelnummern}^<<SQL>> select tid,name from xcube_kennzahl where maskeninfo_id=${Maskennummer} and is_default=1^
999990083^2.Ansicht in Zeilen^125^0^0^100^100^1^char^50^0^1^<<SQL>> select F.name,F.caption from sx_fields F,xcube_dimconfig C where F.table_name=C.table_name and F.name=C.name and is_secondrowdim=1 and C.maskeninfo_id=${Maskennummer} order by 1^^1^

1
src-modules/module/xcube/masken/999990060_maske_system_bez.unl

@ -0,0 +1 @@ @@ -0,0 +1 @@
999990060^7^

23
src-modules/module/xcube/masken/999990060_masken_felder_bez.unl

@ -0,0 +1,23 @@ @@ -0,0 +1,23 @@
999990060^999990060^
999990060^999990061^
999990060^999990062^
999990060^999990063^
999990060^999990064^
999990060^999990065^
999990060^999990066^
999990060^999990067^
999990060^999990069^
999990060^999990070^
999990060^999990071^
999990060^999990072^
999990060^999990073^
999990060^999990074^
999990060^999990075^
999990060^999990076^
999990060^999990077^
999990060^999990078^
999990060^999990079^
999990060^999990080^
999990060^999990081^
999990060^999990082^
999990060^999990083^

266
src-modules/module/xcube/masken/999990060_maskeninfo.unl

@ -0,0 +1,266 @@ @@ -0,0 +1,266 @@
999990060^xCube Studierende^--freemarker template\
-- Maskenfelder -Leere Zeilen ausblenden, leere SPalten ausblenden?\
<sqlvars>\
<sqlvar name="table_name">select table_name from xcube where maskeninfo_id=${Maskennummer}</sqlvar>\
<sqlvar name="aggrfunction">select aggrfunction from xcube_kennzahl where maskeninfo_id=${Maskennummer} and tid=<<Kennzahl>></sqlvar>\
<sqlvar name="aggrfunction_restriction">select nvl(restriction,''::char(1)) from xcube_kennzahl where maskeninfo_id=${Maskennummer} and tid=<<Kennzahl>></sqlvar>\
<sqlvar name="restriction" type="string"><![CDATA[<sximport>select restriction from xcube where maskeninfo_id=<<Maskennummer>></sximport>]]></sqlvar>\
<sqlvar name="coldef" type="hash"><![CDATA[select F.name,F.caption,F.foreignkey_tab,F.foreignkey_col,\
F.foreignkey_cap,nvl(F.foreignkey_cond,''::varchar(1)) as foreignkey_cond,\
--nvl(C.specific_restriction,''::varchar(1)) as specific_restriction,\
C.sortfield,C.is_sicht\
from sx_fields F,xcube_dimconfig C where C.table_name=F.table_name and F.name=C.name \
and C.maskeninfo_id=${Maskennummer} \
and F.name=<<Ansicht in Ergebnisspalten>>]]>\
</sqlvar>\
<sqlvar name="nichtsicht_ergspalten" type='hashsequence'><![CDATA[\
<#if coldef.is_sicht=0>\
select distinct ${coldef.foreignkey_col} as apnr,${coldef.foreignkey_cap} as name,\
1::smallint as detailgesamtsort,${coldef.sortfield} as tmp_sortfield\
from ${coldef.foreignkey_tab} where \
1=1 \
<#if coldef.foreignkey_cond!=''> and ${coldef.foreignkey_cond} </#if>\
--{coldef.specific_restriction} \
--ausblenden von Spalten, die gar nicht in konkretem Teilergebnis vorkommen\
<#if "<<Leere Spalten ausblenden>>"="'ja'">\
and ${coldef.foreignkey_col}::varchar(255) in (select distinct ${coldef.name}::varchar(255) from ${table_name} where \
${restriction} \
)\
</#if>\
union\
select 'gesamt','Gesamt',2::smallint as detailgesamtsort,null as tmp_sortfield from xdummy\
order by detailgesamtsort,tmp_sortfield,name;\
<#else>\
select 'Sichtspalten aktiv' from xdummy;\
</#if>\
]]>\
</sqlvar>\
\
\
\
<sqlvar name="rowdef" type="hash"><![CDATA[select F.name,F.caption,C.is_sicht,foreignkey_tab,foreignkey_col,foreignkey_cap,\
nvl(F.foreignkey_cond,''::varchar(1)) as foreignkey_cond,\
--nvl(C.specific_restriction,''::varchar(1)) as specific_restriction,\
C.sortfield\
from sx_fields F,xcube_dimconfig C where F.table_name=C.table_name and F.name=C.name \
and C.maskeninfo_id=${Maskennummer} and F.name=<<Ansicht in Ergebniszeilen>>]]>\
</sqlvar>\
--nur bei wenn Ergzeilen_def nicht vom Typ Sicht relevant\
<sqlvar name="nichtsicht_ergzeilen" type='hashsequence'><![CDATA[\
<#if rowdef.is_sicht=0>\
select 1::smallint as level, ${rowdef.foreignkey_col}::varchar(255) as key,--hier wird zur Vereinheitlichung mit Sichten Bezeichung "key" für eigentlichen Schluessel benoetigt\
${rowdef.foreignkey_cap} as name,${rowdef.sortfield} as tmp_sortfield from ${rowdef.foreignkey_tab}\
where 1=1\
<#if rowdef.foreignkey_cond!=''> and ${rowdef.foreignkey_cond} </#if>\
--{rowdef.specific_restriction} \
union\
select 2,'gesamt','Gesamt',null as ${rowdef.sortfield} from xdummy\
order by level,tmp_sortfield; \
<#else>\
select 'nicht relevant' from xdummy;</#if>\
]]>\
</sqlvar>\
\
<sqlvar name="zweiteRowDef" type="hash"><![CDATA[\
<#if "<<2.Ansicht in Zeilen>>"!="">\
select F.name,F.caption,C.is_sicht,foreignkey_tab,foreignkey_col,foreignkey_cap,\
nvl(F.foreignkey_cond,''::varchar(1)) as foreignkey_cond,\
--nvl(C.specific_restriction,''::varchar(1)) as specific_restriction,\
C.sortfield\
from sx_fields F,xcube_dimconfig C where F.table_name=C.table_name and F.name=C.name \
and C.maskeninfo_id=${Maskennummer} and F.name=<<2.Ansicht in Zeilen>>\
<#else>\
select 'keine zweite RowDef' from xdummy;\
</#if>\
]]>\
</sqlvar>\
--nur bei wenn Ergzeilen_def nicht vom Typ Sicht relevant\
<sqlvar name="zweiteRow_nichtsicht_ergzeilen" type='hashsequence'><![CDATA[\
<#if "<<2.Ansicht in Zeilen>>"!=""&&zweiteRowDef.is_sicht=0>\
select 1::smallint as level, ${zweiteRowDef.foreignkey_col}::varchar(255) as key,--hier wird zur Vereinheitlichung mit Sichten Bezeichung "key" für eigentlichen Schluessel benoetigt\
${zweiteRowDef.foreignkey_cap} as name,${zweiteRowDef.sortfield} as tmp_sortfield from ${zweiteRowDef.foreignkey_tab}\
where 1=1\
<#if zweiteRowDef.foreignkey_cond!=''> and ${zweiteRowDef.foreignkey_cond} </#if>\
--{zweiteRowDef.specific_restriction} \
union\
select 2,'gesamt','Gesamt',null as ${zweiteRowDef.sortfield} from xdummy\
order by level,tmp_sortfield; \
<#else>\
select 'nicht relevant' from xdummy;</#if>\
]]>\
</sqlvar>\
\
\
</sqlvars>\
\
\
\
\
\
create temp table tmp_rohdaten (\
colattrib varchar(255), <@addcomment comment=coldef.caption/>\
rowattrib varchar(255), <@addcomment comment=rowdef.caption/>\
row2attrib varchar(255),\
value decimal(17,5));\
insert into tmp_rohdaten (colattrib,rowattrib,<#if "<<2.Ansicht in Zeilen>>"!="">row2attrib, </#if> value)\
select ${coldef.name}::varchar(255), \
${rowdef.name}::varchar(255),\
<#if "<<2.Ansicht in Zeilen>>"!="">${zweiteRowDef.name}::varchar(255),</#if>\
${aggrfunction}\
from \
${table_name}\
where \
${restriction}\
<#if (aggrfunction_restriction?length>0)> and ${aggrfunction_restriction} </#if>\
group by 1,2 <#if "<<2.Ansicht in Zeilen>>"!="">,${zweiteRowDef.name}</#if> ;\
create index ix_tmp_roh1 on tmp_rohdaten (colattrib,rowattrib,row2attrib);\
\
<#if coldef.is_sicht&gt;0>\
<#assign ergspalten=.vars[coldef.caption].elements/>\
<#else>\
<#assign ergspalten=nichtsicht_ergspalten/>\
</#if>\
create temp table tmp_erg (\
ebene integer,\
col1 varchar(255),\
name varchar(255),\
<#if "<<2.Ansicht in Zeilen>>"!="">col2 varchar(255),</#if>\
<#assign i=0/>\
<#foreach spalte in ergspalten>\
<#assign i=i+1/>\
c${i} decimal(17,5) default 0, <@addcomment comment=spalte.name/>\
\
</#foreach>\
sortnr integer\
) <@informixnolog/>;\
\
create index ix_tmp_erg on tmp_erg (sortnr);\
\
<#if rowdef.is_sicht&gt;0> \
<#assign zeilendef=.vars[rowdef.caption].elements/> --ermittelt des SichtObjekts anhand des Feldnames (aus felderinfo)\
<#else>\
<#assign zeilendef=nichtsicht_ergzeilen/>\
</#if>\
<#assign sortnr=0/>\
<#foreach zeile in zeilendef>\
<#if "<<2.Ansicht in Zeilen>>"!="">\
<#foreach zeile2 in zweiteRow_nichtsicht_ergzeilen>\
<#assign sortnr=sortnr+1/>\
insert into tmp_erg (ebene,col1,name,col2,sortnr)\
values (${zeile.level},'${zeile.key}','${zeile.name}','${zeile2.name}',${sortnr});\
<#assign i=0/>\
<#foreach spalte in ergspalten>\
<#assign i=i+1/>\
<@updateval i=i col=spalte row=zeile row2=zeile2 sortnr=sortnr/>\
</#foreach>\
</#foreach>\
<#else>\
<#assign sortnr=sortnr+1/>\
insert into tmp_erg (ebene,col1,name,sortnr)\
values (${zeile.level},'${zeile.key}','${zeile.name}',${sortnr});\
<#assign i=0/>\
<#foreach spalte in ergspalten>\
<#assign i=i+1/>\
<@updateval i=i col=spalte row=zeile row2='' sortnr=sortnr/>\
</#foreach>\
</#if> \
</#foreach>\
\
<#macro updateval i col row row2 sortnr>\
update tmp_erg T set c${i}=\
(select nvl(sum(value),0) from tmp_rohdaten R where 1=1 \
\
<#if coldef.is_sicht==1>\
and R.colattrib in ${col.subkeys}\
<#else>\
--TODO Sicht=2\
<#if col.apnr!='gesamt'>\
and R.colattrib='${col.apnr}' \
</#if>\
</#if>\
\
<#if rowdef.is_sicht==1>\
and R.rowattrib in ${row.subkeys}\
<#elseif rowdef.is_sicht==2>\
and ( ${row.strukturStr?replace('$1',' R.rowattrib')} ) \
<#else>\
<#if row.key!='gesamt'> and R.rowattrib='${row.key}' </#if>\
</#if>\
<#if row2?is_hash> and R.row2attrib='${row2.key}' </#if> \
) where T.sortnr='${sortnr}'\
;\
</#macro>\
\
drop table tmp_rohdaten;\
\
\
\
<#if "<<Leere Zeilen ausblenden>>"="'ja'">\
delete from tmp_erg where\
<#assign i=0/>\
<#foreach spalte in ergspalten>\
<#assign i=i+1/>\
c${i}=0 <#if spalte_has_next> and </#if>\
</#foreach>;\
</#if>\
<#if "<<Ansicht in Ergebniszeilen>>"="'institution'">\
update tmp_erg set name=replace(name,col1||' - ','');\
update tmp_erg set col1=(select max(uniquename) from organigramm where col1=trim(key_apnr))\
where substring(col1 from 1 for 1)='_';\
--vorher war ggfs _3 zu O005030, auch O005030 in Namen ersetzen\
update tmp_erg set name=replace(name,col1||' - ','');\
</#if> \
\
\
\
\
select \
<#if rowdef.is_sicht&gt;0>ebene,col1,</#if>\
name,\
<#if "<<2.Ansicht in Zeilen>>"!="">col2,</#if>\
<#assign i=0/>\
<#foreach spalte in ergspalten>\
<#assign i=i+1/>\
c${i} <#if spalte_has_next>,</#if>\
</#foreach>\
\
from tmp_erg order by sortnr;^--freemarker Template\
XIL List\
sizable_columns horizontal_scrolling\
drop_and_delete movable_columns\
white_space_color=COLOR_WHITE fixed_columns=1\
min_heading_height=35\
XIL List\
sizable_columns horizontal_scrolling\
drop_and_delete movable_columns\
white_space_color=COLOR_WHITE fixed_columns=1\
min_heading_height=35\
<#if rowdef.is_sicht==1>\
Column CID=0 heading_text="Ebene" center_heading\
row_selectable heading_platform readonly\
width=10 text_size=8\
Column CID=20 heading_text="${.vars["Ansicht in ErgebniszeilenObject"].selectedItems[0].name}Nr" center_heading\
row_selectable heading_platform readonly\
width=10 text_size=10\
</#if>\
Column CID=20 heading_text="${.vars["Ansicht in ErgebniszeilenObject"].selectedItems[0].name}" center_heading\
row_selectable heading_platform readonly\
width=10 text_size=10\
<#if "<<2.Ansicht in Zeilen>>"!="">\
Column CID=20 heading_text="${.vars["2.Ansicht in ZeilenObject"].selectedItems[0].name}" center_heading\
row_selectable heading_platform readonly\
width=10 text_size=10\
</#if>\
<#if coldef.is_sicht&gt;0>\
<#assign ergspalten=.vars[coldef.caption].elements/>\
<#else>\
<#assign ergspalten=nichtsicht_ergspalten/>\
</#if>\
<#foreach spalte in ergspalten>\
Column CID=1 heading_text="${spalte.name}" center_heading\
row_selectable heading_platform readonly\
width=12\
</#foreach>\
\
\
@@@^Altersgruppe^Anzahl^Flexible Ausgabe der Studierendenstatistik, Studiengänge und Lehreinheiten^drop table tmp_erg;^^3^700^360^0^1^^

1
src-modules/module/xcube/masken/999990060_sachgeb_maske_bez.unl

@ -0,0 +1 @@ @@ -0,0 +1 @@
16^999990060^

26
src-modules/module/xcube/schluesseltabellen/xcube_dims_install.sql

@ -0,0 +1,26 @@ @@ -0,0 +1,26 @@
delete from xcube_dims where id in ('fssemzahl','hssemzahl');
INSERT INTO xcube_dims (id,apnr,name,sort1,parent,strukturstr)
VALUES
('fssemzahl','1','1.FS',1,NULL,NULL),
('fssemzahl','2','2.FS',2,NULL,NULL),
('fssemzahl','3','3.FS',3,NULL,NULL),
('fssemzahl','4','4.FS',4,NULL,NULL),
('fssemzahl','5','5.FS',5,NULL,NULL),
('fssemzahl','6','6.FS',6,NULL,NULL),
('fssemzahl','7','7.FS',7,NULL,NULL),
('fssemzahl','8','8.FS',8,NULL,NULL),
('fssemzahl','9','9.FS',9,NULL,NULL),
('fssemzahl','10','10.FS',10,NULL,NULL);
INSERT INTO xcube_dims (id,apnr,name,sort1,parent,strukturstr)
VALUES
('hssemzahl','1','1.HS',1,NULL,NULL),
('hssemzahl','2','2.HS',2,NULL,NULL),
('hssemzahl','3','3.HS',3,NULL,NULL),
('hssemzahl','4','4.HS',4,NULL,NULL),
('hssemzahl','10','10.HS',10,NULL,NULL),
('hssemzahl','5','5.HS',5,NULL,NULL),
('hssemzahl','6','6.HS',6,NULL,NULL),
('hssemzahl','7','7.HS',7,NULL,NULL),
('hssemzahl','8','8.HS',8,NULL,NULL),
('hssemzahl','9','9.HS',9,NULL,NULL);

66
src-modules/module/xcube/schluesseltabellen/xcube_install.sql

@ -0,0 +1,66 @@ @@ -0,0 +1,66 @@
--freemarker template
<#assign xcubes = [
{"name":"Studierendenwürfel", "uniquename":"xcube_sos_stg_aggr","sachgebiet":16,"table_name":"sos_stg_aggr","maskeninfo_id":999990060,
"restriction":"sem_rueck_beur_ein in (<<Semester>>)"}
] />
<#assign xcube_kennzahl = [
{"xcube":"xcube_sos_stg_aggr", "maskeninfo_id":999990060,"apnr":"faelle","name":"Studierende (Fälle)","aggrfunction":"sum(summe)","restriction":"","is_default":1,"sortnr":1},
{"xcube":"xcube_sos_stg_aggr", "maskeninfo_id":999990060,"apnr":"koepfe","name":"Studierende (Köpfe)","aggrfunction":"sum(summe)","restriction":"studiengang_nr=1 and fach_nr=1"
,"is_default":0,"sortnr":2}
] />
<#assign xcube_dimconfig = [
{"xcube":"xcube_sos_stg_aggr","maskeninfo_id":999990060, "table_name":"sos_stg_aggr", "name":"fach_sem_zahl",
"is_sicht":0,"is_rowdim":1,"is_secondrowdim":0,"is_rowdefault":1,"is_coldim":1, "is_secondcoldim":0,"is_coldefault":0,"sortfield":"sort1"},
{"xcube":"xcube_sos_stg_aggr","maskeninfo_id":999990060, "table_name":"sos_stg_aggr", "name":"hssem",
"is_sicht":0,"is_rowdim":1,"is_secondrowdim":0,"is_rowdefault":0,"is_coldim":1, "is_secondcoldim":0,"is_coldefault":1,"sortfield":"sort1"},
{"xcube":"xcube_sos_stg_aggr","maskeninfo_id":999990060, "table_name":"sos_stg_aggr", "name":"geschlecht",
"is_sicht":0,"is_rowdim":1,"is_secondrowdim":1, "is_rowdefault":0,"is_coldim":1, "is_secondcoldim":0,"is_coldefault":0,"sortfield":"apnr"}
] />
<#assign sx_fields_entries = [
{"table_name":"sos_stg_aggr","name":"hssem","caption":"HS","foreignkey_tab":"xcube_dims","foreignkey_col":"apnr","foreignkey_cap":"name","foreignkey_cond":"id='hssemzahl'"},
{"table_name":"sos_stg_aggr","name":"fach_sem_zahl","caption":"FS","foreignkey_tab":"xcube_dims","foreignkey_col":"apnr","foreignkey_cap":"name","foreignkey_cond":"id='fssemzahl'"}
] />
--freemarker magic
<#foreach cube in xcubes>
delete from xcube where maskeninfo_id=${cube.maskeninfo_id};
delete from xcube_dimconfig where maskeninfo_id=${cube.maskeninfo_id};
delete from xcube_kennzahl where maskeninfo_id=${cube.maskeninfo_id};
insert into xcube (name,uniquename,table_name,maskeninfo_id,sachgebiet,restriction)
values ('${cube.name}','${cube.uniquename}','${cube.table_name}',${cube.maskeninfo_id},${cube.sachgebiet},
'${cube.restriction?replace("\x0027","\x0027\x0027")}');
</#foreach>
<#foreach k in xcube_kennzahl>
insert into xcube_kennzahl (xcube,apnr,name,maskeninfo_id,aggrfunction,restriction,is_default,sortnr) values
('${k.xcube}','${k.apnr}','${k.name}',${k.maskeninfo_id},'${k.aggrfunction?replace("\x0027","\x0027\x0027")}',
'${k.restriction?replace("\x0027","\x0027\x0027")}',
${k.is_default},${k.sortnr});
</#foreach>
<#foreach conf in xcube_dimconfig>
insert into xcube_dimconfig (xcube,maskeninfo_id,table_name,name,is_sicht,is_rowdim,is_secondrowdim,is_rowdefault,is_coldim,is_secondcoldim, is_coldefault,sortfield)
values ('${conf.xcube}',${conf.maskeninfo_id},'${conf.table_name}','${conf.name}',${conf.is_sicht},${conf.is_rowdim},${conf.is_secondrowdim},
${conf.is_rowdefault},${conf.is_coldim},${conf.is_secondcoldim},
${conf.is_coldefault},'${conf.sortfield}');
</#foreach>
<#foreach sxf in sx_fields_entries>
insert into sx_fields (table_name,name) select '${sxf.table_name}','${sxf.name}' from xdummy where
(select count(*) from sx_fields where table_name='${sxf.table_name}' and name='${sxf.name}')=0;
update sx_fields set caption='${sxf.caption?replace("\x0027","\x0027\x0027")}',
foreignkey_tab='${sxf.foreignkey_tab}',foreignkey_col='${sxf.foreignkey_col}',foreignkey_cap='${sxf.foreignkey_cap}',
foreignkey_cond='${sxf.foreignkey_cond?replace("\x0027","\x0027\x0027")}' -- einfache durch zwei einfache Zeichen ersetzten
where table_name='${sxf.table_name}'
and name='${sxf.name}';
</#foreach>
Loading…
Cancel
Save