Compare commits
No commits in common. 'master' and 'etl_0.4_Release' have entirely different histories.
master
...
etl_0.4_Re
35 changed files with 213 additions and 3015 deletions
@ -1,47 +0,0 @@
@@ -1,47 +0,0 @@
|
||||
#!/bin/bash |
||||
#Änderungen |
||||
#--------------------------------------------------------------------- |
||||
# Shell-Kommando "etl_execute_unload_job.x" |
||||
# |
||||
#--------------------------------------------------------------------- |
||||
|
||||
if [ "$1" = "" ] |
||||
then echo "Aufruf: etl_execute_unload_job.x job_uniquename FILTER <Ausgabedatei (optional)>" |
||||
echo " " |
||||
echo "Aktion: etl_execute_unload_job.x entlaedt Tabellen." |
||||
echo " Mit Hilfe von etl_execute_upload_job.x koennen diese Daten importiert werden." |
||||
echo " " |
||||
exit 0 |
||||
fi |
||||
|
||||
#------------------------------------------------------------------- |
||||
#-- Metadaten entladen |
||||
#------------------------------------------------------------------- |
||||
|
||||
JOB_UNIQUENAME=$1 |
||||
|
||||
FILTER=$2 |
||||
|
||||
if [ "$3" == "" ] |
||||
then outfile=$JOB_UNIQUENAME.xml |
||||
else |
||||
|
||||
outfile=$3 |
||||
|
||||
fi |
||||
|
||||
|
||||
|
||||
SX_CLIENT=jdbc |
||||
export SX_CLIENT |
||||
CP=".:$JDBC_CLASSPATH" |
||||
|
||||
CMD="java $JAVA_OPTS -cp $CP de.superx.elt.bin.EtlJobExecutor -dbproperties:$DB_PROPERTIES -job:$JOB_UNIQUENAME -outfile:$outfile -params:$FILTER" |
||||
|
||||
echo $CMD |
||||
|
||||
$CMD |
||||
|
||||
|
||||
|
||||
|
@ -1,47 +0,0 @@
@@ -1,47 +0,0 @@
|
||||
#!/bin/bash |
||||
#Änderungen |
||||
#--------------------------------------------------------------------- |
||||
# Shell-Kommando "etl_execute_unload_job.x" |
||||
# |
||||
#--------------------------------------------------------------------- |
||||
|
||||
if [ "$1" = "" ] |
||||
then echo "Aufruf: etl_execute_upload_job.x job_uniquename FILTER <Eingabedatei (optional)>" |
||||
echo " " |
||||
echo "Aktion: etl_execute_upload_job.x laedt Tabellen." |
||||
echo " " |
||||
echo " " |
||||
exit 0 |
||||
fi |
||||
|
||||
#------------------------------------------------------------------- |
||||
#-- Metadaten entladen |
||||
#------------------------------------------------------------------- |
||||
|
||||
JOB_UNIQUENAME=$1 |
||||
|
||||
FILTER=$2 |
||||
|
||||
if [ "$3" == "" ] |
||||
then infile=$JOB_UNIQUENAME.xml |
||||
else |
||||
|
||||
infile=$3 |
||||
|
||||
fi |
||||
|
||||
|
||||
|
||||
SX_CLIENT=jdbc |
||||
export SX_CLIENT |
||||
CP=".:$JDBC_CLASSPATH" |
||||
|
||||
CMD="java $JAVA_OPTS -cp $CP de.superx.elt.bin.EtlJobExecutor -dbproperties:$DB_PROPERTIES -job:$JOB_UNIQUENAME -params:PATH_TO_INPUTFILE=$infile" |
||||
|
||||
echo $CMD |
||||
|
||||
$CMD |
||||
|
||||
|
||||
|
||||
|
@ -1,7 +1,4 @@
@@ -1,7 +1,4 @@
|
||||
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 |
||||
images/resultset_up.svg |
||||
|
||||
|
@ -1,22 +0,0 @@
@@ -1,22 +0,0 @@
|
||||
--Freemarker Template |
||||
|
||||
--used in etl-job qa_project_upload |
||||
<#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) |
||||
) |
||||
; |
||||
|
@ -1,67 +0,0 @@
@@ -1,67 +0,0 @@
|
||||
--Freemarker Template |
||||
|
||||
--used in etl-job qa_project_upload |
||||
<#if SQLdialect='Postgres'> |
||||
drop table if exists tmp_rpta_resultset; |
||||
drop table if exists tmp_etl_rpta_column_layout; |
||||
drop table if exists tmp_rpta_column; |
||||
drop table if exists tmp_rpta_column2layout; |
||||
</#if> |
||||
|
||||
|
||||
CREATE TABLE tmp_rpta_resultset ( |
||||
tid integer, |
||||
caption character varying(255), |
||||
uniquename character varying(255), |
||||
fieldclause text, |
||||
joinclause text, |
||||
whereclause text, |
||||
systeminfo_id integer, |
||||
is_virtual smallint |
||||
); |
||||
|
||||
|
||||
CREATE TABLE tmp_etl_rpta_column_layout ( |
||||
tid integer, |
||||
uniquename character varying(255), |
||||
caption character varying(255), |
||||
resultset_id integer, |
||||
whereclause text, |
||||
description text, |
||||
userinfo_id integer, |
||||
sortnr integer, |
||||
sortclause text, |
||||
is_virtual smallint, |
||||
resultset_uniquename character varying(255) |
||||
); |
||||
|
||||
CREATE TABLE tmp_rpta_column ( |
||||
tid integer, |
||||
uniquename character varying(255), |
||||
caption character varying(255), |
||||
srcfieldname character varying(255), |
||||
column_type integer, |
||||
col_function text, |
||||
is_aggregate smallint, |
||||
resultset_id integer, |
||||
custom integer, |
||||
description text, |
||||
targetfieldname character varying(255) |
||||
); |
||||
|
||||
|
||||
CREATE TABLE tmp_rpta_column2layout ( |
||||
tid integer, |
||||
column_id integer, |
||||
layout_id integer, |
||||
sortnr smallint, |
||||
is_visible smallint, |
||||
visible_size smallint, |
||||
format_code varchar(255), |
||||
targetfieldname character varying(255), |
||||
caption character varying(255), |
||||
description text |
||||
); |
||||
|
||||
|
||||
|
@ -1,49 +0,0 @@
@@ -1,49 +0,0 @@
|
||||
--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) |
||||
) |
||||
; |
||||
|
||||
|
@ -1,4 +0,0 @@
@@ -1,4 +0,0 @@
|
||||
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^ |
||||
4^RPTA_COLUMN_LAYOUT^Spaltenlayouts^0^rpta_column_layout_unload^rpta_column_layout_upload^RPTA_COLUMN_LAYOUT_TID^42000^42008^1^ |
@ -1,12 +0,0 @@
@@ -1,12 +0,0 @@
|
||||
--freemarker template |
||||
<sqlvars> |
||||
<sqlvar name="QA_installed"> |
||||
select 1 from xdummy where 0 < (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> |
@ -1,62 +0,0 @@
@@ -1,62 +0,0 @@
|
||||
begin work; |
||||
|
||||
delete from sichten where name_intern in (select name_intern from tmp_sichten); |
||||
|
||||
insert into sichten(parent, |
||||
systeminfoid, |
||||
art, |
||||
type, |
||||
name_intern, |
||||
name, |
||||
beschreibung, |
||||
sortnr, |
||||
quelle, |
||||
alt_hier_id, |
||||
treecfgtable, |
||||
treecfgid, |
||||
label, |
||||
user_rechte, |
||||
rechtequelle, |
||||
sesamkey, |
||||
standbutton, |
||||
attribut1, |
||||
attribut2, |
||||
attribut3, |
||||
attribut4, |
||||
xmlmaxentries, |
||||
gueltig_seit, |
||||
gueltig_bis, |
||||
cacheapplet, |
||||
cachexml, |
||||
aktiv) select parent, |
||||
systeminfoid, |
||||
art, |
||||
type, |
||||
name_intern, |
||||
name, |
||||
beschreibung, |
||||
sortnr, |
||||
quelle, |
||||
alt_hier_id, |
||||
treecfgtable, |
||||
treecfgid, |
||||
label, |
||||
user_rechte, |
||||
rechtequelle, |
||||
sesamkey, |
||||
standbutton, |
||||
attribut1, |
||||
attribut2, |
||||
attribut3, |
||||
attribut4, |
||||
xmlmaxentries, |
||||
gueltig_seit, |
||||
gueltig_bis, |
||||
cacheapplet, |
||||
cachexml, |
||||
aktiv from tmp_sichten; |
||||
|
||||
drop table tmp_sichten; |
||||
|
||||
commit; |
||||
|
@ -1,52 +0,0 @@
@@ -1,52 +0,0 @@
|
||||
begin work; |
||||
|
||||
|
||||
delete from userinfo where benutzer in (select benutzer from tmp_userinfo); |
||||
|
||||
delete from user_institution where userid in (select userid from tmp_user_institution); |
||||
delete from user_masken_bez where userinfo_id in (select userinfo_id from tmp_user_masken_bez); |
||||
delete from user_sachgeb_bez where userinfo_id in (select userinfo_id from tmp_user_sachgeb_bez); |
||||
delete from user_pw where userinfo_id in (select userinfo_id from tmp_user_pw); |
||||
delete from user_sichtarten where userinfo_id in (select userinfo_id from tmp_user_sichtarten); |
||||
delete from user_sichten where userinfo_id in (select userinfo_id from tmp_user_sichten); |
||||
delete from groupinfo where tid in (select tid from tmp_groupinfo); |
||||
|
||||
delete from group_field_pref where groupinfo_id in (select groupinfo_id from tmp_group_field_pref); |
||||
delete from group_masken_bez where groupinfo_id in (select groupinfo_id from tmp_group_masken_bez); |
||||
delete from group_sachgeb_bez where groupinfo_id in (select groupinfo_id from tmp_group_sachgeb_bez); |
||||
delete from group_sichtarten where groupinfo_id in (select groupinfo_id from tmp_group_sichtarten); |
||||
delete from group_sichten where groupinfo_id in (select groupinfo_id from tmp_group_sichten); |
||||
delete from user_group_bez where groupinfo_id in (select groupinfo_id from tmp_user_group_bez); |
||||
|
||||
|
||||
insert into userinfo select * from tmp_userinfo ; |
||||
insert into user_institution select * from tmp_user_institution ; |
||||
insert into user_masken_bez select * from tmp_user_masken_bez ; |
||||
insert into user_sachgeb_bez select * from tmp_user_sachgeb_bez ; |
||||
insert into user_pw select * from tmp_user_pw ; |
||||
insert into user_sichtarten select * from tmp_user_sichtarten ; |
||||
insert into user_sichten select * from tmp_user_sichten ; |
||||
insert into groupinfo select * from tmp_groupinfo ; |
||||
insert into group_field_pref select * from tmp_group_field_pref ; |
||||
insert into group_masken_bez select * from tmp_group_masken_bez ; |
||||
insert into group_sachgeb_bez select * from tmp_group_sachgeb_bez ; |
||||
insert into group_sichtarten select * from tmp_group_sichtarten; |
||||
insert into group_sichten select * from tmp_group_sichten ; |
||||
insert into user_group_bez select * from tmp_user_group_bez ; |
||||
|
||||
drop table tmp_userinfo; |
||||
drop table tmp_user_institution; |
||||
drop table tmp_user_masken_bez; |
||||
drop table tmp_user_sachgeb_bez; |
||||
drop table tmp_user_pw; |
||||
drop table tmp_user_sichtarten; |
||||
drop table tmp_user_sichten; |
||||
drop table tmp_groupinfo; |
||||
drop table tmp_group_field_pref; |
||||
drop table tmp_group_masken_bez; |
||||
drop table tmp_group_sachgeb_bez; |
||||
drop table tmp_group_sichtarten; |
||||
drop table tmp_group_sichten; |
||||
drop table tmp_user_group_bez; |
||||
|
||||
commit; |
File diff suppressed because it is too large
Load Diff
@ -1,61 +0,0 @@
@@ -1,61 +0,0 @@
|
||||
|
||||
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; |
||||
|
@ -1,40 +0,0 @@
@@ -1,40 +0,0 @@
|
||||
--freemarker template |
||||
<#include "SQL_lingua_franca"/> |
||||
<#include "SuperX_general"/> |
||||
<#include "RPTA-Makros"/> |
||||
|
||||
<sqlvars> |
||||
<sqlvar name="rpta_column_layout" type="hash"> |
||||
select uniquename, |
||||
caption, |
||||
resultset_uniquename as rpta_resultset, |
||||
replace(whereclause,'''','''''') as whereclause, |
||||
description, |
||||
sortclause, |
||||
is_virtual |
||||
from tmp_etl_rpta_column_layout; |
||||
</sqlvar> |
||||
<sqlvar name="rpta_columns" type="hashsequence"> |
||||
select C.uniquename, |
||||
null::varchar(255) as caption, |
||||
C.caption as caption_der_spalte, |
||||
L.caption as caption_in_ergebnistabelle, |
||||
C.srcfieldname, |
||||
C.targetfieldname, |
||||
T.uniquename as column_type, |
||||
replace(C.col_function,'''','''''') as col_function, |
||||
L.is_visible, |
||||
L.visible_size, |
||||
C.is_aggregate, |
||||
null::varchar(255) as description, |
||||
L.format_code, |
||||
C.description as description_der_spalte, |
||||
L.description as description_in_ergebnistabelle |
||||
from tmp_rpta_column C, tmp_rpta_column2layout L, rpta_column_type T |
||||
where L.column_id=C.tid |
||||
and T.tid=C.column_type |
||||
</sqlvar> |
||||
</sqlvars> |
||||
|
||||
|
||||
<@rpta_column_layout_fuellen /> |
@ -1,42 +0,0 @@
@@ -1,42 +0,0 @@
|
||||
|
||||
--obsolete jobs: |
||||
|
||||
delete from etl_step |
||||
where 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') |
||||
and J.systeminfo_id=9); |
||||
|
||||
delete from etl_step_property |
||||
where etl_step_id 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') |
||||
and J.systeminfo_id=9); |
||||
|
||||
delete from etl_step_relation |
||||
where 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') |
||||
and J.systeminfo_id=9); |
||||
|
||||
delete from etl_job |
||||
where uniquename in ('sx_select_mask', |
||||
'sx_insert_mask', |
||||
'kern_konstanten_update', |
||||
'sichten_unload', |
||||
'sos_gewichtung_unload') |
||||
and systeminfo_id=9; |
||||
|
@ -1,137 +0,0 @@
@@ -1,137 +0,0 @@
|
||||
package de.superx.elt; |
||||
import static de.superx.servlet.SxSQL_Server.DEFAULT_MANDANTEN_ID; |
||||
import java.io.File; |
||||
import java.io.FileNotFoundException; |
||||
import java.io.IOException; |
||||
import java.sql.Connection; |
||||
import java.sql.ResultSet; |
||||
import java.sql.SQLException; |
||||
import java.sql.Statement; |
||||
import java.sql.DatabaseMetaData; |
||||
import java.util.HashMap; |
||||
import java.util.Hashtable; |
||||
import java.util.Iterator; |
||||
import java.util.Properties; |
||||
import java.util.StringTokenizer; |
||||
import java.util.logging.Level; |
||||
import java.util.logging.Logger; |
||||
|
||||
import de.memtext.db.ConnectionCreator; |
||||
import de.memtext.util.DateUtils; |
||||
import de.memtext.util.GetOpts; |
||||
import de.memtext.util.StringUtils; |
||||
import de.superx.common.DBServletException; |
||||
import de.superx.common.FieldContainer; |
||||
import de.superx.common.Sichten; |
||||
import de.superx.common.StandaloneSicht; |
||||
import de.superx.common.SuperX_el; |
||||
import de.superx.common.SxResultRow; |
||||
import de.superx.common.SxResultSet; |
||||
import de.superx.common.SxSqlHelper; |
||||
import de.superx.common.SxUser; |
||||
import de.superx.common.TableFieldExists; |
||||
import de.superx.common.TemplateProcessor; |
||||
import de.superx.servlet.SuperXManager; |
||||
import de.superx.servlet.SxPools; |
||||
import de.superx.servlet.SxSQL_Server; |
||||
import de.superx.util.PropsReader; |
||||
import de.superx.util.SqlStringUtils; |
||||
|
||||
public class EtlFmParser extends TemplateProcessor { |
||||
private String dbprop, infile, outfile; |
||||
private Properties props; |
||||
|
||||
private Statement stm; |
||||
private String isSimpleParser; |
||||
private static String sqlDialect; |
||||
|
||||
EtlFmParser(String mandantenID, Connection con) { |
||||
super(mandantenID,con); |
||||
|
||||
} |
||||
|
||||
|
||||
|
||||
private void initConAndParser() throws IOException, SQLException, |
||||
ClassNotFoundException { |
||||
|
||||
stm = con.createStatement(); |
||||
if(SqlStringUtils.tableExists(con,"fm_templates",DEFAULT_MANDANTEN_ID)) |
||||
{ |
||||
setTemplates(readFromDb("select trim(both from id),content from fm_templates")); |
||||
repositoryToMap(readFromDb(REPOSITORY_SELECT), repositoryMap); |
||||
} |
||||
if(SqlStringUtils.tableExists(con,"konstanten",DEFAULT_MANDANTEN_ID)) |
||||
{ |
||||
SxResultSet rs = readFromDb("select trim(both from beschreibung),apnr from konstanten"); |
||||
for (Iterator it = rs.iterator(); it.hasNext();) { |
||||
SxResultRow row = (SxResultRow) it.next(); |
||||
String beschreibung = (String) row.get(0); |
||||
|
||||
repositoryMap.put("K_" + beschreibung.trim(), row.get(1)); |
||||
} |
||||
} |
||||
} |
||||
|
||||
|
||||
|
||||
protected SxResultSet readFromDb(String sql) throws SQLException { |
||||
SuperX_el el = new SuperX_el(); |
||||
|
||||
SxSqlHelper sh=new SxSqlHelper(); |
||||
sh.execute(sql, this.con, el); |
||||
|
||||
|
||||
if (el.getError_String() != null |
||||
&& !el.getError_String().trim().equals("")) |
||||
throw new SQLException("\nProblem bei:" + "\n\n Meldung:" |
||||
+ el.getError_String() + "\n sql:" + sql); |
||||
|
||||
return el.getResultSet(); |
||||
|
||||
|
||||
} |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* |
||||
* Einfacher Parser für Fremddatenbanken, nur sqlDialect wird übergeben wird |
||||
* von DOSQL direkt aufgerufen |
||||
*/ |
||||
public String simpleParser( String input) |
||||
throws FileNotFoundException, IOException, Exception { |
||||
String output = ""; |
||||
sqlDialect = "Postgres";// de.superx.util.SqlStringUtils.getSqlDialect(props .getProperty("driverName"));
|
||||
initConAndParser(); |
||||
HashMap map = new HashMap(); |
||||
try { |
||||
output = "--automatically created by SuperX/Freemarker for " |
||||
+ sqlDialect |
||||
+ " (" |
||||
+ DateUtils.getTodayString() |
||||
+ " " |
||||
+ DateUtils.getNowString() |
||||
+ ")\n" |
||||
+ process("FM-Parsing ", input, map, |
||||
sqlDialect); |
||||
|
||||
} catch (Exception e) { |
||||
System.err.println("Fehler beim FM-Parsen "); |
||||
e.printStackTrace(); |
||||
System.exit(1); |
||||
} |
||||
return output; |
||||
|
||||
} |
||||
|
||||
} |
||||
|
||||
// Created on 08.12.2006 at 18:03:46
|
||||
|
||||
|
||||
|
@ -1,213 +0,0 @@
@@ -1,213 +0,0 @@
|
||||
/* |
||||
* 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; |
||||
} |
||||
|
||||
} |
Binary file not shown.
@ -1,143 +0,0 @@
@@ -1,143 +0,0 @@
|
||||
<%@ 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> |
Loading…
Reference in new issue