Browse Source

RPTA JRXML-sourcecode ausgeben

userinfo_gueltigkeit
Daniel Quathamer 2 years ago
parent
commit
9d5e3d80d5
  1. 33
      src/de/memtext/util/FileUtils.java
  2. 434
      src/de/superx/servlet/RequestParameter.java
  3. 20
      src/de/superx/servlet/SuperXmlTabelle.java
  4. 124
      superx/WEB-INF/conf/edustore/db/install/conf/kern.xml
  5. 23
      superx/WEB-INF/conf/edustore/db/install/schluesseltabellen/release_unloads/menu_element.unl
  6. 178
      superx/WEB-INF/conf/edustore/db/install/schluesseltabellen/sx_stylesheet_tabelle_jrxml_einfuegen.sql
  7. 264
      superx/WEB-INF/conf/edustore/db/install/schluesseltabellen/sx_stylesheets_fuellen.sql
  8. BIN
      superx/WEB-INF/lib/superx4.9.jar
  9. 1
      superx/xml/viz_rpt_assistent.xsl

33
src/de/memtext/util/FileUtils.java

@ -2,12 +2,15 @@ package de.memtext.util; @@ -2,12 +2,15 @@ package de.memtext.util;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.StringWriter;
import java.net.URL;
import java.net.URLConnection;
import java.util.Iterator;
@ -289,4 +292,34 @@ public class FileUtils { @@ -289,4 +292,34 @@ public class FileUtils {
}
return resultFiles;
}
public static String getFileContentsWithEncoding(String filePath, String encoding) throws FileNotFoundException,IOException {
File f = new File(filePath);
String fileContents = "";
if (encoding == null || encoding.trim().equals("")) {
encoding = System.getProperty("file.encoding");
}
// --- IputStream und OutputStream generieren ---//
FileInputStream fis = new FileInputStream(f);
// Wenn Quelldatei Unicode, dann speziellen Reader nutzen
BufferedReader in;
//BufferedReader ist schneller bei großen Dateien
in = new BufferedReader(new InputStreamReader(fis, encoding));
// --- Output-Stream der temporären Datei erzeugen ---//
StringWriter out = new StringWriter();
// --- Verarbeiten der Datei ---//
String text;
text = in.readLine();
while (text != null) { // Datei nicht leer
out.write(text);
out.write(System.getProperty("line.separator"));
text = in.readLine();
}
if (!(out == null)) {
fileContents = out.toString();
}
return fileContents;
}
}

434
src/de/superx/servlet/RequestParameter.java

