geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rwo...@apache.org
Subject svn commit: r946083 - in /geronimo/server/branches/2.2/plugins/console/plugin-portlets/src/main: i18n-resources/ java/org/apache/geronimo/console/car/ webapp/WEB-INF/view/car/
Date Wed, 19 May 2010 08:38:17 GMT
Author: rwonly
Date: Wed May 19 08:38:16 2010
New Revision: 946083

URL: http://svn.apache.org/viewvc?rev=946083&view=rev
Log:
GERONIMO-5163 Admin console assemble server problems

Modified:
    geronimo/server/branches/2.2/plugins/console/plugin-portlets/src/main/i18n-resources/pluginportlets_en.properties
    geronimo/server/branches/2.2/plugins/console/plugin-portlets/src/main/i18n-resources/pluginportlets_zh.properties
    geronimo/server/branches/2.2/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/AssemblyConfirmHandler.java
    geronimo/server/branches/2.2/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/AssemblyListHandler.java
    geronimo/server/branches/2.2/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/AssemblyViewHandler.java
    geronimo/server/branches/2.2/plugins/console/plugin-portlets/src/main/webapp/WEB-INF/view/car/assemblyConfirm.jsp
    geronimo/server/branches/2.2/plugins/console/plugin-portlets/src/main/webapp/WEB-INF/view/car/assemblyName.jsp
    geronimo/server/branches/2.2/plugins/console/plugin-portlets/src/main/webapp/WEB-INF/view/car/assemblylist.jsp
    geronimo/server/branches/2.2/plugins/console/plugin-portlets/src/main/webapp/WEB-INF/view/car/viewForDownload.jsp

Modified: geronimo/server/branches/2.2/plugins/console/plugin-portlets/src/main/i18n-resources/pluginportlets_en.properties
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.2/plugins/console/plugin-portlets/src/main/i18n-resources/pluginportlets_en.properties?rev=946083&r1=946082&r2=946083&view=diff
==============================================================================
--- geronimo/server/branches/2.2/plugins/console/plugin-portlets/src/main/i18n-resources/pluginportlets_en.properties
(original)
+++ geronimo/server/branches/2.2/plugins/console/plugin-portlets/src/main/i18n-resources/pluginportlets_en.properties
Wed May 19 08:38:16 2010
@@ -93,7 +93,9 @@ car.list.assemblyArtifactId             
 car.list.assemblyFormat                       = Assembly format:
 car.list.assemblyGroupId                      = Assembly groupId:
 car.list.assemblyPath                         = Assembly target path:
+car.list.assemblyPath.description             = default: WASCE_HOME/var/temp/, can be set
to a relative path of WASCE_HOME or an absolute path
 car.list.assemblyVersion                      = Assembly version:
+car.list.assemblyVersion.description          = default: 1.0
 car.list.expertUser                           = Expert User (view all system plugins)
 car.list.filterByCategoryAndName              = Filter by category and name: 
 car.list.nameServer                           = Name the server to be assembled: 

Modified: geronimo/server/branches/2.2/plugins/console/plugin-portlets/src/main/i18n-resources/pluginportlets_zh.properties
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.2/plugins/console/plugin-portlets/src/main/i18n-resources/pluginportlets_zh.properties?rev=946083&r1=946082&r2=946083&view=diff
==============================================================================
--- geronimo/server/branches/2.2/plugins/console/plugin-portlets/src/main/i18n-resources/pluginportlets_zh.properties
(original)
+++ geronimo/server/branches/2.2/plugins/console/plugin-portlets/src/main/i18n-resources/pluginportlets_zh.properties
Wed May 19 08:38:16 2010
@@ -93,7 +93,9 @@ car.list.assemblyArtifactId             
 car.list.assemblyFormat                       = 新服务器格式:
 car.list.assemblyGroupId                      = 新服务器组 ID:
 car.list.assemblyPath                         = 新服务器保存路径:
+car.list.assemblyPath.description             = 默认值为:WASCE_HOME/var/temp/,可以设为WASCE_HOME下的相对路径,或任意绝对路径
 car.list.assemblyVersion                      = 新服务器版本:
+car.list.assemblyVersion.description          = 默认值为: 1.0
 car.list.expertUser                           = 专家用户(显示所有系统插件)
 car.list.filterByCategoryAndName              = 按照种类和名称过滤:
 car.list.nameServer                           = 命名要组装的新服务器:

Modified: geronimo/server/branches/2.2/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/AssemblyConfirmHandler.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.2/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/AssemblyConfirmHandler.java?rev=946083&r1=946082&r2=946083&view=diff
==============================================================================
--- geronimo/server/branches/2.2/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/AssemblyConfirmHandler.java
(original)
+++ geronimo/server/branches/2.2/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/AssemblyConfirmHandler.java
Wed May 19 08:38:16 2010
@@ -38,16 +38,18 @@ public class AssemblyConfirmHandler exte
     }
 
     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");
