From 08315572e72a3be510667fb906314d4be2307c61 Mon Sep 17 00:00:00 2001 From: Matthew Buckett Date: Mon, 15 Feb 2016 17:20:42 +0000 Subject: [PATCH] SAK-23918 Remove the dependency on implementation. Section tool we depending on implementations so that it could run in a standalone mode, this code got removed and these parts can also now go. --- sections/sections-app/pom.xml | 24 ----- .../tool/section/EntryServlet.java | 2 - .../backingbean/standalone/ConfigBean.java | 55 ----------- .../jsf/backingbean/standalone/LoginBean.java | 91 ------------------- 4 files changed, 172 deletions(-) delete mode 100644 sections/sections-app/src/java/org/sakaiproject/tool/section/jsf/backingbean/standalone/ConfigBean.java delete mode 100644 sections/sections-app/src/java/org/sakaiproject/tool/section/jsf/backingbean/standalone/LoginBean.java diff --git a/sections/sections-app/pom.xml b/sections/sections-app/pom.xml index 337d5ebcd503..8b2b2f7b531c 100644 --- a/sections/sections-app/pom.xml +++ b/sections/sections-app/pom.xml @@ -53,31 +53,7 @@ org.sakaiproject.edu-services.sections sections-api - - org.sakaiproject.edu-services.sections - sections-impl-standalone - provided - - - - org.sakaiproject.edu-services.sections - sections-model - provided - - - - org.sakaiproject.edu-services.sections - sections-impl - provided - - - - org.sakaiproject.edu-services.sections - sections-integrationsupport - provided - - org.sakaiproject sakai-sections-app-util diff --git a/sections/sections-app/src/java/org/sakaiproject/tool/section/EntryServlet.java b/sections/sections-app/src/java/org/sakaiproject/tool/section/EntryServlet.java index d5c4283a0ddd..bd41f9c4c909 100644 --- a/sections/sections-app/src/java/org/sakaiproject/tool/section/EntryServlet.java +++ b/sections/sections-app/src/java/org/sakaiproject/tool/section/EntryServlet.java @@ -14,8 +14,6 @@ import org.sakaiproject.section.api.facade.manager.Authz; import org.sakaiproject.section.api.facade.manager.Context; import org.sakaiproject.section.api.SectionManager; -import org.sakaiproject.component.section.sakai.SectionManagerImpl; -import org.sakaiproject.tool.section.jsf.backingbean.StudentViewBean; import org.springframework.context.ApplicationContext; import org.springframework.web.context.WebApplicationContext; diff --git a/sections/sections-app/src/java/org/sakaiproject/tool/section/jsf/backingbean/standalone/ConfigBean.java b/sections/sections-app/src/java/org/sakaiproject/tool/section/jsf/backingbean/standalone/ConfigBean.java deleted file mode 100644 index 5191c7660d64..000000000000 --- a/sections/sections-app/src/java/org/sakaiproject/tool/section/jsf/backingbean/standalone/ConfigBean.java +++ /dev/null @@ -1,55 +0,0 @@ -/********************************************************************************** - * $URL$ - * $Id$ - *********************************************************************************** - * - * Copyright (c) 2006, 2008 The Sakai Foundation - * - * Licensed under the Educational Community License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.opensource.org/licenses/ECL-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - **********************************************************************************/ -package org.sakaiproject.tool.section.jsf.backingbean.standalone; - -import javax.faces.context.FacesContext; -import javax.servlet.ServletContext; - -import org.sakaiproject.section.api.SectionManager; -import org.sakaiproject.tool.section.jsf.backingbean.CourseDependentBean; - -public class ConfigBean extends CourseDependentBean { - private static final long serialVersionUID = 1L; - - public String updateConfigAllManual() { - getServletContext().setAttribute(SectionManager.CONFIGURATION_KEY, SectionManager.ExternalIntegrationConfig.MANUAL_MANDATORY); - return "overview"; - } - - public String updateConfigAllAutomatic() { - getServletContext().setAttribute(SectionManager.CONFIGURATION_KEY, SectionManager.ExternalIntegrationConfig.AUTOMATIC_MANDATORY); - return "overview"; - } - - public String updateConfigOptionalAll() { - getServletContext().setAttribute(SectionManager.CONFIGURATION_KEY, SectionManager.ExternalIntegrationConfig.AUTOMATIC_DEFAULT); - return "overview"; - } - - public String updateConfigOptionalMultiple() { - getServletContext().setAttribute(SectionManager.CONFIGURATION_KEY, SectionManager.ExternalIntegrationConfig.MANUAL_DEFAULT); - return "overview"; - } - - private ServletContext getServletContext() { - return (ServletContext)FacesContext.getCurrentInstance().getExternalContext().getContext(); - } -} diff --git a/sections/sections-app/src/java/org/sakaiproject/tool/section/jsf/backingbean/standalone/LoginBean.java b/sections/sections-app/src/java/org/sakaiproject/tool/section/jsf/backingbean/standalone/LoginBean.java deleted file mode 100644 index b02ef1854b4e..000000000000 --- a/sections/sections-app/src/java/org/sakaiproject/tool/section/jsf/backingbean/standalone/LoginBean.java +++ /dev/null @@ -1,91 +0,0 @@ -/********************************************************************************** - * $URL$ - * $Id$ - *********************************************************************************** - * - * Copyright (c) 2005, 2006, 2008 The Sakai Foundation - * - * Licensed under the Educational Community License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.opensource.org/licenses/ECL-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - **********************************************************************************/ -package org.sakaiproject.tool.section.jsf.backingbean.standalone; - -import javax.faces.context.FacesContext; -import javax.servlet.http.HttpSession; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.sakaiproject.component.section.facade.impl.standalone.AuthnStandaloneImpl; -import org.sakaiproject.component.section.facade.impl.standalone.ContextStandaloneImpl; -import org.sakaiproject.tool.section.jsf.JsfUtil; -import org.sakaiproject.tool.section.jsf.backingbean.CourseDependentBean; - -/** - * Controls the login page for the standalone webapp, which allows a person to - * choose the current user and site context. - * - * @author Josh Holtzman - */ -public class LoginBean extends CourseDependentBean { - - private static final Log log = LogFactory.getLog(LoginBean.class); - - private static final long serialVersionUID = 1L; - - private String userName; - private String context; - - public LoginBean() { - // Default for testing - userName = "instructor1"; - } - - public String processSetUserNameAndContext() { - // We store the username and context as a session attribute in standalone mode - HttpSession session = (HttpSession)FacesContext.getCurrentInstance().getExternalContext().getSession(true); - session.setAttribute(AuthnStandaloneImpl.USER_NAME, userName); - session.setAttribute(ContextStandaloneImpl.CONTEXT, context); - - if(isSectionEnrollmentMangementEnabled() || isSectionManagementEnabled() || - isSectionOptionsManagementEnabled() || isSectionTaManagementEnabled()) { - return "overview"; - } - - if(isViewOwnSectionsEnabled()) { - return "studentView"; - } - - if(log.isDebugEnabled()) log.debug(userName + " does not have a role in site " + context); - - JsfUtil.addRedirectSafeInfoMessage("You have no role in this site. " + - "Please choose another site or another user, or both."); - - // Keep the user on the login page, and exercise the redirect to test messaging - return "login"; - } - - public String getUserName() { - return userName; - } - public void setUserName(String userName) { - this.userName = userName; - } - - public String getContext() { - return context; - } - - public void setContext(String context) { - this.context = context; - } -}