You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by jb...@apache.org on 2008/02/27 17:26:05 UTC
svn commit: r631634 - in
/geronimo/server/branches/2.1/plugins/console/plugin-portlets/src/main:
java/org/apache/geronimo/console/car/ExportConfigHandler.java
webapp/WEB-INF/view/car/index.jsp
Author: jbohn
Date: Wed Feb 27 08:25:58 2008
New Revision: 631634
URL: http://svn.apache.org/viewvc?rev=631634&view=rev
Log:
GERONIMO-3867 Add validation to ensure a configuration is selected for export. Also some minor changes to make the handler code more consistent.
Modified:
geronimo/server/branches/2.1/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/ExportConfigHandler.java
geronimo/server/branches/2.1/plugins/console/plugin-portlets/src/main/webapp/WEB-INF/view/car/index.jsp
Modified: geronimo/server/branches/2.1/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/ExportConfigHandler.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/ExportConfigHandler.java?rev=631634&r1=631633&r2=631634&view=diff
==============================================================================
--- geronimo/server/branches/2.1/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/ExportConfigHandler.java (original)
+++ geronimo/server/branches/2.1/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/ExportConfigHandler.java Wed Feb 27 08:25:58 2008
@@ -66,17 +66,18 @@
public void renderView(RenderRequest request, RenderResponse response, MultiPageModel model) throws PortletException, IOException {
String configId = request.getParameter("configId");
- PluginType data = ManagementHelper.getManagementHelper(request).getPluginInstaller().getPluginMetadata(
- Artifact.create(configId));
- PluginArtifactType instance = data.getPluginArtifact().get(0);
+ PluginInstaller pluginInstaller = ManagementHelper.getManagementHelper(request).getPluginInstaller();
+ Artifact newArtifact = Artifact.create(configId);
+ PluginType metadata = pluginInstaller.getPluginMetadata(newArtifact);
+ PluginArtifactType instance = metadata.getPluginArtifact().get(0);
request.setAttribute("configId", PluginInstallerGBean.toArtifact(instance.getModuleId()).toString());
- request.setAttribute("name", data.getName());
+ request.setAttribute("name", metadata.getName());
request.setAttribute("repository", combine(instance.getSourceRepository()));
- request.setAttribute("category", data.getCategory());
- request.setAttribute("url", data.getUrl());
- request.setAttribute("author", data.getAuthor());
- request.setAttribute("description", data.getDescription());
- List<LicenseType> licenses = data.getLicense();
+ request.setAttribute("category", metadata.getCategory());
+ request.setAttribute("url", metadata.getUrl());
+ request.setAttribute("author", metadata.getAuthor());
+ request.setAttribute("description", metadata.getDescription());
+ List<LicenseType> licenses = metadata.getLicense();
if (licenses != null && licenses.size() > 0) {
request.setAttribute("license", licenses.get(0).getValue());
if (licenses.get(0).isOsiApproved()) {
Modified: geronimo/server/branches/2.1/plugins/console/plugin-portlets/src/main/webapp/WEB-INF/view/car/index.jsp
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/plugins/console/plugin-portlets/src/main/webapp/WEB-INF/view/car/index.jsp?rev=631634&r1=631633&r2=631634&view=diff
==============================================================================
--- geronimo/server/branches/2.1/plugins/console/plugin-portlets/src/main/webapp/WEB-INF/view/car/index.jsp (original)
+++ geronimo/server/branches/2.1/plugins/console/plugin-portlets/src/main/webapp/WEB-INF/view/car/index.jsp Wed Feb 27 08:25:58 2008
@@ -19,6 +19,20 @@
<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<fmt:setBundle basename="pluginportlets"/>
+
+<script>
+function <portlet:namespace/>validateForm(){
+ with(document.<portlet:namespace/>ExportForm){
+ if (configId.value==null || configId.value=="") {
+ alert("Please select a configuration to export.");
+ return false;
+ }
+ }
+ return true;
+}
+</script>
+
+
<portlet:defineObjects/>
<fmt:message key="car.index.summary"/>
@@ -49,7 +63,7 @@
<p><fmt:message key="car.index.createGeronimoPluginExp"/></p>
-<form name="<portlet:namespace/>ExportForm" action="<portlet:actionURL/>" method="POST">
+<form name="<portlet:namespace/>ExportForm" action="<portlet:actionURL/>" method="POST" onsubmit="return <portlet:namespace/>validateForm()">
<input type="hidden" name="mode" value="configure-before"/>
<select name="configId">
<option/>