OSDN Git Service

データベースステータスページで連想ノートクリック回数を表示できるようにした
[neighbornote/NeighborNote.git] / src / cx / fbn / nevernote / sql / HistoryTable.java
index 485ff59..0d16a11 100644 (file)
@@ -1,3 +1,22 @@
+/*
+ * This file is part of NeighborNote
+ * Copyright 2013 Yuki Takahashi
+ * 
+ * This file may be licensed under the terms of of the
+ * GNU General Public License Version 2 (the ``GPL'').
+ *
+ * Software distributed under the License is distributed
+ * on an ``AS IS'' basis, WITHOUT WARRANTY OF ANY KIND, either
+ * express or implied. See the GPL for the specific language
+ * governing rights and limitations.
+ *
+ * You should have received a copy of the GPL along with this
+ * program. If not, go to http://www.gnu.org/licenses/gpl.html
+ * or write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+*/
+
 // ICHANGED
 package cx.fbn.nevernote.sql;
 
@@ -5,6 +24,7 @@ import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 
+import cx.fbn.nevernote.Global;
 import cx.fbn.nevernote.sql.driver.NSqlQuery;
 import cx.fbn.nevernote.utilities.ApplicationLogger;
 
@@ -39,6 +59,11 @@ public class HistoryTable {
                NSqlQuery query = new NSqlQuery(db.getBehaviorConnection());
                boolean excludedCheck = false;
                
+               // 操作ログの取得を停止中
+               if (Global.isHaltLogButton()) {
+                       return;
+               }
+               
                if (behaviorType == null) {
                        return;
                }
@@ -281,4 +306,22 @@ public class HistoryTable {
                        }
                }
        }
+
+       // 操作履歴数の取得
+       public int getHistoryCount() {
+               NSqlQuery query = new NSqlQuery(db.getBehaviorConnection());
+               query.exec("Select count(*) from History");
+               query.next();
+               int returnValue = new Integer(query.valueString(0));
+               return returnValue;
+       }
+       
+       // 連想ノートクリック回数を取得
+       public int getRensoClickCount() {
+               NSqlQuery query = new NSqlQuery(db.getBehaviorConnection());
+               query.exec("Select count(*) from History where behaviorType='rensoItemClick'");
+               query.next();
+               int returnValue = new Integer(query.valueString(0));
+               return returnValue;
+       }
 }