Author: chris.laprun(a)jboss.com
Date: 2007-01-03 22:45:57 -0500 (Wed, 03 Jan 2007)
New Revision: 5944
Added:
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/EndpointConfigurationInfo.java
Removed:
trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/portal-lib.tld
Modified:
trunk/build/ide/intellij/idea60/modules/wsrp/wsrp.iml
trunk/wsrp/build.xml
trunk/wsrp/src/main/org/jboss/portal/wsrp/WSRPConsumer.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/WSRPConsumerImpl.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/portlet/consumers/WSRPConsumerConfigurationPortlet.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/services/CachingServiceFactory.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/services/RMIInvokerServiceFactory.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/services/SOAPInvokerServiceFactory.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/services/ServiceFactory.java
trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/jsp/consumers/consumer.jsp
trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/jsp/consumers/view.jsp
Log:
- Improved Consumer admin portlet.
- Removed dependency on core since it was creating a cyclic dependency...
- Added support for endpoint information.
- Better user interface.
- Still need to add support for information modification but this will require support for
persistence. Need to think about it first!
Modified: trunk/build/ide/intellij/idea60/modules/wsrp/wsrp.iml
===================================================================
--- trunk/build/ide/intellij/idea60/modules/wsrp/wsrp.iml 2007-01-03 00:39:30 UTC (rev
5943)
+++ trunk/build/ide/intellij/idea60/modules/wsrp/wsrp.iml 2007-01-04 03:45:57 UTC (rev
5944)
@@ -27,7 +27,6 @@
</orderEntry>
<orderEntry type="module" module-name="api" />
<orderEntry type="module" module-name="test" />
- <orderEntry type="module" module-name="core" />
<orderEntry type="module-library">
<library>
<CLASSES>
Modified: trunk/wsrp/build.xml
===================================================================
--- trunk/wsrp/build.xml 2007-01-03 00:39:30 UTC (rev 5943)
+++ trunk/wsrp/build.xml 2007-01-04 03:45:57 UTC (rev 5944)
@@ -130,7 +130,6 @@
<path id="dependentmodule.classpath">
<path refid="jboss.portal-common.classpath"/>
- <path refid="jboss.portal-core.classpath"/>
<path refid="jboss.portal-jems.classpath"/>
<path refid="jboss.portal-server.classpath"/>
<path refid="jboss.portal-registration.classpath"/>
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/WSRPConsumer.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/WSRPConsumer.java 2007-01-03 00:39:30 UTC
(rev 5943)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/WSRPConsumer.java 2007-01-04 03:45:57 UTC
(rev 5944)
@@ -24,6 +24,7 @@
import org.jboss.portal.portlet.PortletInvoker;
import org.jboss.portal.portlet.invocation.PortletInvocation;
+import org.jboss.portal.wsrp.consumer.EndpointConfigurationInfo;
import org.jboss.portal.wsrp.consumer.ProducerSessionInformation;
import org.jboss.portal.wsrp.consumer.RegistrationInfo;
import org.jboss.portal.wsrp.core.RegistrationData;
@@ -121,4 +122,12 @@
* @since 2.6
*/
RegistrationInfo getRegistrationInfo();
+
+ /**
+ * Retrieves the configuration information for the WSRP endpoints of the associated
remote producer.
+ *
+ * @return
+ * @since 2.6
+ */
+ EndpointConfigurationInfo getEndpointConfigurationInfo();
}
Added: trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/EndpointConfigurationInfo.java
===================================================================
---
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/EndpointConfigurationInfo.java 2007-01-03
00:39:30 UTC (rev 5943)
+++
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/EndpointConfigurationInfo.java 2007-01-04
03:45:57 UTC (rev 5944)
@@ -0,0 +1,84 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2007, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+
+package org.jboss.portal.wsrp.consumer;
+
+import org.jboss.portal.common.util.ParameterValidation;
+import org.jboss.portal.wsrp.WSRPConsumer;
+import org.jboss.portal.wsrp.services.RemoteSOAPInvokerServiceFactory;
+import org.jboss.portal.wsrp.services.ServiceFactory;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
+ * @version $Revision$
+ * @since 2.6
+ */
+public class EndpointConfigurationInfo
+{
+ private ServiceFactory serviceFactory;
+
+
+ public EndpointConfigurationInfo(WSRPConsumer consumer)
+ {
+ ParameterValidation.throwIllegalArgExceptionIfNull(consumer,
"WSRPConsumer");
+ serviceFactory = consumer.getServiceFactory();
+ }
+
+ public boolean usesWSDL()
+ {
+ return serviceFactory instanceof RemoteSOAPInvokerServiceFactory;
+ }
+
+ public String getWSDLLocationIfAvailable()
+ {
+ if (usesWSDL())
+ {
+ RemoteSOAPInvokerServiceFactory remoteSF =
(RemoteSOAPInvokerServiceFactory)serviceFactory;
+ return remoteSF.getWsdlDefinitionURL();
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ public String getServiceDescriptionInterfaceURL()
+ {
+ return serviceFactory.getServiceDescriptionURL();
+ }
+
+ public String getMarkupInterfaceURL()
+ {
+ return serviceFactory.getMarkupURL();
+ }
+
+ public String getPortletManagementInterfaceURL()
+ {
+ return serviceFactory.getPortletManagementURL();
+ }
+
+ public String getRegistrationInterfaceURL()
+ {
+ return serviceFactory.getRegistrationURL();
+ }
+}
Property changes on:
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/EndpointConfigurationInfo.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/WSRPConsumerImpl.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/WSRPConsumerImpl.java 2007-01-03
00:39:30 UTC (rev 5943)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/WSRPConsumerImpl.java 2007-01-04
03:45:57 UTC (rev 5944)
@@ -140,6 +140,9 @@
/** The registration information for this consumer */
private RegistrationInfo registrationInfo;
+ /** The configuration information for the WSRP endpoints of the associated producer.
*/
+ private EndpointConfigurationInfo endpointConfigurationInfo;
+
/** The registration data used to register this consumer with the associated producer
*/
private RegistrationData registrationData;
@@ -173,6 +176,11 @@
sessionHandler = new SessionHandler(this);
}
+ public EndpointConfigurationInfo getEndpointConfigurationInfo()
+ {
+ return endpointConfigurationInfo;
+ }
+
// PortletInvoker implementation
************************************************************************************
public Set getPortlets() throws InvokerUnavailableException
@@ -732,6 +740,7 @@
protected void startService() throws Exception
{
serviceFactory.start();
+ endpointConfigurationInfo = new EndpointConfigurationInfo(this);
}
// Web services access
**********************************************************************************************
Modified:
trunk/wsrp/src/main/org/jboss/portal/wsrp/portlet/consumers/WSRPConsumerConfigurationPortlet.java
===================================================================
---
trunk/wsrp/src/main/org/jboss/portal/wsrp/portlet/consumers/WSRPConsumerConfigurationPortlet.java 2007-01-03
00:39:30 UTC (rev 5943)
+++
trunk/wsrp/src/main/org/jboss/portal/wsrp/portlet/consumers/WSRPConsumerConfigurationPortlet.java 2007-01-04
03:45:57 UTC (rev 5944)
@@ -23,18 +23,17 @@
package org.jboss.portal.wsrp.portlet.consumers;
-import org.jboss.portal.core.servlet.jsp.PortalJsp;
-import org.jboss.portal.core.servlet.jsp.taglib.context.DelegateContext;
-import org.jboss.portal.wsrp.WSRPConsumer;
-
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
import javax.portlet.GenericPortlet;
import javax.portlet.PortletException;
import javax.portlet.PortletRequestDispatcher;
+import javax.portlet.PortletSecurityException;
+import javax.portlet.PortletURL;
import javax.portlet.RenderRequest;
import javax.portlet.RenderResponse;
import java.io.IOException;
-import java.util.Iterator;
-import java.util.List;
+import java.io.PrintWriter;
/**
* @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
@@ -44,6 +43,7 @@
public class WSRPConsumerConfigurationPortlet extends GenericPortlet
{
private ConsumersRegistry registry;
+ private static final String NOT_SUPPORTED = "notSupported";
private static final String JSP_PATH = "/WEB-INF/jsp/consumers/";
public static final String OP = "op";
@@ -53,6 +53,7 @@
public static final String ID = "id";
public static final String CONSUMER = "consumer";
public static final String CONSUMERS_REGISTRY = "ConsumersRegistry";
+ public static final String OP_EDIT = "editConsumer";
public void init() throws PortletException
{
@@ -77,18 +78,6 @@
// list consumers
if (OP_LIST.equals(op))
{
- DelegateContext ctx = new DelegateContext();
- DelegateContext consumerCtx;
-
- List consumersList = registry.getConfiguredConsumers();
- for (Iterator consumers = consumersList.iterator(); consumers.hasNext();)
- {
- WSRPConsumer consumer = (WSRPConsumer)consumers.next();
- consumerCtx = ctx.next(CONSUMER);
- consumerCtx.put(ID, consumer.getProducerId());
- }
-
- request.setAttribute(PortalJsp.CTX_REQUEST, ctx);
PortletRequestDispatcher rd = getPortletContext().getRequestDispatcher(JSP_PATH
+ "view.jsp");
rd.include(request, response);
}
@@ -107,5 +96,36 @@
PortletRequestDispatcher rd = getPortletContext().getRequestDispatcher(JSP_PATH
+ "consumer.jsp");
rd.include(request, response);
}
+
+ if (NOT_SUPPORTED.equals(op))
+ {
+ PrintWriter printWriter = response.getWriter();
+ printWriter.print(request.getParameter("method") + " not yet
supported<br/>");
+ PortletURL url = response.createRenderURL();
+ url.setParameter(OP, OP_LIST);
+ printWriter.println("<a href='" + url +
"'>back</a>");
+ }
+
}
+
+ public void processAction(ActionRequest request, ActionResponse response) throws
PortletException, PortletSecurityException, IOException
+ {
+ String op = request.getParameter(OP);
+ if (op == null)
+ {
+ op = OP_LIST;
+ }
+
+ if (OP_ACTIVATE.equals(op))
+ {
+ response.setRenderParameter(OP, NOT_SUPPORTED);
+ response.setRenderParameter("method", "activate");
+ }
+
+ if (OP_EDIT.equals(op))
+ {
+ response.setRenderParameter(OP, NOT_SUPPORTED);
+ response.setRenderParameter("method", "modifying consumer
information");
+ }
+ }
}
\ No newline at end of file
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/services/CachingServiceFactory.java
===================================================================
---
trunk/wsrp/src/main/org/jboss/portal/wsrp/services/CachingServiceFactory.java 2007-01-03
00:39:30 UTC (rev 5943)
+++
trunk/wsrp/src/main/org/jboss/portal/wsrp/services/CachingServiceFactory.java 2007-01-04
03:45:57 UTC (rev 5944)
@@ -82,4 +82,40 @@
{
return delegate != null && delegate.isAvailable();
}
+
+ public String getServiceDescriptionURL()
+ {
+ if (delegate != null)
+ {
+ return delegate.getServiceDescriptionURL();
+ }
+ return null;
+ }
+
+ public String getMarkupURL()
+ {
+ if (delegate != null)
+ {
+ return delegate.getMarkupURL();
+ }
+ return null;
+ }
+
+ public String getRegistrationURL()
+ {
+ if (delegate != null)
+ {
+ return delegate.getRegistrationURL();
+ }
+ return null;
+ }
+
+ public String getPortletManagementURL()
+ {
+ if (delegate != null)
+ {
+ return delegate.getPortletManagementURL();
+ }
+ return null;
+ }
}
Modified:
trunk/wsrp/src/main/org/jboss/portal/wsrp/services/RMIInvokerServiceFactory.java
===================================================================
---
trunk/wsrp/src/main/org/jboss/portal/wsrp/services/RMIInvokerServiceFactory.java 2007-01-03
00:39:30 UTC (rev 5943)
+++
trunk/wsrp/src/main/org/jboss/portal/wsrp/services/RMIInvokerServiceFactory.java 2007-01-04
03:45:57 UTC (rev 5944)
@@ -51,4 +51,25 @@
{
return true;
}
+
+
+ public String getServiceDescriptionURL()
+ {
+ return null;
+ }
+
+ public String getMarkupURL()
+ {
+ return null;
+ }
+
+ public String getRegistrationURL()
+ {
+ return null;
+ }
+
+ public String getPortletManagementURL()
+ {
+ return null;
+ }
}
Modified:
trunk/wsrp/src/main/org/jboss/portal/wsrp/services/SOAPInvokerServiceFactory.java
===================================================================
---
trunk/wsrp/src/main/org/jboss/portal/wsrp/services/SOAPInvokerServiceFactory.java 2007-01-03
00:39:30 UTC (rev 5943)
+++
trunk/wsrp/src/main/org/jboss/portal/wsrp/services/SOAPInvokerServiceFactory.java 2007-01-04
03:45:57 UTC (rev 5944)
@@ -89,4 +89,24 @@
{
return endpointURL != null;
}
+
+ public String getServiceDescriptionURL()
+ {
+ return endpointURL + PORT_NAMES.get(WSRP_v1_ServiceDescription_PortType.class);
+ }
+
+ public String getMarkupURL()
+ {
+ return endpointURL + PORT_NAMES.get(WSRP_v1_Markup_PortType.class);
+ }
+
+ public String getRegistrationURL()
+ {
+ return endpointURL + PORT_NAMES.get(WSRP_v1_Registration_PortType.class);
+ }
+
+ public String getPortletManagementURL()
+ {
+ return endpointURL + PORT_NAMES.get(WSRP_v1_PortletManagement_PortType.class);
+ }
}
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/services/ServiceFactory.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/services/ServiceFactory.java 2007-01-03
00:39:30 UTC (rev 5943)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/services/ServiceFactory.java 2007-01-04
03:45:57 UTC (rev 5944)
@@ -35,4 +35,12 @@
Object getService(Class clazz) throws Exception;
boolean isAvailable();
+
+ String getServiceDescriptionURL();
+
+ String getMarkupURL();
+
+ String getRegistrationURL();
+
+ String getPortletManagementURL();
}
Modified: trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/jsp/consumers/consumer.jsp
===================================================================
--- trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/jsp/consumers/consumer.jsp 2007-01-03
00:39:30 UTC (rev 5943)
+++ trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/jsp/consumers/consumer.jsp 2007-01-04
03:45:57 UTC (rev 5944)
@@ -1,13 +1,12 @@
<%@ page import="org.jboss.portal.wsrp.WSRPConsumer" %>
+<%@ page import="org.jboss.portal.wsrp.consumer.EndpointConfigurationInfo"
%>
<%@ page import="org.jboss.portal.wsrp.consumer.RegistrationInfo" %>
<%@ page import="org.jboss.portal.wsrp.portlet.consumers.ConsumersRegistry"
%>
<%@ page
import="org.jboss.portal.wsrp.portlet.consumers.WSRPConsumerConfigurationPortlet"
%>
<%@ page
import="org.jboss.portal.wsrp.registration.RegistrationPropertyDescription"
%>
<%@ page import="java.util.Iterator" %>
-<%@ page language="java"
extends="org.jboss.portal.core.servlet.jsp.PortalJsp" %>
-<%@ taglib uri="/WEB-INF/portal-lib.tld" prefix="n" %>
+<%@ page import="java.util.Set" %>
<%@ taglib
uri="http://java.sun.com/portlet" prefix="portlet"
%>
-<%@ page isELIgnored="false" %>
<portlet:defineObjects/>
<%
@@ -19,94 +18,139 @@
}
WSRPConsumer consumer = registry.getConsumer(id);
RegistrationInfo regInfo = consumer.getRegistrationInfo();
+ EndpointConfigurationInfo endInfo = consumer.getEndpointConfigurationInfo();
%>
<div class="portlet-section-body">
- <form action="consumer.jsp">
- <table width="100%" border="1" cellspacing="0"
class="portlet-table-body">
- <caption>Consumer '<%=
consumer.getProducerId()%>'</caption>
- <tbody>
- <tr>
- <th>Producer id:</th>
+<form name="<portlet:namespace/>editConsumer"
+ action="<portlet:actionURL>
+ <portlet:param name="<%=WSRPConsumerConfigurationPortlet.OP%>"
value="<%=WSRPConsumerConfigurationPortlet.OP_EDIT%>"/>
+ </portlet:actionURL>" method="post">
+<table width="100%" border="1" cellspacing="0"
class="portlet-table-body">
+<caption class="portlet-table-header">Consumer '<%=
consumer.getProducerId()%>'</caption>
+<tbody>
+<tr>
+ <th>Producer id:</th>
- <td><input type="text" name="producer-id"
value="<%=consumer.getProducerId()%>"/></td>
- </tr>
+ <td><input type="text" name="producer-id"
value="<%=consumer.getProducerId()%>"/></td>
+</tr>
- <tr>
- <th>Cache expiration:</th>
+<tr>
+ <th>Cache expiration:</th>
- <td><input type="text"
name="cache-expiration"
-
value="<%=consumer.getExpirationCacheSeconds().intValue()%>"/> seconds
- </td>
- </tr>
+ <td><input type="text" name="cache-expiration"
+
value="<%=consumer.getExpirationCacheSeconds().intValue()%>"/> seconds
+ </td>
+</tr>
- <tr>
- <th>Endpoint configuration:</th>
+<tr>
+ <th>Endpoint configuration:</th>
- <td><input type="radio" name="endpoint"
value="endpoint-config"/>Individual interfaces:<br/>
- <table border="1">
- <tr>
- <th>Service Description URL:</th>
- <td><input type="text"
name='service-description-url'/></td>
- </tr>
- <tr>
- <th>Markup URL:</th>
- <td><input type="text"
name='markup-url'/></td>
- </tr>
- <tr>
- <th>Registration URL:</th>
- <td><input type="text"
name='registration-url'/></td>
- </tr>
- <tr>
- <th>Portlet Management URL:</th>
- <td><input type="text"
name='portlet-management-url'/></td>
- </tr>
- </table>
- <input type="radio" name="endpoint"
value="endpoint-wsdl-url"/> WSDL interface URL: <input
type='text'
-
name='endpoint-wsdl-url'/>
- </td>
- </tr>
- <tr>
- <th><input type='checkbox' name='registration'
value='registration'
-
checked="<%=regInfo.requiresRegistration()%>"/>Requires registration?
- </th>
- <td>
- <table border='1'>
- <tr>
- <th>Name</th>
- <th>Value</th>
- <th>Description</th>
- </tr>
- <%
- if (regInfo.requiresRegistration())
- {
- String description = "";
- for (Iterator names =
regInfo.getRegistrationPropertyNames().iterator(); names.hasNext();)
- {
- String name = (String)names.next();
- RegistrationInfo.RegistrationProperty prop =
regInfo.getRegistrationProperty(name);
- RegistrationPropertyDescription desc =
prop.getDescription();
- if (desc != null)
- {
- description = desc.getDescription().getValue();
- }
- %>
- <tr>
- <td><%=name%>
- </td>
- <td><%=prop.getValueAsString()%>
- </td>
- <td><%=description%>
- </td>
- </tr>
- <%
- }
- }
- %>
- </table>
- </td>
- </tr>
- </tbody>
+ <%
+ boolean usesWSDL = endInfo.usesWSDL();
+ %>
+
+ <td><input type="radio" <%=!usesWSDL ?
"checked='true'" : ""%> name="endpoint"
value="endpoint-config"/>Individual
+ interfaces<br/>
+ <table border="0" class='portlet-table-body'
style='display:<%=usesWSDL ? "none;" : "table;"%>'>
+ <tr>
+ <th class="portlet-form-field-label">Service Description
URL:</th>
+ <td><input type="text"
name='service-description-url' size='50'
+
value='<%=endInfo.getServiceDescriptionInterfaceURL()%>'/></td>
+ </tr>
+ <tr>
+ <th class="portlet-form-field-label">Markup URL:</th>
+ <td><input type="text" name='markup-url'
size='50'
value='<%=endInfo.getMarkupInterfaceURL()%>'/></td>
+ </tr>
+ <tr>
+ <th class="portlet-form-field-label">Registration
URL:</th>
+ <td><input type="text" name='registration-url'
size='50'
+
value='<%=endInfo.getRegistrationInterfaceURL()%>'/>
+ </td>
+ </tr>
+ <tr>
+ <th class="portlet-form-field-label">Portlet Management
URL:</th>
+ <td><input type="text"
name='portlet-management-url' size='50'
+
value='<%=endInfo.getPortletManagementInterfaceURL()%>'/></td>
+ </tr>
</table>
- </form>
+ <input type="radio" name="endpoint" <%=usesWSDL ?
"checked='true'" : ""%>
value="endpoint-wsdl-url"/>
+ WSDL interface URL
+ <input type='text' style='display:<%=usesWSDL ?
"inline;" : "none;"%>' name='endpoint-wsdl-url'
size='50'
+ value='<%=endInfo.getWSDLLocationIfAvailable()%>'/>
+ </td>
+</tr>
+<tr>
+ <%
+ boolean requiresReg = regInfo.requiresRegistration();
+ %>
+ <th><input type='checkbox' name='registration'
value='registration'
+ <%=requiresReg ? "checked='true'" :
""%>/>Requires registration?
+ </th>
+ <td>
+ <%
+ if (requiresReg)
+ {
+ Set propertyNames = regInfo.getRegistrationPropertyNames();
+ if (!propertyNames.isEmpty())
+ {
+ %>
+ <input type="hidden" name="propNumber"
value="<%=propertyNames.size()%>"/>
+ <table border='1' cellspacing='0'
class='portlet-table-body'>
+ <tr>
+ <th>Name</th>
+ <th>Value</th>
+ <th>Description</th>
+ </tr>
+ <%
+ String description = "";
+ String formName = "name";
+ String formValue = "value";
+ int propIndex = 0;
+ for (Iterator names = propertyNames.iterator(); names.hasNext();)
+ {
+ String name = (String)names.next();
+ RegistrationInfo.RegistrationProperty prop =
regInfo.getRegistrationProperty(name);
+ RegistrationPropertyDescription desc = prop.getDescription();
+ if (desc != null)
+ {
+ description = desc.getDescription().getValue();
+ }
+ %>
+ <tr>
+ <td><input type="text" size="25"
name="<%=formName + propIndex%>" value="<%=name%>"/>
+ </td>
+ <td><input type="text" size="25"
name="<%=formValue + propIndex%>"
value="<%=prop.getValueAsString()%>"/>
+ </td>
+ <td><%=description%>
+ </td>
+ </tr>
+ <%
+ propIndex++;
+ }
+ %>
+ </table>
+ <%
+ }
+ else
+ {
+ %>
+ No required registration properties.
+ <%
+ }
+ }
+ %>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <input type="submit" name="editConsumer"
value="Save" class="portlet-form-button"/>
+ <a href="<portlet:renderURL>
+ <portlet:param name="<%=WSRPConsumerConfigurationPortlet.OP%>"
value="<%=WSRPConsumerConfigurationPortlet.OP_LIST%>"/></portlet:renderURL>">
+ <input type="button" value="Cancel"
class="portlet-form-button"/></a>
+ </td>
+</tr>
+</tbody>
+</table>
+</form>
</div>
\ No newline at end of file
Modified: trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/jsp/consumers/view.jsp
===================================================================
--- trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/jsp/consumers/view.jsp 2007-01-03
00:39:30 UTC (rev 5943)
+++ trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/jsp/consumers/view.jsp 2007-01-04
03:45:57 UTC (rev 5944)
@@ -1,10 +1,14 @@
+<%@ page import="org.jboss.portal.wsrp.WSRPConsumer" %>
+<%@ page import="org.jboss.portal.wsrp.portlet.consumers.ConsumersRegistry"
%>
<%@ page
import="org.jboss.portal.wsrp.portlet.consumers.WSRPConsumerConfigurationPortlet"
%>
-<%@ page language="java"
extends="org.jboss.portal.core.servlet.jsp.PortalJsp" %>
-<%@ taglib uri="/WEB-INF/portal-lib.tld" prefix="n" %>
+<%@ page import="java.util.Iterator" %>
<%@ taglib
uri="http://java.sun.com/portlet" prefix="portlet"
%>
-<%@ page isELIgnored="false" %>
<portlet:defineObjects/>
+<%
+ ConsumersRegistry registry =
(ConsumersRegistry)portletConfig.getPortletContext().getAttribute(WSRPConsumerConfigurationPortlet.CONSUMERS_REGISTRY);
+%>
+
<div class="portlet-section-body">
<table width="100%" border="0" cellspacing="0"
class="portlet-table-body">
<caption>Configured WSRP Consumers</caption>
@@ -16,27 +20,41 @@
</tr>
</thead>
<tbody>
- <n:iterate ctx="<%= WSRPConsumerConfigurationPortlet.CONSUMER
%>">
- <tr>
- <td class="portlet-table-text">x</td>
- <td class="portlet-table-text"><a
href="<portlet:renderURL>
+ <%
+ int rowIndex = 0;
+ String evenStyle = "portlet-table-body";
+ String oddStyle = "portlet-table-alternate";
+ String style;
+ for (Iterator consumers = registry.getConfiguredConsumers().iterator();
consumers.hasNext();)
+ {
+ WSRPConsumer consumer = (WSRPConsumer)consumers.next();
+ String id = consumer.getProducerId();
+ style = (rowIndex % 2 == 0) ? evenStyle : oddStyle;
+ %>
+ <tr>
+ <td class="<%=style%>">x</td>
+ <td class="<%=style%>"><a
href="<portlet:renderURL>
<portlet:param
name="<%=WSRPConsumerConfigurationPortlet.OP%>"
value="<%=WSRPConsumerConfigurationPortlet.OP_CONFIGURE%>" />
- <portlet:param
name="<%=WSRPConsumerConfigurationPortlet.ID%>"
value="${n:out('consumer.id')}"/>
-
</portlet:renderURL>">${n:out("consumer.id")}</a>
- </td>
- <td class="portlet-table-text">
- <a href="<portlet:actionURL>
+ <portlet:param
name="<%=WSRPConsumerConfigurationPortlet.ID%>"
value="<%=id%>"/>
+ </portlet:renderURL>"><%=id%>
+ </a>
+ </td>
+ <td class="<%=style%>">
+ <a href="<portlet:actionURL>
<portlet:param
name="<%=WSRPConsumerConfigurationPortlet.OP%>"
value="<%=WSRPConsumerConfigurationPortlet.OP_ACTIVATE%>"/>
- <portlet:param
name="<%=WSRPConsumerConfigurationPortlet.ID%>"
value="${n:out('consumer.id')}"/>
+ <portlet:param
name="<%=WSRPConsumerConfigurationPortlet.ID%>"
value="<%=id%>"/>
<portlet:param name="activate"
value="false"/>
</portlet:actionURL>">deactivate</a> |
- <a href="<portlet:renderURL>
+ <a href="<portlet:renderURL>
<portlet:param
name="<%=WSRPConsumerConfigurationPortlet.OP%>"
value="<%=WSRPConsumerConfigurationPortlet.OP_CONFIGURE%>" />
- <portlet:param
name="<%=WSRPConsumerConfigurationPortlet.ID%>"
value="${n:out('consumer.id')}"/>
+ <portlet:param
name="<%=WSRPConsumerConfigurationPortlet.ID%>"
value="<%=id%>"/>
</portlet:renderURL>">configure</a>
- </td>
- </tr>
- </n:iterate>
+ </td>
+ </tr>
+ <%
+ rowIndex++;
+ }
+ %>
</tbody>
</table>
</div>
\ No newline at end of file
Deleted: trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/portal-lib.tld
===================================================================
--- trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/portal-lib.tld 2007-01-03 00:39:30
UTC (rev 5943)
+++ trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/portal-lib.tld 2007-01-04 03:45:57
UTC (rev 5944)
@@ -1,104 +0,0 @@
-<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ~ JBoss, a division of Red Hat ~
- ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
- ~ contributors as indicated by the @authors tag. See the ~
- ~ copyright.txt in the distribution for a full listing of ~
- ~ individual contributors. ~
- ~ ~
- ~ This is free software; you can redistribute it and/or modify it ~
- ~ under the terms of the GNU Lesser General Public License as ~
- ~ published by the Free Software Foundation; either version 2.1 of ~
- ~ the License, or (at your option) any later version. ~
- ~ ~
- ~ This software is distributed in the hope that it will be useful, ~
- ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
- ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
- ~ Lesser General Public License for more details. ~
- ~ ~
- ~ You should have received a copy of the GNU Lesser General Public ~
- ~ License along with this software; if not, write to the Free ~
- ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
- ~ 02110-1301 USA, or see the FSF site:
http://www.fsf.org. ~
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
-
-<taglib
xmlns="http://java.sun.com/xml/ns/j2ee"
-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd"
- version="2.0">
- <tlib-version>1.1</tlib-version>
- <short-name>JBoss-Portal-tags</short-name>
-
- <tag>
- <name>if</name>
- <tag-class>org.jboss.portal.core.servlet.jsp.taglib.IfTag</tag-class>
- <body-content>JSP</body-content>
- <attribute>
- <name>ctx</name>
- <required>true</required>
- <rtexprvalue>true</rtexprvalue>
- </attribute>
- </tag>
-
- <tag>
- <name>iterate</name>
-
<tag-class>org.jboss.portal.core.servlet.jsp.taglib.IterateTag</tag-class>
- <body-content>JSP</body-content>
- <attribute>
- <name>ctx</name>
- <required>true</required>
- <rtexprvalue>true</rtexprvalue>
- </attribute>
- </tag>
-
- <tag>
- <name>include</name>
-
<tag-class>org.jboss.portal.core.servlet.jsp.taglib.IncludeTag</tag-class>
- <body-content>JSP</body-content>
- <attribute>
- <name>page</name>
- <required>true</required>
- <rtexprvalue>true</rtexprvalue>
- </attribute>
- </tag>
-
- <tag>
- <name>error</name>
-
<tag-class>org.jboss.portal.core.servlet.jsp.taglib.ErrorTag</tag-class>
- <body-content>JSP</body-content>
- <attribute>
- <name>key</name>
- <required>true</required>
- <rtexprvalue>true</rtexprvalue>
- </attribute>
- </tag>
-
- <tag>
- <name>errors</name>
-
<tag-class>org.jboss.portal.core.servlet.jsp.taglib.ErrorsTag</tag-class>
- <body-content>JSP</body-content>
- </tag>
-
- <tag>
- <name>success</name>
-
<tag-class>org.jboss.portal.core.servlet.jsp.taglib.SuccessTag</tag-class>
- <body-content>JSP</body-content>
- </tag>
- <function>
- <name>i18n</name>
-
<function-class>org.jboss.portal.core.servlet.jsp.taglib.PortalLib</function-class>
- <function-signature>java.lang.String
getMessage(java.lang.String)</function-signature>
- </function>
-
- <function>
- <name>out</name>
-
<function-class>org.jboss.portal.core.servlet.jsp.taglib.PortalLib</function-class>
- <function-signature>java.lang.String
out(java.lang.String)</function-signature>
- </function>
-
- <function>
- <name>i18nout</name>
-
<function-class>org.jboss.portal.core.servlet.jsp.taglib.PortalLib</function-class>
- <function-signature>java.lang.String
i18nOut(java.lang.String)</function-signature>
- </function>
-
-</taglib>