Skip to content

Commit 17fc0f7

Browse files
committed
db-view
0 parents  commit 17fc0f7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+16742
-0
lines changed

.classpath

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry kind="src" path="src"/>
4+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.launching.macosx.MacOSXType/Java SE 8 [1.8.0_45]">
5+
<attributes>
6+
<attribute name="owner.project.facets" value="java"/>
7+
</attributes>
8+
</classpathentry>
9+
<classpathentry kind="con" path="org.eclipse.jst.server.core.container/org.eclipse.jst.server.tomcat.runtimeTarget/Apache Tomcat v8.0">
10+
<attributes>
11+
<attribute name="owner.project.facets" value="jst.web"/>
12+
</attributes>
13+
</classpathentry>
14+
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
15+
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/>
16+
<classpathentry kind="output" path="build/classes"/>
17+
</classpath>

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/build/
2+
/.DS_Store

.project

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>db-view</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.wst.jsdt.core.javascriptValidator</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
<buildCommand>
14+
<name>org.eclipse.jdt.core.javabuilder</name>
15+
<arguments>
16+
</arguments>
17+
</buildCommand>
18+
<buildCommand>
19+
<name>org.eclipse.wst.common.project.facet.core.builder</name>
20+
<arguments>
21+
</arguments>
22+
</buildCommand>
23+
<buildCommand>
24+
<name>org.eclipse.wst.validation.validationbuilder</name>
25+
<arguments>
26+
</arguments>
27+
</buildCommand>
28+
</buildSpec>
29+
<natures>
30+
<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
31+
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
32+
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
33+
<nature>org.eclipse.jdt.core.javanature</nature>
34+
<nature>org.eclipse.wst.jsdt.core.jsNature</nature>
35+
</natures>
36+
</projectDescription>

.settings/.jsdtscope

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry kind="src" path="WebContent"/>
4+
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.JRE_CONTAINER"/>
5+
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.WebProject">
6+
<attributes>
7+
<attribute name="hide" value="true"/>
8+
</attributes>
9+
</classpathentry>
10+
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.baseBrowserLibrary"/>
11+
<classpathentry kind="output" path=""/>
12+
</classpath>

WebContent/META-INF/MANIFEST.MF

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Manifest-Version: 1.0
2+
Class-Path:
3+

WebContent/WEB-INF/lib/dbview.jar

16 KB
Binary file not shown.
Binary file not shown.
628 KB
Binary file not shown.

WebContent/WEB-INF/log4j.properties

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# A default log4j configuration for log4j users.
2+
#
3+
# To use this configuration, deploy it into your application's WEB-INF/classes
4+
# directory. You are also encouraged to edit it as you like.
5+
6+
# Configure the console as our one appender
7+
log4j.appender.A1=org.apache.log4j.ConsoleAppender
8+
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
9+
log4j.appender.A1.layout.ConversionPattern=%d{HH:mm:ss,SSS} %-5p [%c] - %m%n
10+
11+
# tighten logging on the DataNucleus Categories
12+
log4j.category.DataNucleus.JDO=WARN, A1
13+
log4j.category.DataNucleus.Persistence=WARN, A1
14+
log4j.category.DataNucleus.Cache=WARN, A1
15+
log4j.category.DataNucleus.MetaData=WARN, A1
16+
log4j.category.DataNucleus.General=WARN, A1
17+
log4j.category.DataNucleus.Utility=WARN, A1
18+
log4j.category.DataNucleus.Transaction=WARN, A1
19+
log4j.category.DataNucleus.Datastore=WARN, A1
20+
log4j.category.DataNucleus.ClassLoading=WARN, A1
21+
log4j.category.DataNucleus.Plugin=WARN, A1
22+
log4j.category.DataNucleus.ValueGeneration=WARN, A1
23+
log4j.category.DataNucleus.Enhancer=WARN, A1
24+
log4j.category.DataNucleus.SchemaTool=WARN, A1

WebContent/WEB-INF/logging.properties

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# A default java.util.logging configuration.
2+
# (All App Engine logging is through java.util.logging by default).
3+
#
4+
# To use this configuration, copy it into your application's WEB-INF
5+
# folder and add the following to your appengine-web.xml:
6+
#
7+
# <system-properties>
8+
# <property name="java.util.logging.config.file" value="WEB-INF/logging.properties"/>
9+
# </system-properties>
10+
#
11+
12+
# Set the default logging level for all loggers to WARNING
13+
.level = WARNING

WebContent/WEB-INF/web.xml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
4+
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
5+
version="2.5" xmlns="http://java.sun.com/xml/ns/javaee">
6+
7+
<!-- Servlets -->
8+
<servlet>
9+
<servlet-name>dbvServlet</servlet-name>
10+
<servlet-class>com.service.dmc.servlet.DbvServlet</servlet-class>
11+
</servlet>
12+
13+
<servlet-mapping>
14+
<servlet-name>dbvServlet</servlet-name>
15+
<url-pattern>/action</url-pattern>
16+
</servlet-mapping>
17+
18+
<listener>
19+
<listener-class>com.service.dmc.servlet.DbvServletContextListener</listener-class>
20+
</listener>
21+
22+
<!-- Default page to serve -->
23+
<welcome-file-list>
24+
<welcome-file>index.jsp</welcome-file>
25+
</welcome-file-list>
26+
27+
</web-app>

