01: /**********************************************************************************
02: * $URL: https://source.sakaiproject.org/svn/metaobj/tags/sakai_2-4-1/metaobj-impl/api-impl/src/java/org/sakaiproject/metaobj/shared/mgt/impl/PortalParamManagerImpl.java $
03: * $Id: PortalParamManagerImpl.java 14225 2006-09-05 17:39:44Z chmaurer@iupui.edu $
04: ***********************************************************************************
05: *
06: * Copyright (c) 2004, 2005, 2006 The Sakai Foundation.
07: *
08: * Licensed under the Educational Community License, Version 1.0 (the "License");
09: * you may not use this file except in compliance with the License.
10: * You may obtain a copy of the License at
11: *
12: * http://www.opensource.org/licenses/ecl1.php
13: *
14: * Unless required by applicable law or agreed to in writing, software
15: * distributed under the License is distributed on an "AS IS" BASIS,
16: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17: * See the License for the specific language governing permissions and
18: * limitations under the License.
19: *
20: **********************************************************************************/package org.sakaiproject.metaobj.shared.mgt.impl;
21:
22: import java.util.Hashtable;
23: import java.util.Iterator;
24: import java.util.List;
25: import java.util.Map;
26:
27: import javax.servlet.ServletRequest;
28:
29: import org.apache.commons.logging.Log;
30: import org.apache.commons.logging.LogFactory;
31: import org.sakaiproject.metaobj.shared.mgt.PortalParamManager;
32:
33: public class PortalParamManagerImpl implements PortalParamManager {
34: protected final transient Log logger = LogFactory
35: .getLog(getClass());
36:
37: private List parameters = null;
38:
39: public Map getParams(ServletRequest request) {
40: Map map = new Hashtable();
41:
42: for (Iterator i = getParameters().iterator(); i.hasNext();) {
43: String key = (String) i.next();
44: String value = request.getParameter(key);
45: if (value == null) {
46: value = (String) request.getAttribute(key);
47: }
48:
49: if (value != null) {
50: map.put(key, value);
51: }
52: }
53:
54: return map;
55: }
56:
57: public List getParameters() {
58: return parameters;
59: }
60:
61: public void setParameters(List parameters) {
62: this.parameters = parameters;
63: }
64: }
|