Browse Source

Sichten und Testfälle exportieren #5

master
Daniel Quathamer 1 month ago
parent
commit
a5f12f59c9
  1. 2
      .classpath
  2. 53
      src-modules/module/etl/conf/etl.xml
  3. 2
      src-modules/module/etl/conf/includes.txt
  4. 19
      src-modules/module/etl/masken/42000_felderinfo.unl
  5. 2
      src-modules/module/etl/masken/42000_masken_felder_bez.unl
  6. 22
      src-modules/module/etl/schluesseltabellen/create_load_etl_qa_project.sql
  7. 49
      src-modules/module/etl/schluesseltabellen/create_load_etl_sichten.sql
  8. 3
      src-modules/module/etl/schluesseltabellen/etl_manager_tab.unl
  9. 12
      src-modules/module/etl/schluesseltabellen/etl_manager_tab_prepare.sql
  10. 67
      src-modules/module/etl/schluesseltabellen/etl_step_fuellen.sql
  11. 61
      src-modules/module/etl/schluesseltabellen/trans_etl_sichten.sql
  12. 11
      src/de/superx/elt/EtlUtils.java
  13. 213
      src/de/superx/sxrest/JobEtlXml.java
  14. 5
      src/de/superx/sxrest/MaskXml.java
  15. BIN
      superx/WEB-INF/lib/superx-etl.jar
  16. 277
      superx/edit/etl/etl_manager.jsp
  17. 143
      superx/edit/etl/saveEtlXml.jsp
  18. 54
      superx/images/downloadblck.svg
  19. 55
      superx/images/eye.svg

2
.classpath

@ -4,7 +4,6 @@ @@ -4,7 +4,6 @@
<classpathentry kind="src" path="src"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/freemarker-2.3.25.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/postgresql-42.2.19.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/superx5.0.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/saxon-he-10.5.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib_ext/servlet-api.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/jersey-core-1.11.jar"/>
@ -19,5 +18,6 @@ @@ -19,5 +18,6 @@
<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="lib" path="/kern/superx/WEB-INF/lib/superx5.2.jar"/>
<classpathentry kind="output" path="superx/WEB-INF/classes"/>
</classpath>

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

@ -38,6 +38,48 @@ rightname="CS_BIA_STANDARDREPORTS_ADMIN[ETL]" /> @@ -38,6 +38,48 @@ rightname="CS_BIA_STANDARDREPORTS_ADMIN[ETL]" />
<indexes>
</indexes>
</table>
<table name="etl_manager_tab" thema="Administration" releaseUnload="demo"
typ="Schlüsseltabelle">
<description>Schlüsseltabelle für Ladejob im ETL-Manager</description>
<columns>
<column name="tid" type="SERIAL" size="" default=""
notnull="true" description="tid" isKey="true" />
<column name="uniquename" type="VARCHAR" size="255" default=""
notnull="true" description="Unique Name" />
<column name="caption" type="VARCHAR" size="255" default=""
notnull="" description="Bezeichnung" />
<column name="job_export" type="VARCHAR" size="255" default=""
notnull="" description="Job zum Exportieren" />
<column name="job_import" type="VARCHAR" size="255" default=""
notnull="" description="Job zum Importieren" />
<column name="job_param_ui" type="VARCHAR" size="255" default=""
notnull="" description="Identifikator im Job" />
<column name="systeminfo_id" type="INTEGER" size="" default=""
notnull="true" description="Komponente" />
<column name="maskeninfo_id" type="INTEGER" size="" default=""
notnull="false" description="Maske (für Suche/Auswahl)" />
<column name="felderinfo_id" type="INTEGER" size="" default=""
notnull="false" description="Maskenfeld (für Suche/Auswahl)" />
<column name="active" type="INTEGER" size="" default="1"
notnull="true" description="Aktiv" />
</columns>
<primaryKeys>
<rs>
<row>
<fld name='table_cat'>superx</fld>
<fld name='table_schem'>superx</fld>
<fld name='table_name'>etl_manager_tab</fld>
<fld name='column_name'>tid</fld>
<fld name='key_seq'>1</fld>
<fld name='pk_name'>etl_manager_tab_pk</fld>
</row>
</rs>
</primaryKeys>
<indexes>
</indexes>
</table>
<views>
</views>
@ -334,7 +376,9 @@ parent="Laderoutinen">Abfragen zur Administration</thema> @@ -334,7 +376,9 @@ parent="Laderoutinen">Abfragen zur Administration</thema>
<install>
<install-step name="Füllen der Modul-Tabellen">
<action error="stop">
<loadtable refresh="true" delimiter="^" header="false" tabname="etl_manager_tab"><file path="$ETL_PFAD/schluesseltabellen/etl_manager_tab.unl"/></loadtable>
<loadtable refresh="true" delimiter="^" header="false" tabname="etl_step_type"><file path="$ETL_PFAD/schluesseltabellen/etl_step_type.unl"/></loadtable>
<loadtable refresh="true" delimiter="^" header="false" tabname="etl_manager_tab"><file path="$ETL_PFAD/schluesseltabellen/etl_manager_tab.unl"/></loadtable>
<nativeaction sql="" scriptfile="$ETL_PFAD/schluesseltabellen/sachgebiete_fuellen.sql" database=""/>
<nativeaction sql="" scriptfile="$ETL_PFAD/schluesseltabellen/etl_step_fuellen.sql" database=""/>
<nativeaction sql="" scriptfile="$ETL_PFAD/schluesseltabellen/etl_step_users_groups.sql" database=""/>
@ -345,6 +389,10 @@ parent="Laderoutinen">Abfragen zur Administration</thema> @@ -345,6 +389,10 @@ parent="Laderoutinen">Abfragen zur Administration</thema>
</action>
<action>
<nativeaction sql="" scriptfile="$ETL_PFAD/schluesseltabellen/etl_manager_tab_prepare.sql" database=""/>
</action>
</install-step>
</install>
@ -368,6 +416,7 @@ version integer @@ -368,6 +416,7 @@ version integer
</action>
<action error="stop">
<loadtable refresh="true" delimiter="^" header="false" tabname="etl_manager_tab"><file path="$ETL_PFAD/schluesseltabellen/etl_manager_tab.unl"/></loadtable>
<loadtable refresh="true" delimiter="^" header="false" tabname="etl_step_type"><file path="$ETL_PFAD/schluesseltabellen/etl_step_type.unl"/></loadtable>
<nativeaction sql="" scriptfile="$ETL_PFAD/schluesseltabellen/etl_step_fuellen.sql" database=""/>
<nativeaction sql="" scriptfile="$ETL_PFAD/schluesseltabellen/etl_step_users_groups.sql" database=""/>
@ -376,6 +425,10 @@ version integer @@ -376,6 +425,10 @@ version integer
<nativeaction sql="" scriptfile="$ETL_PFAD/schluesseltabellen/sachgebiete_fuellen.sql" database=""/>
</action>
<action>
<nativeaction sql="" scriptfile="$ETL_PFAD/schluesseltabellen/etl_manager_tab_prepare.sql" database=""/>
</action>
</upgrade-step>
</upgrade>

2
src-modules/module/etl/conf/includes.txt

@ -1,4 +1,6 @@ @@ -1,4 +1,6 @@
doku/etl_modul/etl.html
WEB-INF/conf/edustore/db/bin/SQL_ENV_etl.sam
WEB-INF/lib/superx-etl.jar
images/eye.svg
images/downloadblck.svg

19
src-modules/module/etl/masken/42000_felderinfo.unl

