Browse Source

Das ETL Modul ist mit HISinOne-BI 2023.12 oder höher nicht kompatibel, wg. geänderter Klassen mit gleichem Namen im Kernmodul. #4

etl_0.4_Release
Daniel Quathamer 6 months ago
parent
commit
77976f984d
  1. 5
      .classpath
  2. 4
      build.xml
  3. 4
      src-modules/module/etl/bin/etl_dosql.x
  4. 2
      src-modules/module/etl/bin/etl_sx_insert_mask.x
  5. 2
      src-modules/module/etl/bin/etl_sx_select_mask.x
  6. 2
      src-modules/module/etl/bin/etl_sx_unload_records.x
  7. 2
      src-modules/module/etl/bin/etl_sx_upload_records.x
  8. 2
      src-modules/module/etl/conf/etl.xml
  9. 45
      src-modules/module/etl/schluesseltabellen/create_load_etl_stylesheets.sql
  10. 25
      src-modules/module/etl/schluesseltabellen/create_load_etl_themenbaum.sql
  11. 97
      src-modules/module/etl/schluesseltabellen/etl_step_fuellen.sql
  12. 10
      src-modules/module/etl/schluesseltabellen/etl_step_type.unl
  13. 57
      src-modules/module/etl/schluesseltabellen/sx_stylesheets_fuellen.sql
  14. 4
      src/de/superx/elt/ActionHandler/EtlActionHandler.java
  15. 6
      src/de/superx/elt/ActionHandler/EtlActionHandlerDoquery.java
  16. 11
      src/de/superx/elt/ActionHandler/EtlActionHandlerDosql.java
  17. 2
      src/de/superx/elt/ActionHandler/EtlActionHandlerI.java
  18. 2
      src/de/superx/elt/ActionHandler/EtlActionHandlerMsg.java
  19. 4
      src/de/superx/elt/ActionHandler/EtlActionHandlerUnloadRecords.java
  20. 6
      src/de/superx/elt/ActionHandler/EtlActionHandlerUploadRecords.java
  21. 5
      src/de/superx/elt/EtlAction.java
  22. 7
      src/de/superx/elt/EtlActionJob.java
  23. 4
      src/de/superx/elt/EtlStep.java
  24. 14
      src/de/superx/elt/EtlUtils.java
  25. 6
      src/de/superx/elt/QueryResultSerializer.java
  26. 4
      src/de/superx/elt/SqlExecutor.java
  27. 10
      src/de/superx/elt/TableUploader.java
  28. 4
      src/de/superx/elt/bin/Doquery.java
  29. 8
      src/de/superx/elt/bin/Dosql.java
  30. 10
      src/de/superx/elt/bin/EtlJobExecutor.java
  31. 2
      src/de/superx/elt/bin/SxTransformer.java
  32. 4
      src/de/superx/elt/bin/UnloadRecords.java
  33. 6
      src/de/superx/elt/bin/UploadRecords.java
  34. 2
      src/de/superx/elt/util/FileUtils.java
  35. 2
      src/de/superx/elt/util/GetOpts.java
  36. 2
      src/de/superx/elt/util/GetOptsBackport.java
  37. 2
      src/de/superx/sxrest/JobExecutor.java
  38. 4
      src/de/superx/sxrest/LaunchUpgrade.java
  39. 32
      src/de/superx/sxrest/MaskXml.java
  40. BIN
      superx/WEB-INF/lib/superx-etl.jar
  41. 39
      superx/edit/etl/etl_manager.jsp
  42. 26
      superx/edit/etl/jobexecutor.jsp
  43. 58
      superx/edit/etl/saveMask.jsp

5
.classpath

@ -14,5 +14,10 @@
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/log4j-core-2.16.0.jar"/> <classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/log4j-core-2.16.0.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/log4j-1.2-api-2.16.0.jar"/> <classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/log4j-1.2-api-2.16.0.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/log4j-api-2.16.0.jar"/> <classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/log4j-api-2.16.0.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/slf4j-api-1.6.1.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/slf4j-log4j12-1.6.1.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/dom4j-1.6.1.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/kettle-engine-6.0.0.0-353.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/metastore-6.0.0.0-353.jar"/>
<classpathentry kind="output" path="superx/WEB-INF/classes"/> <classpathentry kind="output" path="superx/WEB-INF/classes"/>
</classpath> </classpath>

4
build.xml

@ -38,7 +38,7 @@ ant -DWEBAPP=$WEBAPP cleanBuildPath
<property name="version" value="0.1" /> <property name="version" value="0.1" />
<property name="docm_version" value="1.0" /> <property name="docm_version" value="1.0" />
<property name="etl_version" value="0.2" /> <property name="etl_version" value="0.4b" />
@ -124,7 +124,7 @@ ant -DWEBAPP=$WEBAPP cleanBuildPath
<delete> <delete>
<fileset dir="${distDir}" includes="superx-etl*.jar" /> <fileset dir="${distDir}" includes="superx-etl*.jar" />
</delete> </delete>
<jar destfile="${distDir}/superx-etl.jar" basedir="${BUILD_PATH}" includes="de/superx/etl/** de/superx/sxrest/**" excludes="freemarker/**/* com/**/* javax/**/* **/*.java"> <jar destfile="${distDir}/superx-etl.jar" basedir="${BUILD_PATH}" includes="de/superx/elt/** de/superx/sxrest/**" excludes="freemarker/**/* com/**/* javax/**/* **/*.java">
<manifest> <manifest>
<!-- Who is building this jar? --> <!-- Who is building this jar? -->
<attribute name="Built-By" value="superx"/> <attribute name="Built-By" value="superx"/>

4
src-modules/module/etl/bin/etl_dosql.x

@ -55,7 +55,7 @@ then
if [ "$LANG" != "" ] if [ "$LANG" != "" ]
then LOCALE="-Duser.language=$LANG" then LOCALE="-Duser.language=$LANG"
fi fi
java $LOCALE -cp $CP $JAVA_OPTS de.superx.etl.bin.Dosql -logger:$LOGGER_PROPERTIES -dbproperties:$DB_PROPERTIES -sqlfile:"$filename" -outFormat:"txt" -delim:$DBDELIMITER -header:$header -outfile:$outfile -params:$params java $LOCALE -cp $CP $JAVA_OPTS de.superx.elt.bin.Dosql -logger:$LOGGER_PROPERTIES -dbproperties:$DB_PROPERTIES -sqlfile:"$filename" -outFormat:"txt" -delim:$DBDELIMITER -header:$header -outfile:$outfile -params:$params
else else
case $SX_CLIENT in case $SX_CLIENT in
@ -65,7 +65,7 @@ jdbc)
if [ "$LANG" != "" ] if [ "$LANG" != "" ]
then LOCALE="-Duser.language=$LANG" then LOCALE="-Duser.language=$LANG"
fi fi
java $LOCALE -cp $CP $JAVA_OPTS de.superx.etl.bin.Dosql -logger:$LOGGER_PROPERTIES -dbproperties:$DB_PROPERTIES -sqlfile:"$filename" -outFormat:"txt" -delim:$DBDELIMITER -header:$header -outfile:$outfile -params:$params java $LOCALE -cp $CP $JAVA_OPTS de.superx.elt.bin.Dosql -logger:$LOGGER_PROPERTIES -dbproperties:$DB_PROPERTIES -sqlfile:"$filename" -outFormat:"txt" -delim:$DBDELIMITER -header:$header -outfile:$outfile -params:$params
;; ;;
psql) psql)

2
src-modules/module/etl/bin/etl_sx_insert_mask.x

@ -59,7 +59,7 @@ SX_CLIENT=jdbc
export SX_CLIENT export SX_CLIENT
CP=".:$JDBC_CLASSPATH" CP=".:$JDBC_CLASSPATH"
CMD="java $JAVA_OPTS -cp $CP de.superx.etl.bin.EtlJobExecutor -dbproperties:$DB_PROPERTIES -job:sx_insert_mask -params:TID=$TID,PATH_TO_INPUTFILE=$infile" CMD="java $JAVA_OPTS -cp $CP de.superx.elt.bin.EtlJobExecutor -dbproperties:$DB_PROPERTIES -job:sx_insert_mask -params:TID=$TID,PATH_TO_INPUTFILE=$infile"
$CMD $CMD

2
src-modules/module/etl/bin/etl_sx_select_mask.x

@ -36,7 +36,7 @@ SX_CLIENT=jdbc
export SX_CLIENT export SX_CLIENT
CP=".:$JDBC_CLASSPATH" CP=".:$JDBC_CLASSPATH"
CMD="java $JAVA_OPTS -cp $CP de.superx.etl.bin.EtlJobExecutor -dbproperties:$DB_PROPERTIES -job:sx_select_mask -outfile:$outfile -params:TID=$TID" CMD="java $JAVA_OPTS -cp $CP de.superx.elt.bin.EtlJobExecutor -dbproperties:$DB_PROPERTIES -job:sx_select_mask -outfile:$outfile -params:TID=$TID"
echo $CMD echo $CMD

2
src-modules/module/etl/bin/etl_sx_unload_records.x

@ -41,6 +41,6 @@ CP=".:$JDBC_CLASSPATH"
echo "Unload $table to $filename" echo "Unload $table to $filename"
java $LOCALE -cp "$CP" de.superx.etl.bin.Doquery $LOGGER_PROPERTIES $DB_PROPERTIES 'select * from '$table $outformat $DBDELIMITER $header $filename java $LOCALE -cp "$CP" de.superx.elt.bin.Doquery $LOGGER_PROPERTIES $DB_PROPERTIES 'select * from '$table $outformat $DBDELIMITER $header $filename

2
src-modules/module/etl/bin/etl_sx_upload_records.x