-        File deployedPath = new File(System.getProperty("org.apache.geronimo.home.dir"),
relativeServerPath);
+        String assemblyFileLocation = request.getParameter("assemblyFileLocation");
+        File deployedPath = new File(assemblyFileLocation);
+        if (!deployedPath.isAbsolute()) {
+            deployedPath = new File(System.getProperty("org.apache.geronimo.home.dir"), assemblyFileLocation);
+        }
+        
         String absoluteDeployedPath = deployedPath.getAbsolutePath();
         
         request.setAttribute("plugins", plugins);

Modified: geronimo/server/branches/2.2/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/AssemblyListHandler.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.2/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/AssemblyListHandler.java?rev=946083&r1=946082&r2=946083&view=diff
==============================================================================
--- geronimo/server/branches/2.2/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/AssemblyListHandler.java
(original)
+++ geronimo/server/branches/2.2/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/AssemblyListHandler.java
Wed May 19 08:38:16 2010
@@ -51,7 +51,7 @@ public class AssemblyListHandler extends
 
     public String actionBeforeView(ActionRequest request, ActionResponse response, MultiPageModel
model) throws PortletException, IOException {
         String column = (String) request.getAttribute("column");
-        String relativeServerPath = request.getParameter("relativeServerPath");
+        String targetPath = request.getParameter("targetPath");
         String groupId = request.getParameter("groupId");
         String artifactId = request.getParameter("artifactId");
         String version = request.getParameter("version");
@@ -59,7 +59,7 @@ public class AssemblyListHandler extends
         String type = request.getParameter("type");
 
         if(!isEmpty(column)) response.setRenderParameter("column", column);
-        response.setRenderParameter("relativeServerPath", isEmpty(relativeServerPath) ? "var/temp/assembly"
: relativeServerPath);
+        response.setRenderParameter("targetPath", isEmpty(targetPath) ? "var/temp/" : targetPath);
         if(!isEmpty(groupId)) response.setRenderParameter("groupId", groupId);
         if(!isEmpty(artifactId)) response.setRenderParameter("artifactId", artifactId);
         response.setRenderParameter("version", isEmpty(version) ? "1.0" : version);
@@ -73,7 +73,7 @@ public class AssemblyListHandler extends
 
     public void renderView(RenderRequest request, RenderResponse response, MultiPageModel
model) throws PortletException, IOException {
         String column = request.getParameter("column");
-        String relativeServerPath = request.getParameter("relativeServerPath");
+        String targetPath = request.getParameter("targetPath");
         String groupId = request.getParameter("groupId");
         String artifactId = request.getParameter("artifactId");
         String version = request.getParameter("version");
@@ -84,7 +84,7 @@ public class AssemblyListHandler extends
         }
             
         request.setAttribute("column", column);
-        request.setAttribute("relativeServerPath", relativeServerPath);
+        request.setAttribute("targetPath", targetPath);
         request.setAttribute("groupId", groupId);
         request.setAttribute("artifactId", artifactId);
         request.setAttribute("version", version);

Modified: geronimo/server/branches/2.2/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/AssemblyViewHandler.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.2/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/AssemblyViewHandler.java?rev=946083&r1=946082&r2=946083&view=diff
==============================================================================
--- geronimo/server/branches/2.2/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/AssemblyViewHandler.java
(original)
+++ geronimo/server/branches/2.2/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/AssemblyViewHandler.java
Wed May 19 08:38:16 2010
@@ -16,6 +16,7 @@
  */
 package org.apache.geronimo.console.car;
 
+import java.io.File;
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.List;
@@ -54,7 +55,7 @@ public class AssemblyViewHandler extends
         if (configId != null) {
             pluginIds = new String[]{configId};
         }
-        String relativeServerPath = request.getParameter("relativeServerPath");
+        String targetPath = request.getParameter("targetPath");
         String groupId = request.getParameter("groupId");
         String artifactId = request.getParameter("artifactId");
         String version = request.getParameter("version");
@@ -62,7 +63,7 @@ public class AssemblyViewHandler extends
 
         response.setRenderParameter("clickedConfigId", isEmpty(configId) ? "" : configId);
         response.setRenderParameter("pluginIds", pluginIds);
-        response.setRenderParameter("relativeServerPath", isEmpty(relativeServerPath) ? "var/temp/assembly"
: relativeServerPath);
+        response.setRenderParameter("targetPath", isEmpty(targetPath) ? "var/temp/" : targetPath);
         if(!isEmpty(groupId)) response.setRenderParameter("groupId", groupId);
         if(!isEmpty(artifactId)) response.setRenderParameter("artifactId", artifactId);
         response.setRenderParameter("version", isEmpty(version) ? "1.0" : version);
@@ -77,7 +78,7 @@ public class AssemblyViewHandler extends
 
         String clickedConfigId = request.getParameter("clickedConfigId");
         String[] configIds = request.getParameterValues("pluginIds");
-        String relativeServerPath = request.getParameter("relativeServerPath");
+        String targetPath = request.getParameter("targetPath");
         String groupId = request.getParameter("groupId");
         String artifactId = request.getParameter("artifactId");
         String version = request.getParameter("version");
@@ -95,7 +96,7 @@ public class AssemblyViewHandler extends
 
         request.setAttribute("clickedConfigId", clickedConfigId);
         request.setAttribute("plugins", plugins);
-        request.setAttribute("relativeServerPath", relativeServerPath);
+        request.setAttribute("targetPath", targetPath);
         request.setAttribute("groupId", groupId);
         request.setAttribute("artifactId", artifactId);
         request.setAttribute("version", version);
@@ -109,13 +110,12 @@ public class AssemblyViewHandler extends
     }
 
     public String actionAfterView(ActionRequest request, ActionResponse response, MultiPageModel
model) throws PortletException, IOException {
-        String relativeServerPath = request.getParameter("relativeServerPath");
+        String targetPath = request.getParameter("targetPath");
         String groupId = request.getParameter("groupId");
         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();
@@ -124,13 +124,27 @@ public class AssemblyViewHandler extends
         PluginListType list = getServerPluginList(request, pluginInstaller);
         PluginListType installList = getPluginsFromIds(configIds, list);
         
-
+        
+        // if the targetPath doesn't end with "/" or "\", add one.
+        if (targetPath.lastIndexOf("/") != targetPath.length()-1){
+            if (targetPath.lastIndexOf("\\") != targetPath.length()-1){
+                targetPath = targetPath + "/";
+            }
+        }
+        
+        String targetBasePath = targetPath + groupId +"/";
+        String targetAssemblyPath = targetBasePath + artifactId+"-"+version;
+        String targetArchivePath = targetBasePath;
+        
         try {
-            DownloadResults downloadResults = pluginInstaller.installPluginList("repository",
relativeServerPath, installList);
-            archiver.archive(relativeServerPath, "var/temp", new Artifact(groupId, artifactId,
version, format));
+            DownloadResults downloadResults = pluginInstaller.installPluginList("repository",
targetAssemblyPath, installList);
+            archiver.archive(targetAssemblyPath, targetArchivePath, new Artifact(groupId,
artifactId, version, format));
         } catch (Exception e) {
             throw new PortletException("Could not assemble server", e);
         }
+        
+        response.setRenderParameter("assemblyFileLocation", targetBasePath);
+        
         return ASSEMBLY_CONFIRM_MODE+BEFORE_ACTION;
     }
 

