You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by ga...@apache.org on 2008/02/14 19:54:45 UTC
svn commit: r627838 - in
/geronimo/server/trunk/plugins/console/plugin-portlets/src/main:
java/org/apache/geronimo/console/car/ resources/ webapp/WEB-INF/view/car/
Author: gawor
Date: Thu Feb 14 10:54:30 2008
New Revision: 627838
URL: http://svn.apache.org/viewvc?rev=627838&view=rev
Log:
Adds a confirmation page at the end of Assembling a server. Patch from Joseph Leong (GERONIMO-3802)
Added:
geronimo/server/trunk/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/AssemblyConfirmHandler.java (with props)
geronimo/server/trunk/plugins/console/plugin-portlets/src/main/webapp/WEB-INF/view/car/assemblyConfirm.jsp (with props)
Modified:
geronimo/server/trunk/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/AssemblyViewHandler.java
geronimo/server/trunk/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/BaseImportExportHandler.java
geronimo/server/trunk/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/ImportExportPortlet.java
geronimo/server/trunk/plugins/console/plugin-portlets/src/main/resources/pluginportlets.properties
Added: geronimo/server/trunk/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/AssemblyConfirmHandler.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/AssemblyConfirmHandler.java?rev=627838&view=auto
==============================================================================
--- geronimo/server/trunk/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/AssemblyConfirmHandler.java (added)
+++ geronimo/server/trunk/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/AssemblyConfirmHandler.java Thu Feb 14 10:54:30 2008
@@ -0,0 +1,59 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.geronimo.console.car;
+
+import java.io.IOException;
+import java.util.List;
+
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.PortletException;
+import javax.portlet.PortletSession;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+
+import org.apache.geronimo.console.MultiPageModel;
+
+/**
+ * Handler for the confirm screen.
+ */
+public class AssemblyConfirmHandler extends BaseImportExportHandler {
+ public AssemblyConfirmHandler() {
+ super(ASSEMBLY_CONFIRM_MODE, "/WEB-INF/view/car/assemblyConfirm.jsp");
+ }
+
+ public String actionBeforeView(ActionRequest request, ActionResponse response, MultiPageModel model) throws PortletException, IOException {
+ String relativeServerPath = request.getParameter("relativeServerPath");
+ response.setRenderParameter("relativeServerPath", relativeServerPath);
+ return getMode();
+ }
+
+ public void renderView(RenderRequest request, RenderResponse response, MultiPageModel model) throws PortletException, IOException {
+ PortletSession assemblysession = request.getPortletSession(false);
+ List<PluginInfoBean> plugins = (List<PluginInfoBean>) assemblysession.getAttribute("plugins");
+ String relativeServerPath = request.getParameter("relativeServerPath");
+ String absoluteDeployedPath = System.getProperty("org.apache.geronimo.home.dir")+"/"+relativeServerPath;
+
+ request.setAttribute("plugins", plugins);
+ request.setAttribute("absoluteDeployedPath", absoluteDeployedPath);
+ request.setAttribute("mode", ASSEMBLY_CONFIRM_MODE+"-after");
+ }
+
+ public String actionAfterView(ActionRequest request, ActionResponse response, MultiPageModel model) throws PortletException, IOException {
+ return INDEX_MODE+BEFORE_ACTION;
+ }
+}
Propchange: geronimo/server/trunk/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/AssemblyConfirmHandler.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: geronimo/server/trunk/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/AssemblyViewHandler.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/AssemblyViewHandler.java?rev=627838&r1=627837&r2=627838&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/AssemblyViewHandler.java (original)
+++ geronimo/server/trunk/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/AssemblyViewHandler.java Thu Feb 14 10:54:30 2008
@@ -25,6 +25,7 @@
import javax.portlet.PortletException;
import javax.portlet.RenderRequest;
import javax.portlet.RenderResponse;
+import javax.portlet.PortletSession;
import org.apache.geronimo.console.MultiPageModel;
import org.apache.geronimo.kernel.repository.Artifact;
@@ -90,6 +91,9 @@
request.setAttribute("artifactId", artifactId);
request.setAttribute("version", version);
request.setAttribute("format", format);
+
+ PortletSession assemblysession = request.getPortletSession(true);
+ assemblysession.setAttribute("plugins", plugins);
request.setAttribute("allInstallable", true);
request.setAttribute("mode", ASSEMBLY_VIEW_MODE + "-after");
@@ -101,6 +105,8 @@
String artifactId = request.getParameter("artifactId");
String version = request.getParameter("version");
String format = request.getParameter("format");
+
+ response.setRenderParameter("relativeServerPath",relativeServerPath);
PluginInstaller pluginInstaller = ManagementHelper.getManagementHelper(request).getPluginInstaller();
ServerArchiver archiver = ManagementHelper.getManagementHelper(request).getArchiver();
@@ -108,6 +114,7 @@
PluginListType list = getServerPluginList(request, pluginInstaller);
PluginListType installList = getPluginsFromIds(configIds, list);
+
try {
DownloadResults downloadResults = pluginInstaller.installPluginList("repository", relativeServerPath, installList);
@@ -115,7 +122,7 @@
} catch (Exception e) {
throw new PortletException("Could not assemble server", e);
}
- return INDEX_MODE;
+ return ASSEMBLY_CONFIRM_MODE+BEFORE_ACTION;
}
}
Modified: geronimo/server/trunk/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/BaseImportExportHandler.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/BaseImportExportHandler.java?rev=627838&r1=627837&r2=627838&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/BaseImportExportHandler.java (original)
+++ geronimo/server/trunk/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/BaseImportExportHandler.java Thu Feb 14 10:54:30 2008
@@ -53,7 +53,7 @@
protected static final String CONFIGURE_EXPORT_MODE = "configure";
protected static final String CONFIRM_EXPORT_MODE = "confirm";
protected static final String UPDATE_REPOS_MODE = "updateList";
-
+ protected static final String ASSEMBLY_CONFIRM_MODE = "assemblyConfirm";
protected static final String LIST_SERVER_MODE = "listServer";
protected static final String ASSEMBLY_VIEW_MODE = "assemblyView";
Modified: geronimo/server/trunk/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/ImportExportPortlet.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/ImportExportPortlet.java?rev=627838&r1=627837&r2=627838&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/ImportExportPortlet.java (original)
+++ geronimo/server/trunk/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/ImportExportPortlet.java Thu Feb 14 10:54:30 2008
@@ -40,7 +40,7 @@
addHelper(new UpdateListHandler(), config);
addHelper(new AddRepositoryHandler(), config);
addHelper(new ViewPluginDownloadHandler(), config);
-
+ addHelper(new AssemblyConfirmHandler(), config);
addHelper(new AssemblyListHandler(), config);
addHelper(new AssemblyViewHandler(), config);
}
Modified: geronimo/server/trunk/plugins/console/plugin-portlets/src/main/resources/pluginportlets.properties
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/console/plugin-portlets/src/main/resources/pluginportlets.properties?rev=627838&r1=627837&r2=627838&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/console/plugin-portlets/src/main/resources/pluginportlets.properties (original)
+++ geronimo/server/trunk/plugins/console/plugin-portlets/src/main/resources/pluginportlets.properties Thu Feb 14 10:54:30 2008
@@ -109,6 +109,12 @@
car.viewForDownload.prerequisites = Prerequisites
car.viewForDownload.website = Web Site
+car.assemblyConfirm.moduleId = Module ID
+car.assemblyConfirm.description = Description
+car.assemblyConfirm.plugin = Plugin
+
+
+
configmanager.common.archive = Archive
configmanager.common.plan = Plan
configmanager.common.startAppAfterInstall = Start app after install
Added: geronimo/server/trunk/plugins/console/plugin-portlets/src/main/webapp/WEB-INF/view/car/assemblyConfirm.jsp
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/console/plugin-portlets/src/main/webapp/WEB-INF/view/car/assemblyConfirm.jsp?rev=627838&view=auto
==============================================================================
--- geronimo/server/trunk/plugins/console/plugin-portlets/src/main/webapp/WEB-INF/view/car/assemblyConfirm.jsp (added)
+++ geronimo/server/trunk/plugins/console/plugin-portlets/src/main/webapp/WEB-INF/view/car/assemblyConfirm.jsp Thu Feb 14 10:54:30 2008
@@ -0,0 +1,50 @@
+<%--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+--%>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
+<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
+<fmt:setBundle basename="pluginportlets"/>
+<portlet:defineObjects/>
+<table border="0">
+ <tr>
+ <td><h1>Server Assembly Successful</h1></td>
+ </tr>
+ <c:forEach var="plugin" items="${plugins}">
+ <c:set var="artifact" value="${plugin.pluginArtifact.moduleId}"/>
+ <tr>
+ <th align="left" valign="top"><fmt:message key="car.assemblyConfirm.plugin" />:</th>
+ <td>${plugin.name}</td>
+ </tr>
+ <tr>
+ <th align="left" valign="top"><fmt:message key="car.assemblyConfirm.moduleId" />:</th>
+ <td>${artifact.groupId}/${artifact.artifactId}/${artifact.version}/${artifact.type}</td>
+ </tr>
+ <tr>
+ <th align="left" valign="top"><fmt:message key="car.assemblyConfirm.description" />:</th>
+ <td>${plugin.description}</td>
+ </tr>
+ <br>
+ </c:forEach>
+</table>
+<br>
+<p>File Location: ${absoluteDeployedPath}</p>
+<br>
+<form>
+<input type="submit" value="Done" onclick="history.go(-3); return false;" />
+</form>
+
Propchange: geronimo/server/trunk/plugins/console/plugin-portlets/src/main/webapp/WEB-INF/view/car/assemblyConfirm.jsp
------------------------------------------------------------------------------
svn:eol-style = native