@ -3,4 +3,21 @@ @@ -3,4 +3,21 @@
42002^Arten von Ladeschritten^100^0^0^150^300^1^char^30^0^18^^^<<SQL>>select '../edit/etl/etl_step_type_list.jsp' from xdummy;^
42003^Name^20^0^0^150^150^1^sql^50^0^0^^^^
42004^Komponente^30^0^0^150^200^1^integer^200^0^1^<<SQL>> select tid,name from systeminfo order by 2;^^^
42005^ETL-Manager^1000^0^0^150^300^1^char^30^0^18^^^<<SQL>>select '../edit/etl/etl_manager.jsp' from xdummy;^
42005^Job-Management^1000^0^0^150^300^1^char^30^0^18^^^<<SQL>>select '../edit/etl/etl_manager.jsp' from xdummy;^
42006^Maske^1^0^0^100^380^1^integer^30^0^1^<<SQL>> select M.tid, M.tid || ' - ' || M.name from maskeninfo M, sachgeb_maske_bez S where M.tid=S.maskeninfo_id order by 1;^hidden^^
42007^Testfall-Projekt^15^0^0^150^80^1^integer^200^0^1^<<SQL>> --freemarker template\
<sqlvars>\
<sqlvar name="QA_installed">\
select 1 from xdummy where 0 &lt; (select count(*) from db_version where his_system='qa')\
union select 0 from xdummy where \
0 = (select count(*) from db_version where his_system='qa');\
</sqlvar>\
</sqlvars>\
\
<#if QA_installed==1>\
select tid,name from qa_project where active=1 order by 2;\
<#else>\
select null::char(1),'Keine Auwahl möglich' from xdummy\
</#if>\
\
/* <<just a comment to make it a modal dialog>> */^ ^^

2
src-modules/module/etl/masken/42000_masken_felder_bez.unl

@ -4,3 +4,5 @@ @@ -4,3 +4,5 @@
42000^42003^
42000^42004^
42000^42005^
42000^42006^
42000^42007^

22
src-modules/module/etl/schluesseltabellen/create_load_etl_qa_project.sql

@ -0,0 +1,22 @@ @@ -0,0 +1,22 @@
--Freemarker Template
--used in etl-job sx_insert_mask
<#if SQLdialect='Postgres'>
drop table if exists tmp_etl_qa_project;
drop table if exists tmp_etl_sachgeb_sichtarten;
</#if>
CREATE TABLE tmp_etl_qa_project(
uniquename VARCHAR(255) ,
name VARCHAR(255) ,
systeminfo_id INTEGER ,
sachgebiete_id INTEGER ,
active SMALLINT ,
created_from INTEGER ,
issue_link VARCHAR(255)
)
;

49
src-modules/module/etl/schluesseltabellen/create_load_etl_sichten.sql

@ -0,0 +1,49 @@ @@ -0,0 +1,49 @@
--Freemarker Template
--used in etl-job sx_insert_mask
<#if SQLdialect='Postgres'>
drop table if exists tmp_etl_sichten;
drop table if exists tmp_etl_sachgeb_sichtarten;
</#if>
CREATE TABLE tmp_etl_sichten (
-- tid integer,
--
-- parent CHAR(255) ,
systeminfoid INTEGER default 0 not null,
art CHAR(40) ,
type INTEGER default 10 not null,
name_intern CHAR(200) ,
name CHAR(200) ,
-- beschreibung CHAR(255) ,
sortnr INTEGER default 0 not null,
quelle TEXT ,
-- alt_hier_id CHAR(150) ,
-- treecfgtable CHAR(255) ,
-- treecfgid CHAR(150) ,
-- label SMALLINT default 0 not null,
-- user_rechte SMALLINT default 1 not null,
-- rechtequelle CHAR(255) ,
-- sesamkey CHAR(100) ,
standbutton SMALLINT default 0 not null,
-- attribut1 CHAR(255) ,
-- attribut2 CHAR(255) ,
-- attribut3 INTEGER ,
-- attribut4 INTEGER ,
-- xmlmaxentries INTEGER ,
-- gueltig_seit DATE default date('01.01.1900') not null,
-- gueltig_bis DATE default date('01.01.3000') not null,
-- cacheapplet CHAR(255) ,
-- cachexml CHAR(255) ,
aktiv SMALLINT default 1
);
create table tmp_etl_sachgeb_sichtarten(
sachgebiete_id INTEGER ,
sichtart CHAR(255)
)
;

3
src-modules/module/etl/schluesseltabellen/etl_manager_tab.unl

@ -0,0 +1,3 @@ @@ -0,0 +1,3 @@
1^MASK^Masken^0^sx_select_mask^sx_insert_mask^TID^42000^42006^1^
2^SICHT^Sichten^0^sichten_unload^sichten_upload^SYSTEMINFO_ID^42000^42004^1^
3^QA_PROJECT^Testfälle^0^qa_project_unload^qa_project_upload^QA_PROJECT_ID^42000^42007^1^

12
src-modules/module/etl/schluesseltabellen/etl_manager_tab_prepare.sql

@ -0,0 +1,12 @@ @@ -0,0 +1,12 @@
--freemarker template
<sqlvars>
<sqlvar name="QA_installed">
select 1 from xdummy where 0 &lt; (select count(*) from db_version where his_system='qa')
union select 0 from xdummy where
0 = (select count(*) from db_version where his_system='qa');
</sqlvar>
</sqlvars>
<#if QA_installed==0>
update etl_manager_tab set active=0 where uniquename='QA_PROJECT';
</#if>

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

