Browse Source

Bugfix Paketerzeugung #1

qa_0.6_Release
Daniel Quathamer 1 year ago
parent
commit
1bc39a532a
  1. 16
      src-modules/module/qa/masken/37140_maskeninfo.unl
  2. 108
      superx/edit/qa/qa_show_mask_execution_result.jsp

16
src-modules/module/qa/masken/37140_maskeninfo.unl

@ -13,12 +13,11 @@ R.orderbyclause,\ @@ -13,12 +13,11 @@ R.orderbyclause,\
T.tid,\
T.uniquename,\
T.name,\
T.whereclause,\
C.tid as testcase_id\
FROM qa_testcase C, qa_dbtest T, qa_resultset R\
where C.dbtest_id=T.tid\
and T.resultset_id=R.tid\
and C.is_active=1\
T.whereclause\
FROM qa_dbtest T, qa_resultset R\
where \
T.resultset_id=R.tid\
and T.active=1\
;\
\
</sqlvar>\
@ -51,10 +50,10 @@ from qa_dbtest T where T.active=1)\ @@ -51,10 +50,10 @@ from qa_dbtest T where T.active=1)\
\
/* <#assign dbtest_id="<<DB-Test>>" />*/\
</#if>\
\
create temp table tmp_qa_dbtest_result_id\
(qa_dbtest_result_id integer);\
\
\
<#foreach dbtest in qa_dbtests>\
<#if dbtest_id == "" || dbtest_id==dbtest.tid?string>\
\
@ -66,13 +65,16 @@ order by ${dbtest.orderbyclause}\ @@ -66,13 +65,16 @@ order by ${dbtest.orderbyclause}\
</#if>))::integer as _rownumber\
into temp tmp_rs\
from ${dbtest.fromclause}\
\
<#if dbtest.whereclause !=''>\
where <#assign inlineTemplate=dbtest.whereclause?interpret />\
<@inlineTemplate/>\
</#if>\
\
<#if dbtest.groupbyclause !=''>\
group by ${dbtest.groupbyclause}\
</#if>\
\
<#if dbtest.orderbyclause !=''>\
order by ${dbtest.orderbyclause}\
</#if>\

108
superx/edit/qa/qa_show_mask_execution_result.jsp

@ -0,0 +1,108 @@ @@ -0,0 +1,108 @@
<%@page pageEncoding="UTF-8" contentType="text/html" %>
<%@ page import ="org.dbforms.config.DbFormsConfigRegistry,java.sql.Connection,java.sql.PreparedStatement,java.sql.Statement,java.sql.ResultSet,de.superx.common.SxUser" %>
<%
SxUser user = (SxUser) request.getSession().getAttribute("user");
if (user != null && user.isAdmin()) {
StringBuffer LinkMandantID=new StringBuffer("");
int MAXCHARLENGTH_OF_KEYS = 50;
String ALLOWED_KEY_CHARS = "abcdefghijklmnopqrstuvwxyzäöüßABCDEFGHIJKLMNOPQRSTUVWXYZÄÖÜ_1234567890";
String IdOutput=request.getParameter("tid");
String typeOutput="html"; //TODO:parametrisierbar request.getParameter("type");
String defaultMandantenIDParam=request.getParameter("MandantID");
//Check Validity:
boolean entryOK=true;
if(IdOutput.length()> MAXCHARLENGTH_OF_KEYS)
entryOK=false;
for (int i = 0; i < IdOutput.length(); i++) {
char lookingAt = IdOutput.charAt(i);
if (ALLOWED_KEY_CHARS.indexOf(lookingAt)==-1) {
entryOK=false;
}
}
if(!entryOK)
throw new IllegalArgumentException(
"output Parameter contains forbidden characters or length");
if(defaultMandantenIDParam != null && !defaultMandantenIDParam.toString().equals("")) {
LinkMandantID.append("/"+defaultMandantenIDParam.toString());
}
/*
if (request.getSession()!=null&&request.getSession().getAttribute("sessiontype")!=null&&
request.getSession().getAttribute("sessiontype").equals("superx")) {
*/
Object mandantobject=request.getSession().getAttribute("MandantenID");
//Object userid=request.getSession().getAttribute("UserID");
String mandantenid="";
if(mandantobject != null)
mandantenid=mandantobject.toString();
else
{
if(defaultMandantenIDParam != null)
mandantenid=defaultMandantenIDParam.toString();
}
//der superx-Default-Mandant ist bei dbforms ein Leerstring
if(mandantenid.equals("default"))
mandantenid="";
Connection conmm=null;
try {
conmm = DbFormsConfigRegistry.instance().lookup().getConnection(mandantenid);
//Ausgabe holen:
PreparedStatement st_output;
ResultSet rs_output;
st_output=conmm.prepareStatement("select result_html from qa_mask_execution_result where tid=? ");
st_output.setInt(1,Integer.valueOf(IdOutput));
rs_output = st_output.executeQuery();
String sb_output="";
while (rs_output.next())
{ if(rs_output.getObject(1) !=null)
sb_output=rs_output.getObject(1).toString().trim();
}
rs_output.close();
st_output.close();
if(sb_output==null || sb_output.equals(""))
sb_output="<html><body><p>Text konnte nicht geladen werden, wenden Sie sich an den Administrator</p></body></html>";
//Ende Ausgabe holen
String sb_titel="";
sb_titel="Show HTML content";
conmm.close();
out.println(sb_output);
} //ende Suche DB Verbindung
catch (Exception e) {
out.print("<html><body>Fehler bei Datenverbindung: "+e+ " <br>MandantID: "+mandantenid+"</body></html>");
}
}
else {
if (request.getSession()!=null) session.invalidate();
String send_redirect="/superx/index.jsp"; //" + LinkMandantID.toString() + "
response.sendRedirect(send_redirect);
return;
}
%>
Loading…
Cancel
Save