geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r830774 - in /geronimo/server/branches/2.2/plugins/console/console-base-portlets/src/main: i18n-resources/ java/org/apache/geronimo/console/repository/ webapp/WEB-INF/view/repository/
Date Wed, 28 Oct 2009 21:59:33 GMT
Author: djencks
Date: Wed Oct 28 21:59:33 2009
New Revision: 830774

URL: http://svn.apache.org/viewvc?rev=830774&view=rev
Log:
GERONIMO-4759 remove function for non-car repository artifacts.  Modified patch from Victor
Fang

Modified:
    geronimo/server/branches/2.2/plugins/console/console-base-portlets/src/main/i18n-resources/consolebase_en.properties
    geronimo/server/branches/2.2/plugins/console/console-base-portlets/src/main/i18n-resources/consolebase_zh.properties
    geronimo/server/branches/2.2/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/repository/RepositoryViewPortlet.java
    geronimo/server/branches/2.2/plugins/console/console-base-portlets/src/main/webapp/WEB-INF/view/repository/normal.jsp

Modified: geronimo/server/branches/2.2/plugins/console/console-base-portlets/src/main/i18n-resources/consolebase_en.properties
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.2/plugins/console/console-base-portlets/src/main/i18n-resources/consolebase_en.properties?rev=830774&r1=830773&r2=830774&view=diff
==============================================================================
--- geronimo/server/branches/2.2/plugins/console/console-base-portlets/src/main/i18n-resources/consolebase_en.properties
(original)
+++ geronimo/server/branches/2.2/plugins/console/console-base-portlets/src/main/i18n-resources/consolebase_en.properties
Wed Oct 28 21:59:33 2009
@@ -203,6 +203,7 @@
 consolebase.common.next            = Next
 consolebase.common.password        = Password
 consolebase.common.refresh         = Refresh
+consolebase.common.remove          = Remove
 consolebase.common.reset           = Reset
 consolebase.common.restart         = Restart
 consolebase.common.return          = Return

Modified: geronimo/server/branches/2.2/plugins/console/console-base-portlets/src/main/i18n-resources/consolebase_zh.properties
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.2/plugins/console/console-base-portlets/src/main/i18n-resources/consolebase_zh.properties?rev=830774&r1=830773&r2=830774&view=diff
==============================================================================
--- geronimo/server/branches/2.2/plugins/console/console-base-portlets/src/main/i18n-resources/consolebase_zh.properties
(original)
+++ geronimo/server/branches/2.2/plugins/console/console-base-portlets/src/main/i18n-resources/consolebase_zh.properties
Wed Oct 28 21:59:33 2009
@@ -203,6 +203,7 @@
 consolebase.common.next            = 下一步
 consolebase.common.password        = 密码
 consolebase.common.refresh         = 刷新
+consolebase.common.remove          = 移除
 consolebase.common.reset           = 重置
 consolebase.common.restart         = 重启
 consolebase.common.return          = 返回

Modified: geronimo/server/branches/2.2/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/repository/RepositoryViewPortlet.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.2/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/repository/RepositoryViewPortlet.java?rev=830774&r1=830773&r2=830774&view=diff
==============================================================================
--- geronimo/server/branches/2.2/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/repository/RepositoryViewPortlet.java
(original)
+++ geronimo/server/branches/2.2/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/repository/RepositoryViewPortlet.java
Wed Oct 28 21:59:33 2009
@@ -33,6 +33,7 @@
 import org.apache.geronimo.kernel.repository.FileWriteMonitor;
 import org.apache.geronimo.kernel.repository.ListableRepository;
 import org.apache.geronimo.kernel.repository.WriteableRepository;
+import org.apache.geronimo.kernel.repository.Maven2Repository;
 import org.apache.geronimo.system.resolver.ExplicitDefaultArtifactResolver;
 
 import javax.portlet.ActionRequest;
@@ -92,12 +93,36 @@
             actionResponse.setRenderParameter("mode", "usage");
             actionResponse.setRenderParameter("res", res);
             return;
+        }        
+        
+        if(action != null && action.equals("remove")) {
+            // User clicked on a repository remove
+            String res = actionRequest.getParameter("res");
+            actionResponse.setRenderParameter("mode", "remove");
+            actionResponse.setRenderParameter("res", res);
+            Maven2Repository repo = (Maven2Repository) PortletManager.getCurrentServer(actionRequest).getRepositories()[0];
+            Artifact artifact = Artifact.create(res);
+            File location = repo.getLocation(artifact);
+            if (location == null) {
+                return;//??
+            }
+            if (location.isDirectory()) {
+                //don't use this to uninstall plugins
+                return;//??
+            }
+            while (true) {
+                location.delete();
+                location = location.getParentFile();
+                File[] contents = location.listFiles();
+                if (contents == null || contents.length == 0) {
+                    return;
+                }
+            }
         }
 
         try {
 
 
-            List list = new ArrayList();
             WriteableRepository repo = PortletManager.getCurrentServer(actionRequest).getWritableRepositories()[0];
 
             File uploadFile = null;

Modified: geronimo/server/branches/2.2/plugins/console/console-base-portlets/src/main/webapp/WEB-INF/view/repository/normal.jsp
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.2/plugins/console/console-base-portlets/src/main/webapp/WEB-INF/view/repository/normal.jsp?rev=830774&r1=830773&r2=830774&view=diff
==============================================================================
--- geronimo/server/branches/2.2/plugins/console/console-base-portlets/src/main/webapp/WEB-INF/view/repository/normal.jsp
(original)
+++ geronimo/server/branches/2.2/plugins/console/console-base-portlets/src/main/webapp/WEB-INF/view/repository/normal.jsp
Wed Oct 28 21:59:33 2009
@@ -163,7 +163,29 @@
 <b><fmt:message key="repository.normal.currentRepositoryEntries"/></b>
 <p><fmt:message key="repository.normal.toViewUsage"/></p>
 <ul>
-<c:forEach items="${reslist}" var="res">
-<li><a href="<portlet:actionURL portletMode="view"><portlet:param name="action"
value="usage"/><portlet:param name="res" value="${res}"/></portlet:actionURL>"><c:out
value="${res}"/></a></li>
-</c:forEach>
+<table width="100%" class="TableLine" summary="Repository Manager">
+    <tr class="DarkBackground">
+        <th scope="col" align="left">&nbsp;<fmt:message key="configmanager.normal.componentName"
/></th>   
+        <th scope="col" align="left">&nbsp;<fmt:message key="consolebase.common.commands"/></th>
+    </tr>
+    <c:set var="backgroundClass" value='MediumBackground'/>
+	  <c:forEach items="${reslist}" var="res">
+	      <c:choose>
+          <c:when test="${backgroundClass == 'MediumBackground'}" >
+              <c:set var="backgroundClass" value='LightBackground'/>
+          </c:when>
+          <c:otherwise>
+              <c:set var="backgroundClass" value='MediumBackground'/>
+          </c:otherwise>
+      </c:choose>
+      <tr>
+        <td class="${backgroundClass}">
+	      <a href="<portlet:actionURL portletMode="view"><portlet:param name="action"
value="usage"/><portlet:param name="res" value="${res}"/></portlet:actionURL>"><c:out
value="${res}"/></a>
+	    </td>
+	    <td class="${backgroundClass}">
+	      <a href="<portlet:actionURL portletMode="view"><portlet:param name="action"
value="remove"/><portlet:param name="res" value="${res}"/></portlet:actionURL>"><fmt:message
key="consolebase.common.remove"/></a>
+	    </td>
+	  </tr>
+	</c:forEach>
+</table>
 </ul>



Mime
View raw message