001: /**********************************************************************************
002: * $URL: https://source.sakaiproject.org/svn/osp/tags/sakai_2-4-1/matrix/tool/src/java/org/theospi/portfolio/matrix/control/AbstractMatrixController.java $
003: * $Id: AbstractMatrixController.java 9134 2006-05-08 20:28:42Z chmaurer@iupui.edu $
004: ***********************************************************************************
005: *
006: * Copyright (c) 2006 The Sakai Foundation.
007: *
008: * Licensed under the Educational Community License, Version 1.0 (the "License");
009: * you may not use this file except in compliance with the License.
010: * You may obtain a copy of the License at
011: *
012: * http://www.opensource.org/licenses/ecl1.php
013: *
014: * Unless required by applicable law or agreed to in writing, software
015: * distributed under the License is distributed on an "AS IS" BASIS,
016: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
017: * See the License for the specific language governing permissions and
018: * limitations under the License.
019: *
020: **********************************************************************************/package org.theospi.portfolio.matrix.control;
021:
022: import org.sakaiproject.metaobj.security.AuthenticationManager;
023: import org.sakaiproject.metaobj.shared.mgt.AgentManager;
024: import org.sakaiproject.metaobj.shared.mgt.IdManager;
025: import org.sakaiproject.metaobj.utils.mvc.intf.Controller;
026: import org.sakaiproject.metaobj.worksite.mgt.WorksiteManager;
027: import org.sakaiproject.tool.cover.ToolManager;
028: import org.theospi.portfolio.matrix.MatrixManager;
029: import org.theospi.portfolio.security.AuthorizationFacade;
030: import org.theospi.utils.mvc.impl.servlet.AbstractFormController;
031:
032: public abstract class AbstractMatrixController extends
033: AbstractFormController implements Controller {
034:
035: private MatrixManager matrixManager;
036: private AuthenticationManager authManager = null;
037: private IdManager idManager = null;
038: private AuthorizationFacade authzManager = null;
039: private WorksiteManager worksiteManager = null;
040: private AgentManager agentManager = null;
041:
042: protected Boolean isMaintainer() {
043: return new Boolean(getAuthzManager()
044: .isAuthorized(
045: WorksiteManager.WORKSITE_MAINTAIN,
046: getIdManager().getId(
047: ToolManager.getCurrentPlacement()
048: .getContext())));
049: }
050:
051: /**
052: * @return
053: */
054: public AuthenticationManager getAuthManager() {
055: return authManager;
056: }
057:
058: /**
059: * @param manager
060: */
061: public void setAuthManager(AuthenticationManager manager) {
062: authManager = manager;
063: }
064:
065: /**
066: * @return
067: */
068: public IdManager getIdManager() {
069: return idManager;
070: }
071:
072: /**
073: * @param manager
074: */
075: public void setIdManager(IdManager manager) {
076: idManager = manager;
077: }
078:
079: /**
080: * @return
081: */
082: public AuthorizationFacade getAuthzManager() {
083: return authzManager;
084: }
085:
086: /**
087: * @param facade
088: */
089: public void setAuthzManager(AuthorizationFacade facade) {
090: authzManager = facade;
091: }
092:
093: /**
094: * @return Returns the matrixManager.
095: */
096: public MatrixManager getMatrixManager() {
097: return matrixManager;
098: }
099:
100: /**
101: * @param matrixManager The matrixManager to set.
102: */
103: public void setMatrixManager(MatrixManager matrixManager) {
104: this .matrixManager = matrixManager;
105: }
106:
107: /**
108: * @return Returns the worksiteManager.
109: */
110: public WorksiteManager getWorksiteManager() {
111: return worksiteManager;
112: }
113:
114: /**
115: * @param worksiteManager The worksiteManager to set.
116: */
117: public void setWorksiteManager(WorksiteManager worksiteManager) {
118: this .worksiteManager = worksiteManager;
119: }
120:
121: /**
122: * @return Returns the agentManager.
123: */
124: public AgentManager getAgentManager() {
125: return agentManager;
126: }
127:
128: /**
129: * @param agentManager The agentManager to set.
130: */
131: public void setAgentManager(AgentManager agentManager) {
132: this.agentManager = agentManager;
133: }
134: }
|