You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
447 lines
17 KiB
447 lines
17 KiB
<%@ 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,java.util.ArrayList" %> |
|
<%@ page import ="org.dbforms.config.DbFormsConfigRegistry,java.sql.Connection,java.sql.Statement,java.sql.ResultSet,de.superx.common.SxUser" %> |
|
|
|
|
|
<% |
|
String platform=de.superx.servlet.SuperXManager.isHis1?"HISinOne":"SuperX"; |
|
String restApiPath="sxrest";// klappt noch nicht platform.equals("HISinOne")?"ds/api":"sxrest"; |
|
%> |
|
|
|
<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>Job Management</title> |
|
|
|
<link rel="stylesheet" href="../../style/dbforms.css" /> |
|
<link rel="stylesheet" href="../../style/bulma.css" /> |
|
<link rel="stylesheet" href="../../style/bulma-tooltip.min.css" /> |
|
<!-- <link rel="stylesheet" href="../../style/sx_common.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"> |
|
var restApiPath="<%=restApiPath %>"; |
|
|
|
|
|
|
|
function getTabMenu(srctype,caption,i,jobExportUniquename,jobImportUniquename,maskeninfo_tid,felderinfo_tid,paramname,jobParamName) |
|
{ |
|
var zs=""; |
|
zs+="<input type=\"hidden\" name=\"jobParamName\" value=\""+jobParamName+"\"/> "; |
|
zs+="<input type=\"hidden\" name=\"jobParamValue\" value=\"\"/> "; |
|
|
|
if(srctype=="load") |
|
{ |
|
zs+=paramname+": "; |
|
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+"',20,'',"+maskeninfo_tid+");\" />"; |
|
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+="<a onclick=\"getSrcAsXml('"+jobExportUniquename+"','"+jobParamName+"',document.getElementById('"+paramname+"').value);return false;\" class=\"linkLookImage\"><img title=\"Quellcode anzeigen\" alt=\"Quellcode anzeigen\" src=\"../../images/eye.svg\" border=\"0\"/></a>"; |
|
zs+="<a onclick=\"downloadMaskSrc('"+jobExportUniquename+"','"+jobParamName+"',document.getElementById('"+paramname+"').value);return false;\" class=\"linkLookImage\"><img title=\"Quellcode herunterladen\" alt=\"Quellcode herunterladen\" src=\"../../images/downloadblck.svg\" border=\"0\"/></a>"; |
|
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>"; |
|
|
|
|
|
|
|
//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") |
|
{ |
|
zs+=paramname+" importieren "; |
|
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>"; |
|
zs+="<a onclick=\"saveEtlXmlSrc('"+jobParamName+"');return false;\" class=\"linkLookImage\"><img title=\"Quellcode importieren\" alt=\"Quellcode importieren\" src=\"../../images/resultset_up.svg\" border=\"0\"/></a>"; |
|
//,document.getElementById('"+paramname+"').value |
|
|
|
//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=\"saveEtlXmlSrc(document.getElementById('Maskentid').value)\">importieren...</button>"; |
|
} |
|
document.getElementById("MaskSubHeader").innerHTML=zs; |
|
} |
|
|
|
function getSrcAsXml(jobUniquename,jobParamName,jobParamValue) |
|
{ |
|
//document.getElementById("MaskHeader").innerHTML="Masken-Quellcode laden"; |
|
//document.getElementById("MaskSubHeader").innerHTML="Maske TID="+tid; |
|
var xhttp = new XMLHttpRequest(); |
|
xhttp.onreadystatechange = function() { |
|
if (this.readyState == 4 && this.status == 200) { |
|
var xmlDoc=this.responseXML; |
|
var xmlTxt=new XMLSerializer().serializeToString(xmlDoc); |
|
document.getElementById("Inhalt").value=xmlTxt; |
|
// document.getElementById("Inhalt").innerHTML = this.responseText; |
|
|
|
//alert(this.responseText); |
|
} |
|
else |
|
{ |
|
document.getElementById("Inhalt").innerHTML="Serveranfrage Antwort... "+this.status; |
|
} |
|
}; |
|
xhttp.open("GET", "../../"+restApiPath+"/jobetlxml/get/"+jobUniquename+"/"+jobParamName+"/view/"+jobParamValue, true); |
|
xhttp.send(); |
|
|
|
|
|
} |
|
function downloadMaskSrc(jobUniquename,jobParamName,jobParamValue) |
|
{ |
|
window.open("../../"+restApiPath+"/jobetlxml/get/"+jobUniquename+"/"+jobParamName+"/download/"+jobParamValue,"_blank"); |
|
|
|
} |
|
function saveEtlXmlSrc(jobParamName) |
|
{ |
|
document.forms["saveEtlXml"].elements["src"].value=document.getElementById("Inhalt").value; |
|
|
|
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) |
|
{ |
|
document.getElementById("MaskHeader").innerHTML="Komponente "+ componentName+"<br />Version: "+componentVersion; |
|
var menuLines="<form method=\"post\" name=\"execUpgrade\" action=\"../../edit/etl/jobexecutor.jsp\" target=\"_blank\"><input type='hidden' size='10' id='tid' name='systeminfo_id' value='"+systeminfo_id+"'/><input type='hidden' size='10' id='tid' name='componentUniquename' value='"+componentUniquename+"'/><input type='hidden' size='10' id='tid' name='componentAction' value='upgrade'/><button class=\"button has-tooltip-multiline has-tooltip-right\" data-tooltip=\"Upgrade starten\" >Upgrade...</button></form>"; |
|
//"<p><button class=\"button has-tooltip-multiline has-tooltip-right\" data-tooltip=\"Upgrade starten\" onclick=\"launchUpgrade('"+componentName+"')\">Upgrade starten</button></p>"; |
|
|
|
menuLines+="<form method=\"post\" name=\"execUpdate\" action=\"../../edit/etl/jobexecutor.jsp\" target=\"_blank\"><input type='hidden' size='10' id='tid' name='systeminfo_id' value='"+systeminfo_id+"'/><input type='hidden' size='10' id='tid' name='componentUniquename' value='"+componentUniquename+"'/><input type='hidden' size='10' id='tid' name='componentAction' value='update'/><button class=\"button has-tooltip-multiline has-tooltip-right\" data-tooltip=\"Update starten\" >HLR starten</button></form>"; |
|
|
|
//<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=\"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>"; |
|
|
|
|
|
|
|
} |
|
|
|
function copyTextWithTooltip(mydiv,mybutton) |
|
{ |
|
var fldElem=document.getElementById(mydiv); |
|
// Select the text field |
|
fldElem.select(); |
|
fldElem.setSelectionRange(0, 999999); // For mobile devices |
|
|
|
// Copy the text inside the text field |
|
navigator.clipboard.writeText(fldElem.value); |
|
if(mybutton) |
|
{ |
|
mybutton.setAttribute("data-tooltip","Kopiert: "+ fldElem.value.substring(0,10)+"..."); |
|
} |
|
} |
|
|
|
function EtlMaskeComboLaden(fname,zeilenanzahl, caption,maskentid) { |
|
|
|
var editurl="/superx/edit/kern/maske_combo_laden.jsp?tid="+maskentid+ "&Feldname="+getEncoded(fname); |
|
editurl +="&referrerForm=saveEtlXml"; |
|
editurl +="&zeilenanzahl="+zeilenanzahl+"¶ms="; |
|
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> |
|
<style type="text/css"> |
|
.buttonbar img { |
|
height: 1.5rem; |
|
width: 1.7rem; |
|
margin: 8px 0px 0px 0px; |
|
padding: 0rem 0.1rem 0rem 0.1rem; |
|
} |
|
.buttonbar input { |
|
height: 1.5rem; |
|
width: 14rem; |
|
margin: 8px 10px 0px 0px; |
|
padding: 0rem 0.1rem 0rem 0.1rem; |
|
} |
|
</style> |
|
<body> |
|
<% |
|
//init Variables: |
|
String EntwicklungsmodusAn=""; |
|
String EntwicklungsmodusAus="checked"; |
|
|
|
Object mandantobject=request.getSession().getAttribute("MandantenID"); |
|
|
|
String mandantenid=""; |
|
if(mandantobject != null) |
|
mandantenid=mandantobject.toString(); |
|
//der superx-Default-Mandant ist bei dbforms ein Leerstring |
|
if(mandantenid.equals("default")) |
|
mandantenid=""; |
|
|
|
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"> |
|
<div class="navbar-brand"> |
|
|
|
<a class="navbar-item" href="etl_manager.jsp">Job Management</a> |
|
|
|
|
|
</div> |
|
<% |
|
|
|
|
|
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 |
|
</a> |
|
--> |
|
</div> |
|
|
|
</div> |
|
</div> |
|
</nav> |
|
<!-- END NAV --> |
|
|
|
<div class="container"> |
|
<div class="columns"> |
|
<div class="column is-3 "> |
|
<aside class="menu is-hidden-mobile"> |
|
<!--<p class="menu-label"> |
|
Untermenü |
|
</p> |
|
<ul class="menu-list"> |
|
<li><a class="is-active">Startseite</a></li> |
|
|
|
</ul> |
|
--> |
|
<% |
|
for (int i = 0; i < etlJobsArr.length; i++) { |
|
|
|
if(tab.equals(etlJobsArr[i].tabUniquename.toLowerCase())) |
|
{ |
|
%> |
|
|
|
<ul class="menu-list"> |
|
<li> |
|
<a class="is-active"> |
|
<% 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+"'"; |
|
|
|
%> |
|
</a> |
|
</li> |
|
</ul> |
|
<ul class="menu-list"> |
|
<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ü |
|
} //Ende Schleife Tabs |
|
%> |
|
|
|
</aside> |
|
</div> |
|
<div class="column is-9"> |
|
<% |
|
if(tab.equals("")) |
|
{ |
|
%> |
|
|
|
<section class="hero is-info welcome is-small"> |
|
<div class="hero-body"> |
|
<div class="container"> |
|
<h1 class="title"> |
|
Job Management |
|
</h1> |
|
<h2 class="subtitle"> |
|
Diese Komponente dient der Job-Verwaltung. |
|
</h2> |
|
|
|
</div> |
|
</div> |
|
</section> |
|
<section class="section"> |
|
<p>Klicken Sie oben auf den jew. Reiter, um zum jew. Menü zu gelangen.</p> |
|
</section> |
|
|
|
<div class="columns"> |
|
<div class="column is-6"> |
|
|
|
</div> |
|
<div class="column is-6"> |
|
|
|
</div> |
|
</div> |
|
<% |
|
} //Ende Tiles Startseite |
|
%> |
|
<% |
|
|
|
for (int i = 0; i < etlJobsArr.length; i++) { |
|
|
|
if(tab.equals(etlJobsArr[i].tabUniquename.toLowerCase())) |
|
{ |
|
%> |
|
<section class="hero is-info welcome is-small"> |
|
|
|
<div class="hero-body"> |
|
<div class="container" id="loadMask" > |
|
<h1 class="title" id="MaskHeader"><% out.print(etlJobsArr[i].tabCaption); %></h1> |
|
<h2 class="subtitle">Quellcodes verwalten</h2> |
|
</div> |
|
</div> |
|
</section> |
|
<section class="section"> |
|
<h2 class="subtitle"> |
|
<form method="post" name="saveEtlXml" action="../../edit/etl/saveEtlXml.jsp" target="_blank"> |
|
<div id="MaskSubHeader" class="buttonbar">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 "> |
|
<figure class="highlight"><div class="buttons has-addons is-right"> |
|
<button class="button is-small is-info" data-tooltip="in die Zwischenablage kopieren" onClick="copyTextWithTooltip('Inhalt',this);">Kopieren</button> |
|
</div> |
|
|
|
<textarea id="Inhalt" name="Inhalt" class="textarea" placeholder="Inhalt..." rows="20"></textarea> |
|
|
|
</figure> |
|
</div> |
|
|
|
|
|
</div> |
|
|
|
|
|
</section> |
|
<% |
|
} //Ende Mask Content |
|
} //Ende Schleife Tabs |
|
%> |
|
|
|
</div> |
|
</div> |
|
</div> |
|
<!--<script async type="text/javascript" src="../js/bulma.js"></script>--> |
|
|
|
|
|
</body> |
|
|
|
</html> |
|
|
|
|