From 48920608b354f929ae320f50a500ecca0ed8bb48 Mon Sep 17 00:00:00 2001 From: Daniel Quathamer Date: Wed, 27 Dec 2023 09:58:40 +0100 Subject: [PATCH] xCube mit Sparklines #3 --- src-modules/module/xcube/conf/xcube.xml | 4 +- .../module/xcube/masken/21000_felderinfo.unl | 6 ++- .../module/xcube/masken/21000_maskeninfo.unl | 14 +++++- .../sx_stylesheets_einfuegen.sql | 45 +++++++++++++++++++ 4 files changed, 66 insertions(+), 3 deletions(-) create mode 100644 src-modules/module/xcube/schluesseltabellen/sx_stylesheets_einfuegen.sql diff --git a/src-modules/module/xcube/conf/xcube.xml b/src-modules/module/xcube/conf/xcube.xml index c6ed62a..c59b232 100644 --- a/src-modules/module/xcube/conf/xcube.xml +++ b/src-modules/module/xcube/conf/xcube.xml @@ -1,6 +1,6 @@ - + @@ -238,6 +238,7 @@ parent="Xcubes">Abfragen zur Administration von Xcubes + @@ -250,6 +251,7 @@ parent="Xcubes">Abfragen zur Administration von Xcubes + diff --git a/src-modules/module/xcube/masken/21000_felderinfo.unl b/src-modules/module/xcube/masken/21000_felderinfo.unl index 3bcfeba..6f75458 100644 --- a/src-modules/module/xcube/masken/21000_felderinfo.unl +++ b/src-modules/module/xcube/masken/21000_felderinfo.unl @@ -42,5 +42,9 @@ and trim(F.table_name) || '.' || F.name in (select trim(tablename)||'.'||trim(fi 21027^Hörerstatus (intern)^43^0^0^140^80^1^char^30^0^12^<> select tid,name,sortnr from sichten where art in ('XCUBE-Hörerstatus-Sicht') order by 3,2;^^^ 21028^Spaltenvisualisierung^10000^0^0^140^80^1^char^30^0^1^<> select '_graph','Balken (horiz. linksb.)' from xdummy\ union select '_graphbarright','Balken (horiz. rechtsb.)' from xdummy\ -union select '_graphbaralternating','Balken (horiz. rechtsb./linksb.)' from xdummy^^^ +union select '_graphbaralternating','Balken (horiz. rechtsb./linksb.)' from xdummy\ +union select '_sparkbar','Balkendiagramm' from xdummy\ +where 0 < (select count(*) from sx_stylesheets where filename='tabelle_html_viz.xsl')\ +union select '_sparkline','Liniendiagramm' from xdummy\ +where 0 < (select count(*) from sx_stylesheets where filename='tabelle_html_viz.xsl')^^^ 21029^Zeilenfilter bis Ebene^140^0^0^140^80^1^integer^30^0^0^ ^^^ diff --git a/src-modules/module/xcube/masken/21000_maskeninfo.unl b/src-modules/module/xcube/masken/21000_maskeninfo.unl index a4ee4d3..ea4355c 100644 --- a/src-modules/module/xcube/masken/21000_maskeninfo.unl +++ b/src-modules/module/xcube/masken/21000_maskeninfo.unl @@ -380,7 +380,11 @@ select \ ebene as level, --bei Grafiken keine Ebenenanzeige\ \ \ +<#if graph_col?starts_with("_spark")>\ +name as _categorySpark\ + <#else>\ name\ +\ --TODO: wenn <<2.Ansicht in Zeilen>>"!="" dann ,col2\ <#assign i=0/>\ <#foreach spalte in ergspalten>\ @@ -393,14 +397,22 @@ name\ <#else>\ , '' || c${i}::${datatype} || '|' || tmp_cellmax.maxvalue as _graphbarright${i}\ \ -<#else>\ + <#elseif graph_col?starts_with("_spark")>\ +, c${i} as ${graph_col}${i}\ + <#else>\ , '' || c${i}::${datatype} || '|' || tmp_cellmax.maxvalue as ${graph_col}${i}\ \ \ <#else>\ +--letzte Spalte:\ +<#if graph_col?starts_with("_spark")>\ +, c${i} as ${graph_col}${i}\ +<#else>\ , c${i}::${datatype} as col${i}\ \ \ +\ +\ \ \ from tmp_erg, tmp_cellmax order by sortnr;^--freemarker Template\ diff --git a/src-modules/module/xcube/schluesseltabellen/sx_stylesheets_einfuegen.sql b/src-modules/module/xcube/schluesseltabellen/sx_stylesheets_einfuegen.sql new file mode 100644 index 0000000..390d8d5 --- /dev/null +++ b/src-modules/module/xcube/schluesseltabellen/sx_stylesheets_einfuegen.sql @@ -0,0 +1,45 @@ +--Freemarker Template + +create temp table tmp_hilf (tid integer); + +--Sicherstellen, dass keine Duplikate vorkommen: +--#################################################################################################### +delete from sx_mask_style where maskeninfo_id=21000 and stylesheet_id in (select tid from sx_stylesheets where filename ='tabelle_html.xsl') and ord=1; +delete from sx_mask_style where maskeninfo_id=21000 and stylesheet_id in (select tid from sx_stylesheets where filename ='tabelle_html_viz.xsl') and ord=10; + + +-- Mask Style füllen +--#################################################################################################### +create temp table tmp_mask_style ( +tid serial not null, +maskeninfo_id INTEGER , +stylesheet_id INTEGER , +ord SMALLINT, +filename char(255) +); + +delete from tmp_hilf; +insert into tmp_hilf select max(tid) from sx_mask_style; +update tmp_hilf set tid=1 where tid is null; + +insert into tmp_mask_style (tid,maskeninfo_id,ord,filename) +select max(tid)+1,21000,10,'tabelle_html_viz.xsl' from tmp_hilf +where 0< (select count(*) from sx_stylesheets where filename='tabelle_html_viz.xsl'); + +update tmp_mask_style set stylesheet_id=(select max(tid) from sx_stylesheets where filename='tabelle_html_viz.xsl') +where filename='tabelle_html_viz.xsl'; + +insert into sx_mask_style ( tid, maskeninfo_id, stylesheet_id, ord) +SELECT tid, maskeninfo_id, stylesheet_id, ord +FROM tmp_mask_style; + +drop table tmp_mask_style; + +drop table tmp_hilf; + +select sp_update_sequence('sx_stylesheets'); +select sp_update_sequence('sx_mask_style'); +select sp_update_sequence('stylesheet_field'); + + +