geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rwo...@apache.org
Subject svn commit: r949693 - 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 Mon, 31 May 2010 08:55:33 GMT
Author: rwonly
Date: Mon May 31 08:55:33 2010
New Revision: 949693

URL: http://svn.apache.org/viewvc?rev=949693&view=rev
Log:
GERONIMO-5177 Removing an entry from the Repository results in NullPointerException(original
patch from Ben Liang, Thanks!)

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/i18n-resources/portletinfo_en.properties
    geronimo/server/branches/2.2/plugins/console/console-base-portlets/src/main/i18n-resources/portletinfo_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=949693&r1=949692&r2=949693&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
Mon May 31 08:55:33 2010
@@ -394,6 +394,9 @@ repository.normal.title                 
 repository.normal.toViewUsage              = Click an entry to view usage.
 repository.usage.content                   = To use <b>{0}</b> in an application
or a module, add a dependency element under dependencies in environment element in it's deployment
plan as shown below:
 repository.usage.title                     = Usage for {0}
+repository.remove.confirm                  = Are you sure to remove the component 
+repository.remove.ok                       = &nbsp;&nbsp;&nbsp;OK&nbsp;&nbsp;&nbsp;
+repository.remove.cancel                   = &nbsp;CANCEL&nbsp;
 
 securityrealmmanager.common.add                            = Add
 securityrealmmanager.common.emptyText                      = The focussed field must not
be empty.

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=949693&r1=949692&r2=949693&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
Mon May 31 08:55:33 2010
@@ -394,6 +394,9 @@ repository.normal.title                 
 repository.normal.toViewUsage              = 点击每个条目来查看用法。
 repository.usage.content                   = 要在一个应用程序或模块中使用<b>{0}</b>,请在部署计划中的environment元素中的dependencies小节中添加一个dependency元素,如下所示:
 repository.usage.title                     = {0}使用方法
+repository.remove.confirm                  = 您确定删除这个组件吗?

+repository.remove.ok                       = 确定
+repository.remove.cancel                   = 取消
 
 securityrealmmanager.common.add                            = 添加
 securityrealmmanager.common.emptyText                      = 焦点所在字段不能为空。

Modified: geronimo/server/branches/2.2/plugins/console/console-base-portlets/src/main/i18n-resources/portletinfo_en.properties
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.2/plugins/console/console-base-portlets/src/main/i18n-resources/portletinfo_en.properties?rev=949693&r1=949692&r2=949693&view=diff
==============================================================================
--- geronimo/server/branches/2.2/plugins/console/console-base-portlets/src/main/i18n-resources/portletinfo_en.properties
(original)
+++ geronimo/server/branches/2.2/plugins/console/console-base-portlets/src/main/i18n-resources/portletinfo_en.properties
Mon May 31 08:55:33 2010
@@ -133,6 +133,8 @@ consolebase.errorMsg21 = Unable to get n
 consolebase.errorMsg22 = Errors in user input while processing a CSR.
 consolebase.errorMsg23 = Errors encountered while issuing certificate.
 consolebase.errorMsg24 = Default properties-login module does not exist, it might be replaced
by a customized login module.
+consolebase.errorMsg25 = An error occure when removing  
+consolebase.errorMsg26 = The component is not found in any repository.
 consolebase.infoMsg01  = Started application
 consolebase.infoMsg02  = Stopped application
 consolebase.infoMsg03  = Restarted application
@@ -151,6 +153,8 @@ consolebase.infoMsg15  = CA Setup is suc
 consolebase.infoMsg16  = Approved CSR. id = <b>{0}</b>.
 consolebase.infoMsg17  = Rejected and deleted CSR. id = <b>{0}</b>.
 consolebase.infoMsg18  = Certificate Issued successfully. This Certificate details can also
be viewed using the serial number <b>{0}</b> with the 'View Issued Certificate'
link provided in the CA home screen.
+consolebase.infoMsg19  = &nbsp;has been successfully removed from repository.
+consolebase.infoMsg20  = The component is a directory which should not be removed.
 consolebase.warnMsg01  = Invalid value for changeState: 
 consolebase.warnMsg02  = No modules found of this type
 consolebase.warnMsg03  = Web statistics are not supported for the current web container.
