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.car;
17:
18: import java.io.IOException;
19: import java.util.List;
20:
21: import javax.portlet.ActionRequest;
22: import javax.portlet.ActionResponse;
23: import javax.portlet.PortletException;
24: import javax.portlet.PortletSession;
25: import javax.portlet.RenderRequest;
26: import javax.portlet.RenderResponse;
27:
28: import org.apache.geronimo.console.MultiPageModel;
29:
30: /**
31: * Handler for the confirm screen.
32: */
33: public class AssemblyConfirmHandler extends BaseImportExportHandler {
34: public AssemblyConfirmHandler() {
35: super (ASSEMBLY_CONFIRM_MODE,
36: "/WEB-INF/view/car/assemblyConfirm.jsp");
37: }
38:
39: public String actionBeforeView(ActionRequest request,
40: ActionResponse response, MultiPageModel model)
41: throws PortletException, IOException {
42: String relativeServerPath = request
43: .getParameter("relativeServerPath");
44: response.setRenderParameter("relativeServerPath",
45: relativeServerPath);
46: return getMode();
47: }
48:
49: public void renderView(RenderRequest request,
50: RenderResponse response, MultiPageModel model)
51: throws PortletException, IOException {
52: PortletSession assemblysession = request
53: .getPortletSession(false);
54: List<PluginInfoBean> plugins = (List<PluginInfoBean>) assemblysession
55: .getAttribute("plugins");
56: String relativeServerPath = request
57: .getParameter("relativeServerPath");
58: String absoluteDeployedPath = System
59: .getProperty("org.apache.geronimo.home.dir")
60: + "/" + relativeServerPath;
61:
62: request.setAttribute("plugins", plugins);
63: request.setAttribute("absoluteDeployedPath",
64: absoluteDeployedPath);
65: request.setAttribute("mode", ASSEMBLY_CONFIRM_MODE + "-after");
66: }
67:
68: public String actionAfterView(ActionRequest request,
69: ActionResponse response, MultiPageModel model)
70: throws PortletException, IOException {
71: return INDEX_MODE + BEFORE_ACTION;
72: }
73: }
|