@ -8,7 +8,9 @@ @@ -8,7 +8,9 @@
{"uniquename":"sx_insert_mask", "name":"Maske hochladen", "systeminfo_id":270 ,"logfile":""},
{"uniquename":"kern_konstanten_update", "name":"Konstanten aktualisieren", "systeminfo_id":270 ,"logfile":""},
{"uniquename":"sichten_unload", "name":"Sichten entladen", "systeminfo_id":270 ,"logfile":""},
{"uniquename":"sos_gewichtung_unload", "name":"Gewichtungen entladen", "systeminfo_id":270 ,"logfile":""}
{"uniquename":"sichten_upload", "name":"Sichten hochladen", "systeminfo_id":270 ,"logfile":""},
{"uniquename":"sos_gewichtung_unload", "name":"Gewichtungen entladen", "systeminfo_id":270 ,"logfile":""},
{"uniquename":"qa_project_unload", "name":"Testfallprojekte entladen", "systeminfo_id":260 ,"logfile":""}
] />
@ -25,10 +27,20 @@ @@ -25,10 +27,20 @@
{"etl_job":"kern_konstanten_update","param_name":"SUPERX_DIR", "name":"Superx-Pfad zu WEB-INF/conf/edustore", "param_default":"$WEBAPP/WEB-INF/conf/edustore"},
{"etl_job":"kern_konstanten_update","param_name":"PATH_TO_INPUTFILE", "name":"Eingabepfad", "param_default":"$SUPERX_DIR/db/install/schluesseltabellen/kern_feste_konstanten_fuellen.sql"},
{"etl_job":"sichten_unload","param_name":"SYSTEMINFO_ID", "name":"Komponente", "param_default":""},
{"etl_job":"sichten_unload","param_name":"SYSTEMINFO_ID", "name":"Komponente", "param_default":""},
{"etl_job":"sichten_unload","param_name":"NAME_INTERN", "name":"ID", "param_default":""},
{"etl_job":"sichten_unload","param_name":"PATH_TO_OUTPUTFILE", "name":"Ausgabedatei", "param_default":"$SUPERX_DIR/db/masken/sichten_$SYSTEMINFO_ID.xml"},
{"etl_job":"sichten_unload","param_name":"FORMAT", "name":"Ausgabeformat", "param_default":"XML"},
{"etl_job":"sichten_upload","param_name":"SYSTEMINFO_ID", "name":"Komponente", "param_default":""},
{"etl_job":"sichten_upload","param_name":"NAME_INTERN", "name":"ID", "param_default":""},
{"etl_job":"sichten_upload","param_name":"PATH_TO_INPUTFILE", "name":"Eingabedatei", "param_default":""},
{"etl_job":"sichten_upload","param_name":"FORMAT", "name":"Format", "param_default":"XML"},
{"etl_job":"qa_project_unload","param_name":"QA_PROJECT_ID", "name":"Testfall-Projekt", "param_default":""},
{"etl_job":"qa_project_unload","param_name":"PATH_TO_OUTPUTFILE", "name":"Ausgabedatei", "param_default":"$SUPERX_DIR/db/masken/qa_project_$QA_PROJECT_ID.xml"},
{"etl_job":"qa_project_unload","param_name":"FORMAT", "name":"Ausgabeformat", "param_default":"XML"},
{"etl_job":"sos_gewichtung_unload","param_name":"SYSTEMINFO_ID", "name":"Komponente", "param_default":""},
{"etl_job":"sos_gewichtung_unload","param_name":"PATH_TO_OUTPUTFILE", "name":"Ausgabedatei", "param_default":"$SUPERX_DIR/db/db/module/sos/schluesseltabellen/sichten_$SYSTEMINFO_ID.xml"},
{"etl_job":"sos_gewichtung_unload","param_name":"FORMAT", "name":"Ausgabeformat", "param_default":"XML"}
@ -78,12 +90,25 @@ @@ -78,12 +90,25 @@
{"etl_job":"sichten_unload", "uniquename":"unload_sichten_ges", "name":"Sichten entladen", "type":"MSG"},
{"etl_job":"sichten_unload", "uniquename":"unload_sichtentab", "name":"Sichten entladen", "type":"UNLOAD", "parent":"unload_sichten_ges"},
{"etl_job":"sichten_unload", "uniquename":"unload_sichten_sachgeb", "name":"Sachgebiete von Sichtarten entladen", "type":"UNLOAD", "parent":"unload_sichten_ges"},
{"etl_job":"sichten_unload", "uniquename":"unload_sichten_sachgeb", "name":"Sachgebiete von Sichten entladen", "type":"UNLOAD", "parent":"unload_sichten_ges"},
{"etl_job":"sichten_upload", "uniquename":"create_tmp_etl_sichten", "name":"Tabelle tmp_etl_sichten erzeugen", "type":"DOSQL" },
{"etl_job":"sichten_upload", "uniquename":"upload_tmp_etl_sichten", "name":"tmp_etl_sichten hochladen", "type":"LOAD" },
{"etl_job":"sichten_upload", "uniquename":"upload_tmp_etl_sachgeb_sichtarten", "name":"upload_tmp_etl_sachgeb_sichtarten hochladen", "type":"LOAD" },
{"etl_job":"sichten_upload", "uniquename":"trans_etl_sichten", "name":"etl_sichten füllen", "type":"DOSQL" },
{"etl_job":"sos_gewichtung_unload", "uniquename":"unload_sos_gewichtung_ges", "name":"Gewichtungen entladen", "type":"MSG"},
{"etl_job":"sos_gewichtung_unload", "uniquename":"unload_sos_gewichtung", "name":"Gewichtungen entladen", "type":"UNLOAD", "parent":"unload_sos_gewichtung_ges"}
{"etl_job":"sos_gewichtung_unload", "uniquename":"unload_sos_gewichtung", "name":"Gewichtungen entladen", "type":"UNLOAD", "parent":"unload_sos_gewichtung_ges"},
{"etl_job":"qa_project_unload", "uniquename":"qa_project_unload_ges", "name":"Testfall-Projekt entladen", "type":"MSG"},
{"etl_job":"qa_project_unload", "uniquename":"unload_qa_project_tab", "name":"Projekte entladen", "type":"UNLOAD", "parent":"qa_project_unload_ges"},
{"etl_job":"qa_project_unload", "uniquename":"unload_qa_resultset_tab", "name":"Resultsets entladen", "type":"UNLOAD", "parent":"qa_project_unload_ges"},
{"etl_job":"qa_project_unload", "uniquename":"unload_qa_dbtest_tab", "name":"DB-Tests entladen", "type":"UNLOAD", "parent":"qa_project_unload_ges"},
{"etl_job":"qa_project_unload", "uniquename":"unload_qa_dbtest_assertion_tab", "name":"DB-Test Erwartungen entladen", "type":"UNLOAD", "parent":"qa_project_unload_ges"},
{"etl_job":"qa_project_unload", "uniquename":"unload_qa_dbtest2project_tab", "name":"DB-Test zu Projekt entladen", "type":"UNLOAD", "parent":"qa_project_unload_ges"},
{"etl_job":"qa_project_unload", "uniquename":"unload_qa_mask_execution_tab", "name":"Masken-Tests entladen", "type":"UNLOAD", "parent":"qa_project_unload_ges"},
{"etl_job":"qa_project_unload", "uniquename":"unload_qa_mask_execution_assert_tab", "name":"Masken-Test Erwartungen entladen", "type":"UNLOAD", "parent":"qa_project_unload_ges"},
{"etl_job":"qa_project_unload", "uniquename":"unload_qa_mask_execution2project_tab", "name":"Masken-Test zu Projekt entladen", "type":"UNLOAD", "parent":"qa_project_unload_ges"}
] />
@ -151,17 +176,43 @@ @@ -151,17 +176,43 @@
{"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":"create_tmp_etl_sichten","prop_name":"PATH_TO_INPUTFILE", "prop_value":"$SUPERX_DIR/db/module/etl/schluesseltabellen/create_load_etl_sichten.sql" },
{"etl_step":"upload_tmp_etl_sichten","prop_name":"target_table", "prop_value":"tmp_etl_sichten" },
{"etl_step":"upload_tmp_etl_sichten","prop_name":"format", "prop_value":"xml" },
{"etl_step":"upload_tmp_etl_sichten","prop_name":"search_path", "prop_value":"/etlAction/unload [@name=\"unload_sichtentab\"]/rs/row" },
{"etl_step":"upload_tmp_etl_sichten","prop_name":"path_to_inputfile", "prop_value":"$PATH_TO_INPUTFILE" },
{"etl_step":"upload_tmp_etl_sachgeb_sichtarten","prop_name":"target_table", "prop_value":"tmp_etl_sachgeb_sichtarten" },
{"etl_step":"upload_tmp_etl_sachgeb_sichtarten","prop_name":"format", "prop_value":"xml" },
{"etl_step":"upload_tmp_etl_sachgeb_sichtarten","prop_name":"search_path", "prop_value":"/etlAction/unload [@name=\"unload_sichten_sachgeb\"]/rs/row" },
{"etl_step":"upload_tmp_etl_sachgeb_sichtarten","prop_name":"path_to_inputfile", "prop_value":"$PATH_TO_INPUTFILE" },
{"etl_step":"trans_etl_sichten","prop_name":"PATH_TO_INPUTFILE", "prop_value":"$SUPERX_DIR/db/module/etl/schluesseltabellen/trans_etl_sichten.sql" },
{"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":"unload_sichten_ges","prop_name":"msg", "prop_value":"Entlade Sichten Komponente $SYSTEMINFO_ID" },
{"etl_step":"unload_sichtentab","prop_name":"select_stmt", "prop_value":"SELECT S.systeminfoid,S.art,S.type,S.name_intern,S.name,S.sortnr,S.quelle,S.standbutton FROM sichten S where S.systeminfoid= $SYSTEMINFO_ID and position(''<#'' in quelle) =0 order by art,sortnr ,name;" },
{"etl_step":"unload_sichten_sachgeb","prop_name":"select_stmt", "prop_value":"SELECT A.sichtart,A.sachgebiete_id FROM sachgeb_sichtarten A where A.sichtart in (select distinct S.art from sichten S where S.systeminfoid= $SYSTEMINFO_ID) order by 1,2;" },
{"etl_step":"unload_sichtentab","prop_name":"select_stmt", "prop_value":"SELECT S.systeminfoid,S.art,S.type,S.name_intern,S.name,S.sortnr,S.quelle,S.standbutton,S.aktiv FROM sichten S where (S.systeminfoid::varchar(255)= ''$SYSTEMINFO_ID'' or S.name_intern=''$NAME_INTERN'') and position(''<#'' in quelle) =0 order by art,sortnr ,name;" },
{"etl_step":"unload_sichten_sachgeb","prop_name":"select_stmt", "prop_value":"SELECT A.sichtart,A.sachgebiete_id FROM sachgeb_sichtarten A where A.sichtart in (select distinct S.art from sichten S where (S.systeminfoid::varchar(255)= ''$SYSTEMINFO_ID'' or S.name_intern=''$NAME_INTERN'')) order by 1,2;" },
{"etl_step":"unload_sos_gewichtung_ges","prop_name":"msg", "prop_value":"Entlade Gewichtungen Komponente $SYSTEMINFO_ID" },
{"etl_step":"unload_sos_gewichtung","prop_name":"select_stmt", "prop_value":" SELECT art, ch35_ang_abschluss, fach_nr, kz_fach, text, faktor FROM sos_gewichtung where ch35_ang_abschluss in (''B5'',''B6'',''B7'',''B8'',''M3'',''M4'',''M7'',''M8'') and art=''vzae'' order by 1,2,3,4,5 ;" }
{"etl_step":"unload_sos_gewichtung","prop_name":"select_stmt", "prop_value":" SELECT art, ch35_ang_abschluss, fach_nr, kz_fach, text, faktor FROM sos_gewichtung where ch35_ang_abschluss in (''B5'',''B6'',''B7'',''B8'',''M3'',''M4'',''M7'',''M8'') and art=''vzae'' order by 1,2,3,4,5 ;" },
{"etl_step":"unload_qa_project","prop_name":"msg", "prop_value":"Entlade Testfall-Projekt $QA_PROJECT_ID Stammdaten" },
{"etl_step":"unload_qa_project_tab","prop_name":"select_stmt", "prop_value":"SELECT uniquename, name, systeminfo_id, sachgebiete_id, active, created_from, issue_link FROM qa_project where tid= $QA_PROJECT_ID order by 1;" },
{"etl_step":"unload_qa_resultset_tab","prop_name":"select_stmt", "prop_value":"SELECT R.uniquename, R.name, R.systeminfo_id, R.fromclause, R.fieldclause, R.groupbyclause, R.orderbyclause FROM qa_resultset R where R.tid in (select distinct T.resultset_id from qa_dbtest T, qa_dbtest2project P where P.dbtest_id=T.tid and P.project_id= $QA_PROJECT_ID ) order by 1;" },
{"etl_step":"unload_qa_dbtest_tab","prop_name":"select_stmt", "prop_value":"SELECT T.uniquename,T.name,T.systeminfo_id,R.uniquename as resultset_uniquename,T.whereclause,T.description,T.active from qa_dbtest T,qa_resultset R where R.tid=T.resultset_id and T.tid in (select P.dbtest_id from qa_dbtest2project P where P.project_id= $QA_PROJECT_ID ) order by 1;" },
{"etl_step":"unload_qa_dbtest_assertion_tab","prop_name":"select_stmt", "prop_value":"SELECT T.uniquename as dbtest_uniquename,A.rownr,A.def_col_caption,A.def_col_name,A.def_col_value,A.def_col_function from qa_dbtest T, qa_dbtest_assertion A where A.dbtest_id=T.tid and T.tid in (select P.dbtest_id from qa_dbtest2project P where P.project_id= $QA_PROJECT_ID ) order by 1;" },
{"etl_step":"unload_qa_dbtest2project_tab","prop_name":"select_stmt", "prop_value":"SELECT T.uniquename as dbtest_uniquename,P.uniquename as project_uniquename,DP.issue_id FROM qa_dbtest2project DP, qa_dbtest T, qa_project P where DP.dbtest_id=T.tid and DP.project_id=P.tid and DP.project_id= $QA_PROJECT_ID order by 1;" },
{"etl_step":"unload_qa_mask_execution_tab","prop_name":"select_stmt", "prop_value":"SELECT E.name,E.userinfo_id,E.maskeninfo_id,E.is_active,E.stylesheet_id,E.contenttype,E.output_filename,E.systeminfo_id,E.uniquename FROM qa_mask_execution E where E.tid in (select P.mask_execution_id from qa_mask_execution2project P where P.project_id= $QA_PROJECT_ID ) order by 1;" },
{"etl_step":"unload_qa_mask_execution_assert_tab","prop_name":"select_stmt", "prop_value":"SELECT E.uniquename,A.rownr,A.colnr,A.result_value_min,A.result_value_max,A.is_active,A.caption FROM qa_mask_execution E, qa_mask_execution_assert A where E.tid=A.mask_execution_id and E.tid in (select P.mask_execution_id from qa_mask_execution2project P where P.project_id= $QA_PROJECT_ID ) order by 1;" },
{"etl_step":"unload_qa_mask_execution2project_tab","prop_name":"select_stmt", "prop_value":"SELECT E.uniquename as mask_execution_uniquename,P.uniquename as project_uniquename,DP.issue_id FROM qa_mask_execution2project DP, qa_mask_execution E, qa_project P where DP.mask_execution_id=E.tid and DP.project_id=P.tid and DP.project_id= $QA_PROJECT_ID order by 1;" }