@@ -159,3 +163,9 @@ consolebase.warnMsg05  = CA is not runni
 consolebase.warnMsg06  = A certificate with the serial number <b>{0}</b> has
already been issued. You might be seeing this message since you have clicked 'Issue Certificate'
button a second time.
 consolebase.warnMsg07  = <p style='font-size:120%;'><b>A shutdown of the server
will disable this Web Console! Proceed only if you are certain you want to terminate the server.</b></p>
 consolebase.warnMsg08  = There are no Web Containers defined.
+
+
+repository.remove.successMsg  = &nbsp;has been successfully removed from repository.
+repository.remove.errorMsg01  = An error occure when removing    
+repository.remove.errorMsg02  = The component is not found in any repository.
+repository.remove.infoMsg01   = The component is a directory which should not be removed.

Modified: geronimo/server/branches/2.2/plugins/console/console-base-portlets/src/main/i18n-resources/portletinfo_zh.properties
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.2/plugins/console/console-base-portlets/src/main/i18n-resources/portletinfo_zh.properties?rev=949693&r1=949692&r2=949693&view=diff
==============================================================================
--- geronimo/server/branches/2.2/plugins/console/console-base-portlets/src/main/i18n-resources/portletinfo_zh.properties
(original)
+++ geronimo/server/branches/2.2/plugins/console/console-base-portlets/src/main/i18n-resources/portletinfo_zh.properties
Mon May 31 08:55:33 2010
@@ -135,6 +135,8 @@ consolebase.errorMsg21 = 无法ä� consolebase.errorMsg22 = 处理CSR时用户输入错误。
 consolebase.errorMsg23 = 颁发证书时遇到错误。
 consolebase.errorMsg24 = 默认的登录模块不存在, 可能被自定义的登录模块替换。
+consolebase.errorMsg25 = 删除出现错误
+consolebase.errorMsg26 = 这个组件在存储库中未找到
 consolebase.infoMsg01  = 已启动应用
 consolebase.infoMsg02  = 已停止应用
 consolebase.infoMsg03  = 已重启应用
@@ -153,6 +155,8 @@ consolebase.infoMsg15  = CA设置� consolebase.infoMsg16  = 批准了id为<b>{0}</b>的CSR.
 consolebase.infoMsg17  = 拒绝并删除了id为<b>{0}</b>的CSR.
 consolebase.infoMsg18  = 成功发布证书。在CA的主页面点击'查看已发布证书'链接并使用序列号<b>{0}</b>,也可以查看证书详情。
+consolebase.infoMsg19  = &nbsp;已成功删除
+consolebase.infoMsg20  = 文件目录不能删除
 consolebase.warnMsg01  = 无效的改变状态值:
 consolebase.warnMsg02  = 未找到该类型的模块
 consolebase.warnMsg03  = 该Web容器不支持Web统计数据
@@ -161,3 +165,7 @@ consolebase.warnMsg05  = CA未处� consolebase.warnMsg06  = 序列号为<b>{0}</b>的证书先前已被发布,当你点击了'发布证书'按钮两次时你可能会看到这条消息。
 consolebase.warnMsg07  = <p style='font-size:120%;'><b>关闭服务器将会使Web控制台不可用!只有当你确定要关闭服务器时,才继续。</b></p>
 consolebase.warnMsg08  = 未定义任何Web容器。