@ -0,0 +1,434 @@ @@ -0,0 +1,434 @@
package de.superx.servlet;
public enum RequestParameter{
/**
* zeige login
*/
showlogin(null),
/**
*
*/
tid(null),
/**
*
*/
navi(null),
/**
*
*/
cachingcontrol(null),
/**
*
*/
token(null),
/**
*
*/
kennung(null),
/**
*
*/
passwort(null),
/**
*
*/
param(null),
/**
*
*/
runSQL(null),
/**
*
*/
action(null),
/**
*
*/
field(null),
/**
*
*/
id(null),
/**
*
*/
keyfieldsused(null),
/**
*
*/
contenttype(null),
/**
*
*/
irowno(null),
/**
*
*/
colset(null),
/**
*
*/
colsort(null),
/**
*
*/
stylesheet(null),
/**
*
*/
usetreetable(null),
/**
*
*/
backlink(null),
/**
*
*/
MandantenID(null),
/**
*
*/
query(null),
/**
*
*/
showlastsqlxml(null),
/**
*
*/
Entwicklungsmodus(null),
/**
*
*/
pfad(null),
/**
*
*/
alt_redirect_url(null),
/**
*
*/
start_applet(null),
/**
*
*/
redirect(null),
/**
* zeigt hauptseite
*/
show_main_page(null),
/**
*
*/
accepted(null),
/**
*
*/
user_specific(null),
/**
*
*/
requestedServlet(null),
/**
*
*/
getXML_(null),
/**
*
*/
altes_passwort(null),
/**
*
*/
passwort2(null),
/**
*
*/
getKidRows(null),
/**
*
*/
getchart(null),
/**
*
*/
getDynChart(null),
/**
*
*/
csvupload(null),
/**
*
*/
reuseresult(null),
/**
*
*/
encrypt(null),
/**
*
*/
preparedxmlnotolderthan(null),
/**
*
*/
preparedxmlfileappendix(null),
/**
*
*/
preparedxmlencrypted(null),
/**
*
*/
Statistikexport(null),
/**
*
*/
maxoffset(null),
/**
*
*/
openHeader(null),
/**
*
*/
closeHeader(null),
/**
*
*/
encrypted(null),
/**
*
*/
jr_template(null),
/**
*
*/
offset(null),
/**
*
*/
Tabelle(null),
/**
*
*/
Trennzeichen(null),
/**
*
*/
Kodierung(null),
/**
*
*/
Modus(null),
/**
*
*/
tmpfile(null),
/**
*
*/
treetableid(null),
/**
*
*/
locale(null),
/**
*
*/
login(null),
/**
*
*/
checkFor(null),
/**
*
*/
maxRows(null),
/**
*
*/
maxOffset(null),
/**
*
*/
SuperXmlTabelle(null),
/**
*
*/
dokettlejob(null),
/**
*
*/
bigexcel(null),
/**
*
*/
title(null),
/**
*
*/
maxRowsOrganigramm(null),
/**
*
*/
SuperXmlMaske(null),
/**
*
*/
user(null),
/**
*
*/
clazz("class"),
/**
*
*/
xupdater(null),
/**
*
*/
referer_start(null),
/**
*
*/
zukünftigerStandErlaubt(null),
/**
*
*/
xml_return_link(null),
/**
*
*/
last_sql_extra_page(null),
/**
*
*/
xsl_processor(null),
/**
*
*/
sharedSecret(null),
/**
*
*/
defaultMaskXsl(null),
/**
*
*/
defaultTableHtmlXsl(null),
/**
*
*/
defaultTableXlsXsl(null),
/**
*
*/
defaultTablePdfXsl(null),
/**
*
*/
field1Cache(null),
/**
*
*/
isResponseCompressionWanted(null),
/**
*
*/
sichtenCaching(null),
/**
*
*/
noSessionFieldDefaults(null),
/**
*
*/
select_(null),
/**
*
*/
Exportformat(null),
/**
*
*/
statdir(null),
/**
*
*/
Lieferung(null),
/**
*
*/
berichtssemester(null),
/**
*
*/
Prüfstufe(null),
/**
*
*/
Plausibilisierung(null),
/**
*
*/
stand(null),
/**
*
*/
Hochschulstandort(null),
/**
*
*/
Vorname("Vorname (Melder)"),
/**
*
*/
Nachname("Nachname (Melder)"),
/**
*
*/
Kennung(null),
/**
*
*/
cNField("className.Field"),
/**
*
*/
cNTable("className.Table"),
/**
*
*/
cNQuery("className.Query"),
/**
*
*/
cNForeignKey("className.ForeignKey"),
/**
*
*/
cNReference("className.Reference"),
/**
*
*/
configurationStr("log4j.configuration")
;
private String parameterString;
private RequestParameter (String name) {
this.parameterString = name;
}
public String toString() {
if (parameterString == null) {
return super.toString();
}
return parameterString;
}
}

20
src/de/superx/servlet/SuperXmlTabelle.java