@ -40,7 +40,7 @@ fi
echo "$tabelle wird aus der Datei $quelldatei gefüllt" echo "$tabelle wird aus der Datei $quelldatei gefüllt"
CP=".:$JDBC_CLASSPATH" CP=".:$JDBC_CLASSPATH"
CMD="java $JAVA_OPTS -cp $CP de.superx.etl.bin.UploadRecords -logger:$LOGGER_PROPERTIES -dbproperties:$DB_PROPERTIES -table:$tabelle -unl:$quelldatei -delim:$DBDELIMITER -header:$header -informat:$informat -encoding:$encoding" CMD="java $JAVA_OPTS -cp $CP de.superx.elt.bin.UploadRecords -logger:$LOGGER_PROPERTIES -dbproperties:$DB_PROPERTIES -table:$tabelle -unl:$quelldatei -delim:$DBDELIMITER -header:$header -informat:$informat -encoding:$encoding"
$CMD $CMD

2
src-modules/module/etl/conf/etl.xml

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!--<!DOCTYPE module SYSTEM "../../../conf/superx-module.dtd"> --> <!--<!DOCTYPE module SYSTEM "../../../conf/superx-module.dtd"> -->
<module name="etl" version="0.3" sachgebiet_id="270" <module name="etl" version="0.4b" sachgebiet_id="270"
sachgebiet="Laderoutinen" systeminfo_id="270" sachgebiet="Laderoutinen" systeminfo_id="270"
system="Laderoutinen" thema="Laderoutinen" thema_parent="Abfragen"> system="Laderoutinen" thema="Laderoutinen" thema_parent="Abfragen">
<database name="superx" system="superx"> <database name="superx" system="superx">

45
src-modules/module/etl/schluesseltabellen/create_load_etl_stylesheets.sql

@ -0,0 +1,45 @@
--Freemarker Template
--used in etl-job sx_insert_mask
<#if SQLdialect='Postgres'>
drop table if exists tmp_etl_stylesheets;
drop table if exists tmp_etl_mask_style;
drop table if exists tmp_etl_stylesheet_field;
</#if>
create table tmp_etl_stylesheets(
tid integer ,
filename character(255),
caption character(255),
description character(255),
relation character(10),
useragent character(255),
contenttype character(200),
is_generic SMALLINT default 0 ,
toolbar_icon_filepath VARCHAR(255) ,
usage_resultset_data CHAR(10) default 'T' ,
stylesheet_type CHAR(10) default 'XSL' ,
jr_datasource CHAR(10)
);
CREATE TABLE tmp_etl_mask_style (
-- tid integer ,
maskeninfo_id integer,
stylesheet_id integer,
ord smallint,
stylesheet_filename character(255)
);
CREATE TABLE tmp_etl_stylesheet_field (
tid integer ,
stylesheet_id integer,
stylesheet_filename character(255),
tablename character(255),
fieldname character(255)
);

25
src-modules/module/etl/schluesseltabellen/create_load_etl_themenbaum.sql

@ -0,0 +1,25 @@
--Freemarker Template
--used in etl-job sx_insert_mask
<#if SQLdialect='Postgres'>
drop table if exists tmp_etl_themenbaum;
</#if>
CREATE TABLE tmp_etl_themenbaum (
-- tid integer,
name varchar(255) NOT NULL,
maskeninfo_id integer,
parent integer,
parent_name varchar(255),
gueltig_seit date,
gueltig_bis date,
erlaeuterung char(240),
sort integer DEFAULT 0 NOT NULL,
css_class varchar(255)
);

97
src-modules/module/etl/schluesseltabellen/etl_step_fuellen.sql