+repository.remove.successMsg  = &nbsp;已成功删除
+repository.remove.errorMsg01  = 删除时出现错误
+repository.remove.errorMsg02  = 这个组件在存储库中不存在
+repository.remove.infoMsg01   = 文件目录不能删除
\ No newline at end of file

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=949693&r1=949692&r2=949693&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
Mon May 31 08:55:33 2010
@@ -17,43 +17,49 @@
 
 package org.apache.geronimo.console.repository;
 
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+import java.util.SortedSet;
+
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.PortletConfig;
+import javax.portlet.PortletContext;
+import javax.portlet.PortletException;
+import javax.portlet.PortletRequestDispatcher;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.WindowState;
+
 import org.apache.commons.fileupload.FileItem;
 import org.apache.commons.fileupload.FileUploadException;
 import org.apache.commons.fileupload.disk.DiskFileItemFactory;
 import org.apache.commons.fileupload.portlet.PortletFileUpload;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 import org.apache.geronimo.console.BasePortlet;
 import org.apache.geronimo.console.util.PortletManager;
 import org.apache.geronimo.kernel.GBeanNotFoundException;
 import org.apache.geronimo.kernel.InternalKernelException;
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.KernelRegistry;
+import org.apache.geronimo.kernel.config.Configuration;
+import org.apache.geronimo.kernel.config.ConfigurationManager;
+import org.apache.geronimo.kernel.config.ConfigurationUtil;
 import org.apache.geronimo.kernel.repository.Artifact;
 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.kernel.repository.WriteableRepository;
 import org.apache.geronimo.system.resolver.ExplicitDefaultArtifactResolver;
-
-import javax.portlet.ActionRequest;
-import javax.portlet.ActionResponse;
-import javax.portlet.PortletConfig;
-import javax.portlet.PortletContext;
-import javax.portlet.PortletException;
-import javax.portlet.PortletRequestDispatcher;
-import javax.portlet.RenderRequest;
-import javax.portlet.RenderResponse;
-import javax.portlet.WindowState;
-import java.io.File;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Properties;
-import java.util.SortedSet;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * @version $Rev$ $Date$
@@ -63,6 +69,12 @@ public class RepositoryViewPortlet exten
     private static final Logger log = LoggerFactory.getLogger(RepositoryViewPortlet.class);
 
     private Kernel kernel;
+    
+    private ConfigurationManager configrationManager;
+    
+    private Map<Artifact,LinkedHashSet> childToParents=new HashMap<Artifact,LinkedHashSet>();
+    
+    private Map<Artifact,LinkedHashSet<Artifact>> parentToChildren=new HashMap<Artifact,LinkedHashSet<Artifact>>();
 
     private PortletContext ctx;
 