@ -1829,6 +1829,22 @@ public class SuperXmlTabelle extends AbstractSuperXServlet { @@ -1829,6 +1829,22 @@ public class SuperXmlTabelle extends AbstractSuperXServlet {
transformer.setParameter("seitenhoehe", "842");
}
transformer.transform(new javax.xml.transform.stream.StreamSource(s1), new javax.xml.transform.stream.StreamResult(myOutwriter));
if(rptContentype.equals("text/xml")) {
//JRXML-Sourcecode
String filename_extension=".jrxml";
OutputStream out = response.getOutputStream();
// open browser download dialogue
response.setHeader("Content-disposition", "attachment; filename=" + FileUtils.removeProblemChars(maske.getName()) + filename_extension);
response.setHeader("Cache-Control", "expires=0");
String jrxmlFileContent = de.memtext.util.FileUtils.getFileContentsWithEncoding(jrxmlFilePath, SqlStringUtils.getEncoding());
byte[] myBytes = jrxmlFileContent.getBytes(SqlStringUtils.getEncoding());
response.setContentLength(myBytes.length);
out.write(myBytes);
}
else
{
JasperCreator jc = new JasperCreator(
request,
response,
@ -1859,7 +1875,9 @@ public class SuperXmlTabelle extends AbstractSuperXServlet { @@ -1859,7 +1875,9 @@ public class SuperXmlTabelle extends AbstractSuperXServlet {
+ tutil.getSinceStart());
} catch (JRException e) {
} //Wenn kein JRXML-Quellcode
}
catch (JRException e) {
System.err.println("Fehler bei JasperReport-Erzeugung "+ e.toString());
}

124
superx/WEB-INF/conf/edustore/db/install/conf/kern.xml

@ -1,11 +1,11 @@ @@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!--<!DOCTYPE module SYSTEM "../../conf/superx-module.dtd"> -->
<module name="kern" version="4.9" sachgebiet_id="0" sachgebiet="Administration"
<module name="kern" version="5.0b" sachgebiet_id="0" sachgebiet="Administration"
systeminfo_id="9" system="Administration" thema="Administration"
thema_parent="Abfragen">
<database name="superx" version="2" system="superx">
<!-- sachgebiete Knoten wird derzeit nur fuer setzen von sachgebiete.rightname
in sx_tables_fuellen.sql genutzt http://ics/ilias3/goto.php?target=wiki_40_SingleSignOn-Rechteuebernahme&client_id=memtext -->
in sx_tables_fuellen.sql genutzt -->
<sachgebiete>
<sachgebiet id="0" name="Administration"
rightname="CS_BIA_ADMINISTRATE_TOPIC_AREA[CORE]" />
@ -2385,6 +2385,22 @@ @@ -2385,6 +2385,22 @@
notnull="false" description="Generisches Stylesheet">
<comment>Wird nur für Ergebnistabellen ausgewertet, nicht für Masken-Stylesheets. Wenn 1, dann ist das Stylesheet für alle Ergebnistabellen nutzbar</comment>
</column>
<column name="toolbar_icon_filepath" type="VARCHAR" size="255" default=""
notnull="false" description="Icon in der Symbolleiste">
<comment>Pfad relativ zu webapps/superx</comment>
</column>
<column name="usage_resultset_data" type="CHAR" size="10" default="T"
notnull="false" description="Nutzung der Ergebnisdaten">
<comment>Welche Ergebniszeilen soll das Stylesheet verarbeiten. S=Nur Schema, T=Aktuelle Baumstruktur,A=Alle Daten</comment>
</column>
<column name="stylesheet_type" type="CHAR" size="10" default="XSL"
notnull="false" description="Art des Stylesheets">
<comment>XSL,JRXML,XSL_JRXML,XSL_FO,XML,NATIVE,XLSX</comment>
</column>
<column name="jr_datasource" type="CHAR" size="10" default=""
notnull="false" description="Datenquelle (JR)">
<comment>Wird nur bei JR ausgewertet. Mögliche Werte: RS,XMLSOURCE</comment>
</column>
</columns>
<indexes></indexes>
<primaryKeys>
@ -2453,6 +2469,39 @@ @@ -2453,6 +2469,39 @@
</rs>
</privileges>
</table>
<table name="sx_stylesheet_param" version="2.1" thema="Administration"
typ="Schlüsseltabelle">
<columns>
<column name="tid" type="SERIAL" size="4" default="" notnull="true"
description="Laufnummer" />
<column name="stylesheet_id" type="INTEGER" size="4" default=""
notnull="true" description="Tid des Stylesheets" sortable="true" />
<column name="param_name" type="VARCHAR" size="255" default=""
notnull="true" description="Name des Paramaters" sortable="true">
</column>
<column name="default_val" type="VARCHAR" size="255" default=""
notnull="false" description="Default-Wert der Variable" />
<column name="description" type="VARCHAR" size="255" default=""
notnull="false" description="Beschreibung der Variable" />
<column name="wertebereich" type="VARCHAR" size="255" default=""
notnull="false" description="Wertebereich"/>
</columns>
<indexes></indexes>
<primaryKeys>
<rs>
<row>
<fld name='table_cat'>superx</fld>
<fld name='table_schem'>superx</fld>
<fld name='table_name'>sx_stylesheet_param</fld>
<fld name='column_name'>tid</fld>
<fld name='key_seq'>1</fld>
<fld name='pk_name'>c_stylesheet_param</fld>
</row>
</rs>
</primaryKeys>
</table>
<table name="sx_captions" version="3.0" thema="Administration"
typ="Schlüsseltabelle">
<columns>
@ -7783,6 +7832,31 @@ where dimension_bp_id=(select D.tid from dimension_bp D where D.apnr='bluep_absc @@ -7783,6 +7832,31 @@ where dimension_bp_id=(select D.tid from dimension_bp D where D.apnr='bluep_absc
displayType="select" visibleFields="filename" format="%s">
<relation-column from="tid" to="stylesheet_id" />
</relation>
<relation from="sx_stylesheets" to="sx_stylesheet_param" delete="FALSE"
displayType="select" visibleFields="filename" format="%s">
<relation-column from="tid" to="stylesheet_id" />
</relation>
<relation from="menu_element" to="sx_stylesheets" delete="FALSE"
displayType="select" visibleFields="description" format="%s">
<relation-column from="element" to="\'stylesheet_type\'" />
<relation-column from="element_value" to="stylesheet_type" />
</relation>
<relation from="menu_element" to="sx_stylesheets" delete="FALSE"
displayType="select" visibleFields="description" format="%s">
<relation-column from="element" to="\'contenttype\'" />
<relation-column from="element_value" to="contenttype" />
</relation>
<relation from="menu_element" to="sx_stylesheets" delete="FALSE"
displayType="select" visibleFields="description" format="%s">
<relation-column from="element" to="\'usage_resultset_data\'" />
<relation-column from="element_value" to="usage_resultset_data" />
</relation>
<relation from="menu_element" to="sx_stylesheets" delete="FALSE"
displayType="select" visibleFields="description" format="%s">
<relation-column from="element" to="\'jr_datasource\'" />
<relation-column from="element_value" to="jr_datasource" />
</relation>
<relation from="maskeninfo" to="sachgeb_maske_bez" delete="FALSE"
displayType="select" visibleFields="name" format="%s">
<relation-column from="tid" to="maskeninfo_id" />
@ -9866,6 +9940,10 @@ mode="full"> @@ -9866,6 +9940,10 @@ mode="full">
<customfield name="relation" visibleSize="10" nullFieldValue="" />
<customfield name="contenttype" visibleSize="50" nullFieldValue="" />
<customfield name="is_generic" visibleSize="50" nullFieldValue="" />
<customfield name="stylesheet_type" visibleSize="50" nullFieldValue="" />
<customfield name="usage_resultset_data" visibleSize="50" nullFieldValue="" />
<customfield name="jr_datasource" visibleSize="50" nullFieldValue="" />
<customfield name="toolbar_icon_filepath" visibleSize="50" nullFieldValue="" />
</form>
<form name="organigramm"
@ -10974,6 +11052,48 @@ mode="none"> @@ -10974,6 +11052,48 @@ mode="none">
<customfield name="key_apnr" nullFieldValue="" type="label" visibleSize="5" />
<customfield name="drucktext" nullFieldValue="" type="label" visibleSize="30" />
</form>
<form name="sx_stylesheet_param_edit"
table="sx_stylesheet_param"
path="/edit/kern/sx_stylesheet_param_edit.jsp"
followUp=""
caption="Stylesheet-Parameter"
orderBy="tid"
gotoHt=""
helpfile=""
maxRows="1"
mode="full">
<description>In diesem Formular können Sie Stylesheet-Parameter bearbeiten.</description>
<filters>
<filter mandatory="" type="equals">tid</filter>
</filters>
<customfield name="tid" nullFieldValue="" visibleSize="5" />
<customfield name="stylesheet_id" nullFieldValue="" visibleSize="30" />
<customfield name="param_name" nullFieldValue="" visibleSize="3" />
<customfield name="default_val" nullFieldValue="" visibleSize="3" />
<customfield name="description" nullFieldValue="" visibleSize="3" />
<customfield name="wertebereich" nullFieldValue="" visibleSize="3" />
</form>
<form name="sx_stylesheet_param_list"
table="sx_stylesheet_param"
path="/edit/kern/sx_stylesheet_param_list.jsp"
followUp=""
caption="Stylesheet-Parameter"
orderBy="param_name"
gotoHt=""
helpfile=""
maxRows="*"
mode="full">
<description>In diesem Formular können Sie Stylesheet-Parameter bearbeiten.</description>
<filters>
<filter mandatory="false" type="equals">stylesheet_id</filter>
</filters>
<customfield name="stylesheet_id" nullFieldValue="" visibleSize="30" />
<customfield name="param_name" nullFieldValue="" visibleSize="3" />
<customfield name="description" nullFieldValue="" visibleSize="3" />
<customfield type="link" name="Details" path="/superx/edit/kern/sx_stylesheet_param_edit.jsp"
linkid="tid" />
</form>
</dbforms>
</module>

23
superx/WEB-INF/conf/edustore/db/install/schluesseltabellen/release_unloads/menu_element.unl

@ -8,7 +8,7 @@ @@ -8,7 +8,7 @@
13^Feldtyp^date^date^date^^
34^Feldtyp^decimal^decimal^^^
35^orgstruktur^40^Institut^^^
36^contenttype^text/html^Normale html-Datei^^^
36^contenttype^text/html^HTML-Datei^^^
37^stylesheet-relation^table^Stylesheet für eine Ergebnistabelle^^^
38^stylesheet-relation^mask^Stylesheet für eine Maske^^^
39^useragent^Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030624^Mozilla 1.5 für Linux^^^
@ -54,11 +54,30 @@ @@ -54,11 +54,30 @@
70^group_field_pref^hidden^Versteckt^1^^
72^Feldart^19^19-Datei-Upload^^Dateiupload für CSV-/Excel-/TEXT-Dateien^
77^contenttype^application/pdf^PDF-Datei^^^
78^contenttype^application/vnd.ms-excel^XLS-Datei^^^
78^contenttype^application/vnd.ms-excel^XLS-Datei (obsolet)^^^
79^contenttype^application/vnd.openxmlformats-officedocument.spreadsheetml.sheet^XLSX-Datei^^^
80^contenttype^application/vnd.openxmlformats-officedocument.wordprocessingml.document^DOCX-Datei^^^
81^contenttype^application/vnd.oasis.opendocument.text^ODT-Datei^^^
82^contenttype^application/vnd.oasis.opendocument.spreadsheet^ODS-Datei^^^
82^contenttype^application/jrxml^JRXML-Datei^^^
99^contenttype^text/plain^TEXT-Datei (plain)^^^
100^contenttype^text/xml^XML-Datei^^^
101^contenttype^text/xhtml^XHTML-Datei^^^
102^contenttype^text/txt^TXT-Datei^^^
83^Feldart^18^18-Link auf weitere Einstellungen^^^
84^Frontend^3^Angular+XML^^^
85^Frontend^4^Angular^^^
86^Feldart^21^21-Zeitraum, Datum von-bis^^^
87^stylesheet_type^XSL^XSL-Stylesheet^^^
88^stylesheet_type^JRXML^JasperReport Template^^^
89^stylesheet_type^XSL_JRXML^XSL-zu-JasperReport^^^
90^stylesheet_type^XSL_FO^XSL-zu-FO-Stylesheet^^^
91^stylesheet_type^NATIVE^Download Bereich (keine Transf.)^^^
92^stylesheet_type^XSL_XLSX^XSL-zu-POI-Stylesheet^^^
103^stylesheet_type^XSL_CSV^XSL-zu-CSV-Stylesheet^^^
104^stylesheet_type^XML^XML (direkter Download, ohne Transformation)^^^
93^usage_resultset_data^S^Keine Daten (nur Schema)^^^
94^usage_resultset_data^T^Aktueller Ausgabebaum^^^
95^usage_resultset_data^A^Alle Daten^^^
96^jr_datasource^RS^Java-Resultset vom Servlet^^^
97^jr_datasource^XML^XML-Resultset vom Servlet^^^

178
superx/WEB-INF/conf/edustore/db/install/schluesseltabellen/sx_stylesheet_tabelle_jrxml_einfuegen.sql

@ -1,178 +0,0 @@ @@ -1,178 +0,0 @@
--Freemarker Template
--Achtung: Macro fügt Inhalte ein
--Bitte nur Freemarker Variablen füllen
<#assign masken = [
] />
<#assign stylesheet = [
{"filename":"tabelle_jrxml_a4_quer.xsl",
"caption":"Gener. Standardlayout JR (A4 quer)",
"description":"Gener. Standardlayout JR (A4 quer)",
"relation":"table",
"contenttype":"text/xml",
"is_generic":"1"
},
{"filename":"viz_rpt_assistent.xsl",
"caption":"Berichtsassistent",
"description":"Export als formatierter Bericht",
"relation":"table",
"contenttype":"text/html",
"is_generic":"1"}
] />
<#assign stylesheet_field = [
] />
--Hier eventuell notwendige delete's auf die Tabellen sx_mask_style, sx_stylesheets oder stylesheet_field einfügen.
--Achtung: ab hier nicht ändern, Mutterdatei ist $SUPERX_DIR/db/module/sos/schluesseltabellen/sx_stylesheets_fuellen.sql
<@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>
--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>
<#foreach column in m_stylesheet_field>
delete from stylesheet_field where stylesheet_id in (select tid from sx_stylesheets where filename ='${column.filename}');
</#foreach>
-- 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
);
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)
select max(tid)+${counter_tid},'${column.filename}',
'${column.caption}',
'${column.description}',
'${column.relation}',
'${column.contenttype}',
${column.is_generic}
from tmp_hilf;
<#assign counter_tid = counter_tid + 1 />
</#foreach>
<#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);
</#if>
--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>
)
SELECT tid, filename, caption, description, relation, useragent, contenttype
<#if TableFieldExists?exists && TableFieldExists('sx_stylesheets','is_generic')>
,is_generic
</#if>
FROM tmp_stylesheets;
drop table tmp_stylesheets;
-- 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;
<#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;
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 />
</#foreach>
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;
--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 />
</#foreach>
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;
<#if SQLdialect='Postgres'>
select sp_update_sequence('sx_stylesheets');
select sp_update_sequence('sx_mask_style');
select sp_update_sequence('stylesheet_field');
</#if>
</#macro>

