Browse Source

Beispiel-Ladejob, Sync Script

master
Daniel Quathamer 2 years ago
parent
commit
6c0a0f3a25
  1. 29
      rsync_to_h1.x
  2. 25
      rsync_to_superx.x
  3. 2
      superx/WEB-INF/conf/edustore/db/module/myjobs/conf/his1/edustore_install/edustore_myjobs_drop_pg.xml
  4. 3
      superx/WEB-INF/conf/edustore/db/module/myjobs/conf/his1/edustore_install/edustore_myjobs_install_pg.xml
  5. 6
      superx/WEB-INF/conf/edustore/db/module/myjobs/conf/his1/edustore_install/edustore_myjobs_integrate_pg.sql
  6. 39
      superx/WEB-INF/conf/edustore/db/module/myjobs/conf/his1/edustore_install/edustore_myjobs_masken_einspielen.xml
  7. 39
      superx/WEB-INF/conf/edustore/db/module/myjobs/conf/his1/edustore_install/edustore_myjobs_masken_entladen.xml
  8. 14
      superx/WEB-INF/conf/edustore/db/module/myjobs/conf/his1/edustore_install/edustore_myjobs_masken_loeschen.xml
  9. 4
      superx/WEB-INF/conf/edustore/db/module/myjobs/conf/myjobs.html
  10. 13
      superx/WEB-INF/conf/edustore/db/module/myjobs/conf/myjobs.xml
  11. 10
      superx/WEB-INF/conf/edustore/db/module/myjobs/conf/unload_params_fuellen.sql
  12. 2
      superx/WEB-INF/conf/edustore/db/module/myjobs/conf/unload_params_loeschen.sql
  13. 10
      superx/WEB-INF/conf/edustore/db/module/myjobs/masken/8000_felderinfo.unl
  14. 1
      superx/WEB-INF/conf/edustore/db/module/myjobs/masken/8000_maske_system_bez.unl
  15. 8
      superx/WEB-INF/conf/edustore/db/module/myjobs/masken/8000_masken_felder_bez.unl
  16. 7
      superx/WEB-INF/conf/edustore/db/module/myjobs/masken/8000_maskeninfo.unl
  17. 1
      superx/WEB-INF/conf/edustore/db/module/myjobs/masken/8000_sachgeb_maske_bez.unl
  18. 2
      superx/WEB-INF/conf/edustore/db/module/myjobs/myjobs_drop_pg.sql
  19. 14
      superx/WEB-INF/conf/edustore/db/module/myjobs/myjobs_install_pg.sql
  20. 4
      superx/WEB-INF/conf/edustore/db/module/myjobs/myjobs_masken_einspielen_pg.x
  21. 3
      superx/WEB-INF/conf/edustore/db/module/myjobs/myjobs_masken_entladen_pg.x
  22. 2
      superx/WEB-INF/conf/edustore/db/module/myjobs/myjobs_masken_loeschen_pg.x
  23. 41
      superx/WEB-INF/conf/edustore/db/module/myjobs/schluesseltabellen/sx_jobs_fuellen.sql
  24. 30
      superx/WEB-INF/conf/edustore/db/module/myjobs/upgrade/myjobs_upgrade_themenbaum.sql

29
rsync_to_h1.x

