[jboss-svn-commits] JBL Code SVN: r35668 - labs/jbosslabs/labs-3.0-build/integration/sbs/reports/trunk/src/main/java/org/jboss/community/sbs/plugin/reports/monthly/valuesource.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Fri Oct 22 09:16:00 EDT 2010
Author: lkrzyzanek
Date: 2010-10-22 09:16:00 -0400 (Fri, 22 Oct 2010)
New Revision: 35668
Modified:
labs/jbosslabs/labs-3.0-build/integration/sbs/reports/trunk/src/main/java/org/jboss/community/sbs/plugin/reports/monthly/valuesource/SBSValueSource.java
Log:
Added selects for wiki and comments
Modified: labs/jbosslabs/labs-3.0-build/integration/sbs/reports/trunk/src/main/java/org/jboss/community/sbs/plugin/reports/monthly/valuesource/SBSValueSource.java
===================================================================
--- labs/jbosslabs/labs-3.0-build/integration/sbs/reports/trunk/src/main/java/org/jboss/community/sbs/plugin/reports/monthly/valuesource/SBSValueSource.java 2010-10-22 12:07:38 UTC (rev 35667)
+++ labs/jbosslabs/labs-3.0-build/integration/sbs/reports/trunk/src/main/java/org/jboss/community/sbs/plugin/reports/monthly/valuesource/SBSValueSource.java 2010-10-22 13:16:00 UTC (rev 35668)
@@ -77,22 +77,26 @@
// WIKI related values
sqlStatements.put(SBSValueType.WIKI_NEW_ARTICLE_RH, "SELECT d.containerId, count(d.internalDocID)"
- + " FROM jiveDocument d"
- + " WHERE d.userID IN (SELECT userId from reportsRedHatUsers where created = ?)"
- + " and d.creationDate > ? and d.creationDate < ?" + " group by d.containerId");
+ + " FROM jiveDocument d" + " WHERE d.userID IN (SELECT userId from reportsRedHatUsers where created = ?)"
+ + " and d.creationDate > ? and d.creationDate < ? group by d.containerId");
- sqlStatements.put(SBSValueType.WIKI_NEW_ARTICLE_CM,
- "select 1, 1 from reportsRedHatUsers where created = ? and created = ? and created = ?");
+ sqlStatements.put(SBSValueType.WIKI_NEW_ARTICLE_CM, "SELECT d.containerId, count(d.internalDocID)"
+ + " FROM jiveDocument d" + " WHERE d.userID NOT IN (SELECT userId from reportsRedHatUsers where created = ?)"
+ + " and d.creationDate > ? and d.creationDate < ? group by d.containerId");
sqlStatements.put(SBSValueType.WIKI_EDIT_ARTICLE_RH,
"select 1, 1 from reportsRedHatUsers where created = ? and created = ? and created = ?");
sqlStatements.put(SBSValueType.WIKI_EDIT_ARTICLE_CM,
"select 1, 1 from reportsRedHatUsers where created = ? and created = ? and created = ?");
- sqlStatements.put(SBSValueType.WIKI_COMMENT_RH,
- "select 1, 1 from reportsRedHatUsers where created = ? and created = ? and created = ?");
- sqlStatements.put(SBSValueType.WIKI_COMMENT_CM,
- "select 1, 1 from reportsRedHatUsers where created = ? and created = ? and created = ?");
+ sqlStatements.put(SBSValueType.WIKI_COMMENT_RH, "SELECT d.containerId, count(c.commentID)"
+ + " FROM jiveComment c, jiveDocument d" + " WHERE c.objectID = d.internalDocID and c.objectType = 102"
+ + " and c.userID IN (SELECT userId from reportsRedHatUsers where created = ?)"
+ + " and c.creationDate > ? and c.creationDate < ? group by d.containerId");
+ sqlStatements.put(SBSValueType.WIKI_COMMENT_CM, "SELECT d.containerId, count(c.commentID)"
+ + " FROM jiveComment c, jiveDocument d" + " WHERE c.objectID = d.internalDocID and c.objectType = 102"
+ + " and c.userID NOT IN (SELECT userId from reportsRedHatUsers where created = ?)"
+ + " and c.creationDate > ? and c.creationDate < ? group by d.containerId");
// forum related values
sqlStatements.put(SBSValueType.FORUM_QUESTION_RH,
@@ -114,11 +118,10 @@
sqlStatements.put(SBSValueType.FORUM_THREAD_CM,
"select 1, 1 from reportsRedHatUsers where created = ? and created = ? and created = ?");
- sqlStatements
- .put(SBSValueType.FORUM_REPLY_RH, "select 1, 1 from reportsRedHatUsers where created = ? and created = ? and created = ?");
- sqlStatements
-.put(SBSValueType.FORUM_REPLY_CM,
+ sqlStatements.put(SBSValueType.FORUM_REPLY_RH,
"select 1, 1 from reportsRedHatUsers where created = ? and created = ? and created = ?");
+ sqlStatements.put(SBSValueType.FORUM_REPLY_CM,
+ "select 1, 1 from reportsRedHatUsers where created = ? and created = ? and created = ?");
}
@@ -149,6 +152,8 @@
throw new IllegalArgumentException("No SQL statement defined for value type " + valueType);
}
+ // TODO: Consider usage of Spring DAO Templates instead of Prepared Statements
+
Connection conn = dataSource.getConnection();
PreparedStatement ps = null;
ResultSet rs = null;
More information about the jboss-svn-commits
mailing list