WebContent/css/black.css

Lines changed: 23 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

WebContent/css/dark.css

Lines changed: 24 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

WebContent/css/default.css

Lines changed: 23 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading

WebContent/css/orange.css

Lines changed: 23 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

WebContent/debug.jsp

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
<%@page import="java.util.Enumeration"%>
2+
<%@page import="java.util.Set"%>
3+
<%@page import="java.util.Map"%>
4+
<%@page import="com.service.dmc.util.ClassInspector"%>
5+
<%@page import="java.util.List"%>
6+
<%@ page language="java" contentType="text/html; charset=UTF-8"
7+
pageEncoding="UTF-8"%>
8+
<%
9+
ClassInspector inspector = new ClassInspector();
10+
Map<String, String> requestPrameters = inspector.inspect(request);
11+
Map<String, String> responsePrameters = inspector.inspect(response);
12+
Map<String, String> sessionPrameters = inspector.inspect(session);
13+
Map<String, String> contextParameters = inspector.inspect(application);
14+
Map<String, String> configParameters = inspector.inspect(config);
15+
16+
Set<String> keys = null;
17+
Set<Object> systemKeys = null;
18+
19+
%>
20+
21+
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
22+
<html>
23+
<head>
24+
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
25+
26+
27+
28+
<title>inspector</title>
29+
</head>
30+
<body>
31+
32+
<h1>System Parameters</h1>
33+
<table>
34+
<%
35+
systemKeys = System.getProperties().keySet();
36+
for (Object key : systemKeys) {
37+
out.write("<tr><td>"+ key + "</td><td>" + System.getProperties().getProperty((String)key) + "</td></tr>");
38+
}
39+
%>
40+
</table>
41+
42+
<h1>Request Parameters</h1>
43+
<table>
44+
<%
45+
keys = requestPrameters.keySet();
46+
for (String key : keys) {
47+
out.write("<tr><td>"+ key + "</td><td>" + requestPrameters.get(key) + "</td></tr>");
48+
}
49+
%>
50+
</table>
51+
52+
<h1>Response Parameters</h1>
53+
<table>
54+
<%
55+
keys = responsePrameters.keySet();
56+
for (String key : keys) {
57+
out.write("<tr><td>"+ key + "</td><td>" + responsePrameters.get(key) + "</td></tr>");
58+
}
59+
%>
60+
</table>
61+
62+
<h1>Context Parameters</h1>
63+
<table>
64+
<%
65+
keys = contextParameters.keySet();
66+
for (String key : keys) {
67+
out.write("<tr><td>"+ key + "</td><td>" + contextParameters.get(key) + "</td></tr>");
68+
}
69+
%>
70+
</table>
71+
72+
<h1>Config Parameters</h1>
73+
<table>
74+
<%
75+
keys = configParameters.keySet();
76+
for (String key : keys) {
77+
out.write("<tr><td>"+ key + "</td><td>" + configParameters.get(key) + "</td></tr>");
78+
}
79+
%>
80+
</table>
81+
82+
</body>
83+
</html>

WebContent/history.jsp

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<%@page import="java.util.ArrayList"%>
2+
<%@page import="java.util.Map"%>
3+
<%@page import="com.service.dmc.sql.QueryBean"%>
4+
<%@page import="java.util.List"%>
5+
<%@ page language="java" contentType="text/html; charset=UTF-8"
6+
pageEncoding="UTF-8"%>
7+
<%! private static String escapeHtml( String str ) {
8+
if(str==null) {
9+
return str;
10+
}
11+
str = str.replaceAll("&" , "&amp;" );
12+
str = str.replaceAll("<" , "&lt;" );
13+
str = str.replaceAll(">" , "&gt;" );
14+
str = str.replaceAll("\"", "&#92;&quot;");
15+
str = str.replaceAll("'" , "&#39;" );
16+
17+
return str;
18+
}
19+
%>
20+
21+
<% QueryBean bean = (QueryBean) request.getAttribute("bean");
22+
23+
@SuppressWarnings("unchecked")
24+
Map<String, ArrayList<String>> map = (Map<String, ArrayList<String>>) getServletContext().getAttribute("sql-history");
25+
if( map == null) {
26+
return;
27+
}
28+
ArrayList<String> list = map.get(bean.getUrl());
29+
if( list == null) {
30+
return;
31+
}
32+
33+
String escaped = null;
34+
out.println("<table>");
35+
for (String s : list) {
36+
out.print("<tr><td nowrap>");
37+
escaped = escapeHtml(s);
38+
out.print("<span style='cursor: pointer' onclick='$(\"#sql\").val(\""+ escaped + "\")'>" + s + "</span>");
39+
out.println("</td></tr>");
40+
}
41+
out.println("</table>");
42+
43+
%>

0 commit comments

Comments
 (0)