Author: chris.laprun(a)jboss.com
Date: 2008-10-02 14:40:00 -0400 (Thu, 02 Oct 2008)
New Revision: 12024
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
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/consumer/RegistrationInfo.java
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/consumer/RegistrationProperty.java
Log:
- JBPORTAL-2103: fixed issue with duplicated ids.
- Improved display of registration properties a little bit using dataTable instead of
forEach.
- Improved CSS.
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 2008-10-02
17:29:00 UTC (rev 12023)
+++
branches/JBoss_Portal_Branch_2_6/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ConsumerBean.java 2008-10-02
18:40:00 UTC (rev 12024)
@@ -28,11 +28,15 @@
import org.jboss.portal.wsrp.consumer.EndpointConfigurationInfo;
import org.jboss.portal.wsrp.consumer.ProducerInfo;
import org.jboss.portal.wsrp.consumer.RegistrationInfo;
+import org.jboss.portal.wsrp.consumer.RegistrationProperty;
import javax.faces.context.FacesContext;
import javax.faces.event.ValueChangeEvent;
import java.net.MalformedURLException;
import java.net.URL;
+import java.util.Collections;
+import java.util.LinkedList;
+import java.util.List;
import java.util.Map;
/**
@@ -283,8 +287,27 @@
return getProducerInfo().hasLocalRegistrationInfo();
}
- public RegistrationInfo getExpectedRegistrationInfo()
+ public boolean isRegistrationPropertiesEmpty()
{
+ RegistrationInfo regInfo = getProducerInfo().getRegistrationInfo();
+ return regInfo == null || regInfo.isRegistrationPropertiesEmpty();
+ }
+
+ public boolean isExpectedRegistrationPropertiesEmpty()
+ {
+ RegistrationInfo info = getExpectedRegistrationInfo();
+ if (info != null)
+ {
+ return info.isRegistrationPropertiesEmpty();
+ }
+ else
+ {
+ return true;
+ }
+ }
+
+ private RegistrationInfo getExpectedRegistrationInfo()
+ {
if (expectedRegistrationInfo == null)
{
Map sessionMap =
FacesContext.getCurrentInstance().getExternalContext().getSessionMap();
@@ -294,6 +317,23 @@
return expectedRegistrationInfo;
}
+ public List<RegistrationProperty> getRegistrationProperties()
+ {
+ return getSortedProperties(getProducerInfo().getRegistrationInfo());
+ }
+
+ public List<RegistrationProperty> getExpectedRegistrationProperties()
+ {
+ return getSortedProperties(getExpectedRegistrationInfo());
+ }
+
+ private LinkedList<RegistrationProperty> getSortedProperties(RegistrationInfo
registrationInfo)
+ {
+ LinkedList<RegistrationProperty> list = new
LinkedList<RegistrationProperty>(registrationInfo.getRegistrationProperties().values());
+ Collections.sort(list);
+ return list;
+ }
+
// Actions
public String update()
@@ -360,7 +400,7 @@
}
}
- // if the registration is locally modified, bypassed the refresh as it will not
yield a proper result
+ // if the registration is locally modified, bypass the refresh as it will not
yield a proper result
if (!isRegistrationLocallyModified())
{
manager.refresh(consumer);
@@ -509,6 +549,7 @@
FacesContext.getCurrentInstance().renderResponse();
}
+ // todo: valueChangeListener not needed anymore when events on RegistrationProperties
work
public void regPropListener(ValueChangeEvent event)
{
if (!registrationLocallyModified)
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 2008-10-02
17:29:00 UTC (rev 12023)
+++
branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/consumers/editConsumer.xhtml 2008-10-02
18:40:00 UTC (rev 12024)
@@ -82,29 +82,34 @@
<h3
class="portlet-area-header">#{i18n.edit_consumer_registration_current}</h3>
<h:panelGroup styleClass="portlet-area-body">
<c:choose>
- <c:when test="#{!empty
consumer.producerInfo.registrationInfo.registrationProperties}">
- <table class="registration-prop-table #{consumer.active ?
'active' : 'inactive'}">
- <tr>
- <th
class="nameColumn">#{i18n.edit_consumer_prop_name}</th>
- <th
class="descColumn">#{i18n.edit_consumer_prop_desc}</th>
- <th>#{i18n.edit_consumer_prop_value}</th>
- </tr>
- <c:forEach
items="#{consumer.producerInfo.registrationInfo.registrationProperties}"
- var="prop">
- <tr title="#{prop.description.label.value}">
- <td>#{prop.name}</td>
- <td>#{prop.description.label.value}</td>
- <td>
- <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}"/>
- </td>
- </tr>
- </c:forEach>
- </table>
- <h:commandLink id="cons-update-link"
action="#{consumer.update}"
+ <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:commandLink id="cons-update-link"
action="#{consumer.update}"
value="#{i18n.edit_consumer_registration_update_props}"
rendered="#{consumer.registered}"
styleClass="portlet-form-button
portlet-section-buttonrow"/>
@@ -127,26 +132,30 @@
<h3
class="portlet-area-header">#{i18n.edit_consumer_registration_expected}</h3>
<h:panelGroup styleClass="portlet-area-body">
<c:choose>
- <c:when test="#{!empty
consumer.expectedRegistrationInfo.registrationProperties}">
- <table class="registration-prop-table
#{consumer.active ? 'active' : 'inactive'}">
- <tr>
- <th
class="nameColumn">#{i18n.edit_consumer_prop_name}</th>
- <th
class="descColumn">#{i18n.edit_consumer_prop_desc}</th>
- <th>#{i18n.edit_consumer_prop_value}</th>
- </tr>
- <c:forEach
items="#{consumer.expectedRegistrationInfo.registrationProperties}"
var="prop">
- <tr
title="#{prop.description.label.value}">
- <td>#{prop.name}</td>
- <td>#{prop.description.label.value}</td>
- <td>
- <h:inputText id="prop-value-input"
value="#{prop.value}" size="50"/>
-
- <h:outputText
styleClass="portlet-msg-error" value="#{prop.status}"
-
rendered="#{prop.determinedInvalid}"/>
- </td>
- </tr>
- </c:forEach>
- </table>
+ <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}
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 2008-10-02
17:29:00 UTC (rev 12023)
+++
branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/style.css 2008-10-02
18:40:00 UTC (rev 12024)
@@ -17,7 +17,7 @@
/* Top nav. */
.wsrp-consumers-ui ul.topnav {
- padding: 4px 0px 3px;
+ padding: 4px 0 3px;
border-bottom: 1px solid #b3c0c7;
margin: 0;
}
@@ -25,9 +25,8 @@
.wsrp-consumers-ui ul.topnav li {
list-style-type: none;
display: inline;
- margin: 0;
+ margin: 0 0 0 5px;
padding: 3px 0.5em;
- margin-left: 5px;
border: 1px solid #b3c0c7;
border-bottom: none;
background-color: #f2f4f5;
@@ -60,14 +59,10 @@
border: solid 1px #bbb;
border-left: solid 1px #eee;
border-right: solid 1px #eee;
- background-color: #d5d5d5;
- background-image: url( img/pathBackground.png );
- background-position: left;
- background-repeat: repeat-x;
+ background: url( img/pathBackground.png ) repeat-x left;
height: 21px;
- margin: 0px;
- padding: 0px;
- padding-left: 2px;
+ margin: 0;
+ padding: 0 0 0 2px;
}
.wsrp-consumers-ui ul.objectpath li {
@@ -105,16 +100,12 @@
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;
+ background: url( img/section-subHeader-bg.gif ) repeat-x left top;
border: 1px solid #b9c6d7;
}
.wsrp-consumers-ui .portlet-section-header {
- background-image: url( img/pathBackground.png );
- background-position: left;
- background-repeat: repeat-x;
+ background: url( img/pathBackground.png ) repeat-x left;
font-weight: bold;
color: #656565;
font-size: 10px;
@@ -124,9 +115,7 @@
}
.wsrp-consumers-ui .portlet-section-header th {
- background-image: url( img/pathBackground.png );
- background-position: left;
- background-repeat: repeat-x;
+ background: url( img/pathBackground.png ) repeat-x left;
font-weight: bold;
color: #656565;
font-size: 10px;
@@ -136,71 +125,51 @@
}
.wsrp-consumers-ui .actionConfigure {
- background-image: url( img/actionIcon_Configure.gif );
- background-position: left;
- background-repeat: no-repeat;
- line-height: 14px;
- padding-left: 18px;
+ padding: 5px 5px 5px 20px;
+ background: url( img/jbp-icon-set/settings.gif ) no-repeat left;
+ line-height: 18px;
white-space: nowrap;
}
.wsrp-consumers-ui .actionRefresh {
- background-image: url( img/actionIcon_Refresh.gif );
- background-position: left;
- background-repeat: no-repeat;
- line-height: 14px;
- padding-left: 18px;
+ padding: 5px 5px 5px 20px;
+ background: url( img/jbp-icon-set/refresh.gif ) no-repeat left;
+ line-height: 18px;
white-space: nowrap;
}
.wsrp-consumers-ui .actionRegister {
- background-image: url( img/actionIcon_Register.gif );
- background-position: left;
- background-repeat: no-repeat;
- line-height: 14px;
- padding-left: 18px;
+ padding: 5px 5px 5px 24px;
+ background: url( img/jbp-icon-set/register.gif ) no-repeat left;
+ line-height: 18px;
white-space: nowrap;
}
.wsrp-consumers-ui .actionDeregister {
- background-image: url( img/actionIcon_Deregister.gif );
- background-position: left;
- background-repeat: no-repeat;
- line-height: 14px;
- padding-left: 18px;
+ padding: 5px 5px 5px 24px;
+ background: url( img/jbp-icon-set/deregister.gif ) no-repeat left;
+ line-height: 18px;
white-space: nowrap;
}
.wsrp-consumers-ui .actionDelete {
- background-image: url( img/actionIcon_Delete.gif );
- background-position: left;
- background-repeat: no-repeat;
- padding-top: 2px;
- padding-bottom: 2px;
+ padding: 5px 5px 5px 20px;
+ background: url( img/jbp-icon-set/delete2.gif ) no-repeat left;
line-height: 18px;
- padding-left: 18px;
white-space: nowrap;
}
.wsrp-consumers-ui .actionActivate {
- background-image: url( img/actionIcon_Activate.gif );
- background-position: left;
- background-repeat: no-repeat;
- padding-top: 2px;
- padding-bottom: 2px;
+ padding: 5px 5px 5px 23px;
+ background: url( img/jbp-icon-set/activate.gif ) no-repeat left;
line-height: 18px;
- padding-left: 18px;
white-space: nowrap;
}
.wsrp-consumers-ui .actionDeactivate {
- background-image: url( img/actionIcon_Deactivate.gif );
- background-position: left;
- background-repeat: no-repeat;
- padding-top: 2px;
- padding-bottom: 2px;
+ padding: 5px 5px 5px 20px;
+ background: url( img/jbp-icon-set/deactivate.gif ) no-repeat left;
line-height: 18px;
- padding-left: 18px;
white-space: nowrap;
}
@@ -286,25 +255,34 @@
}
.wsrp-consumers-ui .registration-prop-table.active th {
- background-color: #C7DDB7;
+ background: #C7DDB7 none;
}
-.wsrp-consumers-ui .registration-prop-table.inactive {
+.wsrp-consumers-ui .registration-prop-table.active .portlet-section-alternate
+{
+ background: #dcf0d0;
+}
+
+.wsrp-consumers-ui .registration-prop-table.inactive, .wsrp-consumers-ui span.inactive {
border: 1px solid #EBD1B8;
}
.wsrp-consumers-ui .registration-prop-table.inactive th {
- background-color: #EBD1B8;
+ background: #EBD1B8 none;
}
-.wsrp-consumers-ui .registration-prop-table th.nameColumn {
- width: 25%;
+.wsrp-consumers-ui .registration-prop-table.inactive .portlet-section-alternate {
+ background: #f0f0dd;
}
-.wsrp-consumers-ui .registration-prop-table th.descColumn {
- width: 25%;
+.wsrp-consumers-ui .registration-prop-table .nameColumn {
+ width: 20%;
}
+.wsrp-consumers-ui .registration-prop-table .descColumn {
+ width: 20%;
+}
+
.wsrp-consumers-ui .portlet-section-buttonrow {
margin-top: 6px;
margin-bottom: 6px;
@@ -339,8 +317,7 @@
color: #fff;
font-size: 11px;
background-color: #5986b3;
- padding: 2px;
- padding-left: 4px;
+ padding: 2px 2px 2px 4px;
margin: 0;
display: block;
}
@@ -371,4 +348,4 @@
.wsrp-consumers-ui .wsrp-content-container {
margin: 0 auto 0 auto;
width: 98%;
-}
+}
\ No newline at end of file
Modified:
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/consumer/RegistrationInfo.java
===================================================================
---
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/consumer/RegistrationInfo.java 2008-10-02
17:29:00 UTC (rev 12023)
+++
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/consumer/RegistrationInfo.java 2008-10-02
18:40:00 UTC (rev 12024)
@@ -231,9 +231,14 @@
public boolean hasLocalInfo()
{
- return persistentRegistrationHandle != null || (persistentRegistrationProperties !=
null && !persistentRegistrationProperties.isEmpty());
+ return persistentRegistrationHandle != null || isRegistrationPropertiesEmpty();
}
+ public boolean isRegistrationPropertiesEmpty()
+ {
+ return persistentRegistrationProperties != null &&
!persistentRegistrationProperties.isEmpty();
+ }
+
public RegistrationData getRegistrationData()
{
registrationData = WSRPTypeFactory.createDefaultRegistrationData();
Modified:
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/consumer/RegistrationProperty.java
===================================================================
---
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/consumer/RegistrationProperty.java 2008-10-02
17:29:00 UTC (rev 12023)
+++
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/consumer/RegistrationProperty.java 2008-10-02
18:40:00 UTC (rev 12024)
@@ -31,7 +31,7 @@
* @version $Revision$
* @since 2.6
*/
-public class RegistrationProperty
+public class RegistrationProperty implements Comparable<RegistrationProperty>
{
private Long persistentId;
private RegistrationPropertyDescription persistentDescription;
@@ -60,6 +60,11 @@
setValue(stringValue);
}
+ public int compareTo(RegistrationProperty o)
+ {
+ return persistentName.compareTo(o.persistentName);
+ }
+
@Override
public boolean equals(Object o)
{