01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17: package org.apache.cocoon.portal.acting;
18:
19: import java.util.Map;
20:
21: import org.apache.avalon.framework.parameters.Parameters;
22: import org.apache.avalon.framework.service.ServiceException;
23: import org.apache.avalon.framework.thread.ThreadSafe;
24: import org.apache.cocoon.ProcessingException;
25: import org.apache.cocoon.acting.ServiceableAction;
26: import org.apache.cocoon.environment.Redirector;
27: import org.apache.cocoon.environment.SourceResolver;
28: import org.apache.cocoon.portal.PortalService;
29:
30: /**
31: * This action saves the profile.
32: *
33: * @author <a href="mailto:cziegeler@apache.org">Carsten Ziegeler</a>
34: * @version CVS $Id: SaveAction.java 433543 2006-08-22 06:22:54Z crossley $
35: */
36: public final class SaveAction extends ServiceableAction implements
37: ThreadSafe {
38:
39: /* (non-Javadoc)
40: * @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)
41: */
42: public Map act(Redirector redirector, SourceResolver resolver,
43: Map objectModel, String source, Parameters par)
44: throws Exception {
45: if (this .getLogger().isDebugEnabled()) {
46: this .getLogger().debug(
47: "BEGIN act resolver=" + resolver + ", objectModel="
48: + objectModel + ", source=" + source
49: + ", par=" + par);
50: }
51:
52: PortalService service = null;
53: try {
54: service = (PortalService) this .manager
55: .lookup(PortalService.ROLE);
56: service.getComponentManager().getProfileManager()
57: .saveUserProfiles(null);
58: } catch (ServiceException ce) {
59: throw new ProcessingException(
60: "Unable to lookup portal service.", ce);
61: } finally {
62: this .manager.release(service);
63: }
64:
65: if (this .getLogger().isDebugEnabled()) {
66: this .getLogger().debug("END act map={}");
67: }
68:
69: return EMPTY_MAP;
70: }
71:
72: }
|