JBoss Portal SVN: r5944 - in trunk: build/ide/intellij/idea60/modules/wsrp wsrp wsrp/src/main/org/jboss/portal/wsrp wsrp/src/main/org/jboss/portal/wsrp/consumer wsrp/src/main/org/jboss/portal/wsrp/portlet/consumers wsrp/src/main/org/jboss/portal/wsrp/services wsrp/src/resources/portal-wsrp-war/WEB-INF wsrp/src/resources/portal-wsrp-war/WEB-INF/jsp/consumers
by portal-commits@lists.jboss.org
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>
17 years, 4 months
JBoss Portal SVN: r5943 - in trunk: federation/src/main/org/jboss/portal/federation/impl wsrp wsrp/src/main/org/jboss/portal/test/wsrp/config wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer wsrp/src/main/org/jboss/portal/wsrp wsrp/src/main/org/jboss/portal/wsrp/consumer wsrp/src/main/org/jboss/portal/wsrp/portlet wsrp/src/main/org/jboss/portal/wsrp/portlet/consumers wsrp/src/main/org/jboss/portal/wsrp/producer/config wsrp/src/main/org/jboss/portal/wsrp/producer/config/impl wsrp/src/mai
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2007-01-02 19:39:30 -0500 (Tue, 02 Jan 2007)
New Revision: 5943
Added:
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RegistrationInfo.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/portlet/
trunk/wsrp/src/main/org/jboss/portal/wsrp/portlet/consumers/
trunk/wsrp/src/main/org/jboss/portal/wsrp/portlet/consumers/ConsumersRegistry.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/portlet/consumers/ConsumersRegistryService.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/portlet/consumers/WSRPConsumerConfigurationPortlet.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/registration/
trunk/wsrp/src/main/org/jboss/portal/wsrp/registration/LocalizedString.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/registration/RegistrationPropertyDescription.java
trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/jboss-portlet.xml
trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/jsp/
trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/jsp/consumers/
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
trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/portal-lib.tld
trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/portlet.xml
Removed:
trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/config/LocalizedString.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/config/RegistrationPropertyDescription.java
Modified:
trunk/federation/src/main/org/jboss/portal/federation/impl/FederatedPortletInvokerService.java
trunk/wsrp/build.xml
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/config/ProducerConfigurationTestCase.java
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/RegistrationTestCase.java
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/ServiceDescriptionTestCase.java
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/V1ProducerBaseTest.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/WSRPConsumer.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/WSRPUtils.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/WSRPConsumerImpl.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/config/ProducerConfigurationFactory.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/config/ProducerRegistrationRequirements.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/config/impl/ProducerRegistrationRequirementsImpl.java
trunk/wsrp/src/resources/portal-wsrp-sar/META-INF/jboss-service.xml
trunk/wsrp/src/resources/portal-wsrp-sar/default-wsrp.xml
Log:
- Started implementing a user interface for Consumer configuration. NOT FINISHED (mostly synchronization commit)!
- Added RegistrationInfo concept: needs more work and should replace access to RegistrationData from Consumer.
- Created registration package in wsrp and moved LocalizedString and RegistrationPropertyDescription to it.
- WSRP now depends on core until taglib is extracted.
Modified: trunk/federation/src/main/org/jboss/portal/federation/impl/FederatedPortletInvokerService.java
===================================================================
--- trunk/federation/src/main/org/jboss/portal/federation/impl/FederatedPortletInvokerService.java 2007-01-02 21:58:14 UTC (rev 5942)
+++ trunk/federation/src/main/org/jboss/portal/federation/impl/FederatedPortletInvokerService.java 2007-01-03 00:39:30 UTC (rev 5943)
@@ -70,6 +70,18 @@
this.federatingPortletInvoker = federatingPortletInvoker;
}
+ /**
+ * Added to be able to access invoker when configuring WSRP consumers.
+ *
+ * @return
+ * @see org.jboss.portal.wsrp.portlet.consumers.ConsumersRegistryService
+ * @since 2.6
+ */
+ public PortletInvoker getPortletInvoker()
+ {
+ return portletInvoker;
+ }
+
public String getId()
{
return id;
Modified: trunk/wsrp/build.xml
===================================================================
--- trunk/wsrp/build.xml 2007-01-02 21:58:14 UTC (rev 5942)
+++ trunk/wsrp/build.xml 2007-01-03 00:39:30 UTC (rev 5943)
@@ -130,6 +130,7 @@
<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/test/wsrp/config/ProducerConfigurationTestCase.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/test/wsrp/config/ProducerConfigurationTestCase.java 2007-01-02 21:58:14 UTC (rev 5942)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/config/ProducerConfigurationTestCase.java 2007-01-03 00:39:30 UTC (rev 5943)
@@ -24,11 +24,11 @@
package org.jboss.portal.test.wsrp.config;
import junit.framework.TestCase;
-import org.jboss.portal.wsrp.producer.config.LocalizedString;
import org.jboss.portal.wsrp.producer.config.ProducerConfiguration;
import org.jboss.portal.wsrp.producer.config.ProducerConfigurationFactory;
import org.jboss.portal.wsrp.producer.config.ProducerRegistrationRequirements;
-import org.jboss.portal.wsrp.producer.config.RegistrationPropertyDescription;
+import org.jboss.portal.wsrp.registration.LocalizedString;
+import org.jboss.portal.wsrp.registration.RegistrationPropertyDescription;
import org.jboss.xb.binding.ObjectModelFactory;
import org.jboss.xb.binding.Unmarshaller;
import org.jboss.xb.binding.UnmarshallerFactory;
Modified: trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/RegistrationTestCase.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/RegistrationTestCase.java 2007-01-02 21:58:14 UTC (rev 5942)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/RegistrationTestCase.java 2007-01-03 00:39:30 UTC (rev 5943)
@@ -35,7 +35,7 @@
import org.jboss.portal.wsrp.core.PropertyDescription;
import org.jboss.portal.wsrp.core.RegistrationContext;
import org.jboss.portal.wsrp.core.RegistrationData;
-import org.jboss.portal.wsrp.producer.config.RegistrationPropertyDescription;
+import org.jboss.portal.wsrp.registration.RegistrationPropertyDescription;
import javax.xml.namespace.QName;
Modified: trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/ServiceDescriptionTestCase.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/ServiceDescriptionTestCase.java 2007-01-02 21:58:14 UTC (rev 5942)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/ServiceDescriptionTestCase.java 2007-01-03 00:39:30 UTC (rev 5943)
@@ -35,7 +35,7 @@
import org.jboss.portal.wsrp.core.ModelDescription;
import org.jboss.portal.wsrp.core.PropertyDescription;
import org.jboss.portal.wsrp.core.ServiceDescription;
-import org.jboss.portal.wsrp.producer.config.RegistrationPropertyDescription;
+import org.jboss.portal.wsrp.registration.RegistrationPropertyDescription;
/**
* Tests WSRP Service Description
Modified: trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/V1ProducerBaseTest.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/V1ProducerBaseTest.java 2007-01-02 21:58:14 UTC (rev 5942)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/V1ProducerBaseTest.java 2007-01-03 00:39:30 UTC (rev 5943)
@@ -40,7 +40,7 @@
import org.jboss.portal.wsrp.core.WSRP_v1_PortletManagement_PortType;
import org.jboss.portal.wsrp.core.WSRP_v1_Registration_PortType;
import org.jboss.portal.wsrp.core.WSRP_v1_ServiceDescription_PortType;
-import org.jboss.portal.wsrp.producer.config.RegistrationPropertyDescription;
+import org.jboss.portal.wsrp.registration.RegistrationPropertyDescription;
import javax.xml.namespace.QName;
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/WSRPConsumer.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/WSRPConsumer.java 2007-01-02 21:58:14 UTC (rev 5942)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/WSRPConsumer.java 2007-01-03 00:39:30 UTC (rev 5943)
@@ -25,6 +25,7 @@
import org.jboss.portal.portlet.PortletInvoker;
import org.jboss.portal.portlet.invocation.PortletInvocation;
import org.jboss.portal.wsrp.consumer.ProducerSessionInformation;
+import org.jboss.portal.wsrp.consumer.RegistrationInfo;
import org.jboss.portal.wsrp.core.RegistrationData;
import org.jboss.portal.wsrp.services.ServiceFactory;
import org.jboss.system.Service;
@@ -112,4 +113,12 @@
* @see ProducerSessionInformation
*/
ProducerSessionInformation getProducerSessionInformationFrom(HttpSession session);
+
+ /**
+ * Retrieves the registration information associated with this consumer.
+ *
+ * @return
+ * @since 2.6
+ */
+ RegistrationInfo getRegistrationInfo();
}
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/WSRPUtils.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/WSRPUtils.java 2007-01-02 21:58:14 UTC (rev 5942)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/WSRPUtils.java 2007-01-03 00:39:30 UTC (rev 5943)
@@ -38,8 +38,8 @@
import org.jboss.portal.wsrp.core.OperationFailedFault;
import org.jboss.portal.wsrp.core.PropertyDescription;
import org.jboss.portal.wsrp.core.StateChange;
-import org.jboss.portal.wsrp.producer.config.LocalizedString;
-import org.jboss.portal.wsrp.producer.config.RegistrationPropertyDescription;
+import org.jboss.portal.wsrp.registration.LocalizedString;
+import org.jboss.portal.wsrp.registration.RegistrationPropertyDescription;
import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
@@ -349,6 +349,17 @@
}
/**
+ *
+ * @param propertyDescription
+ * @return
+ * @since 2.6
+ */
+ /*public static RegistrationPropertyDescription convertToRegistrationPropertyDescription(PropertyDescription propertyDescription)
+ {
+ ParameterValidation.throwIllegalArgExceptionIfNull(propertyDescription, "PropertyDescription");
+ }*/
+
+ /**
* @param regLocalizedString
* @return
* @since 2.6
Added: trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RegistrationInfo.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RegistrationInfo.java 2007-01-02 21:58:14 UTC (rev 5942)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RegistrationInfo.java 2007-01-03 00:39:30 UTC (rev 5943)
@@ -0,0 +1,144 @@
+/******************************************************************************
+ * 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.common.value.StringValue;
+import org.jboss.portal.registration.Registration;
+import org.jboss.portal.wsrp.core.Property;
+import org.jboss.portal.wsrp.core.RegistrationData;
+import org.jboss.portal.wsrp.registration.RegistrationPropertyDescription;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision$
+ * @since 2.6
+ */
+public class RegistrationInfo
+{
+ private Registration registration;
+ private boolean requiresRegistration;
+ private Map registrationProperties;
+ private RegistrationData registrationData;
+
+ public RegistrationInfo(RegistrationData registrationData)
+ {
+ ParameterValidation.throwIllegalArgExceptionIfNull(registrationData, "RegistrationData");
+ this.registrationData = registrationData;
+ Property[] props = registrationData.getRegistrationProperties();
+ ParameterValidation.throwIllegalArgExceptionIfNull(props, "Registration properties");
+ requiresRegistration = true;
+ int propNumber = props.length;
+
+ if (propNumber > 0)
+ {
+ registrationProperties = new HashMap(propNumber);
+ }
+
+ for (int i = 0; i < propNumber; i++)
+ {
+ Property prop = props[i];
+ String name = prop.getName();
+ registrationProperties.put(name, new RegistrationProperty(name, prop.getStringValue()));
+ }
+ }
+
+ public boolean requiresRegistration()
+ {
+ return requiresRegistration;
+ }
+
+ public Registration getRegistration()
+ {
+ return registration;
+ }
+
+ public RegistrationData getRegistrationData()
+ {
+ return registrationData;
+ }
+
+ public String getConsumerName()
+ {
+ return registrationData.getConsumerName();
+ }
+
+ public String getConsumerAgent()
+ {
+ return registrationData.getConsumerAgent();
+ }
+
+ public RegistrationProperty getRegistrationProperty(String name)
+ {
+ ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(name, "registration property name", "RegistrationInfo.getRegistrationProperty");
+ return (RegistrationProperty)getRegistrationProperties().get(name);
+ }
+
+ public Map getRegistrationProperties()
+ {
+ if (registrationProperties != null)
+ {
+ return Collections.unmodifiableMap(registrationProperties);
+ }
+ else
+ {
+ return Collections.EMPTY_MAP;
+ }
+ }
+
+ public Set getRegistrationPropertyNames()
+ {
+ return getRegistrationProperties().keySet();
+ }
+
+ public static class RegistrationProperty extends org.jboss.portal.portlet.state.Property
+ {
+ private RegistrationPropertyDescription description;
+
+ public RegistrationProperty(String name, String stringValue)
+ {
+ super(name, new StringValue(stringValue));
+ }
+
+ public String getValueAsString()
+ {
+ return getValue().asString();
+ }
+
+ public RegistrationPropertyDescription getDescription()
+ {
+ return description;
+ }
+
+ public void setDescription(RegistrationPropertyDescription description)
+ {
+ this.description = description;
+ }
+ }
+}
Property changes on: trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RegistrationInfo.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-02 21:58:14 UTC (rev 5942)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/WSRPConsumerImpl.java 2007-01-03 00:39:30 UTC (rev 5943)
@@ -137,6 +137,9 @@
/** The identifier of the associated producer */
private String producerId;
+ /** The registration information for this consumer */
+ private RegistrationInfo registrationInfo;
+
/** The registration data used to register this consumer with the associated producer */
private RegistrationData registrationData;
@@ -697,7 +700,9 @@
public void setRegistrationData(RegistrationData registrationData)
{
+ ParameterValidation.throwIllegalArgExceptionIfNull(registrationData, "RegistrationData");
this.registrationData = registrationData;
+ this.registrationInfo = new RegistrationInfo(registrationData);
}
public RegistrationData getRegistrationData()
@@ -705,6 +710,11 @@
return registrationData;
}
+ public RegistrationInfo getRegistrationInfo()
+ {
+ return registrationInfo;
+ }
+
// Session information access ***************************************************************************************
public ProducerSessionInformation getProducerSessionInformationFrom(PortletInvocation invocation)
Added: trunk/wsrp/src/main/org/jboss/portal/wsrp/portlet/consumers/ConsumersRegistry.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/portlet/consumers/ConsumersRegistry.java 2007-01-02 21:58:14 UTC (rev 5942)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/portlet/consumers/ConsumersRegistry.java 2007-01-03 00:39:30 UTC (rev 5943)
@@ -0,0 +1,39 @@
+/*
+* 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.
+*/
+
+package org.jboss.portal.wsrp.portlet.consumers;
+
+import org.jboss.portal.wsrp.WSRPConsumer;
+
+import java.util.List;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision$
+ * @since 2.6
+ */
+public interface ConsumersRegistry
+{
+ List getConfiguredConsumers();
+
+ WSRPConsumer getConsumer(String id);
+}
Property changes on: trunk/wsrp/src/main/org/jboss/portal/wsrp/portlet/consumers/ConsumersRegistry.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Added: trunk/wsrp/src/main/org/jboss/portal/wsrp/portlet/consumers/ConsumersRegistryService.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/portlet/consumers/ConsumersRegistryService.java 2007-01-02 21:58:14 UTC (rev 5942)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/portlet/consumers/ConsumersRegistryService.java 2007-01-03 00:39:30 UTC (rev 5943)
@@ -0,0 +1,99 @@
+/******************************************************************************
+ * 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. *
+ ******************************************************************************/
+
+package org.jboss.portal.wsrp.portlet.consumers;
+
+import org.jboss.portal.common.util.ParameterValidation;
+import org.jboss.portal.federation.FederatingPortletInvoker;
+import org.jboss.portal.federation.impl.FederatedPortletInvokerService;
+import org.jboss.portal.jems.as.system.AbstractJBossService;
+import org.jboss.portal.portlet.PortletInvoker;
+import org.jboss.portal.wsrp.WSRPConsumer;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision$
+ * @since 2.6
+ */
+public class ConsumersRegistryService extends AbstractJBossService implements ConsumersRegistry
+{
+ /** Gives access to the Portal's portlet invokers */
+ private FederatingPortletInvoker federatingPortletInvoker;
+
+ public FederatingPortletInvoker getFederatingPortletInvoker()
+ {
+ return federatingPortletInvoker;
+ }
+
+ public void setFederatingPortletInvoker(FederatingPortletInvoker federatingPortletInvoker)
+ {
+ this.federatingPortletInvoker = federatingPortletInvoker;
+ }
+
+ public List getConfiguredConsumers()
+ {
+ Collection invokers = federatingPortletInvoker.getFederatedInvokers();
+ if (invokers.isEmpty())
+ {
+ return Collections.EMPTY_LIST;
+ }
+
+ List result = new ArrayList(invokers.size());
+ for (Iterator invokersIt = invokers.iterator(); invokersIt.hasNext();)
+ {
+ WSRPConsumer consumer = getConsumerFrom((FederatedPortletInvokerService)invokersIt.next());
+
+ if (consumer != null)
+ {
+ result.add(consumer);
+ }
+ }
+
+ return result;
+ }
+
+ public WSRPConsumer getConsumer(String id)
+ {
+ ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(id, "consumer id", null);
+ return getConsumerFrom((FederatedPortletInvokerService)federatingPortletInvoker.getFederatedInvoker(id));
+ }
+
+ private WSRPConsumer getConsumerFrom(FederatedPortletInvokerService service)
+ {
+ PortletInvoker invoker = service.getPortletInvoker();
+ if (invoker instanceof WSRPConsumer)
+ {
+ return (WSRPConsumer)invoker;
+ }
+ else
+ {
+ return null;
+ }
+ }
+}
Property changes on: trunk/wsrp/src/main/org/jboss/portal/wsrp/portlet/consumers/ConsumersRegistryService.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Added: 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-02 21:58:14 UTC (rev 5942)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/portlet/consumers/WSRPConsumerConfigurationPortlet.java 2007-01-03 00:39:30 UTC (rev 5943)
@@ -0,0 +1,111 @@
+/******************************************************************************
+ * 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. *
+ ******************************************************************************/
+
+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.GenericPortlet;
+import javax.portlet.PortletException;
+import javax.portlet.PortletRequestDispatcher;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import java.io.IOException;
+import java.util.Iterator;
+import java.util.List;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision$
+ * @since 2.6
+ */
+public class WSRPConsumerConfigurationPortlet extends GenericPortlet
+{
+ private ConsumersRegistry registry;
+ private static final String JSP_PATH = "/WEB-INF/jsp/consumers/";
+
+ public static final String OP = "op";
+ public static final String OP_LIST = "list";
+ public static final String OP_ACTIVATE = "activate";
+ public static final String OP_CONFIGURE = "configure";
+ public static final String ID = "id";
+ public static final String CONSUMER = "consumer";
+ public static final String CONSUMERS_REGISTRY = "ConsumersRegistry";
+
+ public void init() throws PortletException
+ {
+ super.init();
+ registry = (ConsumersRegistry)getPortletContext().getAttribute(CONSUMERS_REGISTRY);
+ if (registry == null)
+ {
+ throw new PortletException("Couldn't initialize Consumers registry");
+ }
+ }
+
+ protected void doView(RenderRequest request, RenderResponse response) throws PortletException, IOException
+ {
+ response.setContentType("text/html");
+
+ String op = request.getParameter(OP);
+ if (op == null)
+ {
+ op = OP_LIST;
+ }
+
+ // 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);
+ }
+
+ // configure a specific consumer
+ if (OP_CONFIGURE.equals(op))
+ {
+ String id = request.getParameter(ID);
+
+ if (id == null)
+ {
+ response.getWriter().println("Cannot configure a Consumer without a valid identifier!");
+ }
+
+
+ PortletRequestDispatcher rd = getPortletContext().getRequestDispatcher(JSP_PATH + "consumer.jsp");
+ rd.include(request, response);
+ }
+ }
+}
\ No newline at end of file
Property changes on: trunk/wsrp/src/main/org/jboss/portal/wsrp/portlet/consumers/WSRPConsumerConfigurationPortlet.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Deleted: trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/config/LocalizedString.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/config/LocalizedString.java 2007-01-02 21:58:14 UTC (rev 5942)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/config/LocalizedString.java 2007-01-03 00:39:30 UTC (rev 5943)
@@ -1,146 +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. *
- ******************************************************************************/
-
-package org.jboss.portal.wsrp.producer.config;
-
-import org.jboss.portal.common.util.ParameterValidation;
-
-import java.util.Locale;
-
-/**
- * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
- * @version $Revision$
- * @since 2.6
- */
-public class LocalizedString
-{
- private String value;
- private Locale locale;
- private String resourceName;
-
-
- public LocalizedString(String value, Locale locale)
- {
- this.value = value;
- this.locale = locale;
- }
-
-
- public LocalizedString(String value)
- {
- this.value = value;
- this.locale = Locale.getDefault();
- }
-
- public LocalizedString()
- {
- }
-
- public LocalizedString(LocalizedString other)
- {
- this.value = other.value;
- this.locale = other.locale;
- this.resourceName = other.resourceName;
- }
-
-
- public String toString()
- {
- return "LocalizedString{" +
- "value='" + value + '\'' +
- ", locale=" + locale +
- ", resourceName='" + resourceName + '\'' +
- '}';
- }
-
- public boolean equals(Object o)
- {
- if (this == o)
- {
- return true;
- }
- if (o == null || getClass() != o.getClass())
- {
- return false;
- }
-
- LocalizedString that = (LocalizedString)o;
-
- if (!locale.equals(that.locale))
- {
- return false;
- }
- if (resourceName != null ? !resourceName.equals(that.resourceName) : that.resourceName != null)
- {
- return false;
- }
- if (value != null ? !value.equals(that.value) : that.value != null)
- {
- return false;
- }
-
- return true;
- }
-
- public int hashCode()
- {
- int result;
- result = (value != null ? value.hashCode() : 0);
- result = 31 * result + locale.hashCode();
- result = 31 * result + (resourceName != null ? resourceName.hashCode() : 0);
- return result;
- }
-
- public String getValue()
- {
- return value;
- }
-
- public void setValue(String value)
- {
- ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(value, "value", "LocalizedString");
- this.value = value;
- }
-
- public Locale getLocale()
- {
- return locale;
- }
-
- public void setLocale(Locale locale)
- {
- ParameterValidation.throwIllegalArgExceptionIfNull(locale, "locale");
- this.locale = locale;
- }
-
- public String getResourceName()
- {
- return resourceName;
- }
-
- public void setResourceName(String resourceName)
- {
- ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(resourceName, "resource name", "LocalizedString");
- this.resourceName = resourceName;
- }
-}
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/config/ProducerConfigurationFactory.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/config/ProducerConfigurationFactory.java 2007-01-02 21:58:14 UTC (rev 5942)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/config/ProducerConfigurationFactory.java 2007-01-03 00:39:30 UTC (rev 5943)
@@ -27,6 +27,8 @@
import org.jboss.portal.common.util.ParameterValidation;
import org.jboss.portal.wsrp.producer.config.impl.ProducerConfigurationImpl;
import org.jboss.portal.wsrp.producer.config.impl.ProducerRegistrationRequirementsImpl;
+import org.jboss.portal.wsrp.registration.LocalizedString;
+import org.jboss.portal.wsrp.registration.RegistrationPropertyDescription;
import org.jboss.util.StringPropertyReplacer;
import org.jboss.xb.binding.ObjectModelFactory;
import org.jboss.xb.binding.UnmarshallingContext;
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/config/ProducerRegistrationRequirements.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/config/ProducerRegistrationRequirements.java 2007-01-02 21:58:14 UTC (rev 5942)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/config/ProducerRegistrationRequirements.java 2007-01-03 00:39:30 UTC (rev 5943)
@@ -24,13 +24,14 @@
package org.jboss.portal.wsrp.producer.config;
import org.jboss.portal.registration.RegistrationPropertyChangeListener;
+import org.jboss.portal.wsrp.registration.RegistrationPropertyDescription;
import javax.xml.namespace.QName;
import java.util.Map;
/**
* @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
- * @version $Revision$
+ * @version $Revision:5865 $
* @since 2.6
*/
public interface ProducerRegistrationRequirements
Deleted: trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/config/RegistrationPropertyDescription.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/config/RegistrationPropertyDescription.java 2007-01-02 21:58:14 UTC (rev 5942)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/config/RegistrationPropertyDescription.java 2007-01-03 00:39:30 UTC (rev 5943)
@@ -1,198 +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. *
- ******************************************************************************/
-
-package org.jboss.portal.wsrp.producer.config;
-
-import javax.xml.namespace.QName;
-import java.net.URI;
-
-/**
- * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
- * @version $Revision$
- * @since 2.6
- */
-public class RegistrationPropertyDescription implements Cloneable
-{
- private QName name;
- private QName type;
- private URI schemaLocation;
- private LocalizedString description;
- private LocalizedString hint;
- private LocalizedString label;
- private String[] usages;
- private QName[] aliases;
- private transient ProducerRegistrationRequirements parent;
-
-
- public RegistrationPropertyDescription(QName name, QName type)
- {
- this.name = name;
- this.type = type;
- }
-
- public RegistrationPropertyDescription(String name, QName type)
- {
- this(new QName(name), type);
- }
-
- public RegistrationPropertyDescription()
- {
- }
-
- public RegistrationPropertyDescription(RegistrationPropertyDescription other)
- {
- setName(new QName(other.name.toString()));
- setType(new QName(other.type.toString()));
-
- aliases = new QName[other.aliases.length];
- System.arraycopy(other.aliases, 0, aliases, 0, other.aliases.length);
-
- setDescription(new LocalizedString(other.description));
- setHint(new LocalizedString(other.hint));
- setLabel(new LocalizedString(other.label));
- setSchemaLocation(other.schemaLocation);
-
- usages = new String[other.usages.length];
- System.arraycopy(other.usages, 0, usages, 0, other.usages.length);
-
- parent = other.parent;
- }
-
- public QName getName()
- {
- return name;
- }
-
- public void setName(QName name)
- {
- this.name = name;
- notifyParentOfChangeIfNeeded();
- }
-
- public QName getType()
- {
- return type;
- }
-
- public void setType(QName type)
- {
- this.type = type;
- notifyParentOfChangeIfNeeded();
- }
-
- public URI getSchemaLocation()
- {
- return schemaLocation;
- }
-
- public void setSchemaLocation(URI schemaLocation)
- {
- this.schemaLocation = schemaLocation;
- notifyParentOfChangeIfNeeded();
- }
-
- public LocalizedString getDescription()
- {
- return description;
- }
-
- public void setDescription(LocalizedString description)
- {
- this.description = description;
- notifyParentOfChangeIfNeeded();
- }
-
- public void setDefaultDescription(String value)
- {
- setDescription(new LocalizedString(value));
- }
-
- public LocalizedString getHint()
- {
- return hint;
- }
-
- public void setHint(LocalizedString hint)
- {
- this.hint = hint;
- notifyParentOfChangeIfNeeded();
- }
-
- public void setDefaultHint(String value)
- {
- setHint(new LocalizedString(value));
- }
-
- public LocalizedString getLabel()
- {
- return label;
- }
-
- public void setLabel(LocalizedString label)
- {
- this.label = label;
- notifyParentOfChangeIfNeeded();
- }
-
- public void setDefaultLabel(String value)
- {
- setLabel(new LocalizedString(value));
- }
-
- public String[] getUsages()
- {
- return usages;
- }
-
- public void setUsages(String[] usages)
- {
- this.usages = new String[usages.length];
- System.arraycopy(usages, 0, this.usages, 0, usages.length);
- notifyParentOfChangeIfNeeded();
- }
-
- public QName[] getAliases()
- {
- return aliases;
- }
-
- public void setAliases(QName[] aliases)
- {
- this.aliases = new QName[aliases.length];
- System.arraycopy(aliases, 0, this.aliases, 0, aliases.length);
- notifyParentOfChangeIfNeeded();
- }
-
- public void setParent(ProducerRegistrationRequirements requirements)
- {
- this.parent = requirements;
- }
-
- private void notifyParentOfChangeIfNeeded()
- {
- if (parent != null)
- {
- parent.notifyRegistrationPropertyChangeListeners();
- }
- }
-}
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/config/impl/ProducerRegistrationRequirementsImpl.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/config/impl/ProducerRegistrationRequirementsImpl.java 2007-01-02 21:58:14 UTC (rev 5942)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/config/impl/ProducerRegistrationRequirementsImpl.java 2007-01-03 00:39:30 UTC (rev 5943)
@@ -26,7 +26,7 @@
import org.jboss.portal.common.util.ParameterValidation;
import org.jboss.portal.registration.RegistrationPropertyChangeListener;
import org.jboss.portal.wsrp.producer.config.ProducerRegistrationRequirements;
-import org.jboss.portal.wsrp.producer.config.RegistrationPropertyDescription;
+import org.jboss.portal.wsrp.registration.RegistrationPropertyDescription;
import javax.xml.namespace.QName;
import java.util.Collections;
Copied: trunk/wsrp/src/main/org/jboss/portal/wsrp/registration/LocalizedString.java (from rev 5938, trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/config/LocalizedString.java)
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/config/LocalizedString.java 2006-12-28 02:59:43 UTC (rev 5938)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/registration/LocalizedString.java 2007-01-03 00:39:30 UTC (rev 5943)
@@ -0,0 +1,146 @@
+/******************************************************************************
+ * 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. *
+ ******************************************************************************/
+
+package org.jboss.portal.wsrp.registration;
+
+import org.jboss.portal.common.util.ParameterValidation;
+
+import java.util.Locale;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision:5865 $
+ * @since 2.6
+ */
+public class LocalizedString
+{
+ private String value;
+ private Locale locale;
+ private String resourceName;
+
+
+ public LocalizedString(String value, Locale locale)
+ {
+ this.value = value;
+ this.locale = locale;
+ }
+
+
+ public LocalizedString(String value)
+ {
+ this.value = value;
+ this.locale = Locale.getDefault();
+ }
+
+ public LocalizedString()
+ {
+ }
+
+ public LocalizedString(LocalizedString other)
+ {
+ this.value = other.value;
+ this.locale = other.locale;
+ this.resourceName = other.resourceName;
+ }
+
+
+ public String toString()
+ {
+ return "LocalizedString{" +
+ "value='" + value + '\'' +
+ ", locale=" + locale +
+ ", resourceName='" + resourceName + '\'' +
+ '}';
+ }
+
+ public boolean equals(Object o)
+ {
+ if (this == o)
+ {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass())
+ {
+ return false;
+ }
+
+ LocalizedString that = (LocalizedString)o;
+
+ if (!locale.equals(that.locale))
+ {
+ return false;
+ }
+ if (resourceName != null ? !resourceName.equals(that.resourceName) : that.resourceName != null)
+ {
+ return false;
+ }
+ if (value != null ? !value.equals(that.value) : that.value != null)
+ {
+ return false;
+ }
+
+ return true;
+ }
+
+ public int hashCode()
+ {
+ int result;
+ result = (value != null ? value.hashCode() : 0);
+ result = 31 * result + locale.hashCode();
+ result = 31 * result + (resourceName != null ? resourceName.hashCode() : 0);
+ return result;
+ }
+
+ public String getValue()
+ {
+ return value;
+ }
+
+ public void setValue(String value)
+ {
+ ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(value, "value", "LocalizedString");
+ this.value = value;
+ }
+
+ public Locale getLocale()
+ {
+ return locale;
+ }
+
+ public void setLocale(Locale locale)
+ {
+ ParameterValidation.throwIllegalArgExceptionIfNull(locale, "locale");
+ this.locale = locale;
+ }
+
+ public String getResourceName()
+ {
+ return resourceName;
+ }
+
+ public void setResourceName(String resourceName)
+ {
+ ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(resourceName, "resource name", "LocalizedString");
+ this.resourceName = resourceName;
+ }
+}
Property changes on: trunk/wsrp/src/main/org/jboss/portal/wsrp/registration/LocalizedString.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Copied: trunk/wsrp/src/main/org/jboss/portal/wsrp/registration/RegistrationPropertyDescription.java (from rev 5938, trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/config/RegistrationPropertyDescription.java)
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/config/RegistrationPropertyDescription.java 2006-12-28 02:59:43 UTC (rev 5938)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/registration/RegistrationPropertyDescription.java 2007-01-03 00:39:30 UTC (rev 5943)
@@ -0,0 +1,200 @@
+/******************************************************************************
+ * 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. *
+ ******************************************************************************/
+
+package org.jboss.portal.wsrp.registration;
+
+import org.jboss.portal.wsrp.producer.config.ProducerRegistrationRequirements;
+
+import javax.xml.namespace.QName;
+import java.net.URI;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision:5865 $
+ * @since 2.6
+ */
+public class RegistrationPropertyDescription implements Cloneable
+{
+ private QName name;
+ private QName type;
+ private URI schemaLocation;
+ private LocalizedString description;
+ private LocalizedString hint;
+ private LocalizedString label;
+ private String[] usages;
+ private QName[] aliases;
+ private transient ProducerRegistrationRequirements parent;
+
+
+ public RegistrationPropertyDescription(QName name, QName type)
+ {
+ this.name = name;
+ this.type = type;
+ }
+
+ public RegistrationPropertyDescription(String name, QName type)
+ {
+ this(new QName(name), type);
+ }
+
+ public RegistrationPropertyDescription()
+ {
+ }
+
+ public RegistrationPropertyDescription(RegistrationPropertyDescription other)
+ {
+ setName(new QName(other.name.toString()));
+ setType(new QName(other.type.toString()));
+
+ aliases = new QName[other.aliases.length];
+ System.arraycopy(other.aliases, 0, aliases, 0, other.aliases.length);
+
+ setDescription(new LocalizedString(other.description));
+ setHint(new LocalizedString(other.hint));
+ setLabel(new LocalizedString(other.label));
+ setSchemaLocation(other.schemaLocation);
+
+ usages = new String[other.usages.length];
+ System.arraycopy(other.usages, 0, usages, 0, other.usages.length);
+
+ parent = other.parent;
+ }
+
+ public QName getName()
+ {
+ return name;
+ }
+
+ public void setName(QName name)
+ {
+ this.name = name;
+ notifyParentOfChangeIfNeeded();
+ }
+
+ public QName getType()
+ {
+ return type;
+ }
+
+ public void setType(QName type)
+ {
+ this.type = type;
+ notifyParentOfChangeIfNeeded();
+ }
+
+ public URI getSchemaLocation()
+ {
+ return schemaLocation;
+ }
+
+ public void setSchemaLocation(URI schemaLocation)
+ {
+ this.schemaLocation = schemaLocation;
+ notifyParentOfChangeIfNeeded();
+ }
+
+ public LocalizedString getDescription()
+ {
+ return description;
+ }
+
+ public void setDescription(LocalizedString description)
+ {
+ this.description = description;
+ notifyParentOfChangeIfNeeded();
+ }
+
+ public void setDefaultDescription(String value)
+ {
+ setDescription(new LocalizedString(value));
+ }
+
+ public LocalizedString getHint()
+ {
+ return hint;
+ }
+
+ public void setHint(LocalizedString hint)
+ {
+ this.hint = hint;
+ notifyParentOfChangeIfNeeded();
+ }
+
+ public void setDefaultHint(String value)
+ {
+ setHint(new LocalizedString(value));
+ }
+
+ public LocalizedString getLabel()
+ {
+ return label;
+ }
+
+ public void setLabel(LocalizedString label)
+ {
+ this.label = label;
+ notifyParentOfChangeIfNeeded();
+ }
+
+ public void setDefaultLabel(String value)
+ {
+ setLabel(new LocalizedString(value));
+ }
+
+ public String[] getUsages()
+ {
+ return usages;
+ }
+
+ public void setUsages(String[] usages)
+ {
+ this.usages = new String[usages.length];
+ System.arraycopy(usages, 0, this.usages, 0, usages.length);
+ notifyParentOfChangeIfNeeded();
+ }
+
+ public QName[] getAliases()
+ {
+ return aliases;
+ }
+
+ public void setAliases(QName[] aliases)
+ {
+ this.aliases = new QName[aliases.length];
+ System.arraycopy(aliases, 0, this.aliases, 0, aliases.length);
+ notifyParentOfChangeIfNeeded();
+ }
+
+ public void setParent(ProducerRegistrationRequirements requirements)
+ {
+ this.parent = requirements;
+ }
+
+ private void notifyParentOfChangeIfNeeded()
+ {
+ if (parent != null)
+ {
+ parent.notifyRegistrationPropertyChangeListeners();
+ }
+ }
+}
Property changes on: trunk/wsrp/src/main/org/jboss/portal/wsrp/registration/RegistrationPropertyDescription.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/wsrp/src/resources/portal-wsrp-sar/META-INF/jboss-service.xml
===================================================================
--- trunk/wsrp/src/resources/portal-wsrp-sar/META-INF/jboss-service.xml 2007-01-02 21:58:14 UTC (rev 5942)
+++ trunk/wsrp/src/resources/portal-wsrp-sar/META-INF/jboss-service.xml 2007-01-03 00:39:30 UTC (rev 5943)
@@ -115,11 +115,17 @@
</mbean>
<!-- Configure a consumer that is the portal itself -->
- <mbean
- code="org.jboss.portal.wsrp.deployment.WSRPDeployer"
- name="portal.wsrp:service=WSRPDeployer">
+ <mbean code="org.jboss.portal.wsrp.deployment.WSRPDeployer" name="portal.wsrp:service=WSRPDeployer">
<attribute name="DefaultWSRPLocation">default-wsrp.xml</attribute>
<depends optional-attribute-name="FederatingPortletInvoker" proxy-type="attribute">portal:service=PortletInvoker,type=Federating</depends>
</mbean>
+
+ <!-- Consumers registry for WSRP consumer configuration portlet -->
+ <mbean code="org.jboss.portal.wsrp.portlet.consumers.ConsumersRegistryService"
+ name="portal.wsrp:service=ConsumersRegistry"
+ xmbean-dd="" xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <depends optional-attribute-name="FederatingPortletInvoker" proxy-type="attribute">portal:service=PortletInvoker,type=Federating</depends>
+ </mbean>
</server>
Modified: trunk/wsrp/src/resources/portal-wsrp-sar/default-wsrp.xml
===================================================================
--- trunk/wsrp/src/resources/portal-wsrp-sar/default-wsrp.xml 2007-01-02 21:58:14 UTC (rev 5942)
+++ trunk/wsrp/src/resources/portal-wsrp-sar/default-wsrp.xml 2007-01-03 00:39:30 UTC (rev 5943)
@@ -47,7 +47,7 @@
<endpoint-wsdl-url>http://wsrp.netunitysoftware.com/WSRPTestService/WSRPTestService.asmx?Ope...</endpoint-wsdl-url>
<registration-data/>
</wsrp-producer>
- </deployment>
+ </deployment>-->
<deployment>
<wsrp-producer>
<producer-id>vignette</producer-id>
@@ -67,7 +67,7 @@
</registration-data>
</wsrp-producer>
</deployment>
- <deployment>
+ <!--<deployment>
<wsrp-producer>
<producer-id>bea</producer-id>
<expiration-cache>120</expiration-cache>
@@ -80,8 +80,8 @@
</property>
</registration-data>
</wsrp-producer>
- </deployment>
- <deployment>
+ </deployment>-->
+ <!--<deployment>
<wsrp-producer>
<producer-id>oracle</producer-id>
<expiration-cache>120</expiration-cache>
Added: trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/jboss-portlet.xml
===================================================================
--- trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/jboss-portlet.xml 2007-01-02 21:58:14 UTC (rev 5942)
+++ trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/jboss-portlet.xml 2007-01-03 00:39:30 UTC (rev 5943)
@@ -0,0 +1,30 @@
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ 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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+<portlet-app>
+ <service>
+ <service-name>ConsumersRegistry</service-name>
+ <service-class>org.jboss.portal.wsrp.portlet.consumers.ConsumersRegistry</service-class>
+ <service-ref>portal.wsrp:service=ConsumersRegistry</service-ref>
+ </service>
+</portlet-app>
+
Added: 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-02 21:58:14 UTC (rev 5942)
+++ trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/jsp/consumers/consumer.jsp 2007-01-03 00:39:30 UTC (rev 5943)
@@ -0,0 +1,112 @@
+<%@ page import="org.jboss.portal.wsrp.WSRPConsumer" %>
+<%@ 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" %>
+<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %>
+<%@ page isELIgnored="false" %>
+<portlet:defineObjects/>
+
+<%
+ ConsumersRegistry registry = (ConsumersRegistry)portletConfig.getPortletContext().getAttribute(WSRPConsumerConfigurationPortlet.CONSUMERS_REGISTRY);
+ String id = request.getParameter(WSRPConsumerConfigurationPortlet.ID);
+ if (id == null)
+ {
+ // todo: do something... :)
+ }
+ WSRPConsumer consumer = registry.getConsumer(id);
+ RegistrationInfo regInfo = consumer.getRegistrationInfo();
+%>
+
+<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>
+
+ <td><input type="text" name="producer-id" value="<%=consumer.getProducerId()%>"/></td>
+ </tr>
+
+ <tr>
+ <th>Cache expiration:</th>
+
+ <td><input type="text" name="cache-expiration"
+ value="<%=consumer.getExpirationCacheSeconds().intValue()%>"/> seconds
+ </td>
+ </tr>
+
+ <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>
+ </table>
+ </form>
+</div>
\ No newline at end of file
Added: 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-02 21:58:14 UTC (rev 5942)
+++ trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/jsp/consumers/view.jsp 2007-01-03 00:39:30 UTC (rev 5943)
@@ -0,0 +1,42 @@
+<%@ 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" %>
+<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %>
+<%@ page isELIgnored="false" %>
+<portlet:defineObjects/>
+
+<div class="portlet-section-body">
+ <table width="100%" border="0" cellspacing="0" class="portlet-table-body">
+ <caption>Configured WSRP Consumers</caption>
+ <thead>
+ <tr>
+ <th class="portlet-table-header">Active?</th>
+ <th class="portlet-table-header">Name</th>
+ <th class="portlet-table-header">Action</th>
+ </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>
+ <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.OP%>" value="<%=WSRPConsumerConfigurationPortlet.OP_ACTIVATE%>"/>
+ <portlet:param name="<%=WSRPConsumerConfigurationPortlet.ID%>" value="${n:out('consumer.id')}"/>
+ <portlet:param name="activate" value="false"/>
+ </portlet:actionURL>">deactivate</a> |
+ <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>">configure</a>
+ </td>
+ </tr>
+ </n:iterate>
+ </tbody>
+ </table>
+</div>
\ No newline at end of file
Added: 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-02 21:58:14 UTC (rev 5942)
+++ trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/portal-lib.tld 2007-01-03 00:39:30 UTC (rev 5943)
@@ -0,0 +1,104 @@
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ 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>
Added: trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/portlet.xml
===================================================================
--- trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/portlet.xml 2007-01-02 21:58:14 UTC (rev 5942)
+++ trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/portlet.xml 2007-01-03 00:39:30 UTC (rev 5943)
@@ -0,0 +1,42 @@
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ 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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+<portlet-app
+ xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
+ version="1.0">
+ <portlet>
+ <description>Configuration portlet for WSRP remote producers.</description>
+ <portlet-name>WSRPConsumerConfigurationPortlet</portlet-name>
+ <display-name>WSRP Consumers Configuration</display-name>
+ <portlet-class>org.jboss.portal.wsrp.portlet.consumers.WSRPConsumerConfigurationPortlet</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>VIEW</portlet-mode>
+ </supports>
+ <portlet-info>
+ <title>WSRP Consumers Configuration</title>
+ </portlet-info>
+ </portlet>
+</portlet-app>
+
17 years, 4 months
JBoss Portal SVN: r5942 - trunk/core/src/main/org/jboss/portal/core/deployment/jboss
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2007-01-02 16:58:14 -0500 (Tue, 02 Jan 2007)
New Revision: 5942
Modified:
trunk/core/src/main/org/jboss/portal/core/deployment/jboss/PortletAppDeployment.java
Log:
Improved logging.
Modified: trunk/core/src/main/org/jboss/portal/core/deployment/jboss/PortletAppDeployment.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/deployment/jboss/PortletAppDeployment.java 2007-01-02 19:16:05 UTC (rev 5941)
+++ trunk/core/src/main/org/jboss/portal/core/deployment/jboss/PortletAppDeployment.java 2007-01-02 21:58:14 UTC (rev 5942)
@@ -28,11 +28,11 @@
import org.jboss.portal.common.net.URLVisitor;
import org.jboss.portal.common.util.Tools;
import org.jboss.portal.common.util.XML;
-import org.jboss.portal.common.value.Value;
import org.jboss.portal.common.value.StringValue;
+import org.jboss.portal.common.value.Value;
import org.jboss.portal.core.metadata.InstanceMetaData;
-import org.jboss.portal.core.metadata.ServiceMetaData;
import org.jboss.portal.core.metadata.PreferencesMetaData;
+import org.jboss.portal.core.metadata.ServiceMetaData;
import org.jboss.portal.core.metadata.portlet.JBossApplicationMetaData;
import org.jboss.portal.core.model.instance.DuplicateInstanceException;
import org.jboss.portal.core.model.instance.Instance;
@@ -41,12 +41,12 @@
import org.jboss.portal.portlet.PortletInvokerException;
import org.jboss.portal.portlet.impl.jsr168.metadata.PreferenceMetaData;
import org.jboss.portal.portlet.state.PropertyChange;
-import org.jboss.portal.security.spi.provider.SecurityConfigurationException;
-import org.jboss.portal.security.spi.provider.AuthorizationDomain;
-import org.jboss.portal.security.spi.provider.DomainConfigurator;
-import org.jboss.portal.security.metadata.SecurityConstraintsMetaData;
import org.jboss.portal.security.RoleSecurityBinding;
import org.jboss.portal.security.SecurityConstants;
+import org.jboss.portal.security.metadata.SecurityConstraintsMetaData;
+import org.jboss.portal.security.spi.provider.AuthorizationDomain;
+import org.jboss.portal.security.spi.provider.DomainConfigurator;
+import org.jboss.portal.security.spi.provider.SecurityConfigurationException;
import org.jboss.portal.server.deployment.PortalWebApp;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -109,12 +109,11 @@
ServiceMetaData serviceMD = (ServiceMetaData)i.next();
//
- log.debug("About to inject a service in the servlet context of " + pwa.getURL());
-
- //
String serviceName = serviceMD.getName();
String serviceClass = serviceMD.getClassName();
String serviceRef = serviceMD.getRef();
+ log.debug("Trying to inject service '" + serviceName + "' (ref: '" + serviceRef + "' class: " + serviceClass +
+ ") in the servlet context of " + pwa.getURL());
//
if (serviceRef.startsWith(":"))
@@ -129,8 +128,6 @@
Class proxyClass = pwa.getClassLoader().loadClass(serviceClass);
ObjectName objectName = ObjectName.getInstance(serviceRef);
Object proxy = MBeanProxyExt.create(proxyClass, objectName, factory.getServer(), true);
- //
- log.debug("Want to inject " + serviceRef + " with class " + proxy + " and name " + serviceName);
pwa.getServletContext().setAttribute(serviceName, proxy);
}
catch (Exception e)
@@ -351,9 +348,7 @@
}
}
- /**
- * Requires a transaction to execute, setup in aop configuration.
- */
+ /** Requires a transaction to execute, setup in aop configuration. */
private void handleInstance(InstanceMetaDataContext metaDataCtx) throws PortletInvokerException, SecurityConfigurationException, DuplicateInstanceException
{
InstanceMetaData metaData = metaDataCtx.metaData;
17 years, 4 months