@ -44,6 +44,8 @@
{"etl_job":"sx_select_mask", "uniquename":"unload_maske_system_bez", "name":"maske_system_bez entladen", "type":"UNLOAD", "parent":"unload_masken_stammdaten"}, {"etl_job":"sx_select_mask", "uniquename":"unload_maske_system_bez", "name":"maske_system_bez entladen", "type":"UNLOAD", "parent":"unload_masken_stammdaten"},
{"etl_job":"sx_select_mask", "uniquename":"unload_themenbaum", "name":"themenbaum entladen", "type":"UNLOAD"}, {"etl_job":"sx_select_mask", "uniquename":"unload_themenbaum", "name":"themenbaum entladen", "type":"UNLOAD"},
{"etl_job":"sx_select_mask", "uniquename":"unload_sx_mask_style", "name":"sx_mask_style entladen", "type":"UNLOAD"}, {"etl_job":"sx_select_mask", "uniquename":"unload_sx_mask_style", "name":"sx_mask_style entladen", "type":"UNLOAD"},
{"etl_job":"sx_select_mask", "uniquename":"unload_sx_stylesheets", "name":"sx_stylesheets entladen", "type":"UNLOAD"},
{"etl_job":"sx_select_mask", "uniquename":"unload_stylesheet_field", "name":"stylesheet_field entladen", "type":"UNLOAD"},
{"etl_job":"sx_insert_mask", "uniquename":"delete_maskeninfo", "name":"Maskeninfo löschen", "type":"DOQUERY" }, {"etl_job":"sx_insert_mask", "uniquename":"delete_maskeninfo", "name":"Maskeninfo löschen", "type":"DOQUERY" },
{"etl_job":"sx_insert_mask", "uniquename":"upload_maskeninfo", "name":"Maskeninfo hochladen", "type":"LOAD" }, {"etl_job":"sx_insert_mask", "uniquename":"upload_maskeninfo", "name":"Maskeninfo hochladen", "type":"LOAD" },
@ -61,7 +63,17 @@
{"etl_job":"sx_insert_mask", "uniquename":"delete_maske_system_bez", "name":"maske_system_bez löschen", "type":"DOQUERY" }, {"etl_job":"sx_insert_mask", "uniquename":"delete_maske_system_bez", "name":"maske_system_bez löschen", "type":"DOQUERY" },
{"etl_job":"sx_insert_mask", "uniquename":"upload_maske_system_bez", "name":"maske_system_bez hochladen", "type":"LOAD" }, {"etl_job":"sx_insert_mask", "uniquename":"upload_maske_system_bez", "name":"maske_system_bez hochladen", "type":"LOAD" },
{"etl_job":"sx_insert_mask", "uniquename":"create_tmp_etl_themenbaum", "name":"Tabelle tmp_etl_themenbaum erzeugen", "type":"DOSQL" },
{"etl_job":"sx_insert_mask", "uniquename":"create_tmp_etl_stylesheets", "name":"Tabelle tmp_etl_stylesheets erzeugen", "type":"DOSQL" },
{"etl_job":"sx_insert_mask", "uniquename":"upload_tmp_etl_themenbaum", "name":"tmp_etl_themenbaum hochladen", "type":"LOAD" },
{"etl_job":"sx_insert_mask", "uniquename":"upload_tmp_etl_stylesheets", "name":"tmp_etl_stylesheets hochladen", "type":"LOAD" },
{"etl_job":"sx_insert_mask", "uniquename":"upload_tmp_etl_mask_style", "name":"tmp_etl_mask_style hochladen", "type":"LOAD" },
{"etl_job":"sx_insert_mask", "uniquename":"upload_tmp_etl_stylesheet_field", "name":"tmp_etl_stylesheet_field hochladen", "type":"LOAD" },
{"etl_job":"sx_insert_mask", "uniquename":"themenbaum_fuellen", "name":"themenbaum_fuellen", "type":"DOSQL" },
{"etl_job":"sx_insert_mask", "uniquename":"sx_stylesheets_fuellen", "name":"sx_stylesheets_fuellen", "type":"DOSQL" },
{"etl_job":"kern_konstanten_update", "uniquename":"kern_konstanten_update", "name":"Kern Konstanten aktualisieren", "type":"DOSQL" }, {"etl_job":"kern_konstanten_update", "uniquename":"kern_konstanten_update", "name":"Kern Konstanten aktualisieren", "type":"DOSQL" },
{"etl_job":"sichten_unload", "uniquename":"unload_sichten_ges", "name":"Sichten entladen", "type":"MSG"}, {"etl_job":"sichten_unload", "uniquename":"unload_sichten_ges", "name":"Sichten entladen", "type":"MSG"},
@ -84,6 +96,8 @@
{"etl_step":"unload_maske_system_bez","prop_name":"select_stmt", "prop_value":"select maskeninfo_id,systeminfo_id from maske_system_bez where maskeninfo_id=$TID order by 1,2" }, {"etl_step":"unload_maske_system_bez","prop_name":"select_stmt", "prop_value":"select maskeninfo_id,systeminfo_id from maske_system_bez where maskeninfo_id=$TID order by 1,2" },
{"etl_step":"unload_themenbaum","prop_name":"select_stmt", "prop_value":"select name,maskeninfo_id,parent,(select name from themenbaum where tid=T.parent) as parent_name,gueltig_seit,gueltig_bis,erlaeuterung,sort,css_class from themenbaum T where maskeninfo_id=$TID order by 2,1" }, {"etl_step":"unload_themenbaum","prop_name":"select_stmt", "prop_value":"select name,maskeninfo_id,parent,(select name from themenbaum where tid=T.parent) as parent_name,gueltig_seit,gueltig_bis,erlaeuterung,sort,css_class from themenbaum T where maskeninfo_id=$TID order by 2,1" },
{"etl_step":"unload_sx_mask_style","prop_name":"select_stmt", "prop_value":"select maskeninfo_id,stylesheet_id,ord,(select filename from sx_stylesheets where tid=S.stylesheet_id) as stylesheet_filename from sx_mask_style S where maskeninfo_id=$TID order by 1,2,3" }, {"etl_step":"unload_sx_mask_style","prop_name":"select_stmt", "prop_value":"select maskeninfo_id,stylesheet_id,ord,(select filename from sx_stylesheets where tid=S.stylesheet_id) as stylesheet_filename from sx_mask_style S where maskeninfo_id=$TID order by 1,2,3" },
{"etl_step":"unload_sx_stylesheets","prop_name":"select_stmt", "prop_value":"select S.tid,S.filename,S.caption,S.description,S.relation,S.useragent,S.contenttype,S.is_generic,S.toolbar_icon_filepath,S.usage_resultset_data,S.stylesheet_type,S.jr_datasource from sx_stylesheets S, sx_mask_style M where S.tid=M.stylesheet_id and M.maskeninfo_id=$TID order by 1,2,3" },
{"etl_step":"unload_stylesheet_field","prop_name":"select_stmt", "prop_value":"select F.tid,F.stylesheet_id,S.filename as stylesheet_filename,F.tablename,F.fieldname FROM stylesheet_field F, sx_stylesheets S, sx_mask_style M where F.stylesheet_id=S.tid and S.tid=M.stylesheet_id and M.maskeninfo_id=$TID order by 1,2,3,4,5" },
{"etl_step":"delete_maskeninfo","prop_name":"select_stmt", "prop_value":"delete from maskeninfo where tid=$TID" }, {"etl_step":"delete_maskeninfo","prop_name":"select_stmt", "prop_value":"delete from maskeninfo where tid=$TID" },
{"etl_step":"upload_maskeninfo","prop_name":"target_table", "prop_value":"maskeninfo" }, {"etl_step":"upload_maskeninfo","prop_name":"target_table", "prop_value":"maskeninfo" },
@ -114,6 +128,31 @@
{"etl_step":"upload_maske_system_bez","prop_name":"format", "prop_value":"xml" }, {"etl_step":"upload_maske_system_bez","prop_name":"format", "prop_value":"xml" },
{"etl_step":"upload_maske_system_bez","prop_name":"search_path", "prop_value":"/etlAction/unload [@name=\"unload_maske_system_bez\"]/rs/row" }, {"etl_step":"upload_maske_system_bez","prop_name":"search_path", "prop_value":"/etlAction/unload [@name=\"unload_maske_system_bez\"]/rs/row" },
{"etl_step":"upload_maske_system_bez","prop_name":"path_to_inputfile", "prop_value":"$PATH_TO_INPUTFILE" }, {"etl_step":"upload_maske_system_bez","prop_name":"path_to_inputfile", "prop_value":"$PATH_TO_INPUTFILE" },
{"etl_step":"create_tmp_etl_themenbaum","prop_name":"PATH_TO_INPUTFILE", "prop_value":"$SUPERX_DIR/db/module/etl/schluesseltabellen/create_load_etl_themenbaum.sql" },
{"etl_step":"create_tmp_etl_stylesheets","prop_name":"PATH_TO_INPUTFILE", "prop_value":"$SUPERX_DIR/db/module/etl/schluesseltabellen/create_load_etl_stylesheets.sql" },
{"etl_step":"upload_tmp_etl_themenbaum","prop_name":"target_table", "prop_value":"tmp_etl_themenbaum" },
{"etl_step":"upload_tmp_etl_themenbaum","prop_name":"format", "prop_value":"xml" },
{"etl_step":"upload_tmp_etl_themenbaum","prop_name":"search_path", "prop_value":"/etlAction/unload [@name=\"unload_themenbaum\"]/rs/row" },
{"etl_step":"upload_tmp_etl_themenbaum","prop_name":"path_to_inputfile", "prop_value":"$PATH_TO_INPUTFILE" },
{"etl_step":"upload_tmp_etl_stylesheets","prop_name":"target_table", "prop_value":"tmp_etl_stylesheets" },
{"etl_step":"upload_tmp_etl_stylesheets","prop_name":"format", "prop_value":"xml" },
{"etl_step":"upload_tmp_etl_stylesheets","prop_name":"search_path", "prop_value":"/etlAction/unload [@name=\"unload_sx_stylesheets\"]/rs/row" },
{"etl_step":"upload_tmp_etl_stylesheets","prop_name":"path_to_inputfile", "prop_value":"$PATH_TO_INPUTFILE" },
{"etl_step":"upload_tmp_etl_mask_style","prop_name":"target_table", "prop_value":"tmp_etl_mask_style" },
{"etl_step":"upload_tmp_etl_mask_style","prop_name":"format", "prop_value":"xml" },
{"etl_step":"upload_tmp_etl_mask_style","prop_name":"search_path", "prop_value":"/etlAction/unload [@name=\"unload_sx_mask_style\"]/rs/row" },
{"etl_step":"upload_tmp_etl_mask_style","prop_name":"path_to_inputfile", "prop_value":"$PATH_TO_INPUTFILE" },
{"etl_step":"upload_tmp_etl_stylesheet_field","prop_name":"target_table", "prop_value":"tmp_etl_stylesheet_field" },
{"etl_step":"upload_tmp_etl_stylesheet_field","prop_name":"format", "prop_value":"xml" },
{"etl_step":"upload_tmp_etl_stylesheet_field","prop_name":"search_path", "prop_value":"/etlAction/unload [@name=\"unload_stylesheet_field\"]/rs/row" },
{"etl_step":"upload_tmp_etl_stylesheet_field","prop_name":"path_to_inputfile", "prop_value":"$PATH_TO_INPUTFILE" },
{"etl_step":"themenbaum_fuellen","prop_name":"PATH_TO_INPUTFILE", "prop_value":"$SUPERX_DIR/db/module/etl/schluesseltabellen/themenbaum_fuellen.sql" },
{"etl_step":"sx_stylesheets_fuellen","prop_name":"PATH_TO_INPUTFILE", "prop_value":"$SUPERX_DIR/db/module/etl/schluesseltabellen/sx_stylesheets_fuellen.sql" },
{"etl_step":"kern_konstanten_update","prop_name":"path_to_inputfile", "prop_value":"$PATH_TO_INPUTFILE" }, {"etl_step":"kern_konstanten_update","prop_name":"path_to_inputfile", "prop_value":"$PATH_TO_INPUTFILE" },
@ -131,8 +170,8 @@
{"testcase":"test_sx_select_mask","assertion":1, "sql":"select count(*) from etl_job where uniquename='sx_select_mask'" }, {"testcase":"test_sx_select_mask","assertion":1, "sql":"select count(*) from etl_job where uniquename='sx_select_mask'" },
{"testcase":"test_sx_insert_mask","assertion":1, "sql":"select count(*) from etl_job where uniquename='sx_insert_mask'" }, {"testcase":"test_sx_insert_mask","assertion":1, "sql":"select count(*) from etl_job where uniquename='sx_insert_mask'" },
{"testcase":"test_sx_insert_mask_params","assertion":3, "sql":"select count(*) from etl_job_param P, etl_job J where J.tid=P.etl_job_id and J.uniquename='sx_insert_mask'" }, {"testcase":"test_sx_insert_mask_params","assertion":3, "sql":"select count(*) from etl_job_param P, etl_job J where J.tid=P.etl_job_id and J.uniquename='sx_insert_mask'" },
{"testcase":"test_sx_insert_mask_steps","assertion":10, "sql":"select count(*) from etl_step S, etl_step_relation R, etl_job J where J.tid=R.job_id and S.tid=R.step_id and J.uniquename='sx_insert_mask'" }, {"testcase":"test_sx_insert_mask_steps","assertion":18, "sql":"select count(*) from etl_step S, etl_step_relation R, etl_job J where J.tid=R.job_id and S.tid=R.step_id and J.uniquename='sx_insert_mask'" },
{"testcase":"test_sx_select_mask_steps","assertion":8, "sql":"select count(*) from etl_step S, etl_step_relation R, etl_job J where J.tid=R.job_id and S.tid=R.step_id and J.uniquename='sx_select_mask'" } {"testcase":"test_sx_select_mask_steps","assertion":10, "sql":"select count(*) from etl_step S, etl_step_relation R, etl_job J where J.tid=R.job_id and S.tid=R.step_id and J.uniquename='sx_select_mask'" }
] /> ] />
@ -198,6 +237,34 @@ custom_step SMALLINT default 1
) )
; ;
--jobs with custom_job=0 get deleted in HISinOne-BI
--therefore set to 2:
update etl_job set custom_job=2
where custom_job=0
and uniquename in ('sx_select_mask','sx_insert_mask',
'kern_konstanten_update',
'sichten_unload',
'sos_gewichtung_unload');
update etl_step set custom_step=2
where custom_step=0
and tid in (select R.step_id from etl_step_relation R, etl_job J
where R.job_id=J.tid
and J.uniquename in ('sx_select_mask','sx_insert_mask',
'kern_konstanten_update',
'sichten_unload',
'sos_gewichtung_unload'));
update etl_step_relation set custom_step=2
where custom_step=0
and job_id in (select J.tid
from etl_job J
where J.uniquename in ('sx_select_mask','sx_insert_mask',
'kern_konstanten_update',
'sichten_unload',
'sos_gewichtung_unload'));
<#foreach etl_job in etl_jobs> <#foreach etl_job in etl_jobs>
truncate table tmp_etl_job; truncate table tmp_etl_job;
@ -216,7 +283,7 @@ insert into tmp_etl_job(uniquename,caption,systeminfo_id,logfile,already_exists,
values ('${etl_job.uniquename}', values ('${etl_job.uniquename}',
'${etl_job.name}', '${etl_job.name}',
${etl_job.systeminfo_id}, ${etl_job.systeminfo_id},
'${etl_job.logfile}',0,0); '${etl_job.logfile}',0,2);
<#if SQLdialect='Postgres'> <#if SQLdialect='Postgres'>
--Postgres Dialekt: --Postgres Dialekt:
@ -329,7 +396,7 @@ J.tid as etl_job_id,
</#if> </#if>
J.uniquename, J.uniquename,
'${etl_job.logfile}' as logfile, '${etl_job.logfile}' as logfile,
0, 2,
0 0
from etl_job J from etl_job J
where J.uniquename='${etl_job.uniquename}' where J.uniquename='${etl_job.uniquename}'
@ -453,7 +520,7 @@ FROM tmp_etl_step T )
delete from etl_step_relation delete from etl_step_relation
where job_id in (select J.tid where job_id in (select J.tid
FROM tmp_etl_job J) FROM tmp_etl_job J)
and custom_step=0 and custom_step=2
; ;
@ -500,7 +567,7 @@ select
0 as force_continue, 0 as force_continue,
1 as step_active, 1 as step_active,
sortnr, sortnr,
0 2
FROM tmp_etl_step FROM tmp_etl_step
; ;
@ -546,28 +613,12 @@ where ${testfall.assertion}!=(${testfall.sql})
</#foreach> --Ende Testfälle </#foreach> --Ende Testfälle
<#if SQLdialect='Informix'>
--nun xupdates:
--bei informix kann man TEXT Spalten nicht updaten, daher per jdbc updaten:
--damit DOSQL nicht den xupdater beim Start dieses Scriptes anwirft,
--wird das in eine temp. Datei ausgelagert.
! echo "<xup""date>" > "./tmp"$MANDANTID".sql"
<#foreach etl_step_property in etl_step_properties>
! echo '<text table="etl_step_property" field="prop_value" where="prop_name='\''${etl_step_property.prop_name}'\'' and etl_step_id=(select S.tid from etl_step S where S.uniquename='\''${etl_step_property.etl_step}'\'')">${etl_step_property.prop_value}</text>' >>"./tmp"$MANDANTID".sql"
</#foreach>
! echo "</xup""date>" >> "./tmp"$MANDANTID".sql"
! DOSQL "./tmp"$MANDANTID".sql"
<#else>
--Postgres:
<#foreach etl_step_property in etl_step_properties> <#foreach etl_step_property in etl_step_properties>
update etl_step_property set prop_value='${etl_step_property.prop_value}' where prop_name='${etl_step_property.prop_name}' and etl_step_id=(select S.tid from etl_step S where S.uniquename='${etl_step_property.etl_step}'); update etl_step_property set prop_value='${etl_step_property.prop_value}' where prop_name='${etl_step_property.prop_name}' and etl_step_id=(select S.tid from etl_step S where S.uniquename='${etl_step_property.etl_step}');
</#foreach> </#foreach>
</#if>