264
superx/WEB-INF/conf/edustore/db/install/schluesseltabellen/sx_stylesheets_fuellen.sql

@ -11,22 +11,157 @@ @@ -11,22 +11,157 @@
] />
<#assign stylesheet = [
{"filename":"tabelle_html.xsl", "caption":"Generisches Standardlayout", "description":"Generisch", "relation":"table", "contenttype":"text/html", "is_generic":"1"},
{"filename":"tabelle_html_datenblatt.xsl", "caption":"Generisches Standardlayout Datenblätter", "description":"Generisch", "relation":"table", "contenttype":"text/html", "is_generic":"1"},
{"filename":"tabellenfeld_bearbeiten.xsl", "caption":"Generisches Standardlayout für Editierung", "description":"Generisch", "relation":"table", "contenttype":"text/html", "is_generic":"0"},
{"filename":"maske_html.xsl", "caption":"Generisches Standardlayout", "description":"Generisch", "relation":"mask", "contenttype":"text/html", "is_generic":"0"},
{"filename":"maske_html_tabfeld.xsl", "caption":"Generisches Standardlayout für Editierung", "description":"Generisch", "relation":"mask", "contenttype":"text/html", "is_generic":"0"},
{"filename":"tabelle_fo_rtf.xsl", "caption":"RTF", "description":"Export in Textverarbeitung", "relation":"table", "contenttype":"application/msword", "is_generic":"1"},
{"filename":"tabelle_fo_pdf.xsl", "caption":"PDF", "description":"Export in PDF (Adobe)", "relation":"table", "contenttype":"application/pdf", "is_generic":"1"},
{"filename":"tabelle_html_p.xsl", "caption":"HTML (Druckversion)", "description":"HTML Druckversion", "relation":"table", "contenttype":"text/html", "is_generic":"1"},
{"filename":"tabelle_xml.xsl", "caption":"XML", "description":"Export XML", "relation":"table", "contenttype":"text/xml", "is_generic":"1"},
{"filename":"tabelle_xls.xsl", "caption":"XLS", "description":"Export in XLSX (MS Excel)", "relation":"table", "contenttype":"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "is_generic":"1"},
{"filename":"tabelle_html_csv_upload.xsl", "caption":"CSV Upload", "description":"Upload mit CSV", "relation":"table", "contenttype":"text/html", "is_generic":"0"},
{"filename":"tabelle2jasperreport_legende_subreport.xsl", "caption":"Export als JasperReport-Template (Legende)", "description":"Layoutvorlage für JasperReports (Legende als Subreport)", "relation":"table", "contenttype":"application/jrxml", "is_generic":"0"},
{"filename":"tabelle2jasperreport_generic.xsl", "caption":"Export als JasperReport-Template", "description":"Layoutvorlage für JasperReports", "relation":"table", "contenttype":"application/jrxml", "is_generic":"1"},
{"filename":"tabelle_xml_mondrian3.xsl", "caption":"Export als Mondrian Schema V3", "description":"Export als Mondrian Schema V3", "relation":"table", "contenttype":"text/xml", "is_generic":"0"},
{"filename":"tabelle_xml_mondrian4.xsl", "caption":"Export als Mondrian Schema V4", "description":"Export als Mondrian Schema V4", "relation":"table", "contenttype":"text/xml", "is_generic":"0"},
{"filename":"tabelle_mediawiki.xsl", "caption":"Export als Mediawiki-Quellcode", "description":"Export als Mediawiki-Quellcode", "relation":"table", "contenttype":"application/wiki", "is_generic":"1"}
{"filename":"tabelle_html.xsl",
"caption":"Generisches Standardlayout",
"description":"Generisch",
"relation":"table",
"contenttype":"text/html",
"is_generic":"1",
"toolbar_icon_filepath":"../images/icons/html.svg",
"stylesheet_type":"XSL",
"usage_resultset_data":"T",
"jr_datasource":""},
{"filename":"tabelle_html_datenblatt.xsl",
"caption":"Generisches Standardlayout Datenblätter",
"description":"Generisch",
"relation":"table",
"contenttype":"text/html",
"is_generic":"1",
"toolbar_icon_filepath":"../images/icons/html.svg",
"stylesheet_type":"XSL",
"usage_resultset_data":"T",
"jr_datasource":""},
{"filename":"maske_html.xsl",
"caption":"Generisches Standardlayout",
"description":"Generisch",
"relation":"mask",
"contenttype":"text/html",
"is_generic":"0",
"toolbar_icon_filepath":"",
"stylesheet_type":"XSL",
"usage_resultset_data":"",
"jr_datasource":""},
{"filename":"maske_html_tabfeld.xsl",
"caption":"Generisches Standardlayout für Editierung",
"description":"Generisch",
"relation":"mask",
"contenttype":"text/html",
"is_generic":"0",
"toolbar_icon_filepath":"",
"stylesheet_type":"XSL",
"usage_resultset_data":"",
"jr_datasource":""},
{"filename":"tabelle_fo_rtf.xsl",
"caption":"RTF",
"description":"Export in Textverarbeitung",
"relation":"table",
"contenttype":"application/msword",
"is_generic":"0",
"toolbar_icon_filepath":"",
"stylesheet_type":"XSL_FO",
"usage_resultset_data":"T",
"jr_datasource":""},
{"filename":"tabelle_fo_pdf.xsl",
"caption":"PDF",
"description":"Export in PDF (Adobe)",
"relation":"table",
"contenttype":"application/pdf",
"is_generic":"1",
"toolbar_icon_filepath":"../images/icons/page_white_width_acrobat.svg",
"stylesheet_type":"XSL_FO",
"usage_resultset_data":"T",
"jr_datasource":""},
{"filename":"tabelle_html_p.xsl",
"caption":"HTML (Druckversion)",
"description":"HTML Druckversion",
"relation":"table",
"contenttype":"text/html",
"is_generic":"1",
"toolbar_icon_filepath":"../images/icons/html.svg",
"stylesheet_type":"XSL",
"usage_resultset_data":"T",
"jr_datasource":""},
{"filename":"tabelle_xml.xsl",
"caption":"XML",
"description":"Export XML",
"relation":"table",
"contenttype":"text/xml",
"is_generic":"1",
"toolbar_icon_filepath":"../images/icons/page_white_code.svg",
"stylesheet_type":"XML",
"usage_resultset_data":"T",
"jr_datasource":""},
{"filename":"tabelle_xls.xsl",
"caption":"XLS",
"description":"Export in XLSX (MS Excel)",
"relation":"table",
"contenttype":"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
"is_generic":"1",
"toolbar_icon_filepath":"page_white_excel.svg",
"stylesheet_type":"XSL_XLSX",
"usage_resultset_data":"T",
"jr_datasource":""},
{"filename":"tabelle_html_csv_upload.xsl",
"caption":"CSV Upload",
"description":"Upload mit CSV",
"relation":"table",
"contenttype":"text/html",
"is_generic":"0",
"toolbar_icon_filepath":"",
"stylesheet_type":"XSL",
"usage_resultset_data":"T",
"jr_datasource":""},
{"filename":"tabelle2jasperreport_legende_subreport.xsl",
"caption":"Export als JasperReport-Template (Legende)",
"description":"Layoutvorlage für JasperReports (Legende als Subreport)",
"relation":"table",
"contenttype":"application/jrxml",
"is_generic":"0",
"toolbar_icon_filepath":"",
"stylesheet_type":"XSL",
"usage_resultset_data":"T",
"jr_datasource":""},
{"filename":"tabelle2jasperreport_generic.xsl",
"caption":"Export als JasperReport-Template",
"description":"Layoutvorlage für JasperReports",
"relation":"table",
"contenttype":"application/jrxml",
"is_generic":"1",
"toolbar_icon_filepath":"",
"stylesheet_type":"XSL",
"usage_resultset_data":"T",
"jr_datasource":""},
{"filename":"tabelle_xml_mondrian3.xsl",
"caption":"Export als Mondrian Schema V3",
"description":"Export als Mondrian Schema V3",
"relation":"table",
"contenttype":"text/xml",
"is_generic":"0",
"toolbar_icon_filepath":"",
"stylesheet_type":"XSL",
"usage_resultset_data":"S",
"jr_datasource":""},
{"filename":"tabelle_xml_mondrian4.xsl",
"caption":"Export als Mondrian Schema V4",
"description":"Export als Mondrian Schema V4",
"relation":"table",
"contenttype":"text/xml",
"is_generic":"0",
"toolbar_icon_filepath":"",
"stylesheet_type":"XSL",
"usage_resultset_data":"S",
"jr_datasource":""},
{"filename":"tabelle_mediawiki.xsl",
"caption":"Export als Mediawiki-Quellcode",
"description":"Export als Mediawiki-Quellcode",
"relation":"table",
"contenttype":"text/plain",
"is_generic":"1",
"toolbar_icon_filepath":"",
"stylesheet_type":"XSL",
"usage_resultset_data":"T",
"jr_datasource":""}
] />
<#assign stylesheet_field = [
@ -35,8 +170,31 @@ @@ -35,8 +170,31 @@
--Hier eventuell notwendige updates/delete's auf die Tabellen sx_mask_style, sx_stylesheets oder stylesheet_field einfügen.
delete from sx_mask_style where maskeninfo_id=71560;
update sx_stylesheets set stylesheet_type='XSL',
usage_resultset_data='T'
where relation='table'
and trim(filename) like '%.xsl';
update sx_stylesheets set stylesheet_type='JRXML',
jr_datasource='RS',
usage_resultset_data='T'
where relation='table'
and trim(filename) like '%.jrxml'
;
update sx_stylesheets set stylesheet_type='JRXML',
jr_datasource='XML',
usage_resultset_data='T'
where relation='table'
and trim(filename) like '%xmlsource.jrxml'
;
--Alte ISO Stylesheets:
update sx_stylesheets set contenttype='text/html'
where contenttype like 'text/html%'
and trim(contenttype) like '%charset=ISO-8859-1'
;
--Achtung: Kernmodule hat andere Mutterdatei als $SUPERX_DIR/db/module/sos/schluesseltabellen/sx_stylesheets_fuellen.sql
<@sx_stylesheets_insert
@ -72,7 +230,11 @@ description CHAR(255) , @@ -72,7 +230,11 @@ description CHAR(255) ,
relation CHAR(10) ,
useragent CHAR(255) ,
contenttype CHAR(200) ,
is_generic smallint
is_generic smallint,
toolbar_icon_filepath varchar(255),
stylesheet_type CHAR(10),
usage_resultset_data CHAR(10),
jr_datasource CHAR(10)
);
create temp table tmp_hilf (tid integer);
@ -81,23 +243,83 @@ update tmp_hilf set tid=1 where tid is null; @@ -81,23 +243,83 @@ update tmp_hilf set tid=1 where tid is null;
<#assign couter_tid = 1 />
<#foreach column in m_stylesheet>
insert into tmp_stylesheets (tid,filename,caption,description,relation,contenttype,is_generic)
insert into tmp_stylesheets (tid,
filename,
caption,
description,
relation,
contenttype,
is_generic,
toolbar_icon_filepath,
stylesheet_type,
usage_resultset_data,
jr_datasource)
select max(tid)+${couter_tid},
'${column.filename}',
'${column.caption}',
'${column.description}',
'${column.relation}',
'${column.contenttype}',
${column.is_generic} from tmp_hilf;
${column.is_generic},
'${column.toolbar_icon_filepath}',
'${column.stylesheet_type}',
'${column.usage_resultset_data}',
'${column.jr_datasource}'
from tmp_hilf;
<#assign couter_tid = couter_tid + 1 />
</#foreach>
update sx_stylesheets set contenttype=(select T.contenttype
from tmp_stylesheets T
where T.filename=sx_stylesheets.filename)
where filename in (select filename from tmp_stylesheets);
update sx_stylesheets set is_generic=(select T.is_generic
from tmp_stylesheets T
where T.filename=sx_stylesheets.filename)
where filename in (select filename from tmp_stylesheets);
update sx_stylesheets set toolbar_icon_filepath=(select T.toolbar_icon_filepath
from tmp_stylesheets T
where T.filename=sx_stylesheets.filename)
where filename in (select filename from tmp_stylesheets)
and (toolbar_icon_filepath is null or toolbar_icon_filepath='');
update sx_stylesheets set stylesheet_type=(select T.stylesheet_type
from tmp_stylesheets T
where T.filename=sx_stylesheets.filename)
where filename in (select filename from tmp_stylesheets)
;
--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,is_generic)
SELECT tid, filename, caption, description, relation, useragent, contenttype,is_generic
insert into sx_stylesheets (tid,
filename,
caption,
description,
relation,
useragent,
contenttype,
is_generic,
toolbar_icon_filepath,
jr_datasource,
usage_resultset_data,
stylesheet_type)
SELECT tid,
filename,
caption,
description,
relation,
useragent,
contenttype,
is_generic,
toolbar_icon_filepath,
jr_datasource,
usage_resultset_data,
stylesheet_type
FROM tmp_stylesheets;
drop table tmp_stylesheets;

BIN
superx/WEB-INF/lib/superx4.9.jar

Binary file not shown.

1
superx/xml/viz_rpt_assistent.xsl

@ -1219,6 +1219,7 @@ var platform='superx'; @@ -1219,6 +1219,7 @@ var platform='superx';
<option value="application/vnd.oasis.opendocument.spreadsheet">ODS</option>
<option value="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" selected="true">XLSX</option>
<option value="text/html">HTML</option>
<option value="text/xml">JRXML-Quellcode</option>
</select>
</div>

Loading…
Cancel
Save