Author: chris.laprun(a)jboss.com
Date: 2007-12-03 22:05:02 -0500 (Mon, 03 Dec 2007)
New Revision: 9266
Modified:
branches/JBoss_Portal_Branch_2_6/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ConsumerBean.java
branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/consumers/editConsumer.xhtml
branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/style.css
Log:
- JBPORTAL-1834: Fixed bad interaction design with respect to entering registration
properties. Instead of using
immediate text field, use a button to update the properties when needed.
Modified:
branches/JBoss_Portal_Branch_2_6/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ConsumerBean.java
===================================================================
---
branches/JBoss_Portal_Branch_2_6/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ConsumerBean.java 2007-12-04
01:29:57 UTC (rev 9265)
+++
branches/JBoss_Portal_Branch_2_6/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ConsumerBean.java 2007-12-04
03:05:02 UTC (rev 9266)
@@ -240,7 +240,7 @@
public boolean isRegistrationLocallyModified()
{
- return registrationLocallyModified;
+ return isRegistered() && registrationLocallyModified;
}
public boolean isRegistrationChecked()
@@ -309,7 +309,7 @@
}
}
- return manager.listConsumers();
+ return ConsumerManagerBean.CONFIGURE_CONSUMER;
}
beanContext.createErrorMessage("Couldn't update Consumer!");
@@ -320,7 +320,6 @@
{
registry.updateProducerInfo(prodInfo);
modified = false;
- registrationLocallyModified = false;
}
public String refreshConsumer()
@@ -355,26 +354,26 @@
// get updated registration info
RegistrationInfo newReg = getExpectedRegistrationInfo();
- // check that we have the proper state: need to check before saving
modifications as this will reset the modified status
- if (newReg == null && !isRegistrationLocallyModified())
- {
- IllegalStateException e =
- new IllegalStateException("Registration not locally modified:
there should be expected registration from producer!");
- log.debug(e);
- throw e;
- }
-
// make sure we save any modified registration properties
saveToRegistry(info);
// save old info in case something goes wrong
RegistrationInfo oldReg = getProducerInfo().getRegistrationInfo();
- // if we want to change an existing registration property (for example, to
upgrade service) then there are
- // no expected information, we're just using the modified local version
+ // check that we have the proper state
if (newReg == null)
{
+ // if we want to change an existing registration property (for example, to
upgrade service) then there are
+ // no expected information, we're just using the modified local
version
newReg = oldReg;
+
+ if (!isRegistrationLocallyModified())
+ {
+ IllegalStateException e =
+ new IllegalStateException("Registration not locally modified:
there should be expected registration from producer!");
+ log.debug(e);
+ throw e;
+ }
}
try
@@ -426,7 +425,7 @@
private Object modifyIfNeeded(Object oldValue, Object newValue, String target, boolean
checkURL)
{
- if ((oldValue != null && !oldValue.equals(newValue)) || (oldValue == null
&& newValue != null))
+ if (isOldAndNewEqual(oldValue, newValue))
{
if (checkURL)
{
@@ -448,6 +447,11 @@
return oldValue;
}
+ private boolean isOldAndNewEqual(Object oldValue, Object newValue)
+ {
+ return (oldValue != null && !oldValue.equals(newValue)) || (oldValue ==
null && newValue != null);
+ }
+
// Listeners
public void useWSDLListener(ValueChangeEvent event)
@@ -460,11 +464,9 @@
public void regPropListener(ValueChangeEvent event)
{
- // todo: should use modifyIfNeeded but it might be tricky as the name of the
property that has been changed
- // cannot be easily retrieved (we cannot use it as an id directly), could use title
but that would be hackish
- registrationLocallyModified = true;
-
- // bypass the rest of the life cycle and re-display page
- FacesContext.getCurrentInstance().renderResponse();
+ if (!registrationLocallyModified)
+ {
+ registrationLocallyModified = isOldAndNewEqual(event.getOldValue(),
event.getNewValue());
+ }
}
}
\ No newline at end of file
Modified:
branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/consumers/editConsumer.xhtml
===================================================================
---
branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/consumers/editConsumer.xhtml 2007-12-04
01:29:57 UTC (rev 9265)
+++
branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/consumers/editConsumer.xhtml 2007-12-04
03:05:02 UTC (rev 9266)
@@ -95,8 +95,8 @@
<td>#{prop.name}</td>
<td>#{prop.description.label.value}</td>
<td>
- <h:inputText value="#{prop.value}"
size="50" onchange="this.form.submit()"
- immediate="true"
valueChangeListener="#{consumer.regPropListener}"
+ <h:inputText value="#{prop.value}"
size="50"
+
valueChangeListener="#{consumer.regPropListener}"
disabled="#{consumer.registrationModified}"/>
<h:outputText
styleClass="portlet-msg-error" value="#{prop.status}"
rendered="#{prop.determinedInvalid}"/>
@@ -104,6 +104,9 @@
</tr>
</c:forEach>
</table>
+ <h:commandLink action="#{consumer.update}"
value="Update properties"
+ rendered="#{consumer.registered}"
+ styleClass="portlet-form-button
portlet-section-buttonrow"/>
</c:when>
<c:otherwise>
Registration is indicated as required without registration
properties.
Modified:
branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/style.css
===================================================================
---
branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/style.css 2007-12-04
01:29:57 UTC (rev 9265)
+++
branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/style.css 2007-12-04
03:05:02 UTC (rev 9266)
@@ -1,4 +1,4 @@
-@import url(basestyles.css);
+@import url( basestyles.css );
.wsrp-consumers-ui table {
border: 0;
@@ -105,10 +105,10 @@
color: #315896;
font-size: 11px;
padding: 3px 0 3px 3px;
- background-image:url(img/section-subHeader-bg.gif);
- background-position:left top;
- background-repeat:repeat-x;
- border:1px solid #b9c6d7;
+ background-image: url( img/section-subHeader-bg.gif );
+ background-position: left top;
+ background-repeat: repeat-x;
+ border: 1px solid #b9c6d7;
}
.wsrp-consumers-ui .portlet-section-header {
@@ -278,6 +278,7 @@
.wsrp-consumers-ui .registration-prop-table {
text-align: left;
width: 100%;
+ margin-bottom: .3em;
}
.wsrp-consumers-ui .registration-prop-table.active {
Show replies by date