10
src-modules/module/etl/schluesseltabellen/etl_step_type.unl

@ -1,5 +1,5 @@
1^LOAD^Tabelle hochladen^de.superx.etl.ActionHandler.EtlActionHandlerUploadRecords^ 1^LOAD^Tabelle hochladen^de.superx.elt.ActionHandler.EtlActionHandlerUploadRecords^
2^DOSQL^SQL-Script ausführen^de.superx.etl.ActionHandler.EtlActionHandlerDosql^ 2^DOSQL^SQL-Script ausführen^de.superx.elt.ActionHandler.EtlActionHandlerDosql^
3^DOQUERY^SQL-Query ausführen^de.superx.etl.ActionHandler.EtlActionHandlerDoquery^ 3^DOQUERY^SQL-Query ausführen^de.superx.elt.ActionHandler.EtlActionHandlerDoquery^
4^UNLOAD^SQL-Ergebnis entladen^de.superx.etl.ActionHandler.EtlActionHandlerUnloadRecords^ 4^UNLOAD^SQL-Ergebnis entladen^de.superx.elt.ActionHandler.EtlActionHandlerUnloadRecords^
5^MSG^Logausgabe^de.superx.etl.ActionHandler.EtlActionHandlerMsg^ 5^MSG^Logausgabe^de.superx.elt.ActionHandler.EtlActionHandlerMsg^

57
src-modules/module/etl/schluesseltabellen/sx_stylesheets_fuellen.sql

@ -7,18 +7,69 @@ update tmp_etl_stylesheets set tid=(select S.tid
from sx_stylesheets S from sx_stylesheets S
where S.filename=tmp_etl_stylesheets.filename); where S.filename=tmp_etl_stylesheets.filename);
--update metadata:
update sx_stylesheets set (filename,
caption,
description,
relation,
useragent,
contenttype,
is_generic,
toolbar_icon_filepath,
usage_resultset_data,
stylesheet_type,
jr_datasource)
=(select filename,
caption,
description,
relation,
useragent,
contenttype,
is_generic,
toolbar_icon_filepath,
usage_resultset_data,
stylesheet_type,
jr_datasource
from tmp_etl_stylesheets T
where T.tid=sx_stylesheets.tid)
where tid in (select tid from tmp_etl_stylesheets);
--new Stylesheet? --new Stylesheet?
insert into sx_stylesheets(filename,caption,description,relation,contenttype) insert into sx_stylesheets(filename,caption,description,relation,contenttype,
select filename,caption,description,relation,contenttype is_generic, toolbar_icon_filepath, usage_resultset_data, stylesheet_type, jr_datasource)
select filename,caption,description,relation,contenttype,
is_generic, toolbar_icon_filepath, usage_resultset_data, stylesheet_type, jr_datasource
from tmp_etl_stylesheets from tmp_etl_stylesheets
where tid is null; where tid is null;
--abwärtskompatibel:
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'
;
--lookup tid: --lookup tid:
update tmp_etl_stylesheets set tid=(select S.tid update tmp_etl_stylesheets set tid=(select S.tid
from sx_stylesheets S from sx_stylesheets S
where S.filename=tmp_etl_stylesheets.filename); where S.filename=tmp_etl_stylesheets.filename);
delete from sx_mask_style where maskeninfo_id in (select maskeninfo_id delete from sx_mask_style where maskeninfo_id in (select maskeninfo_id
from tmp_etl_mask_style); from tmp_etl_mask_style);

4
src/de/superx/etl/ActionHandler/EtlActionHandler.java → src/de/superx/elt/ActionHandler/EtlActionHandler.java

@ -5,7 +5,7 @@
* This package is licensed under the CampusSource License; * This package is licensed under the CampusSource License;
* http://www.campussource.de/org/license/ * http://www.campussource.de/org/license/
*/ */
package de.superx.etl.ActionHandler; package de.superx.elt.ActionHandler;
import java.io.StringWriter; import java.io.StringWriter;
import java.sql.Connection; import java.sql.Connection;
@ -16,7 +16,7 @@ import java.util.Properties;
import java.util.logging.Logger; import java.util.logging.Logger;
import de.superx.bin.SxConnection; import de.superx.bin.SxConnection;
import de.superx.etl.EtlStep; import de.superx.elt.EtlStep;

6
src/de/superx/etl/ActionHandler/EtlActionHandlerDoquery.java → src/de/superx/elt/ActionHandler/EtlActionHandlerDoquery.java