61
src-modules/module/etl/schluesseltabellen/trans_etl_sichten.sql

@ -0,0 +1,61 @@ @@ -0,0 +1,61 @@
update sichten set systeminfoid=T.systeminfoid,
art=T.art,
type=T.type,
name=T.name,
quelle=T.quelle ,
sortnr=T.sortnr,
standbutton=T.standbutton,
aktiv=T.aktiv
from tmp_etl_sichten T
where T.name_intern=sichten.name_intern
and sichten.name_intern in (select T2.name_intern from tmp_etl_sichten T2)
;
delete from tmp_etl_sichten where name_intern in (select name_intern from sichten);
INSERT INTO sichten(
systeminfoid ,
art ,
type ,
name_intern ,
name ,
sortnr ,
quelle ,
standbutton ,
gueltig_seit ,
gueltig_bis ,
aktiv)
select systeminfoid ,
art ,
type ,
name_intern ,
name ,
sortnr ,
quelle ,
standbutton ,
date_val('01.01.1900') as gueltig_seit ,
date_val('01.01.3000') as gueltig_bis ,
aktiv
from tmp_etl_sichten S;
delete from sachgeb_sichtarten
where (sachgebiete_id ,
sichtart) in
(select sachgebiete_id ,
sichtart from tmp_etl_sachgeb_sichtarten);
insert into sachgeb_sichtarten(
sachgebiete_id ,
sichtart)
select
sachgebiete_id ,
sichtart
from tmp_etl_sachgeb_sichtarten;
drop table if exists tmp_etl_sichten;
drop table if exists tmp_etl_sachgeb_sichtarten;

11
src/de/superx/elt/EtlUtils.java

