Index: lams_admin/build.xml
===================================================================
diff -u -r3bc65f0652b50074ff432112d8e47a6df3728810 -r70b2844ef7a633436b631e9e55096dc55ee63ed7
--- lams_admin/build.xml (.../build.xml) (revision 3bc65f0652b50074ff432112d8e47a6df3728810)
+++ lams_admin/build.xml (.../build.xml) (revision 70b2844ef7a633436b631e9e55096dc55ee63ed7)
@@ -213,6 +213,18 @@
+
+
+
+
+
+
+
+
+
+
+
Index: lams_admin/conf/language/lams/ApplicationResources.properties
===================================================================
diff -u -re716da296153c98b6603ef404b8c89ad8a12030c -r70b2844ef7a633436b631e9e55096dc55ee63ed7
--- lams_admin/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision e716da296153c98b6603ef404b8c89ad8a12030c)
+++ lams_admin/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision 70b2844ef7a633436b631e9e55096dc55ee63ed7)
@@ -386,6 +386,18 @@
admin.gradebook.learner.enable =Enable Gradebook for Learners
admin.gradebook.monitor.enable =Enable Gradebook for Monitors
sysadmin.serverUrl =External Server URL
+admin.statistics.title =Server Statistics
+admin.statistics.overall =Overall Statistics
+admin.statistics.totalUsers =Total users:
+admin.statistics.groups =Total groups:
+admin.statistics.subGroups =Total sub-groups:
+admin.statistics.learningDesigns =Total learning designs:
+admin.statistics.lessons =Total lessons:
+admin.statistics.activities =Total activities:
+admin.statistics.completedActivities =Total completed activities:
+admin.statistics.title.byGroup =Statistics by Group
+admin.statistics.group.learners =Total Learners:
+admin.statistics.group.monitors =Total Monitors:
+admin.statistics.group.authors =Total Authors:
-
#======= End labels: Exported 379 labels for en AU =====
Index: lams_admin/conf/language/lams/ApplicationResources_en_AU.properties
===================================================================
diff -u -re716da296153c98b6603ef404b8c89ad8a12030c -r70b2844ef7a633436b631e9e55096dc55ee63ed7
--- lams_admin/conf/language/lams/ApplicationResources_en_AU.properties (.../ApplicationResources_en_AU.properties) (revision e716da296153c98b6603ef404b8c89ad8a12030c)
+++ lams_admin/conf/language/lams/ApplicationResources_en_AU.properties (.../ApplicationResources_en_AU.properties) (revision 70b2844ef7a633436b631e9e55096dc55ee63ed7)
@@ -386,6 +386,18 @@
admin.gradebook.learner.enable =Enable Gradebook for Learners
admin.gradebook.monitor.enable =Enable Gradebook for Monitors
sysadmin.serverUrl =External Server URL
+admin.statistics.title =Server Statistics
+admin.statistics.overall =Overall Statistics
+admin.statistics.totalUsers =Total users:
+admin.statistics.groups =Total groups:
+admin.statistics.subGroups =Total sub-groups:
+admin.statistics.learningDesigns =Total learning designs:
+admin.statistics.lessons =Total lessons:
+admin.statistics.activities =Total activities:
+admin.statistics.completedActivities =Total completed activities:
+admin.statistics.title.byGroup =Statistics by Group
+admin.statistics.group.learners =Total Learners:
+admin.statistics.group.monitors =Total Monitors:
+admin.statistics.group.authors =Total Authors:
-
#======= End labels: Exported 379 labels for en AU =====
Index: lams_admin/src/java/org/lamsfoundation/lams/admin/service/AdminServiceProxy.java
===================================================================
diff -u -r8a3e9e26bd2052212eda725e7c88b681ddd45361 -r70b2844ef7a633436b631e9e55096dc55ee63ed7
--- lams_admin/src/java/org/lamsfoundation/lams/admin/service/AdminServiceProxy.java (.../AdminServiceProxy.java) (revision 8a3e9e26bd2052212eda725e7c88b681ddd45361)
+++ lams_admin/src/java/org/lamsfoundation/lams/admin/service/AdminServiceProxy.java (.../AdminServiceProxy.java) (revision 70b2844ef7a633436b631e9e55096dc55ee63ed7)
@@ -26,6 +26,7 @@
import javax.servlet.ServletContext;
import org.lamsfoundation.lams.integration.service.IIntegrationService;
+import org.lamsfoundation.lams.statistics.service.IStatisticsService;
import org.lamsfoundation.lams.usermanagement.service.IUserManagementService;
import org.lamsfoundation.lams.usermanagement.service.LdapService;
import org.lamsfoundation.lams.util.MessageService;
@@ -46,7 +47,9 @@
private static IAuditService auditService;
private static IImportService importService;
private static LdapService ldapService;
+ private static IStatisticsService statisticsService;
+
public static final IUserManagementService getService(ServletContext servletContext) {
if (manageService == null) {
manageService = (IUserManagementService)getDomainService(servletContext, "userManagementService");
@@ -90,6 +93,13 @@
return ldapService;
}
+ public static final IStatisticsService getStatisticsService(ServletContext servletContext) {
+ if (statisticsService == null) {
+ statisticsService = (IStatisticsService)getDomainService(servletContext, "statisticsService");
+ }
+ return statisticsService;
+ }
+
private static Object getDomainService(ServletContext servletContext,String serviceName) {
WebApplicationContext wac = WebApplicationContextUtils.getRequiredWebApplicationContext(servletContext);
return wac.getBean(serviceName);
Index: lams_admin/src/java/org/lamsfoundation/lams/admin/web/action/StatisticsAction.java
===================================================================
diff -u
--- lams_admin/src/java/org/lamsfoundation/lams/admin/web/action/StatisticsAction.java (revision 0)
+++ lams_admin/src/java/org/lamsfoundation/lams/admin/web/action/StatisticsAction.java (revision 70b2844ef7a633436b631e9e55096dc55ee63ed7)
@@ -0,0 +1,69 @@
+/****************************************************************
+ * Copyright (C) 2006 LAMS Foundation (http://lamsfoundation.org)
+ * =============================================================
+ * License Information: http://lamsfoundation.org/licensing/lams/2.0/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2.0
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
+ * USA
+ *
+ * http://www.gnu.org/licenses/gpl.txt
+ * ****************************************************************
+ */
+package org.lamsfoundation.lams.admin.web.action;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.struts.action.Action;
+import org.apache.struts.action.ActionForm;
+import org.apache.struts.action.ActionForward;
+import org.apache.struts.action.ActionMapping;
+import org.lamsfoundation.lams.admin.service.AdminServiceProxy;
+import org.lamsfoundation.lams.statistics.dto.StatisticsDTO;
+import org.lamsfoundation.lams.statistics.service.IStatisticsService;
+import org.lamsfoundation.lams.usermanagement.Role;
+
+/**
+ * @author Luke Foxton
+ *
+ * Gives the overall statistics for a LAMS server
+ *
+ * @struts.action path="/statistics" validate="false"
+ * @struts.action-forward name="success" path=".statistics"
+ * @struts.action-forward name="error" path=".error"
+ */
+public class StatisticsAction extends Action {
+
+ private static IStatisticsService statisticsService;
+
+ public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
+
+ // check permission
+ if (!request.isUserInRole(Role.SYSADMIN)) {
+ request.setAttribute("errorName", "RegisterAction");
+ request.setAttribute("errorMessage", AdminServiceProxy.getMessageService(getServlet().getServletContext()).getMessage("error.authorisation"));
+ return mapping.findForward("error");
+ }
+
+ if (statisticsService == null) {
+ statisticsService = AdminServiceProxy.getStatisticsService(getServlet().getServletContext());
+ }
+
+ StatisticsDTO stats = statisticsService.getOverallStatistics();
+
+ request.setAttribute("statisticsDTO", stats);
+ return mapping.findForward("success");
+ }
+
+}
Index: lams_admin/src/java/org/lamsfoundation/lams/admin/web/action/SysAdminStartAction.java
===================================================================
diff -u -r18df5a739d3e9dff1734cf64ee63595acff7a71e -r70b2844ef7a633436b631e9e55096dc55ee63ed7
--- lams_admin/src/java/org/lamsfoundation/lams/admin/web/action/SysAdminStartAction.java (.../SysAdminStartAction.java) (revision 18df5a739d3e9dff1734cf64ee63595acff7a71e)
+++ lams_admin/src/java/org/lamsfoundation/lams/admin/web/action/SysAdminStartAction.java (.../SysAdminStartAction.java) (revision 70b2844ef7a633436b631e9e55096dc55ee63ed7)
@@ -71,6 +71,7 @@
links.add(new LinkBean("serverlist.do", "sysadmin.maintain.external.servers"));
links.add(new LinkBean("register.do", "sysadmin.register.server"));
links.add(new LinkBean("libraryManage.do", "sysadmin.library.management"));
+ links.add(new LinkBean("statistics.do", "admin.statistics.title"));
} else if (request.isUserInRole(Role.AUTHOR_ADMIN)) {
LinkBean linkBean = new LinkBean("toolcontentlist.do", "sysadmin.tool.management");
links.add(linkBean);
Index: lams_admin/web/WEB-INF/struts/struts-config.xml
===================================================================
diff -u -r6ea112b9b57636ff8cf428beaf3e91df321aa0d9 -r70b2844ef7a633436b631e9e55096dc55ee63ed7
--- lams_admin/web/WEB-INF/struts/struts-config.xml (.../struts-config.xml) (revision 6ea112b9b57636ff8cf428beaf3e91df321aa0d9)
+++ lams_admin/web/WEB-INF/struts/struts-config.xml (.../struts-config.xml) (revision 70b2844ef7a633436b631e9e55096dc55ee63ed7)
@@ -244,6 +244,23 @@
/>
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: lams_admin/web/statistics.jsp
===================================================================
diff -u
--- lams_admin/web/statistics.jsp (revision 0)
+++ lams_admin/web/statistics.jsp (revision 70b2844ef7a633436b631e9e55096dc55ee63ed7)
@@ -0,0 +1,170 @@
+<%@ include file="/taglibs.jsp"%>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ |
+
+ ${statisticsDTO.users}
+ |
+
+
+
+
+ |
+
+ ${statisticsDTO.sequences}
+ |
+
+
+
+
+ |
+
+ ${statisticsDTO.lessons}
+ |
+
+
+
+
+ |
+
+ ${statisticsDTO.activities}
+ |
+
+
+
+
+ |
+
+ ${statisticsDTO.completedActivities}
+ |
+
+
+
+
+ |
+
+ ${statisticsDTO.groups}
+ |
+
+
+
+
+ |
+
+ ${statisticsDTO.subGroups}
+ |
+
+
+
+
+
+
+
+ ${groupStatisticDTO.name}
+
+
+
+
+
+ |
+
+ ${groupStatisticDTO.totalUsers}
+ |
+
+
+
+
+ |
+
+ ${groupStatisticDTO.lessons}
+ |
+
+
+
+
+ |
+
+ ${groupStatisticDTO.monitors}
+ |
+
+
+
+
+ |
+
+ ${groupStatisticDTO.authors}
+ |
+
+
+
+
+ |
+
+ ${groupStatisticDTO.learners}
+ |
+
+
+
+
+
+
+
+ ${subGroupStatisticDTO.name}
+
+
+
+
+
+ |
+
+ ${subGroupStatisticDTO.totalUsers}
+ |
+
+
+
+
+ |
+
+ ${subGroupStatisticDTO.lessons}
+ |
+
+
+
+
+ |
+
+ ${subGroupStatisticDTO.monitors}
+ |
+
+
+
+
+ |
+
+ ${subGroupStatisticDTO.authors}
+ |
+
+
+
+
+ |
+
+ ${subGroupStatisticDTO.learners}
+ |
+
+
+
+
+
+