Modified: geronimo/server/branches/2.2/plugins/console/plugin-portlets/src/main/webapp/WEB-INF/view/car/assemblyConfirm.jsp
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.2/plugins/console/plugin-portlets/src/main/webapp/WEB-INF/view/car/assemblyConfirm.jsp?rev=946083&r1=946082&r2=946083&view=diff
==============================================================================
--- geronimo/server/branches/2.2/plugins/console/plugin-portlets/src/main/webapp/WEB-INF/view/car/assemblyConfirm.jsp
(original)
+++ geronimo/server/branches/2.2/plugins/console/plugin-portlets/src/main/webapp/WEB-INF/view/car/assemblyConfirm.jsp
Wed May 19 08:38:16 2010
@@ -44,7 +44,8 @@
 <br>
 <p>File Location: ${absoluteDeployedPath}</p>
 <br>
-<form method=POST">
-<input type="submit" value='<fmt:message key="consolebase.common.done" />' onclick="history.go(-4);
return false;" />
+<form action="<portlet:actionURL/>" method="POST">
+<input id="mode" type="hidden" name="mode" value="assemblyConfirm-after"/>
+<input type="submit" value='<fmt:message key="consolebase.common.done" />' />
 </form>
 

Modified: geronimo/server/branches/2.2/plugins/console/plugin-portlets/src/main/webapp/WEB-INF/view/car/assemblyName.jsp
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.2/plugins/console/plugin-portlets/src/main/webapp/WEB-INF/view/car/assemblyName.jsp?rev=946083&r1=946082&r2=946083&view=diff
==============================================================================
--- geronimo/server/branches/2.2/plugins/console/plugin-portlets/src/main/webapp/WEB-INF/view/car/assemblyName.jsp
(original)
+++ geronimo/server/branches/2.2/plugins/console/plugin-portlets/src/main/webapp/WEB-INF/view/car/assemblyName.jsp
Wed May 19 08:38:16 2010
@@ -51,18 +51,22 @@
 <tr>
   <td><label for="<portlet:namespace/>groupId"><fmt:message key="car.list.assemblyGroupId"/></label></td>
   <td><input type="text" name="groupId" id="<portlet:namespace/>groupId" value="${groupId}"/></td>