@ -315,7 +315,7 @@ public static String getFileContentsWithEncoding(String filePath, String encodin @@ -315,7 +315,7 @@ public static String getFileContentsWithEncoding(String filePath, String encodin
* @throws IOException
* @throws XPathExpressionException
*/
public static boolean isNodeValueInXml(String src, String searchPath, String expectedValue)
public static boolean isNodeValueInXml(String src, String searchPath, String expectedValue,String jobuniquename)
throws ParserConfigurationException, SAXException, IOException, XPathExpressionException {
boolean b=false;
Document mydomres =de.superx.elt.EtlUtils.parseXml(src);
@ -341,4 +341,13 @@ public static String getFileContentsWithEncoding(String filePath, String encodin @@ -341,4 +341,13 @@ public static String getFileContentsWithEncoding(String filePath, String encodin
returnString="Erfolg";
return returnString;
}
public static String translateReturnCode2Html(int returnCode)
{
String returnString=translateReturnCode(returnCode);
if(returnCode==0)
returnString="<span style='color:green'>"+returnString+"</span>";
else
returnString="<span style='color:red'>"+returnString+"</span>";
return returnString;
}
}

213
src/de/superx/sxrest/JobEtlXml.java

@ -0,0 +1,213 @@ @@ -0,0 +1,213 @@
/*
* de.superx.etl - a package for controlling ETL routines
* Copyright (C) 2021 Daniel Quathamer <danielq@memtext.de>
*
* This package is licensed under the CampusSource License;
* http://www.campussource.de/org/license/
*/
package de.superx.sxrest;
import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
import javax.ws.rs.FormParam;
import javax.ws.rs.GET;
import javax.ws.rs.HEAD;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.core.Response;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.xpath.XPath;
import javax.xml.xpath.XPathConstants;
import javax.xml.xpath.XPathExpressionException;
import javax.xml.xpath.XPathFactory;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Request;
import de.memtext.util.DateUtils;
import de.superx.common.SxUser;
import de.superx.elt.EtlActionJob;
import de.superx.elt.EtlUtils;
import de.superx.servlet.SuperXManager;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import javax.servlet.http.HttpServletRequest;
@Path("/jobetlxml/get/{jobUniquename}/{jobParamName}")
public class JobEtlXml {
@Context
Request request;
@GET
@Path("/view/{param}")
@Produces(MediaType.APPLICATION_XML)
public Document printXml(@PathParam("jobUniquename") String jobUniquename,
@PathParam("jobParamName") String jobParamName,
@PathParam("param") String param,
@Context HttpServletRequest request) {
String returntext="";
returntext = getJobEtlXml(jobUniquename,jobParamName, param, request);
return de.memtext.util.XMLUtils.buildDocumentFromString(returntext, false);
}
private String getJobEtlXml(String jobUniquename,
String jobParamName,
String param,
HttpServletRequest request) {
String returntext;
SxUser user = (SxUser) request.getSession().getAttribute("user");
//TODO: valide Einträge prüfen:
//ebenso param
System.out.println("JOB"+jobUniquename + " mit param "+jobParamName);
String mandantenid= (String) request.getSession().getAttribute("MandantenID");
if(mandantenid==null || mandantenid.equals(""))
mandantenid="default";
if (user == null || !user.isAdmin()) {
returntext="Fehlende Rechte";
}
else
{
int returnCode=0;
EtlActionJob myJob=new EtlActionJob(jobUniquename); //TODO:Mandantid
try {
myJob.initJob(jobUniquename,jobParamName+"="+param);
} catch (Exception e) {
// TODO Auto-generated catch block
returntext=e.toString();
returntext+=myJob.getLogoutput();
}
System.out.println("Job "+ jobUniquename+" initialized");
try {
returnCode= myJob.execute("");
returntext=myJob.getSw().toString();
} catch (Exception e) {
// TODO Auto-generated catch block
returntext=e.toString();
returntext+=myJob.getLogoutput();
}
}
return returntext;
}
@GET
@Path("/download/{param}")
@Produces(MediaType.APPLICATION_XML)
public String createDownloadXml(
@PathParam("jobUniquename") String jobUniquename,
@PathParam("jobParamName") String jobParamName,
@PathParam("param") String param,
@Context HttpServletRequest request) {
String returntext="";
returntext = getJobEtlXml(jobUniquename,jobParamName,param, request);
return returntext;
//return de.memtext.util.XMLUtils.buildDocumentFromString(returntext, false);
}
/* Aktuell noch nicht genutzt: */
@GET
@Path("/saveget/{params}")
@Produces(MediaType.TEXT_PLAIN)
public String saveGetXml(@QueryParam("param") String tid,
@QueryParam("Inhalt") String src,
@Context HttpServletRequest request) {
String returntext="";
SxUser user = (SxUser) request.getSession().getAttribute("user");
String mandantenid= (String) request.getSession().getAttribute("MandantenID");
if(mandantenid==null || mandantenid.equals(""))
mandantenid="default";
if (user == null || !user.isAdmin()) {
returntext="Fehlende Rechte";
}
else
{
returntext="tid="+tid+"-src="+src;
}
return returntext;
}
/* Aktuell noch nicht genutzt: */
@POST
@Path("/save")
@Consumes("application/x-www-form-urlencoded")
//@Consumes(MediaType.APPLICATION_FORM_URLENCODED)
@Produces(MediaType.TEXT_PLAIN)
public String saveXml(@FormParam("tid") String tid,
@FormParam("Inhalt") String src,
@Context HttpServletRequest request) {
String returntext="";
String jobuniquename="sx_select_mask";
int returnCode=0;
tid="16000";
SxUser user = (SxUser) request.getSession().getAttribute("user");
String mandantenid= (String) request.getSession().getAttribute("MandantenID");
String searchString="/etlAction[@name=\""+jobuniquename+"\"]/unload[@name=\"unload_maskeninfo\"]/rs/row/fld[@name=\"tid\"]";
if(mandantenid==null || mandantenid.equals(""))
mandantenid="default";
if (user == null || !user.isAdmin()) {
returntext="Fehlende Rechte";
}
else
{
try {
if(de.superx.elt.EtlUtils.isNodeValueInXml(src,searchString,tid,jobuniquename))
{
String job="sx_insert_mask";
returntext="TID="+tid;
String params="TID="+tid;
File temp;
temp = File.createTempFile("myTempFile", ".xml");
BufferedWriter bw = new BufferedWriter(new FileWriter(temp));
bw.write(src);
bw.close();
params+=EtlUtils.NEWLINE+"PATH_TO_INPUTFILE="+temp.getAbsolutePath();
params+=EtlUtils.NEWLINE+"FORMAT=XML";
EtlActionJob myJob=new EtlActionJob(job); //TODO:Mandantid
myJob.initJob(job,params);
returnCode= myJob.execute("");
returntext=myJob.getSw().toString();
}
else
returntext="Übergebene TID "+tid+" entspricht nicht der XML-Datei ";
} catch (Exception e) {
returntext=e.toString();
e.printStackTrace();
}
}
return returntext;
}
}

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

@ -147,11 +147,12 @@ public class MaskXml { @@ -147,11 +147,12 @@ public class MaskXml {
@FormParam("Inhalt") String src,
@Context HttpServletRequest request) {
String returntext="";
String jobuniquename="sx_select_mask";
int returnCode=0;
tid="16000";
SxUser user = (SxUser) request.getSession().getAttribute("user");
String mandantenid= (String) request.getSession().getAttribute("MandantenID");
String searchString="/etlAction[@name=\"sx_select_mask\"]/unload[@name=\"unload_maskeninfo\"]/rs/row/fld[@name=\"tid\"]";
String searchString="/etlAction[@name=\""+jobuniquename+"\"]/unload[@name=\"unload_maskeninfo\"]/rs/row/fld[@name=\"tid\"]";
if(mandantenid==null || mandantenid.equals(""))
mandantenid="default";
@ -162,7 +163,7 @@ public class MaskXml { @@ -162,7 +163,7 @@ public class MaskXml {
else
{
try {
if(de.superx.elt.EtlUtils.isNodeValueInXml(src,searchString,tid))
if(de.superx.elt.EtlUtils.isNodeValueInXml(src,searchString,tid,jobuniquename))
{
String job="sx_insert_mask";
returntext="TID="+tid;

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

Binary file not shown.

277
superx/edit/etl/etl_manager.jsp

@ -1,7 +1,10 @@ @@ -1,7 +1,10 @@
<%@ taglib uri="/WEB-INF/dbforms.tld" prefix="db" %>
<%@page pageEncoding="utf-8" contentType="text/html; charset=UTF-8" %>
<%@ page import ="de.superx.servlet.ServletUtils" %>
<%@ page import ="de.superx.servlet.SxPools" %>
<%@ page import ="de.superx.servlet.SxPools,java.util.ArrayList" %>
<%@ page import ="org.dbforms.config.DbFormsConfigRegistry,java.sql.Connection,java.sql.Statement,java.sql.ResultSet,de.superx.common.SxUser" %>
<html>
@ -10,9 +13,12 @@ @@ -10,9 +13,12 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>ETL Manager</title>
<link rel="stylesheet" href="../../style/bulma.css" />
<link rel="stylesheet" href="../../style/dbforms.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/nd_functions.js"></script>
</head>
<script language="Javascript">
@ -31,29 +37,40 @@ var xhttp = new XMLHttpRequest(); @@ -31,29 +37,40 @@ var xhttp = new XMLHttpRequest();
xhttp.send();
}
function getMaskMenu(srctype)
function getTabMenu(srctype,caption,i,jobExportUniquename,jobImportUniquename,maskeninfo_tid,felderinfo_tid,paramname,jobParamName)
{
var zs=caption+": ";
//
zs+="<input type=\"hidden\" name=\"jobParamName\" value=\""+jobParamName+"\"/> ";
zs+="<input type=\"hidden\" name=\"jobParamValue\" value=\"\"/> ";
zs+="<input class=\"schluesselfeld\" size=\"5\" style=\"display:none;\" name=\""+paramname+"\" id=\""+paramname+"\"/> ";
zs+="<input type=\"text\" size=\"20\" name=\"label_"+paramname+"\" onClick=\"EtlMaskeComboLaden('"+paramname+"',1,'',"+maskeninfo_tid+");\" />";
if(srctype=="load")
{
document.getElementById("MaskHeader").innerHTML="Masken-Quellcode exportieren";
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;
document.getElementById("MaskHeader").innerHTML=caption+"-Quellcode exportieren";
zs+="<input type='hidden' name='jobuniquename' value='"+jobExportUniquename+"'/>";
zs+="<button class=\"button has-tooltip-multiline has-tooltip-right\" data-tooltip=\"Quellcode exportieren\" onclick=\"getSrcAsXml('"+jobExportUniquename+"','"+jobParamName+"',document.getElementById('"+paramname+"').value);return false;\">anzeigen...</button>";
zs+="<button class=\"button has-tooltip-multiline has-tooltip-right\" data-tooltip=\"Quellcode herunterladen\" onclick=\"downloadMaskSrc('"+jobExportUniquename+"','"+jobParamName+"',document.getElementById('"+paramname+"').value);return false;\">herunterladen...</button>";
}
if(srctype=="save")
{
document.getElementById("MaskHeader").innerHTML="Masken-Quellcode importieren";
document.getElementById("MaskSubHeader").innerHTML="<form method=\"post\" name=\"saveMask\" action=\"../../edit/etl/saveMask.jsp\" target=\"_blank\"> TID = <input type='text' size='10' id='Maskentid' name='maskeninfo_id' /><input type='hidden' name='src' /><button class=\"button has-tooltip-multiline has-tooltip-right\" data-tooltip=\"Quellcode der Maske mit der Nummer im Feld TID importieren\" onclick=\"saveMaskSrc(document.getElementById('Maskentid').value)\">importieren...</button></form>";
document.getElementById("MaskHeader").innerHTML=caption+"-Quellcode importieren";
zs+="<input type='hidden' name='src' /><input type='hidden' name='jobuniquename' value='"+jobImportUniquename+"'/>";
zs+="<button class=\"button has-tooltip-multiline has-tooltip-right\" data-tooltip=\"Quellcode importieren\" onclick=\"saveEtlXmlSrc('"+jobParamName+"',document.getElementById('"+paramname+"').value)\">importieren...</button>";
//document.getElementById("maskentid_for_upload").style.visibility="visible";
//document.getElementById("button_for_upload").style.visibility="visible";
//document.getElementById("MaskSubHeader").innerHTML="Maske TID="+tid;
//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=\"saveMaskSrc(document.getElementById('Maskentid').value)\">importieren...</button>";
//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=\"saveEtlXmlSrc(document.getElementById('Maskentid').value)\">importieren...</button>";
}
zs+="<a onclick=\"togglekeyfields(); return false;\" class=\"linkLookImage\"><img title=\"Schlüsselfelder an- oder ausschalten\" alt=\"Schlüsselfelder an- oder ausschalten\" src=\"../../images/key.svg\" border=\"0\"/></a>";
document.getElementById("MaskSubHeader").innerHTML=zs;
}
function getMaskSrc(tid)
function getSrcAsXml(jobUniquename,jobParamName,jobParamValue)
{
//document.getElementById("MaskHeader").innerHTML="Masken-Quellcode laden";
//document.getElementById("MaskSubHeader").innerHTML="Maske TID="+tid;
@ -72,27 +89,29 @@ var xhttp = new XMLHttpRequest(); @@ -72,27 +89,29 @@ var xhttp = new XMLHttpRequest();
document.getElementById("Inhalt").innerHTML="Serveranfrage Antwort... "+this.status;
}
};
xhttp.open("GET", "../../sxrest/maskxml/get/"+tid, true);
xhttp.open("GET", "../../sxrest/jobetlxml/get/"+jobUniquename+"/"+jobParamName+"/view/"+jobParamValue, true);
xhttp.send();
}
function downloadMaskSrc(tid)
function downloadMaskSrc(jobUniquename,jobParamName,jobParamValue)
{
window.open("../../sxrest/maskxml/download/"+tid,"_blank");
window.open("../../sxrest/jobetlxml/get/"+jobUniquename+"/"+jobParamName+"/download/"+jobParamValue,"_blank");
}
function saveMaskSrc(tid)
function saveEtlXmlSrc(jobParamName,jobParamValue)
{
document.forms["saveMask"].elements["src"].value=document.getElementById("Inhalt").value;
if(document.forms["saveMask"].elements["src"].value=="" || document.forms["saveMask"].elements["maskeninfo_id"].value=="")
document.forms["saveEtlXml"].elements["src"].value=document.getElementById("Inhalt").value;
if(document.forms["saveEtlXml"].elements["src"].value=="" || jobParamValue=="")
{
alert("Bitte setzen Sie eine Nummer in das Feld TID und einen passenden XML ins Feld Inhalt");
return false;
}
else
{
document.forms["saveMask"].submit();
document.forms["saveEtlXml"].elements["jobParamName"].value=jobParamName;
document.forms["saveEtlXml"].elements["jobParamValue"].value=jobParamValue;
document.forms["saveEtlXml"].submit();
}
}
function getComponentMenu(systeminfo_id, componentName,componentUniquename,componentVersion)
@ -106,7 +125,7 @@ menuLines+="<form method=\"post\" name=\"execUpdate\" action=\"../../edit/etl/jo @@ -106,7 +125,7 @@ menuLines+="<form method=\"post\" name=\"execUpdate\" action=\"../../edit/etl/jo
//<p><button class=\"button has-tooltip-multiline has-tooltip-right\" data-tooltip=\"Update starten\" onclick=\"launchUpdate('"+componentName+"')\">HLR starten</button></p>";
document.getElementById("MaskSubHeader").innerHTML=menuLines;
//document.getElementById("MaskSubHeader").innerHTML="<form method=\"post\" name=\"saveMask\" action=\"../../edit/etl/jobexecutor.jsp\" target=\"_blank\"> TID = <input type='text' size='10' id='Maskentid' name='maskeninfo_id' /><input type='hidden' name='src' /><button class=\"button has-tooltip-multiline has-tooltip-right\" data-tooltip=\"Quellcode der Maske mit der Nummer im Feld TID importieren\" onclick=\"saveMaskSrc(document.getElementById('Maskentid').value)\">importieren...</button></form>";
//document.getElementById("MaskSubHeader").innerHTML="<form method=\"post\" name=\"saveEtlXml\" action=\"../../edit/etl/jobexecutor.jsp\" target=\"_blank\"> TID = <input type='text' size='10' id='Maskentid' name='maskeninfo_id' /><input type='hidden' name='src' /><button class=\"button has-tooltip-multiline has-tooltip-right\" data-tooltip=\"Quellcode der Maske mit der Nummer im Feld TID importieren\" onclick=\"saveEtlXmlSrc(document.getElementById('Maskentid').value)\">importieren...</button></form>";
@ -127,8 +146,27 @@ var fldElem=document.getElementById(mydiv); @@ -127,8 +146,27 @@ var fldElem=document.getElementById(mydiv);
}
}
function EtlMaskeComboLaden(fname,zeilenanzahl, caption,maskentid) {
var editurl="/superx/edit/kern/maske_combo_laden.jsp?tid="+maskentid+ "&Feldname="+getEncoded(fname);
editurl +="&zeilenanzahl="+zeilenanzahl+"&params=";
neu2=window.open(editurl,"_blank","directories=no,location=no,menubar=no,scrollbars=yes,resizable=yes,toolbar=no,width=800,height=660");
return false;
}
function togglekeyfields() {
var myform=document.forms[0];
myform.elements.keyfieldsused.value = "true";
for (i = 0; i < myform.elements.length; i++) {
e = myform.elements[i];
if (e.getAttribute('class') == "schluesselfeld" || e.className ==
"schluesselfeld")
if (e.style.display != "none") {
e.style.display = "none";
} else e.style.display = "";
}
}
</script>
<body>
<%
@ -148,8 +186,71 @@ String tab = request.getParameter("tab"); @@ -148,8 +186,71 @@ String tab = request.getParameter("tab");
if(tab == null)
tab="";
//Daten aus Datenbank werden in Variablen gespeichert
Connection conmm=null;
class etlJob{
String tabUniquename;
String tabCaption;
String jobExportUniquename;
String jobImportUniquename;
String jobParamFieldname;
String jobParamFieldTid;
String jobParamMaskTid;
String jobParamName;
}
ArrayList<etlJob> etlJobs = new ArrayList<etlJob>();
//out.println("Getting Connection for mandantenid="+mandantenid);
try {
conmm = DbFormsConfigRegistry.instance().lookup().getConnection(mandantenid);
//System.out.println("Got Connection");
Statement st;
st=conmm.createStatement();
ResultSet rs;
String sqlQueryEtlManagerTab="select T.caption,T.uniquename,T.tid,T.job_export,T.job_import,T.maskeninfo_id,T.felderinfo_id";
sqlQueryEtlManagerTab+=", F.name as feldname,T.job_param_ui ";
sqlQueryEtlManagerTab+=" from etl_manager_tab T, felderinfo F where T.felderinfo_id=F.tid and T.active=1";
sqlQueryEtlManagerTab+=" order by 1";
rs = st.executeQuery(sqlQueryEtlManagerTab);
int i=0;
while (rs.next()) {
etlJob myJob=new etlJob();
myJob.tabCaption=rs.getString(1);
myJob.tabUniquename=rs.getString(2);
myJob.jobExportUniquename=rs.getString(4);
myJob.jobImportUniquename=rs.getString(5);
myJob.jobParamMaskTid=rs.getString(6);
myJob.jobParamFieldTid=rs.getString(7);
myJob.jobParamFieldname=rs.getString(8);
myJob.jobParamName=rs.getString(9);
etlJobs.add(myJob);
i++;
}
rs.close();
st.close();
conmm.close();
} //Check DB connection
catch (Exception e) {
out.print("<html><body>Fehler bei Datenverbindung: "+e+ " MandantID"+mandantenid +"</body></html>");
}
etlJob[] etlJobsArr=new etlJob[etlJobs.size()];
etlJobsArr=etlJobs.toArray(etlJobsArr);
%>
<!-- START NAV -->
<nav class="navbar is-white">
<div class="container">
@ -159,9 +260,27 @@ if(tab == null) @@ -159,9 +260,27 @@ if(tab == null)
</div>
<a class="navbar-item" href="etl_manager.jsp?tab=mask">
Masken
</a>
<%
for (int i = 0; i < etlJobsArr.length; i++) {
String tabUniquename=etlJobsArr[i].tabUniquename;
String tabCaption=etlJobsArr[i].tabCaption;
//String jobImportUniquename=etlJobsArr[i].jobImportUniquename;
//String jobExportUniquename=etlJobsArr[i].jobExportUniquename;
String tabUrl="etl_manager.jsp?tab="+tabUniquename.toLowerCase();
%>
<a class="navbar-item" href="<%= tabUrl %>">
<% out.print(tabCaption); %>
</a>
<%
}
%>
<!--
<a class="navbar-item" href="etl_manager.jsp?tab=action">
Komponenten
@ -186,42 +305,40 @@ if(tab == null) @@ -186,42 +305,40 @@ if(tab == null)
<!--<li><a>Customers</a></li>
<li><a>Other</a></li>-->
</ul>
<%
if(tab.equals("mask"))
for (int i = 0; i < etlJobsArr.length; i++) {
if(tab.equals(etlJobsArr[i].tabUniquename.toLowerCase()))
{
%>
<p class="menu-label">
Masken-Sicherung
<% out.print(etlJobsArr[i].tabCaption);
String menuArgs=",";
menuArgs+="'"+etlJobsArr[i].tabCaption+"'";
menuArgs+=","+i;
menuArgs+=",'"+etlJobsArr[i].jobExportUniquename+"'";
menuArgs+=",'"+etlJobsArr[i].jobImportUniquename+"'";
menuArgs+=",'"+etlJobsArr[i].jobParamMaskTid+"'";
menuArgs+=",'"+etlJobsArr[i].jobParamFieldTid+"'";
menuArgs+=",'"+etlJobsArr[i].jobParamFieldname+"'";
menuArgs+=",'"+etlJobsArr[i].jobParamName+"'";
%>
</p>
<ul class="menu-list">
<li><a onClick="getMaskMenu('load');">Masken-Quellcode exportieren</a></li>
<li><a onClick="getMaskMenu('save');">Masken-Quellcode importieren</a></li>
<li><a onClick="<%= "getTabMenu('load'"+menuArgs+");" %>"><% out.print(etlJobsArr[i].tabCaption); %>-Quellcode exportieren</a></li>
<li><a onClick="<%= "getTabMenu('save'"+menuArgs+");" %>"><% out.print(etlJobsArr[i].tabCaption); %>-Quellcode importieren</a></li>
</ul>
<%
} //Ende Masken Menü
%>
<%
if(tab.equals("action"))
{
%>
<p class="menu-label">
Komponentenverwaltung
</p>
<%@ include file="/edit/etl/systeminfo_list.inc" %>
<!--<ul class="menu-list">
<li><a onClick="getComponentMenu('kern');">Kernmodul</a></li>
<li><a onClick="getComponentMenu('etl');">ETL-Komponente</a></li>
</ul>-->
<%
} //Ende Action Menü
%>
} //Ende Schleife Tabs
%>
</aside>
</div>
<div class="column is-9">
@ -237,40 +354,13 @@ if(tab.equals("")) @@ -237,40 +354,13 @@ if(tab.equals(""))
ETL Manager
</h1>
<h2 class="subtitle">
Diese Komponente dient der Masken-Verwaltung.
Diese Komponente dient der Job-Verwaltung.
</h2>
<p class="title">Klicken Sie oben links auf "Masken", um zum Menü zu gelangen.</p>
</div>
</div>
</section>
<!--<section class="info-tiles">
<div class="tile is-ancestor has-text-centered">
<div class="tile is-parent">
<article class="tile is-child box">
<p class="title">Nützliche Funktion</p>
<p class="subtitle">welche?</p>
</div>
</article>
</div>
<div class="tile is-parent">
<article class="tile is-child box">
<p class="title">Weitere nützliche Funktion</p>
<p class="subtitle">welche</p>
</article>
</div>
<div class="tile is-parent">
<article class="tile is-child box">
<p class="title">Noch eine nützliche Funktion</p>
<p class="subtitle">der Webanwendung</p>
</article>
</div>
</div>
</section>-->
<div class="columns">
<div class="column is-6">
@ -283,16 +373,24 @@ if(tab.equals("")) @@ -283,16 +373,24 @@ if(tab.equals(""))
} //Ende Tiles Startseite
%>
<%
if(tab.equals("mask"))
for (int i = 0; i < etlJobsArr.length; i++) {
if(tab.equals(etlJobsArr[i].tabUniquename.toLowerCase()))
{
%>
<section class="section">
<div class="container" id="loadMask" >
<h1 class="title" id="MaskHeader">Masken-Verwaltung</h1>
<h1 class="title" id="MaskHeader"><% out.print(etlJobsArr[i].tabCaption); %></h1>
<h2 class="subtitle">
<div id="MaskSubHeader">Wählen Sie links das Masken-Menü</div>
<form method="post" name="saveEtlXml" action="../../edit/etl/saveEtlXml.jsp" target="_blank">
<div id="MaskSubHeader">Wählen Sie links das Export/Import-Menü</div>
<div style="float:right">
<input type="hidden" name="keyfieldsused" value="false"/>
</div>
</form>
</h2>
<div class="bd-snippet-code highlight-full ">
@ -312,32 +410,15 @@ if(tab.equals("mask")) @@ -312,32 +410,15 @@ if(tab.equals("mask"))
</section>
<%
} //Ende Mask Content
} //Ende Schleife Tabs
%>
<%
if(tab.equals("action"))
{
%>
<section class="section">
<div class="container">
<h1 class="title" id="MaskHeader">Komponenten</h1>
<h2 class="subtitle">
<div id="MaskSubHeader">Install / Upgrade / Hauptladeroutinen / Unterladeroutinen </div>
</h2>
<div class="bd-snippet-code highlight-full ">
</div>
</div>
</section>
<%
} //Ende Action Content
%>
</div>
</div>
</div>
</div>
<!--<script async type="text/javascript" src="../js/bulma.js"></script>-->
</body>
</html>

143
superx/edit/etl/saveEtlXml.jsp

@ -0,0 +1,143 @@ @@ -0,0 +1,143 @@
<%@ taglib uri="/WEB-INF/dbforms.tld" prefix="db" %>
<%@page pageEncoding="utf-8" contentType="text/html; charset=UTF-8" %>
<%@ page import ="de.superx.servlet.ServletUtils" %>
<%@ page import ="de.superx.servlet.SxPools" %>
<%@ page import ="java.io.BufferedWriter" %>
<%@ page import ="java.io.File" %>
<%@ page import ="java.io.FileWriter" %>
<%@ page import ="java.io.IOException" %>
<%@ page import ="de.superx.elt.EtlActionJob" %>
<%@ page import ="de.superx.elt.EtlUtils" %>
<%@ page import ="de.superx.common.SxUser" %>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Ausführung</title>
<link rel="stylesheet" href="../../style/bulma.css" />
<script type="text/javascript" src="/superx/xml/js/memtext/sx_functions.js"></script>
</head>
<body>
<%
//init Variables:
if (request.getCharacterEncoding() == null)
request.setCharacterEncoding("UTF-8");
String idparamName = request.getParameter("idparamName");
String idparamValue = request.getParameter("idparamValue");
String src = request.getParameter("src");
String jobuniquename = request.getParameter("jobuniquename");
String returntext="";
int returnCode=0;
returntext=src;
SxUser user = (SxUser) request.getSession().getAttribute("user");
String mandantenid= (String) request.getSession().getAttribute("MandantenID");
//String searchString="/etlAction[@name=\""+jobuniquename+"\"]/unload[@name=\"unload_maskeninfo\"]/rs/row/fld[@name=\"tid\"]";
if(mandantenid==null || mandantenid.equals(""))
mandantenid="default";
if (user == null || !user.isAdmin()) {
returnCode=1;
returntext="Fehlende Rechte";
}
else
{
try {
//if(de.superx.elt.EtlUtils.isNodeValueInXml(src,searchString,idparamValue,jobuniquename))
//{
returntext=idparamName+"="+idparamValue;
String params=idparamName+"="+idparamValue;
File temp;
temp = File.createTempFile("myTempFile", ".xml");
BufferedWriter bw = new BufferedWriter(new FileWriter(temp));
bw.write(src);
bw.close();
params+=EtlUtils.NEWLINE+"PATH_TO_INPUTFILE="+temp.getAbsolutePath();
params+=EtlUtils.NEWLINE+"FORMAT=XML";
EtlActionJob myJob=new EtlActionJob(jobuniquename); //TODO:Mandantid
myJob.initJob(jobuniquename,params);
returnCode= myJob.execute("");
returntext+=myJob.getActionLog().toString();
/*}
else
{
returntext="Übergebener Parameter "+idparamName+" Wert "+idparamValue+" entspricht nicht der XML-Datei ";
returnCode=1;
}*/
} catch (Exception e) {
returnCode=1;
returntext=e.toString();
e.printStackTrace();
}
}
%>
<!-- START NAV -->
<nav class="navbar is-white">
<div class="container">
<div class="navbar-brand">
Masken laden
<div class="navbar-burger burger" data-target="navMenu">
<span>dd</span>
<span>dd</span>
<span>dd</span>
</div>
</div>
<!-- <div id="navMenu" class="navbar-menu">
<div class="navbar-start">
<a class="navbar-item" href="webapp_manager.jsp?tab=inst">
Installation /Patches
</a>
<a class="navbar-item" href="webapp_manager.jsp?tab=load">
Konnektoren
</a>-->
<a class="navbar-item" href="javascript:window.close()">
Schließen
</a>
</div>
</div>
</div>
</nav>
<!-- END NAV -->
<section class="section">
<div class="container">
<h1 class="title" id="MaskHeader">Protokoll</h1>
<h2 class="subtitle">
<div id="MaskSubHeader">Ergebnis der Ausführung</div>
</h2>
<p>Status: <%="Code "+ returnCode+ "("+de.superx.elt.EtlUtils.translateReturnCode2Html(returnCode)+")"%>, Logausgabe:
</p>
<div class="bd-snippet-code highlight-full ">
<figure class="highlight"><div class="buttons has-addons is-right">
<button class="button is-small is-info" onClick="copyText('Inhalt');">Kopieren</button>
</div>
<textarea id="Inhalt" name="Inhalt" class="textarea" placeholder="Inhalt..." rows="20"><%= returntext %>
</textarea>
</figure>
</div>
</div>
</section>
</body>
</html>

54
superx/images/downloadblck.svg

@ -0,0 +1,54 @@ @@ -0,0 +1,54 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="185.8"
version="1.1"
id="svg856"
sodipodi:docname="download.svg"
height="171.39999"
inkscape:version="0.92.5 (0.92.5+68)">
<metadata
id="metadata862">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs860" />
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1920"
inkscape:window-height="1020"
id="namedview858"
showgrid="false"
inkscape:zoom="1.3741116"
inkscape:cx="-84.141542"
inkscape:cy="188.25558"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="svg856" />
<path
style="fill:black;fill-opacity:1;stroke:none;stroke-width:0.2;stroke-opacity:1"
d="m 142.8,150 q 0,-3 -2,-5 -2,-2 -5,-2.2 -3,-0.2 -5.2,2.2 -2.2,2.4 -2,5 0.2,2.6 2,5 1.8,2.4 5.2,2.2 3.4,-0.2 5,-2.2 1.6,-2 2,-5 z m 28.6,0 q 0,-3 -2,-5 -2,-2 -5.2,-2.2 -3.2,-0.2 -5,2.2 -1.8,2.4 -2,5 -0.2,2.6 2,5 2.2,2.4 5,2.2 2.8,-0.2 5.2,-2.2 2.4,-2 2,-5 z m 14.4,-25 v 35.8 q 0,4.4 -3.2,7.4 -3.2,3 -7.6,3.2 H 10.8 q -4.6,0 -7.6,-3.2 Q 0.2,165 0,160.8 V 125 q 0,-4.4 3.2,-7.6 3.2,-3.2 7.6,-3.2 h 51.8 l 15,15.2 q 6.6,6.4 15.2,6.4 8.6,0 15.2,-6.4 l 15.2,-15.2 H 175 q 4.4,0 7.6,3.2 3.2,3.2 3.2,7.6 z M 149.4,61.4 q 2,4.6 -1.6,8 l -50,50 q -2,2 -5,2 -3,0 -5,-2 l -50,-50 q -3.4,-3.4 -1.6,-8 2,-4.2 6.6,-4.2 h 28.6 v -50 q 0,-3 2.2,-5 2.2,-2 5,-2.2 h 28.6 q 2.8,0 5,2.2 2.2,2.2 2,5 v 50 h 28.6 q 4.8,0 6.6,4.2 z"
id="path854"
inkscape:connector-curvature="0" />
</svg>

After

Width:  |  Height:  |  Size: 2.3 KiB

55
superx/images/eye.svg

@ -0,0 +1,55 @@ @@ -0,0 +1,55 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="40"
version="1.1"
id="svg4"
sodipodi:docname="eye.svg"
height="25"
inkscape:version="0.92.2 5c3e80d, 2017-08-06">
<metadata
id="metadata10">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs8" />
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1920"
inkscape:window-height="963"
id="namedview6"
showgrid="false"
inkscape:zoom="4.362592"
inkscape:cx="74.725132"
inkscape:cy="46.776568"
inkscape:window-x="1920"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="svg4" />
<path
d="m 36.6793,12.519684 q -3.304754,-5.1320931 -8.281332,-7.6592611 1.321906,2.255012 1.321906,4.859937 0,4.0434691 -2.838203,6.8816721 Q 24.043468,19.440235 20,19.440235 q -4.043469,0 -6.881672,-2.838203 -2.838202,-2.838203 -2.838202,-6.8816721 0,-2.604925 1.321906,-4.859937 -4.9765781,2.527168 -8.2813318,7.6592611 2.9159607,4.432262 7.2704648,7.076066 4.354499,2.643805 9.408835,2.643805 5.054332,0 9.408835,-2.643805 4.354504,-2.643804 7.270465,-7.076066 z M 21.049746,4.1605909 q 0,-0.427672 -0.311035,-0.738707 Q 20.427676,3.1108449 20,3.1497279 q -2.721566,0 -4.665539,1.943972 -1.943976,1.943977 -1.943976,4.62666 0,0.4276761 0.311039,0.7387111 0.311035,0.311035 0.738707,0.311035 0.427676,0 0.738711,-0.311035 0.311039,-0.311035 0.311039,-0.7387111 0,-1.866214 1.321902,-3.188117 Q 18.133785,5.2103369 20,5.2103369 q 0.427676,0 0.738711,-0.311035 0.311035,-0.311035 0.311035,-0.738711 z m 18.389999,8.3590931 q 0,0.738711 -0.427676,1.477418 -3.032597,5.015457 -8.164691,8.009176 Q 25.715285,25 20,25 14.284715,25 9.1526217,22.006278 4.0205282,19.012559 0.98793076,13.997102 0.560255,13.258395 0.560255,12.519684 q 0,-0.738711 0.42767576,-1.5163 Q 4.0205282,6.0268099 9.1526217,3.0330869 14.284715,0.03936788 20,4.8587962e-4 25.715285,-0.03838412 30.847378,3.0330869 q 5.132094,3.07148 8.164691,7.9702971 0.427676,0.777589 0.427676,1.5163 z"
id="path2"
inkscape:connector-curvature="0"
style="stroke-width:0.03887949" />
</svg>

After

Width:  |  Height:  |  Size: 2.8 KiB

Loading…
Cancel
Save