KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > cocoon > portal > acting > ObjectModelAction


1 /*
2  * Copyright 1999-2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package org.apache.cocoon.portal.acting;
17
18 import java.util.Map JavaDoc;
19
20 import org.apache.avalon.framework.parameters.Parameters;
21 import org.apache.cocoon.acting.AbstractAction;
22 import org.apache.cocoon.environment.Redirector;
23 import org.apache.cocoon.environment.SourceResolver;
24
25 /**
26  * Stores all parameters in the object model adding prefix "cocoon-portal-".
27  *
28  * @deprecated Use the {@link org.apache.cocoon.acting.SetterAction} instead.
29  * @author <a HREF="mailto:bluetkemeier@s-und-n.de">Bj&ouml;rn L&uuml;tkemeier</a>
30  * @version CVS $Id: ObjectModelAction.java 189567 2005-06-08 09:49:32Z cziegeler $
31  */

32 public class ObjectModelAction
33 extends AbstractAction {
34
35     /* (non-Javadoc)
36      * @see org.apache.cocoon.acting.Action#act(org.apache.cocoon.environment.Redirector, org.apache.cocoon.environment.SourceResolver, java.util.Map, java.lang.String, org.apache.avalon.framework.parameters.Parameters)
37      */

38     public Map JavaDoc act(Redirector redirector, SourceResolver resolver, Map JavaDoc objectModel, String JavaDoc source, Parameters parameters)
39     throws Exception JavaDoc {
40         final String JavaDoc[] names = parameters.getNames();
41         for(int i = 0; i < names.length; i++) {
42             final String JavaDoc name = names[i];
43             objectModel.put("cocoon-portal-" + name, parameters.getParameter(name));
44         }
45         return EMPTY_MAP;
46     }
47 }
48
Popular Tags