@ -5,7 +5,7 @@
* This package is licensed under the CampusSource License; * This package is licensed under the CampusSource License;
* http://www.campussource.de/org/license/ * http://www.campussource.de/org/license/
*/ */
package de.superx.etl.ActionHandler; package de.superx.elt.ActionHandler;
import java.io.StringWriter; import java.io.StringWriter;
import java.sql.Connection; import java.sql.Connection;
@ -14,8 +14,8 @@ import java.util.Properties;
import java.util.logging.Logger; import java.util.logging.Logger;
import de.superx.bin.SxConnection; import de.superx.bin.SxConnection;
import de.superx.etl.QueryResultSerializer; import de.superx.elt.QueryResultSerializer;
import de.superx.etl.SqlExecutor; import de.superx.elt.SqlExecutor;
public class EtlActionHandlerDoquery extends EtlActionHandler implements EtlActionHandlerI { public class EtlActionHandlerDoquery extends EtlActionHandler implements EtlActionHandlerI {

11
src/de/superx/etl/ActionHandler/EtlActionHandlerDosql.java → src/de/superx/elt/ActionHandler/EtlActionHandlerDosql.java

@ -5,7 +5,7 @@
* This package is licensed under the CampusSource License; * This package is licensed under the CampusSource License;
* http://www.campussource.de/org/license/ * http://www.campussource.de/org/license/
*/ */
package de.superx.etl.ActionHandler; package de.superx.elt.ActionHandler;
import java.io.File; import java.io.File;
import java.io.StringWriter; import java.io.StringWriter;
@ -15,8 +15,9 @@ import java.util.Properties;
import java.util.logging.Logger; import java.util.logging.Logger;
import de.superx.bin.SxConnection; import de.superx.bin.SxConnection;
import de.superx.etl.QueryResultSerializer; import de.superx.elt.EtlUtils;
import de.superx.etl.SqlExecutor; import de.superx.elt.QueryResultSerializer;
import de.superx.elt.SqlExecutor;
public class EtlActionHandlerDosql extends EtlActionHandler implements EtlActionHandlerI { public class EtlActionHandlerDosql extends EtlActionHandler implements EtlActionHandlerI {
@ -31,7 +32,9 @@ public class EtlActionHandlerDosql extends EtlActionHandler implements EtlAction
String log=""; String log="";
long numberOfRows=0; long numberOfRows=0;
this.getConnection(); this.getConnection();
String filename=handlerSpecificProperties.getProperty("PATH_TO_INPUTFILE"); Properties myProps=EtlUtils.replaceSUPERX_DIRandETL_PFAD(handlerSpecificProperties);
String filename=myProps.getProperty("PATH_TO_INPUTFILE");
File sqlScriptFile = null; File sqlScriptFile = null;
try { try {
sqlScriptFile = new File(filename); sqlScriptFile = new File(filename);

2
src/de/superx/etl/ActionHandler/EtlActionHandlerI.java → src/de/superx/elt/ActionHandler/EtlActionHandlerI.java

@ -5,7 +5,7 @@
* This package is licensed under the CampusSource License; * This package is licensed under the CampusSource License;
* http://www.campussource.de/org/license/ * http://www.campussource.de/org/license/
*/ */
package de.superx.etl.ActionHandler; package de.superx.elt.ActionHandler;
import java.io.StringWriter; import java.io.StringWriter;
import java.sql.Connection; import java.sql.Connection;

2
src/de/superx/etl/ActionHandler/EtlActionHandlerMsg.java → src/de/superx/elt/ActionHandler/EtlActionHandlerMsg.java

@ -5,7 +5,7 @@
* This package is licensed under the CampusSource License; * This package is licensed under the CampusSource License;
* http://www.campussource.de/org/license/ * http://www.campussource.de/org/license/
*/ */
package de.superx.etl.ActionHandler; package de.superx.elt.ActionHandler;
import java.io.StringWriter; import java.io.StringWriter;
import java.sql.Connection; import java.sql.Connection;

4
src/de/superx/etl/ActionHandler/EtlActionHandlerUnloadRecords.java → src/de/superx/elt/ActionHandler/EtlActionHandlerUnloadRecords.java

@ -5,7 +5,7 @@
* This package is licensed under the CampusSource License; * This package is licensed under the CampusSource License;
* http://www.campussource.de/org/license/ * http://www.campussource.de/org/license/
*/ */
package de.superx.etl.ActionHandler; package de.superx.elt.ActionHandler;
import java.io.StringWriter; import java.io.StringWriter;
import java.sql.Connection; import java.sql.Connection;
@ -14,7 +14,7 @@ import java.util.Properties;
import java.util.logging.Logger; import java.util.logging.Logger;
import de.superx.bin.SxConnection; import de.superx.bin.SxConnection;
import de.superx.etl.QueryResultSerializer; import de.superx.elt.QueryResultSerializer;
public class EtlActionHandlerUnloadRecords extends EtlActionHandler implements EtlActionHandlerI { public class EtlActionHandlerUnloadRecords extends EtlActionHandler implements EtlActionHandlerI {

6
src/de/superx/etl/ActionHandler/EtlActionHandlerUploadRecords.java → src/de/superx/elt/ActionHandler/EtlActionHandlerUploadRecords.java

@ -5,7 +5,7 @@
* This package is licensed under the CampusSource License; * This package is licensed under the CampusSource License;
* http://www.campussource.de/org/license/ * http://www.campussource.de/org/license/
*/ */
package de.superx.etl.ActionHandler; package de.superx.elt.ActionHandler;
import java.io.StringWriter; import java.io.StringWriter;
import java.sql.Connection; import java.sql.Connection;
@ -14,8 +14,8 @@ import java.util.Properties;
import java.util.logging.Logger; import java.util.logging.Logger;
import de.superx.bin.SxConnection; import de.superx.bin.SxConnection;
import de.superx.etl.QueryResultSerializer; import de.superx.elt.QueryResultSerializer;
import de.superx.etl.TableUploader; import de.superx.elt.TableUploader;
public class EtlActionHandlerUploadRecords extends EtlActionHandler implements EtlActionHandlerI { public class EtlActionHandlerUploadRecords extends EtlActionHandler implements EtlActionHandlerI {

5
src/de/superx/etl/EtlAction.java → src/de/superx/elt/EtlAction.java

@ -5,7 +5,7 @@
* This package is licensed under the CampusSource License; * This package is licensed under the CampusSource License;
* http://www.campussource.de/org/license/ * http://www.campussource.de/org/license/
*/ */
package de.superx.etl; package de.superx.elt;
import java.io.BufferedReader; import java.io.BufferedReader;
import java.io.File; import java.io.File;
@ -26,6 +26,7 @@ import javax.sql.DataSource;
import de.superx.bin.SxConnection; import de.superx.bin.SxConnection;
import de.superx.common.Sichten; import de.superx.common.Sichten;
import de.superx.etl.EtlUtils;
public class EtlAction { public class EtlAction {
protected Properties params; protected Properties params;
@ -182,7 +183,7 @@ public class EtlAction {
} }
public Connection getConnection(Connection myConnection) throws Exception { public Connection getConnection(Connection myConnection) throws Exception {
String myDefaultPropFile=de.superx.etl.EtlUtils.WEBINFDIR+de.superx.etl.EtlUtils.PATHSEP+"db.properties"; String myDefaultPropFile=de.superx.elt.EtlUtils.WEBINFDIR+de.superx.elt.EtlUtils.PATHSEP+"db.properties";
if(myConnection==null) if(myConnection==null)
{ {
if(propfile==null) if(propfile==null)

7
src/de/superx/etl/EtlActionJob.java → src/de/superx/elt/EtlActionJob.java

@ -5,7 +5,7 @@
* This package is licensed under the CampusSource License; * This package is licensed under the CampusSource License;
* http://www.campussource.de/org/license/ * http://www.campussource.de/org/license/
*/ */
package de.superx.etl; package de.superx.elt;
import java.io.IOException; import java.io.IOException;
import java.io.PrintStream; import java.io.PrintStream;
@ -27,6 +27,7 @@ import de.superx.common.SuperX_el;
import de.superx.common.SxResultRow; import de.superx.common.SxResultRow;
import de.superx.common.SxResultSet; import de.superx.common.SxResultSet;
import de.superx.common.SxSqlHelper; import de.superx.common.SxSqlHelper;
import de.superx.etl.EtlUtils;
import de.superx.servlet.SxPools; import de.superx.servlet.SxPools;
import de.superx.util.SqlStringUtils; import de.superx.util.SqlStringUtils;
import freemarker.template.TemplateBooleanModel; import freemarker.template.TemplateBooleanModel;
@ -122,7 +123,7 @@ public class EtlActionJob extends EtlAction {
super.addActionLog("Runtime Params: "+runtimeParamsArg); super.addActionLog("Runtime Params: "+runtimeParamsArg);
} }
if(runTimeParams!=null) if(runTimeParams!=null)
this.setParams(de.superx.etl.EtlUtils.mergeParamProperties(this.getParams(), runTimeParams)); this.setParams(de.superx.elt.EtlUtils.mergeParamProperties(this.getParams(), runTimeParams));
super.addActionLog("Job "+jobCaption+ " initialized"); super.addActionLog("Job "+jobCaption+ " initialized");
} }
public int execute(String outfile) throws SQLException, Exception public int execute(String outfile) throws SQLException, Exception
@ -219,7 +220,7 @@ public class EtlActionJob extends EtlAction {
else else
{ {
try { try {
de.superx.etl.EtlUtils.saveFileContentsWithEncoding(outfile, sw.toString(), null); de.superx.elt.EtlUtils.saveFileContentsWithEncoding(outfile, sw.toString(), null);
} catch (Exception e) { } catch (Exception e) {
// TODO Auto-generated catch block // TODO Auto-generated catch block
e.printStackTrace(); e.printStackTrace();

4
src/de/superx/etl/EtlStep.java → src/de/superx/elt/EtlStep.java

@ -5,7 +5,7 @@
* This package is licensed under the CampusSource License; * This package is licensed under the CampusSource License;
* http://www.campussource.de/org/license/ * http://www.campussource.de/org/license/
*/ */
package de.superx.etl; package de.superx.elt;
import java.io.InputStream; import java.io.InputStream;
@ -27,7 +27,6 @@ import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.RowCallbackHandler; import org.springframework.jdbc.core.RowCallbackHandler;
import org.springframework.jdbc.datasource.DriverManagerDataSource; import org.springframework.jdbc.datasource.DriverManagerDataSource;
import de.superx.etl.ActionHandler.*;
import de.memtext.rights.RightsKeyEntry; import de.memtext.rights.RightsKeyEntry;
import de.memtext.util.GetOpts; import de.memtext.util.GetOpts;
import de.superx.bin.Doquery; import de.superx.bin.Doquery;
@ -36,6 +35,7 @@ import de.superx.common.SuperX_el;
import de.superx.common.SxResultRow; import de.superx.common.SxResultRow;
import de.superx.common.SxResultSet; import de.superx.common.SxResultSet;
import de.superx.common.SxSqlHelper; import de.superx.common.SxSqlHelper;
import de.superx.elt.ActionHandler.*;
import de.superx.servlet.SxPools; import de.superx.servlet.SxPools;
import de.superx.util.SqlStringUtils; import de.superx.util.SqlStringUtils;
import freemarker.template.TemplateBooleanModel; import freemarker.template.TemplateBooleanModel;

14
src/de/superx/etl/EtlUtils.java → src/de/superx/elt/EtlUtils.java

@ -5,7 +5,7 @@
* This package is licensed under the CampusSource License; * This package is licensed under the CampusSource License;
* http://www.campussource.de/org/license/ * http://www.campussource.de/org/license/
*/ */
package de.superx.etl; package de.superx.elt;
import java.io.BufferedReader; import java.io.BufferedReader;
import java.io.BufferedWriter; import java.io.BufferedWriter;
@ -53,7 +53,7 @@ public static void main(String args[]) {
try { try {
String tidInXmlFile=""; String tidInXmlFile="";
Document mydomres =de.superx.etl.EtlUtils.buildDocumentFromXmlFile("/home/superx/devel_module/community/tomcat/temp/myTempFile6460222908896375059.xml"); Document mydomres =de.superx.elt.EtlUtils.buildDocumentFromXmlFile("/home/superx/devel_module/community/tomcat/temp/myTempFile6460222908896375059.xml");
XPathFactory factory = new net.sf.saxon.xpath.XPathFactoryImpl(); XPathFactory factory = new net.sf.saxon.xpath.XPathFactoryImpl();
XPath xPath = factory.newXPath(); XPath xPath = factory.newXPath();
@ -91,6 +91,14 @@ public static Properties convertStringToProperty(String inp) throws IOException
myProps.load(new StringReader(inp)); myProps.load(new StringReader(inp));
return myProps; return myProps;
} }
public static Properties replaceSUPERX_DIRandETL_PFAD(Properties params) throws IOException
{
Properties returnProperties=new Properties();
Properties pathParams =convertStringToProperty("SUPERX_DIR="+SUPERX_DIR);
returnProperties=mergeParamProperties(params,pathParams);
return returnProperties;
}
public static Properties mergeParamProperties(Properties params, Properties runTimeParams) public static Properties mergeParamProperties(Properties params, Properties runTimeParams)
{ {
@ -310,7 +318,7 @@ public static String getFileContentsWithEncoding(String filePath, String encodin
public static boolean isNodeValueInXml(String src, String searchPath, String expectedValue) public static boolean isNodeValueInXml(String src, String searchPath, String expectedValue)
throws ParserConfigurationException, SAXException, IOException, XPathExpressionException { throws ParserConfigurationException, SAXException, IOException, XPathExpressionException {
boolean b=false; boolean b=false;
Document mydomres =de.superx.etl.EtlUtils.parseXml(src); Document mydomres =de.superx.elt.EtlUtils.parseXml(src);
XPathFactory factory = new net.sf.saxon.xpath.XPathFactoryImpl(); XPathFactory factory = new net.sf.saxon.xpath.XPathFactoryImpl();
XPath xPath = factory.newXPath(); XPath xPath = factory.newXPath();

6
src/de/superx/etl/QueryResultSerializer.java → src/de/superx/elt/QueryResultSerializer.java

@ -5,7 +5,7 @@
* This package is licensed under the CampusSource License; * This package is licensed under the CampusSource License;
* http://www.campussource.de/org/license/ * http://www.campussource.de/org/license/
*/ */
package de.superx.etl; package de.superx.elt;
import java.io.BufferedOutputStream; import java.io.BufferedOutputStream;
import java.io.FileNotFoundException; import java.io.FileNotFoundException;
import java.io.FileWriter; import java.io.FileWriter;
@ -34,8 +34,8 @@ import de.superx.bin.SxJdbcClient;
import java.util.Iterator; import java.util.Iterator;
import java.util.StringTokenizer; import java.util.StringTokenizer;
import de.superx.etl.bin.SxTransformer;
import de.superx.common.SxResultSet; import de.superx.common.SxResultSet;
import de.superx.elt.bin.SxTransformer;
import de.superx.servlet.ServletUtils; import de.superx.servlet.ServletUtils;
import de.superx.servlet.SxSQL_Server; import de.superx.servlet.SxSQL_Server;
import de.superx.util.SqlStringUtils; import de.superx.util.SqlStringUtils;
@ -373,7 +373,7 @@ public class QueryResultSerializer {
String headZs = "<rsmd>"; String headZs = "<rsmd>";
int colNumber = this.getColnames().length; int colNumber = this.getColnames().length;
for (int i = 0; i < colNumber; i++) { for (int i = 0; i < colNumber; i++) {
headZs += "<fld name=\"" + this.getColnames()[i] + "\" type=\""+SxDBUtils.getSqlTypeName(this.getColtypes()[i])+"\" />"+NEWLINE; headZs += "<fld name=\"" + this.getColnames()[i] + "\" type=\""+SxDBUtils.getSqlTypeName(this.getColtypes()[i])+"\"> </fld>"+NEWLINE;
} }
headZs+="</rsmd>"; headZs+="</rsmd>";

4
src/de/superx/etl/SqlExecutor.java → src/de/superx/elt/SqlExecutor.java

@ -5,7 +5,7 @@
* This package is licensed under the CampusSource License; * This package is licensed under the CampusSource License;
* http://www.campussource.de/org/license/ * http://www.campussource.de/org/license/
*/ */
package de.superx.etl; package de.superx.elt;
import java.io.BufferedOutputStream; import java.io.BufferedOutputStream;
import java.io.BufferedReader; import java.io.BufferedReader;
import java.io.File; import java.io.File;
@ -43,9 +43,9 @@ import java.util.Iterator;
import java.util.Properties; import java.util.Properties;
import java.util.StringTokenizer; import java.util.StringTokenizer;
import de.superx.etl.bin.SxTransformer;
import de.superx.bin.XUpdater; import de.superx.bin.XUpdater;
import de.superx.common.FieldContainer; import de.superx.common.FieldContainer;
import de.superx.elt.bin.SxTransformer;
import de.superx.servlet.ServletUtils; import de.superx.servlet.ServletUtils;
import de.superx.servlet.SuperXManager; import de.superx.servlet.SuperXManager;
import de.superx.servlet.SxPools; import de.superx.servlet.SxPools;

10
src/de/superx/etl/TableUploader.java → src/de/superx/elt/TableUploader.java

@ -5,7 +5,7 @@
* This package is licensed under the CampusSource License; * This package is licensed under the CampusSource License;
* http://www.campussource.de/org/license/ * http://www.campussource.de/org/license/
*/ */
package de.superx.etl; package de.superx.elt;
import java.io.BufferedReader; import java.io.BufferedReader;
import java.io.BufferedWriter; import java.io.BufferedWriter;
@ -37,7 +37,6 @@ import java.text.ParseException;
import java.util.Iterator; import java.util.Iterator;
import java.util.Properties; import java.util.Properties;
import de.superx.etl.util.FileUtils;
import de.superx.util.SqlStringUtils; import de.superx.util.SqlStringUtils;
import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilder;
@ -59,6 +58,7 @@ import org.postgresql.copy.CopyManager;
import de.superx.bin.SxConnection; import de.superx.bin.SxConnection;
import de.superx.bin.SxJdbcClient; import de.superx.bin.SxJdbcClient;
import de.superx.bin.UploadRecords; import de.superx.bin.UploadRecords;
import de.superx.elt.util.FileUtils;
import de.memtext.util.DateUtils; import de.memtext.util.DateUtils;
import de.memtext.util.GetOpts; import de.memtext.util.GetOpts;
import de.memtext.util.StringUtils; import de.memtext.util.StringUtils;
@ -252,7 +252,7 @@ public class TableUploader {
org.xml.sax.InputSource is; org.xml.sax.InputSource is;
NodeList rowlist; NodeList rowlist;
mydomres = de.superx.etl.EtlUtils.buildDocumentFromXmlFile(srcFile); mydomres = de.superx.elt.EtlUtils.buildDocumentFromXmlFile(srcFile);
if(xml_search_path==null) if(xml_search_path==null)
{ {
@ -375,7 +375,7 @@ public class TableUploader {
String copySql = "COPY " + targetTable + " FROM STDIN WITH DELIMITER '" + delim + "' NULL '' ENCODING '"+ encoding+"'"; String copySql = "COPY " + targetTable + " FROM STDIN WITH DELIMITER '" + delim + "' NULL '' ENCODING '"+ encoding+"'";
copySql += header ? " HEADER" : ""; copySql += header ? " HEADER" : "";
String srcFileContent=de.superx.etl.EtlUtils.getFileContentsWithEncoding(srcFile, encoding); String srcFileContent=de.superx.elt.EtlUtils.getFileContentsWithEncoding(srcFile, encoding);
String msg=""; String msg="";
try { try {
//dbmd=uploadConnection.getMetaData(); //dbmd=uploadConnection.getMetaData();
@ -399,7 +399,7 @@ public class TableUploader {
{ {
String srcFileIso=srcFile+"_iso.tmp"; String srcFileIso=srcFile+"_iso.tmp";
String srcFileContentValidIso = FileUtils.convertToIso(srcFileContent,"postgres") ;//new String(srcFileContent.getBytes("ISO-8859-1")); String srcFileContentValidIso = FileUtils.convertToIso(srcFileContent,"postgres") ;//new String(srcFileContent.getBytes("ISO-8859-1"));
de.superx.etl.EtlUtils.saveFileContentsWithEncoding(srcFileIso, srcFileContentValidIso, "iso-8859-9"); de.superx.elt.EtlUtils.saveFileContentsWithEncoding(srcFileIso, srcFileContentValidIso, "iso-8859-9");
FileInputStream fis = new FileInputStream(srcFileIso); FileInputStream fis = new FileInputStream(srcFileIso);
in4 = new BufferedReader(new InputStreamReader(fis, "iso-8859-9")); in4 = new BufferedReader(new InputStreamReader(fis, "iso-8859-9"));

4
src/de/superx/etl/bin/Doquery.java → src/de/superx/elt/bin/Doquery.java

@ -5,7 +5,7 @@
* This package is licensed under the CampusSource License; * This package is licensed under the CampusSource License;
* http://www.campussource.de/org/license/ * http://www.campussource.de/org/license/
*/ */
package de.superx.etl.bin; package de.superx.elt.bin;
import java.io.File; import java.io.File;
import java.io.FileInputStream; import java.io.FileInputStream;
@ -26,7 +26,7 @@ import java.util.StringTokenizer;
import de.superx.util.SqlStringUtils; import de.superx.util.SqlStringUtils;
import de.superx.bin.SxConnection; import de.superx.bin.SxConnection;
import de.superx.common.SuperX_el; import de.superx.common.SuperX_el;
import de.superx.etl.QueryResultSerializer; import de.superx.elt.QueryResultSerializer;
import de.superx.servlet.SxPools; import de.superx.servlet.SxPools;
import de.superx.servlet.SxSQL_Server; import de.superx.servlet.SxSQL_Server;

8
src/de/superx/etl/bin/Dosql.java → src/de/superx/elt/bin/Dosql.java

@ -5,7 +5,7 @@
* This package is licensed under the CampusSource License; * This package is licensed under the CampusSource License;
* http://www.campussource.de/org/license/ * http://www.campussource.de/org/license/
*/ */
package de.superx.etl.bin; package de.superx.elt.bin;
import java.io.BufferedReader; import java.io.BufferedReader;
import java.io.File; import java.io.File;
import java.io.FileInputStream; import java.io.FileInputStream;
@ -24,11 +24,11 @@ import java.util.logging.LogManager;
import java.util.logging.Logger; import java.util.logging.Logger;
import de.memtext.util.ExceptionHandler; import de.memtext.util.ExceptionHandler;
import de.superx.etl.util.GetOpts;
import de.memtext.util.PropUtils; import de.memtext.util.PropUtils;
import de.superx.bin.SxConnection; import de.superx.bin.SxConnection;
import de.superx.etl.EtlUtils; import de.superx.elt.EtlUtils;
import de.superx.etl.SqlExecutor; import de.superx.elt.SqlExecutor;
import de.superx.elt.util.GetOpts;
/** /**
* @author Daniel Quathamer Projektgruppe SuperX * @author Daniel Quathamer Projektgruppe SuperX

10
src/de/superx/etl/bin/EtlJobExecutor.java → src/de/superx/elt/bin/EtlJobExecutor.java

@ -5,13 +5,13 @@
* This package is licensed under the CampusSource License; * This package is licensed under the CampusSource License;
* http://www.campussource.de/org/license/ * http://www.campussource.de/org/license/
*/ */
package de.superx.etl.bin; package de.superx.elt.bin;
import java.sql.Connection; import java.sql.Connection;
import de.superx.etl.util.GetOpts; import de.superx.elt.EtlActionJob;
import de.superx.etl.EtlActionJob; import de.superx.elt.EtlUtils;
import de.superx.etl.EtlUtils; import de.superx.elt.util.GetOpts;
public class EtlJobExecutor { public class EtlJobExecutor {
@ -20,7 +20,7 @@ public class EtlJobExecutor {
} }
public static void main(String[] args) { public static void main(String[] args) {
String usage="usage: java de.superx.bin.EtlJobExecutor -dbproperties:$DB_PROPERTIES -job:abc -params:TID=16000 (optional) -outfile:Ausgabedatei (optional)" ; String usage="usage: java de.superx.elt.bin.EtlJobExecutor -dbproperties:$DB_PROPERTIES -job:abc -params:TID=16000 (optional) -outfile:Ausgabedatei (optional)" ;
GetOpts.setOpts(args); GetOpts.setOpts(args);
String isdrin = GetOpts.isAllRequiredOptionsPresent("-dbproperties,-job"); String isdrin = GetOpts.isAllRequiredOptionsPresent("-dbproperties,-job");

2
src/de/superx/etl/bin/SxTransformer.java → src/de/superx/elt/bin/SxTransformer.java

@ -5,7 +5,7 @@
* This package is licensed under the CampusSource License; * This package is licensed under the CampusSource License;
* http://www.campussource.de/org/license/ * http://www.campussource.de/org/license/
*/ */
package de.superx.etl.bin; package de.superx.elt.bin;
import java.io.BufferedWriter; import java.io.BufferedWriter;
import java.io.File; import java.io.File;

4
src/de/superx/etl/bin/UnloadRecords.java → src/de/superx/elt/bin/UnloadRecords.java

@ -5,7 +5,7 @@
* This package is licensed under the CampusSource License; * This package is licensed under the CampusSource License;
* http://www.campussource.de/org/license/ * http://www.campussource.de/org/license/
*/ */
package de.superx.etl.bin; package de.superx.elt.bin;
import java.io.File; import java.io.File;
import java.io.FileInputStream; import java.io.FileInputStream;
import java.io.FileNotFoundException; import java.io.FileNotFoundException;
@ -25,7 +25,7 @@ import java.util.StringTokenizer;
import de.superx.util.SqlStringUtils; import de.superx.util.SqlStringUtils;
import de.superx.bin.SxConnection; import de.superx.bin.SxConnection;
import de.superx.common.SuperX_el; import de.superx.common.SuperX_el;
import de.superx.etl.QueryResultSerializer; import de.superx.elt.QueryResultSerializer;
import de.superx.servlet.SxPools; import de.superx.servlet.SxPools;
import de.superx.servlet.SxSQL_Server; import de.superx.servlet.SxSQL_Server;

6
src/de/superx/etl/bin/UploadRecords.java → src/de/superx/elt/bin/UploadRecords.java

@ -5,9 +5,9 @@
* This package is licensed under the CampusSource License; * This package is licensed under the CampusSource License;
* http://www.campussource.de/org/license/ * http://www.campussource.de/org/license/
*/ */
package de.superx.etl.bin; package de.superx.elt.bin;
import de.superx.etl.util.GetOpts; import de.superx.elt.TableUploader;
import de.superx.etl.TableUploader; import de.superx.elt.util.GetOpts;
/* /*
* @author Daniel Quathamer Projektgruppe SuperX * @author Daniel Quathamer Projektgruppe SuperX

2
src/de/superx/etl/util/FileUtils.java → src/de/superx/elt/util/FileUtils.java

@ -1,4 +1,4 @@
package de.superx.etl.util; package de.superx.elt.util;
import java.io.BufferedReader; import java.io.BufferedReader;
import java.io.BufferedWriter; import java.io.BufferedWriter;

2
src/de/superx/etl/util/GetOpts.java → src/de/superx/elt/util/GetOpts.java

@ -1,4 +1,4 @@
package de.superx.etl.util; package de.superx.elt.util;
import java.util.StringTokenizer; import java.util.StringTokenizer;

2
src/de/superx/etl/util/GetOptsBackport.java → src/de/superx/elt/util/GetOptsBackport.java

@ -1,4 +1,4 @@
package de.superx.etl.util; package de.superx.elt.util;
/** /**
* Class to analyze arguments passed to Java class * Class to analyze arguments passed to Java class

2
src/de/superx/sxrest/JobExecutor.java

@ -13,7 +13,7 @@ import java.sql.SQLException;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import de.memtext.util.DateUtils; import de.memtext.util.DateUtils;
import de.superx.common.SxUser; import de.superx.common.SxUser;
import de.superx.etl.EtlActionJob; import de.superx.elt.EtlActionJob;
import de.superx.servlet.SuperXManager; import de.superx.servlet.SuperXManager;
@Path("/execute") @Path("/execute")

4
src/de/superx/sxrest/LaunchUpgrade.java

@ -15,8 +15,8 @@ import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Request; import javax.ws.rs.core.Request;
import de.memtext.util.DateUtils; import de.memtext.util.DateUtils;
import de.superx.common.SxUser; import de.superx.common.SxUser;
import de.superx.etl.EtlActionJob; import de.superx.elt.EtlActionJob;
import de.superx.etl.EtlUtils; import de.superx.elt.EtlUtils;
import de.superx.servlet.SuperXManager; import de.superx.servlet.SuperXManager;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;

32
src/de/superx/sxrest/MaskXml.java

@ -35,8 +35,8 @@ import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Request; import javax.ws.rs.core.Request;
import de.memtext.util.DateUtils; import de.memtext.util.DateUtils;
import de.superx.common.SxUser; import de.superx.common.SxUser;
import de.superx.etl.EtlActionJob; import de.superx.elt.EtlActionJob;
import de.superx.etl.EtlUtils; import de.superx.elt.EtlUtils;
import de.superx.servlet.SuperXManager; import de.superx.servlet.SuperXManager;
import java.io.BufferedWriter; import java.io.BufferedWriter;
@ -55,12 +55,18 @@ public class MaskXml {
@GET @GET
@Path("/get/{param}") @Path("/get/{param}")
@Produces(MediaType.TEXT_PLAIN) @Produces(MediaType.APPLICATION_XML)
public String printXml(@PathParam("param") String tid,@Context HttpServletRequest request) { public Document printXml(@PathParam("param") String tid,@Context HttpServletRequest request) {
String returntext=""; String returntext="";
SxUser user = (SxUser) request.getSession().getAttribute("user"); returntext = getMaskXml(tid, request);
return de.memtext.util.XMLUtils.buildDocumentFromString(returntext, false);
}
private String getMaskXml(String tid, HttpServletRequest request) {
String returntext;
SxUser user = (SxUser) request.getSession().getAttribute("user");
String mandantenid= (String) request.getSession().getAttribute("MandantenID"); String mandantenid= (String) request.getSession().getAttribute("MandantenID");
if(mandantenid==null || mandantenid.equals("")) if(mandantenid==null || mandantenid.equals(""))
mandantenid="default"; mandantenid="default";
@ -94,9 +100,18 @@ public class MaskXml {
returntext+=myJob.getLogoutput(); returntext+=myJob.getLogoutput();
} }
} }
return returntext;
return returntext; }
@GET
@Path("/download/{param}")
@Produces(MediaType.APPLICATION_XML)
public String createDownloadXml(@PathParam("param") String tid,@Context HttpServletRequest request) {
String returntext="";
returntext = getMaskXml(tid, request);
return returntext;
//return de.memtext.util.XMLUtils.buildDocumentFromString(returntext, false);
} }
/* Aktuell noch nicht genutzt: */
@GET @GET
@Path("/saveget/{params}") @Path("/saveget/{params}")
@Produces(MediaType.TEXT_PLAIN) @Produces(MediaType.TEXT_PLAIN)
@ -121,6 +136,7 @@ public class MaskXml {
return returntext; return returntext;
} }
/* Aktuell noch nicht genutzt: */
@POST @POST
@Path("/save") @Path("/save")
@Consumes("application/x-www-form-urlencoded") @Consumes("application/x-www-form-urlencoded")
@ -146,7 +162,7 @@ public class MaskXml {
else else
{ {
try { try {
if(de.superx.etl.EtlUtils.isNodeValueInXml(src,searchString,tid)) if(de.superx.elt.EtlUtils.isNodeValueInXml(src,searchString,tid))
{ {
String job="sx_insert_mask"; String job="sx_insert_mask";
returntext="TID="+tid; returntext="TID="+tid;

BIN
superx/WEB-INF/lib/superx-etl.jar

Binary file not shown.

39
superx/edit/etl/etl_manager.jsp

@ -11,6 +11,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<title>ETL Manager</title> <title>ETL Manager</title>
<link rel="stylesheet" href="../../style/bulma.css" /> <link rel="stylesheet" href="../../style/bulma.css" />
<link rel="stylesheet" href="../../style/bulma-tooltip.min.css" />
<script type="text/javascript" src="/superx/xml/js/memtext/sx_functions.js"></script> <script type="text/javascript" src="/superx/xml/js/memtext/sx_functions.js"></script>
</head> </head>
<script language="Javascript"> <script language="Javascript">
@ -32,10 +33,13 @@ var xhttp = new XMLHttpRequest();
function getMaskMenu(srctype) function getMaskMenu(srctype)
{ {
if(srctype=="load") if(srctype=="load")
{ {
document.getElementById("MaskHeader").innerHTML="Masken-Quellcode exportieren"; document.getElementById("MaskHeader").innerHTML="Masken-Quellcode exportieren";
document.getElementById("MaskSubHeader").innerHTML="TID = <input type='text' size='10' id='Maskentid' />"+" <button class=\"button has-tooltip-multiline has-tooltip-right\" data-tooltip=\"Quellcode der Maske mit der Nummer im Feld TID exportieren\" onclick=\"getMaskSrc(document.getElementById('Maskentid').value)\">exportieren...</button>"; var zs="TID = <input type='text' size='10' id='Maskentid' />"+" <button class=\"button has-tooltip-multiline has-tooltip-right\" data-tooltip=\"Quellcode der Maske mit der Nummer im Feld TID exportieren\" onclick=\"getMaskSrc(document.getElementById('Maskentid').value)\">anzeigen...</button>";
zs +="<button class=\"button has-tooltip-multiline has-tooltip-right\" data-tooltip=\"Quellcode der Maske mit der Nummer im Feld TID herunterladen\" onclick=\"downloadMaskSrc(document.getElementById('Maskentid').value)\">herunterladen...</button>";
document.getElementById("MaskSubHeader").innerHTML=zs;
} }
if(srctype=="save") if(srctype=="save")
{ {
@ -56,7 +60,11 @@ function getMaskSrc(tid)
var xhttp = new XMLHttpRequest(); var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() { xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) { if (this.readyState == 4 && this.status == 200) {
document.getElementById("Inhalt").innerHTML = this.responseText; var xmlDoc=this.responseXML;
var xmlTxt=new XMLSerializer().serializeToString(xmlDoc);
document.getElementById("Inhalt").value=xmlTxt;
// document.getElementById("Inhalt").innerHTML = this.responseText;
//alert(this.responseText); //alert(this.responseText);
} }
else else
@ -69,7 +77,11 @@ var xhttp = new XMLHttpRequest();
} }
function downloadMaskSrc(tid)
{
window.open("../../sxrest/maskxml/download/"+tid,"_blank");
}
function saveMaskSrc(tid) function saveMaskSrc(tid)
{ {
document.forms["saveMask"].elements["src"].value=document.getElementById("Inhalt").value; document.forms["saveMask"].elements["src"].value=document.getElementById("Inhalt").value;
@ -100,7 +112,20 @@ document.getElementById("MaskSubHeader").innerHTML=menuLines;
} }
function copyTextWithTooltip(mydiv,mybutton)
{
var fldElem=document.getElementById(mydiv);
// Select the text field
fldElem.select();
fldElem.setSelectionRange(0, 999999); // For mobile devices
// Copy the text inside the text field
navigator.clipboard.writeText(fldElem.value);
if(mybutton)
{
mybutton.setAttribute("data-tooltip","Kopiert: "+ fldElem.value.substring(0,10)+"...");
}
}
@ -132,11 +157,7 @@ if(tab == null)
<a class="navbar-item" href="etl_manager.jsp">ETL Manager</a> <a class="navbar-item" href="etl_manager.jsp">ETL Manager</a>
<div class="navbar-burger burger" data-target="navMenu">
<span>dd</span>
<span>dd</span>
<span>dd</span>
</div>
</div> </div>
<a class="navbar-item" href="etl_manager.jsp?tab=mask"> <a class="navbar-item" href="etl_manager.jsp?tab=mask">
Masken Masken
@ -175,7 +196,7 @@ if(tab.equals("mask"))
</p> </p>
<ul class="menu-list"> <ul class="menu-list">
<li><a onClick="getMaskMenu('load');">Masken-Quellcode exportieren</a></li> <li><a onClick="getMaskMenu('load');">Masken-Quellcode exportieren</a></li>
<li><a onClick="getMaskMenu('save');">Masken-Quellcode importieren</a></li> <li><a onClick="getMaskMenu('save');">Masken-Quellcode importieren</a></li>
</ul> </ul>
@ -276,7 +297,7 @@ if(tab.equals("mask"))
<div class="bd-snippet-code highlight-full "> <div class="bd-snippet-code highlight-full ">
<figure class="highlight"><div class="buttons has-addons is-right"> <figure class="highlight"><div class="buttons has-addons is-right">
<button class="button is-small is-info" onClick="copyText('Inhalt');">Kopieren</button> <button class="button is-small is-info" data-tooltip="in die Zwischenablage kopieren" onClick="copyTextWithTooltip('Inhalt',this);">Kopieren</button>
</div> </div>
<textarea id="Inhalt" name="Inhalt" class="textarea" placeholder="Inhalt..." rows="20"></textarea> <textarea id="Inhalt" name="Inhalt" class="textarea" placeholder="Inhalt..." rows="20"></textarea>

26
superx/edit/etl/jobexecutor.jsp

@ -6,8 +6,8 @@
<%@ page import ="java.io.File" %> <%@ page import ="java.io.File" %>
<%@ page import ="java.io.FileWriter" %> <%@ page import ="java.io.FileWriter" %>
<%@ page import ="java.io.IOException" %> <%@ page import ="java.io.IOException" %>
<%@ page import ="de.superx.etl.EtlActionJob" %> <%@ page import ="de.superx.elt.EtlActionJob" %>
<%@ page import ="de.superx.etl.EtlUtils" %> <%@ page import ="de.superx.elt.EtlUtils" %>
<%@ page import ="de.superx.common.SxUser" %> <%@ page import ="de.superx.common.SxUser" %>
<%@ page import ="de.superx.servlet.SuperXManager" %> <%@ page import ="de.superx.servlet.SuperXManager" %>
@ -82,27 +82,25 @@ String componentAction = request.getParameter("componentAction");
else else
{ {
try { try {
String job=componentUniquename+"_"+componentAction; String job=componentUniquename+"_"+componentAction;
String params=componentUniquename.toUpperCase()+"_PFAD="+SuperXManager.getWEB_INFPfad()+EtlUtils.PATHSEP+"conf"+EtlUtils.PATHSEP+"edustore"+EtlUtils.PATHSEP+"db"+EtlUtils.PATHSEP+"module"+EtlUtils.PATHSEP+componentUniquename; String params=componentUniquename.toUpperCase()+"_PFAD="+SuperXManager.getWEB_INFPfad()+EtlUtils.PATHSEP+"conf"+EtlUtils.PATHSEP+"edustore"+EtlUtils.PATHSEP+"db"+EtlUtils.PATHSEP+"module"+EtlUtils.PATHSEP+componentUniquename;
EtlActionJob myJob=new EtlActionJob(job); //TODO:Mandantid
myJob.initJob(job,params);
returnCode= myJob.execute("");
returntext+=myJob.getActionLog().toString();
EtlActionJob myJob=new EtlActionJob(job); //TODO:Mandantid
myJob.initJob(job,params);
returnCode= myJob.execute("");
returntext+=myJob.getActionLog().toString();
} catch (Exception e) { } catch (Exception e) {
returnCode=1; returnCode=1;
returntext=e.toString(); returntext=e.toString();
e.printStackTrace(); e.printStackTrace();
} }
} }
%> %>
<!-- START NAV --> <!-- START NAV -->
<nav class="navbar is-white"> <nav class="navbar is-white">
@ -143,7 +141,7 @@ String componentAction = request.getParameter("componentAction");
<h2 class="subtitle"> <h2 class="subtitle">
<div id="MaskSubHeader">Ergebnis der Ausführung</div> <div id="MaskSubHeader">Ergebnis der Ausführung</div>
</h2> </h2>
<p>Status: <%= "Code "+ returnCode+ "("+de.superx.etl.EtlUtils.translateReturnCode(returnCode)+")" %>, Logausgabe: <p>Status: <%="Code "+ returnCode+ "("+de.superx.elt.EtlUtils.translateReturnCode(returnCode)+")"%>, Logausgabe:
</p> </p>
<div class="bd-snippet-code highlight-full "> <div class="bd-snippet-code highlight-full ">
<figure class="highlight"><div class="buttons has-addons is-right"> <figure class="highlight"><div class="buttons has-addons is-right">

58
superx/edit/etl/saveMask.jsp

@ -6,8 +6,8 @@
<%@ page import ="java.io.File" %> <%@ page import ="java.io.File" %>
<%@ page import ="java.io.FileWriter" %> <%@ page import ="java.io.FileWriter" %>
<%@ page import ="java.io.IOException" %> <%@ page import ="java.io.IOException" %>
<%@ page import ="de.superx.etl.EtlActionJob" %> <%@ page import ="de.superx.elt.EtlActionJob" %>
<%@ page import ="de.superx.etl.EtlUtils" %> <%@ page import ="de.superx.elt.EtlUtils" %>
<%@ page import ="de.superx.common.SxUser" %> <%@ page import ="de.superx.common.SxUser" %>
<html> <html>
@ -46,43 +46,41 @@ String src = request.getParameter("src");
else else
{ {
try { try {
if(de.superx.etl.EtlUtils.isNodeValueInXml(src,searchString,tid)) if(de.superx.elt.EtlUtils.isNodeValueInXml(src,searchString,tid))
{ {
String job="sx_insert_mask"; String job="sx_insert_mask";
returntext="TID="+tid; returntext="TID="+tid;
String params="TID="+tid; String params="TID="+tid;
File temp; File temp;
temp = File.createTempFile("myTempFile", ".xml"); temp = File.createTempFile("myTempFile", ".xml");
BufferedWriter bw = new BufferedWriter(new FileWriter(temp)); BufferedWriter bw = new BufferedWriter(new FileWriter(temp));
bw.write(src); bw.write(src);
bw.close(); bw.close();
params+=EtlUtils.NEWLINE+"PATH_TO_INPUTFILE="+temp.getAbsolutePath(); params+=EtlUtils.NEWLINE+"PATH_TO_INPUTFILE="+temp.getAbsolutePath();
params+=EtlUtils.NEWLINE+"FORMAT=XML"; params+=EtlUtils.NEWLINE+"FORMAT=XML";
EtlActionJob myJob=new EtlActionJob(job); //TODO:Mandantid EtlActionJob myJob=new EtlActionJob(job); //TODO:Mandantid
myJob.initJob(job,params); myJob.initJob(job,params);
returnCode= myJob.execute(""); returnCode= myJob.execute("");
returntext+=myJob.getActionLog().toString(); returntext+=myJob.getActionLog().toString();
} }
else else
{ {
returntext="Übergebene TID "+tid+" entspricht nicht der XML-Datei "; returntext="Übergebene TID "+tid+" entspricht nicht der XML-Datei ";
returnCode=1; returnCode=1;
} }
} catch (Exception e) { } catch (Exception e) {
returnCode=1; returnCode=1;
returntext=e.toString(); returntext=e.toString();
e.printStackTrace(); e.printStackTrace();
} }
} }
%> %>
<!-- START NAV --> <!-- START NAV -->
<nav class="navbar is-white"> <nav class="navbar is-white">
@ -123,7 +121,7 @@ String src = request.getParameter("src");
<h2 class="subtitle"> <h2 class="subtitle">
<div id="MaskSubHeader">Ergebnis der Ausführung</div> <div id="MaskSubHeader">Ergebnis der Ausführung</div>
</h2> </h2>
<p>Status: <%= "Code "+ returnCode+ "("+de.superx.etl.EtlUtils.translateReturnCode(returnCode)+")" %>, Logausgabe: <p>Status: <%="Code "+ returnCode+ "("+de.superx.elt.EtlUtils.translateReturnCode(returnCode)+")"%>, Logausgabe:
</p> </p>
<div class="bd-snippet-code highlight-full "> <div class="bd-snippet-code highlight-full ">
<figure class="highlight"><div class="buttons has-addons is-right"> <figure class="highlight"><div class="buttons has-addons is-right">

Loading…
Cancel
Save