Author: wesleyhales
Date: 2008-03-18 16:35:58 -0400 (Tue, 18 Mar 2008)
New Revision: 10313
Modified:
modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/portal/admin/ui/AdminPortlet.java
modules/portlet/trunk/portal/src/main/resources/simple-portal-war/css/admin.css
Log:
admin portlet - small fixes
Modified:
modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/portal/admin/ui/AdminPortlet.java
===================================================================
---
modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/portal/admin/ui/AdminPortlet.java 2008-03-18
20:15:05 UTC (rev 10312)
+++
modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/portal/admin/ui/AdminPortlet.java 2008-03-18
20:35:58 UTC (rev 10313)
@@ -22,27 +22,23 @@
******************************************************************************/
package org.jboss.portal.portlet.portal.admin.ui;
-import org.jboss.portal.portlet.container.managed.PortletApplicationRegistry;
+import org.jboss.portal.common.i18n.LocalizedString;
+import org.jboss.portal.portlet.container.managed.ManagedObject;
import org.jboss.portal.portlet.container.managed.ManagedPortletApplication;
import org.jboss.portal.portlet.container.managed.ManagedPortletContainer;
import org.jboss.portal.portlet.container.managed.ManagedPortletFilter;
-import org.jboss.portal.portlet.container.managed.ManagedObject;
-import org.jboss.portal.portlet.info.PortletInfo;
+import org.jboss.portal.portlet.container.managed.PortletApplicationRegistry;
import org.jboss.portal.portlet.info.MetaInfo;
-import org.jboss.portal.common.i18n.LocalizedString;
-import static org.jboss.unit.api.Assert.assertNotNull;
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
import javax.portlet.GenericPortlet;
+import javax.portlet.PortletException;
+import javax.portlet.PortletURL;
import javax.portlet.RenderRequest;
import javax.portlet.RenderResponse;
-import javax.portlet.PortletException;
-import javax.portlet.ActionRequest;
-import javax.portlet.ActionResponse;
-import javax.portlet.PortletURL;
-import javax.portlet.PortletRequestDispatcher;
import java.io.IOException;
import java.io.PrintWriter;
-import java.util.Locale;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -120,19 +116,19 @@
//
writer.print("" +
- "" +
- "" +
- "<div class=\"admin-container full-width\">\n" +
- " <div class=\"admin-header\">\n"
+
- " <div class=\"expand\">\n" +
- " <img
src=\"/simple-portal/images/admin/expand.gif\" alt=\"\"/><a
href=\"javascript:expandAll();\">Expand All</a>\n" +
- " </div>\n" +
- " <div class=\"collapse\">\n"
+
- " <img
src=\"/simple-portal/images/admin/contract.gif\" alt=\"\"/><a
href=\"javascript:collapseAll();\">Collapse All</a>\n" +
- " </div>\n" +
- " </div>\n");
+ "" +
+ "" +
+ "<div class=\"admin-container full-width\">\n" +
+ " <div class=\"admin-header\">\n" +
+ " <div class=\"expand\">\n" +
+ " <img
src=\"/simple-portal/images/admin/expand.gif\" alt=\"\"/><a
href=\"javascript:expandAll();\">Expand All</a>\n" +
+ " </div>\n" +
+ " <div class=\"collapse\">\n" +
+ " <img
src=\"/simple-portal/images/admin/contract.gif\" alt=\"\"/><a
href=\"javascript:collapseAll();\">Collapse All</a>\n" +
+ " </div>\n" +
+ " </div>\n");
-
+
for (ManagedPortletApplication application :
registry.getManagedPortletApplications())
{
PortletURL url = resp.createActionURL();
@@ -146,47 +142,51 @@
url.setParameter("lifecycle", "start");
String startURL = url.toString();
- String htmlId = application.getId().substring(1,application.getId().length());
+ String htmlId = application.getId().substring(1, application.getId().length());
-
-
writer.print("" +
"\n" +
" <div class=\"par-container\">\n"
+
" <div class=\"par-header\">\n"
+
" <div
class=\"par-header-left\">\n" +
- " <a id=\"contract-"+ htmlId
+"\" href=\"#\" onclick=\"collapse(this,'"+ htmlId
+"');\">\n" +
+ " <a id=\"contract-" + htmlId +
"\" href=\"javascript:return false;\"
onclick=\"collapse(this,'" + htmlId + "');\">\n" +
" <img
src=\"/simple-portal/images/admin/contract.gif\" alt=\"\"
/>\n" +
- " <h3 class=\"par\">"+
application.getId() +"</h3>\n" +
+ " <h3 class=\"par\">" +
application.getId() + "</h3>\n" +
" </a>\n" +
- " <a id=\"expand-"+ htmlId
+"\" href=\"#\" onclick=\"expand(this,'"+ htmlId
+"');\">\n" +
+ " <a id=\"expand-" + htmlId +
"\" href=\"#\" onclick=\"expand(this,'" + htmlId +
"');return false;\">\n" +
" <img
src=\"/simple-portal/images/admin/expand.gif\" alt=\"\" />\n"
+
- " <h3 class=\"par\">"+
application.getId() +"</h3>\n" +
+ " <h3 class=\"par\">" +
application.getId() + "</h3>\n" +
" </a>\n" +
" </div>\n" +
"\n" +
" <div
class=\"par-header-right\">\n" +
" <span
class=\"par-status\">");
- if (application.getStatus().toString().equals("STARTED")){
- writer.print("<img
src=\"/simple-portal/images/admin/started-icon.gif\"
alt=\"\"/>");
- }else{
- writer.print("<img
src=\"/simple-portal/images/admin/stopped-icon.gif\"
alt=\"\"/>");
- }
- writer.print("" +
+ if (application.getStatus().toString().equals("STARTED"))
+ {
+ writer.print("<img
src=\"/simple-portal/images/admin/started-icon.gif\"
alt=\"\"/>");
+ }
+ else
+ {
+ writer.print("<img
src=\"/simple-portal/images/admin/stopped-icon.gif\"
alt=\"\"/>");
+ }
+ writer.print("" +
"" + application.getStatus() + "</span>\n" +
"\n" +
" <div
class=\"par-control\">\n" +
" <img
src=\"/simple-portal/images/admin/start-stop-edge.gif\"
alt=\"\"/>\n");
- if (application.getStatus().toString().equals("STARTED")){
- writer.print("<a class=\"stop\" href=\"" +
stopURL + "\">Stop</a></td>\n");
- }else{
- writer.print("<a class=\"start\" href=\"" +
startURL + "\">Start</a></td>\n");
- }
+ if (application.getStatus().toString().equals("STARTED"))
+ {
+ writer.print("<a class=\"stop\" href=\"" +
stopURL + "\">Stop</a></td>\n");
+ }
+ else
+ {
+ writer.print("<a class=\"start\" href=\"" +
startURL + "\">Start</a></td>\n");
+ }
- writer.print("" +
+ writer.print("" +
"" +
"" +
" </div>\n" +
@@ -219,7 +219,7 @@
//
//writer.print("<li>Filter " + filter.getId() + " "
+ filter.getStatus() + " <a href=\"" +
- // startURL + "\">Start</a> <a href=\"" +
stopURL + "\">Stop</a></li>");
+ // startURL + "\">Start</a> <a href=\"" +
stopURL + "\">Stop</a></li>");
writer.print("" +
"" +
@@ -227,11 +227,14 @@
" <td
class=\"par-row-left\"><img class=\"icon\"
src=\"/simple-portal/images/admin/filter-icon.gif\"
alt=\"\"/>" + filter.getId() + "</td>\n" +
" <td>" + filter.getStatus()
+ "</td>\n" +
" <td></td>\n");
- if (filter.getStatus().toString().equals("STARTED")){
- writer.print(" <td
class=\"par-row-right\">Start | <a class=\"stop\"
href=\"" + stopURL + "\">Stop</a></td>\n");
- }else{
- writer.print(" <td
class=\"par-row-right\"><a class=\"start\" href=\"" +
startURL + "\">Start</a> | Stop</td>\n");
- }
+ if (filter.getStatus().toString().equals("STARTED"))
+ {
+ writer.print(" <td
class=\"par-row-right\">Start | <a class=\"stop\"
href=\"" + stopURL + "\">Stop</a></td>\n");
+ }
+ else
+ {
+ writer.print(" <td
class=\"par-row-right\"><a class=\"start\" href=\"" +
startURL + "\">Start</a> | Stop</td>\n");
+ }
writer.print(" </tr>");
@@ -252,48 +255,62 @@
url.setParameter("lifecycle", "start");
startURL = url.toString();
-
+
LocalizedString description = null;
String descString = "";
- try{
+ try
+ {
MetaInfo metaInfo = container.getInfo().getMeta();
description = metaInfo.getMetaValue("description");
- }catch(Exception e){
+ }
+ catch (Exception e)
+ {
//e.printStackTrace();
}
- if (description != null){
- descString = description.getString(req.getLocale(),true);
+ if (description != null)
+ {
+ descString = description.getString(req.getLocale(), true);
}
writer.print("" +
"" +
" <tr
class=\"par-container-row\">\n" +
" <td
class=\"par-row-left\"><img class=\"icon\"
src=\"/simple-portal/images/admin/portlet-icon.gif\"
alt=\"\"/>" + container.getId() + "</td>\n" +
- " <td>" +
container.getStatus() + "</td>\n" +
+ " <td>" +
container.getStatus());
+ if (container.getStatus().toString().equals("FAILED"))
+ {
+ writer.print("<img class=\"failed\"
src=\"/simple-portal/images/admin/warning-icon.gif\"
alt=\"\"/>");
+ }
+
+
+ writer.print("</td>\n" +
" <td>" + descString +
"</td>\n");
- if (container.getStatus().toString().equals("STARTED")){
- writer.print(" <td
class=\"par-row-right\">Start | <a class=\"stop\"
href=\"" + stopURL + "\">Stop</a></td>\n");
- }else{
- writer.print(" <td
class=\"par-row-right\"><a class=\"start\" href=\"" +
startURL + "\">Start</a> | Stop</td>\n");
- }
+ if (container.getStatus().toString().equals("STARTED"))
+ {
+ writer.print(" <td
class=\"par-row-right\">Start | <a class=\"stop\"
href=\"" + stopURL + "\">Stop</a></td>\n");
+ }
+ else
+ {
+ writer.print(" <td
class=\"par-row-right\"><a class=\"start\" href=\"" +
startURL + "\">Start</a> | Stop</td>\n");
+ }
writer.print(" </tr>");
}
- writer.print("</table>" +
- " </div>\n" +
- "");
+ writer.print("</table>" +
+ " </div>\n" +
+ "");
}
writer.print("</div>" +
" </div>\n" +
- " </div>\n" +
- " </div>\n" +
- "\n" +
- " </div>\n" +
- " <br class=\"clear\"/>\n" +
- "</div>");
+ " </div>\n" +
+ " </div>\n" +
+ "\n" +
+ " </div>\n" +
+ " <br class=\"clear\"/>\n" +
+ "</div>");
//
writer.close();
Modified: modules/portlet/trunk/portal/src/main/resources/simple-portal-war/css/admin.css
===================================================================
---
modules/portlet/trunk/portal/src/main/resources/simple-portal-war/css/admin.css 2008-03-18
20:15:05 UTC (rev 10312)
+++
modules/portlet/trunk/portal/src/main/resources/simple-portal-war/css/admin.css 2008-03-18
20:35:58 UTC (rev 10313)
@@ -95,12 +95,14 @@
table.par-table {
margin: 0;
padding: 0;
- border-collapse: collapse;
+ /*border-collapse: collapse;*/
border-spacing: 0;
+ border: 1px solid #999;
}
table.par-table td {
padding: 0 0 0 3px;
+ width: 25%;
}
table.par-table tr.par-subhead {
@@ -120,6 +122,10 @@
margin: 0 3px 0 0;
}
+table.par-table td img.failed {
+ margin: 0 0 0 3px;
+}
+
table.par-table td.par-header-left {
padding: 0 0 0 15px;
}