JBoss Portal SVN: r7198 - in trunk/wsrp/src: resources/portal-wsrp-war/WEB-INF/jsf/consumers and 1 other directory.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2007-05-05 13:30:04 -0400 (Sat, 05 May 2007)
New Revision: 7198
Modified:
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RegistrationInfo.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/WSRPConsumerImpl.java
trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/jsf/consumers/editConsumer.xhtml
Log:
- Refreshing a consumer should start it.
- JBPORTAL-715: Properly display registration info if local information is present.
- Fixed error in RegistrationInfo.refresh where the status would be improperly set to invalid
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java 2007-05-05 04:56:19 UTC (rev 7197)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java 2007-05-05 17:30:04 UTC (rev 7198)
@@ -204,6 +204,12 @@
this.persistentActive = active;
}
+ public void setActiveAndSave(boolean active)
+ {
+ setActive(active);
+ registry.updateProducerInfo(this);
+ }
+
CookieProtocol getRequiresInitCookie()
{
return requiresInitCookie;
@@ -257,6 +263,8 @@
{
result.appendToStatus("Couldn't refresh endpoint information: ").append(e.getLocalizedMessage());
}
+ // save changes to endpoint
+ registry.updateProducerInfo(this);
serviceDescription = getServiceDescription(false);
@@ -527,8 +535,7 @@
log.debug("Caught Exception in getServiceDescription:\n", e);
// de-activate
- setActive(false);
- registry.updateProducerInfo(this);
+ setActiveAndSave(false);
Throwable cause = e.getCause();
throw new InvokerUnavailableException("Problem getting service description for producer "
@@ -626,7 +633,6 @@
public void register() throws PortletInvokerException
{
register(null);
- registry.updateProducerInfo(this);
}
/**
@@ -684,11 +690,15 @@
setActive(false);
throw new PortletInvokerException("Couldn't register with producer '" + persistentId + "'", e);
}
+ finally
+ {
+ registry.updateProducerInfo(this);
+ }
}
else
{
log.info(result.getStatus());
- setActive(false);
+ setActiveAndSave(false);
throw new PortletInvokerException("Consumer is not ready to be registered with producer because of missing or invalid registration information.");
}
}
@@ -723,9 +733,16 @@
persistentRegistrationInfo = new RegistrationInfo(this);
}
- RegistrationInfo.RegistrationRefreshResult result =
- persistentRegistrationInfo.refresh(getServiceDescription(true), persistentId, mergeWithLocalInfo, true);
- registry.updateProducerInfo(this);
+ RegistrationInfo.RegistrationRefreshResult result;
+ try
+ {
+ result = persistentRegistrationInfo.refresh(getServiceDescription(true), persistentId, mergeWithLocalInfo, true);
+ }
+ finally
+ {
+ registry.updateProducerInfo(this);
+ }
+
log.info("Refreshed registration information for consumer with id '" + persistentId + "'");
return result;
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RegistrationInfo.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RegistrationInfo.java 2007-05-05 04:56:19 UTC (rev 7197)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RegistrationInfo.java 2007-05-05 17:30:04 UTC (rev 7198)
@@ -339,7 +339,7 @@
{
// take the opportunity to add the property description... ^_^
existing.setDescription(prop.getDescription());
- if (prop.isInvalid())
+ if (existing.isInvalid())
{
result.setHasIssues(true);
}
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/WSRPConsumerImpl.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/WSRPConsumerImpl.java 2007-05-05 04:56:19 UTC (rev 7197)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/WSRPConsumerImpl.java 2007-05-05 17:30:04 UTC (rev 7198)
@@ -460,6 +460,12 @@
public void activate() throws Exception
{
+ internalStart();
+ producerInfo.setActiveAndSave(getEndpointConfigurationInfo().isAvailable());
+ }
+
+ private void internalStart() throws Exception
+ {
if (!started)
{
try
@@ -469,18 +475,17 @@
catch (Exception e)
{
// mark the consumer as inactive if it cannot be started
- producerInfo.setActive(false);
+ producerInfo.setActiveAndSave(false);
throw e;
}
log.info("Consumer with id '" + getProducerId() + "' activated");
}
- producerInfo.setActive(getEndpointConfigurationInfo().isAvailable());
}
public void deactivate() throws Exception
{
- producerInfo.setActive(false);
+ producerInfo.setActiveAndSave(false);
if (started)
{
stop();
@@ -505,6 +510,15 @@
public RefreshResult refresh(boolean forceRefresh) throws PortletInvokerException
{
+ try
+ {
+ internalStart();
+ }
+ catch (Exception e)
+ {
+ throw new PortletInvokerException(e);
+ }
+
return producerInfo.detailedRefresh(forceRefresh);
}
Modified: trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/jsf/consumers/editConsumer.xhtml
===================================================================
--- trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/jsf/consumers/editConsumer.xhtml 2007-05-05 04:56:19 UTC (rev 7197)
+++ trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/jsf/consumers/editConsumer.xhtml 2007-05-05 17:30:04 UTC (rev 7198)
@@ -73,7 +73,7 @@
</c:choose>
</td>
</tr>
-<c:if test="#{!consumer.refreshNeeded or consumer.registrationChecked}">
+<c:if test="#{!consumer.refreshNeeded or consumer.localInfoPresent}">
<tr>
<th>Registration information</th>
<td>
19 years
JBoss Portal SVN: r7197 - in trunk/wsrp/src: resources/portal-wsrp-sar/conf/consumer/hibernate and 1 other directory.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2007-05-05 00:56:19 -0400 (Sat, 05 May 2007)
New Revision: 7197
Modified:
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RegistrationInfo.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RegistrationProperty.java
trunk/wsrp/src/resources/portal-wsrp-sar/conf/consumer/hibernate/domain.hbm.xml
Log:
- Handle existing invalid properties properly.
- Initialize invalid status correctly.
- Removed incorrect natural-id in Hibernate mapping.
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RegistrationInfo.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RegistrationInfo.java 2007-05-05 03:27:54 UTC (rev 7196)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RegistrationInfo.java 2007-05-05 04:56:19 UTC (rev 7197)
@@ -339,6 +339,10 @@
{
// take the opportunity to add the property description... ^_^
existing.setDescription(prop.getDescription());
+ if (prop.isInvalid())
+ {
+ result.setHasIssues(true);
+ }
}
else
{
@@ -474,6 +478,7 @@
RegistrationProperty prop = new RegistrationProperty(name, null, LocaleInfo.getRFC3066LanguageTagFor(desc.getLang()));
prop.setDescription(desc);
prop.setStatus(RegistrationProperty.MISSING_VALUE_STATUS);
+ prop.setInvalid(true);
result.put(name, prop);
}
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RegistrationProperty.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RegistrationProperty.java 2007-05-05 03:27:54 UTC (rev 7196)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RegistrationProperty.java 2007-05-05 04:56:19 UTC (rev 7197)
@@ -56,7 +56,7 @@
this.persistentName = name;
this.persistentValue = stringValue;
this.persistentLang = lang;
- persistentInvalid = (stringValue == null);
+ persistentInvalid = (stringValue == null || stringValue.length() == 0);
}
public boolean equals(Object o)
Modified: trunk/wsrp/src/resources/portal-wsrp-sar/conf/consumer/hibernate/domain.hbm.xml
===================================================================
--- trunk/wsrp/src/resources/portal-wsrp-sar/conf/consumer/hibernate/domain.hbm.xml 2007-05-05 03:27:54 UTC (rev 7196)
+++ trunk/wsrp/src/resources/portal-wsrp-sar/conf/consumer/hibernate/domain.hbm.xml 2007-05-05 04:56:19 UTC (rev 7197)
@@ -91,9 +91,7 @@
<param name="sequence">wsrpconsumer_seq</param>
</generator>
</id>
- <natural-id>
- <property name="name" type="java.lang.String" not-null="true" unique="false" insert="false" update="false"/>
- </natural-id>
+ <property name="name" type="java.lang.String" not-null="true" unique="false" insert="false" update="false"/>
<property name="value" type="java.lang.String"/>
<property name="invalid" type="boolean"/>
<property name="lang" type="java.lang.String" not-null="true"/>
19 years
JBoss Portal SVN: r7196 - trunk/wsrp/src/main/org/jboss/portal/wsrp/portlet/consumers.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2007-05-04 23:27:54 -0400 (Fri, 04 May 2007)
New Revision: 7196
Removed:
trunk/wsrp/src/main/org/jboss/portal/wsrp/portlet/consumers/WSRPConsumerConfigurationPortlet.java
Log:
- Removed unused portlet.
Deleted: 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-05-05 03:27:23 UTC (rev 7195)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/portlet/consumers/WSRPConsumerConfigurationPortlet.java 2007-05-05 03:27:54 UTC (rev 7196)
@@ -1,205 +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.portlet.consumers;
-
-import org.jboss.portal.portlet.PortletInvokerException;
-import org.jboss.portal.wsrp.consumer.ConsumerRegistry;
-import org.jboss.portal.wsrp.consumer.ProducerInfo;
-
-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.io.PrintWriter;
-
-/**
- * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
- * @version $Revision$
- * @since 2.6
- */
-public class WSRPConsumerConfigurationPortlet extends GenericPortlet
-{
- private ConsumerRegistry registry;
- private static final String NOT_SUPPORTED = "notSupported";
- 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 OP_REGISTER = "register";
- private static final String OP_ERROR = "error";
- public static final String ID = "id";
- public static final String ACTIVATE = "activate";
- public static final String REGISTER = "register";
- 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
- {
- super.init();
- registry = (ConsumerRegistry)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))
- {
- PortletRequestDispatcher rd = getPortletContext().getRequestDispatcher(JSP_PATH + "view.jsp");
- rd.include(request, response);
- return;
- }
-
- // 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);
- return;
- }
-
- 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>");
- return;
- }
-
- if (OP_ERROR.equals(op))
- {
- PrintWriter printWriter = response.getWriter();
- printWriter.print(request.getParameter("message"));
- PortletURL url = response.createRenderURL();
- url.setParameter(OP, OP_LIST);
- printWriter.println("<br/><a href='" + url + "'>back</a>");
- return;
- }
- }
-
- public void processAction(ActionRequest request, ActionResponse response) throws PortletException, PortletSecurityException, IOException
- {
- String op = request.getParameter(OP);
- if (op == null)
- {
- return;
- }
-
- String id = request.getParameter(ID);
- if (id == null)
- {
- response.setRenderParameter(OP, OP_ERROR);
- response.setRenderParameter("message", "No Consumer identifier was provided for the request!");
- return;
- }
-
- if (OP_ACTIVATE.equals(op))
- {
- String activate = request.getParameter(ACTIVATE);
- if (activate != null)
- {
- boolean start = Boolean.valueOf(activate).booleanValue();
- if (start)
- {
- registry.activateConsumerWith(id);
- }
- else
- {
- registry.deactivateConsumerWith(id);
- }
- }
-
- return;
- }
-
- if (OP_REGISTER.equals(op))
- {
- String regString = request.getParameter(REGISTER);
- if (regString != null)
- {
- boolean register = Boolean.valueOf(regString).booleanValue();
-
- try
- {
- ProducerInfo info = registry.getConsumer(id).getProducerInfo();
- if (register)
- {
- info.register();
- }
- else
- {
- info.deregister();
- }
-
- response.setRenderParameter(OP, OP_CONFIGURE);
- response.setRenderParameter(ID, id);
- }
- catch (PortletInvokerException e)
- {
- response.setRenderParameter(OP, OP_ERROR);
- response.setRenderParameter("message", e.getLocalizedMessage());
- }
- }
-
- return;
- }
-
- if (OP_EDIT.equals(op))
- {
- response.setRenderParameter(OP, NOT_SUPPORTED);
- response.setRenderParameter("method", "modifying consumer information");
- return;
- }
- }
-}
\ No newline at end of file
19 years
JBoss Portal SVN: r7195 - in trunk/wsrp/src: main/org/jboss/portal/wsrp/consumer and 2 other directories.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2007-05-04 23:27:23 -0400 (Fri, 04 May 2007)
New Revision: 7195
Modified:
trunk/wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ConsumerBean.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ConsumerManagerBean.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RefreshResult.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RegistrationInfo.java
trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/jsf/consumers/consumers.xhtml
trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/jsf/consumers/editConsumer.xhtml
trunk/wsrp/src/resources/portal-wsrp-war/style.css
Log:
- JBPORTAL-715: Improved layout, behavior and information reporting
+ Fixed display of registration information
+ Moved refresh functionality to ConsumerManagerBean
+ Better display of consumer status
+ Can refresh from consumer list
+ Still needs work and testing.
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ConsumerBean.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ConsumerBean.java 2007-05-05 03:23:14 UTC (rev 7194)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ConsumerBean.java 2007-05-05 03:27:23 UTC (rev 7195)
@@ -23,11 +23,9 @@
package org.jboss.portal.wsrp.admin.ui;
-import org.jboss.portal.portlet.PortletInvokerException;
import org.jboss.portal.wsrp.WSRPConsumer;
import org.jboss.portal.wsrp.consumer.ConsumerRegistry;
import org.jboss.portal.wsrp.consumer.ProducerInfo;
-import org.jboss.portal.wsrp.consumer.RefreshResult;
import org.jboss.portal.wsrp.consumer.RegistrationInfo;
import javax.faces.context.FacesContext;
@@ -176,11 +174,21 @@
return getProducerInfo().isRegistrationRequired();
}
+ public boolean isRegistrationChecked()
+ {
+ return getProducerInfo().isRegistrationChecked();
+ }
+
public ProducerInfo getProducerInfo()
{
return consumer.getProducerInfo();
}
+ public boolean isLocalInfoPresent()
+ {
+ return getProducerInfo().hasLocalRegistrationInfo();
+ }
+
// Actions
public String update()
@@ -234,35 +242,6 @@
return null;
}
- public String refresh()
- {
- if (consumer != null)
- {
- try
- {
- RefreshResult result = consumer.refresh(true);
- if (result.hasIssues())
- {
- createErrorMessage(result.getStatus());
- }
- else
- {
- createInfoMessage(null, result.getStatus());
- }
- }
- catch (PortletInvokerException e)
- {
- createErrorMessageFrom(e);
- return null;
- }
-
- return null;
- }
-
- createErrorMessage("Couldn't refresh Consumer!");
- return null;
- }
-
// Listeners
public void useWSDLListener(ValueChangeEvent event)
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ConsumerManagerBean.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ConsumerManagerBean.java 2007-05-05 03:23:14 UTC (rev 7194)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ConsumerManagerBean.java 2007-05-05 03:27:23 UTC (rev 7195)
@@ -23,8 +23,10 @@
package org.jboss.portal.wsrp.admin.ui;
import org.jboss.portal.common.util.ParameterValidation;
+import org.jboss.portal.portlet.PortletInvokerException;
import org.jboss.portal.wsrp.WSRPConsumer;
import org.jboss.portal.wsrp.consumer.ConsumerRegistry;
+import org.jboss.portal.wsrp.consumer.RefreshResult;
import javax.faces.context.FacesContext;
import java.util.ArrayList;
@@ -191,6 +193,36 @@
}
}
+ public String refreshConsumer()
+ {
+ if (refreshConsumerId() != null)
+ {
+ try
+ {
+ RefreshResult result = getSelectedConsumer().refresh(true);
+ if (result.hasIssues())
+ {
+ createErrorMessage(result.getStatus());
+ }
+ else
+ {
+ createInfoMessage(null, result.getStatus());
+ }
+ }
+ catch (PortletInvokerException e)
+ {
+ createErrorMessageFrom(e);
+ }
+
+ return configureConsumer();
+ }
+ else
+ {
+ noSelectedConsumerError();
+ return null;
+ }
+ }
+
public String listConsumers()
{
setConsumerIdInSession(true);
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java 2007-05-05 03:23:14 UTC (rev 7194)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java 2007-05-05 03:27:23 UTC (rev 7195)
@@ -178,6 +178,11 @@
return persistentRegistrationInfo != null && persistentRegistrationInfo.isRegistrationRequired() != null;
}
+ public boolean hasLocalRegistrationInfo()
+ {
+ return persistentRegistrationInfo != null && persistentRegistrationInfo.hasLocalInfo();
+ }
+
/**
* Determines whether the associated consumer is active.
*
@@ -651,7 +656,7 @@
if (serviceDescription.isRequiresRegistration())
{
// check if the configured registration information is correct and if we can get the service description
- RefreshResult result = persistentRegistrationInfo.refresh(serviceDescription, persistentId, false, false);
+ RefreshResult result = persistentRegistrationInfo.refresh(serviceDescription, persistentId, true, false);
if (!result.hasIssues())
{
try
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RefreshResult.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RefreshResult.java 2007-05-05 03:23:14 UTC (rev 7194)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RefreshResult.java 2007-05-05 03:27:23 UTC (rev 7195)
@@ -80,7 +80,7 @@
}
else
{
- status.append(" ").append(message);
+ status.append("\n").append(message);
}
return status;
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RegistrationInfo.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RegistrationInfo.java 2007-05-05 03:23:14 UTC (rev 7194)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RegistrationInfo.java 2007-05-05 03:27:23 UTC (rev 7195)
@@ -152,6 +152,11 @@
return requiresRegistration != null && !requiresRegistration.booleanValue();
}
+ public boolean hasLocalInfo()
+ {
+ return persistentRegistrationHandle != null || !getRegistrationProperties().isEmpty();
+ }
+
public RegistrationData getRegistrationData()
{
if (registrationData == null)
@@ -306,7 +311,7 @@
if (serviceDescription.isRequiresRegistration())
{
requiresRegistration = Boolean.TRUE;
- StringBuffer message = new StringBuffer("Producer '").append(producerId).append("' requires registration.");
+ StringBuffer message = new StringBuffer("Producer '").append(producerId).append("' requires registration");
result.appendToStatus(message.toString());
log.debug(message);
@@ -364,7 +369,7 @@
}
else
{
- String msg = "Producer '" + producerId + "' doesn't require registration.";
+ String msg = "Producer '" + producerId + "' doesn't require registration";
log.debug(msg);
result.appendToStatus(msg);
requiresRegistration = Boolean.FALSE;
@@ -393,12 +398,12 @@
private void handleNoRequiredRegistrationProperties(String producerId, RegistrationRefreshResult result, boolean keepExtra)
{
- log.info("The producer didn't require any specific registration properties.");
+ log.info("The producer didn't require any specific registration properties");
Map properties = getRegistrationProperties();
if (!properties.isEmpty())
{
String msg = "Registration data is available for producer '"
- + producerId + "' when none is expected by the producer.";
+ + producerId + "' when none is expected by the producer";
log.info(msg);
checkForExtraProperties(producerId, result, Collections.EMPTY_SET, properties, keepExtra);
}
Modified: trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/jsf/consumers/consumers.xhtml
===================================================================
--- trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/jsf/consumers/consumers.xhtml 2007-05-05 03:23:14 UTC (rev 7194)
+++ trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/jsf/consumers/consumers.xhtml 2007-05-05 03:27:23 UTC (rev 7195)
@@ -15,7 +15,8 @@
Create a consumer named:
<h:inputText value="#{consumersMgr.selectedId}" id="consumerName"/><h:message styleClass="error"
for="consumerName"/>
- <h:commandButton action="#{consumersMgr.createConsumer}" value="Create Consumer"/>
+ <h:commandButton action="#{consumersMgr.createConsumer}" value="Create Consumer"
+ styleClass="portlet-form-button"/>
</h:form>
<table width="100%" class="portlet-table-body">
@@ -28,40 +29,45 @@
<td colspan="2">Legend:
<span class="active">active</span>
<span class="inactive">inactive</span>
+ <span class="needsRefresh">needs refresh</span>
</td>
</tr>
</thead>
<tbody>
<h:form>
<c:forEach items="#{consumersMgr.consumers}" var="consumer">
- <tr class="#{consumer.producerInfo.active ? 'active' : 'inactive'}">
+ <tr class="#{consumer.active ? 'active' : 'inactive'} #{consumer.refreshNeeded ? 'needsRefresh' : ''}">
<td>
<h:commandLink action="#{consumersMgr.configureConsumer}">
<f:param name="id" value="#{consumer.producerId}"/>
<h:outputText
- value="#{consumer.producerId} (#{consumer.producerInfo.active ? 'active' : 'inactive'})"/>
+ value="#{consumer.producerId} (#{consumer.active ? 'active' : 'inactive'})
+ #{consumer.refreshNeeded ? '(refresh needed)' : ''}"/>
</h:commandLink>
</td>
<td>
<h:commandLink action="#{consumersMgr.configureConsumer}">
<f:param name="id" value="#{consumer.producerId}"/>
<h:outputText value="Configure"/>
- </h:commandLink>
- |
+ </h:commandLink> |
+ <h:commandLink action="#{consumersMgr.refreshConsumer}">
+ <f:param name="id" value="#{consumer.producerId}"/>
+ <h:outputText value="Refresh"/>
+ </h:commandLink> |
<h:commandLink action="#{consumersMgr.activateConsumer}">
<f:param name="id" value="#{consumer.producerId}"/>
- <f:param name="activate" value="#{!consumer.producerInfo.active}"/>
- <h:outputText value="#{consumer.producerInfo.active ? 'Deactivate' : 'Activate'}"/>
+ <f:param name="activate" value="#{!consumer.active}"/>
+ <h:outputText value="#{consumer.active ? 'Deactivate' : 'Activate'}"/>
</h:commandLink>
- <c:if test="#{consumer.producerInfo.active and consumer.producerInfo.registrationRequired}"> |
- <h:commandLink
- action="#{consumersMgr.registerConsumer}">
+ <c:if
+ test="#{!consumer.refreshNeeded and consumer.active and consumer.producerInfo.registrationRequired}">
+ |
+ <h:commandLink action="#{consumersMgr.registerConsumer}">
<f:param name="id" value="#{consumer.producerId}"/>
<f:param name="register" value="#{!consumer.producerInfo.registered}"/>
<h:outputText value="#{consumer.producerInfo.registered ? 'Deregister' : 'Register'}"/>
</h:commandLink>
- </c:if>
- |
+ </c:if> |
<h:commandLink action="#{consumersMgr.destroyConsumer}">
<f:param name="id" value="#{consumer.producerId}"/>
<h:outputText value="Destroy"/>
Modified: trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/jsf/consumers/editConsumer.xhtml
===================================================================
--- trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/jsf/consumers/editConsumer.xhtml 2007-05-05 03:23:14 UTC (rev 7194)
+++ trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/jsf/consumers/editConsumer.xhtml 2007-05-05 03:27:23 UTC (rev 7195)
@@ -5,9 +5,10 @@
xmlns:f="http://java.sun.com/jsf/core"
xmlns:c="http://java.sun.com/jstl/core">
-<h:form>
- <h1 class="portlet">Consumer '#{consumer.id}' configuration</h1>
-</h:form>
+<h1
+ class="portlet-section-header #{consumer.active ? 'active' : 'inactive'} #{consumer.refreshNeeded ? 'needsRefresh' : ''}">
+ Consumer '#{consumer.id}' configuration (#{consumer.active ? 'active' : 'inactive'})
+ #{consumer.refreshNeeded ? '(refresh needed)' : ''}</h1>
<hr/>
@@ -72,20 +73,12 @@
</c:choose>
</td>
</tr>
-<c:if test="#{consumer.refreshNeeded}">
+<c:if test="#{!consumer.refreshNeeded or consumer.registrationChecked}">
<tr>
- <td colspan="2" class="info">
- There have been changes in the Producer configuration (or the Producer's service description has not yet
- been retrieved), refreshing the Consumer might be a good idea.
- </td>
- </tr>
-</c:if>
-<c:if test="#{!consumer.refreshNeeded}">
- <tr>
<th>Registration information</th>
<td>
<c:choose>
- <c:when test="#{consumer.registrationRequired}">
+ <c:when test="#{consumer.localInfoPresent}">
<c:choose>
<c:when test="#{!empty consumer.producerInfo.registrationInfo.registrationPropertyNames}">
<table border='1' cellspacing='0' class='registration-prop-table'>
@@ -107,31 +100,44 @@
</table>
</c:when>
<c:otherwise>
- No required registration properties.
+ Registration is indicated as required without registration properties.
</c:otherwise>
</c:choose>
</c:when>
- <c:otherwise>
+ <c:when test="#{consumer.registrationChecked and !consumer.registrationRequired}">
Producer doesn't require registration.
- </c:otherwise>
+ </c:when>
</c:choose>
</td>
</tr>
+ <c:if test="#{!empty consumer.producerInfo.registrationInfo.registrationHandle}">
+ <tr>
+ <th>Registration context:</th>
+ <td>Handle:
+ <h:outputText value="#{consumer.producerInfo.registrationInfo.registrationHandle}"/>
+ </td>
+ </tr>
+ </c:if>
+ <c:if test="#{!consumer.registrationChecked}">
+ <tr>
+ <td colspan="2">
+ <p class="info">Registration information hasn't been validated with the Producer. You should validate
+ it.</p>
+ <h:commandLink action="#{consumer.refreshRegistrationInfo}" value="Validate"
+ title="Validate registration info from Producer"
+ styleClass="portlet-form-button">
+ <f:param name="eraseLocalInfo" value="false"/>
+ </h:commandLink>
+ </td>
+ </tr>
+ </c:if>
</c:if>
-<c:if test="#{consumer.producerInfo.registrationInfo.registrationValid}">
- <tr>
- <th>Registration context:</th>
- <td>Handle:
- <h:outputText value="#{consumer.producerInfo.registrationInfo.registrationContext.registrationHandle}"/>
- </td>
- </tr>
-</c:if>
<tr>
<td>
<h:commandButton action="#{consumer.update}" value="Save" styleClass="portlet-form-button"/>
- <h:commandLink action="#{consumer.refresh}" value="Refresh" title="Refresh information from Producer"
+ <h:commandLink action="#{consumersMgr.refreshConsumer}" value="Refresh" title="Refresh information from Producer"
styleClass="portlet-form-button">
- <f:param name="eraseLocalData" value="true"/>
+ <f:param name="id" value="#{consumer.id}"/>
</h:commandLink>
</td>
<td style="text-align: right;">
Modified: trunk/wsrp/src/resources/portal-wsrp-war/style.css
===================================================================
--- trunk/wsrp/src/resources/portal-wsrp-war/style.css 2007-05-05 03:23:14 UTC (rev 7194)
+++ trunk/wsrp/src/resources/portal-wsrp-war/style.css 2007-05-05 03:27:23 UTC (rev 7195)
@@ -28,15 +28,19 @@
padding-top: 2px;
}
-.wsrp-consumers-ui .active {
+.wsrp-consumers-ui .active, .wsrp-consumer-ui .active {
background-color: #C7DDB7;
font-weight: bold;
}
-.wsrp-consumers-ui .inactive {
+.wsrp-consumers-ui .inactive, .wsrp-consumer-ui .inactive {
background-color: #EBD1B8;
}
+.wsrp-consumers-ui .needsRefresh, .wsrp-consumer-ui .needsRefresh {
+ font-style: italic;
+}
+
.wsrp-consumer-ui .registration-prop-table {
text-align: left;
border: 0;
@@ -57,7 +61,15 @@
color: red;
}
+.error:before {
+ content: "Error: "
+}
+
.info {
font-weight: bold;
color: green;
+}
+
+.info:before {
+ content: "Info: "
}
\ No newline at end of file
19 years
JBoss Portal SVN: r7194 - in trunk/wsrp/src/main/org/jboss/portal/wsrp: services and 1 other directory.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2007-05-04 23:23:14 -0400 (Fri, 04 May 2007)
New Revision: 7194
Modified:
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ConsumerRegistryService.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/EndpointConfigurationInfo.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/services/AbstractSOAPServiceFactory.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/services/RemoteSOAPInvokerServiceFactory.java
Log:
- Improved behavior if WSDL is not available at startup.
- Now attempt to start the service factory if it hasn't been started already to provide for better user experience in particular when refreshing the info.
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ConsumerRegistryService.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ConsumerRegistryService.java 2007-05-04 16:08:59 UTC (rev 7193)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ConsumerRegistryService.java 2007-05-05 03:23:14 UTC (rev 7194)
@@ -267,7 +267,8 @@
}
catch (ConsumerException e)
{
- // ignore and continue
+ producerInfo.setActive(false);
+ updateProducerInfo(producerInfo);
}
}
}
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/EndpointConfigurationInfo.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/EndpointConfigurationInfo.java 2007-05-04 16:08:59 UTC (rev 7193)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/EndpointConfigurationInfo.java 2007-05-05 03:23:14 UTC (rev 7194)
@@ -191,7 +191,9 @@
this.persistentWsdlDefinitionURL = wsdlDefinitionURL;
// WSDL url is optional so can be null (and in particular, it is when loaded from Hibernate most of the time)
- if (wsdlDefinitionURL != null)
+ // do not attempt to set the URL if the service factory hasn't been created yet to avoid issues when
+ // ConsumerRegistry starts (in particular, raising an exception if the WSDL is not available)
+ if (wsdlDefinitionURL != null && serviceFactory != null)
{
if (!(serviceFactory instanceof RemoteSOAPInvokerServiceFactory))
{
@@ -236,8 +238,24 @@
throw new IllegalStateException("Cannot initialize ServiceFactory: missing either service description or markup URLs!");
}
}
+
+ startServiceFactoryIfNeeded();
}
+ }
+ private void startServiceFactoryIfNeeded()
+ {
+ if (!serviceFactory.isAvailable())
+ {
+ try
+ {
+ serviceFactory.start();
+ }
+ catch (Exception e)
+ {
+ throw new ConsumerException("Couldn't start ServiceFactory", e);
+ }
+ }
}
private void internalSetWsdlURL()
@@ -255,7 +273,7 @@
public void start() throws Exception
{
- getServiceFactory().start();
+ initServiceFactoryIfNeeded();
}
public void stop() throws Exception
@@ -267,6 +285,7 @@
public ServiceFactory getServiceFactory()
{
initServiceFactoryIfNeeded();
+ startServiceFactoryIfNeeded();
return serviceFactory;
}
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/services/AbstractSOAPServiceFactory.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/services/AbstractSOAPServiceFactory.java 2007-05-04 16:08:59 UTC (rev 7193)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/services/AbstractSOAPServiceFactory.java 2007-05-05 03:23:14 UTC (rev 7194)
@@ -37,14 +37,11 @@
{
/** Cache the services. */
- private Map services;
+ private Map services = new ConcurrentReaderHashMap();
protected void createService() throws Exception
{
super.createService();
-
- //
- services = new ConcurrentReaderHashMap();
}
protected void destroyService() throws Exception
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/services/RemoteSOAPInvokerServiceFactory.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/services/RemoteSOAPInvokerServiceFactory.java 2007-05-04 16:08:59 UTC (rev 7193)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/services/RemoteSOAPInvokerServiceFactory.java 2007-05-05 03:23:14 UTC (rev 7194)
@@ -72,7 +72,7 @@
return wsdlDefinitionURL;
}
- public void setWsdlDefinitionURL(String wsdlDefinitionURL) throws RuntimeException, Exception
+ public void setWsdlDefinitionURL(String wsdlDefinitionURL) throws Exception
{
if (wsdlDefinitionURL == null || wsdlDefinitionURL.length() == 0)
{
19 years
JBoss Portal SVN: r7193 - trunk/theme/src/main/org/jboss/portal/theme/impl.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-05-04 12:08:59 -0400 (Fri, 04 May 2007)
New Revision: 7193
Modified:
trunk/theme/src/main/org/jboss/portal/theme/impl/JSPLayout.java
Log:
JBPORTAL-1379 : Dashboard maximized window should not be draggable
Modified: trunk/theme/src/main/org/jboss/portal/theme/impl/JSPLayout.java
===================================================================
--- trunk/theme/src/main/org/jboss/portal/theme/impl/JSPLayout.java 2007-05-04 16:07:13 UTC (rev 7192)
+++ trunk/theme/src/main/org/jboss/portal/theme/impl/JSPLayout.java 2007-05-04 16:08:59 UTC (rev 7193)
@@ -25,12 +25,14 @@
import org.jboss.portal.theme.LayoutDispatcher;
import org.jboss.portal.theme.PortalLayout;
+import org.jboss.portal.theme.impl.render.dynamic.DynaRenderOptions;
import org.jboss.portal.theme.page.PageResult;
import org.jboss.portal.theme.page.WindowContext;
import org.jboss.portal.theme.page.WindowResult;
import org.jboss.portal.theme.render.RendererContext;
import org.jboss.portal.theme.render.renderer.PageRendererContext;
import org.jboss.portal.theme.render.renderer.PageRenderer;
+import org.jboss.portal.theme.render.renderer.RegionRendererContext;
import org.jboss.portal.theme.render.RenderException;
import org.jboss.portal.theme.render.RendererFactory;
import org.jboss.portal.theme.render.ThemeContext;
@@ -44,6 +46,7 @@
import java.io.Writer;
import java.io.PrintWriter;
import java.util.Iterator;
+import java.util.Map;
/**
* Layout implementation that uses JSPs (and tags) to render the response back to the client.
@@ -123,16 +126,34 @@
// //
// pageResult = newRes;
+ // Get src region
+ RegionRendererContext srcRegion = pageResult.getRegion(wc.getRegionName());
+ Map srcProps = srcRegion.getProperties();
+
+ //
pageResult.setLayoutState("maximized");
wc.setRegionName("maximized");
wc.setOrder(0);
+
+ // Yes it is ugly
+ pageResult.rebuild();
+
+ // New destination region
+ RegionRendererContext dstRegion = pageResult.getRegion("maximized");
+ Map dstProps = dstRegion.getProperties();
+
+ // Copy properties
+ dstProps.putAll(srcProps);
+
+ // Disable DnD
+ DynaRenderOptions options = DynaRenderOptions.getOptions(Boolean.FALSE, null);
+ options.setOptions(dstProps);
+
+ //
break;
}
}
- // Yes it is ugly
- pageResult.rebuild();
-
try
{
String layoutState = pageResult.getLayoutState();
19 years
JBoss Portal SVN: r7192 - in trunk: wsrp and 1 other directory.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2007-05-04 12:07:13 -0400 (Fri, 04 May 2007)
New Revision: 7192
Modified:
trunk/test/.classpath
trunk/wsrp/.classpath
Log:
Update Eclipse files
Modified: trunk/test/.classpath
===================================================================
--- trunk/test/.classpath 2007-05-04 07:15:53 UTC (rev 7191)
+++ trunk/test/.classpath 2007-05-04 16:07:13 UTC (rev 7192)
@@ -6,6 +6,7 @@
<classpathentry kind="lib" path="/thirdparty/oswego-concurrent/lib/concurrent.jar"/>
<classpathentry kind="lib" path="/tools/lib/xalan.jar"/>
<classpathentry kind="lib" path="/thirdparty/sun-servlet/lib/servlet-api.jar"/>
+ <classpathentry kind="lib" path="selenium-java-client-driver-backport.jar"/>
<classpathentry combineaccessrules="false" kind="src" path="/common"/>
<classpathentry kind="lib" path="/thirdparty/apache-httpclient/lib/commons-httpclient.jar"/>
<classpathentry kind="lib" path="/thirdparty/dom4j/lib/dom4j.jar"/>
Modified: trunk/wsrp/.classpath
===================================================================
--- trunk/wsrp/.classpath 2007-05-04 07:15:53 UTC (rev 7191)
+++ trunk/wsrp/.classpath 2007-05-04 16:07:13 UTC (rev 7192)
@@ -30,5 +30,6 @@
<classpathentry combineaccessrules="false" kind="src" path="/portlet-federation"/>
<classpathentry kind="lib" path="/thirdparty/hibernate/lib/hibernate3.jar"/>
<classpathentry kind="lib" path="/thirdparty/apache-myfaces/lib/myfaces-api.jar"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/web"/>
<classpathentry kind="output" path="output/classes"/>
</classpath>
19 years
JBoss Portal SVN: r7191 - docs/trunk/userGuide/en/modules.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2007-05-04 03:15:53 -0400 (Fri, 04 May 2007)
New Revision: 7191
Modified:
docs/trunk/userGuide/en/modules/acknowledgements.xml
docs/trunk/userGuide/en/modules/featurelist.xml
Log:
Sync with ref guide
Modified: docs/trunk/userGuide/en/modules/acknowledgements.xml
===================================================================
--- docs/trunk/userGuide/en/modules/acknowledgements.xml 2007-05-04 05:28:38 UTC (rev 7190)
+++ docs/trunk/userGuide/en/modules/acknowledgements.xml 2007-05-04 07:15:53 UTC (rev 7191)
@@ -1,21 +1,15 @@
<preface id="acknowledgements">
<title>Acknowledgements</title>
- <para>We would like to thank
- <emphasis role="bold">all</emphasis>
- the developers that participate
- in the JBoss Portal project effort.
- </para>
+ <para>We would like to thank the developers that participate in the JBoss Portal project effort.</para>
<para>Specifically,</para>
<para>
- <orderedlist>
- <listitem>Thomas Heute, for his help on the first-ever version of JBoss Portal and the corresponding
- documentation. ;-)</listitem>
+ <itemizedlist>
<listitem>
- Remy for his help with Tomcat configuration.
+ Antoine Herzog for his feedback, for writing Wikis and helping in the forums.
</listitem>
<listitem>
Mark Fernandes and Paul Tamaro from Novell, for their hard work in supplying the
- portal project with usable and attractive themes and layouts.
+ portal project with usable and attractive themes and layouts in the 2.4 version of JBoss Portal
</listitem>
<listitem>
Kev "kevs3d" Roast for supplying us with two working portlets that integrate existing
@@ -25,14 +19,21 @@
Swarn "sdhaliwal" Dhaliwal for supplying us with the Struts-Bridge, that will allow
for existing struts applications to work with the Portal.
</listitem>
- <listitem>Julien Viet for creating a scalable and flexible architecture... and putting up with all of my crazy
- ideas.</listitem>
- </orderedlist>
+ <listitem>
+ A few Red Hat employees, Remy Maucherat for Tomcat configuration, Magesh Kumar Bojan and Martin Putz always there to help our customers,
+ Prabhat Jha for making sure that JBoss Portal runs great everywhere. Noel Rocher for his early feedback on JBoss Portal 2.6
+ and contributions.
+ </listitem>
+ <listitem>
+ The JBoss Labs (http://www.JBoss.org) team for building a great infrastructure on top of JBoss Portal 2.6, providing very useful feedback and
+ giving us the initial Drag and Drop implementation.
+ </listitem>
+ <listitem>
+ Everyone participating in the forums and Wiki in general.
+ </listitem>
+ </itemizedlist>
</para>
<para>Contributions of any kind are always welcome, you can contribute by providing ideas,
filling bug reports, producing some code, designing a theme, writing some documentation,
- etc... To report a bug please use our
- <ulink url="http://jira.jboss.com/jira/browse/JBPORTAL">Jira system</ulink>
- .
- </para>
+ etc... If you think your name is missing from this page, please let us know.</para>
</preface>
\ No newline at end of file
Modified: docs/trunk/userGuide/en/modules/featurelist.xml
===================================================================
--- docs/trunk/userGuide/en/modules/featurelist.xml 2007-05-04 05:28:38 UTC (rev 7190)
+++ docs/trunk/userGuide/en/modules/featurelist.xml 2007-05-04 07:15:53 UTC (rev 7191)
@@ -3,7 +3,7 @@
<para>The following list details features found in this document's related release. For a
technical view of our features, view the
<ulink
- url="http://jira.jboss.com/jira/browse/JBPORTAL">Project Roadmap and Task List</ulink>
+ url="http://jira.jboss.com/jira/browse/JBPORTAL">Project Roadmap and Task List</ulink>
.
</para>
<para>
@@ -17,23 +17,21 @@
</listitem>
<listitem>
<emphasis role="bold">DB Agnostic:</emphasis>
- Will work with any RDBMS supported by
- Hibernate
+ Will work with any RDBMS supported by Hibernate
</listitem>
<listitem>
<emphasis role="bold">SSO/LDAP:</emphasis>
Leverages Tomcat and JBoss single sign on (SSO)
solutions.
+ Identity mapping framework adaptable to the enterprise LDAP deployments.
</listitem>
<listitem>
<emphasis role="bold">JAAS Authentication:</emphasis>
- Custom authentication via JAAS login
- modules.
+ Custom authentication via JAAS login modules.
</listitem>
<listitem>
<emphasis role="bold">Cacheing:</emphasis>
- Utilizes render-view caching for improved
- performance.
+ Utilizes render-view caching for improved performance.
</listitem>
<listitem>
<emphasis role="bold">Clusterable:</emphasis>
@@ -67,6 +65,9 @@
<emphasis role="bold">Java Management Extension (JMX) 1.2</emphasis>
</listitem>
<listitem>
+ <emphasis role="bold">Web Services for Remote Portlets (WSRP) 1.0 Base Level </emphasis>
+ </listitem>
+ <listitem>
<emphasis role="bold">Full J2EE 1.4 compliance when used with JBoss AS</emphasis>
</listitem>
</itemizedlist>
@@ -116,6 +117,29 @@
</listitem>
</itemizedlist>
<para>
+ <emphasis role="bold">Web Services for Remote Portlets</emphasis>
+ </para>
+ <itemizedlist>
+ <listitem>
+ <emphasis role="bold">WSRP Consumer</emphasis>
+ <itemizedlist>
+ <listitem>Support for WSRP Base level (support for service description and markup interfaces)</listitem>
+ <listitem>Ability to easily consume portlets from remote producers</listitem>
+ <listitem>Seamless integration of WSRP portlets in portal</listitem>
+ <listitem>Support for simple registration schemes</listitem>
+ <listitem>Simple caching of markup and metadata</listitem>
+ </itemizedlist>
+ </listitem>
+ <listitem>
+ <emphasis role="bold">WSRP Producer</emphasis>
+ <itemizedlist>
+ <listitem>Support for WSRP Base level (support for service description and markup interfaces)</listitem>
+ <listitem>Local portlets can easily be exposed remotely to WSRP consumers</listitem>
+ <listitem>Includes a local WSRP producer to easily test WSRP in Portal ('self' portlet provider)</listitem>
+ </itemizedlist>
+</listitem>
+ </itemizedlist>
+ <para>
<emphasis role="bold">Themes and Layouts</emphasis>
</para>
<itemizedlist>
@@ -257,43 +281,4 @@
to the user based on his/her browser settings.
</listitem>
</itemizedlist>
- <para>
- <emphasis role="bold">Message Boards</emphasis>
- </para>
- <itemizedlist>
- <listitem>
- <emphasis role="bold">Instant reply:</emphasis>
- Instant reply feature, makes for one-click
- replies to posts.
- </listitem>
- <listitem>
- <emphasis role="bold">Post quoting:</emphasis>
- Quote an existing topic and poster within a
- reply.
- </listitem>
- <listitem>
- <emphasis role="bold">Flood control:</emphasis>
- Prevents abuse of multiple posts withing a
- set configurable time-frame.
- </listitem>
- <listitem>
- <emphasis role="bold">Category creation:</emphasis>
- Create a category that contains forums
- within it.
- </listitem>
- <listitem>
- <emphasis role="bold">Forum creation:</emphasis>
- Create a forum and assign it to a specific
- category.
- </listitem>
- <listitem>
- <emphasis role="bold">Forum modification:</emphasis>
- Edit, move, delete forums.
- </listitem>
- <listitem>
- <emphasis role="bold">Forum and category reordering:</emphasis>
- Reorder categories and
- forums in the order you would like them to appear on the page.
- </listitem>
- </itemizedlist>
-</preface>
\ No newline at end of file
+</preface>
19 years
JBoss Portal SVN: r7190 - in trunk/wsrp/src: main/org/jboss/portal/test/wsrp/other and 4 other directories.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2007-05-04 01:28:38 -0400 (Fri, 04 May 2007)
New Revision: 7190
Modified:
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/framework/support/MockWSRPConsumer.java
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/other/RegistrationInfoTestCase.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/WSRPConsumer.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ConsumerBean.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RefreshResult.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RegistrationInfo.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/WSRPConsumerImpl.java
trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/jsf/consumers/consumers.xhtml
trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/jsf/consumers/editConsumer.xhtml
Log:
- JBPORTAL-715:
+ Improved layout, behavior and information reporting.
+ Implemented refresh functionality.
+ Still needs work and testing.
- Renamed RegistrationInfo.refreshRegistrationRequirementsFor to refresh.
- Refresh methods return more detailed information.
Modified: trunk/wsrp/src/main/org/jboss/portal/test/wsrp/framework/support/MockWSRPConsumer.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/test/wsrp/framework/support/MockWSRPConsumer.java 2007-05-04 02:43:12 UTC (rev 7189)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/framework/support/MockWSRPConsumer.java 2007-05-04 05:28:38 UTC (rev 7190)
@@ -35,6 +35,7 @@
import org.jboss.portal.wsrp.WSRPConsumer;
import org.jboss.portal.wsrp.consumer.ProducerInfo;
import org.jboss.portal.wsrp.consumer.ProducerSessionInformation;
+import org.jboss.portal.wsrp.consumer.RefreshResult;
import org.jboss.portal.wsrp.consumer.RegistrationInfo;
import org.jboss.portal.wsrp.services.ServiceFactory;
@@ -66,11 +67,6 @@
{
}
- public ServiceFactory getServiceFactory()
- {
- return producerInfo.getEndpointConfigurationInfo().getServiceFactory();
- }
-
public ProducerSessionInformation getProducerSessionInformationFrom(PortletInvocation invocation)
{
return null;
@@ -116,6 +112,16 @@
return true;
}
+ public boolean isRefreshNeeded()
+ {
+ return false;
+ }
+
+ public RefreshResult refresh(boolean forceRefresh)
+ {
+ return null;
+ }
+
public Set getPortlets() throws PortletInvokerException
{
return null;
Modified: trunk/wsrp/src/main/org/jboss/portal/test/wsrp/other/RegistrationInfoTestCase.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/test/wsrp/other/RegistrationInfoTestCase.java 2007-05-04 02:43:12 UTC (rev 7189)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/other/RegistrationInfoTestCase.java 2007-05-04 05:28:38 UTC (rev 7190)
@@ -80,7 +80,7 @@
assertFalse(info.isRegistrationValid());
ServiceDescription sd = createServiceDescription(false, 0);
- RegistrationInfo.RegistrationRefreshResult result = info.refreshRegistrationRequirementsFor(sd, producerId, true, false);
+ RegistrationInfo.RegistrationRefreshResult result = info.refresh(sd, producerId, true, false);
assertNotNull(result);
assertFalse(result.hasIssues());
assertFalse(info.isRegistrationRequired().booleanValue());
@@ -88,7 +88,7 @@
assertFalse(info.isRegistrationDeterminedRequired());
assertTrue(info.isRegistrationValid());
- result = info.refreshRegistrationRequirementsFor(sd, producerId, false, false);
+ result = info.refresh(sd, producerId, false, false);
assertNotNull(result);
assertFalse(result.hasIssues());
assertFalse(info.isRegistrationRequired().booleanValue());
@@ -103,7 +103,7 @@
assertNull(info.isRegistrationRequired());
assertFalse(info.isRegistrationValid());
- RegistrationInfo.RegistrationRefreshResult result = info.refreshRegistrationRequirementsFor(
+ RegistrationInfo.RegistrationRefreshResult result = info.refresh(
createServiceDescription(true, 0), producerId, true, false);
assertNotNull(result);
assertFalse(result.hasIssues());
@@ -118,7 +118,7 @@
// set a registration property
info.setRegistrationPropertyValue("foo", "bar");
- RegistrationInfo.RegistrationRefreshResult result = info.refreshRegistrationRequirementsFor(
+ RegistrationInfo.RegistrationRefreshResult result = info.refresh(
createServiceDescription(true, 0), producerId, false, false);
assertNotNull(result);
assertTrue(result.hasIssues());
@@ -143,7 +143,7 @@
// producer requests 2 registration properties
ServiceDescription sd = createServiceDescription(true, 2);
- RegistrationInfo.RegistrationRefreshResult result = info.refreshRegistrationRequirementsFor(sd, producerId, false, false);
+ RegistrationInfo.RegistrationRefreshResult result = info.refresh(sd, producerId, false, false);
assertNotNull(result);
assertTrue(result.hasIssues());
String status = result.getStatus();
@@ -165,7 +165,7 @@
{
info.setRegistrationPropertyValue("foo", "bar");
- RegistrationInfo.RegistrationRefreshResult result = info.refreshRegistrationRequirementsFor(createServiceDescription(true, 2),
+ RegistrationInfo.RegistrationRefreshResult result = info.refresh(createServiceDescription(true, 2),
producerId, true, false);
assertNotNull(result);
assertTrue(result.hasIssues());
@@ -189,7 +189,7 @@
public void testForceRefreshRegistration()
{
- RegistrationInfo.RegistrationRefreshResult result = info.refreshRegistrationRequirementsFor(
+ RegistrationInfo.RegistrationRefreshResult result = info.refresh(
createServiceDescription(true, 0), producerId, false, false);
assertNotNull(result);
assertFalse(result.hasIssues());
@@ -197,22 +197,22 @@
// Modifying a property renders the info dirty and hence should be refreshed
info.setRegistrationPropertyValue("foo", "bar");
- result = info.refreshRegistrationRequirementsFor(createServiceDescription(true, 0), producerId, false, false);
+ result = info.refresh(createServiceDescription(true, 0), producerId, false, false);
assertTrue(result.hasIssues());
assertFalse(info.isRegistrationValid());
info.removeRegistrationProperty("foo");
- result = info.refreshRegistrationRequirementsFor(createServiceDescription(true, 0), producerId, false, false);
+ result = info.refresh(createServiceDescription(true, 0), producerId, false, false);
assertFalse(result.hasIssues());
assertFalse(info.isRegistrationValid());
// producer has changed but we're not forcing refresh so registration should still be invalid
- result = info.refreshRegistrationRequirementsFor(createServiceDescription(false, 0), producerId, false, false);
+ result = info.refresh(createServiceDescription(false, 0), producerId, false, false);
assertFalse(result.hasIssues());
assertFalse(info.isRegistrationValid());
// force refresh
- result = info.refreshRegistrationRequirementsFor(createServiceDescription(false, 0), producerId, false, true);
+ result = info.refresh(createServiceDescription(false, 0), producerId, false, true);
assertFalse(result.hasIssues());
assertTrue(info.isRegistrationValid());
}
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/WSRPConsumer.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/WSRPConsumer.java 2007-05-04 02:43:12 UTC (rev 7189)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/WSRPConsumer.java 2007-05-04 05:28:38 UTC (rev 7190)
@@ -28,6 +28,7 @@
import org.jboss.portal.portlet.invocation.PortletInvocation;
import org.jboss.portal.wsrp.consumer.ProducerInfo;
import org.jboss.portal.wsrp.consumer.ProducerSessionInformation;
+import org.jboss.portal.wsrp.consumer.RefreshResult;
import org.jboss.portal.wsrp.consumer.RegistrationInfo;
import org.jboss.system.Service;
@@ -123,4 +124,17 @@
* @since 2.6
*/
boolean isActive();
+
+ /**
+ * @return
+ * @since 2.6
+ */
+ boolean isRefreshNeeded();
+
+ /**
+ * @param forceRefresh
+ * @return
+ * @since 2.6
+ */
+ RefreshResult refresh(boolean forceRefresh) throws PortletInvokerException;
}
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ConsumerBean.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ConsumerBean.java 2007-05-04 02:43:12 UTC (rev 7189)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ConsumerBean.java 2007-05-04 05:28:38 UTC (rev 7190)
@@ -23,9 +23,11 @@
package org.jboss.portal.wsrp.admin.ui;
+import org.jboss.portal.portlet.PortletInvokerException;
import org.jboss.portal.wsrp.WSRPConsumer;
import org.jboss.portal.wsrp.consumer.ConsumerRegistry;
import org.jboss.portal.wsrp.consumer.ProducerInfo;
+import org.jboss.portal.wsrp.consumer.RefreshResult;
import org.jboss.portal.wsrp.consumer.RegistrationInfo;
import javax.faces.context.FacesContext;
@@ -69,6 +71,11 @@
this.useWSDL = useWSDL ? Boolean.TRUE : Boolean.FALSE;
}
+ public boolean isRefreshNeeded()
+ {
+ return consumer.isRefreshNeeded();
+ }
+
public String getId()
{
return consumer.getProducerId();
@@ -206,7 +213,7 @@
try
{
RegistrationInfo.RegistrationRefreshResult result = consumer.refreshRegistrationInfo(eraseLocalData);
- if (!result.isValid())
+ if (result.hasIssues())
{
createErrorMessage(result.getStatus());
}
@@ -227,6 +234,35 @@
return null;
}
+ public String refresh()
+ {
+ if (consumer != null)
+ {
+ try
+ {
+ RefreshResult result = consumer.refresh(true);
+ if (result.hasIssues())
+ {
+ createErrorMessage(result.getStatus());
+ }
+ else
+ {
+ createInfoMessage(null, result.getStatus());
+ }
+ }
+ catch (PortletInvokerException e)
+ {
+ createErrorMessageFrom(e);
+ return null;
+ }
+
+ return null;
+ }
+
+ createErrorMessage("Couldn't refresh Consumer!");
+ return null;
+ }
+
// Listeners
public void useWSDLListener(ValueChangeEvent event)
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java 2007-05-04 02:43:12 UTC (rev 7189)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java 2007-05-04 05:28:38 UTC (rev 7190)
@@ -104,6 +104,8 @@
private GetServiceDescription serviceDescriptionRequest;
private ConsumerRegistry registry;
+ private static final String REGISTER_MEANING = "Should clients ask for a new service description?";
+ private static final String REFRESH_MEANING = "Did just refresh?";
/*protected org.jboss.portal.wsrp.core.ItemDescription[] userCategoryDescriptions;
protected org.jboss.portal.wsrp.core.ItemDescription[] customUserProfileItemDescriptions;
@@ -212,10 +214,15 @@
*/
public boolean refresh(boolean forceRefresh) throws PortletInvokerException
{
- boolean justRefreshed = internalRefresh(forceRefresh);
+ return detailedRefresh(forceRefresh).specificCode();
+ }
+ public RefreshResult detailedRefresh(boolean forceRefresh) throws PortletInvokerException
+ {
+ RefreshResult result = internalRefresh(forceRefresh);
+
// update DB
- if (justRefreshed)
+ if (result.specificCode())
{
if (!isActive())
{
@@ -225,10 +232,10 @@
registry.updateProducerInfo(this);
}
- return justRefreshed;
+ return result;
}
- private boolean internalRefresh(boolean forceRefresh) throws PortletInvokerException
+ private RefreshResult internalRefresh(boolean forceRefresh) throws PortletInvokerException
{
ServiceDescription serviceDescription;
// might neeed a different cache value: right now, we cache the whole producer info but we might want to cache
@@ -236,7 +243,16 @@
if (forceRefresh || isRefreshNeeded(true))
{
log.debug("ProducerInfo refresh needed for producer '" + persistentId + "'");
- persistentEndpointInfo.refresh();
+ RefreshResult result = new RefreshResult(true, REFRESH_MEANING);
+ try
+ {
+ persistentEndpointInfo.refresh();
+ }
+ catch (InvokerUnavailableException e)
+ {
+ result.appendToStatus("Couldn't refresh endpoint information: ").append(e.getLocalizedMessage());
+ }
+
serviceDescription = getServiceDescription(false);
// do we need to call initCookie or not?
@@ -246,7 +262,8 @@
if (serviceDescription.isRequiresRegistration())
{
// attempt to register and determine if the current service description can be used to extract POPs
- if (register(serviceDescription))
+ RefreshResult registrationResult = register(serviceDescription);
+ if (registrationResult.specificCode())
{
// registration occurred, so we should ask for a new service description
serviceDescription = getServiceDescription(false);
@@ -254,7 +271,16 @@
// extract the POPs
extractOfferedPortlets(serviceDescription);
- return true;
+
+ String status = registrationResult.getStatus();
+ if (status != null)
+ {
+ result.appendToStatus(status);
+ }
+ result.setHasIssues(registrationResult.hasIssues());
+ result.appendToStatus("Producer information successfully refreshed");
+
+ return result;
}
else
{
@@ -262,11 +288,11 @@
persistentRegistrationInfo = new RegistrationInfo(this, false);
setServiceDescriptionRequest(getUnregisteredServiceDescriptionRequest());
extractOfferedPortlets(serviceDescription);
- return true;
+ return result;
}
}
- return false;
+ return new RefreshResult(false, REFRESH_MEANING);
}
public String getId()
@@ -607,7 +633,7 @@
* @throws PortletInvokerException
* @since 2.6
*/
- private boolean register(ServiceDescription serviceDescription) throws PortletInvokerException
+ private RefreshResult register(ServiceDescription serviceDescription) throws PortletInvokerException
{
if (persistentRegistrationInfo == null)
{
@@ -625,7 +651,8 @@
if (serviceDescription.isRequiresRegistration())
{
// check if the configured registration information is correct and if we can get the service description
- if (persistentRegistrationInfo.initialize(serviceDescription, getId()))
+ RefreshResult result = persistentRegistrationInfo.refresh(serviceDescription, persistentId, false, false);
+ if (!result.hasIssues())
{
try
{
@@ -640,9 +667,11 @@
}
persistentRegistrationInfo.setRegistrationContext(registrationContext);
- log.info("Consumer with id '" + persistentId + "' successfully registered with handle: '"
- + registrationContext.getRegistrationHandle() + "'");
- return true;
+ String msg = "Consumer with id '" + persistentId + "' successfully registered with handle: '"
+ + registrationContext.getRegistrationHandle() + "'";
+ log.info(msg);
+ result.appendToStatus("\n").append(msg);
+ return new RefreshResult(result, true, REGISTER_MEANING);
}
catch (Exception e)
{
@@ -653,14 +682,14 @@
}
else
{
- log.info("Consumer is not ready to be registered with producer because of missing or invalid registration information.");
+ log.info(result.getStatus());
setActive(false);
throw new PortletInvokerException("Consumer is not ready to be registered with producer because of missing or invalid registration information.");
}
}
}
- return false;
+ return new RefreshResult(false, REGISTER_MEANING);
}
public void deregister() throws PortletInvokerException
@@ -690,7 +719,7 @@
}
RegistrationInfo.RegistrationRefreshResult result =
- persistentRegistrationInfo.refreshRegistrationRequirementsFor(getServiceDescription(true), persistentId, mergeWithLocalInfo, true);
+ persistentRegistrationInfo.refresh(getServiceDescription(true), persistentId, mergeWithLocalInfo, true);
registry.updateProducerInfo(this);
log.info("Refreshed registration information for consumer with id '" + persistentId + "'");
@@ -700,7 +729,8 @@
public boolean isRefreshNeeded(boolean considerCache)
{
return (considerCache && isCacheExpired())
- || (persistentRegistrationInfo != null && persistentRegistrationInfo.isRefreshNeeded())
+ || persistentRegistrationInfo == null
+ || persistentRegistrationInfo.isRefreshNeeded()
|| persistentEndpointInfo.isRefreshNeeded();
}
}
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RefreshResult.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RefreshResult.java 2007-05-04 02:43:12 UTC (rev 7189)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RefreshResult.java 2007-05-04 05:28:38 UTC (rev 7190)
@@ -32,7 +32,26 @@
{
private StringBuffer status;
private boolean hasIssues;
+ private boolean specificCode;
+ private final String meaning;
+ public RefreshResult(boolean specificCode, String specificCodeMeaning)
+ {
+ this.specificCode = specificCode;
+ this.meaning = specificCodeMeaning;
+ }
+
+ public RefreshResult(RefreshResult previous, boolean specificCode, String specificCodeMeaning)
+ {
+ this(specificCode, specificCodeMeaning);
+ String status = previous.getStatus();
+ if (status != null)
+ {
+ appendToStatus(status);
+ }
+ setHasIssues(previous.hasIssues);
+ }
+
public boolean hasIssues()
{
return hasIssues;
@@ -66,4 +85,19 @@
return status;
}
+
+ public boolean specificCode()
+ {
+ return specificCode;
+ }
+
+ public void setSpecificCode(boolean specificCode)
+ {
+ this.specificCode = specificCode;
+ }
+
+ public String getMeaning()
+ {
+ return meaning;
+ }
}
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RegistrationInfo.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RegistrationInfo.java 2007-05-04 02:43:12 UTC (rev 7189)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RegistrationInfo.java 2007-05-04 05:28:38 UTC (rev 7190)
@@ -275,7 +275,7 @@
*/
boolean initialize(ServiceDescription serviceDescription, String producerId)
{
- return !refreshRegistrationRequirementsFor(serviceDescription, producerId, false, false).hasIssues();
+ return !refresh(serviceDescription, producerId, false, false).hasIssues();
}
@@ -286,9 +286,8 @@
* @param forceRefresh
* @return
*/
- public RegistrationRefreshResult refreshRegistrationRequirementsFor(ServiceDescription serviceDescription,
- String producerId, boolean mergeWithLocalInfo,
- boolean forceRefresh)
+ public RegistrationRefreshResult refresh(ServiceDescription serviceDescription, String producerId,
+ boolean mergeWithLocalInfo, boolean forceRefresh)
{
log.debug("RegistrationInfo refresh requested");
@@ -525,6 +524,11 @@
public class RegistrationRefreshResult extends RefreshResult
{
+ public RegistrationRefreshResult()
+ {
+ super(false, "Unused");
+ }
+
private Map registrationProperties;
public Map getRegistrationProperties()
@@ -536,6 +540,16 @@
{
this.registrationProperties = registrationProperties;
}
+
+ public boolean specificCode()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public void setSpecificCode(boolean specificCode)
+ {
+ throw new UnsupportedOperationException();
+ }
}
private String modifyIfNeeded(String oldValue, String newValue)
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/WSRPConsumerImpl.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/WSRPConsumerImpl.java 2007-05-04 02:43:12 UTC (rev 7189)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/WSRPConsumerImpl.java 2007-05-04 05:28:38 UTC (rev 7190)
@@ -488,9 +488,9 @@
}
}
- public RegistrationInfo.RegistrationRefreshResult refreshRegistrationInfo(boolean eraseLocalData) throws PortletInvokerException
+ public RegistrationInfo.RegistrationRefreshResult refreshRegistrationInfo(boolean mergeWithLocalInfo) throws PortletInvokerException
{
- return producerInfo.refreshRegistrationInfo(eraseLocalData);
+ return producerInfo.refreshRegistrationInfo(mergeWithLocalInfo);
}
public boolean isActive()
@@ -498,6 +498,16 @@
return producerInfo.isActive() && started;
}
+ public boolean isRefreshNeeded()
+ {
+ return !started || producerInfo.isRefreshNeeded(false);
+ }
+
+ public RefreshResult refresh(boolean forceRefresh) throws PortletInvokerException
+ {
+ return producerInfo.detailedRefresh(forceRefresh);
+ }
+
// Service implementation *******************************************************************************************
protected void startService() throws Exception
Modified: trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/jsf/consumers/consumers.xhtml
===================================================================
--- trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/jsf/consumers/consumers.xhtml 2007-05-04 02:43:12 UTC (rev 7189)
+++ trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/jsf/consumers/consumers.xhtml 2007-05-04 05:28:38 UTC (rev 7190)
@@ -9,7 +9,7 @@
<hr/>
- <h:messages styleClass="error"/>
+ <h:messages errorClass="error" infoClass="info"/>
<h:form>
Create a consumer named:
Modified: trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/jsf/consumers/editConsumer.xhtml
===================================================================
--- trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/jsf/consumers/editConsumer.xhtml 2007-05-04 02:43:12 UTC (rev 7189)
+++ trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/jsf/consumers/editConsumer.xhtml 2007-05-04 05:28:38 UTC (rev 7190)
@@ -7,30 +7,12 @@
<h:form>
<h1 class="portlet">Consumer '#{consumer.id}' configuration</h1>
- <h:commandLink action="#{consumersMgr.activateConsumer}" styleClass="portlet-form-button"
- value="#{consumer.active ? 'Deactivate' : 'Activate'}">
- <f:param name="id" value="#{consumer.id}"/>
- <f:param name="activate" value="#{!consumer.active}"/>
- </h:commandLink>
-
- <h:commandLink action="#{consumersMgr.registerConsumer}" styleClass="portlet-form-button"
- rendered="#{consumer.active and consumer.registrationRequired}"
- value="#{consumer.registered ? 'Deregister' : 'Register'}">
- <f:param name="id" value="#{consumer.id}"/>
- <f:param name="register" value="#{!consumer.registered}"/>
- </h:commandLink>
-
- <h:commandLink action="#{consumersMgr.destroyConsumer}" value="Destroy" styleClass="portlet-form-button">
- <f:param name="id" value="#{consumer.id}"/>
- </h:commandLink>
-
- <h:commandLink action="#{consumersMgr.listConsumers}" value="Return to list" styleClass="portlet-form-button"/>
</h:form>
<hr/>
<h:form>
-<h:messages styleClass="error"/>
+<h:messages errorClass="error" infoClass="info"/>
<table width="100%" class="portlet-table-body">
<tr>
<th>Producer id:</th>
@@ -90,48 +72,52 @@
</c:choose>
</td>
</tr>
-<tr>
- <th>Registration information<br/><br/>
- <h:commandLink action="#{consumer.refreshRegistrationInfo}" value="Validate" styleClass="portlet-form-button">
- <f:param name="eraseLocalData" value="false"/>
- </h:commandLink>
- <h:commandLink action="#{consumer.refreshRegistrationInfo}" value="Replace" styleClass="portlet-form-button">
- <f:param name="eraseLocalData" value="true"/>
- </h:commandLink>
- </th>
- <td>
- <c:choose>
- <c:when test="#{consumer.registrationRequired}">
- <c:choose>
- <c:when test="#{!empty consumer.producerInfo.registrationInfo.registrationPropertyNames}">
- <table border='1' cellspacing='0' class='registration-prop-table'>
- <tr>
- <th>Name</th>
- <th>Value</th>
- </tr>
- <c:forEach items="#{consumer.producerInfo.registrationInfo.registrationProperties}" var="prop">
- <tr title="#{prop.description.label.value}">
- <td>
- <h:inputText value="#{prop.name}" size="40"/>
- </td>
- <td>
- <h:inputText value="#{prop.value}" size="40"/>
- </td>
+<c:if test="#{consumer.refreshNeeded}">
+ <tr>
+ <td colspan="2" class="info">
+ There have been changes in the Producer configuration (or the Producer's service description has not yet
+ been retrieved), refreshing the Consumer might be a good idea.
+ </td>
+ </tr>
+</c:if>
+<c:if test="#{!consumer.refreshNeeded}">
+ <tr>
+ <th>Registration information</th>
+ <td>
+ <c:choose>
+ <c:when test="#{consumer.registrationRequired}">
+ <c:choose>
+ <c:when test="#{!empty consumer.producerInfo.registrationInfo.registrationPropertyNames}">
+ <table border='1' cellspacing='0' class='registration-prop-table'>
+ <tr>
+ <th>Name</th>
+ <th>Value</th>
</tr>
- </c:forEach>
- </table>
- </c:when>
- <c:otherwise>
- No required registration properties.
- </c:otherwise>
- </c:choose>
- </c:when>
- <c:otherwise>
- Producer doesn't require registration.
- </c:otherwise>
- </c:choose>
- </td>
-</tr>
+ <c:forEach items="#{consumer.producerInfo.registrationInfo.registrationProperties}" var="prop">
+ <tr title="#{prop.description.label.value}">
+ <td>
+ <h:outputText value="#{prop.name}"/>
+ </td>
+ <td>
+ <h:inputText value="#{prop.value}" size="40"/>
+ <h:outputText styleClass="error" value="#{prop.status}" rendered="#{prop.invalid}"/>
+ </td>
+ </tr>
+ </c:forEach>
+ </table>
+ </c:when>
+ <c:otherwise>
+ No required registration properties.
+ </c:otherwise>
+ </c:choose>
+ </c:when>
+ <c:otherwise>
+ Producer doesn't require registration.
+ </c:otherwise>
+ </c:choose>
+ </td>
+ </tr>
+</c:if>
<c:if test="#{consumer.producerInfo.registrationInfo.registrationValid}">
<tr>
<th>Registration context:</th>
@@ -141,12 +127,39 @@
</tr>
</c:if>
<tr>
- <td colspan="2">
+ <td>
<h:commandButton action="#{consumer.update}" value="Save" styleClass="portlet-form-button"/>
+ <h:commandLink action="#{consumer.refresh}" value="Refresh" title="Refresh information from Producer"
+ styleClass="portlet-form-button">
+ <f:param name="eraseLocalData" value="true"/>
+ </h:commandLink>
</td>
+ <td style="text-align: right;">
+ <h:commandLink action="#{consumersMgr.listConsumers}" value="Return to list" styleClass="portlet-form-button"/>
+ </td>
</tr>
+<tr>
+ <td>
+ <h:commandLink action="#{consumersMgr.activateConsumer}" styleClass="portlet-form-button"
+ value="#{consumer.active ? 'Deactivate' : 'Activate'}">
+ <f:param name="id" value="#{consumer.id}"/>
+ <f:param name="activate" value="#{!consumer.active}"/>
+ </h:commandLink>
+
+ <h:commandLink action="#{consumersMgr.registerConsumer}" styleClass="portlet-form-button"
+ rendered="#{consumer.active and consumer.registrationRequired}"
+ value="#{consumer.registered ? 'Deregister' : 'Register'}">
+ <f:param name="id" value="#{consumer.id}"/>
+ <f:param name="register" value="#{!consumer.registered}"/>
+ </h:commandLink>
+
+ </td>
+ <td style="text-align: right;">
+ <h:commandLink action="#{consumersMgr.destroyConsumer}" value="Destroy" styleClass="portlet-form-button">
+ <f:param name="id" value="#{consumer.id}"/>
+ </h:commandLink>
+ </td>
+</tr>
</table>
-
-<hr/>
</h:form>
</div>
\ No newline at end of file
19 years
JBoss Portal SVN: r7189 - in trunk/wsrp/src/main/org/jboss/portal: wsrp/consumer and 1 other directory.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2007-05-03 22:43:12 -0400 (Thu, 03 May 2007)
New Revision: 7189
Added:
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RefreshResult.java
Modified:
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/other/RegistrationInfoTestCase.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RegistrationInfo.java
Log:
- Simplified refreshRegistrationRequirementsFor and fixed behavior with respect to returned properties in result.
- Added RefreshResult class.
- Updated tests.
Modified: trunk/wsrp/src/main/org/jboss/portal/test/wsrp/other/RegistrationInfoTestCase.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/test/wsrp/other/RegistrationInfoTestCase.java 2007-05-04 01:04:31 UTC (rev 7188)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/other/RegistrationInfoTestCase.java 2007-05-04 02:43:12 UTC (rev 7189)
@@ -32,7 +32,6 @@
import org.jboss.portal.wsrp.core.ServiceDescription;
import java.util.Map;
-import java.util.Set;
/**
* @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
@@ -59,7 +58,7 @@
assertNull(info.getRegistrationState());
}
- public void testSetGetRegistrationProperty()
+ /*public void testSetGetRegistrationProperty()
{
String key = "foo";
info.setRegistrationPropertyValue(key, "bar");
@@ -72,7 +71,7 @@
assertNotNull(properties.get(key));
assertEquals(properties.get(key), info.getRegistrationProperty(key));
assertEquals("bar", info.getRegistrationProperty(key).getValue());
- }
+ }*/
public void testRefreshNoRegistration()
{
@@ -83,7 +82,7 @@
ServiceDescription sd = createServiceDescription(false, 0);
RegistrationInfo.RegistrationRefreshResult result = info.refreshRegistrationRequirementsFor(sd, producerId, true, false);
assertNotNull(result);
- assertTrue(result.isValid());
+ assertFalse(result.hasIssues());
assertFalse(info.isRegistrationRequired().booleanValue());
assertTrue(info.isRegistrationDeterminedNotRequired());
assertFalse(info.isRegistrationDeterminedRequired());
@@ -91,7 +90,7 @@
result = info.refreshRegistrationRequirementsFor(sd, producerId, false, false);
assertNotNull(result);
- assertTrue(result.isValid());
+ assertFalse(result.hasIssues());
assertFalse(info.isRegistrationRequired().booleanValue());
assertTrue(info.isRegistrationDeterminedNotRequired());
assertFalse(info.isRegistrationDeterminedRequired());
@@ -107,7 +106,7 @@
RegistrationInfo.RegistrationRefreshResult result = info.refreshRegistrationRequirementsFor(
createServiceDescription(true, 0), producerId, true, false);
assertNotNull(result);
- assertTrue(result.isValid());
+ assertFalse(result.hasIssues());
assertTrue(info.isRegistrationRequired().booleanValue());
assertTrue(info.isRegistrationDeterminedRequired());
assertFalse(info.isRegistrationDeterminedNotRequired());
@@ -122,10 +121,12 @@
RegistrationInfo.RegistrationRefreshResult result = info.refreshRegistrationRequirementsFor(
createServiceDescription(true, 0), producerId, false, false);
assertNotNull(result);
- assertFalse(result.isValid());
+ assertTrue(result.hasIssues());
String status = result.getStatus();
assertNotNull(status);
assertTrue(status.indexOf("foo") != -1);
+ assertEquals(1, info.getRegistrationProperties().size());
+ assertEquals(1, result.getRegistrationProperties().size());
Map regProps = result.getRegistrationProperties();
assertNotNull(regProps);
@@ -144,10 +145,12 @@
RegistrationInfo.RegistrationRefreshResult result = info.refreshRegistrationRequirementsFor(sd, producerId, false, false);
assertNotNull(result);
- assertFalse(result.isValid());
+ assertTrue(result.hasIssues());
String status = result.getStatus();
assertNotNull(status);
assertTrue(status.indexOf("prop0") != -1 && status.indexOf("prop1") != -1);
+ assertEquals(0, info.getRegistrationProperties().size());
+ assertEquals(2, result.getRegistrationProperties().size());
Map regProps = result.getRegistrationProperties();
assertNotNull(regProps);
@@ -165,7 +168,7 @@
RegistrationInfo.RegistrationRefreshResult result = info.refreshRegistrationRequirementsFor(createServiceDescription(true, 2),
producerId, true, false);
assertNotNull(result);
- assertFalse(result.isValid());
+ assertTrue(result.hasIssues());
RegistrationProperty prop = info.getRegistrationProperty("prop0");
assertNotNull(prop);
@@ -179,6 +182,7 @@
assertTrue(prop.isInvalid());
assertEquals(RegistrationProperty.MISSING_VALUE_STATUS, prop.getStatus());
assertEquals(2, info.getRegistrationProperties().size());
+ assertEquals(2, result.getRegistrationProperties().size());
assertNull(info.getRegistrationProperty("foo"));
}
@@ -188,28 +192,28 @@
RegistrationInfo.RegistrationRefreshResult result = info.refreshRegistrationRequirementsFor(
createServiceDescription(true, 0), producerId, false, false);
assertNotNull(result);
- assertTrue(result.isValid());
+ assertFalse(result.hasIssues());
assertFalse(info.isRegistrationValid());
// Modifying a property renders the info dirty and hence should be refreshed
info.setRegistrationPropertyValue("foo", "bar");
result = info.refreshRegistrationRequirementsFor(createServiceDescription(true, 0), producerId, false, false);
- assertFalse(result.isValid());
+ assertTrue(result.hasIssues());
assertFalse(info.isRegistrationValid());
info.removeRegistrationProperty("foo");
result = info.refreshRegistrationRequirementsFor(createServiceDescription(true, 0), producerId, false, false);
- assertTrue(result.isValid());
+ assertFalse(result.hasIssues());
assertFalse(info.isRegistrationValid());
// producer has changed but we're not forcing refresh so registration should still be invalid
result = info.refreshRegistrationRequirementsFor(createServiceDescription(false, 0), producerId, false, false);
- assertTrue(result.isValid());
+ assertFalse(result.hasIssues());
assertFalse(info.isRegistrationValid());
// force refresh
result = info.refreshRegistrationRequirementsFor(createServiceDescription(false, 0), producerId, false, true);
- assertTrue(result.isValid());
+ assertFalse(result.hasIssues());
assertTrue(info.isRegistrationValid());
}
Added: trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RefreshResult.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RefreshResult.java (rev 0)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RefreshResult.java 2007-05-04 02:43:12 UTC (rev 7189)
@@ -0,0 +1,69 @@
+/******************************************************************************
+ * 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;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision$
+ * @since 2.6
+ */
+public class RefreshResult
+{
+ private StringBuffer status;
+ private boolean hasIssues;
+
+ public boolean hasIssues()
+ {
+ return hasIssues;
+ }
+
+ public void setHasIssues(boolean hasIssues)
+ {
+ this.hasIssues = hasIssues;
+ }
+
+ public String getStatus()
+ {
+ if (status == null)
+ {
+ return null;
+ }
+
+ return status.toString();
+ }
+
+ StringBuffer appendToStatus(String message)
+ {
+ if (status == null)
+ {
+ status = new StringBuffer(message);
+ }
+ else
+ {
+ status.append(" ").append(message);
+ }
+
+ return status;
+ }
+}
Property changes on: trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RefreshResult.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RegistrationInfo.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RegistrationInfo.java 2007-05-04 01:04:31 UTC (rev 7188)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RegistrationInfo.java 2007-05-04 02:43:12 UTC (rev 7189)
@@ -275,7 +275,7 @@
*/
boolean initialize(ServiceDescription serviceDescription, String producerId)
{
- return refreshRegistrationRequirementsFor(serviceDescription, producerId, false, false).isValid();
+ return !refreshRegistrationRequirementsFor(serviceDescription, producerId, false, false).hasIssues();
}
@@ -294,7 +294,14 @@
if (forceRefresh || isRefreshNeeded())
{
+ persistentRegistrationProperties = getOrCreateRegistrationPropertiesMap(true);
+
RegistrationRefreshResult result = new RegistrationRefreshResult();
+ // if we're not merging, we need to copy the properties so that we can collect validation results.
+ if (!mergeWithLocalInfo)
+ {
+ result.setRegistrationProperties(new HashMap(persistentRegistrationProperties));
+ }
dirty = false;
if (serviceDescription.isRequiresRegistration())
@@ -308,91 +315,52 @@
ModelDescription regPropDescs = serviceDescription.getRegistrationPropertyDescription();
if (regPropDescs != null)
{
- result.setValid(true);
+ result.setHasIssues(false);
PropertyDescription[] propertyDescriptions = regPropDescs.getPropertyDescriptions();
if (propertyDescriptions != null && propertyDescriptions.length > 0)
{
Map descriptionsMap = getRegistrationPropertyDescriptionsFromWSRP(propertyDescriptions);
- if (mergeWithLocalInfo)
- {
- persistentRegistrationProperties = getOrCreateRegistrationPropertiesMap(true);
+ // check that we don't have unexpected registration properties and if so, mark them as invalid or remove them
+ Set expectedNames = descriptionsMap.keySet();
+ checkForExtraProperties(producerId, result, expectedNames, persistentRegistrationProperties, !mergeWithLocalInfo);
- // Remove extra properties
- Set unexpected = new HashSet(persistentRegistrationProperties.keySet());
- unexpected.removeAll(descriptionsMap.keySet());
- if (!unexpected.isEmpty())
+ // Merge existing properties
+ for (Iterator props = descriptionsMap.values().iterator(); props.hasNext();)
+ {
+ RegistrationProperty prop = (RegistrationProperty)props.next();
+ String name = prop.getName();
+ RegistrationProperty existing = getRegistrationProperty(name);
+ if (existing != null)
{
- for (Iterator invalidProps = unexpected.iterator(); invalidProps.hasNext();)
- {
- persistentRegistrationProperties.remove(invalidProps.next());
- }
+ // take the opportunity to add the property description... ^_^
+ existing.setDescription(prop.getDescription());
}
-
- // Merge existing properties
- for (Iterator props = descriptionsMap.values().iterator(); props.hasNext();)
+ else
{
- RegistrationProperty prop = (RegistrationProperty)props.next();
- String name = prop.getName();
- RegistrationProperty existing = getRegistrationProperty(name);
- if (existing != null)
+ if (mergeWithLocalInfo)
{
- existing.setDescription(prop.getDescription());
- }
- else
- {
persistentRegistrationProperties.put(name, prop);
}
- }
-
- resetRegistration();
- result.setValid(false);
- }
- else
- {
- persistentRegistrationProperties = getOrCreateRegistrationPropertiesMap(true);
-
- // check that we don't have unexpected registration properties and if so, mark them as invalid
- Set expectedNames = descriptionsMap.keySet();
- checkForExtraProperties(producerId, result, expectedNames, persistentRegistrationProperties);
-
- // now check for missing properties, add the missing ones with a null value
- StringBuffer missingProps = new StringBuffer();
- for (Iterator descriptionNames = expectedNames.iterator(); descriptionNames.hasNext();)
- {
- String name = (String)descriptionNames.next();
- RegistrationProperty prop = (RegistrationProperty)persistentRegistrationProperties.get(name);
- RegistrationProperty producerProp = (RegistrationProperty)descriptionsMap.get(name);
- if (prop == null)
- {
- producerProp.setStatus(RegistrationProperty.MISSING_STATUS);
- persistentRegistrationProperties.put(name, producerProp);
- missingProps.append("Missing value for property '").append(name).append("'\n");
- }
else
{
- // take the opportunity to add the property description... ^_^
- prop.setDescription(producerProp.getDescription());
+ prop.setStatus(RegistrationProperty.MISSING_STATUS);
+ result.getRegistrationProperties().put(name, prop);
}
- }
- if (missingProps.length() > 0)
- {
- log.debug(missingProps);
- result.appendToStatus(missingProps.toString());
- resetRegistration();
- result.setValid(false);
+ result.appendToStatus("Missing value for property '").append(name).append("'\n");
+ result.setHasIssues(true);
}
}
}
else
{
- handleNoRequiredRegistrationProperties(producerId, result);
+ handleNoRequiredRegistrationProperties(producerId, result, !mergeWithLocalInfo);
}
}
else
{
- handleNoRequiredRegistrationProperties(producerId, result);
+ handleNoRequiredRegistrationProperties(producerId, result, !mergeWithLocalInfo);
}
}
else
@@ -401,11 +369,16 @@
log.debug(msg);
result.appendToStatus(msg);
requiresRegistration = Boolean.FALSE;
- result.setValid(true);
+ result.setHasIssues(false);
}
- result.setRegistrationProperties(persistentRegistrationProperties);
- String msg = "Registration configuration is " + (result.isValid() ? "" : "NOT") + " valid";
+ // if we're merging, the resulting properties are the saved properties
+ if (mergeWithLocalInfo)
+ {
+ result.setRegistrationProperties(persistentRegistrationProperties);
+ }
+
+ String msg = "Registration configuration is " + (result.hasIssues() ? "NOT" : "") + " valid";
result.appendToStatus(msg);
log.debug(msg);
return result;
@@ -413,13 +386,13 @@
else
{
RegistrationRefreshResult result = new RegistrationRefreshResult();
- result.valid = true;
- result.registrationProperties = persistentRegistrationProperties;
+ result.setHasIssues(false);
+ result.setRegistrationProperties(persistentRegistrationProperties);
return result;
}
}
- private void handleNoRequiredRegistrationProperties(String producerId, RegistrationRefreshResult result)
+ private void handleNoRequiredRegistrationProperties(String producerId, RegistrationRefreshResult result, boolean keepExtra)
{
log.info("The producer didn't require any specific registration properties.");
Map properties = getRegistrationProperties();
@@ -428,13 +401,13 @@
String msg = "Registration data is available for producer '"
+ producerId + "' when none is expected by the producer.";
log.info(msg);
- checkForExtraProperties(producerId, result, Collections.EMPTY_SET, properties);
+ checkForExtraProperties(producerId, result, Collections.EMPTY_SET, properties, keepExtra);
}
else
{
log.info("Using default registration data for producer '" + producerId + "'");
registrationData = WSRPTypeFactory.createDefaultRegistrationData();
- result.setValid(true);
+ result.setHasIssues(false);
}
}
@@ -445,7 +418,7 @@
* @param properties
* @return a set of the property names expected by the producer
*/
- private void checkForExtraProperties(String producerId, RegistrationRefreshResult result, Set expectedNames, Map properties)
+ private void checkForExtraProperties(String producerId, RegistrationRefreshResult result, Set expectedNames, Map properties, boolean keepExtra)
{
Set unexpected = new HashSet(properties.keySet());
unexpected.removeAll(expectedNames);
@@ -457,14 +430,26 @@
{
String name = (String)invalidProps.next();
message.append("\t- ").append(name).append("\n");
- RegistrationProperty prop = (RegistrationProperty)properties.get(name);
- prop.setInvalid(true);
- prop.setStatus(RegistrationProperty.INEXISTENT_STATUS);
+ if (keepExtra)
+ {
+ // mark the prop as invalid
+ RegistrationProperty prop = (RegistrationProperty)properties.get(name);
+ prop.setInvalid(true);
+ prop.setStatus(RegistrationProperty.INEXISTENT_STATUS);
+
+ // do the same in the result
+ prop = (RegistrationProperty)result.getRegistrationProperties().get(name);
+ prop.setInvalid(true);
+ prop.setStatus(RegistrationProperty.INEXISTENT_STATUS);
+ }
+ else
+ {
+ properties.remove(name);
+ }
}
log.info(message);
result.appendToStatus(message.toString());
- resetRegistration();
- result.setValid(false);
+ result.setHasIssues(true);
}
}
@@ -538,22 +523,10 @@
return dirty || requiresRegistration == null;
}
- public class RegistrationRefreshResult
+ public class RegistrationRefreshResult extends RefreshResult
{
private Map registrationProperties;
- private StringBuffer status;
- private boolean valid;
- public String getStatus()
- {
- if (status == null)
- {
- return null;
- }
-
- return status.toString();
- }
-
public Map getRegistrationProperties()
{
return registrationProperties;
@@ -563,28 +536,6 @@
{
this.registrationProperties = registrationProperties;
}
-
- public boolean isValid()
- {
- return valid;
- }
-
- public void setValid(boolean valid)
- {
- this.valid = valid;
- }
-
- void appendToStatus(String message)
- {
- if (status == null)
- {
- status = new StringBuffer(message);
- }
- else
- {
- status.append(" ").append(message);
- }
- }
}
private String modifyIfNeeded(String oldValue, String newValue)
19 years