Index: lams_admin/src/java/org/lamsfoundation/lams/admin/web/controller/CleanupPreviewLessonsController.java
===================================================================
diff -u -rec30ad2cd8a7b048f296533bcb70fdafd80a3be6 -rf2ad75cef0c507a64877942631fee13efbc6ed50
--- lams_admin/src/java/org/lamsfoundation/lams/admin/web/controller/CleanupPreviewLessonsController.java (.../CleanupPreviewLessonsController.java) (revision ec30ad2cd8a7b048f296533bcb70fdafd80a3be6)
+++ lams_admin/src/java/org/lamsfoundation/lams/admin/web/controller/CleanupPreviewLessonsController.java (.../CleanupPreviewLessonsController.java) (revision f2ad75cef0c507a64877942631fee13efbc6ed50)
@@ -46,44 +46,40 @@
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
-import org.springframework.web.context.WebApplicationContext;
-import org.springframework.web.context.support.WebApplicationContextUtils;
/**
* @author Marcin Cieslak
*/
@Controller
@RequestMapping("/cleanupPreviewLessons")
public class CleanupPreviewLessonsController {
-
private static Logger log = Logger.getLogger(CleanupPreviewLessonsController.class);
- private static IMonitoringService monitoringService;
- private static ILessonService lessonService;
- private static ISecurityService securityService;
-
@Autowired
+ private IMonitoringService monitoringService;
+ @Autowired
+ private ILessonService lessonService;
+ @Autowired
+ private ISecurityService securityService;
+ @Autowired
@Qualifier("adminMessageService")
- private MessageService adminMessageService;
+ private MessageService messageService;
- @Autowired
- private WebApplicationContext applicationContext;
-
@RequestMapping(path = "/start")
public String unspecified(HttpServletRequest request, HttpServletResponse response) throws IOException {
- if (!getSecurityService().isSysadmin(getUserID(), "display cleanup preview lessons", false)) {
+ if (!securityService.isSysadmin(getUserID(), "display cleanup preview lessons", false)) {
response.sendError(HttpServletResponse.SC_FORBIDDEN, "User is not a sysadmin");
return null;
}
if (!(request.isUserInRole(Role.SYSADMIN))) {
request.setAttribute("errorName", "CleanupPreviewLessonsController");
- request.setAttribute("errorMessage", adminMessageService.getMessage("error.need.sysadmin"));
+ request.setAttribute("errorMessage", messageService.getMessage("error.need.sysadmin"));
return "error";
}
- long[] lessonCount = getLessonService().getPreviewLessonCount();
+ long[] lessonCount = lessonService.getPreviewLessonCount();
request.setAttribute("previewCount", lessonCount[0]);
request.setAttribute("allLessonCount", lessonCount[1]);
@@ -95,14 +91,14 @@
public String deletePreviewLessons(HttpServletRequest request, HttpServletResponse response) throws IOException {
Integer userID = getUserID();
Integer limit = WebUtil.readIntParam(request, "limit", true);
- List lessonIDs = getLessonService().getPreviewLessons(limit);
+ List lessonIDs = lessonService.getPreviewLessons(limit);
for (Long lessonID : lessonIDs) {
log.info("Deleting preview lesson: " + lessonID);
// role is checked in this method
- getMonitoringService().removeLessonPermanently(lessonID, userID);
+ monitoringService.removeLessonPermanently(lessonID, userID);
}
- long[] lessonCount = getLessonService().getPreviewLessonCount();
+ long[] lessonCount = lessonService.getPreviewLessonCount();
String responseJSON = JsonUtil.toString(lessonCount);
response.setContentType("application/json;charset=utf-8");
response.getWriter().print(responseJSON);
@@ -114,31 +110,4 @@
UserDTO user = (UserDTO) ss.getAttribute(AttributeNames.USER);
return user == null ? null : user.getUserID();
}
-
- private IMonitoringService getMonitoringService() {
- if (monitoringService == null) {
- WebApplicationContext ctx = WebApplicationContextUtils
- .getRequiredWebApplicationContext(applicationContext.getServletContext());
- monitoringService = (IMonitoringService) ctx.getBean("monitoringService");
- }
- return monitoringService;
- }
-
- private ILessonService getLessonService() {
- if (lessonService == null) {
- WebApplicationContext ctx = WebApplicationContextUtils
- .getRequiredWebApplicationContext(applicationContext.getServletContext());
- lessonService = (ILessonService) ctx.getBean("lessonService");
- }
- return lessonService;
- }
-
- private ISecurityService getSecurityService() {
- if (securityService == null) {
- WebApplicationContext ctx = WebApplicationContextUtils
- .getRequiredWebApplicationContext(applicationContext.getServletContext());
- securityService = (ISecurityService) ctx.getBean("securityService");
- }
- return securityService;
- }
}
\ No newline at end of file
Index: lams_admin/src/java/org/lamsfoundation/lams/admin/web/controller/CleanupTempFilesController.java
===================================================================
diff -u -rec30ad2cd8a7b048f296533bcb70fdafd80a3be6 -rf2ad75cef0c507a64877942631fee13efbc6ed50
--- lams_admin/src/java/org/lamsfoundation/lams/admin/web/controller/CleanupTempFilesController.java (.../CleanupTempFilesController.java) (revision ec30ad2cd8a7b048f296533bcb70fdafd80a3be6)
+++ lams_admin/src/java/org/lamsfoundation/lams/admin/web/controller/CleanupTempFilesController.java (.../CleanupTempFilesController.java) (revision f2ad75cef0c507a64877942631fee13efbc6ed50)
@@ -44,32 +44,23 @@
/**
* @author jliew
- *
- *
- *
- *
- *
- *
- *
- *
*/
@Controller
@RequestMapping("/cleanup")
public class CleanupTempFilesController {
-
private static Logger log = Logger.getLogger(CleanupTempFilesController.class);
@Autowired
@Qualifier("adminMessageService")
- private MessageService adminMessageService;
+ private MessageService messageService;
@RequestMapping(path = "/start")
public String execute(@ModelAttribute CleanupForm cleanupForm, HttpServletRequest request) throws Exception {
// check user is sysadmin
if (!(request.isUserInRole(Role.SYSADMIN))) {
request.setAttribute("errorName", "CleanupTempFilesAction");
- request.setAttribute("errorMessage", adminMessageService.getMessage("error.need.sysadmin"));
+ request.setAttribute("errorMessage", messageService.getMessage("error.need.sysadmin"));
return "error";
}
@@ -88,9 +79,9 @@
int filesDeleted = FileUtil.cleanupOldFiles(FileUtil.getOldTempFiles(numDays));
String args[] = new String[1];
args[0] = new Integer(filesDeleted).toString();
- request.setAttribute("filesDeleted", adminMessageService.getMessage("msg.cleanup.files.deleted", args));
+ request.setAttribute("filesDeleted", messageService.getMessage("msg.cleanup.files.deleted", args));
} else {
- errorMap.add("numDays", adminMessageService.getMessage("error.non.negative.number.required"));
+ errorMap.add("numDays", messageService.getMessage("error.non.negative.number.required"));
}
} else {
// recommended number of days to leave temp files
Index: lams_admin/src/java/org/lamsfoundation/lams/admin/web/controller/CloneLessonsController.java
===================================================================
diff -u -r62aaf160878735888d077bf28fac3c1989bb8fbd -rf2ad75cef0c507a64877942631fee13efbc6ed50
--- lams_admin/src/java/org/lamsfoundation/lams/admin/web/controller/CloneLessonsController.java (.../CloneLessonsController.java) (revision 62aaf160878735888d077bf28fac3c1989bb8fbd)
+++ lams_admin/src/java/org/lamsfoundation/lams/admin/web/controller/CloneLessonsController.java (.../CloneLessonsController.java) (revision f2ad75cef0c507a64877942631fee13efbc6ed50)
@@ -32,7 +32,6 @@
import org.apache.commons.lang.StringUtils;
import org.apache.log4j.Logger;
-import org.lamsfoundation.lams.admin.service.AdminServiceProxy;
import org.lamsfoundation.lams.lesson.Lesson;
import org.lamsfoundation.lams.lesson.service.ILessonService;
import org.lamsfoundation.lams.monitoring.service.IMonitoringService;
@@ -49,22 +48,21 @@
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
-import org.springframework.web.context.WebApplicationContext;
/**
* @author jliew
*/
@Controller
@RequestMapping("/clone")
public class CloneLessonsController {
-
private static final Logger log = Logger.getLogger(CloneLessonsController.class);
- private static IUserManagementService userManagementService;
- private static ILessonService lessonService;
- private static IMonitoringService monitoringService;
@Autowired
- private WebApplicationContext applicationContext;
+ private IUserManagementService userManagementService;
+ @Autowired
+ private ILessonService lessonService;
+ @Autowired
+ private IMonitoringService monitoringService;
@RequestMapping(path = "/start")
public String execute(HttpServletRequest request, HttpServletResponse response) throws UserAccessDeniedException {
@@ -75,9 +73,6 @@
List errors = new ArrayList<>();
try {
- CloneLessonsController.userManagementService = AdminServiceProxy
- .getService(applicationContext.getServletContext());
-
String method = WebUtil.readStrParam(request, "method", true);
if (StringUtils.equals(method, "getGroups")) {
return getGroups(response);
@@ -100,7 +95,7 @@
// default action
Integer groupId = WebUtil.readIntParam(request, "groupId", false);
- request.setAttribute("org", CloneLessonsController.userManagementService.findById(Organisation.class, groupId));
+ request.setAttribute("org", userManagementService.findById(Organisation.class, groupId));
return "organisation/cloneStart";
}
@@ -113,8 +108,8 @@
response.addHeader("Cache-Control", "no-cache");
response.addHeader("content-type", "text/html; charset=UTF-8");
- List groups = CloneLessonsController.userManagementService
- .getOrganisationsByTypeAndStatus(OrganisationType.COURSE_TYPE, OrganisationState.ACTIVE);
+ List groups = userManagementService.getOrganisationsByTypeAndStatus(OrganisationType.COURSE_TYPE,
+ OrganisationState.ACTIVE);
for (Object o : groups) {
Organisation org = (Organisation) o;
response.getWriter()
@@ -141,7 +136,7 @@
properties.put("organisationState.organisationStateId", OrganisationState.ACTIVE);
response.getWriter().println("");
- List groups = CloneLessonsController.userManagementService.findByProperties(Organisation.class, properties);
+ List groups = userManagementService.findByProperties(Organisation.class, properties);
for (Object o : groups) {
Organisation org = (Organisation) o;
response.getWriter()
@@ -159,10 +154,7 @@
Integer sourceGroupId = WebUtil.readIntParam(request, "sourceGroupId", true);
if (sourceGroupId != null) {
- CloneLessonsController.lessonService = AdminServiceProxy
- .getLessonService(applicationContext.getServletContext());
-
- List lessons = CloneLessonsController.lessonService.getLessonsByGroup(sourceGroupId);
+ List lessons = lessonService.getLessonsByGroup(sourceGroupId);
request.setAttribute("lessons", lessons);
}
@@ -176,8 +168,7 @@
Integer groupId = WebUtil.readIntParam(request, "groupId", false);
- Vector monitors = CloneLessonsController.userManagementService.getUsersFromOrganisationByRole(groupId,
- Role.MONITOR, true);
+ Vector monitors = userManagementService.getUsersFromOrganisationByRole(groupId, Role.MONITOR, true);
request.setAttribute("monitors", monitors);
response.addHeader("Cache-Control", "no-cache");
@@ -190,8 +181,7 @@
Integer groupId = WebUtil.readIntParam(request, "groupId", false);
- Vector learners = CloneLessonsController.userManagementService.getUsersFromOrganisationByRole(groupId,
- Role.LEARNER, true);
+ Vector learners = userManagementService.getUsersFromOrganisationByRole(groupId, Role.LEARNER, true);
request.setAttribute("learners", learners);
response.addHeader("Cache-Control", "no-cache");
@@ -219,15 +209,11 @@
learnerIds = learners.split(",");
}
- CloneLessonsController.monitoringService = AdminServiceProxy
- .getMonitoringService(applicationContext.getServletContext());
int result = 0;
-
- Organisation group = (Organisation) CloneLessonsController.userManagementService.findById(Organisation.class,
- groupId);
+ Organisation group = (Organisation) userManagementService.findById(Organisation.class, groupId);
if (group != null) {
- result = CloneLessonsController.monitoringService.cloneLessons(lessonIds, addAllStaff, addAllLearners,
- staffIds, learnerIds, group);
+ result = monitoringService.cloneLessons(lessonIds, addAllStaff, addAllLearners, staffIds, learnerIds,
+ group);
} else {
throw new UserException("Couldn't find Organisation based on id=" + groupId);
}
Index: lams_admin/src/java/org/lamsfoundation/lams/admin/web/controller/ConfigController.java
===================================================================
diff -u -r62aaf160878735888d077bf28fac3c1989bb8fbd -rf2ad75cef0c507a64877942631fee13efbc6ed50
--- lams_admin/src/java/org/lamsfoundation/lams/admin/web/controller/ConfigController.java (.../ConfigController.java) (revision 62aaf160878735888d077bf28fac3c1989bb8fbd)
+++ lams_admin/src/java/org/lamsfoundation/lams/admin/web/controller/ConfigController.java (.../ConfigController.java) (revision f2ad75cef0c507a64877942631fee13efbc6ed50)
@@ -28,7 +28,6 @@
import javax.servlet.http.HttpServletRequest;
import org.apache.commons.lang.StringUtils;
-import org.lamsfoundation.lams.admin.service.AdminServiceProxy;
import org.lamsfoundation.lams.admin.web.form.ConfigForm;
import org.lamsfoundation.lams.config.ConfigurationItem;
import org.lamsfoundation.lams.util.Configuration;
@@ -40,43 +39,25 @@
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.context.WebApplicationContext;
/**
* ConfigAction
*
* @author Mitchell Seaton
*/
-/**
- *
- *
- *
- *
- *
- */
@Controller
public class ConfigController {
-
- private static Configuration configurationService;
-
+
@Autowired
- private WebApplicationContext applicationContext;
-
+ private Configuration configurationService;
@Autowired
@Qualifier("adminMessageService")
- private MessageService adminMessageService;
+ private MessageService messageService;
- private Configuration getConfiguration() {
- if (configurationService == null) {
- configurationService = AdminServiceProxy.getConfiguration(applicationContext.getServletContext());
- }
- return configurationService;
- }
-
@RequestMapping(path = "/config")
public String unspecified(@ModelAttribute ConfigForm configForm, HttpServletRequest request) throws Exception {
- request.setAttribute("config", getConfiguration().arrangeItems(Configuration.ITEMS_NON_LDAP));
+ request.setAttribute("config", configurationService.arrangeItems(Configuration.ITEMS_NON_LDAP));
request.setAttribute("countryCodes", LanguageUtil.getCountryCodes(false));
Map smtpAuthTypes = new LinkedHashMap();
smtpAuthTypes.put("none", "None");
@@ -96,7 +77,7 @@
String errorForward = "config/editconfig";
for (int i = 0; i < keys.length; i++) {
- ConfigurationItem item = getConfiguration().getConfigItemByKey(keys[i]);
+ ConfigurationItem item = configurationService.getConfigItemByKey(keys[i]);
if (item != null) {
// return to ldap page if that's where we came from
@@ -107,7 +88,7 @@
if (item.getRequired()) {
if (!(values[i] != null && values[i].length() > 0)) {
request.setAttribute("error", getRequiredError(item.getDescriptionKey()));
- request.setAttribute("config", getConfiguration().arrangeItems(Configuration.ITEMS_NON_LDAP));
+ request.setAttribute("config", configurationService.arrangeItems(Configuration.ITEMS_NON_LDAP));
return errorForward;
}
}
@@ -117,14 +98,14 @@
Long.parseLong(values[i]);
} catch (NumberFormatException e) {
request.setAttribute("error", getNumericError(item.getDescriptionKey()));
- request.setAttribute("config", getConfiguration().arrangeItems(Configuration.ITEMS_NON_LDAP));
+ request.setAttribute("config", configurationService.arrangeItems(Configuration.ITEMS_NON_LDAP));
return errorForward;
}
}
Configuration.updateItem(keys[i], values[i]);
}
}
- getConfiguration().persistUpdate();
+ configurationService.persistUpdate();
Configuration.refreshCache();
@@ -133,14 +114,14 @@
private String getRequiredError(String arg) {
String[] args = new String[1];
- args[0] = adminMessageService.getMessage(arg);
- return adminMessageService.getMessage("error.required", args);
+ args[0] = messageService.getMessage(arg);
+ return messageService.getMessage("error.required", args);
}
private String getNumericError(String arg) {
String[] args = new String[1];
- args[0] = adminMessageService.getMessage(arg);
- return adminMessageService.getMessage("error.numeric", args);
+ args[0] = messageService.getMessage(arg);
+ return messageService.getMessage("error.numeric", args);
}
}
Index: lams_admin/src/java/org/lamsfoundation/lams/admin/web/controller/DisabledUserManageController.java
===================================================================
diff -u -re2c0c928c2cf3c0527ec942ad9af0ec67a3aa8d7 -rf2ad75cef0c507a64877942631fee13efbc6ed50
--- lams_admin/src/java/org/lamsfoundation/lams/admin/web/controller/DisabledUserManageController.java (.../DisabledUserManageController.java) (revision e2c0c928c2cf3c0527ec942ad9af0ec67a3aa8d7)
+++ lams_admin/src/java/org/lamsfoundation/lams/admin/web/controller/DisabledUserManageController.java (.../DisabledUserManageController.java) (revision f2ad75cef0c507a64877942631fee13efbc6ed50)
@@ -28,48 +28,35 @@
import javax.servlet.http.HttpServletRequest;
import org.apache.log4j.Logger;
-import org.lamsfoundation.lams.admin.service.AdminServiceProxy;
import org.lamsfoundation.lams.usermanagement.Role;
import org.lamsfoundation.lams.usermanagement.User;
import org.lamsfoundation.lams.usermanagement.service.IUserManagementService;
import org.lamsfoundation.lams.util.MessageService;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.context.WebApplicationContext;
/**
* @author jliew
- *
- *
- *
- *
*/
@Controller
public class DisabledUserManageController {
-
private static final Logger log = Logger.getLogger(DisabledUserManageController.class);
@Autowired
- private WebApplicationContext applicationContext;
-
+ private IUserManagementService userManagementService;
@Autowired
- @Qualifier("adminMessageService")
private MessageService adminMessageService;
@RequestMapping("/disabledmanage")
public String execute(HttpServletRequest request) throws Exception {
-
- IUserManagementService service = AdminServiceProxy.getService(applicationContext.getServletContext());
-
- if (!(request.isUserInRole(Role.SYSADMIN) || service.isUserGlobalGroupAdmin())) {
+ if (!(request.isUserInRole(Role.SYSADMIN) || userManagementService.isUserGlobalGroupAdmin())) {
request.setAttribute("errorName", "DisabledUserManageAction");
request.setAttribute("errorMessage", adminMessageService.getMessage("error.need.sysadmin"));
return "error";
}
- List users = service.findByProperty(User.class, "disabledFlag", true);
+ List users = userManagementService.findByProperty(User.class, "disabledFlag", true);
log.debug("got " + users.size() + " disabled users");
request.setAttribute("users", users);
Index: lams_admin/src/java/org/lamsfoundation/lams/admin/web/controller/ImportExcelSaveController.java
===================================================================
diff -u -r8d8232ae7142c30068360a2a41bbcccc065e775b -rf2ad75cef0c507a64877942631fee13efbc6ed50
--- lams_admin/src/java/org/lamsfoundation/lams/admin/web/controller/ImportExcelSaveController.java (.../ImportExcelSaveController.java) (revision 8d8232ae7142c30068360a2a41bbcccc065e775b)
+++ lams_admin/src/java/org/lamsfoundation/lams/admin/web/controller/ImportExcelSaveController.java (.../ImportExcelSaveController.java) (revision f2ad75cef0c507a64877942631fee13efbc6ed50)
@@ -36,34 +36,24 @@
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.context.WebApplicationContext;
+import org.springframework.web.context.support.WebApplicationContextUtils;
import org.springframework.web.multipart.MultipartFile;
/**
* @author jliew
- *
- *
- *
- *
- *
- *
- *
- *
- *
- *
- *
- *
*/
@Controller
public class ImportExcelSaveController {
@Autowired
+ private IImportService importService;
+
+ @Autowired
private WebApplicationContext applicationContext;
@RequestMapping(path = "/importexcelsave", method = RequestMethod.POST)
public String execute(@ModelAttribute ImportExcelForm importExcelForm, HttpServletRequest request)
throws Exception {
-
- IImportService importService = AdminServiceProxy.getImportService(applicationContext.getServletContext());
MultipartFile file = importExcelForm.getFile();
// validation
@@ -74,15 +64,15 @@
String sessionId = SessionManager.getSession().getId();
SessionManager.getSession().setAttribute(IImportService.IMPORT_FILE, file);
// use a new thread only if number of users is > threshold
- if (importService.getNumRows(file) < IImportService.THRESHOLD) {
- List results = importService.parseSpreadsheet(file, sessionId);
- SessionManager.getSession(sessionId).setAttribute(IImportService.IMPORT_RESULTS, results);
- return "forward:/importuserresult.do";
- } else {
+// if (importService.getNumRows(file) < IImportService.THRESHOLD) {
+// List results = importService.parseSpreadsheet(file, sessionId);
+// SessionManager.getSession(sessionId).setAttribute(IImportService.IMPORT_RESULTS, results);
+// return "forward:/importuserresult.do";
+// } else {
Thread t = new Thread(new ImportExcelThread(sessionId));
t.start();
return "import/status";
- }
+// }
}
private class ImportExcelThread implements Runnable {
@@ -94,7 +84,9 @@
@Override
public void run() {
- IImportService importService = AdminServiceProxy.getImportService(applicationContext.getServletContext());
+ WebApplicationContext wac = WebApplicationContextUtils
+ .getRequiredWebApplicationContext(applicationContext.getServletContext());
+ IImportService importService = (IImportService) wac.getBean("importService");
try {
MultipartFile file = (MultipartFile) SessionManager.getSession(sessionId)
.getAttribute(IImportService.IMPORT_FILE);
Index: lams_admin/src/java/org/lamsfoundation/lams/admin/web/controller/ImportGroupsController.java
===================================================================
diff -u -r9d51ed040508d8d5a10ee4033aded0c3784490a8 -rf2ad75cef0c507a64877942631fee13efbc6ed50
--- lams_admin/src/java/org/lamsfoundation/lams/admin/web/controller/ImportGroupsController.java (.../ImportGroupsController.java) (revision 9d51ed040508d8d5a10ee4033aded0c3784490a8)
+++ lams_admin/src/java/org/lamsfoundation/lams/admin/web/controller/ImportGroupsController.java (.../ImportGroupsController.java) (revision f2ad75cef0c507a64877942631fee13efbc6ed50)
@@ -26,40 +26,27 @@
import javax.servlet.http.HttpServletRequest;
-import org.lamsfoundation.lams.admin.service.AdminServiceProxy;
import org.lamsfoundation.lams.admin.service.IImportService;
import org.lamsfoundation.lams.admin.web.form.ImportExcelForm;
import org.lamsfoundation.lams.web.session.SessionManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.multipart.MultipartFile;
/**
* @author jliew
- *
- *
- *
- *
- *
- *
- *
- *
- *
*/
@Controller
public class ImportGroupsController {
@Autowired
- private WebApplicationContext applicationContext;
+ private IImportService importService;
@RequestMapping(path = "/importgroups")
- public String execute(@ModelAttribute("importForm") ImportExcelForm importForm, HttpServletRequest request) throws Exception {
-
- IImportService importService = AdminServiceProxy.getImportService(applicationContext.getServletContext());
+ public String execute(@ModelAttribute("importForm") ImportExcelForm importForm, HttpServletRequest request)
+ throws Exception {
importForm.setOrgId(0);
MultipartFile file = importForm.getFile();
Index: lams_admin/src/java/org/lamsfoundation/lams/admin/web/controller/ImportUserResultController.java
===================================================================
diff -u -rc1cd3b5d3bc88f16ad489fbc19c7d21f5b748305 -rf2ad75cef0c507a64877942631fee13efbc6ed50
--- lams_admin/src/java/org/lamsfoundation/lams/admin/web/controller/ImportUserResultController.java (.../ImportUserResultController.java) (revision c1cd3b5d3bc88f16ad489fbc19c7d21f5b748305)
+++ lams_admin/src/java/org/lamsfoundation/lams/admin/web/controller/ImportUserResultController.java (.../ImportUserResultController.java) (revision f2ad75cef0c507a64877942631fee13efbc6ed50)
@@ -29,36 +29,30 @@
import javax.servlet.http.HttpSession;
import org.apache.log4j.Logger;
-import org.lamsfoundation.lams.admin.service.AdminServiceProxy;
import org.lamsfoundation.lams.admin.service.IImportService;
import org.lamsfoundation.lams.util.MessageService;
import org.lamsfoundation.lams.web.session.SessionManager;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.multipart.MultipartFile;
/**
* @author jliew
- *
- *
- *
*/
@Controller
public class ImportUserResultController {
-
private static Logger log = Logger.getLogger(ImportUserResultController.class);
@Autowired
- private WebApplicationContext applicationContext;
+ private IImportService importService;
+ @Autowired
+ @Qualifier("adminMessageService")
+ private MessageService messageService;
@RequestMapping(path = "/importuserresult")
public String execute(HttpServletRequest request) throws Exception {
-
- MessageService messageService = AdminServiceProxy.getMessageService(applicationContext.getServletContext());
- IImportService importService = AdminServiceProxy.getImportService(applicationContext.getServletContext());
HttpSession ss = SessionManager.getSession();
List results = (List) ss.getAttribute(IImportService.IMPORT_RESULTS);
Index: lams_admin/src/java/org/lamsfoundation/lams/admin/web/controller/LdapConfigController.java
===================================================================
diff -u -r472fb979e3afdb43a7d537e588c5204554ba9f38 -rf2ad75cef0c507a64877942631fee13efbc6ed50
--- lams_admin/src/java/org/lamsfoundation/lams/admin/web/controller/LdapConfigController.java (.../LdapConfigController.java) (revision 472fb979e3afdb43a7d537e588c5204554ba9f38)
+++ lams_admin/src/java/org/lamsfoundation/lams/admin/web/controller/LdapConfigController.java (.../LdapConfigController.java) (revision f2ad75cef0c507a64877942631fee13efbc6ed50)
@@ -29,7 +29,6 @@
import org.apache.commons.lang.StringUtils;
import org.apache.log4j.Logger;
-import org.lamsfoundation.lams.admin.service.AdminServiceProxy;
import org.lamsfoundation.lams.admin.web.form.ConfigForm;
import org.lamsfoundation.lams.usermanagement.AuthenticationMethod;
import org.lamsfoundation.lams.usermanagement.dto.BulkUpdateResultDTO;
@@ -41,61 +40,29 @@
import org.lamsfoundation.lams.util.WebUtil;
import org.lamsfoundation.lams.web.session.SessionManager;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.context.WebApplicationContext;
/**
* @author jliew
- *
- *
- *
- *
- *
*/
@Controller
@RequestMapping("/ldap")
public class LdapConfigController {
-
private static Logger log = Logger.getLogger(LdapConfigController.class);
- private static IUserManagementService service;
- private static LdapService ldapService;
- private static MessageService messageService;
- private static Configuration configurationService;
-
+
@Autowired
- private WebApplicationContext applicationContext;
+ private Configuration configurationService;
+ @Autowired
+ private LdapService ldapService;
+ @Autowired
+ private IUserManagementService userManagementService;
+ @Autowired
+ @Qualifier("adminMessageService")
+ private MessageService messageService;
- private IUserManagementService getService() {
- if (service == null) {
- service = AdminServiceProxy.getService(applicationContext.getServletContext());
- }
- return service;
- }
-
- private LdapService getLdapService() {
- if (ldapService == null) {
- ldapService = AdminServiceProxy.getLdapService(applicationContext.getServletContext());
- }
- return ldapService;
- }
-
- private MessageService getMessageService() {
- if (messageService == null) {
- messageService = AdminServiceProxy.getMessageService(applicationContext.getServletContext());
- }
- return messageService;
- }
-
- private Configuration getConfiguration() {
- if (configurationService == null) {
- configurationService = AdminServiceProxy.getConfiguration(applicationContext.getServletContext());
- }
- return configurationService;
- }
-
@RequestMapping(path = "/start")
public String execute(@ModelAttribute ConfigForm configForm, HttpServletRequest request) throws Exception {
@@ -112,7 +79,7 @@
}
}
- request.setAttribute("config", getConfiguration().arrangeItems(Configuration.ITEMS_ONLY_LDAP));
+ request.setAttribute("config", configurationService.arrangeItems(Configuration.ITEMS_ONLY_LDAP));
int numLdapUsers = getNumLdapUsers();
request.setAttribute("numLdapUsersMsg", getNumLdapUsersMsg(numLdapUsers));
@@ -127,15 +94,15 @@
Thread t = new Thread(new LdapSyncThread(sessionId));
t.start();
- request.setAttribute("wait", getMessageService().getMessage("msg.ldap.synchronise.wait"));
+ request.setAttribute("wait", messageService.getMessage("msg.ldap.synchronise.wait"));
return "ldap";
}
@RequestMapping(path = "/waiting")
public String waiting(HttpServletRequest request) throws Exception {
- request.setAttribute("wait", getMessageService().getMessage("msg.ldap.synchronise.wait"));
+ request.setAttribute("wait", messageService.getMessage("msg.ldap.synchronise.wait"));
return "ldap";
}
@@ -157,12 +124,12 @@
request.setAttribute("numLdapUsersUpdated", getNumUpdatedUsersMsg(dto.getNumUsersUpdated()));
request.setAttribute("numLdapUsersDisabled", getNumDisabledUsersMsg(dto.getNumUsersDisabled()));
request.setAttribute("messages", dto.getMessages());
- request.setAttribute("done", getMessageService().getMessage("msg.done"));
+ request.setAttribute("done", messageService.getMessage("msg.done"));
} else {
ArrayList list = new ArrayList<>();
list.add((String) o);
request.setAttribute("messages", list);
- request.setAttribute("done", getMessageService().getMessage("msg.done"));
+ request.setAttribute("done", messageService.getMessage("msg.done"));
}
// remove session variable that flags bulk update as done
@@ -172,38 +139,38 @@
}
private int getNumLdapUsers() {
- Integer count = getService().getCountUsers(AuthenticationMethod.LDAP);
+ Integer count = userManagementService.getCountUsers(AuthenticationMethod.LDAP);
return (count != null ? count.intValue() : -1);
}
private String getNumLdapUsersMsg(int numLdapUsers) {
String[] args = new String[1];
args[0] = String.valueOf(numLdapUsers);
- return getMessageService().getMessage("msg.num.ldap.users", args);
+ return messageService.getMessage("msg.num.ldap.users", args);
}
private String getNumSearchResultsUsersMsg(int searchResults) {
String[] args = new String[1];
args[0] = String.valueOf(searchResults);
- return getMessageService().getMessage("msg.num.search.results.users", args);
+ return messageService.getMessage("msg.num.search.results.users", args);
}
private String getNumCreatedUsersMsg(int created) {
String[] args = new String[1];
args[0] = String.valueOf(created);
- return getMessageService().getMessage("msg.num.created.users", args);
+ return messageService.getMessage("msg.num.created.users", args);
}
private String getNumUpdatedUsersMsg(int updated) {
String[] args = new String[1];
args[0] = String.valueOf(updated);
- return getMessageService().getMessage("msg.num.updated.users", args);
+ return messageService.getMessage("msg.num.updated.users", args);
}
private String getNumDisabledUsersMsg(int disabled) {
String[] args = new String[1];
args[0] = String.valueOf(disabled);
- return getMessageService().getMessage("msg.num.disabled.users", args);
+ return messageService.getMessage("msg.num.disabled.users", args);
}
private class LdapSyncThread implements Runnable {
@@ -220,7 +187,7 @@
this.log.info("=== Beginning LDAP user sync ===");
long start = System.currentTimeMillis();
try {
- BulkUpdateResultDTO dto = getLdapService().bulkUpdate();
+ BulkUpdateResultDTO dto = ldapService.bulkUpdate();
long end = System.currentTimeMillis();
this.log.info("=== Finished LDAP user sync ===");
this.log.info("Bulk update took " + (end - start) / 1000 + " seconds.");
Index: lams_admin/src/java/org/lamsfoundation/lams/admin/web/controller/LogEventController.java
===================================================================
diff -u -r0aee88559b0d79e0516dd3630c24111361aeb787 -rf2ad75cef0c507a64877942631fee13efbc6ed50
--- lams_admin/src/java/org/lamsfoundation/lams/admin/web/controller/LogEventController.java (.../LogEventController.java) (revision 0aee88559b0d79e0516dd3630c24111361aeb787)
+++ lams_admin/src/java/org/lamsfoundation/lams/admin/web/controller/LogEventController.java (.../LogEventController.java) (revision f2ad75cef0c507a64877942631fee13efbc6ed50)
@@ -32,7 +32,6 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import org.lamsfoundation.lams.admin.service.AdminServiceProxy;
import org.lamsfoundation.lams.logevent.LogEvent;
import org.lamsfoundation.lams.logevent.LogEventType;
import org.lamsfoundation.lams.logevent.dto.LogEventTypeDTO;
@@ -43,12 +42,10 @@
import org.lamsfoundation.lams.util.MessageService;
import org.lamsfoundation.lams.util.WebUtil;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
-import org.springframework.web.context.WebApplicationContext;
-import org.springframework.web.context.support.WebApplicationContextUtils;
import com.fasterxml.jackson.databind.node.ArrayNode;
import com.fasterxml.jackson.databind.node.JsonNodeFactory;
@@ -60,31 +57,25 @@
@Controller
@RequestMapping("/logevent")
public class LogEventController {
-
- private static ILogEventService logEventService;
- private MessageService messageService;
private static SimpleDateFormat START_DATE_FORMAT = new SimpleDateFormat("YYYY-MM-dd");
@Autowired
- private WebApplicationContext applicationContext;
+ private ILogEventService logEventService;
+
+ @Autowired
+ @Qualifier("adminMessageService")
+ private MessageService messageService;
@RequestMapping(path = "/start")
public String unspecified(HttpServletRequest request) throws Exception {
// check permission
if (!request.isUserInRole(Role.SYSADMIN)) {
request.setAttribute("errorName", "EventLogAdmin");
- request.setAttribute("errorMessage", AdminServiceProxy
- .getMessageService(applicationContext.getServletContext()).getMessage("error.authorisation"));
+ request.setAttribute("errorMessage", messageService.getMessage("error.authorisation"));
return "error";
}
- logEventService = getLogEventService();
-
- if (messageService == null) {
- messageService = AdminServiceProxy.getMessageService(applicationContext.getServletContext());
- }
-
// get the log type data and return display for user selection. Also get the start and stop dates from the log.
// TODO check conversion the dates to the user's timezone
List types = logEventService.getEventTypes();
@@ -113,13 +104,10 @@
// check permission
if (!request.isUserInRole(Role.SYSADMIN)) {
request.setAttribute("errorName", "EventLogAdmin");
- request.setAttribute("errorMessage", AdminServiceProxy
- .getMessageService(applicationContext.getServletContext()).getMessage("error.authorisation"));
+ request.setAttribute("errorMessage", messageService.getMessage("error.authorisation"));
return "error";
}
- logEventService = getLogEventService();
-
// paging parameters of tablesorter
int size = WebUtil.readIntParam(request, "size");
int page = WebUtil.readIntParam(request, "page");
@@ -200,13 +188,4 @@
return responsedata.toString();
}
- private ILogEventService getLogEventService() throws ServletException {
- if (logEventService == null) {
- WebApplicationContext ctx = WebApplicationContextUtils
- .getRequiredWebApplicationContext(applicationContext.getServletContext());
- logEventService = (ILogEventService) ctx.getBean("logEventService");
- }
- return logEventService;
- }
-
}
Index: lams_admin/src/java/org/lamsfoundation/lams/admin/web/controller/LtiConsumerManagementController.java
===================================================================
diff -u -r7525e7b5fda723cc9c2c81a78cd8be3785bad851 -rf2ad75cef0c507a64877942631fee13efbc6ed50
--- lams_admin/src/java/org/lamsfoundation/lams/admin/web/controller/LtiConsumerManagementController.java (.../LtiConsumerManagementController.java) (revision 7525e7b5fda723cc9c2c81a78cd8be3785bad851)
+++ lams_admin/src/java/org/lamsfoundation/lams/admin/web/controller/LtiConsumerManagementController.java (.../LtiConsumerManagementController.java) (revision f2ad75cef0c507a64877942631fee13efbc6ed50)
@@ -9,56 +9,42 @@
import org.apache.commons.beanutils.BeanUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.log4j.Logger;
-import org.lamsfoundation.lams.admin.service.AdminServiceProxy;
import org.lamsfoundation.lams.admin.web.form.LtiConsumerForm;
import org.lamsfoundation.lams.integration.ExtServer;
import org.lamsfoundation.lams.integration.service.IIntegrationService;
import org.lamsfoundation.lams.usermanagement.service.IUserManagementService;
import org.lamsfoundation.lams.util.MessageService;
import org.lamsfoundation.lams.util.WebUtil;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.context.WebApplicationContext;
/**
* @author Andrey Balan
*/
@Controller
@RequestMapping("/ltiConsumerManagement")
public class LtiConsumerManagementController {
-
private static Logger log = Logger.getLogger(LtiConsumerManagementController.class);
+
+ @Autowired
+ private IIntegrationService integrationService;
+ @Autowired
private IUserManagementService userManagementService;
+ @Autowired
+ @Qualifier("adminMessageService")
private MessageService messageService;
- private IIntegrationService integrationService;
- @Autowired
- private WebApplicationContext applicationContext;
-
- private void initServices() {
- if (userManagementService == null) {
- userManagementService = AdminServiceProxy.getService(applicationContext.getServletContext());
- }
- if (messageService == null) {
- messageService = AdminServiceProxy.getMessageService(applicationContext.getServletContext());
- }
- if (integrationService == null) {
- integrationService = AdminServiceProxy.getIntegrationService(applicationContext.getServletContext());
- }
- }
-
/**
* Shows all available LTI tool consumers
*/
@RequestMapping(path = "/start")
public String unspecified(HttpServletRequest request) {
- initServices();
-
List ltiConsumers = integrationService.getAllToolConsumers();
Collections.sort(ltiConsumers);
request.setAttribute("ltiConsumers", ltiConsumers);
@@ -71,9 +57,6 @@
*/
@RequestMapping(path = "/edit")
public String edit(@ModelAttribute LtiConsumerForm ltiConsumerForm, HttpServletRequest request) throws Exception {
-
- initServices();
-
Integer sid = WebUtil.readIntParam(request, "sid", true);
// editing a tool consumer
@@ -96,9 +79,6 @@
*/
@RequestMapping(path = "/disable")
public String disable(HttpServletRequest request) throws Exception {
-
- initServices();
-
Integer sid = WebUtil.readIntParam(request, "sid", true);
boolean disable = WebUtil.readBooleanParam(request, "disable");
ExtServer ltiConsumer = integrationService.getExtServer(sid);
@@ -113,9 +93,6 @@
*/
@RequestMapping(path = "/delete")
public String delete(HttpServletRequest request) throws Exception {
-
- initServices();
-
Integer sid = WebUtil.readIntParam(request, "sid", true);
userManagementService.deleteById(ExtServer.class, sid);
@@ -128,9 +105,6 @@
@RequestMapping(path = "/save", method = RequestMethod.POST)
public String save(@ModelAttribute LtiConsumerForm ltiConsumerForm, HttpServletRequest request,
HttpServletResponse response) throws Exception {
-
- initServices();
-
MultiValueMap errorMap = new LinkedMultiValueMap<>();
if (StringUtils.trimToNull(ltiConsumerForm.getServerid()) == null) {
Index: lams_admin/src/java/org/lamsfoundation/lams/admin/web/controller/OrgManageController.java
===================================================================
diff -u -rc9e22b65129fe7561d7e66f5d6338557b0f3236a -rf2ad75cef0c507a64877942631fee13efbc6ed50
--- lams_admin/src/java/org/lamsfoundation/lams/admin/web/controller/OrgManageController.java (.../OrgManageController.java) (revision c9e22b65129fe7561d7e66f5d6338557b0f3236a)
+++ lams_admin/src/java/org/lamsfoundation/lams/admin/web/controller/OrgManageController.java (.../OrgManageController.java) (revision f2ad75cef0c507a64877942631fee13efbc6ed50)
@@ -29,7 +29,6 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import org.lamsfoundation.lams.admin.service.AdminServiceProxy;
import org.lamsfoundation.lams.admin.web.form.OrgManageForm;
import org.lamsfoundation.lams.security.ISecurityService;
import org.lamsfoundation.lams.usermanagement.Organisation;
@@ -38,46 +37,40 @@
import org.lamsfoundation.lams.usermanagement.Role;
import org.lamsfoundation.lams.usermanagement.dto.UserDTO;
import org.lamsfoundation.lams.usermanagement.service.IUserManagementService;
-import org.lamsfoundation.lams.usermanagement.service.UserManagementService;
import org.lamsfoundation.lams.util.FileUtil;
import org.lamsfoundation.lams.util.MessageService;
import org.lamsfoundation.lams.util.WebUtil;
import org.lamsfoundation.lams.web.session.SessionManager;
import org.lamsfoundation.lams.web.util.AttributeNames;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
-import org.springframework.web.context.WebApplicationContext;
-import org.springframework.web.context.support.WebApplicationContextUtils;
import org.springframework.web.util.HtmlUtils;
import com.fasterxml.jackson.databind.node.ArrayNode;
import com.fasterxml.jackson.databind.node.JsonNodeFactory;
import com.fasterxml.jackson.databind.node.ObjectNode;
/**
- *
- * View Source
- *
- *
* @author Fei Yang
*/
@Controller
public class OrgManageController {
- private static IUserManagementService userManagementService;
-
@Autowired
- private WebApplicationContext applicationContext;
+ private ISecurityService securityService;
+ @Autowired
+ private IUserManagementService userManagementService;
+ @Autowired
+ @Qualifier("adminMessageService")
+ private MessageService messageService;
@RequestMapping(path = "/orgmanage")
public String unspecified(@ModelAttribute OrgManageForm orgManageForm, HttpServletRequest request,
HttpServletResponse response) throws Exception {
- initServices();
-
// Get organisation whose child organisations we will populate the OrgManageForm with
Integer orgId = WebUtil.readIntParam(request, "org", true);
@@ -91,7 +84,6 @@
// get logged in user's id
Integer userId = ((UserDTO) SessionManager.getSession().getAttribute(AttributeNames.USER)).getUserID();
- ISecurityService securityService = AdminServiceProxy.getSecurityService(applicationContext.getServletContext());
Organisation org = null;
boolean isRootOrganisation = false;
@@ -117,7 +109,6 @@
int numUsers = org == rootOrganisation ? userManagementService.getCountUsers()
: userManagementService.getUsersFromOrganisation(orgId).size();
String key = org == rootOrganisation ? "label.users.in.system" : "label.users.in.group";
- MessageService messageService = AdminServiceProxy.getMessageService(applicationContext.getServletContext());
request.setAttribute("numUsers", messageService.getMessage(key, new String[] { String.valueOf(numUsers) }));
// Set OrgManageForm
@@ -165,8 +156,6 @@
@RequestMapping("/orgmanage/getOrgs")
@ResponseBody
public String getOrgs(HttpServletRequest request, HttpServletResponse res) throws IOException, ServletException {
- initServices();
-
Integer parentOrgId = WebUtil.readIntParam(request, "parentOrgId");
Integer stateId = WebUtil.readIntParam(request, "stateId");
Integer typeIdParam = WebUtil.readIntParam(request, "type");
@@ -229,12 +218,4 @@
res.setContentType("application/json;charset=utf-8");
return responseJSON.toString();
}
-
- private void initServices() {
- if (userManagementService == null) {
- WebApplicationContext ctx = WebApplicationContextUtils
- .getWebApplicationContext(applicationContext.getServletContext());
- userManagementService = (UserManagementService) ctx.getBean("userManagementService");
- }
- }
}
\ No newline at end of file
Index: lams_admin/src/java/org/lamsfoundation/lams/admin/web/controller/OrgPasswordChangeController.java
===================================================================
diff -u -r198db26e45c4083d69e39fcd40ffed3f7918fc58 -rf2ad75cef0c507a64877942631fee13efbc6ed50
--- lams_admin/src/java/org/lamsfoundation/lams/admin/web/controller/OrgPasswordChangeController.java (.../OrgPasswordChangeController.java) (revision 198db26e45c4083d69e39fcd40ffed3f7918fc58)
+++ lams_admin/src/java/org/lamsfoundation/lams/admin/web/controller/OrgPasswordChangeController.java (.../OrgPasswordChangeController.java) (revision f2ad75cef0c507a64877942631fee13efbc6ed50)
@@ -39,10 +39,11 @@
import org.apache.commons.lang.StringUtils;
import org.apache.log4j.Logger;
import org.lamsfoundation.lams.admin.AdminConstants;
-import org.lamsfoundation.lams.admin.service.AdminServiceProxy;
import org.lamsfoundation.lams.admin.web.form.OrgPasswordChangeForm;
import org.lamsfoundation.lams.events.IEventNotificationService;
import org.lamsfoundation.lams.integration.security.RandomPasswordGenerator;
+import org.lamsfoundation.lams.integration.service.IIntegrationService;
+import org.lamsfoundation.lams.security.ISecurityService;
import org.lamsfoundation.lams.usermanagement.Organisation;
import org.lamsfoundation.lams.usermanagement.Role;
import org.lamsfoundation.lams.usermanagement.User;
@@ -56,12 +57,12 @@
import org.lamsfoundation.lams.web.session.SessionManager;
import org.lamsfoundation.lams.web.util.AttributeNames;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
-import org.springframework.web.context.WebApplicationContext;
import com.fasterxml.jackson.databind.node.ArrayNode;
import com.fasterxml.jackson.databind.node.JsonNodeFactory;
@@ -70,18 +71,24 @@
@Controller
@RequestMapping("/orgPasswordChange")
public class OrgPasswordChangeController {
-
private static Logger log = Logger.getLogger(OrgPasswordChangeController.class);
@Autowired
- private WebApplicationContext applicationContext;
+ private IEventNotificationService eventNotificationService;
+ @Autowired
+ private IIntegrationService integrationService;
+ @Autowired
+ private ISecurityService securityService;
+ @Autowired
+ private IUserManagementService userManagementService;
+ @Autowired
+ @Qualifier("adminMessageService")
+ private MessageService messageService;
@RequestMapping("/start")
public String unspecified(@ModelAttribute OrgPasswordChangeForm orgPasswordChangeForm, HttpServletRequest request) {
Integer organisationID = WebUtil.readIntParam(request, AttributeNames.PARAM_ORGANISATION_ID);
orgPasswordChangeForm.setOrganisationID(organisationID);
- IUserManagementService userManagementService = AdminServiceProxy
- .getService(applicationContext.getServletContext());
Organisation organisation = (Organisation) userManagementService.findById(Organisation.class, organisationID);
orgPasswordChangeForm.setOrgName(organisation.getName());
orgPasswordChangeForm.setStaffChange(true);
@@ -108,8 +115,7 @@
UserDTO userDTO = getUserDTO();
Integer currentUserId = userDTO.getUserID();
- if (!AdminServiceProxy.getSecurityService(applicationContext.getServletContext()).isSysadmin(currentUserId,
- "get grid users for org password change", false)) {
+ if (!securityService.isSysadmin(currentUserId, "get grid users for org password change", false)) {
String warning = "User " + currentUserId + " is not a sysadmin";
log.warn(warning);
response.sendError(HttpServletResponse.SC_FORBIDDEN, warning);
@@ -173,8 +179,7 @@
UserDTO userDTO = getUserDTO();
Integer currentUserId = userDTO.getUserID();
// security check
- if (!AdminServiceProxy.getSecurityService(applicationContext.getServletContext()).isSysadmin(currentUserId,
- "org password change", false)) {
+ if (!securityService.isSysadmin(currentUserId, "org password change", false)) {
String warning = "User " + currentUserId + " is not a sysadmin";
log.warn(warning);
response.sendError(HttpServletResponse.SC_FORBIDDEN, warning);
@@ -223,9 +228,8 @@
}
private void notifyOnPasswordChange(Collection userIDs, String password) {
- MessageService messageService = AdminServiceProxy.getMessageService(applicationContext.getServletContext());
- AdminServiceProxy.getEventNotificationService(applicationContext.getServletContext()).sendMessage(null,
- userIDs.toArray(new Integer[] {}), IEventNotificationService.DELIVERY_METHOD_MAIL,
+ eventNotificationService.sendMessage(null, userIDs.toArray(new Integer[] {}),
+ IEventNotificationService.DELIVERY_METHOD_MAIL,
messageService.getMessage("admin.org.password.change.email.subject"),
messageService.getMessage("admin.org.password.change.email.body", new String[] { password }), false);
}
@@ -240,8 +244,6 @@
throw new IllegalArgumentException("Both included and excluded users arrays must not be passed together");
}
Set changedUserIDs = new TreeSet<>();
- IUserManagementService userManagementService = AdminServiceProxy
- .getService(applicationContext.getServletContext());
UserDTO currentUserDTO = getUserDTO();
User currentUser = (User) userManagementService.findById(User.class, currentUserDTO.getUserID());
for (User user : users) {
@@ -293,8 +295,6 @@
*/
@SuppressWarnings("unchecked")
private List getUsersByRole(Integer organisationID, boolean isStaff) {
- IUserManagementService userManagementService = AdminServiceProxy
- .getService(applicationContext.getServletContext());
Set staff = new HashSet<>();
staff.addAll(userManagementService.getUsersFromOrganisationByRole(organisationID, Role.AUTHOR, true));
staff.addAll(userManagementService.getUsersFromOrganisationByRole(organisationID, Role.MONITOR, true));
@@ -314,8 +314,6 @@
* Gets sorted users for grids
*/
private List getUsersByRole(Integer organisationID, boolean isStaff, String sortBy, String sortOrder) {
- IUserManagementService userManagementService = AdminServiceProxy
- .getService(applicationContext.getServletContext());
List staff = userManagementService.getAllUsers(organisationID,
new String[] { Role.AUTHOR, Role.MONITOR }, null, null, sortBy, sortOrder, null);
Index: lams_admin/src/java/org/lamsfoundation/lams/admin/web/controller/OrgSaveController.java
===================================================================
diff -u -r8d8232ae7142c30068360a2a41bbcccc065e775b -rf2ad75cef0c507a64877942631fee13efbc6ed50
--- lams_admin/src/java/org/lamsfoundation/lams/admin/web/controller/OrgSaveController.java (.../OrgSaveController.java) (revision 8d8232ae7142c30068360a2a41bbcccc065e775b)
+++ lams_admin/src/java/org/lamsfoundation/lams/admin/web/controller/OrgSaveController.java (.../OrgSaveController.java) (revision f2ad75cef0c507a64877942631fee13efbc6ed50)
@@ -31,7 +31,6 @@
import org.apache.commons.beanutils.BeanUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.log4j.Logger;
-import org.lamsfoundation.lams.admin.service.AdminServiceProxy;
import org.lamsfoundation.lams.admin.web.form.OrganisationForm;
import org.lamsfoundation.lams.logevent.LogEvent;
import org.lamsfoundation.lams.logevent.service.ILogEventService;
@@ -45,48 +44,35 @@
import org.lamsfoundation.lams.web.session.SessionManager;
import org.lamsfoundation.lams.web.util.AttributeNames;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.context.WebApplicationContext;
-import org.springframework.web.context.support.WebApplicationContextUtils;
/**
- * @version
- *
- *
- * View Source
- *
- *
* @author Fei Yang
- *
- * Created at 16:42:53 on 2006-6-7
*/
-
@Controller
public class OrgSaveController {
private static Logger log = Logger.getLogger(OrgSaveController.class);
- private static IUserManagementService service;
+
+ @Autowired
+ private ILogEventService logEventService;
+ @Autowired
+ private IUserManagementService userManagementService;
+
+ @Autowired
+ @Qualifier("adminMessageService")
private MessageService messageService;
- @Autowired
- private WebApplicationContext applicationContext;
-
@RequestMapping(path = "/orgsave")
public String execute(@ModelAttribute OrganisationForm organisationForm, BindingResult bindingResult,
HttpServletRequest request, HttpServletResponse response) throws Exception {
- if (service == null) {
- service = AdminServiceProxy.getService(applicationContext.getServletContext());
- }
- if (messageService == null) {
- messageService = AdminServiceProxy.getMessageService(applicationContext.getServletContext());
- }
-
Integer orgId = organisationForm.getOrgId();
Organisation org;
@@ -102,12 +88,12 @@
if (errorMap.isEmpty()) {
HttpSession ss = SessionManager.getSession();
UserDTO user = (UserDTO) ss.getAttribute(AttributeNames.USER);
- OrganisationState state = (OrganisationState) service.findById(OrganisationState.class,
+ OrganisationState state = (OrganisationState) userManagementService.findById(OrganisationState.class,
organisationForm.getStateId());
if (orgId != null) {
- if (service.canEditGroup(user.getUserID(), orgId)) {
- org = (Organisation) service.findById(Organisation.class, orgId);
+ if (userManagementService.canEditGroup(user.getUserID(), orgId)) {
+ org = (Organisation) userManagementService.findById(Organisation.class, orgId);
// set archived date only when it first changes to become archived
if (state.getOrganisationStateId().equals(OrganisationState.ARCHIVED) && !org.getOrganisationState()
.getOrganisationStateId().equals(OrganisationState.ARCHIVED)) {
@@ -124,16 +110,16 @@
org = new Organisation();
BeanUtils.copyProperties(org, organisationForm);
org.setParentOrganisation(
- (Organisation) service.findById(Organisation.class, organisationForm.getParentId()));
+ (Organisation) userManagementService.findById(Organisation.class, organisationForm.getParentId()));
org.setOrganisationType(
- (OrganisationType) service.findById(OrganisationType.class, organisationForm.getTypeId()));
+ (OrganisationType) userManagementService.findById(OrganisationType.class, organisationForm.getTypeId()));
writeAuditLog(user, org, organisationForm, org.getOrganisationState());
}
org.setOrganisationState(state);
if (log.isDebugEnabled()) {
log.debug("orgId: " + org.getOrganisationId() + " create date: " + org.getCreateDate());
}
- org = service.saveOrganisation(org, user.getUserID());
+ org = userManagementService.saveOrganisation(org, user.getUserID());
request.setAttribute("org", organisationForm.getParentId());
return "forward:/orgmanage.do";
@@ -145,11 +131,6 @@
private void writeAuditLog(UserDTO user, Organisation org, OrganisationForm orgForm, OrganisationState newState) {
- WebApplicationContext ctx = WebApplicationContextUtils
- .getRequiredWebApplicationContext(applicationContext.getServletContext());
- ILogEventService logEventService = (ILogEventService) ctx.getBean("logEventService");
- MessageService messageService = (MessageService) ctx.getBean("adminMessageService");
-
String message;
// audit log entries for organisation attribute changes
Index: lams_admin/src/java/org/lamsfoundation/lams/admin/web/controller/OrganisationController.java
===================================================================
diff -u -r62aaf160878735888d077bf28fac3c1989bb8fbd -rf2ad75cef0c507a64877942631fee13efbc6ed50
--- lams_admin/src/java/org/lamsfoundation/lams/admin/web/controller/OrganisationController.java (.../OrganisationController.java) (revision 62aaf160878735888d077bf28fac3c1989bb8fbd)
+++ lams_admin/src/java/org/lamsfoundation/lams/admin/web/controller/OrganisationController.java (.../OrganisationController.java) (revision f2ad75cef0c507a64877942631fee13efbc6ed50)
@@ -33,9 +33,10 @@
import org.apache.commons.beanutils.BeanUtils;
import org.apache.log4j.Logger;
-import org.lamsfoundation.lams.admin.service.AdminServiceProxy;
import org.lamsfoundation.lams.admin.web.form.OrganisationForm;
import org.lamsfoundation.lams.lesson.Lesson;
+import org.lamsfoundation.lams.monitoring.service.IMonitoringService;
+import org.lamsfoundation.lams.security.ISecurityService;
import org.lamsfoundation.lams.usermanagement.Organisation;
import org.lamsfoundation.lams.usermanagement.OrganisationState;
import org.lamsfoundation.lams.usermanagement.OrganisationType;
@@ -47,33 +48,35 @@
import org.lamsfoundation.lams.web.session.SessionManager;
import org.lamsfoundation.lams.web.util.AttributeNames;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
-import org.springframework.web.context.WebApplicationContext;
/**
* @author Fei Yang
*/
@Controller
@RequestMapping("/organisation")
public class OrganisationController {
-
- private static IUserManagementService service;
- private static MessageService messageService;
- private static List status;
-
private static Logger log = Logger.getLogger(OrganisationController.class);
@Autowired
- private WebApplicationContext applicationContext;
+ private IMonitoringService monitoringService;
+ @Autowired
+ private ISecurityService securityService;
+ @Autowired
+ private IUserManagementService userManagementService;
+ @Autowired
+ @Qualifier("adminMessageService")
+ private MessageService messageService;
+
+ private static List status;
@RequestMapping(path = "/edit")
public String edit(@ModelAttribute OrganisationForm organisationForm, HttpServletRequest request) throws Exception {
-
- OrganisationController.service = AdminServiceProxy.getService(applicationContext.getServletContext());
initLocalesAndStatus();
Integer orgId = WebUtil.readIntParam(request, "orgId", true);
@@ -83,10 +86,10 @@
if (userDto != null) {
Integer userId = userDto.getUserID();
// sysadmin, global group admin, group manager, group admin can edit group
- if (OrganisationController.service.canEditGroup(userId, orgId)) {
+ if (userManagementService.canEditGroup(userId, orgId)) {
// edit existing organisation
if (orgId != null) {
- Organisation org = (Organisation) OrganisationController.service.findById(Organisation.class,
+ Organisation org = (Organisation) userManagementService.findById(Organisation.class,
orgId);
BeanUtils.copyProperties(organisationForm, org);
organisationForm.setParentId(org.getParentOrganisation().getOrganisationId());
@@ -106,9 +109,9 @@
}
request.setAttribute("courseToDeleteLessons", courseToDeleteLessons);
}
- request.getSession().setAttribute("status", OrganisationController.status);
- if (OrganisationController.service.isUserSysAdmin()
- || OrganisationController.service.isUserGlobalGroupAdmin()) {
+ request.getSession().setAttribute("status", status);
+ if (userManagementService.isUserSysAdmin()
+ || userManagementService.isUserGlobalGroupAdmin()) {
return "organisation/createOrEdit";
} else {
return "organisation/courseAdminEdit";
@@ -123,10 +126,9 @@
@RequestMapping(path = "/create")
public String create(@ModelAttribute OrganisationForm organisationForm, HttpServletRequest request)
throws Exception {
- OrganisationController.service = AdminServiceProxy.getService(applicationContext.getServletContext());
initLocalesAndStatus();
- if (!(request.isUserInRole(Role.SYSADMIN) || OrganisationController.service.isUserGlobalGroupAdmin())) {
+ if (!(request.isUserInRole(Role.SYSADMIN) || userManagementService.isUserGlobalGroupAdmin())) {
// only sysadmins and global group admins can create groups
if (((organisationForm.getTypeId() != null)
&& organisationForm.getTypeId().equals(OrganisationType.COURSE_TYPE))
@@ -139,11 +141,11 @@
organisationForm.setOrgId(null);
Integer parentId = WebUtil.readIntParam(request, "parentId", true);
if (parentId != null) {
- Organisation parentOrg = (Organisation) OrganisationController.service.findById(Organisation.class,
+ Organisation parentOrg = (Organisation) userManagementService.findById(Organisation.class,
parentId);
organisationForm.setParentName(parentOrg.getName());
}
- request.getSession().setAttribute("status", OrganisationController.status);
+ request.getSession().setAttribute("status", status);
return "organisation/createOrEdit";
}
@@ -154,8 +156,7 @@
@ResponseBody
public String getOrganisationIdByName(HttpServletRequest request, HttpServletResponse response) throws IOException {
String organisationName = WebUtil.readStrParam(request, "name");
- OrganisationController.service = AdminServiceProxy.getService(applicationContext.getServletContext());
- List organisations = service.findByProperty(Organisation.class, "name", organisationName);
+ List organisations = userManagementService.findByProperty(Organisation.class, "name", organisationName);
if (!organisations.isEmpty()) {
response.setContentType("text/plain;charset=utf-8");
response.getWriter().print(organisations.get(0).getOrganisationId());
@@ -165,22 +166,19 @@
@RequestMapping(path = "/deleteAllLessonsInit", method = RequestMethod.POST)
public String deleteAllLessonsInit(HttpServletRequest request, HttpServletResponse response) throws IOException {
- if (!AdminServiceProxy.getSecurityService(applicationContext.getServletContext()).isSysadmin(getUserID(),
- "display cleanup preview lessons", false)) {
+ if (!securityService.isSysadmin(getUserID(), "display cleanup preview lessons", false)) {
response.sendError(HttpServletResponse.SC_FORBIDDEN, "User is not a sysadmin");
return null;
}
if (!(request.isUserInRole(Role.SYSADMIN))) {
request.setAttribute("errorName", "OrganisationAction");
- request.setAttribute("errorMessage", AdminServiceProxy
- .getMessageService(applicationContext.getServletContext()).getMessage("error.need.sysadmin"));
+ request.setAttribute("errorMessage", messageService.getMessage("error.need.sysadmin"));
return "error";
}
Integer organisationId = WebUtil.readIntParam(request, "orgId");
- Organisation organisation = (Organisation) AdminServiceProxy.getService(applicationContext.getServletContext())
- .findById(Organisation.class, organisationId);
+ Organisation organisation = (Organisation) userManagementService.findById(Organisation.class, organisationId);
int lessonCount = organisation.getLessons().size();
request.setAttribute("lessonCount", lessonCount);
request.setAttribute("courseName", organisation.getName());
@@ -193,13 +191,11 @@
Integer userID = getUserID();
Integer limit = WebUtil.readIntParam(request, "limit", true);
Integer organisationId = WebUtil.readIntParam(request, "orgId");
- Organisation organisation = (Organisation) AdminServiceProxy.getService(applicationContext.getServletContext())
- .findById(Organisation.class, organisationId);
+ Organisation organisation = (Organisation) userManagementService.findById(Organisation.class, organisationId);
for (Lesson lesson : (Set) organisation.getLessons()) {
log.info("Deleting lesson: " + lesson.getLessonId());
// role is checked in this method
- AdminServiceProxy.getMonitoringService(applicationContext.getServletContext())
- .removeLessonPermanently(lesson.getLessonId(), userID);
+ monitoringService.removeLessonPermanently(lesson.getLessonId(), userID);
if (limit != null) {
limit--;
if (limit == 0) {
@@ -208,19 +204,16 @@
}
}
- organisation = (Organisation) AdminServiceProxy.getService(applicationContext.getServletContext())
- .findById(Organisation.class, organisationId);
+ organisation = (Organisation) userManagementService.findById(Organisation.class, organisationId);
response.setContentType("application/json;charset=utf-8");
response.getWriter().print(organisation.getLessons().size());
return null;
}
@RequestMapping("/error")
public String error(HttpServletRequest request) {
- OrganisationController.messageService = AdminServiceProxy
- .getMessageService(applicationContext.getServletContext());
request.setAttribute("errorName", "OrganisationAction");
- request.setAttribute("errorMessage", OrganisationController.messageService.getMessage("error.authorisation"));
+ request.setAttribute("errorMessage", messageService.getMessage("error.authorisation"));
return "error";
}
@@ -232,8 +225,8 @@
@SuppressWarnings("unchecked")
private void initLocalesAndStatus() {
- if ((OrganisationController.status == null) && (OrganisationController.service != null)) {
- OrganisationController.status = OrganisationController.service.findAll(OrganisationState.class);
+ if ((status == null) && (userManagementService != null)) {
+ status = userManagementService.findAll(OrganisationState.class);
}
}
}
\ No newline at end of file
Index: lams_admin/src/java/org/lamsfoundation/lams/admin/web/controller/PolicyManagementController.java
===================================================================
diff -u -r95b456e2d455b045b20b696f2a749c0e3cc35917 -rf2ad75cef0c507a64877942631fee13efbc6ed50
--- lams_admin/src/java/org/lamsfoundation/lams/admin/web/controller/PolicyManagementController.java (.../PolicyManagementController.java) (revision 95b456e2d455b045b20b696f2a749c0e3cc35917)
+++ lams_admin/src/java/org/lamsfoundation/lams/admin/web/controller/PolicyManagementController.java (.../PolicyManagementController.java) (revision f2ad75cef0c507a64877942631fee13efbc6ed50)
@@ -25,7 +25,6 @@
import org.lamsfoundation.lams.web.session.SessionManager;
import org.lamsfoundation.lams.web.util.AttributeNames;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
@@ -45,14 +44,11 @@
@Controller
@RequestMapping("policyManagement")
public class PolicyManagementController {
-
private static Logger log = Logger.getLogger(PolicyManagementController.class);
@Autowired
- @Qualifier("policyService")
private IPolicyService policyService;
@Autowired
- @Qualifier("userManagementService")
private IUserManagementService userManagementService;
@RequestMapping("list")
Index: lams_admin/src/java/org/lamsfoundation/lams/admin/web/controller/PortraitBatchUploadController.java
===================================================================
diff -u -re2c0c928c2cf3c0527ec942ad9af0ec67a3aa8d7 -rf2ad75cef0c507a64877942631fee13efbc6ed50
--- lams_admin/src/java/org/lamsfoundation/lams/admin/web/controller/PortraitBatchUploadController.java (.../PortraitBatchUploadController.java) (revision e2c0c928c2cf3c0527ec942ad9af0ec67a3aa8d7)
+++ lams_admin/src/java/org/lamsfoundation/lams/admin/web/controller/PortraitBatchUploadController.java (.../PortraitBatchUploadController.java) (revision f2ad75cef0c507a64877942631fee13efbc6ed50)
@@ -51,16 +51,15 @@
@Controller
public class PortraitBatchUploadController {
- private static IUserManagementService userManagementService;
- private static ISecurityService securityService;
-
@Autowired
- private WebApplicationContext applicationContext;
+ private IUserManagementService userManagementService;
+ @Autowired
+ private ISecurityService securityService;
@RequestMapping("/uploadPortraits")
@ResponseBody
public String execute(HttpServletRequest request, HttpServletResponse response) throws IOException {
- if (!getSecurityService().isSysadmin(getUserID(), "batch upload portraits", false)) {
+ if (!securityService.isSysadmin(getUserID(), "batch upload portraits", false)) {
response.sendError(HttpServletResponse.SC_FORBIDDEN, "User is not a sysadmin");
return null;
}
@@ -69,7 +68,7 @@
Integer maxUserId = WebUtil.readIntParam(request, "maxUserID");
String prefix = request.getParameter("prefix");
- List uploadedUserNames = getUserManagementService().uploadPortraits(minUserId, maxUserId, prefix);
+ List uploadedUserNames = userManagementService.uploadPortraits(minUserId, maxUserId, prefix);
if (uploadedUserNames != null) {
response.setCharacterEncoding("UTF-8");
response.setContentType("text/plain");
@@ -89,22 +88,4 @@
UserDTO user = (UserDTO) ss.getAttribute(AttributeNames.USER);
return user == null ? null : user.getUserID();
}
-
- private IUserManagementService getUserManagementService() {
- if (userManagementService == null) {
- WebApplicationContext ctx = WebApplicationContextUtils
- .getRequiredWebApplicationContext(applicationContext.getServletContext());
- userManagementService = (IUserManagementService) ctx.getBean("userManagementService");
- }
- return userManagementService;
- }
-
- private ISecurityService getSecurityService() {
- if (securityService == null) {
- WebApplicationContext ctx = WebApplicationContextUtils
- .getRequiredWebApplicationContext(applicationContext.getServletContext());
- securityService = (ISecurityService) ctx.getBean("securityService");
- }
- return securityService;
- }
}
\ No newline at end of file
Index: lams_admin/src/java/org/lamsfoundation/lams/admin/web/controller/ScheduledJobListController.java
===================================================================
diff -u -r1ba327f73cb27c822d8a4ef36c386dd5a1432aef -rf2ad75cef0c507a64877942631fee13efbc6ed50
--- lams_admin/src/java/org/lamsfoundation/lams/admin/web/controller/ScheduledJobListController.java (.../ScheduledJobListController.java) (revision 1ba327f73cb27c822d8a4ef36c386dd5a1432aef)
+++ lams_admin/src/java/org/lamsfoundation/lams/admin/web/controller/ScheduledJobListController.java (.../ScheduledJobListController.java) (revision f2ad75cef0c507a64877942631fee13efbc6ed50)
@@ -47,30 +47,20 @@
/**
*
* @author Steve.Ni
- * @version $Revision$
- *
- *
- *
- *
*/
@Controller
public class ScheduledJobListController {
-
private static final Logger log = Logger.getLogger(ScheduledJobListController.class);
-
+
@Autowired
- private WebApplicationContext applicationContext;
+ private Scheduler scheduler;
/**
* Get all waitting queue jobs scheduled in Quartz table and display job name, job start time and description. The
* description will be in format "Lesson Name":"the lesson creator", or "The gate name":"The relatived lesson name".
*/
@RequestMapping(path = "/joblist", method = RequestMethod.POST)
public String execute(HttpServletRequest request) throws Exception {
-
- WebApplicationContext ctx = WebApplicationContextUtils
- .getWebApplicationContext(this.applicationContext.getServletContext());
- Scheduler scheduler = (Scheduler) ctx.getBean("scheduler");
ArrayList jobList = new ArrayList<>();
try {
Set jobKeys = scheduler.getJobKeys(GroupMatcher.jobGroupEquals(Scheduler.DEFAULT_GROUP));
Index: lams_admin/src/java/org/lamsfoundation/lams/admin/web/controller/ServerListController.java
===================================================================
diff -u -r0aee88559b0d79e0516dd3630c24111361aeb787 -rf2ad75cef0c507a64877942631fee13efbc6ed50
--- lams_admin/src/java/org/lamsfoundation/lams/admin/web/controller/ServerListController.java (.../ServerListController.java) (revision 0aee88559b0d79e0516dd3630c24111361aeb787)
+++ lams_admin/src/java/org/lamsfoundation/lams/admin/web/controller/ServerListController.java (.../ServerListController.java) (revision f2ad75cef0c507a64877942631fee13efbc6ed50)
@@ -27,13 +27,11 @@
import javax.servlet.http.HttpServletRequest;
-import org.lamsfoundation.lams.admin.service.AdminServiceProxy;
import org.lamsfoundation.lams.integration.ExtServer;
+import org.lamsfoundation.lams.integration.service.IIntegrationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.context.WebApplicationContext;
/**
*
@@ -43,12 +41,11 @@
public class ServerListController {
@Autowired
- private WebApplicationContext applicationContext;
+ private IIntegrationService integrationService;
@RequestMapping(path = "/serverlist")
public String execute(HttpServletRequest request) throws Exception {
- List extServers = AdminServiceProxy.getIntegrationService(applicationContext.getServletContext())
- .getAllExtServers();
+ List extServers = integrationService.getAllExtServers();
Collections.sort(extServers);
request.setAttribute("servers", extServers);
return "serverlist";
Index: lams_admin/src/java/org/lamsfoundation/lams/admin/web/controller/ServerMaintainController.java
===================================================================
diff -u -rfe0cf553a1a8c8af7594f72d10cd47e1ab225c93 -rf2ad75cef0c507a64877942631fee13efbc6ed50
--- lams_admin/src/java/org/lamsfoundation/lams/admin/web/controller/ServerMaintainController.java (.../ServerMaintainController.java) (revision fe0cf553a1a8c8af7594f72d10cd47e1ab225c93)
+++ lams_admin/src/java/org/lamsfoundation/lams/admin/web/controller/ServerMaintainController.java (.../ServerMaintainController.java) (revision f2ad75cef0c507a64877942631fee13efbc6ed50)
@@ -25,68 +25,66 @@
import javax.servlet.http.HttpServletRequest;
import org.apache.commons.beanutils.BeanUtils;
-import org.lamsfoundation.lams.admin.service.AdminServiceProxy;
import org.lamsfoundation.lams.admin.web.form.ExtServerForm;
import org.lamsfoundation.lams.integration.ExtServer;
import org.lamsfoundation.lams.integration.service.IIntegrationService;
+import org.lamsfoundation.lams.usermanagement.service.IUserManagementService;
+import org.lamsfoundation.lams.util.MessageService;
import org.lamsfoundation.lams.util.WebUtil;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.context.WebApplicationContext;
/**
- *
- * View Source
- *
- *
* @author Fei Yang
*/
@Controller
@RequestMapping("/servermaintain")
public class ServerMaintainController {
@Autowired
- private WebApplicationContext applicationContext;
+ private IIntegrationService integrationService;
+ @Autowired
+ private IUserManagementService userManagementService;
+ @Autowired
+ @Qualifier("adminMessageService")
+ private MessageService messageService;
@RequestMapping(path = "/edit")
public String edit(@ModelAttribute ExtServerForm extServerForm, HttpServletRequest request) throws Exception {
Integer sid = WebUtil.readIntParam(request, "sid", true);
if (sid != null) {
- ExtServer map = AdminServiceProxy.getIntegrationService(applicationContext.getServletContext())
- .getExtServer(sid);
+ ExtServer map = integrationService.getExtServer(sid);
BeanUtils.copyProperties(extServerForm, map);
}
return "servermaintain";
}
@RequestMapping(path = "/disable")
public String disable(HttpServletRequest request) throws Exception {
- IIntegrationService service = AdminServiceProxy.getIntegrationService(applicationContext.getServletContext());
Integer sid = WebUtil.readIntParam(request, "sid", false);
- ExtServer map = service.getExtServer(sid);
+ ExtServer map = integrationService.getExtServer(sid);
map.setDisabled(true);
- service.saveExtServer(map);
+ integrationService.saveExtServer(map);
return "forward:/serverlist.do";
}
@RequestMapping(path = "/enable")
public String enable(HttpServletRequest request) throws Exception {
- IIntegrationService service = AdminServiceProxy.getIntegrationService(applicationContext.getServletContext());
Integer sid = WebUtil.readIntParam(request, "sid", false);
- ExtServer map = service.getExtServer(sid);
+ ExtServer map = integrationService.getExtServer(sid);
map.setDisabled(false);
- service.saveExtServer(map);
+ integrationService.saveExtServer(map);
return "forward:/serverlist.do";
}
@RequestMapping(path = "/delete")
public String delete(HttpServletRequest request) throws Exception {
Integer sid = WebUtil.readIntParam(request, "sid", false);
- AdminServiceProxy.getService(applicationContext.getServletContext()).deleteById(ExtServer.class, sid);
+ userManagementService.deleteById(ExtServer.class, sid);
return "forward:/serverlist.do";
}
Index: lams_admin/src/java/org/lamsfoundation/lams/admin/web/controller/ServerSaveController.java
===================================================================
diff -u -r8d8232ae7142c30068360a2a41bbcccc065e775b -rf2ad75cef0c507a64877942631fee13efbc6ed50
--- lams_admin/src/java/org/lamsfoundation/lams/admin/web/controller/ServerSaveController.java (.../ServerSaveController.java) (revision 8d8232ae7142c30068360a2a41bbcccc065e775b)
+++ lams_admin/src/java/org/lamsfoundation/lams/admin/web/controller/ServerSaveController.java (.../ServerSaveController.java) (revision f2ad75cef0c507a64877942631fee13efbc6ed50)
@@ -29,46 +29,38 @@
import org.apache.commons.beanutils.BeanUtils;
import org.apache.commons.lang.StringUtils;
-import org.lamsfoundation.lams.admin.service.AdminServiceProxy;
import org.lamsfoundation.lams.admin.web.form.ExtServerForm;
import org.lamsfoundation.lams.integration.ExtServer;
import org.lamsfoundation.lams.integration.service.IIntegrationService;
import org.lamsfoundation.lams.usermanagement.service.IUserManagementService;
import org.lamsfoundation.lams.util.MessageService;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.context.WebApplicationContext;
/**
- *
- * View Source
- *
- *
* @author Fei Yang
*/
@Controller
public class ServerSaveController {
- private static IIntegrationService service;
- private static IUserManagementService userService;
- private static MessageService messageService;
-
@Autowired
- private WebApplicationContext applicationContext;
+ private IIntegrationService integrationService;
+ @Autowired
+ private IUserManagementService userManagementService;
+ @Autowired
+ @Qualifier("adminMessageService")
+ private MessageService messageService;
@RequestMapping(path = "/serversave")
public String execute(@ModelAttribute ExtServerForm extServerForm, BindingResult bindingResult,
HttpServletRequest request, HttpServletResponse response) throws Exception {
- service = AdminServiceProxy.getIntegrationService(applicationContext.getServletContext());
- userService = AdminServiceProxy.getService(applicationContext.getServletContext());
- messageService = AdminServiceProxy.getMessageService(applicationContext.getServletContext());
-
MultiValueMap errorMap = new LinkedMultiValueMap<>();
if (StringUtils.trimToNull(extServerForm.getServerid()) == null) {
@@ -94,7 +86,7 @@
Integer sid = extServerForm.getSid();
if (errorMap.isEmpty()) {//check duplication
- List listServer = userService.findByProperty(ExtServer.class, "serverid",
+ List listServer = userManagementService.findByProperty(ExtServer.class, "serverid",
extServerForm.getServerid());
if (listServer != null && listServer.size() > 0) {
if (sid.equals(-1)) {//new map
@@ -109,7 +101,7 @@
}
}
- List listPrefix = userService.findByProperty(ExtServer.class, "prefix",
+ List listPrefix = userManagementService.findByProperty(ExtServer.class, "prefix",
extServerForm.getPrefix());
if (listPrefix != null && listPrefix.size() > 0) {
if (sid.equals(0)) {//new map
@@ -133,10 +125,10 @@
map.setSid(null);
map.setServerTypeId(ExtServer.INTEGRATION_SERVER_TYPE);
} else {
- map = service.getExtServer(sid);
+ map = integrationService.getExtServer(sid);
BeanUtils.copyProperties(map, extServerForm);
}
- service.saveExtServer(map);
+ integrationService.saveExtServer(map);
return "forward:/serverlist.do";
} else {
request.setAttribute("errorMap", errorMap);
Index: lams_admin/src/java/org/lamsfoundation/lams/admin/web/controller/SignupManagementController.java
===================================================================
diff -u -re952488de6475350bc2fab3272b5350b3a7a6d51 -rf2ad75cef0c507a64877942631fee13efbc6ed50
--- lams_admin/src/java/org/lamsfoundation/lams/admin/web/controller/SignupManagementController.java (.../SignupManagementController.java) (revision e952488de6475350bc2fab3272b5350b3a7a6d51)
+++ lams_admin/src/java/org/lamsfoundation/lams/admin/web/controller/SignupManagementController.java (.../SignupManagementController.java) (revision f2ad75cef0c507a64877942631fee13efbc6ed50)
@@ -26,20 +26,15 @@
@Controller
@RequestMapping("/signupManagement")
public class SignupManagementController {
-
private static Logger log = Logger.getLogger(SignupManagementController.class);
@Autowired
- @Qualifier("signupService")
private ISignupService signupService = null;
-
@Autowired
- @Qualifier("userManagementService")
private IUserManagementService userManagementService = null;
-
@Autowired
@Qualifier("adminMessageService")
- private MessageService adminMessageService;
+ private MessageService messageService;
@RequestMapping("/start")
public String execute(HttpServletRequest request) {
@@ -93,10 +88,10 @@
// validate
if (!StringUtils.equals(signupForm.getCourseKey(), signupForm.getConfirmCourseKey())) {
- errorMap.add("courseKey", adminMessageService.getMessage("error.course.keys.unequal"));
+ errorMap.add("courseKey", messageService.getMessage("error.course.keys.unequal"));
}
if (signupService.contextExists(signupForm.getSignupOrganisationId(), signupForm.getContext())) {
- errorMap.add("context", adminMessageService.getMessage("error.context.exists"));
+ errorMap.add("context", messageService.getMessage("error.context.exists"));
}
if (!errorMap.isEmpty()) {
Index: lams_admin/src/java/org/lamsfoundation/lams/admin/web/controller/StatisticsController.java
===================================================================
diff -u -rc1cd3b5d3bc88f16ad489fbc19c7d21f5b748305 -rf2ad75cef0c507a64877942631fee13efbc6ed50
--- lams_admin/src/java/org/lamsfoundation/lams/admin/web/controller/StatisticsController.java (.../StatisticsController.java) (revision c1cd3b5d3bc88f16ad489fbc19c7d21f5b748305)
+++ lams_admin/src/java/org/lamsfoundation/lams/admin/web/controller/StatisticsController.java (.../StatisticsController.java) (revision f2ad75cef0c507a64877942631fee13efbc6ed50)
@@ -26,17 +26,17 @@
import javax.servlet.http.HttpServletRequest;
-import org.lamsfoundation.lams.admin.service.AdminServiceProxy;
import org.lamsfoundation.lams.statistics.dto.GroupStatisticsDTO;
import org.lamsfoundation.lams.statistics.dto.StatisticsDTO;
import org.lamsfoundation.lams.statistics.service.IStatisticsService;
import org.lamsfoundation.lams.usermanagement.Role;
+import org.lamsfoundation.lams.usermanagement.service.IUserManagementService;
+import org.lamsfoundation.lams.util.MessageService;
import org.lamsfoundation.lams.util.WebUtil;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.context.WebApplicationContext;
/**
* Gives the overall statistics for a LAMS server
@@ -47,26 +47,24 @@
@RequestMapping("/statistics")
public class StatisticsController {
- private static IStatisticsService statisticsService;
-
@Autowired
- private WebApplicationContext applicationContext;
+ private IStatisticsService statisticsService;
+ @Autowired
+ private IUserManagementService userManagementService;
+ @Autowired
+ @Qualifier("adminMessageService")
+ private MessageService messageService;
@RequestMapping(path = "/start")
public String unspecified(HttpServletRequest request) throws Exception {
// check permission
if (!request.isUserInRole(Role.SYSADMIN)) {
request.setAttribute("errorName", "StatisticsAction");
- request.setAttribute("errorMessage", AdminServiceProxy
- .getMessageService(applicationContext.getServletContext()).getMessage("error.authorisation"));
+ request.setAttribute("errorMessage", messageService.getMessage("error.authorisation"));
return "error";
}
- if (statisticsService == null) {
- statisticsService = AdminServiceProxy.getStatisticsService(applicationContext.getServletContext());
- }
-
StatisticsDTO stats = statisticsService.getOverallStatistics();
Map groupMap = statisticsService.getGroupMap();
@@ -84,15 +82,10 @@
// check permission
if (!request.isUserInRole(Role.SYSADMIN)) {
request.setAttribute("errorName", "StatisticsAction");
- request.setAttribute("errorMessage", AdminServiceProxy
- .getMessageService(applicationContext.getServletContext()).getMessage("error.authorisation"));
+ request.setAttribute("errorMessage", messageService.getMessage("error.authorisation"));
return "error";
}
- if (statisticsService == null) {
- statisticsService = AdminServiceProxy.getStatisticsService(applicationContext.getServletContext());
- }
-
GroupStatisticsDTO groupStats = statisticsService.getGroupStatisticsDTO(orgId);
request.setAttribute("groupStatisticsDTO", groupStats);
Index: lams_admin/src/java/org/lamsfoundation/lams/admin/web/controller/SysAdminStartController.java
===================================================================
diff -u -r62aaf160878735888d077bf28fac3c1989bb8fbd -rf2ad75cef0c507a64877942631fee13efbc6ed50
--- lams_admin/src/java/org/lamsfoundation/lams/admin/web/controller/SysAdminStartController.java (.../SysAdminStartController.java) (revision 62aaf160878735888d077bf28fac3c1989bb8fbd)
+++ lams_admin/src/java/org/lamsfoundation/lams/admin/web/controller/SysAdminStartController.java (.../SysAdminStartController.java) (revision f2ad75cef0c507a64877942631fee13efbc6ed50)
@@ -27,14 +27,14 @@
import javax.servlet.http.HttpServletRequest;
import org.lamsfoundation.lams.admin.AdminConstants;
-import org.lamsfoundation.lams.admin.service.AdminServiceProxy;
import org.lamsfoundation.lams.admin.web.dto.LinkBean;
import org.lamsfoundation.lams.usermanagement.Role;
import org.lamsfoundation.lams.usermanagement.service.IUserManagementService;
+import org.lamsfoundation.lams.util.MessageService;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.context.WebApplicationContext;
/**
* @author jliew
@@ -43,16 +43,14 @@
@Controller
public class SysAdminStartController {
- private static IUserManagementService service;
-
@Autowired
- private WebApplicationContext applicationContext;
+ private IUserManagementService userManagementService;
+ @Autowired
+ @Qualifier("adminMessageService")
+ private MessageService messageService;
@RequestMapping(path = "/sysadminstart")
public String execute(HttpServletRequest request) throws Exception {
-
- service = AdminServiceProxy.getService(applicationContext.getServletContext());
-
ArrayList
*
* @author Jacky Fang
- * @since 2005-4-7
- * @version 1.1
*/
@Controller
@RequestMapping("/gate")
public class GateController {
@Autowired
- @Qualifier("learnerService")
private ILearnerFullService learnerService;
-
@Autowired
private WebApplicationContext applicationContext;
// ---------------------------------------------------------------------
Index: lams_learning/src/java/org/lamsfoundation/lams/learning/web/controller/GroupingController.java
===================================================================
diff -u -r54007f98ca71e0073f19c5db78536437123287c6 -rf2ad75cef0c507a64877942631fee13efbc6ed50
--- lams_learning/src/java/org/lamsfoundation/lams/learning/web/controller/GroupingController.java (.../GroupingController.java) (revision 54007f98ca71e0073f19c5db78536437123287c6)
+++ lams_learning/src/java/org/lamsfoundation/lams/learning/web/controller/GroupingController.java (.../GroupingController.java) (revision f2ad75cef0c507a64877942631fee13efbc6ed50)
@@ -47,7 +47,6 @@
import org.lamsfoundation.lams.util.WebUtil;
import org.lamsfoundation.lams.web.util.AttributeNames;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
@@ -72,21 +71,13 @@
@Controller
@RequestMapping("/grouping")
public class GroupingController {
-
- /** Input parameter. Boolean value */
- public static final String PARAM_FORCE_GROUPING = "force";
-
- // ---------------------------------------------------------------------
- // Instance variables
- // ---------------------------------------------------------------------
private static Logger log = Logger.getLogger(GroupingController.class);
@Autowired
- @Qualifier("learnerService")
private ILearnerFullService learnerService;
-
@Autowired
private WebApplicationContext applicationContext;
+
// ---------------------------------------------------------------------
// Class level constants - Session Attributes
// ---------------------------------------------------------------------
@@ -96,10 +87,9 @@
public static final String TITLE = "title";
public static final String MAX_LEARNERS_PER_GROUP = "maxLearnersPerGroup";
public static final String VIEW_STUDENTS_BEFORE_SELECTION = "viewStudentsBeforeSelection";
+ /** Input parameter. Boolean value */
+ public static final String PARAM_FORCE_GROUPING = "force";
- // ---------------------------------------------------------------------
- // Struts Dispatch Method
- // ---------------------------------------------------------------------
/**
* Perform the grouping for the users who are currently running the lesson. If force is set to true, then we should
* be in preview mode, and we want to override the chosen grouping to make it group straight away.
Index: lams_learning/src/java/org/lamsfoundation/lams/learning/web/controller/LearnerController.java
===================================================================
diff -u -r62aaf160878735888d077bf28fac3c1989bb8fbd -rf2ad75cef0c507a64877942631fee13efbc6ed50
--- lams_learning/src/java/org/lamsfoundation/lams/learning/web/controller/LearnerController.java (.../LearnerController.java) (revision 62aaf160878735888d077bf28fac3c1989bb8fbd)
+++ lams_learning/src/java/org/lamsfoundation/lams/learning/web/controller/LearnerController.java (.../LearnerController.java) (revision f2ad75cef0c507a64877942631fee13efbc6ed50)
@@ -52,6 +52,8 @@
import org.lamsfoundation.lams.lesson.service.ILessonService;
import org.lamsfoundation.lams.monitoring.service.IMonitoringService;
import org.lamsfoundation.lams.tool.ToolSession;
+import org.lamsfoundation.lams.tool.service.ILamsCoreToolService;
+import org.lamsfoundation.lams.tool.service.ILamsToolService;
import org.lamsfoundation.lams.usermanagement.User;
import org.lamsfoundation.lams.usermanagement.dto.UserDTO;
import org.lamsfoundation.lams.usermanagement.service.IUserManagementService;
@@ -72,7 +74,6 @@
import com.fasterxml.jackson.databind.node.ObjectNode;
/**
- *
*
* The action servlet that interacts with learner to start a lams learner module, join a user to the lesson and allows a
* user to exit a lesson.
@@ -87,41 +88,27 @@
* features to solve duplicate submission problem.
*
* @author Jacky Fang
- * @since 3/03/2005
- * @version 1.1
*/
@Controller
@RequestMapping("/learner")
public class LearnerController {
- // ---------------------------------------------------------------------
- // Instance variables
- // ---------------------------------------------------------------------
private static Logger log = Logger.getLogger(LearnerController.class);
@Autowired
- @Qualifier("learnerService")
private ILearnerFullService learnerService;
-
@Autowired
- @Qualifier("userManagementService")
private IUserManagementService userManagementService;
-
@Autowired
- @Qualifier("gradebookService")
private IGradebookService gradebookService;
-
@Autowired
- @Qualifier("monitoringService")
private IMonitoringService monitoringService;
-
@Autowired
- @Qualifier("lessonService")
private ILessonService lessonService;
-
@Autowired
+ private ILamsToolService lamsToolService;
+ @Autowired
@Qualifier("learningMessageService")
private MessageService messageService;
-
@Autowired
private WebApplicationContext applicationContext;
@@ -134,10 +121,6 @@
"message.lesson.restart.button", "label.learner.progress.notebook", "button.exit",
"label.learner.progress.support", "label.my.progress" };
- // ---------------------------------------------------------------------
- // Class level constants - Struts forward
- // ---------------------------------------------------------------------
-
@RequestMapping("/redirectToURL")
@ResponseBody
private String redirectToURL(HttpServletResponse response, String url) throws IOException, ServletException {
@@ -185,8 +168,7 @@
// security check
Lesson lesson = learnerService.getLesson(lessonID);
- User user = (User) LearnerServiceProxy.getUserManagementService(applicationContext.getServletContext())
- .findById(User.class, learner);
+ User user = (User) userManagementService.findById(User.class, learner);
if ((lesson.getLessonClass() == null) || !lesson.getLessonClass().getLearners().contains(user)) {
request.setAttribute("messageKey",
"User " + user.getLogin() + " is not a learner in the requested lesson.");
@@ -295,8 +277,7 @@
if (lessonId == null) {
// depending on when this is called, there may only be a toolSessionId known, not the lessonId.
Long toolSessionId = WebUtil.readLongParam(request, AttributeNames.PARAM_TOOL_SESSION_ID);
- ToolSession toolSession = LearnerServiceProxy.getLamsToolService(applicationContext.getServletContext())
- .getToolSession(toolSessionId);
+ ToolSession toolSession = lamsToolService.getToolSession(toolSessionId);
lessonId = toolSession.getLesson().getLessonId();
}
@@ -434,13 +415,10 @@
private ObjectNode getProgressBarMessages() {
ObjectNode progressBarMessages = JsonNodeFactory.instance.objectNode();
- MessageService messageService = LearnerServiceProxy
- .getMonitoringMessageService(applicationContext.getServletContext());
for (String key : MONITOR_MESSAGE_KEYS) {
String value = messageService.getMessage(key);
progressBarMessages.put(key, value);
}
- messageService = LearnerServiceProxy.getMessageService(applicationContext.getServletContext());
for (String key : LEARNER_MESSAGE_KEYS) {
String value = messageService.getMessage(key);
progressBarMessages.put(key, value);
@@ -464,8 +442,7 @@
} else {
Long toolSessionId = WebUtil.readLongParam(request, AttributeNames.PARAM_TOOL_SESSION_ID);
- ToolSession toolSession = LearnerServiceProxy.getLamsToolService(applicationContext.getServletContext())
- .getToolSession(toolSessionId);
+ ToolSession toolSession = lamsToolService.getToolSession(toolSessionId);
lesson = toolSession.getLesson();
}
Index: lams_learning/src/java/org/lamsfoundation/lams/learning/web/controller/LessonCompleteActivityController.java
===================================================================
diff -u -r62aaf160878735888d077bf28fac3c1989bb8fbd -rf2ad75cef0c507a64877942631fee13efbc6ed50
--- lams_learning/src/java/org/lamsfoundation/lams/learning/web/controller/LessonCompleteActivityController.java (.../LessonCompleteActivityController.java) (revision 62aaf160878735888d077bf28fac3c1989bb8fbd)
+++ lams_learning/src/java/org/lamsfoundation/lams/learning/web/controller/LessonCompleteActivityController.java (.../LessonCompleteActivityController.java) (revision f2ad75cef0c507a64877942631fee13efbc6ed50)
@@ -28,18 +28,15 @@
import javax.servlet.http.HttpServletRequest;
-import org.lamsfoundation.lams.integration.service.IntegrationService;
+import org.lamsfoundation.lams.integration.service.IIntegrationService;
import org.lamsfoundation.lams.learning.service.ILearnerFullService;
import org.lamsfoundation.lams.learning.web.util.LearningWebUtil;
import org.lamsfoundation.lams.lesson.LearnerProgress;
import org.lamsfoundation.lams.lesson.Lesson;
import org.lamsfoundation.lams.lesson.service.ILessonService;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.context.WebApplicationContext;
-import org.springframework.web.context.support.WebApplicationContextUtils;
/**
* Action class run when the learner finishes a lesson.
@@ -50,19 +47,14 @@
public static final String RELEASED_LESSONS_REQUEST_ATTRIBUTE = "releasedLessons";
@Autowired
- @Qualifier("learnerService")
private ILearnerFullService learnerService;
@Autowired
- private static IntegrationService integrationService;
+ private IIntegrationService integrationService;
@Autowired
- @Qualifier("lessonService")
- private static ILessonService lessonService;
+ private ILessonService lessonService;
- @Autowired
- private WebApplicationContext applicationContext;
-
/**
* Gets an activity from the request (attribute) and forwards onto a display action using the ActionMappings class.
* If no activity is in request then use the current activity in learnerProgress.
@@ -72,7 +64,7 @@
public String execute(HttpServletRequest request) throws UnsupportedEncodingException {
LearnerProgress learnerProgress = LearningWebUtil.getLearnerProgress(request, learnerService);
Lesson lesson = learnerProgress.getLesson();
- Set releasedLessons = getLessonService().getReleasedSucceedingLessons(lesson.getLessonId(),
+ Set releasedLessons = lessonService.getReleasedSucceedingLessons(lesson.getLessonId(),
learnerProgress.getUser().getUserId());
if (!releasedLessons.isEmpty()) {
StringBuilder releasedLessonNames = new StringBuilder();
@@ -84,7 +76,7 @@
}
//checks for lessonFinishUrl parameter
- String lessonFinishCallbackUrl = getIntegrationService().getLessonFinishCallbackUrl(learnerProgress.getUser(),
+ String lessonFinishCallbackUrl = integrationService.getLessonFinishCallbackUrl(learnerProgress.getUser(),
lesson);
if (lessonFinishCallbackUrl != null) {
request.setAttribute("lessonFinishUrl", lessonFinishCallbackUrl);
@@ -94,21 +86,4 @@
return "lessonComplete";
}
-
- private IntegrationService getIntegrationService() {
- if (LessonCompleteActivityController.integrationService == null) {
- LessonCompleteActivityController.integrationService = (IntegrationService) WebApplicationContextUtils
- .getRequiredWebApplicationContext(applicationContext.getServletContext())
- .getBean("integrationService");
- }
- return LessonCompleteActivityController.integrationService;
- }
-
- private ILessonService getLessonService() {
- if (LessonCompleteActivityController.lessonService == null) {
- LessonCompleteActivityController.lessonService = (ILessonService) WebApplicationContextUtils
- .getRequiredWebApplicationContext(applicationContext.getServletContext()).getBean("lessonService");
- }
- return LessonCompleteActivityController.lessonService;
- }
}
\ No newline at end of file
Index: lams_learning/src/java/org/lamsfoundation/lams/learning/web/controller/LoadToolActivityController.java
===================================================================
diff -u -r62aaf160878735888d077bf28fac3c1989bb8fbd -rf2ad75cef0c507a64877942631fee13efbc6ed50
--- lams_learning/src/java/org/lamsfoundation/lams/learning/web/controller/LoadToolActivityController.java (.../LoadToolActivityController.java) (revision 62aaf160878735888d077bf28fac3c1989bb8fbd)
+++ lams_learning/src/java/org/lamsfoundation/lams/learning/web/controller/LoadToolActivityController.java (.../LoadToolActivityController.java) (revision f2ad75cef0c507a64877942631fee13efbc6ed50)
@@ -40,7 +40,6 @@
import org.lamsfoundation.lams.lesson.LearnerProgress;
import org.lamsfoundation.lams.tool.exception.RequiredGroupMissingException;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
@@ -53,12 +52,9 @@
*/
@Controller
public class LoadToolActivityController {
-
private static Logger log = Logger.getLogger(LoadToolActivityController.class);
@Autowired
- @Qualifier("learnerService")
private ILearnerFullService learnerService;
-
@Autowired
private WebApplicationContext applicationContext;
Index: lams_learning/src/java/org/lamsfoundation/lams/learning/web/controller/NotebookController.java
===================================================================
diff -u -r62aaf160878735888d077bf28fac3c1989bb8fbd -rf2ad75cef0c507a64877942631fee13efbc6ed50
--- lams_learning/src/java/org/lamsfoundation/lams/learning/web/controller/NotebookController.java (.../NotebookController.java) (revision 62aaf160878735888d077bf28fac3c1989bb8fbd)
+++ lams_learning/src/java/org/lamsfoundation/lams/learning/web/controller/NotebookController.java (.../NotebookController.java) (revision f2ad75cef0c507a64877942631fee13efbc6ed50)
@@ -31,7 +31,6 @@
import javax.servlet.http.HttpServletRequest;
import org.lamsfoundation.lams.learning.service.ILearnerFullService;
-import org.lamsfoundation.lams.learning.service.LearnerServiceProxy;
import org.lamsfoundation.lams.learning.web.form.NotebookForm;
import org.lamsfoundation.lams.learning.web.util.LearningWebUtil;
import org.lamsfoundation.lams.lesson.Lesson;
@@ -40,14 +39,13 @@
import org.lamsfoundation.lams.notebook.service.ICoreNotebookService;
import org.lamsfoundation.lams.usermanagement.User;
import org.lamsfoundation.lams.usermanagement.exception.UserAccessDeniedException;
+import org.lamsfoundation.lams.usermanagement.service.IUserManagementService;
import org.lamsfoundation.lams.util.WebUtil;
import org.lamsfoundation.lams.web.util.AttributeNames;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.context.WebApplicationContext;
/**
* @author M Seaton
@@ -56,15 +54,11 @@
@RequestMapping("/notebook")
public class NotebookController {
@Autowired
- @Qualifier("coreNotebookService")
- private ICoreNotebookService notebookService;
-
+ private ICoreNotebookService coreNotebookService;
@Autowired
- @Qualifier("learnerService")
private ILearnerFullService learnerService;
-
@Autowired
- private WebApplicationContext applicationContext;
+ private IUserManagementService userManagementService;
/**
* View all notebook entries
@@ -84,7 +78,7 @@
// get all notebook entries for the learner
- TreeMap> entries = notebookService.getEntryByLesson(learnerID,
+ TreeMap> entries = coreNotebookService.getEntryByLesson(learnerID,
CoreNotebookConstants.SCRATCH_PAD);
request.getSession().setAttribute("entries", entries.values());
@@ -103,8 +97,7 @@
// getting requested object according to coming parameters
Integer userID = LearningWebUtil.getUserId();
- User user = (User) LearnerServiceProxy.getUserManagementService(applicationContext.getServletContext())
- .findById(User.class, userID);
+ User user = (User) userManagementService.findById(User.class, userID);
// lesson service
Long lessonID = notebookForm.getLessonID();
@@ -156,7 +149,7 @@
return null;
}
- return notebookService.getEntry(lessonID, CoreNotebookConstants.SCRATCH_PAD, CoreNotebookConstants.JOURNAL_SIG);
+ return coreNotebookService.getEntry(lessonID, CoreNotebookConstants.SCRATCH_PAD, CoreNotebookConstants.JOURNAL_SIG);
}
@@ -171,12 +164,11 @@
Long currentLessonID = notebookForm.getCurrentLessonID();
String mode = WebUtil.readStrParam(request, "mode", true);
- NotebookEntry entry = notebookService.getEntry(uid);
+ NotebookEntry entry = coreNotebookService.getEntry(uid);
// getting requested object according to coming parameters
Integer userID = LearningWebUtil.getUserId();
- User user = (User) LearnerServiceProxy.getUserManagementService(applicationContext.getServletContext())
- .findById(User.class, userID);
+ User user = (User) userManagementService.findById(User.class, userID);
if (entry.getUser() != null && !entry.getUser().getUserId().equals(user.getUserId())) {
// wants to look at someone else's entry - check they are a teacher
@@ -220,7 +212,7 @@
String signature = notebookForm.getSignature();
Integer userID = LearningWebUtil.getUserId();
- notebookService.createNotebookEntry(id, CoreNotebookConstants.SCRATCH_PAD, signature, userID, title, entry);
+ coreNotebookService.createNotebookEntry(id, CoreNotebookConstants.SCRATCH_PAD, signature, userID, title, entry);
boolean skipViewAll = WebUtil.readBooleanParam(request, "skipViewAll", false);
return skipViewAll ? null : viewAll(notebookForm, request);
@@ -239,7 +231,7 @@
String signature = notebookForm.getSignature();
// get existing entry to edit
- NotebookEntry entryObj = notebookService.getEntry(uid);
+ NotebookEntry entryObj = coreNotebookService.getEntry(uid);
// check entry is being edited by it's owner
Integer userID = LearningWebUtil.getUserId();
@@ -252,7 +244,7 @@
entryObj.setEntry(entry);
entryObj.setExternalSignature(signature);
- notebookService.updateEntry(entryObj);
+ coreNotebookService.updateEntry(entryObj);
return viewAll(notebookForm, request);
Index: lams_learning/src/java/org/lamsfoundation/lams/learning/web/controller/SequenceActivityController.java
===================================================================
diff -u -r62aaf160878735888d077bf28fac3c1989bb8fbd -rf2ad75cef0c507a64877942631fee13efbc6ed50
--- lams_learning/src/java/org/lamsfoundation/lams/learning/web/controller/SequenceActivityController.java (.../SequenceActivityController.java) (revision 62aaf160878735888d077bf28fac3c1989bb8fbd)
+++ lams_learning/src/java/org/lamsfoundation/lams/learning/web/controller/SequenceActivityController.java (.../SequenceActivityController.java) (revision f2ad75cef0c507a64877942631fee13efbc6ed50)
@@ -38,7 +38,6 @@
import org.lamsfoundation.lams.learningdesign.SequenceActivity;
import org.lamsfoundation.lams.lesson.LearnerProgress;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.context.WebApplicationContext;
@@ -48,18 +47,12 @@
*
* Normally this will display the first activity inside a sequence activity. If there are no activities within the
* sequence activity then it will display an "empty" message.
- *
- *
- *
*/
@Controller
public class SequenceActivityController {
-
private static Logger log = Logger.getLogger(SequenceActivityController.class);
@Autowired
- @Qualifier("learnerService")
private ILearnerFullService learnerService;
-
@Autowired
private WebApplicationContext applicationContext;
Index: lams_learning/src/java/org/lamsfoundation/lams/learning/web/servlet/LogLessonMarkPushedToIntegrationsServlet.java
===================================================================
diff -u -r7e05bfe2c334b0b3224bbbdd3d6b7f10b383ee9f -rf2ad75cef0c507a64877942631fee13efbc6ed50
--- lams_learning/src/java/org/lamsfoundation/lams/learning/web/servlet/LogLessonMarkPushedToIntegrationsServlet.java (.../LogLessonMarkPushedToIntegrationsServlet.java) (revision 7e05bfe2c334b0b3224bbbdd3d6b7f10b383ee9f)
+++ lams_learning/src/java/org/lamsfoundation/lams/learning/web/servlet/LogLessonMarkPushedToIntegrationsServlet.java (.../LogLessonMarkPushedToIntegrationsServlet.java) (revision f2ad75cef0c507a64877942631fee13efbc6ed50)
@@ -25,6 +25,7 @@
import java.io.IOException;
import java.io.PrintWriter;
+import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
@@ -37,20 +38,25 @@
import org.lamsfoundation.lams.util.WebUtil;
import org.lamsfoundation.lams.web.session.SessionManager;
import org.lamsfoundation.lams.web.util.AttributeNames;
-import org.springframework.web.context.WebApplicationContext;
-import org.springframework.web.context.support.WebApplicationContextUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.context.support.SpringBeanAutowiringSupport;
@SuppressWarnings("serial")
public class LogLessonMarkPushedToIntegrationsServlet extends HttpServlet {
private static Logger log = Logger.getLogger(LogLessonMarkPushedToIntegrationsServlet.class);
- private static ILogEventService logEventService;
+ @Autowired
+ private ILogEventService logEventService;
+ /*
+ * Request Spring to lookup the applicationContext tied to the current ServletContext and inject service beans
+ * available in that applicationContext.
+ */
@Override
- public void init() throws ServletException {
- WebApplicationContext ctx = WebApplicationContextUtils.getRequiredWebApplicationContext(getServletContext());
- logEventService = (ILogEventService) ctx.getBean("logEventService");
+ public void init(ServletConfig config) throws ServletException {
+ super.init(config);
+ SpringBeanAutowiringSupport.processInjectionBasedOnServletContext(this, config.getServletContext());
}
@Override
Index: lams_learning/src/java/org/lamsfoundation/lams/learning/web/servlet/RepopulateProgressMarksServlet.java
===================================================================
diff -u -r62aaf160878735888d077bf28fac3c1989bb8fbd -rf2ad75cef0c507a64877942631fee13efbc6ed50
--- lams_learning/src/java/org/lamsfoundation/lams/learning/web/servlet/RepopulateProgressMarksServlet.java (.../RepopulateProgressMarksServlet.java) (revision 62aaf160878735888d077bf28fac3c1989bb8fbd)
+++ lams_learning/src/java/org/lamsfoundation/lams/learning/web/servlet/RepopulateProgressMarksServlet.java (.../RepopulateProgressMarksServlet.java) (revision f2ad75cef0c507a64877942631fee13efbc6ed50)
@@ -28,6 +28,7 @@
import java.util.ArrayList;
import java.util.Set;
+import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
@@ -52,24 +53,31 @@
import org.lamsfoundation.lams.util.WebUtil;
import org.lamsfoundation.lams.web.session.SessionManager;
import org.lamsfoundation.lams.web.util.AttributeNames;
+import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.context.WebApplicationContext;
+import org.springframework.web.context.support.SpringBeanAutowiringSupport;
import org.springframework.web.context.support.WebApplicationContextUtils;
@SuppressWarnings("serial")
public class RepopulateProgressMarksServlet extends HttpServlet {
private static Logger log = Logger.getLogger(RepopulateProgressMarksServlet.class);
- private static ILogEventService logEventService;
- private static ILessonService lessonService;
- private static ILearnerFullService learnerService;
+ @Autowired
+ private ILogEventService logEventService;
+ @Autowired
+ private ILessonService lessonService;
+ @Autowired
+ private ILearnerFullService learnerService;
+ /*
+ * Request Spring to lookup the applicationContext tied to the current ServletContext and inject service beans
+ * available in that applicationContext.
+ */
@Override
- public void init() throws ServletException {
- WebApplicationContext ctx = WebApplicationContextUtils.getRequiredWebApplicationContext(getServletContext());
- RepopulateProgressMarksServlet.logEventService = (ILogEventService) ctx.getBean("logEventService");
- RepopulateProgressMarksServlet.lessonService = (ILessonService) ctx.getBean("lessonService");
- RepopulateProgressMarksServlet.learnerService = (ILearnerFullService) ctx.getBean("learnerService");
+ public void init(ServletConfig config) throws ServletException {
+ super.init(config);
+ SpringBeanAutowiringSupport.processInjectionBasedOnServletContext(this, config.getServletContext());
}
@Override
Index: lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/ComplexLearnerProgressController.java
===================================================================
diff -u -r62aaf160878735888d077bf28fac3c1989bb8fbd -rf2ad75cef0c507a64877942631fee13efbc6ed50
--- lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/ComplexLearnerProgressController.java (.../ComplexLearnerProgressController.java) (revision 62aaf160878735888d077bf28fac3c1989bb8fbd)
+++ lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/ComplexLearnerProgressController.java (.../ComplexLearnerProgressController.java) (revision f2ad75cef0c507a64877942631fee13efbc6ed50)
@@ -48,7 +48,6 @@
import org.lamsfoundation.lams.web.session.SessionManager;
import org.lamsfoundation.lams.web.util.AttributeNames;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@@ -57,11 +56,9 @@
*/
@Controller
public class ComplexLearnerProgressController {
-
private static Logger log = Logger.getLogger(ComplexLearnerProgressController.class);
@Autowired
- @Qualifier("monitoringService")
private IMonitoringFullService monitoringService;
@RequestMapping("/complexProgress")
Index: lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/EmailNotificationsController.java
===================================================================
diff -u -r62aaf160878735888d077bf28fac3c1989bb8fbd -rf2ad75cef0c507a64877942631fee13efbc6ed50
--- lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/EmailNotificationsController.java (.../EmailNotificationsController.java) (revision 62aaf160878735888d077bf28fac3c1989bb8fbd)
+++ lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/EmailNotificationsController.java (.../EmailNotificationsController.java) (revision f2ad75cef0c507a64877942631fee13efbc6ed50)
@@ -81,7 +81,6 @@
import org.quartz.TriggerKey;
import org.quartz.impl.matchers.GroupMatcher;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.util.Assert;
import org.springframework.web.bind.annotation.RequestMapping;
@@ -112,28 +111,20 @@
private static final String JOB_PREFIX_NAME = "emailScheduleMessageJob:";
@Autowired
- @Qualifier("eventNotificationService")
private IEventNotificationService eventNotificationService;
@Autowired
- @Qualifier("userManagementService")
private IUserManagementService userManagementService;
@Autowired
- @Qualifier("logEventService")
private ILogEventService logEventService;
@Autowired
- @Qualifier("securityService")
private ISecurityService securityService;
@Autowired
- @Qualifier("lessonService")
private ILessonService lessonService;
@Autowired
- @Qualifier("monitoringService")
private IMonitoringFullService monitoringService;
@Autowired
- @Qualifier("scheduler")
private Scheduler scheduler;
@Autowired
- @Qualifier("learnerService")
private ILearnerService learnerService;
/**
Index: lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/EmailProgressController.java
===================================================================
diff -u -r62aaf160878735888d077bf28fac3c1989bb8fbd -rf2ad75cef0c507a64877942631fee13efbc6ed50
--- lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/EmailProgressController.java (.../EmailProgressController.java) (revision 62aaf160878735888d077bf28fac3c1989bb8fbd)
+++ lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/EmailProgressController.java (.../EmailProgressController.java) (revision f2ad75cef0c507a64877942631fee13efbc6ed50)
@@ -55,7 +55,6 @@
import org.quartz.TriggerKey;
import org.quartz.impl.matchers.GroupMatcher;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
@@ -70,21 +69,17 @@
@Controller
@RequestMapping("/emailProgress")
public class EmailProgressController {
+ private static Logger log = Logger.getLogger(EmailNotificationsController.class);
+
@Autowired
- @Qualifier("monitoringService")
private IMonitoringFullService monitoringService;
@Autowired
- @Qualifier("eventNotificationService")
private IEventNotificationService eventNotificationService;
@Autowired
- @Qualifier("securityService")
private ISecurityService securityService;
@Autowired
- @Qualifier("scheduler")
private Scheduler scheduler;
- private static Logger log = Logger.getLogger(EmailNotificationsController.class);
-
// ---------------------------------------------------------------------
// Class level constants
// ---------------------------------------------------------------------
Index: lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/GateController.java
===================================================================
diff -u -r62aaf160878735888d077bf28fac3c1989bb8fbd -rf2ad75cef0c507a64877942631fee13efbc6ed50
--- lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/GateController.java (.../GateController.java) (revision 62aaf160878735888d077bf28fac3c1989bb8fbd)
+++ lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/GateController.java (.../GateController.java) (revision f2ad75cef0c507a64877942631fee13efbc6ed50)
@@ -56,7 +56,6 @@
import org.lamsfoundation.lams.web.session.SessionManager;
import org.lamsfoundation.lams.web.util.AttributeNames;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
@@ -84,20 +83,15 @@
@RequestMapping("/gate")
public class GateController {
+ private static final DateFormat SCHEDULING_DATETIME_FORMAT = new SimpleDateFormat("MM/dd/yy HH:mm");
+
@Autowired
- @Qualifier("monitoringService")
private IMonitoringFullService monitoringService;
-
@Autowired
- @Qualifier("learnerService")
private ILearnerService learnerService;
-
@Autowired
- @Qualifier("lessonService")
private ILessonService lessonService;
- private static final DateFormat SCHEDULING_DATETIME_FORMAT = new SimpleDateFormat("MM/dd/yy HH:mm");
-
// ---------------------------------------------------------------------
// Method
// ---------------------------------------------------------------------
Index: lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/GroupingAJAXController.java
===================================================================
diff -u -rcb2cfe5b40c7aee12c9e500ee7800b5fa679821f -rf2ad75cef0c507a64877942631fee13efbc6ed50
--- lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/GroupingAJAXController.java (.../GroupingAJAXController.java) (revision cb2cfe5b40c7aee12c9e500ee7800b5fa679821f)
+++ lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/GroupingAJAXController.java (.../GroupingAJAXController.java) (revision f2ad75cef0c507a64877942631fee13efbc6ed50)
@@ -60,7 +60,6 @@
import org.lamsfoundation.lams.web.session.SessionManager;
import org.lamsfoundation.lams.web.util.AttributeNames;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
@@ -80,19 +79,15 @@
@Controller
@RequestMapping("/grouping")
public class GroupingAJAXController {
+ private static Logger log = Logger.getLogger(GroupingAJAXController.class);
@Autowired
- @Qualifier("monitoringService")
private IMonitoringFullService monitoringService;
@Autowired
- @Qualifier("securityService")
private ISecurityService securityService;
@Autowired
- @Qualifier("userManagementService")
private IUserManagementService userManagementService;
- private static Logger log = Logger.getLogger(GroupingAJAXController.class);
-
// ---------------------------------------------------------------------
private static final String CHOSEN_GROUPING_SCREEN = "chosenGrouping";
Index: lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/GroupingUploadAJAXController.java
===================================================================
diff -u -rcb2cfe5b40c7aee12c9e500ee7800b5fa679821f -rf2ad75cef0c507a64877942631fee13efbc6ed50
--- lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/GroupingUploadAJAXController.java (.../GroupingUploadAJAXController.java) (revision cb2cfe5b40c7aee12c9e500ee7800b5fa679821f)
+++ lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/GroupingUploadAJAXController.java (.../GroupingUploadAJAXController.java) (revision f2ad75cef0c507a64877942631fee13efbc6ed50)
@@ -94,21 +94,15 @@
@Controller
@RequestMapping("/groupingUpload")
public class GroupingUploadAJAXController {
-
private static Logger log = Logger.getLogger(GroupingUploadAJAXController.class);
@Autowired
- @Qualifier("monitoringService")
private IMonitoringFullService monitoringService;
-
@Autowired
- @Qualifier("userManagementService")
private IUserManagementService userManagementService;
@Autowired
- @Qualifier("lessonService")
private ILessonService lessonService;
@Autowired
- @Qualifier("securityService")
private ISecurityService securityService;
@Autowired
@Qualifier("centralMessageService")
Index: lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/MonitoringController.java
===================================================================
diff -u -rd635e725776fa9c7344e16d4ff83e8c562997663 -rf2ad75cef0c507a64877942631fee13efbc6ed50
--- lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/MonitoringController.java (.../MonitoringController.java) (revision d635e725776fa9c7344e16d4ff83e8c562997663)
+++ lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/MonitoringController.java (.../MonitoringController.java) (revision f2ad75cef0c507a64877942631fee13efbc6ed50)
@@ -113,46 +113,32 @@
@Controller
@RequestMapping("/monitoring")
public class MonitoringController {
-
- @Autowired
- private WebApplicationContext applicationContext;
-
private static Logger log = Logger.getLogger(MonitoringController.class);
- // ---------------------------------------------------------------------
- // Class level constants - Struts forward
- // ---------------------------------------------------------------------
private static final DateFormat LESSON_SCHEDULING_DATETIME_FORMAT = new SimpleDateFormat("MM/dd/yy HH:mm");
private static final int LATEST_LEARNER_PROGRESS_LESSON_DISPLAY_LIMIT = 53;
private static final int LATEST_LEARNER_PROGRESS_ACTIVITY_DISPLAY_LIMIT = 7;
private static final int USER_PAGE_SIZE = 10;
+
@Autowired
- @Qualifier("logEventService")
private ILogEventService logEventService;
@Autowired
- @Qualifier("lessonService")
private ILessonService lessonService;
@Autowired
- @Qualifier("securityService")
private ISecurityService securityService;
@Autowired
- @Qualifier("monitoringService")
private IMonitoringFullService monitoringService;
@Autowired
- @Qualifier("userManagementService")
private IUserManagementService userManagementService;
@Autowired
- @Qualifier("learnerService")
private ILearnerService learnerService;
@Autowired
- @Qualifier("lamsToolService")
- private ILamsToolService toolService;
+ private ILamsToolService lamsToolService;
@Autowired
@Qualifier("monitoringMessageService")
private MessageService messageService;
@Autowired
- @Qualifier("authoringService")
private IAuthoringService authoringService;
private Integer getUserId() {
@@ -1280,7 +1266,7 @@
ToolActivity toolActivity = (ToolActivity) activity;
if (ILamsToolService.LEADER_SELECTION_TOOL_SIGNATURE
.equals(toolActivity.getTool().getToolSignature())) {
- leaders.addAll(toolService.getLeaderUserId(activity.getActivityId()));
+ leaders.addAll(lamsToolService.getLeaderUserId(activity.getActivityId()));
}
}
}
Index: lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/SequenceController.java
===================================================================
diff -u -r62aaf160878735888d077bf28fac3c1989bb8fbd -rf2ad75cef0c507a64877942631fee13efbc6ed50
--- lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/SequenceController.java (.../SequenceController.java) (revision 62aaf160878735888d077bf28fac3c1989bb8fbd)
+++ lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/SequenceController.java (.../SequenceController.java) (revision f2ad75cef0c507a64877942631fee13efbc6ed50)
@@ -37,24 +37,19 @@
import org.lamsfoundation.lams.util.WebUtil;
import org.lamsfoundation.lams.web.util.AttributeNames;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
/**
* The action servlet that provides the support for the Sequence activities. At present, this is only a basic view
* screen that lists the user's in the sequence.
*
- *
- *
- *
* @author Fiona Malikoff
*/
@Controller
public class SequenceController {
@Autowired
- @Qualifier("monitoringService")
private IMonitoringFullService monitoringService;
public static final String VIEW_SEQUENCE = "viewSequence";
Index: lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/TblMonitoringController.java
===================================================================
diff -u -r62aaf160878735888d077bf28fac3c1989bb8fbd -rf2ad75cef0c507a64877942631fee13efbc6ed50
--- lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/TblMonitoringController.java (.../TblMonitoringController.java) (revision 62aaf160878735888d077bf28fac3c1989bb8fbd)
+++ lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/TblMonitoringController.java (.../TblMonitoringController.java) (revision f2ad75cef0c507a64877942631fee13efbc6ed50)
@@ -42,7 +42,6 @@
import org.lamsfoundation.lams.util.WebUtil;
import org.lamsfoundation.lams.web.util.AttributeNames;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@@ -57,19 +56,14 @@
private static Logger log = Logger.getLogger(TblMonitoringController.class);
@Autowired
- @Qualifier("lessonService")
private ILessonService lessonService;
@Autowired
- @Qualifier("monitoringService")
private IMonitoringFullService monitoringService;
@Autowired
- @Qualifier("lamsToolService")
- private ILamsToolService toolService;
+ private ILamsToolService lamsToolService;
@Autowired
- @Qualifier("activityDAO")
private IActivityDAO activityDAO;
@Autowired
- @Qualifier("gradebookService")
private IGradebookService gradebookService;
/**
@@ -122,7 +116,7 @@
}
Set leaderUserIds = leaderselectionToolActivityId == null ? new HashSet<>()
- : toolService.getLeaderUserId(leaderselectionToolActivityId);
+ : lamsToolService.getLeaderUserId(leaderselectionToolActivityId);
GroupingActivity groupingActivity = getGroupingActivity(lesson);
Grouping grouping = groupingActivity == null ? null : groupingActivity.getCreateGrouping();
Index: lams_tool_bbb/src/java/org/lamsfoundation/lams/tool/bbb/web/controller/LearningController.java
===================================================================
diff -u -r910f7a30fc4dc1b47e8b3e2df5927c64df977a45 -rf2ad75cef0c507a64877942631fee13efbc6ed50
--- lams_tool_bbb/src/java/org/lamsfoundation/lams/tool/bbb/web/controller/LearningController.java (.../LearningController.java) (revision 910f7a30fc4dc1b47e8b3e2df5927c64df977a45)
+++ lams_tool_bbb/src/java/org/lamsfoundation/lams/tool/bbb/web/controller/LearningController.java (.../LearningController.java) (revision f2ad75cef0c507a64877942631fee13efbc6ed50)
@@ -33,7 +33,6 @@
import org.lamsfoundation.lams.web.session.SessionManager;
import org.lamsfoundation.lams.web.util.AttributeNames;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@@ -42,16 +41,15 @@
public class LearningController {
@Autowired
- @Qualifier("lamsToolService")
- private ILamsToolService toolService;
+ private ILamsToolService lamsToolService;
@RequestMapping("")
public String execute(HttpServletRequest request) {
HttpSession ss = SessionManager.getSession();
UserDTO user = (UserDTO) ss.getAttribute(AttributeNames.USER);
long toolSessionId = WebUtil.readLongParam(request, AttributeNames.PARAM_TOOL_SESSION_ID);
- String finishURL = toolService.completeToolSession(toolSessionId, user.getUserID().longValue());
+ String finishURL = lamsToolService.completeToolSession(toolSessionId, user.getUserID().longValue());
return "redirect:" + finishURL;
}
}
\ No newline at end of file
Index: lams_tool_chat/src/java/org/lamsfoundation/lams/tool/chat/web/controller/AuthoringChatConditionController.java
===================================================================
diff -u -r903574fa3e87a5a85057a975acfe6ccfba0b9de0 -rf2ad75cef0c507a64877942631fee13efbc6ed50
--- lams_tool_chat/src/java/org/lamsfoundation/lams/tool/chat/web/controller/AuthoringChatConditionController.java (.../AuthoringChatConditionController.java) (revision 903574fa3e87a5a85057a975acfe6ccfba0b9de0)
+++ lams_tool_chat/src/java/org/lamsfoundation/lams/tool/chat/web/controller/AuthoringChatConditionController.java (.../AuthoringChatConditionController.java) (revision f2ad75cef0c507a64877942631fee13efbc6ed50)
@@ -61,7 +61,6 @@
public class AuthoringChatConditionController {
@Autowired
- @Qualifier("chatService")
private IChatService chatService;
@Autowired
Index: lams_tool_chat/src/java/org/lamsfoundation/lams/tool/chat/web/controller/AuthoringController.java
===================================================================
diff -u -r62aaf160878735888d077bf28fac3c1989bb8fbd -rf2ad75cef0c507a64877942631fee13efbc6ed50
--- lams_tool_chat/src/java/org/lamsfoundation/lams/tool/chat/web/controller/AuthoringController.java (.../AuthoringController.java) (revision 62aaf160878735888d077bf28fac3c1989bb8fbd)
+++ lams_tool_chat/src/java/org/lamsfoundation/lams/tool/chat/web/controller/AuthoringController.java (.../AuthoringController.java) (revision f2ad75cef0c507a64877942631fee13efbc6ed50)
@@ -50,16 +50,13 @@
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
-/**
- */
@Controller
@RequestMapping("/authoring")
public class AuthoringController {
private static Logger logger = Logger.getLogger(AuthoringController.class);
@Autowired
- @Qualifier("chatService")
private IChatService chatService;
@Autowired
Index: lams_tool_chat/src/java/org/lamsfoundation/lams/tool/chat/web/controller/LearningController.java
===================================================================
diff -u -r62aaf160878735888d077bf28fac3c1989bb8fbd -rf2ad75cef0c507a64877942631fee13efbc6ed50
--- lams_tool_chat/src/java/org/lamsfoundation/lams/tool/chat/web/controller/LearningController.java (.../LearningController.java) (revision 62aaf160878735888d077bf28fac3c1989bb8fbd)
+++ lams_tool_chat/src/java/org/lamsfoundation/lams/tool/chat/web/controller/LearningController.java (.../LearningController.java) (revision f2ad75cef0c507a64877942631fee13efbc6ed50)
@@ -68,7 +68,6 @@
private static Logger log = Logger.getLogger(LearningController.class);
@Autowired
- @Qualifier("chatService")
private IChatService chatService;
@Autowired
Index: lams_tool_chat/src/java/org/lamsfoundation/lams/tool/chat/web/controller/MonitoringController.java
===================================================================
diff -u -rf23f6693e999a16730433009b95264fa8af9e1a8 -rf2ad75cef0c507a64877942631fee13efbc6ed50
--- lams_tool_chat/src/java/org/lamsfoundation/lams/tool/chat/web/controller/MonitoringController.java (.../MonitoringController.java) (revision f23f6693e999a16730433009b95264fa8af9e1a8)
+++ lams_tool_chat/src/java/org/lamsfoundation/lams/tool/chat/web/controller/MonitoringController.java (.../MonitoringController.java) (revision f2ad75cef0c507a64877942631fee13efbc6ed50)
@@ -62,27 +62,13 @@
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.context.WebApplicationContext;
-/**
- * @author
- * @version
- *
- *
- *
- *
- *
- *
- *
- *
- *
- */
@Controller
@RequestMapping("/monitoring")
public class MonitoringController {
private static Logger log = Logger.getLogger(MonitoringController.class);
@Autowired
- @Qualifier("chatService")
private IChatService chatService;
@Autowired
Index: lams_tool_chat/src/java/org/lamsfoundation/lams/tool/chat/web/controller/PedagogicalPlannerController.java
===================================================================
diff -u -r903574fa3e87a5a85057a975acfe6ccfba0b9de0 -rf2ad75cef0c507a64877942631fee13efbc6ed50
--- lams_tool_chat/src/java/org/lamsfoundation/lams/tool/chat/web/controller/PedagogicalPlannerController.java (.../PedagogicalPlannerController.java) (revision 903574fa3e87a5a85057a975acfe6ccfba0b9de0)
+++ lams_tool_chat/src/java/org/lamsfoundation/lams/tool/chat/web/controller/PedagogicalPlannerController.java (.../PedagogicalPlannerController.java) (revision f2ad75cef0c507a64877942631fee13efbc6ed50)
@@ -42,23 +42,13 @@
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
-/**
- * @author
- * @version
- *
- *
- *
- *
- *
- */
@Controller
@RequestMapping("/pedagogicalPlanner")
public class PedagogicalPlannerController {
private static Logger logger = Logger.getLogger(PedagogicalPlannerController.class);
@Autowired
- @Qualifier("chatService")
private IChatService chatService;
@Autowired
Index: lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/web/controller/AuthoringController.java
===================================================================
diff -u -r62aaf160878735888d077bf28fac3c1989bb8fbd -rf2ad75cef0c507a64877942631fee13efbc6ed50
--- lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/web/controller/AuthoringController.java (.../AuthoringController.java) (revision 62aaf160878735888d077bf28fac3c1989bb8fbd)
+++ lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/web/controller/AuthoringController.java (.../AuthoringController.java) (revision f2ad75cef0c507a64877942631fee13efbc6ed50)
@@ -82,7 +82,6 @@
private static Logger log = Logger.getLogger(AuthoringController.class);
@Autowired
- @Qualifier("dacoService")
private IDacoService dacoService;
@Autowired
Index: lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/web/controller/LearningController.java
===================================================================
diff -u -r7922cb321641adb3b2357e46e800b4ac21b36f14 -rf2ad75cef0c507a64877942631fee13efbc6ed50
--- lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/web/controller/LearningController.java (.../LearningController.java) (revision 7922cb321641adb3b2357e46e800b4ac21b36f14)
+++ lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/web/controller/LearningController.java (.../LearningController.java) (revision f2ad75cef0c507a64877942631fee13efbc6ed50)
@@ -80,8 +80,6 @@
/**
*
* @author Marcin Cieslak
- *
- * @version $Revision$
*/
@Controller
@RequestMapping("/learning")
@@ -93,7 +91,6 @@
private WebApplicationContext applicationContext;
@Autowired
- @Qualifier("dacoService")
private IDacoService dacoService;
@Autowired
Index: lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/web/controller/MonitoringController.java
===================================================================
diff -u -r62aaf160878735888d077bf28fac3c1989bb8fbd -rf2ad75cef0c507a64877942631fee13efbc6ed50
--- lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/web/controller/MonitoringController.java (.../MonitoringController.java) (revision 62aaf160878735888d077bf28fac3c1989bb8fbd)
+++ lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/web/controller/MonitoringController.java (.../MonitoringController.java) (revision f2ad75cef0c507a64877942631fee13efbc6ed50)
@@ -62,7 +62,6 @@
import org.lamsfoundation.lams.web.util.AttributeNames;
import org.lamsfoundation.lams.web.util.SessionMap;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
@@ -78,7 +77,6 @@
public static Logger log = Logger.getLogger(MonitoringController.class);
@Autowired
- @Qualifier("dacoService")
private IDacoService dacoService;
@RequestMapping("/listRecords")
Index: lams_tool_dimdim/src/java/org/lamsfoundation/lams/tool/dimdim/web/controller/LearningController.java
===================================================================
diff -u -r62aaf160878735888d077bf28fac3c1989bb8fbd -rf2ad75cef0c507a64877942631fee13efbc6ed50
--- lams_tool_dimdim/src/java/org/lamsfoundation/lams/tool/dimdim/web/controller/LearningController.java (.../LearningController.java) (revision 62aaf160878735888d077bf28fac3c1989bb8fbd)
+++ lams_tool_dimdim/src/java/org/lamsfoundation/lams/tool/dimdim/web/controller/LearningController.java (.../LearningController.java) (revision f2ad75cef0c507a64877942631fee13efbc6ed50)
@@ -33,7 +33,6 @@
import org.lamsfoundation.lams.web.session.SessionManager;
import org.lamsfoundation.lams.web.util.AttributeNames;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@@ -42,16 +41,15 @@
public class LearningController {
@Autowired
- @Qualifier("lamsToolService")
- private ILamsToolService toolService;
+ private ILamsToolService lamsToolService;
@RequestMapping("")
public String execute(HttpServletRequest request) {
HttpSession ss = SessionManager.getSession();
UserDTO user = (UserDTO) ss.getAttribute(AttributeNames.USER);
long toolSessionId = WebUtil.readLongParam(request, AttributeNames.PARAM_TOOL_SESSION_ID);
- String finishURL = toolService.completeToolSession(toolSessionId, user.getUserID().longValue());
+ String finishURL = lamsToolService.completeToolSession(toolSessionId, user.getUserID().longValue());
return "redirect:" + finishURL;
}
}
\ No newline at end of file
Index: lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/web/controller/AdminController.java
===================================================================
diff -u -r1cef918442124e8d987a285095a7504e3bc00461 -rf2ad75cef0c507a64877942631fee13efbc6ed50
--- lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/web/controller/AdminController.java (.../AdminController.java) (revision 1cef918442124e8d987a285095a7504e3bc00461)
+++ lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/web/controller/AdminController.java (.../AdminController.java) (revision f2ad75cef0c507a64877942631fee13efbc6ed50)
@@ -6,7 +6,6 @@
import org.lamsfoundation.lams.tool.dokumaran.service.IDokumaranService;
import org.lamsfoundation.lams.tool.dokumaran.web.form.AdminForm;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
@@ -19,7 +18,6 @@
public class AdminController {
@Autowired
- @Qualifier("dokumaranService")
private IDokumaranService dokumaranService;
@RequestMapping("")
Index: lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/web/controller/AuthoringController.java
===================================================================
diff -u -r62aaf160878735888d077bf28fac3c1989bb8fbd -rf2ad75cef0c507a64877942631fee13efbc6ed50
--- lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/web/controller/AuthoringController.java (.../AuthoringController.java) (revision 62aaf160878735888d077bf28fac3c1989bb8fbd)
+++ lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/web/controller/AuthoringController.java (.../AuthoringController.java) (revision f2ad75cef0c507a64877942631fee13efbc6ed50)
@@ -45,7 +45,6 @@
import org.lamsfoundation.lams.web.util.AttributeNames;
import org.lamsfoundation.lams.web.util.SessionMap;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
@@ -60,7 +59,6 @@
private static Logger log = Logger.getLogger(AuthoringController.class);
@Autowired
- @Qualifier("dokumaranService")
private IDokumaranService dokumaranService;
/**
Index: lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/web/controller/LearningController.java
===================================================================
diff -u -r1061286825c95ff76c63c5f081be60e88a8a1da2 -rf2ad75cef0c507a64877942631fee13efbc6ed50
--- lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/web/controller/LearningController.java (.../LearningController.java) (revision 1061286825c95ff76c63c5f081be60e88a8a1da2)
+++ lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/web/controller/LearningController.java (.../LearningController.java) (revision f2ad75cef0c507a64877942631fee13efbc6ed50)
@@ -55,7 +55,6 @@
import org.lamsfoundation.lams.web.util.AttributeNames;
import org.lamsfoundation.lams.web.util.SessionMap;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
@@ -74,7 +73,6 @@
private static Logger log = Logger.getLogger(LearningController.class);
@Autowired
- @Qualifier("dokumaranService")
private IDokumaranService dokumaranService;
@Autowired
Index: lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/web/controller/MonitoringController.java
===================================================================
diff -u -r58e32af997a2da8fc96806124b29fc68fdefb149 -rf2ad75cef0c507a64877942631fee13efbc6ed50
--- lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/web/controller/MonitoringController.java (.../MonitoringController.java) (revision 58e32af997a2da8fc96806124b29fc68fdefb149)
+++ lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/web/controller/MonitoringController.java (.../MonitoringController.java) (revision f2ad75cef0c507a64877942631fee13efbc6ed50)
@@ -49,7 +49,6 @@
import org.lamsfoundation.lams.web.util.AttributeNames;
import org.lamsfoundation.lams.web.util.SessionMap;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@@ -60,7 +59,6 @@
public static Logger log = Logger.getLogger(MonitoringController.class);
@Autowired
- @Qualifier("dokumaranService")
private IDokumaranService dokumaranService;
@RequestMapping("/summary")
Index: lams_tool_eadventure/src/java/org/eucm/lams/tool/eadventure/web/controller/LearningController.java
===================================================================
diff -u -r62aaf160878735888d077bf28fac3c1989bb8fbd -rf2ad75cef0c507a64877942631fee13efbc6ed50
--- lams_tool_eadventure/src/java/org/eucm/lams/tool/eadventure/web/controller/LearningController.java (.../LearningController.java) (revision 62aaf160878735888d077bf28fac3c1989bb8fbd)
+++ lams_tool_eadventure/src/java/org/eucm/lams/tool/eadventure/web/controller/LearningController.java (.../LearningController.java) (revision f2ad75cef0c507a64877942631fee13efbc6ed50)
@@ -33,7 +33,6 @@
import org.lamsfoundation.lams.web.session.SessionManager;
import org.lamsfoundation.lams.web.util.AttributeNames;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@@ -42,16 +41,15 @@
public class LearningController {
@Autowired
- @Qualifier("lamsToolService")
- private ILamsToolService toolService;
+ private ILamsToolService lamsToolService;
@RequestMapping("/start")
public String execute(HttpServletRequest request) {
HttpSession ss = SessionManager.getSession();
UserDTO user = (UserDTO) ss.getAttribute(AttributeNames.USER);
long toolSessionId = WebUtil.readLongParam(request, AttributeNames.PARAM_TOOL_SESSION_ID);
- String finishURL = toolService.completeToolSession(toolSessionId, user.getUserID().longValue());
+ String finishURL = lamsToolService.completeToolSession(toolSessionId, user.getUserID().longValue());
return "redirect:" + finishURL;
}
}
\ No newline at end of file
Index: lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/web/controller/AdminController.java
===================================================================
diff -u -r39e351aeeadf3d0973293c74f0c89432a954d2e8 -rf2ad75cef0c507a64877942631fee13efbc6ed50
--- lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/web/controller/AdminController.java (.../AdminController.java) (revision 39e351aeeadf3d0973293c74f0c89432a954d2e8)
+++ lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/web/controller/AdminController.java (.../AdminController.java) (revision f2ad75cef0c507a64877942631fee13efbc6ed50)
@@ -28,7 +28,6 @@
import org.lamsfoundation.lams.tool.forum.service.IForumService;
import org.lamsfoundation.lams.tool.forum.web.forms.AdminForm;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
@@ -41,7 +40,6 @@
public class AdminController {
@Autowired
- @Qualifier("forumService")
private IForumService forumService;
@RequestMapping("/start")
Index: lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/web/controller/AuthoringConditionController.java
===================================================================
diff -u -rf32bc3c30b8ea0463d84b4dbdc112f77a400297a -rf2ad75cef0c507a64877942631fee13efbc6ed50
--- lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/web/controller/AuthoringConditionController.java (.../AuthoringConditionController.java) (revision f32bc3c30b8ea0463d84b4dbdc112f77a400297a)
+++ lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/web/controller/AuthoringConditionController.java (.../AuthoringConditionController.java) (revision f2ad75cef0c507a64877942631fee13efbc6ed50)
@@ -67,7 +67,6 @@
public class AuthoringConditionController {
@Autowired
- @Qualifier("forumService")
private IForumService forumService;
@Autowired
Index: lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/web/controller/AuthoringController.java
===================================================================
diff -u -rbda120a45147297c8a6652f5bb0378aabd1ed79b -rf2ad75cef0c507a64877942631fee13efbc6ed50
--- lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/web/controller/AuthoringController.java (.../AuthoringController.java) (revision bda120a45147297c8a6652f5bb0378aabd1ed79b)
+++ lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/web/controller/AuthoringController.java (.../AuthoringController.java) (revision f2ad75cef0c507a64877942631fee13efbc6ed50)
@@ -87,16 +87,12 @@
private static Logger log = Logger.getLogger(AuthoringController.class);
@Autowired
- @Qualifier("forumService")
private IForumService forumService;
@Autowired
@Qualifier("forumMessageService")
private MessageService messageService;
- @Autowired
- private WebApplicationContext applicationContext;
-
// ******************************************************************************************************************
// Forum Author functions
// ******************************************************************************************************************
Index: lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/web/controller/LearningController.java
===================================================================
diff -u -rbda120a45147297c8a6652f5bb0378aabd1ed79b -rf2ad75cef0c507a64877942631fee13efbc6ed50
--- lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/web/controller/LearningController.java (.../LearningController.java) (revision bda120a45147297c8a6652f5bb0378aabd1ed79b)
+++ lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/web/controller/LearningController.java (.../LearningController.java) (revision f2ad75cef0c507a64877942631fee13efbc6ed50)
@@ -96,7 +96,6 @@
private static final boolean MODE_OPTIONAL = false;
@Autowired
- @Qualifier("forumService")
private IForumService forumService;
@Autowired
Index: lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/web/controller/MonitoringController.java
===================================================================
diff -u -r62aaf160878735888d077bf28fac3c1989bb8fbd -rf2ad75cef0c507a64877942631fee13efbc6ed50
--- lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/web/controller/MonitoringController.java (.../MonitoringController.java) (revision 62aaf160878735888d077bf28fac3c1989bb8fbd)
+++ lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/web/controller/MonitoringController.java (.../MonitoringController.java) (revision f2ad75cef0c507a64877942631fee13efbc6ed50)
@@ -94,7 +94,6 @@
private static Logger log = Logger.getLogger(MonitoringController.class);
@Autowired
- @Qualifier("forumService")
private IForumService forumService;
@Autowired
Index: lams_tool_imscc/src/java/org/lamsfoundation/lams/tool/commonCartridge/web/controller/AdminController.java
===================================================================
diff -u -r1d6eef003bf303f75c5405b66a13ac86232cec03 -rf2ad75cef0c507a64877942631fee13efbc6ed50
--- lams_tool_imscc/src/java/org/lamsfoundation/lams/tool/commonCartridge/web/controller/AdminController.java (.../AdminController.java) (revision 1d6eef003bf303f75c5405b66a13ac86232cec03)
+++ lams_tool_imscc/src/java/org/lamsfoundation/lams/tool/commonCartridge/web/controller/AdminController.java (.../AdminController.java) (revision f2ad75cef0c507a64877942631fee13efbc6ed50)
@@ -29,7 +29,6 @@
import org.lamsfoundation.lams.tool.commonCartridge.service.ICommonCartridgeService;
import org.lamsfoundation.lams.tool.commonCartridge.web.form.AdminForm;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
@@ -44,7 +43,6 @@
public class AdminController {
@Autowired
- @Qualifier("commonCartridgeService")
private ICommonCartridgeService commonCartridgeService;
@RequestMapping("/start")
Index: lams_tool_imscc/src/java/org/lamsfoundation/lams/tool/commonCartridge/web/controller/AuthoringController.java
===================================================================
diff -u -rc9ee204be2fbc37ed1fd4c7eb8267bc103d98a24 -rf2ad75cef0c507a64877942631fee13efbc6ed50
--- lams_tool_imscc/src/java/org/lamsfoundation/lams/tool/commonCartridge/web/controller/AuthoringController.java (.../AuthoringController.java) (revision c9ee204be2fbc37ed1fd4c7eb8267bc103d98a24)
+++ lams_tool_imscc/src/java/org/lamsfoundation/lams/tool/commonCartridge/web/controller/AuthoringController.java (.../AuthoringController.java) (revision f2ad75cef0c507a64877942631fee13efbc6ed50)
@@ -80,12 +80,10 @@
@Controller
@RequestMapping("/authoring")
public class AuthoringController {
+ private static Logger log = Logger.getLogger(AuthoringController.class);
private static final String ITEM_TYPE = "itemType";
- private static Logger log = Logger.getLogger(AuthoringController.class);
-
@Autowired
- @Qualifier("commonCartridgeService")
private ICommonCartridgeService commonCartridgeService;
@Autowired
Index: lams_tool_imscc/src/java/org/lamsfoundation/lams/tool/commonCartridge/web/controller/LearningController.java
===================================================================
diff -u -r62aaf160878735888d077bf28fac3c1989bb8fbd -rf2ad75cef0c507a64877942631fee13efbc6ed50
--- lams_tool_imscc/src/java/org/lamsfoundation/lams/tool/commonCartridge/web/controller/LearningController.java (.../LearningController.java) (revision 62aaf160878735888d077bf28fac3c1989bb8fbd)
+++ lams_tool_imscc/src/java/org/lamsfoundation/lams/tool/commonCartridge/web/controller/LearningController.java (.../LearningController.java) (revision f2ad75cef0c507a64877942631fee13efbc6ed50)
@@ -77,7 +77,6 @@
private WebApplicationContext applicationContext;
@Autowired
- @Qualifier("commonCartridgeService")
private ICommonCartridgeService commonCartridgeService;
@Autowired
Index: lams_tool_imscc/src/java/org/lamsfoundation/lams/tool/commonCartridge/web/controller/MonitoringController.java
===================================================================
diff -u -r1d6eef003bf303f75c5405b66a13ac86232cec03 -rf2ad75cef0c507a64877942631fee13efbc6ed50
--- lams_tool_imscc/src/java/org/lamsfoundation/lams/tool/commonCartridge/web/controller/MonitoringController.java (.../MonitoringController.java) (revision 1d6eef003bf303f75c5405b66a13ac86232cec03)
+++ lams_tool_imscc/src/java/org/lamsfoundation/lams/tool/commonCartridge/web/controller/MonitoringController.java (.../MonitoringController.java) (revision f2ad75cef0c507a64877942631fee13efbc6ed50)
@@ -43,7 +43,6 @@
import org.lamsfoundation.lams.web.util.AttributeNames;
import org.lamsfoundation.lams.web.util.SessionMap;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@@ -54,7 +53,6 @@
public static Logger log = Logger.getLogger(MonitoringController.class);
@Autowired
- @Qualifier("commonCartridgeService")
private ICommonCartridgeService commonCartridgeService;
@RequestMapping("/hideitem")
Index: lams_tool_imscc/src/java/org/lamsfoundation/lams/tool/commonCartridge/web/controller/ViewItemController.java
===================================================================
diff -u -r1d6eef003bf303f75c5405b66a13ac86232cec03 -rf2ad75cef0c507a64877942631fee13efbc6ed50
--- lams_tool_imscc/src/java/org/lamsfoundation/lams/tool/commonCartridge/web/controller/ViewItemController.java (.../ViewItemController.java) (revision 1d6eef003bf303f75c5405b66a13ac86232cec03)
+++ lams_tool_imscc/src/java/org/lamsfoundation/lams/tool/commonCartridge/web/controller/ViewItemController.java (.../ViewItemController.java) (revision f2ad75cef0c507a64877942631fee13efbc6ed50)
@@ -55,19 +55,17 @@
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
-import org.springframework.web.context.WebApplicationContext;
-import org.springframework.web.context.support.WebApplicationContextUtils;
@Controller
public class ViewItemController {
private static final Logger log = Logger.getLogger(ViewItemController.class);
@Autowired
- private WebApplicationContext applicationContext;
+ @Qualifier("commonCartridgeMessageService")
+ private MessageService messageService;
@Autowired
- @Qualifier("commonCartridgeService")
private ICommonCartridgeService commonCartridgeService;;
/**
@@ -210,10 +208,6 @@
SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(sessionMapID);
CommonCartridgeItem item = getCommonCartridgeItem(request, sessionMap, mode);
- WebApplicationContext wac = WebApplicationContextUtils
- .getRequiredWebApplicationContext(applicationContext.getServletContext());
- MessageService messageService = (MessageService) wac.getBean("commonCartridgeMessageService");
-
// Get the post data for the placement
String returnValues = LamsBasicLTIUtil.postLaunchHTML(commonCartridgeService, messageService, item);
Index: lams_tool_imscc/src/java/org/lamsfoundation/lams/tool/commonCartridge/web/servlet/CompleteItemServlet.java
===================================================================
diff -u -r62aaf160878735888d077bf28fac3c1989bb8fbd -rf2ad75cef0c507a64877942631fee13efbc6ed50
--- lams_tool_imscc/src/java/org/lamsfoundation/lams/tool/commonCartridge/web/servlet/CompleteItemServlet.java (.../CompleteItemServlet.java) (revision 62aaf160878735888d077bf28fac3c1989bb8fbd)
+++ lams_tool_imscc/src/java/org/lamsfoundation/lams/tool/commonCartridge/web/servlet/CompleteItemServlet.java (.../CompleteItemServlet.java) (revision f2ad75cef0c507a64877942631fee13efbc6ed50)
@@ -25,6 +25,7 @@
import java.util.SortedSet;
import java.util.TreeSet;
+import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
@@ -35,29 +36,33 @@
import org.lamsfoundation.lams.tool.commonCartridge.CommonCartridgeConstants;
import org.lamsfoundation.lams.tool.commonCartridge.model.CommonCartridgeItem;
import org.lamsfoundation.lams.tool.commonCartridge.model.CommonCartridgeUser;
-import org.lamsfoundation.lams.tool.commonCartridge.service.CommonCartridgeServiceProxy;
import org.lamsfoundation.lams.tool.commonCartridge.service.ICommonCartridgeService;
import org.lamsfoundation.lams.tool.commonCartridge.util.CommonCartridgeItemComparator;
import org.lamsfoundation.lams.usermanagement.dto.UserDTO;
import org.lamsfoundation.lams.web.session.SessionManager;
import org.lamsfoundation.lams.web.util.AttributeNames;
import org.lamsfoundation.lams.web.util.SessionMap;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.context.support.SpringBeanAutowiringSupport;
/**
- *
- *
* @author mseaton
*/
@SuppressWarnings("serial")
public class CompleteItemServlet extends HttpServlet {
private static Logger log = Logger.getLogger(CompleteItemServlet.class);
- private ICommonCartridgeService service;
+ @Autowired
+ private ICommonCartridgeService commonCartridgeService;
+ /*
+ * Request Spring to lookup the applicationContext tied to the current ServletContext and inject service beans
+ * available in that applicationContext.
+ */
@Override
- public void init() throws ServletException {
- service = CommonCartridgeServiceProxy.getCommonCartridgeService(getServletContext());
- super.init();
+ public void init(ServletConfig config) throws ServletException {
+ super.init(config);
+ SpringBeanAutowiringSupport.processInjectionBasedOnServletContext(this, config.getServletContext());
}
/**
@@ -86,7 +91,7 @@
UserDTO user = (UserDTO) ss.getAttribute(AttributeNames.USER);
Long sessionId = (Long) sessionMap.get(CommonCartridgeConstants.ATTR_TOOL_SESSION_ID);
- service.setItemComplete(commonCartridgeItemUid, new Long(user.getUserID().intValue()), sessionId);
+ commonCartridgeService.setItemComplete(commonCartridgeItemUid, new Long(user.getUserID().intValue()), sessionId);
// set commonCartridge item complete tag
SortedSet commonCartridgeItemList = getCommonCartridgeItemList(sessionMap);
@@ -97,7 +102,7 @@
}
}
- CommonCartridgeUser rUser = service.getUserByIDAndSession(new Long(user.getUserID()), sessionId);
+ CommonCartridgeUser rUser = commonCartridgeService.getUserByIDAndSession(new Long(user.getUserID()), sessionId);
response.setContentType("text/javascript");
PrintWriter out = response.getWriter();
Index: lams_tool_kaltura/src/java/org/lamsfoundation/lams/tool/kaltura/web/controller/AuthoringController.java
===================================================================
diff -u -r62aaf160878735888d077bf28fac3c1989bb8fbd -rf2ad75cef0c507a64877942631fee13efbc6ed50
--- lams_tool_kaltura/src/java/org/lamsfoundation/lams/tool/kaltura/web/controller/AuthoringController.java (.../AuthoringController.java) (revision 62aaf160878735888d077bf28fac3c1989bb8fbd)
+++ lams_tool_kaltura/src/java/org/lamsfoundation/lams/tool/kaltura/web/controller/AuthoringController.java (.../AuthoringController.java) (revision f2ad75cef0c507a64877942631fee13efbc6ed50)
@@ -55,7 +55,6 @@
import org.lamsfoundation.lams.web.util.AttributeNames;
import org.lamsfoundation.lams.web.util.SessionMap;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
@@ -71,7 +70,6 @@
private static Logger logger = Logger.getLogger(AuthoringController.class);
@Autowired
- @Qualifier("kalturaService")
private IKalturaService kalturaService;
// Authoring SessionMap key names
Index: lams_tool_kaltura/src/java/org/lamsfoundation/lams/tool/kaltura/web/controller/LearningController.java
===================================================================
diff -u -r62aaf160878735888d077bf28fac3c1989bb8fbd -rf2ad75cef0c507a64877942631fee13efbc6ed50
--- lams_tool_kaltura/src/java/org/lamsfoundation/lams/tool/kaltura/web/controller/LearningController.java (.../LearningController.java) (revision 62aaf160878735888d077bf28fac3c1989bb8fbd)
+++ lams_tool_kaltura/src/java/org/lamsfoundation/lams/tool/kaltura/web/controller/LearningController.java (.../LearningController.java) (revision f2ad75cef0c507a64877942631fee13efbc6ed50)
@@ -85,7 +85,6 @@
private static Logger log = Logger.getLogger(LearningController.class);
@Autowired
- @Qualifier("kalturaService")
private IKalturaService kalturaService;
@Autowired
Index: lams_tool_kaltura/src/java/org/lamsfoundation/lams/tool/kaltura/web/controller/MonitoringController.java
===================================================================
diff -u -r2b381314f275480d99d5487ab8827fdf4ed0c1e5 -rf2ad75cef0c507a64877942631fee13efbc6ed50
--- lams_tool_kaltura/src/java/org/lamsfoundation/lams/tool/kaltura/web/controller/MonitoringController.java (.../MonitoringController.java) (revision 2b381314f275480d99d5487ab8827fdf4ed0c1e5)
+++ lams_tool_kaltura/src/java/org/lamsfoundation/lams/tool/kaltura/web/controller/MonitoringController.java (.../MonitoringController.java) (revision f2ad75cef0c507a64877942631fee13efbc6ed50)
@@ -48,7 +48,6 @@
import org.lamsfoundation.lams.web.session.SessionManager;
import org.lamsfoundation.lams.web.util.AttributeNames;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
@@ -63,7 +62,6 @@
private static Logger log = Logger.getLogger(MonitoringController.class);
@Autowired
- @Qualifier("kalturaService")
private IKalturaService kalturaService;
@RequestMapping("")
Index: lams_tool_kaltura/src/java/org/lamsfoundation/lams/tool/kaltura/web/controller/PedagogicalPlannerController.java
===================================================================
diff -u -rff911101cbe92d6813691c20c292fa04519820b4 -rf2ad75cef0c507a64877942631fee13efbc6ed50
--- lams_tool_kaltura/src/java/org/lamsfoundation/lams/tool/kaltura/web/controller/PedagogicalPlannerController.java (.../PedagogicalPlannerController.java) (revision ff911101cbe92d6813691c20c292fa04519820b4)
+++ lams_tool_kaltura/src/java/org/lamsfoundation/lams/tool/kaltura/web/controller/PedagogicalPlannerController.java (.../PedagogicalPlannerController.java) (revision f2ad75cef0c507a64877942631fee13efbc6ed50)
@@ -44,11 +44,6 @@
/**
* @author Andrey Balan
- *
- *
- *
- *
- *
*/
@Controller
@RequestMapping("/pedagogicalPlanner")
@@ -57,7 +52,6 @@
private static Logger logger = Logger.getLogger(PedagogicalPlannerController.class);
@Autowired
- @Qualifier("kalturaService")
private IKalturaService kalturaService;
@Autowired
Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/controller/McController.java
===================================================================
diff -u -r62aaf160878735888d077bf28fac3c1989bb8fbd -rf2ad75cef0c507a64877942631fee13efbc6ed50
--- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/controller/McController.java (.../McController.java) (revision 62aaf160878735888d077bf28fac3c1989bb8fbd)
+++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/controller/McController.java (.../McController.java) (revision f2ad75cef0c507a64877942631fee13efbc6ed50)
@@ -74,7 +74,6 @@
private static Logger logger = Logger.getLogger(McController.class.getName());
@Autowired
- @Qualifier("mcService")
private IMcService mcService;
@Autowired
Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/controller/McLearningController.java
===================================================================
diff -u -r8e218cf691c1235001bd61a9e6f62c363f62124a -rf2ad75cef0c507a64877942631fee13efbc6ed50
--- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/controller/McLearningController.java (.../McLearningController.java) (revision 8e218cf691c1235001bd61a9e6f62c363f62124a)
+++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/controller/McLearningController.java (.../McLearningController.java) (revision f2ad75cef0c507a64877942631fee13efbc6ed50)
@@ -86,7 +86,6 @@
private static Logger logger = Logger.getLogger(McLearningController.class.getName());
@Autowired
- @Qualifier("mcService")
private IMcService mcService;
@Autowired
Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/controller/McMonitoringController.java
===================================================================
diff -u -r8e218cf691c1235001bd61a9e6f62c363f62124a -rf2ad75cef0c507a64877942631fee13efbc6ed50
--- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/controller/McMonitoringController.java (.../McMonitoringController.java) (revision 8e218cf691c1235001bd61a9e6f62c363f62124a)
+++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/controller/McMonitoringController.java (.../McMonitoringController.java) (revision f2ad75cef0c507a64877942631fee13efbc6ed50)
@@ -88,7 +88,6 @@
private static Logger logger = Logger.getLogger(McMonitoringController.class.getName());
@Autowired
- @Qualifier("mcService")
private IMcService mcService;
@Autowired
Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/controller/McPedagogicalPlannerController.java
===================================================================
diff -u -r424f8d213bbff9badfb9b913fd7c68d5cc1d5c3d -rf2ad75cef0c507a64877942631fee13efbc6ed50
--- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/controller/McPedagogicalPlannerController.java (.../McPedagogicalPlannerController.java) (revision 424f8d213bbff9badfb9b913fd7c68d5cc1d5c3d)
+++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/controller/McPedagogicalPlannerController.java (.../McPedagogicalPlannerController.java) (revision f2ad75cef0c507a64877942631fee13efbc6ed50)
@@ -56,7 +56,6 @@
public class McPedagogicalPlannerController {
@Autowired
- @Qualifier("mcService")
private IMcService mcService;
@Autowired
Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/controller/TblMonitoringController.java
===================================================================
diff -u -r424f8d213bbff9badfb9b913fd7c68d5cc1d5c3d -rf2ad75cef0c507a64877942631fee13efbc6ed50
--- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/controller/TblMonitoringController.java (.../TblMonitoringController.java) (revision 424f8d213bbff9badfb9b913fd7c68d5cc1d5c3d)
+++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/controller/TblMonitoringController.java (.../TblMonitoringController.java) (revision f2ad75cef0c507a64877942631fee13efbc6ed50)
@@ -31,7 +31,6 @@
private static Logger logger = Logger.getLogger(TblMonitoringController.class.getName());
@Autowired
- @Qualifier("mcService")
private IMcService mcService;
/**
Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/controller/QaMonitoringController.java
===================================================================
diff -u -r21ffaba743a8aeb994ba62e03e2a82ae13344f9b -rf2ad75cef0c507a64877942631fee13efbc6ed50
--- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/controller/QaMonitoringController.java (.../QaMonitoringController.java) (revision 21ffaba743a8aeb994ba62e03e2a82ae13344f9b)
+++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/controller/QaMonitoringController.java (.../QaMonitoringController.java) (revision f2ad75cef0c507a64877942631fee13efbc6ed50)
@@ -53,7 +53,6 @@
import org.lamsfoundation.lams.tool.qa.dto.QaQuestionDTO;
import org.lamsfoundation.lams.tool.qa.dto.QaStatsDTO;
import org.lamsfoundation.lams.tool.qa.service.IQaService;
-import org.lamsfoundation.lams.tool.qa.service.QaServiceProxy;
import org.lamsfoundation.lams.tool.qa.util.QaApplicationException;
import org.lamsfoundation.lams.tool.qa.util.QaSessionComparator;
import org.lamsfoundation.lams.tool.qa.util.QaUtils;
@@ -64,12 +63,10 @@
import org.lamsfoundation.lams.web.session.SessionManager;
import org.lamsfoundation.lams.web.util.AttributeNames;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
-import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.util.HtmlUtils;
import com.fasterxml.jackson.databind.node.ArrayNode;
@@ -82,15 +79,11 @@
@Controller
@RequestMapping("/monitoring")
public class QaMonitoringController implements QaAppConstants {
+ private static Logger logger = Logger.getLogger(QaMonitoringController.class.getName());
@Autowired
private IQaService qaService;
- @Autowired
- private WebApplicationContext applicationContext;
-
- private static Logger logger = Logger.getLogger(QaMonitoringController.class.getName());
-
@RequestMapping("/")
public String unspecified() throws IOException, ServletException, ToolException {
return null;
@@ -306,10 +299,6 @@
return null;
}
- private IQaService getQAService() {
- return QaServiceProxy.getQaService(applicationContext.getServletContext());
- }
-
/**
* Get Paged Reflections
*
@@ -334,7 +323,6 @@
}
//return user list according to the given sessionID
- IQaService qaService = getQAService();
List