+  <td>*</td>
 </tr>
 <tr>
   <td><label for="<portlet:namespace/>artifactId"><fmt:message key="car.list.assemblyArtifactId"/></label></td>
   <td><input type="text" name="artifactId" id="<portlet:namespace/>artifactId"
value="${artifactId}"/></td>
+  <td>*</td>
 </tr>
 <tr>
   <td><label for="<portlet:namespace/>version"><fmt:message key="car.list.assemblyVersion"/></label></td>
   <td><input type="text" name="version" id="<portlet:namespace/>version" value="${version}"/></td>
+  <td><fmt:message key="car.list.assemblyVersion.description"/></td>
 </tr>
 <tr>
-  <td><label for="<portlet:namespace/>relativeServerPath"><fmt:message
key="car.list.assemblyPath"/></label></td>
-  <td><input type="text" name="relativeServerPath" id="<portlet:namespace/>relativeServerPath"
value="${relativeServerPath}"/></td>
+  <td><label for="<portlet:namespace/>targetPath"><fmt:message key="car.list.assemblyPath"/></label></td>
+  <td><input type="text" name="targetPath" id="<portlet:namespace/>targetPath"
value="${targetPath}"/></td>
+  <td><fmt:message key="car.list.assemblyPath.description"/></td>
 </tr>
 <tr>
   <td><label for="<portlet:namespace/>format"><fmt:message key="car.list.assemblyFormat"/></label></td>
@@ -71,6 +75,8 @@
         <option <c:if test="${format eq 'zip'}">selected="true"</c:if>>zip</option>
       </select>
   </td>
+  <td></td>
+</tr>
 </table>
 
     <input type="hidden" name="type" value="${type}"/>

Modified: geronimo/server/branches/2.2/plugins/console/plugin-portlets/src/main/webapp/WEB-INF/view/car/assemblylist.jsp
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.2/plugins/console/plugin-portlets/src/main/webapp/WEB-INF/view/car/assemblylist.jsp?rev=946083&r1=946082&r2=946083&view=diff
==============================================================================
--- geronimo/server/branches/2.2/plugins/console/plugin-portlets/src/main/webapp/WEB-INF/view/car/assemblylist.jsp
(original)
+++ geronimo/server/branches/2.2/plugins/console/plugin-portlets/src/main/webapp/WEB-INF/view/car/assemblylist.jsp
Wed May 19 08:38:16 2010
@@ -327,7 +327,7 @@
 </c:otherwise>
 </c:choose>
 
-    <input type="hidden" name="relativeServerPath" value="${relativeServerPath}"/>
+    <input type="hidden" name="targetPath" value="${targetPath}"/>
     <input type="hidden" name="groupId" value="${groupId}"/>
     <input type="hidden" name="artifactId" value="${artifactId}"/>
     <input type="hidden" name="version" value="${version}"/>

Modified: geronimo/server/branches/2.2/plugins/console/plugin-portlets/src/main/webapp/WEB-INF/view/car/viewForDownload.jsp
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.2/plugins/console/plugin-portlets/src/main/webapp/WEB-INF/view/car/viewForDownload.jsp?rev=946083&r1=946082&r2=946083&view=diff
==============================================================================
--- geronimo/server/branches/2.2/plugins/console/plugin-portlets/src/main/webapp/WEB-INF/view/car/viewForDownload.jsp
(original)
+++ geronimo/server/branches/2.2/plugins/console/plugin-portlets/src/main/webapp/WEB-INF/view/car/viewForDownload.jsp
Wed May 19 08:38:16 2010
@@ -76,7 +76,6 @@
     </td>
   </tr>
   <tr>
-  <tr>
     <th align="right" valign="top"><fmt:message key="car.viewForDownload.jvmVersions"
/>:</th>
     <td>
       <c:choose>
@@ -148,7 +147,7 @@
       <td valign="top">
         <input type="submit" value='<fmt:message key="car.common.assemble" />'/>
         <input type="hidden" name="mode" value="${mode}" />
-        <input type="hidden" name="relativeServerPath" value="${relativeServerPath}"/>
+        <input type="hidden" name="targetPath" value="${targetPath}"/>
         <input type="hidden" name="groupId" value="${groupId}"/>
         <input type="hidden" name="artifactId" value="${artifactId}"/>
         <input type="hidden" name="version" value="${version}"/>



Mime
View raw message