From b0d3bf58f51903a2c422a53e762ced6fdc6e6ea5 Mon Sep 17 00:00:00 2001 From: Daniel Quathamer Date: Fri, 12 Jan 2024 12:07:41 +0100 Subject: [PATCH 1/2] Maske im Themenbaum verlagert nach Hochschulvergleich #1 --- src-modules/module/sxc/conf/sxc.xml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src-modules/module/sxc/conf/sxc.xml b/src-modules/module/sxc/conf/sxc.xml index ba3eaee..0de6081 100644 --- a/src-modules/module/sxc/conf/sxc.xml +++ b/src-modules/module/sxc/conf/sxc.xml @@ -104,7 +104,12 @@ parent="SuperX-Connect">Abfragen zur Administration von SuperX-Connect $SXC_PFAD/masken - + + + + $SXC_PFAD/masken + + From b482653a8e666985f1c354ad42a806a6fc52241e Mon Sep 17 00:00:00 2001 From: Daniel Quathamer Date: Sat, 13 Jan 2024 11:54:41 +0100 Subject: [PATCH 2/2] Sparklines im Tabellenheader #1 --- .../module/sxc/masken/47030_felderinfo.unl | 7 +- .../module/sxc/masken/47030_maskeninfo.unl | 14 +- .../sx_stylesheets_einfuegen.sql | 178 +----------------- 3 files changed, 28 insertions(+), 171 deletions(-) diff --git a/src-modules/module/sxc/masken/47030_felderinfo.unl b/src-modules/module/sxc/masken/47030_felderinfo.unl index a1d1325..8dd0731 100644 --- a/src-modules/module/sxc/masken/47030_felderinfo.unl +++ b/src-modules/module/sxc/masken/47030_felderinfo.unl @@ -27,5 +27,10 @@ and trim(F.table_name) || '.' || F.name in (select trim(tablename)||'.'||trim(fi 47053^2.Ansicht in Zeilen^125^0^0^100^100^1^char^50^0^999^<> select name,caption from xcube_dimconfig where maskeninfo_id=${Maskennummer} and is_secondrowdim=1 order by 1^hidden^1^ 47058^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')\ +order by 1^^^ 47059^Zeilenfilter bis Ebene^140^0^0^140^80^1^integer^30^0^0^ ^^^ diff --git a/src-modules/module/sxc/masken/47030_maskeninfo.unl b/src-modules/module/sxc/masken/47030_maskeninfo.unl index 4af5ef3..bebc8d4 100644 --- a/src-modules/module/sxc/masken/47030_maskeninfo.unl +++ b/src-modules/module/sxc/masken/47030_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/sxc/schluesseltabellen/sx_stylesheets_einfuegen.sql b/src-modules/module/sxc/schluesseltabellen/sx_stylesheets_einfuegen.sql index dd08db5..b778410 100755 --- a/src-modules/module/sxc/schluesseltabellen/sx_stylesheets_einfuegen.sql +++ b/src-modules/module/sxc/schluesseltabellen/sx_stylesheets_einfuegen.sql @@ -1,127 +1,11 @@ --Freemarker Template ---Achtung: Macro fügt Inhalte ein ---Bitte nur Freemarker Variablen füllen -<#assign masken = [ -] /> - -<#assign stylesheet = [ - -] /> - -<#assign stylesheet_field = [ - - -] /> - ---Hier eventuell notwendige delete's auf die Tabellen sx_mask_style, sx_stylesheets oder stylesheet_field einfügen. - - <@sx_stylesheets_insert -m_masken=masken -m_stylesheet=stylesheet -m_stylesheet_field=stylesheet_field -/> - - -<#macro sx_stylesheets_insert m_masken m_stylesheet m_stylesheet_field> +create temp table tmp_hilf (tid integer); --Sicherstellen, dass keine Duplikate vorkommen: --#################################################################################################### -<#foreach column in m_masken> -delete from sx_mask_style where maskeninfo_id=${column.mask} and stylesheet_id in (select tid from sx_stylesheets where filename ='${column.filename}') and ord=${column.ord}; - - -<#foreach column in m_stylesheet_field> -delete from stylesheet_field where stylesheet_id in (select tid from sx_stylesheets where filename ='${column.filename}'); - - - - - --- Stylesheets füllen ---#################################################################################################### -create temp table tmp_stylesheets ( -tid serial not null, -filename CHAR(255) , -caption CHAR(255) , -description CHAR(255) , -relation CHAR(10) , -useragent CHAR(255) , -contenttype CHAR(200) , -is_generic smallint, -toolbar_icon_filepath VARCHAR(255) , -usage_resultset_data CHAR(10) default 'T' , -stylesheet_type CHAR(10) default 'XSL' , -jr_datasource CHAR(10) - -); - -create temp table tmp_hilf (tid integer); -insert into tmp_hilf select max(tid) from sx_stylesheets; -update tmp_hilf set tid=1 where tid is null; - -<#assign counter_tid = 1 /> -<#foreach column in m_stylesheet> -insert into tmp_stylesheets (tid, -filename, -caption, -description, -relation, -contenttype, -is_generic, -toolbar_icon_filepath , -usage_resultset_data , -stylesheet_type , -jr_datasource) -select max(tid)+${counter_tid},'${column.filename}', -'${column.caption}', - '${column.description}', - '${column.relation}', -'${column.contenttype}', -${column.is_generic}, -'${column.toolbar_icon_filepath}' , -'${column.usage_resultset_data}' , -'${column.stylesheet_type}' , -'${column.jr_datasource}' -from tmp_hilf; -<#assign counter_tid = counter_tid + 1 /> - - -<#if TableFieldExists?exists && TableFieldExists('sx_stylesheets','is_generic')> -update sx_stylesheets set is_generic=1 -where filename in (select T.filename from tmp_stylesheets T where T.is_generic=1); - - - ---delete für tml_stylesheets hinzugefügt #ak 06.03.2013 -delete from tmp_stylesheets where filename in (select filename from sx_stylesheets); - - -insert into sx_stylesheets (tid, -filename, caption, description, relation, useragent, contenttype -<#if TableFieldExists?exists && TableFieldExists('sx_stylesheets','is_generic')> -,is_generic - -<#if TableFieldExists?exists && TableFieldExists('sx_stylesheets','toolbar_icon_filepath')> -,toolbar_icon_filepath , -usage_resultset_data , -stylesheet_type , -jr_datasource - -) -SELECT tid, filename, caption, description, relation, useragent, contenttype -<#if TableFieldExists?exists && TableFieldExists('sx_stylesheets','is_generic')> -,is_generic - -<#if TableFieldExists?exists && TableFieldExists('sx_stylesheets','toolbar_icon_filepath')> -,toolbar_icon_filepath , -usage_resultset_data , -stylesheet_type , -jr_datasource - -FROM tmp_stylesheets; - -drop table tmp_stylesheets; +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 @@ -138,15 +22,12 @@ delete from tmp_hilf; insert into tmp_hilf select max(tid) from sx_mask_style; update tmp_hilf set tid=1 where tid is null; -<#assign counter_tid = 1 /> -<#foreach column in m_masken> insert into tmp_mask_style (tid,maskeninfo_id,ord,filename) -select max(tid)+${counter_tid},${column.mask},${column.ord},'${column.filename}' from tmp_hilf; +select max(tid)+1,47030,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='${column.filename}') -where filename='${column.filename}'; -<#assign counter_tid = counter_tid + 1 /> - +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 @@ -154,52 +35,11 @@ FROM tmp_mask_style; drop table tmp_mask_style; - ---Field zu Stylesheet Zuordnungen: ---#################################################################################################### -CREATE temp TABLE tmp_stylesheet_field -( -tid serial NOT NULL, -stylesheet_id INTEGER, -tablename char(255), -fieldname char(255), -filename char(255) -); - -delete from tmp_hilf; -insert into tmp_hilf select max(tid) from stylesheet_field; -update tmp_hilf set tid=1 where tid is null; - -<#assign counter_tid = 1 /> -<#foreach column in m_stylesheet_field> -INSERT INTO tmp_stylesheet_field (tid, filename, tablename, fieldname) -select max(tid)+${counter_tid}, '${column.filename}', '${column.tablename}', '${column.fieldname}' from tmp_hilf; - -update tmp_stylesheet_field set stylesheet_id=(select max(tid) from sx_stylesheets where filename='${column.filename}') -where filename='${column.filename}'; -<#assign counter_tid = counter_tid + 1 /> - - -insert into stylesheet_field ( tid, stylesheet_id, tablename, fieldname) -SELECT tid, stylesheet_id, tablename, fieldname -FROM tmp_stylesheet_field; - -drop table tmp_stylesheet_field; drop table tmp_hilf; -update sx_stylesheets -set -contenttype='txt/xml', -is_generic=1, -usage_resultset_data='T', -stylesheet_type='XSL_JRXML' -where filename in ('tabelle_jrxml_a4_quer.xsl'); - - -<#if SQLdialect='Postgres'> select sp_update_sequence('sx_stylesheets'); select sp_update_sequence('sx_mask_style'); select sp_update_sequence('stylesheet_field'); - - + +