Author: chris.laprun(a)jboss.com
Date: 2010-02-14 10:55:04 -0500 (Sun, 14 Feb 2010)
New Revision: 1670
Modified:
components/wsrp/trunk/admin-gui/pom.xml
components/wsrp/trunk/admin-gui/src/main/java/org/gatein/wsrp/admin/ui/ConsumerBean.java
components/wsrp/trunk/admin-gui/src/main/java/org/gatein/wsrp/admin/ui/ManagedBean.java
components/wsrp/trunk/admin-gui/src/main/java/org/gatein/wsrp/admin/ui/ProducerBean.java
components/wsrp/trunk/admin-gui/src/main/webapp/jsf/consumers/editConsumer.xhtml
components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/RegistrationInfo.java
Log:
- Cleaned-up state management on ConsumerBean:
+ Let RegistrationInfo handle more dirty state management instead of relying on a JSF
value change listener.
+ Let ProducerInfo handle expected RegistrationInfo.
+ Removed now unneeded expectedRegistrationInfo and registrationLocallyModified fields.
+ Renamed isRegistrationModified to isDisplayExpectedNeeded to be more explicit.
+ Renamed isRegistrationPropertiesEmpty and isExpectedRegistrationPropertiesEmpty to
is*Existing as the logic was
checking that properties were present, not empty.
+ Cleaned-up editConsumer.xhtml.
- Use SL4J in ManagedBean instead of Log4J and adapted logging code appropriately.
Modified: components/wsrp/trunk/admin-gui/pom.xml
===================================================================
--- components/wsrp/trunk/admin-gui/pom.xml 2010-02-13 11:18:05 UTC (rev 1669)
+++ components/wsrp/trunk/admin-gui/pom.xml 2010-02-14 15:55:04 UTC (rev 1670)
@@ -89,4 +89,19 @@
</dependency>
</dependencies>
+ <!-- Disable some tests for now until we can find some time to work on migrating
them -->
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <excludes>
+ <exclude>org/gatein/wsrp/other/*</exclude>
+ </excludes>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
</project>
\ No newline at end of file
Modified:
components/wsrp/trunk/admin-gui/src/main/java/org/gatein/wsrp/admin/ui/ConsumerBean.java
===================================================================
---
components/wsrp/trunk/admin-gui/src/main/java/org/gatein/wsrp/admin/ui/ConsumerBean.java 2010-02-13
11:18:05 UTC (rev 1669)
+++
components/wsrp/trunk/admin-gui/src/main/java/org/gatein/wsrp/admin/ui/ConsumerBean.java 2010-02-14
15:55:04 UTC (rev 1670)
@@ -31,7 +31,6 @@
import org.gatein.wsrp.consumer.RegistrationProperty;
import org.gatein.wsrp.consumer.registry.ConsumerRegistry;
-import javax.faces.event.ValueChangeEvent;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Collections;
@@ -49,11 +48,8 @@
private ConsumerRegistry registry;
private ConsumerManagerBean manager;
private boolean modified;
- private boolean registrationLocallyModified;
-
private String wsdl;
- private transient RegistrationInfo expectedRegistrationInfo;
private static final String CANNOT_FIND_CONSUMER =
"bean_consumer_cannot_find_consumer";
private static final String CANNOT_UPDATE_CONSUMER =
"bean_consumer_cannot_update_consumer";
private static final String CANNOT_REFRESH_CONSUMER =
"bean_consumer_cannot_refresh_consumer";
@@ -210,14 +206,17 @@
}
}
- public boolean isRegistrationModified()
+ public boolean isDisplayExpectedNeeded()
{
- return getProducerInfo().isModifyRegistrationRequired();
+ ProducerInfo producerInfo = getProducerInfo();
+
+ // only show expected registration info if it is different from the one we
currently have
+ return producerInfo.isModifyRegistrationRequired() &&
producerInfo.getRegistrationInfo() != producerInfo.getExpectedRegistrationInfo();
}
public boolean isRegistrationLocallyModified()
{
- return isRegistered() && registrationLocallyModified;
+ return isRegistered() &&
getProducerInfo().getRegistrationInfo().isModifiedSinceLastRefresh();
}
public boolean isRegistrationChecked()
@@ -244,33 +243,21 @@
return getProducerInfo().hasLocalRegistrationInfo();
}
- public boolean isRegistrationPropertiesEmpty()
+ public boolean isRegistrationPropertiesExisting()
{
RegistrationInfo regInfo = getProducerInfo().getRegistrationInfo();
- return regInfo == null || regInfo.isRegistrationPropertiesEmpty();
+ return regInfo == null || regInfo.isRegistrationPropertiesExisting();
}
- public boolean isExpectedRegistrationPropertiesEmpty()
+ public boolean isExpectedRegistrationPropertiesExisting()
{
RegistrationInfo info = getExpectedRegistrationInfo();
- if (info != null)
- {
- return info.isRegistrationPropertiesEmpty();
- }
- else
- {
- return true;
- }
+ return info != null && info.isRegistrationPropertiesExisting();
}
private RegistrationInfo getExpectedRegistrationInfo()
{
- if (expectedRegistrationInfo == null)
- {
- expectedRegistrationInfo =
beanContext.getFromSession(ConsumerManagerBean.EXPECTED_REG_INFO_KEY,
RegistrationInfo.class);
- }
-
- return expectedRegistrationInfo;
+ return getProducerInfo().getExpectedRegistrationInfo();
}
public List<RegistrationProperty> getRegistrationProperties()
@@ -405,7 +392,7 @@
{
IllegalStateException e =
new IllegalStateException("Registration not locally modified:
there should be expected registration from producer!");
- log.debug(e);
+ log.debug("Couldn't modify registration", e);
throw e;
}
}
@@ -419,8 +406,6 @@
info.modifyRegistration();
newReg.setModifiedSinceLastRefresh(false);
- registrationLocallyModified = false;
-
beanContext.createInfoMessage(MODIFY_REG_SUCCESS);
}
catch (Exception e)
@@ -481,23 +466,6 @@
return oldValue;
}
- // Listeners
-
- // todo: valueChangeListener not needed anymore when events on RegistrationProperties
work
-
- public void regPropListener(ValueChangeEvent event)
- {
- if (!registrationLocallyModified)
- {
- // only mark as locally modified if we had a previous value
- Object oldValue = normalizeStringIfNeeded(event.getOldValue());
- if (oldValue != null)
- {
- registrationLocallyModified = isOldAndNewDifferent(oldValue,
event.getNewValue());
- }
- }
- }
-
protected String getObjectTypeName()
{
return CONSUMER_TYPE;
Modified:
components/wsrp/trunk/admin-gui/src/main/java/org/gatein/wsrp/admin/ui/ManagedBean.java
===================================================================
---
components/wsrp/trunk/admin-gui/src/main/java/org/gatein/wsrp/admin/ui/ManagedBean.java 2010-02-13
11:18:05 UTC (rev 1669)
+++
components/wsrp/trunk/admin-gui/src/main/java/org/gatein/wsrp/admin/ui/ManagedBean.java 2010-02-14
15:55:04 UTC (rev 1670)
@@ -23,8 +23,9 @@
package org.gatein.wsrp.admin.ui;
-import org.apache.log4j.Logger;
import org.gatein.common.util.ParameterValidation;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import java.util.regex.Pattern;
@@ -36,7 +37,7 @@
*/
public abstract class ManagedBean
{
- protected Logger log = Logger.getLogger(getClass());
+ protected Logger log = LoggerFactory.getLogger(getClass());
protected BeanContext beanContext;
Modified:
components/wsrp/trunk/admin-gui/src/main/java/org/gatein/wsrp/admin/ui/ProducerBean.java
===================================================================
---
components/wsrp/trunk/admin-gui/src/main/java/org/gatein/wsrp/admin/ui/ProducerBean.java 2010-02-13
11:18:05 UTC (rev 1669)
+++
components/wsrp/trunk/admin-gui/src/main/java/org/gatein/wsrp/admin/ui/ProducerBean.java 2010-02-14
15:55:04 UTC (rev 1670)
@@ -185,7 +185,7 @@
}
catch (Exception e)
{
- log.debug(e);
+ log.debug("Couldn't save producer", e);
beanContext.createErrorMessage("bean_producer_cannot_save",
e.getLocalizedMessage());
}
return PRODUCER;
@@ -200,7 +200,7 @@
}
catch (Exception e)
{
- log.debug(e);
+ log.debug("Couldn't reload producer configuration", e);
beanContext.createErrorMessage("bean_producer_cannot_reload",
e.getLocalizedMessage());
}
return PRODUCER;
Modified:
components/wsrp/trunk/admin-gui/src/main/webapp/jsf/consumers/editConsumer.xhtml
===================================================================
---
components/wsrp/trunk/admin-gui/src/main/webapp/jsf/consumers/editConsumer.xhtml 2010-02-13
11:18:05 UTC (rev 1669)
+++
components/wsrp/trunk/admin-gui/src/main/webapp/jsf/consumers/editConsumer.xhtml 2010-02-14
15:55:04 UTC (rev 1670)
@@ -28,263 +28,258 @@
xmlns:c="http://java.sun.com/jstl/core"
xmlns:webui="http://jboss.org/gatein">
- <ui:define name="content">
+<ui:define name="content">
- <hr/>
+<hr/>
- <h:form id="edit-cons-form">
- <table width="100%" class="portlet-table-body
#{consumer.active ? 'active' : 'inactive'}">
- <tr>
- <th>#{i18n.edit_consumer_producer}</th>
- <td>
- <h:inputText id="id"
value="#{consumer.id}"/>
- <h:message styleClass="portlet-msg-error"
for="id"/>
- </td>
- </tr>
- <tr>
- <th>#{i18n.edit_consumer_cache}</th>
- <td>
- <h:inputText id="cache"
value="#{consumer.cache}"/>
- #{i18n.edit_consumer_cache_seconds}
- <h:message styleClass="portlet-msg-error"
for="cache"/>
- </td>
- </tr>
- <tr>
- <th>#{i18n.edit_consumer_timeout}</th>
- <td>
- <h:inputText id="timeout"
value="#{consumer.timeout}"/>
- #{i18n.edit_consumer_timeout_milliseconds}
- <h:message styleClass="portlet-msg-error"
for="timeout"/>
- </td>
- </tr>
- <tr>
- <th>#{i18n.edit_consumer_endpoint}</th>
- <td>
- <h:inputText id="wsdl" size="70"
value="#{consumer.wsdl}"/>
- <h:message styleClass="portlet-msg-error"
for="wsdl"/>
- </td>
- </tr>
- <c:if test="#{consumer.localInfoPresent}">
- <tr>
- <th>#{i18n.edit_consumer_registration}</th>
- <td>
- <c:choose>
- <c:when test="#{consumer.localInfoPresent}">
- <h3
class="portlet-area-header">#{i18n.edit_consumer_registration_current}</h3>
- <h:panelGroup styleClass="portlet-area-body">
- <c:choose>
- <c:when
test="#{consumer.registrationPropertiesEmpty}">
- <h:dataTable id="existingProps"
-
value="#{consumer.registrationProperties}" var="prop"
-
rowClasses="portlet-section-body,portlet-section-alternate"
-
columnClasses="nameColumn,descColumn,"
- headerClass="portlet-section-header
#{consumer.active ? 'active' : 'inactive'}"
- styleClass="registration-prop-table
#{consumer.active ? 'active' : 'inactive'}"
- width="100%">
- <h:column>
- <f:facet
name="header">#{i18n.edit_consumer_prop_name}</f:facet>
- #{prop.name}
- </h:column>
- <h:column>
- <f:facet
name="header">#{i18n.edit_consumer_prop_desc}</f:facet>
- #{prop.description.label.value}
- </h:column>
- <h:column>
- <f:facet
name="header">#{i18n.edit_consumer_prop_value}</f:facet>
- <!-- todo: valueChangeListener not needed
anymore when events on RegistrationProperties work -->
- <h:inputText id="prop-value-input"
value="#{prop.value}" size="50"
-
valueChangeListener="#{consumer.regPropListener}"
-
disabled="#{consumer.registrationModified}"/>
- <h:outputText
styleClass="portlet-msg-error" value="#{prop.status}"
-
rendered="#{prop.determinedInvalid}"
-
converter="faces.convert.RegistrationProperty.Status"/>
- </h:column>
- </h:dataTable>
+<h:form id="edit-cons-form">
+<table width="100%" class="portlet-table-body #{consumer.active ?
'active' : 'inactive'}">
+<tr>
+ <th>#{i18n.edit_consumer_producer}</th>
+ <td>
+ <h:inputText id="id" value="#{consumer.id}"/>
+ <h:message styleClass="portlet-msg-error" for="id"/>
+ </td>
+</tr>
+<tr>
+ <th>#{i18n.edit_consumer_cache}</th>
+ <td>
+ <h:inputText id="cache" value="#{consumer.cache}"/>
+ #{i18n.edit_consumer_cache_seconds}
+ <h:message styleClass="portlet-msg-error" for="cache"/>
+ </td>
+</tr>
+<tr>
+ <th>#{i18n.edit_consumer_timeout}</th>
+ <td>
+ <h:inputText id="timeout" value="#{consumer.timeout}"/>
+ #{i18n.edit_consumer_timeout_milliseconds}
+ <h:message styleClass="portlet-msg-error"
for="timeout"/>
+ </td>
+</tr>
+<tr>
+ <th>#{i18n.edit_consumer_endpoint}</th>
+ <td>
+ <h:inputText id="wsdl" size="70"
value="#{consumer.wsdl}"/>
+ <h:message styleClass="portlet-msg-error" for="wsdl"/>
+ </td>
+</tr>
+<c:if test="#{consumer.localInfoPresent}">
+ <tr>
+ <th>#{i18n.edit_consumer_registration}</th>
+ <td>
+ <c:choose>
+ <c:when test="#{consumer.registrationChecked and
!consumer.registrationRequired}">
+ #{i18n.edit_consumer_no_registration}
+ </c:when>
+ <c:otherwise>
+ <h3
class="portlet-area-header">#{i18n.edit_consumer_registration_current}</h3>
+ <h:panelGroup styleClass="portlet-area-body">
+ <c:choose>
+ <c:when
test="#{consumer.registrationPropertiesExisting}">
+ <h:dataTable id="existingProps"
+ value="#{consumer.registrationProperties}"
var="prop"
+
rowClasses="portlet-section-body,portlet-section-alternate"
+ columnClasses="nameColumn,descColumn,"
+ headerClass="portlet-section-header
#{consumer.active ? 'active' : 'inactive'}"
+ styleClass="registration-prop-table
#{consumer.active ? 'active' : 'inactive'}"
+ width="100%">
+ <h:column>
+ <f:facet
name="header">#{i18n.edit_consumer_prop_name}</f:facet>
+ #{prop.name}
+ </h:column>
+ <h:column>
+ <f:facet
name="header">#{i18n.edit_consumer_prop_desc}</f:facet>
+ #{prop.description.label.value}
+ </h:column>
+ <h:column>
+ <f:facet
name="header">#{i18n.edit_consumer_prop_value}</f:facet>
+ <h:inputText id="prop-value-input"
value="#{prop.value}" size="50"
+
disabled="#{consumer.displayExpectedNeeded}"/>
+ <h:outputText styleClass="portlet-msg-error"
value="#{prop.status}"
+
rendered="#{prop.determinedInvalid}"
+
converter="faces.convert.RegistrationProperty.Status"/>
+ </h:column>
+ </h:dataTable>
- <table class="ActionContainer">
- <tr>
- <td>
- <div class="ButtonLeft">
- <div
class="ButtonRight">
- <div
class="ButtonMiddle">
- <h:commandLink
id="cons-update-link" action="#{consumer.update}"
-
value="#{i18n.edit_consumer_registration_update_props}"
-
rendered="#{consumer.registered}"/>
- </div>
- </div>
- </div>
- </td>
- </tr>
- </table>
-
- <ui:remove><webui:commandButton
action="update"
-
backingBean="#{consumer}"
- id="cons-update-link"
-
value="#{i18n.edit_consumer_registration_update_props}"
-
rendered="registered"/></ui:remove>
- </c:when>
- <c:otherwise>
- #{i18n.edit_consumer_registration_no_props}
- </c:otherwise>
- </c:choose>
- <table class="ActionContainer">
- <tr>
- <td>
- <div class="ButtonLeft">
- <div class="ButtonRight">
- <div class="ButtonMiddle">
- <h:commandLink
id="modify-reg-link"
-
action="#{consumer.modifyRegistration}"
-
value="#{i18n.edit_consumer_registration_modify}"
-
title="#{i18n.edit_consumer_registration_modify_title}"
-
rendered="#{consumer.registrationLocallyModified}"/>
- </div>
- </div>
- </div>
- </td>
- </tr>
- </table>
- <ui:remove><webui:commandButton
action="modifyRegistration"
- backingBean="#{consumer}"
- id="modify-reg-link"
-
rendered="registrationLocallyModified"
-
value="#{i18n.edit_consumer_registration_modify}"
-
title="#{i18n.edit_consumer_registration_modify_title}"/>
- </ui:remove>
- <br style="clear:both;"/>
- </h:panelGroup>
-
- <br/>
-
- <c:if
test="#{consumer.registrationModified}">
- <h3
class="portlet-area-header">#{i18n.edit_consumer_registration_expected}</h3>
- <h:panelGroup
styleClass="portlet-area-body">
- <c:choose>
- <c:when
test="#{consumer.expectedRegistrationPropertiesEmpty}">
- <h:dataTable id="expectedProps"
-
value="#{consumer.expectedRegistrationProperties}" var="prop"
-
rowClasses="portlet-section-body,portlet-section-alternate"
-
columnClasses="nameColumn,descColumn,"
-
headerClass="portlet-section-header #{consumer.active ? 'active' :
'inactive'}"
-
styleClass="registration-prop-table #{consumer.active ? 'active' :
'inactive'}"
- width="100%">
- <h:column>
- <f:facet
name="header">#{i18n.edit_consumer_prop_name}</f:facet>
- #{prop.name}
- </h:column>
- <h:column>
- <f:facet
name="header">#{i18n.edit_consumer_prop_desc}</f:facet>
- #{prop.description.label.value}
- </h:column>
- <h:column>
- <f:facet
name="header">#{i18n.edit_consumer_prop_value}</f:facet>
- <h:inputText
id="prop-value-input" value="#{prop.value}" size="50"/>
- <h:outputText
styleClass="portlet-msg-error" value="#{prop.status}"
-
rendered="#{prop.determinedInvalid}"
-
converter="faces.convert.RegistrationProperty.Status"/>
- </h:column>
- </h:dataTable>
- </c:when>
- <c:otherwise>
- #{i18n.edit_consumer_registration_no_props}
- </c:otherwise>
- </c:choose>
-
- <table class="ActionContainer">
- <tr>
- <td>
- <div class="ButtonLeft">
- <div class="ButtonRight">
- <div
class="ButtonMiddle">
- <h:commandLink
id="edit-reg-link"
-
action="#{consumer.modifyRegistration}"
-
value="#{i18n.edit_consumer_registration_modify}"
-
title="#{i18n.edit_consumer_registration_modify_title}"/>
- </div>
- </div>
- </div>
- </td>
- </tr>
- </table>
- <ui:remove><webui:commandButton
action="modifyRegistration"
-
backingBean="#{consumer}"
- id="edit-reg-link"
-
value="#{i18n.edit_consumer_registration_modify}"
-
title="#{i18n.edit_consumer_registration_modify_title}"/></ui:remove>
-
- <br style="clear:both;"/>
- </h:panelGroup>
- </c:if>
- </c:when>
- <c:when test="#{consumer.registrationChecked and
!consumer.registrationRequired}">
- #{i18n.edit_consumer_no_registration}
- </c:when>
- </c:choose>
- </td>
- </tr>
- <c:if test="#{!empty
consumer.producerInfo.registrationInfo.registrationHandle}">
- <tr>
- <th>#{i18n.edit_consumer_registration_context}</th>
- <td id="handle">
- #{i18n.edit_consumer_registration_context_handle}
- <h:outputText
value="#{consumer.producerInfo.registrationInfo.registrationHandle}"/>
-
<table class="ActionContainer">
<tr>
<td>
<div class="ButtonLeft">
<div class="ButtonRight">
<div class="ButtonMiddle">
- <h:commandLink
id="erase-cons-link" action="confirmEraseRegistration"
-
value="#{i18n.edit_consumer_registration_context_erase}"
-
title="#{i18n.edit_consumer_registration_context_erase_title}"/>
+ <h:commandLink
id="cons-update-link" action="#{consumer.update}"
+
value="#{i18n.edit_consumer_registration_update_props}"
+
rendered="#{consumer.registered}"/>
</div>
</div>
</div>
</td>
+ <td>
+ <div class="ButtonLeft">
+ <div class="ButtonRight">
+ <div class="ButtonMiddle">
+ <h:commandLink
id="modify-reg-link"
+
action="#{consumer.modifyRegistration}"
+
value="#{i18n.edit_consumer_registration_modify}"
+
title="#{i18n.edit_consumer_registration_modify_title}"
+
rendered="#{consumer.registrationLocallyModified}"/>
+ </div>
+ </div>
+ </div>
+ </td>
</tr>
</table>
- <ui:remove><webui:commandButton
id="erase-cons-link" action="confirmEraseRegistration"
- backingBean="#{consumer}"
-
value="#{i18n.edit_consumer_registration_context_erase}"
-
title="#{i18n.edit_consumer_registration_context_erase_title}"/></ui:remove>
- </td>
- </tr>
- </c:if>
- </c:if>
- <tr>
- <th/>
- <td class="portlet-section-buttonrow">
- <table class="ActionContainer">
- <tr>
- <td>
- <div class="ButtonLeft">
- <div class="ButtonRight">
- <div class="ButtonMiddle">
- <h:commandLink id="refresh-cons-link"
action="#{consumer.refreshConsumer}"
-
value="#{i18n.edit_consumer_refresh}"
-
title="#{i18n.edit_consumer_refresh_title}"/>
+ <ui:remove><webui:commandButton
action="update"
+
backingBean="#{consumer}"
+ id="cons-update-link"
+
value="#{i18n.edit_consumer_registration_update_props}"
+
rendered="registered"/></ui:remove>
+ </c:when>
+ <c:otherwise>
+ #{i18n.edit_consumer_registration_no_props}
+ </c:otherwise>
+ </c:choose>
+ <ui:remove>
+ <webui:commandButton action="modifyRegistration"
+ backingBean="#{consumer}"
+ id="modify-reg-link"
+
rendered="registrationLocallyModified"
+
value="#{i18n.edit_consumer_registration_modify}"
+
title="#{i18n.edit_consumer_registration_modify_title}"/>
+ </ui:remove>
+ <br style="clear:both;"/>
+ </h:panelGroup>
+
+ <br/>
+
+ <c:if test="#{consumer.displayExpectedNeeded}">
+ <h3
class="portlet-area-header">#{i18n.edit_consumer_registration_expected}</h3>
+ <h:panelGroup styleClass="portlet-area-body">
+ <c:choose>
+ <c:when
test="#{consumer.expectedRegistrationPropertiesExisting}">
+ <h:dataTable id="expectedProps"
+
value="#{consumer.expectedRegistrationProperties}" var="prop"
+
rowClasses="portlet-section-body,portlet-section-alternate"
+ columnClasses="nameColumn,descColumn,"
+ headerClass="portlet-section-header
#{consumer.active ? 'active' : 'inactive'}"
+ styleClass="registration-prop-table
#{consumer.active ? 'active' : 'inactive'}"
+ width="100%">
+ <h:column>
+ <f:facet
name="header">#{i18n.edit_consumer_prop_name}</f:facet>
+ #{prop.name}
+ </h:column>
+ <h:column>
+ <f:facet
name="header">#{i18n.edit_consumer_prop_desc}</f:facet>
+ #{prop.description.label.value}
+ </h:column>
+ <h:column>
+ <f:facet
name="header">#{i18n.edit_consumer_prop_value}</f:facet>
+ <h:inputText id="prop-value-input"
value="#{prop.value}" size="50"/>
+ <h:outputText
styleClass="portlet-msg-error" value="#{prop.status}"
+
rendered="#{prop.determinedInvalid}"
+
converter="faces.convert.RegistrationProperty.Status"/>
+ </h:column>
+ </h:dataTable>
+ </c:when>
+ <c:otherwise>
+ #{i18n.edit_consumer_registration_no_props}
+ </c:otherwise>
+ </c:choose>
+
+ <table class="ActionContainer">
+ <tr>
+ <td>
+ <div class="ButtonLeft">
+ <div class="ButtonRight">
+ <div class="ButtonMiddle">
+ <h:commandLink id="edit-reg-link"
+
action="#{consumer.modifyRegistration}"
+
value="#{i18n.edit_consumer_registration_modify}"
+
title="#{i18n.edit_consumer_registration_modify_title}"/>
+ </div>
</div>
</div>
+ </td>
+ </tr>
+ </table>
+ <ui:remove><webui:commandButton
action="modifyRegistration"
+ backingBean="#{consumer}"
+ id="edit-reg-link"
+
value="#{i18n.edit_consumer_registration_modify}"
+
title="#{i18n.edit_consumer_registration_modify_title}"/></ui:remove>
+
+ <br style="clear:both;"/>
+ </h:panelGroup>
+ </c:if>
+ </c:otherwise>
+ </c:choose>
+ </td>
+ </tr>
+ <c:if test="#{!empty
consumer.producerInfo.registrationInfo.registrationHandle}">
+ <tr>
+ <th>#{i18n.edit_consumer_registration_context}</th>
+ <td id="handle">
+ #{i18n.edit_consumer_registration_context_handle}
+ <h:outputText
value="#{consumer.producerInfo.registrationInfo.registrationHandle}"/>
+
+ <table class="ActionContainer">
+ <tr>
+ <td>
+ <div class="ButtonLeft">
+ <div class="ButtonRight">
+ <div class="ButtonMiddle">
+ <h:commandLink id="erase-cons-link"
action="confirmEraseRegistration"
+
value="#{i18n.edit_consumer_registration_context_erase}"
+
title="#{i18n.edit_consumer_registration_context_erase_title}"/>
</div>
- </td>
- <td>
- <div class="ButtonLeft">
- <div class="ButtonRight">
- <div class="ButtonMiddle">
- <h:commandLink id="list-cons-link"
action="#{consumersMgr.listConsumers}"
-
value="#{i18n.edit_consumer_cancel}"/>
- </div>
- </div>
- </div>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- </h:form>
- </ui:define>
+ </div>
+ </div>
+ </td>
+ </tr>
+ </table>
+ <ui:remove><webui:commandButton id="erase-cons-link"
action="confirmEraseRegistration"
+ backingBean="#{consumer}"
+
value="#{i18n.edit_consumer_registration_context_erase}"
+
title="#{i18n.edit_consumer_registration_context_erase_title}"/></ui:remove>
+
+ </td>
+ </tr>
+ </c:if>
+</c:if>
+<tr>
+ <th/>
+ <td class="portlet-section-buttonrow">
+ <table class="ActionContainer">
+ <tr>
+ <td>
+ <div class="ButtonLeft">
+ <div class="ButtonRight">
+ <div class="ButtonMiddle">
+ <h:commandLink id="refresh-cons-link"
action="#{consumer.refreshConsumer}"
+ value="#{i18n.edit_consumer_refresh}"
+
title="#{i18n.edit_consumer_refresh_title}"/>
+ </div>
+ </div>
+ </div>
+ </td>
+ <td>
+ <div class="ButtonLeft">
+ <div class="ButtonRight">
+ <div class="ButtonMiddle">
+ <h:commandLink id="list-cons-link"
action="#{consumersMgr.listConsumers}"
+
value="#{i18n.edit_consumer_cancel}"/>
+ </div>
+ </div>
+ </div>
+ </td>
+ </tr>
+ </table>
+ </td>
+</tr>
+</table>
+</h:form>
+</ui:define>
</ui:decorate>
Modified:
components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/RegistrationInfo.java
===================================================================
---
components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/RegistrationInfo.java 2010-02-13
11:18:05 UTC (rev 1669)
+++
components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/RegistrationInfo.java 2010-02-14
15:55:04 UTC (rev 1670)
@@ -249,10 +249,10 @@
public boolean hasLocalInfo()
{
- return persistentRegistrationHandle != null || isRegistrationPropertiesEmpty();
+ return persistentRegistrationHandle != null || isRegistrationPropertiesExisting();
}
- public boolean isRegistrationPropertiesEmpty()
+ public boolean isRegistrationPropertiesExisting()
{
return persistentRegistrationProperties != null &&
!persistentRegistrationProperties.isEmpty();
}