@ -0,0 +1,29 @@ @@ -0,0 +1,29 @@
#!/bin/bash
#Synchronisierung webapp zum Zielserver
#Benutzer Variablen:
#REMOTE_HOST ->Ziel-Hostname
#REMOTE_USER ->Ziel-Benutzerkennung
#REMOTE_DIR -> Zielpfad
#TODO: in LOCAL_DIR gelöschte Dateien werden nicht im REMOTE_DIR gelöscht
if [ "$LOCAL_DIR" = "" ]
then
LOCAL_DIR=`pwd`
fi
if [ "$REMOTE_DIR" = "" ]
then
REMOTE_DIR=$WEBAPP
fi
echo "Sync von $LOCAL_DIR nach $REMOTE_DIR"
if [ "$REMOTE_HOST" = "" ]
then
rsync -L -rauvz $LOCAL_DIR/superx/* $REMOTE_DIR
else
rsync -L -rauvz -e ssh $LOCAL_DIR/superx/* "$REMOTE_USER"@"$REMOTE_HOST":$REMOTE_DIR
fi

25
rsync_to_superx.x

@ -1,7 +1,28 @@ @@ -1,7 +1,28 @@
#!/bin/bash
#Synchronisierung webapp zum Zielpfad
#Synchronisierung webapp zum Zielserver
#Benutzer Variablen:
#REMOTE_HOST ->Ziel-Hostname
#REMOTE_USER ->Ziel-Benutzerkennung
#REMOTE_DIR -> Zielpfad
ant -DMODULE_PATH=$MEINMODUL_PFAD -DBASE_DIR=. -DMODULE=meinmodul all
if [ "$LOCAL_DIR" = "" ]
then
LOCAL_DIR=`pwd`
fi
if [ "$REMOTE_DIR" = "" ]
then
REMOTE_DIR=$SUPERX_DIR
fi
echo "Sync von $LOCAL_DIR nach $REMOTE_DIR"
if [ "$REMOTE_HOST" = "" ]
then
rsync -L -rauvz $LOCAL_DIR/superx/WEB-INF/conf/edustore/db/* $REMOTE_DIR/db
rsync -L -rauvz $LOCAL_DIR/superx/* $REMOTE_DIR/webserver/tomcat/webapps/superx
else
rsync -L -rauvz -e ssh $LOCAL_DIR/superx/WEB-INF/conf/edustore/db/* "$REMOTE_USER"@"$REMOTE_HOST":$REMOTE_DIR/db
rsync -L -rauvz -e ssh $LOCAL_DIR/superx/* "$REMOTE_USER"@"$REMOTE_HOST":$REMOTE_DIR/webserver/tomcat/webapps/superx
fi

2
superx/WEB-INF/conf/edustore/db/module/myjobs/conf/his1/edustore_install/edustore_myjobs_drop_pg.xml

@ -37,6 +37,8 @@ select max(tid)+1,'Wuppertaler Ladejobs' from themenbaum; @@ -37,6 +37,8 @@ select max(tid)+1,'Wuppertaler Ladejobs' from themenbaum;
delete from themenbaum where name in (select distinct name from tmp_themenbaum);
--Nun die einzelnen Masken
delete from themenbaum where maskeninfo_id=8000;
drop table tmp_themenbaum;

3
superx/WEB-INF/conf/edustore/db/module/myjobs/conf/his1/edustore_install/edustore_myjobs_install_pg.xml

@ -1,5 +1,8 @@ @@ -1,5 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?><dbi:dbactions xmlns:dsd="http://www.his.de/Abt1/Interfaces/dsd_V1.0" xmlns:dbi="http://www.his.de/Abt1/Interfaces/dbi_V1.0" dbi:want-result="true" dbi:autocommit="true">
<dbi:dbaction dbi:action="executeFile">
<dbi:file database="eduetl" encoding="UTF-8" withNativeClient="n" structure="SQL" filename="$MYJOBS_PFAD/schluesseltabellen/sx_jobs_fuellen.sql"/>
</dbi:dbaction>
<dbi:dbaction dbi:action="executeFile">
<dbi:file structure="SQL" withNativeClient="n" encoding="UTF-8" database="eduetl" filename="$MYJOBS_PFAD/conf/sx_tables_fuellen.sql"/>
</dbi:dbaction>
<dbi:dbaction dbi:action="executeFile">

6
superx/WEB-INF/conf/edustore/db/module/myjobs/conf/his1/edustore_install/edustore_myjobs_integrate_pg.sql

@ -85,6 +85,12 @@ update tmp_themenbaum set parent=(select max(tid) from themenbaum where name='Ab @@ -85,6 +85,12 @@ update tmp_themenbaum set parent=(select max(tid) from themenbaum where name='Ab
-- Nun die einzelnen Masken:
insert into tmp_themenbaum
( name ,maskeninfo_id, parentname,
gueltig_seit ,
gueltig_bis)
values('Jobmonitor ausführen','8000','Administration',date_val('01.01.1900'),date_val('01.01.3000'));
--gibt es die Maske schon?
delete from tmp_themenbaum where maskeninfo_id in (select T.maskeninfo_id from themenbaum T);

39
superx/WEB-INF/conf/edustore/db/module/myjobs/conf/his1/edustore_install/edustore_myjobs_masken_einspielen.xml

@ -1 +1,38 @@ @@ -1 +1,38 @@
<?xml version="1.0" encoding="UTF-8"?><dbi:dbactions xmlns:dsd="http://www.his.de/Abt1/Interfaces/dsd_V1.0" xmlns:dbi="http://www.his.de/Abt1/Interfaces/dbi_V1.0" dbi:want-result="true" dbi:autocommit="true"/>
<?xml version="1.0" encoding="UTF-8"?><dbi:dbactions xmlns:dsd="http://www.his.de/Abt1/Interfaces/dsd_V1.0" xmlns:dbi="http://www.his.de/Abt1/Interfaces/dbi_V1.0" dbi:want-result="true" dbi:autocommit="true">
<dbi:dbaction dbi:action="sqlexec">eduetl:delete from maskeninfo where tid = 8000;
</dbi:dbaction>
<dbi:dbaction dbi:action="sqlexec">eduetl:delete from felderinfo where tid in
(select felderinfo_id from masken_felder_bez where maskeninfo_id = 8000);
</dbi:dbaction>
<dbi:dbaction dbi:action="sqlexec">eduetl:delete from masken_felder_bez where maskeninfo_id = 8000;
</dbi:dbaction>
<dbi:dbaction dbi:action="sqlexec">eduetl:delete from sachgeb_maske_bez where maskeninfo_id = 8000;
</dbi:dbaction>
<dbi:dbaction dbi:action="sqlexec">eduetl:delete from maske_system_bez where maskeninfo_id = 8000;
</dbi:dbaction>
<dbi:dbaction dbi:action="importFile">
<dbi:data database="eduetl" table="maskeninfo">
<dbi:file encoding="UTF-8" separator="^" trailingSeparator="y" withNativeClient="n" firstLinedescription="n" structure="CSV" filename="$MYJOBS_PFAD/masken/8000_maskeninfo.unl"/>
</dbi:data>
</dbi:dbaction>
<dbi:dbaction dbi:action="importFile">
<dbi:data database="eduetl" table="felderinfo">
<dbi:file encoding="UTF-8" separator="^" trailingSeparator="y" withNativeClient="n" firstLinedescription="n" structure="CSV" filename="$MYJOBS_PFAD/masken/8000_felderinfo.unl"/>
</dbi:data>
</dbi:dbaction>
<dbi:dbaction dbi:action="importFile">
<dbi:data database="eduetl" table="masken_felder_bez">
<dbi:file encoding="UTF-8" separator="^" trailingSeparator="y" withNativeClient="n" firstLinedescription="n" structure="CSV" filename="$MYJOBS_PFAD/masken/8000_masken_felder_bez.unl"/>
</dbi:data>
</dbi:dbaction>
<dbi:dbaction dbi:action="importFile">
<dbi:data database="eduetl" table="sachgeb_maske_bez">
<dbi:file encoding="UTF-8" separator="^" trailingSeparator="y" withNativeClient="n" firstLinedescription="n" structure="CSV" filename="$MYJOBS_PFAD/masken/8000_sachgeb_maske_bez.unl"/>
</dbi:data>
</dbi:dbaction>
<dbi:dbaction dbi:action="importFile">
<dbi:data database="eduetl" table="maske_system_bez">
<dbi:file encoding="UTF-8" separator="^" trailingSeparator="y" withNativeClient="n" firstLinedescription="n" structure="CSV" filename="$MYJOBS_PFAD/masken/8000_maske_system_bez.unl"/>
</dbi:data>
</dbi:dbaction>
</dbi:dbactions>

39
superx/WEB-INF/conf/edustore/db/module/myjobs/conf/his1/edustore_install/edustore_myjobs_masken_entladen.xml

@ -1 +1,38 @@ @@ -1 +1,38 @@
<?xml version="1.0" encoding="UTF-8"?><dbi:dbactions xmlns:dsd="http://www.his.de/Abt1/Interfaces/dsd_V1.0" xmlns:dbi="http://www.his.de/Abt1/Interfaces/dbi_V1.0" dbi:want-result="true" dbi:autocommit="true"/>
<?xml version="1.0" encoding="UTF-8"?><dbi:dbactions xmlns:dsd="http://www.his.de/Abt1/Interfaces/dsd_V1.0" xmlns:dbi="http://www.his.de/Abt1/Interfaces/dbi_V1.0" dbi:want-result="true" dbi:autocommit="true">
<dbi:dbaction dbi:action="exportFile">
<dbi:data sqlVarDatabase="" database="eduetl">
<extraction-sql>select * from maskeninfo where tid = 8000;
</extraction-sql>
<dbi:file encoding="UTF-8" separator="^" trailingSeparator="y" withNativeClient="y" firstLinedescription="n" structure="CSV" filename="$MYJOBS_PFAD/masken/8000_maskeninfo.unl"/>
</dbi:data>
</dbi:dbaction>
<dbi:dbaction dbi:action="exportFile">
<dbi:data sqlVarDatabase="" database="eduetl">
<extraction-sql>select * from felderinfo where tid in
(select felderinfo_id from masken_felder_bez where maskeninfo_id = 8000);
</extraction-sql>
<dbi:file encoding="UTF-8" separator="^" trailingSeparator="y" withNativeClient="y" firstLinedescription="n" structure="CSV" filename="$MYJOBS_PFAD/masken/8000_felderinfo.unl"/>
</dbi:data>
</dbi:dbaction>
<dbi:dbaction dbi:action="exportFile">
<dbi:data sqlVarDatabase="" database="eduetl">
<extraction-sql>select * from masken_felder_bez where maskeninfo_id = 8000;
</extraction-sql>
<dbi:file encoding="UTF-8" separator="^" trailingSeparator="y" withNativeClient="y" firstLinedescription="n" structure="CSV" filename="$MYJOBS_PFAD/masken/8000_masken_felder_bez.unl"/>
</dbi:data>
</dbi:dbaction>
<dbi:dbaction dbi:action="exportFile">
<dbi:data sqlVarDatabase="" database="eduetl">
<extraction-sql>select * from sachgeb_maske_bez where maskeninfo_id = 8000;
</extraction-sql>
<dbi:file encoding="UTF-8" separator="^" trailingSeparator="y" withNativeClient="y" firstLinedescription="n" structure="CSV" filename="$MYJOBS_PFAD/masken/8000_sachgeb_maske_bez.unl"/>
</dbi:data>
</dbi:dbaction>
<dbi:dbaction dbi:action="exportFile">
<dbi:data sqlVarDatabase="" database="eduetl">
<extraction-sql>select * from maske_system_bez where maskeninfo_id = 8000;
</extraction-sql>
<dbi:file encoding="UTF-8" separator="^" trailingSeparator="y" withNativeClient="y" firstLinedescription="n" structure="CSV" filename="$MYJOBS_PFAD/masken/8000_maske_system_bez.unl"/>
</dbi:data>
</dbi:dbaction>
</dbi:dbactions>

14
superx/WEB-INF/conf/edustore/db/module/myjobs/conf/his1/edustore_install/edustore_myjobs_masken_loeschen.xml

@ -1 +1,13 @@ @@ -1 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?><dbi:dbactions xmlns:dsd="http://www.his.de/Abt1/Interfaces/dsd_V1.0" xmlns:dbi="http://www.his.de/Abt1/Interfaces/dbi_V1.0" dbi:want-result="true" dbi:autocommit="true"/>
<?xml version="1.0" encoding="UTF-8"?><dbi:dbactions xmlns:dsd="http://www.his.de/Abt1/Interfaces/dsd_V1.0" xmlns:dbi="http://www.his.de/Abt1/Interfaces/dbi_V1.0" dbi:want-result="true" dbi:autocommit="true">
<dbi:dbaction dbi:action="sqlexec">eduetl:delete from maskeninfo where tid = 8000;
</dbi:dbaction>
<dbi:dbaction dbi:action="sqlexec">eduetl:delete from felderinfo where tid in
(select felderinfo_id from masken_felder_bez where maskeninfo_id = 8000);
</dbi:dbaction>
<dbi:dbaction dbi:action="sqlexec">eduetl:delete from masken_felder_bez where maskeninfo_id = 8000;
</dbi:dbaction>
<dbi:dbaction dbi:action="sqlexec">eduetl:delete from sachgeb_maske_bez where maskeninfo_id = 8000;
</dbi:dbaction>
<dbi:dbaction dbi:action="sqlexec">eduetl:delete from maske_system_bez where maskeninfo_id = 8000;
</dbi:dbaction>
</dbi:dbactions>

4
superx/WEB-INF/conf/edustore/db/module/myjobs/conf/myjobs.html

@ -180,7 +180,9 @@ font-style:italic: @@ -180,7 +180,9 @@ font-style:italic:
<h2 class="level_2">
<a name="masken">Masken</a>
</h2>
<ul></ul>
<ul>
<li>Maske Jobmonitor ausf&uuml;hren<br> Nummer 8000</li>
</ul>
<h1 class="level_1">Schnittstellenbeschreibung</h1>
<h2 class="level_2">
<a name="install">Installation</a>

13
superx/WEB-INF/conf/edustore/db/module/myjobs/conf/myjobs.xml

@ -4,6 +4,11 @@ @@ -4,6 +4,11 @@
sachgebiet="Wuppertaler Ladejobs" systeminfo_id="1400"
system="Wuppertaler Ladejobs" thema="Wuppertaler Ladejobs" thema_parent="Abfragen">
<database name="superx" system="superx">
<masken>
<maske tid="8000" name="Jobmonitor ausführen" thema="Administration">
<src><path>$MYJOBS_PFAD/masken</path><author>D. Quathamer</author></src>
</maske>
</masken>
</database>
<etl>
@ -14,7 +19,7 @@ system="Wuppertaler Ladejobs" thema="Wuppertaler Ladejobs" thema_parent="Abfrage @@ -14,7 +19,7 @@ system="Wuppertaler Ladejobs" thema="Wuppertaler Ladejobs" thema_parent="Abfrage
</description>
<action error="stop">
<kettle-job-embedded name="Jobmonitor"
file="$MYJOBS_PFAD/etl/jobmonitor/jobmonitor.kjb" active="true">
file="$MYJOBS_PFAD/etl/jobmonitor/jobmonitor_logausgabe.kjb" active="true">
<description>Jobmonitor</description>
</kettle-job-embedded>
</action>
@ -22,6 +27,12 @@ system="Wuppertaler Ladejobs" thema="Wuppertaler Ladejobs" thema_parent="Abfrage @@ -22,6 +27,12 @@ system="Wuppertaler Ladejobs" thema="Wuppertaler Ladejobs" thema_parent="Abfrage
</etl>
<install>
<install-step name="Füllen der Job-Tabelle">
<action error="stop">
<nativeaction sql="" scriptfile="$MYJOBS_PFAD/schluesseltabellen/sx_jobs_fuellen.sql"
database=""/>
</action>
</install-step>
</install>
<upgrade>
</upgrade>

10
superx/WEB-INF/conf/edustore/db/module/myjobs/conf/unload_params_fuellen.sql

@ -30,7 +30,7 @@ insert into tmp_unload_params(param_id, @@ -30,7 +30,7 @@ insert into tmp_unload_params(param_id,
'POSTGRES',
'POSTGRES',
'Quell-DBMS',
6100);
1400);
insert into tmp_unload_params(param_id,
@ -42,7 +42,7 @@ insert into tmp_unload_params(param_id, @@ -42,7 +42,7 @@ insert into tmp_unload_params(param_id,
'20191',
'20191',
'Startsemester Lehrveranstaltungen. Ab welchem Semester sollen Lehrveranstaltungen entladen werden? z.B. 20191 für SS 2019',
6100);
1400);
insert into tmp_unload_params(param_id,
param_val,
@ -53,7 +53,7 @@ insert into tmp_unload_params(param_id, @@ -53,7 +53,7 @@ insert into tmp_unload_params(param_id,
'hisinone',
'hisinone',
'Quellsystem (z.B. sospos, sva oder hisinone)',
6100);
1400);
--description wird immer geändert:
@ -61,7 +61,7 @@ update unload_params set description=(select T.description @@ -61,7 +61,7 @@ update unload_params set description=(select T.description
from tmp_unload_params T
where T.param_id=unload_params.param_id
and T.systeminfo_id=unload_params.systeminfo_id)
where systeminfo_id=6100
where systeminfo_id=1400
and param_id in (select param_id from tmp_unload_params);
--default_val wird immer geändert:
@ -69,7 +69,7 @@ update unload_params set default_val=(select T.default_val @@ -69,7 +69,7 @@ update unload_params set default_val=(select T.default_val
from tmp_unload_params T
where T.param_id=unload_params.param_id
and T.systeminfo_id=unload_params.systeminfo_id)
where systeminfo_id=6100
where systeminfo_id=1400
and param_id in (select param_id from tmp_unload_params);

2
superx/WEB-INF/conf/edustore/db/module/myjobs/conf/unload_params_loeschen.sql

@ -13,7 +13,7 @@ select sp_table_exists('unload_params') from xdummy; @@ -13,7 +13,7 @@ select sp_table_exists('unload_params') from xdummy;
--Unload Parameter löschen
delete from unload_params where systeminfo_id=6100;
delete from unload_params where systeminfo_id=1400;
</#if>

10
superx/WEB-INF/conf/edustore/db/module/myjobs/masken/8000_felderinfo.unl

@ -0,0 +1,10 @@ @@ -0,0 +1,10 @@
8000^Datei^40^0^0^150^150^1^char^200^0^19^^hidden^ ^
8001^Job^20^0^0^150^150^1^integer^200^1^1^<<SQL>> select tid,caption from sx_jobs where\
sachgebiete_id in (1400)\
order by 2^ ^ ^
8002^Jahr^10^0^0^100^200^1^integer^30^1^1^<<SQL>> SELECT ord,name FROM aggregierung where kategorie='KENN-Jahr' order by 1 desc;^hidden^<<SQL>> SELECT ord,name FROM aggregierung where kategorie='KENN-Jahr' and ord=(year(today())-1) ;^
8003^dokettlejob^100^0^0^150^400^1^char^10^0^0^^hidden^ ^
8004^Semester^3^0^0^140^80^1^integer^30^0^1^<<SQL>> select tid, druck from kenn_semester order by tid DESC;^hidden^<<SQL>> select tid,druck from kenn_semester where today() between sem_beginn and sem_ende;^
8005^Modus^50^0^0^150^250^1^integer^30^1^1^<<SQL>>select 1,'Hinzufügen' from xdummy union select 2,'Alles löschen und hinzufügen' from xdummy;^hidden^<<SQL>> select 2,'Alles löschen und hinzufügen' from xdummy;^
8006^Organisationseinheit^1^0^0^100^100^1^char^30^0^12^<<SQL>> select tid,name,sortnr from sichten where art='Kern-Kostenstellen-Sicht' order by sortnr;^^^
8007^maxoffset^100^0^0^150^400^1^integer^10^0^0^^hidden^100000^

1
superx/WEB-INF/conf/edustore/db/module/myjobs/masken/8000_maske_system_bez.unl

@ -0,0 +1 @@ @@ -0,0 +1 @@
8000^109^

8
superx/WEB-INF/conf/edustore/db/module/myjobs/masken/8000_masken_felder_bez.unl

@ -0,0 +1,8 @@ @@ -0,0 +1,8 @@
8000^8000^
8000^8001^
8000^8002^
8000^8003^
8000^8004^
8000^8005^
8000^8006^
8000^8007^

7
superx/WEB-INF/conf/edustore/db/module/myjobs/masken/8000_maskeninfo.unl

@ -0,0 +1,7 @@ @@ -0,0 +1,7 @@
8000^Jobmonitor ausführen^--Freemarker Template\
\
select 'job' from xdummy;^--Freemarker Template\
Column CID=6 heading_text="Import\\nKommentar" center_heading\
row_selectable col_selectable rightJust heading_platform readonly\
width=10\
@@@^Fachsemester^Anzahl^Beispiel-Ladejob für dezentralen Einsatz an der Hochschule^ ^^1^600^360^0^^^

1
superx/WEB-INF/conf/edustore/db/module/myjobs/masken/8000_sachgeb_maske_bez.unl

@ -0,0 +1 @@ @@ -0,0 +1 @@
114^8000^

2
superx/WEB-INF/conf/edustore/db/module/myjobs/myjobs_drop_pg.sql

@ -56,6 +56,8 @@ select max(tid)+1,'Wuppertaler Ladejobs' from themenbaum; @@ -56,6 +56,8 @@ select max(tid)+1,'Wuppertaler Ladejobs' from themenbaum;
delete from themenbaum where name in (select distinct name from tmp_themenbaum);
--Nun die einzelnen Masken
delete from themenbaum where maskeninfo_id=8000;
drop table tmp_themenbaum;

14
superx/WEB-INF/conf/edustore/db/module/myjobs/myjobs_install_pg.sql

@ -4,6 +4,14 @@ @@ -4,6 +4,14 @@
\! echo "Creating tables"
\! echo `date`
--Install-Schritt: Füllen der Job-Tabelle
\! echo "Scriptfile $MYJOBS_PFAD/schluesseltabellen/sx_jobs_fuellen.sql ausführen"
\! echo `date`
\! DOSQL $MYJOBS_PFAD/schluesseltabellen/sx_jobs_fuellen.sql
--Integrieren:
@ -100,6 +108,12 @@ update tmp_themenbaum set parent=(select max(tid) from themenbaum where name='Ab @@ -100,6 +108,12 @@ update tmp_themenbaum set parent=(select max(tid) from themenbaum where name='Ab
\! echo `date`
insert into tmp_themenbaum
( name ,maskeninfo_id, parentname,
gueltig_seit ,
gueltig_bis)
values('Jobmonitor ausführen','8000','Administration',date_val('01.01.1900'),date_val('01.01.3000'));
--gibt es die Maske schon?
delete from tmp_themenbaum where maskeninfo_id in (select T.maskeninfo_id from themenbaum T);

4
superx/WEB-INF/conf/edustore/db/module/myjobs/myjobs_masken_einspielen_pg.x

@ -3,3 +3,7 @@ @@ -3,3 +3,7 @@
# sx_client psql
# dbsystem POSTGRES
#Maske Nr.8000 Jobmonitor ausführen
echo "Maske Nr. 8000 einfügen:"
cd $MYJOBS_PFAD/masken
sx_auto_insert_mask 8000

3
superx/WEB-INF/conf/edustore/db/module/myjobs/myjobs_masken_entladen_pg.x

@ -3,3 +3,6 @@ @@ -3,3 +3,6 @@
# sx_client psql
# dbsystem POSTGRES
#Maske Nr.8000 Jobmonitor ausführen
cd "$MYJOBS_PFAD/masken"
sx_select_mask 8000

2
superx/WEB-INF/conf/edustore/db/module/myjobs/myjobs_masken_loeschen_pg.x

@ -3,3 +3,5 @@ @@ -3,3 +3,5 @@
# sx_client any
# dbsystem
#Maske Nr.8000 Jobmonitor ausführen
sx_auto_delete_mask 8000

41
superx/WEB-INF/conf/edustore/db/module/myjobs/schluesseltabellen/sx_jobs_fuellen.sql

@ -0,0 +1,41 @@ @@ -0,0 +1,41 @@
--Freemarker Template
--Achtung: Macro fügt Inhalte ein
--Bitte nur Freemarker Variablen füllen
<sqlvars>
<sqlvar name="sx_jobs_exists">select sp_table_exists('sx_jobs') from xdummy;</sqlvar>
</sqlvars>
<#assign jobs = [
{"uniquename":"jobmonitor", "caption":"Jobmonitor", "filepath":"myjobs/etl/jobmonitor/jobmonitor_logausgabe.kjb","sachgebiete_id":1400,
"kenn_profil":"","hs_nr":"","modus_supported":1,"params":"",
"check_sql":"select count(*) from xdummy"}
] />
--- Freemarker Magic
<#if sx_jobs_exists=1>
<#foreach job in jobs>
delete from sx_jobs where uniquename='${job.uniquename}';
</#foreach>
<#if SQLdialect='Postgres'>
select sp_update_sequence('sx_jobs');
</#if>
<#foreach job in jobs>
insert into sx_jobs (uniquename,caption,filepath,sachgebiete_id,kenn_profil,hs_nr,modus_supported,params
<#if SQLdialect='Postgres'>,check_sql
</#if>)
values ('${job.uniquename}','${job.caption}','${job.filepath}',${job.sachgebiete_id},<#if job.kenn_profil!="">${job.kenn_profil}<#else>null::integer</#if>,
<#if job.hs_nr!="">${job.hs_nr}<#else>null::integer</#if>,${job.modus_supported},'${job.params}'
<#if SQLdialect='Postgres'>
,'${job.check_sql}'
</#if>
);
</#foreach>
<#if SQLdialect='Postgres'>
select sp_update_sequence('sx_jobs');
</#if>
</#if>

30
superx/WEB-INF/conf/edustore/db/module/myjobs/upgrade/myjobs_upgrade_themenbaum.sql

@ -14,6 +14,36 @@ CREATE temp TABLE tmp_themenbaum ( @@ -14,6 +14,36 @@ CREATE temp TABLE tmp_themenbaum (
--zuerst die Themen
--nun die Masken
insert into tmp_themenbaum(tid,
name,
maskeninfo_id,
gueltig_seit,
gueltig_bis)
select max(tid)+1,'Jobmonitor ausführen'::char(50),8000,
date_val('01.01.1900'),date_val('30.09.2999')
from themenbaum;
delete from tmp_themenbaum where 0 <
(select count(*) from themenbaum where maskeninfo_id=8000);
update tmp_themenbaum set parent=(select max(tid) from themenbaum where name='Administration');
insert into themenbaum( tid,
name,
maskeninfo_id,
parent,
gueltig_seit,
gueltig_bis,
erlaeuterung)
select tid,
name,
maskeninfo_id,
parent,
gueltig_seit,
gueltig_bis,
erlaeuterung
from tmp_themenbaum;
delete from tmp_themenbaum;
drop table tmp_themenbaum;
<#if SQLdialect='Postgres'>

Loading…
Cancel
Save