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: */package org.apache.geronimo.console.configcreator;
17:
18: import java.io.IOException;
19:
20: import javax.portlet.ActionRequest;
21: import javax.portlet.ActionResponse;
22: import javax.portlet.PortletException;
23: import javax.portlet.RenderRequest;
24: import javax.portlet.RenderResponse;
25:
26: import org.apache.commons.logging.Log;
27: import org.apache.commons.logging.LogFactory;
28: import org.apache.geronimo.console.MultiPageModel;
29:
30: /**
31: * A handler for ...
32: *
33: * @version $Rev: 593590 $ $Date: 2007-11-09 08:53:02 -0800 (Fri, 09 Nov 2007) $
34: */
35: public class SecurityHandler extends AbstractHandler {
36: private static final Log log = LogFactory
37: .getLog(SecurityHandler.class);
38:
39: public SecurityHandler() {
40: super (SECURITY_MODE, "/WEB-INF/view/configcreator/security.jsp");
41: }
42:
43: public String actionBeforeView(ActionRequest request,
44: ActionResponse response, MultiPageModel model)
45: throws PortletException, IOException {
46: return getMode();
47: }
48:
49: public void renderView(RenderRequest request,
50: RenderResponse response, MultiPageModel model)
51: throws PortletException, IOException {
52: WARConfigData data = getSessionData(request);
53: request.setAttribute(DATA_PARAMETER, data);
54: request.setAttribute(DEPLOYED_SECURITY_REALMS_PARAMETER,
55: JSR77_Util.getDeployedSecurityRealms(request));
56: request.setAttribute(DEPLOYED_CREDENTIAL_STORES_PARAMETER,
57: JSR77_Util.getDeployedCredentialStores(request));
58: }
59:
60: public String actionAfterView(ActionRequest request,
61: ActionResponse response, MultiPageModel model)
62: throws PortletException, IOException {
63: WARConfigData data = getSessionData(request);
64: data.readSecurityData(request);
65: return DEPENDENCIES_MODE + "-before";
66: }
67: }
|