@@ -75,6 +87,9 @@ public class RepositoryViewPortlet exten
     public void init(PortletConfig portletConfig) throws PortletException {
         super.init(portletConfig);
         kernel = KernelRegistry.getSingleKernel();
+        
+        configrationManager=ConfigurationUtil.getConfigurationManager(kernel);
+        
         ctx = portletConfig.getPortletContext();
         normalView = ctx
                 .getRequestDispatcher("/WEB-INF/view/repository/normal.jsp");
@@ -87,6 +102,7 @@ public class RepositoryViewPortlet exten
     public void processAction(ActionRequest actionRequest,
                               ActionResponse actionResponse) throws PortletException, IOException
{
         String action = actionRequest.getParameter("action");
+        actionResponse.setRenderParameter("message", ""); // set to blank first
         if(action != null && action.equals("usage")) {
             // User clicked on a repository entry to view usage
             String res = actionRequest.getParameter("res");
@@ -100,29 +116,39 @@ public class RepositoryViewPortlet exten
             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;//??
+                addErrorMessage(actionRequest, getLocalizedString(actionRequest, "consolebase.errorMsg26"));
+                return;
             }
             if (location.isDirectory()) {
-                //don't use this to uninstall plugins
-                return;//??
+                addInfoMessage(actionRequest,getLocalizedString(actionRequest, "consolebase.infoMsg20"));
+                return;
             }
-            while (true) {
-                location.delete();
-                location = location.getParentFile();
-                File[] contents = location.listFiles();
-                if (contents == null || contents.length == 0) {
-                    return;
+            boolean result=location.delete();
+            if(!result){//can not delete the file maybe the jar is using in the JVM
+                addErrorMessage(actionRequest, getLocalizedString(actionRequest, "consolebase.errorMsg25")+artifact.toString()+showReason(artifact));
+                return;
+            }else{//delete parent folder
+                File versionDir=location.getParentFile();
+                File[] contents=versionDir.listFiles();
+                for(File content:contents){
+                    if(!content.delete()){
+                        addErrorMessage(actionRequest, getLocalizedString(actionRequest,
"consolebase.errorMsg25")+artifact.toString()+showReason(artifact));
+                        return;
+                    }
                 }
+                versionDir.delete();
+                addInfoMessage(actionRequest,artifact.toString()+getLocalizedString(actionRequest,"consolebase.infoMsg19"));

+                return;
+            
             }
         }
 
         try {
-
-
             WriteableRepository repo = PortletManager.getCurrentServer(actionRequest).getWritableRepositories()[0];
 
             File uploadFile = null;
@@ -228,13 +254,16 @@ public class RepositoryViewPortlet exten
         }
     }
 
-    protected void doView(RenderRequest request, RenderResponse response)
+	protected void doView(RenderRequest request, RenderResponse response)
             throws PortletException, IOException {
         // i think generic portlet already does this
         if (WindowState.MINIMIZED.equals(request.getWindowState())) {
             return;
         }
-
+        childToParents.clear();
+        parentToChildren.clear();
+        
+        
         String mode = request.getParameter("mode");
         if(mode != null && mode.equals("usage")) {
             String res = request.getParameter("res");
@@ -247,26 +276,37 @@ public class RepositoryViewPortlet exten
             usageView.include(request, response);
             return;
         }
-
+        
         try {
-            List list = new ArrayList();
-            ListableRepository[] repos = PortletManager.getCurrentServer(request).getRepositories();
-            for (int i = 0; i < repos.length; i++) {
-                ListableRepository repo = repos[i];
-                final SortedSet artifacts = repo.list();
+            ListableRepository[] repos = PortletManager.getCurrentServer(request).getRepositories();
    
+            List moduleList=new ArrayList();
+            for(int i=0;i<repos.length;i++){
+                ListableRepository repo=repos[i];
+                
+                final SortedSet artifacts=repo.list();
                 for (Iterator iterator = artifacts.iterator(); iterator.hasNext();) {
                     String fileName = iterator.next().toString();
-                    list.add(fileName);
+                    ModuleDetails module=new ModuleDetails(fileName);
+                    moduleList.add(module);
+                    
+                    Configuration configration=configrationManager.getConfiguration(Artifact.create(fileName));
+                    
+                    if(configration!=null){
+                        Artifact configId=configration.getId();
+                        LinkedHashSet<Artifact> dependencies=configration.getDependencies();
+                        
+                        for(Artifact dependency:dependencies){
+                            addParent(configId,dependency);
+                            addChildren(dependency,configId);
+                        }
+                    }
                 }
             }
-            Collections.sort(list);
-
-            request.setAttribute("org.apache.geronimo.console.repo.list", list);
 
+            request.setAttribute("org.apache.geronimo.console.repo.list", moduleList);
         } catch (Exception e) {
             throw new PortletException(e);
         }
-
         normalView.include(request, response);
     }
 
@@ -303,4 +343,71 @@ public class RepositoryViewPortlet exten
         return listing;
     }
 
+    
+    public void addParent(Artifact child,Artifact parent){
+        if(!childToParents.containsKey(child)){
+            LinkedHashSet <Artifact> parents=new LinkedHashSet<Artifact>();
+            parents.add(parent);
+            childToParents.put(child, parents);
+        }else{
+            childToParents.get(child).add(parent);
+        }
+    }
+    
+    public void addChildren(Artifact parent,Artifact child){
+        if(!parentToChildren.containsKey(parent)){
+            LinkedHashSet<Artifact> children=new LinkedHashSet<Artifact>();
+            children.add(child);
+            parentToChildren.put(parent, children);
+        }else{
+            parentToChildren.get(parent).add(child);
+        }
+    }
+    
+    private String showReason(Artifact artifact){
+        StringBuffer sb=new StringBuffer();
+        sb.append("<br/><br/>Error Reason:the component is using within the server.<br/><br/>");
+        LinkedHashSet<Artifact> children=parentToChildren.get(artifact);
+        if(children!=null){
+            sb.append("The children of "+artifact+":");
+            for(Iterator<Artifact> it=children.iterator();it.hasNext();){
+                sb.append("<br/><span style='padding-left:20px'/>->");
+                sb.append(it.next());
+            }
+        }
+        
+        LinkedHashSet<Artifact> parents=childToParents.get(artifact);
+        if(parents!=null){
+            sb.append("The parents of "+artifact+":<br/>");
+            for(Iterator<Artifact> it=parents.iterator();it.hasNext();){
+                sb.append("<br/><span style='padding-left:20px'/>->");
+                sb.append(it.next());
+            }
+        }
+        return sb.toString();
+    }
+    
+    public static class ModuleDetails{
+        private String name;
+        private boolean shouldRemove;
+        public ModuleDetails(String fileName){
+            name=fileName;
+            shouldRemove=checkShouldRemove(name);
+        }
+        
+        public boolean checkShouldRemove(String name){
+            if(name.endsWith("jar"))
+                return true;
+            return false;
+        }
+        
+        public String getName(){
+            return name;
+        }
+        
+        public boolean getShouldRemove(){
+            return shouldRemove;
+        }
+    
+    }
 }

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=949693&r1=949692&r2=949693&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
Mon May 31 08:55:33 2010
@@ -20,16 +20,20 @@
 <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
 <%@ taglib uri="http://java.sun.com/portlet" prefix="portlet"%>
 <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
+<%@ taglib uri="/WEB-INF/CommonMsg.tld" prefix="CommonMsg"%>
+
 <fmt:setBundle basename="consolebase"/>
 <portlet:defineObjects/>
 
+<CommonMsg:confirmMsg/>
 <c:set var="reslist" value="${requestScope['org.apache.geronimo.console.repo.list']}"/>
 
+
 <style type="text/css">  
     div.Hidden {
         display: none;
     }
-	
+
     div.Shown {
         display: block;
     font-size: 10px;
@@ -113,8 +117,12 @@ function <portlet:namespace/>parse(local
     }
 }
 
+function removePrompt(target,componentName){
+    return showConfirmMessage(target, '<fmt:message key="repository.remove.confirm"/>'
+ componentName + '?', '<fmt:message key="repository.remove.ok"/>', '<fmt:message
key="repository.remove.cancel"/>');
+}
 </script>
 
+<CommonMsg:commonMsg/>
 <div id="<portlet:namespace/>CommonMsgContainer"></div><br>
 
 <table width="100%">
@@ -124,7 +132,7 @@ function <portlet:namespace/>parse(local
   <input type="hidden" value="deploy" name="action"/>
   <table width="80%">
     <tr>
-      <th colspan="2" align="center"><fmt:message key="repository.normal.addArchiveToRepository"/></th>
+      <td colspan="2" align="center"><b><fmt:message key="repository.normal.addArchiveToRepository"/></b></td>
     </tr>
     <tr>
       <td align="right" width="40%"><label for="<portlet:namespace/>local"><fmt:message
key="consolebase.common.file"/></label></td>
@@ -166,30 +174,36 @@ function <portlet:namespace/>parse(local
 
 <b><fmt:message key="repository.normal.currentRepositoryEntries"/></b>
 <p><fmt:message key="repository.normal.toViewUsage"/></p>
-<ul>
+
 <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 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.name}"/></portlet:actionURL>"><c:out
value="${res.name}"/></a>
+            </td>
+            <td class="${backgroundClass}">
+                <c:if test="${res.shouldRemove}">
+                    <a href="<portlet:actionURL portletMode="view" ><portlet:param
name="action" value="remove"/><portlet:param name="res" value="${res.name}"/></portlet:actionURL>"

+                    onClick="return removePrompt(this, '${res.name}');"><fmt:message
key="consolebase.common.remove"/></a>
+                </c:if>
+                <c:if test="${!res.shouldRemove}">
+                     &nbsp;
+                </c:if>
+            </td>
+          </tr>
 	</c:forEach>
 </table>
-</ul>
+



Mime
View raw message