Author: chris.laprun(a)jboss.com
Date: 2007-11-26 22:07:34 -0500 (Mon, 26 Nov 2007)
New Revision: 9120
Added:
branches/JBoss_Portal_Branch_2_6/core-wsrp/src/bin/portal-wsrp-admin-war/img/msgIcon_Warning.gif
branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/consumers/confirmDeleteConsumer.xhtml
branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/consumers/confirmEraseRegistration.xhtml
branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/producer/confirmPropDeletion.xhtml
Modified:
branches/JBoss_Portal_Branch_2_6/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ConsumerManagerBean.java
branches/JBoss_Portal_Branch_2_6/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ProducerBean.java
branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/faces-config.xml
branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/consumers/consumers.xhtml
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/producer/producer.xhtml
branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/style.css
Log:
- JBPORTAL-1715:
+ Added possibility to cancel modifications.
+ Added removal of registration property.
+ Made requiring registration immediate for better usability.
- JBPORTAL-1818: Added confirmation dialogs for registration property, consumer and local
registration deletions.
Copied:
branches/JBoss_Portal_Branch_2_6/core-wsrp/src/bin/portal-wsrp-admin-war/img/msgIcon_Warning.gif
(from rev 8951,
branches/JBoss_Portal_Branch_2_6/core-admin/src/bin/portal-admin-war/img/msgIcon_Warning.gif)
===================================================================
(Binary files differ)
Modified:
branches/JBoss_Portal_Branch_2_6/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ConsumerManagerBean.java
===================================================================
---
branches/JBoss_Portal_Branch_2_6/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ConsumerManagerBean.java 2007-11-27
01:39:35 UTC (rev 9119)
+++
branches/JBoss_Portal_Branch_2_6/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ConsumerManagerBean.java 2007-11-27
03:07:34 UTC (rev 9120)
@@ -29,6 +29,7 @@
import org.jboss.portal.wsrp.consumer.RefreshResult;
import javax.faces.context.FacesContext;
+import javax.faces.event.ActionEvent;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Map;
@@ -270,6 +271,12 @@
return INDEX;
}
+ public void selectConsumer(ActionEvent actionEvent)
+ {
+ refreshConsumerId();
+ setConsumerIdInSession(false);
+ }
+
private String refreshConsumerId()
{
selectedId = beanContext.getParameter("id");
Modified:
branches/JBoss_Portal_Branch_2_6/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ProducerBean.java
===================================================================
---
branches/JBoss_Portal_Branch_2_6/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ProducerBean.java 2007-11-27
01:39:35 UTC (rev 9119)
+++
branches/JBoss_Portal_Branch_2_6/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ProducerBean.java 2007-11-27
03:07:34 UTC (rev 9120)
@@ -30,6 +30,9 @@
import org.jboss.portal.wsrp.producer.config.ProducerRegistrationRequirements;
import org.jboss.portal.wsrp.registration.RegistrationPropertyDescription;
+import javax.faces.context.FacesContext;
+import javax.faces.event.ActionEvent;
+import javax.faces.event.ValueChangeEvent;
import javax.faces.model.SelectItem;
import java.util.ArrayList;
import java.util.Collections;
@@ -50,6 +53,7 @@
private static final String PROPERTY = "property";
private static int counter = 0;
private static final String PRODUCER = "producer";
+ private String selectedProp;
public ProducerConfigurationService getConfigurationService()
{
@@ -149,6 +153,11 @@
return Collections.singletonList(new SelectItem("xsd:string"));
}
+ public String getSelectedPropertyName()
+ {
+ return selectedProp;
+ }
+
public String save()
{
try
@@ -167,9 +176,42 @@
return PRODUCER;
}
+ public String reloadConfiguration()
+ {
+ try
+ {
+ configurationService.reloadConfiguration();
+ }
+ catch (Exception e)
+ {
+ log.debug(e);
+ beanContext.createErrorMessage("status", "Couldn't reload
producer configuration. Cause: " + e.getLocalizedMessage());
+ }
+ return PRODUCER;
+ }
+
public String addRegistrationProperty()
{
getRegRequirements().addEmptyRegistrationProperty(PROPERTY + counter++);
return PRODUCER;
}
+
+ public String deleteRegistrationProperty()
+ {
+ getRegRequirements().removeRegistrationProperty(selectedProp);
+ return PRODUCER;
+ }
+
+ public void requireRegistrationListener(ValueChangeEvent event)
+ {
+ setRegistrationRequired((Boolean)event.getNewValue());
+
+ // bypass the rest of the life cycle and re-display page
+ FacesContext.getCurrentInstance().renderResponse();
+ }
+
+ public void selectProperty(ActionEvent event)
+ {
+ selectedProp = beanContext.getParameter("propName");
+ }
}
Modified:
branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/faces-config.xml
===================================================================
---
branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/faces-config.xml 2007-11-27
01:39:35 UTC (rev 9119)
+++
branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/faces-config.xml 2007-11-27
03:07:34 UTC (rev 9120)
@@ -87,7 +87,7 @@
<managed-bean>
<managed-bean-name>producer</managed-bean-name>
<managed-bean-class>org.jboss.portal.wsrp.admin.ui.ProducerBean</managed-bean-class>
- <managed-bean-scope>request</managed-bean-scope>
+ <managed-bean-scope>session</managed-bean-scope>
<managed-property>
<property-name>configurationService</property-name>
<property-class>org.jboss.portal.wsrp.producer.config.ProducerConfigurationService</property-class>
@@ -113,5 +113,17 @@
<from-outcome>producer</from-outcome>
<to-view-id>/WEB-INF/jsf/producer/producer.xhtml</to-view-id>
</navigation-case>
+ <navigation-case>
+ <from-outcome>confirmPropDeletion</from-outcome>
+
<to-view-id>/WEB-INF/jsf/producer/confirmPropDeletion.xhtml</to-view-id>
+ </navigation-case>
+ <navigation-case>
+ <from-outcome>confirmEraseRegistration</from-outcome>
+
<to-view-id>/WEB-INF/jsf/consumers/confirmEraseRegistration.xhtml</to-view-id>
+ </navigation-case>
+ <navigation-case>
+ <from-outcome>confirmDeleteConsumer</from-outcome>
+
<to-view-id>/WEB-INF/jsf/consumers/confirmDeleteConsumer.xhtml</to-view-id>
+ </navigation-case>
</navigation-rule>
</faces-config>
Added:
branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/consumers/confirmDeleteConsumer.xhtml
===================================================================
---
branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/consumers/confirmDeleteConsumer.xhtml
(rev 0)
+++
branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/consumers/confirmDeleteConsumer.xhtml 2007-11-27
03:07:34 UTC (rev 9120)
@@ -0,0 +1,35 @@
+<ui:decorate template="consumerTemplate.xhtml"
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:jbp="http://www.jboss.org/portal"
+
xmlns:c="http://java.sun.com/jstl/core">
+
+ <ui:param name="title" value=""/>
+ <ui:define name="content">
+
+ <div class="portlet-msg">
+ <div class="portlet-msg-icon"><h:graphicImage
url="/img/msgIcon_Warning.gif" alt="/!\"/></div>
+ <div class="portlet-msg-body">
+ <h3>Delete '#{consumersMgr.selectedConsumer.producerId}'
consumer?</h3>
+
+ <p class="portlet-msg-alert">
+ You are about to delete the
'#{consumersMgr.selectedConsumer.producerId}' consumer!
+ </p>
+
+ <p class="portlet-class">Are you sure you want to
proceed?</p>
+
+ <h:form>
+ <h:commandLink value="Delete consumer"
action="#{consumersMgr.destroyConsumer}"
+ styleClass="portlet-form-button
portlet-section-buttonrow">
+ <f:param name="id"
value="#{consumersMgr.selectedConsumer.producerId}"/>
+ </h:commandLink>
+ <h:commandButton value="Cancel"
action="#{consumersMgr.listConsumers}"
+ styleClass="portlet-form-button
portlet-section-buttonrow"/>
+ </h:form>
+ </div>
+ </div>
+
+ </ui:define>
+
+</ui:decorate>
\ No newline at end of file
Added:
branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/consumers/confirmEraseRegistration.xhtml
===================================================================
---
branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/consumers/confirmEraseRegistration.xhtml
(rev 0)
+++
branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/consumers/confirmEraseRegistration.xhtml 2007-11-27
03:07:34 UTC (rev 9120)
@@ -0,0 +1,39 @@
+<ui:decorate template="consumerTemplate.xhtml"
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:jbp="http://www.jboss.org/portal"
+
xmlns:c="http://java.sun.com/jstl/core">
+
+ <ui:param name="title" value=""/>
+ <ui:define name="content">
+
+ <div class="portlet-msg">
+ <div class="portlet-msg-icon"><h:graphicImage
url="/img/msgIcon_Warning.gif" alt="/!\"/></div>
+ <div class="portlet-msg-body">
+ <h3>Delete local registration for '#{consumer.id}'
consumer?</h3>
+
+ <p class="portlet-msg-alert">
+ You are about to delete the local registration information for the
'#{consumer.id}' consumer!
+ This is only needed if this consumer had previously registered with the
remote producer and this producer
+ has been modified to not require registration
anymore.<br/><br/>
+
+ Only erase local registration information if you experience errors with
the producer due to this
+ particular situation. Erasing local registration when not required might
lead to inability to work with
+ this producer anymore.
+ </p>
+
+ <p class="portlet-class">Are you sure you want to
proceed?</p>
+
+ <h:form>
+ <h:commandButton value="Erase local registration"
action="#{consumer.eraseLocalRegistration}"
+ styleClass="portlet-form-button
portlet-section-buttonrow"/>
+ <h:commandButton value="Cancel"
action="configureConsumer"
+ styleClass="portlet-form-button
portlet-section-buttonrow"/>
+ </h:form>
+ </div>
+ </div>
+
+ </ui:define>
+
+</ui:decorate>
\ 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/consumers.xhtml
===================================================================
---
branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/consumers/consumers.xhtml 2007-11-27
01:39:35 UTC (rev 9119)
+++
branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/consumers/consumers.xhtml 2007-11-27
03:07:34 UTC (rev 9120)
@@ -63,7 +63,8 @@
<f:param name="register"
value="#{!consumer.producerInfo.registered}"/>
<h:outputText
value="#{consumer.producerInfo.registered ? 'Deregister' :
'Register'}"/>
</h:commandLink>
- </c:if> | <h:commandLink
action="#{consumersMgr.destroyConsumer}"
styleClass="actionDelete">
+ </c:if> | <h:commandLink
action="confirmDeleteConsumer" styleClass="actionDelete"
+
actionListener="#{consumersMgr.selectConsumer}">
<f:param name="id"
value="#{consumer.producerId}"/>
<h:outputText value="Delete"/>
</h:commandLink>
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-11-27
01:39:35 UTC (rev 9119)
+++
branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/consumers/editConsumer.xhtml 2007-11-27
03:07:34 UTC (rev 9120)
@@ -117,7 +117,7 @@
<th>Registration context:</th>
<td id="handle">
Handle: <h:outputText
value="#{consumer.producerInfo.registrationInfo.registrationHandle}"/>
- <h:commandLink action="#{consumer.eraseLocalRegistration}"
value="Erase local registration"
+ <h:commandLink action="confirmEraseRegistration"
value="Erase local registration"
title="Erase local registration information (potentially
dangerous!)"
styleClass="portlet-form-button"/>
</td>
Added:
branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/producer/confirmPropDeletion.xhtml
===================================================================
---
branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/producer/confirmPropDeletion.xhtml
(rev 0)
+++
branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/producer/confirmPropDeletion.xhtml 2007-11-27
03:07:34 UTC (rev 9120)
@@ -0,0 +1,35 @@
+<ui:decorate template="producerTemplate.xhtml"
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:jbp="http://www.jboss.org/portal"
+
xmlns:c="http://java.sun.com/jstl/core">
+
+ <ui:param name="title" value=""/>
+ <ui:define name="content">
+
+ <div class="portlet-msg">
+ <div class="portlet-msg-icon"><h:graphicImage
url="/img/msgIcon_Warning.gif" alt="/!\"/></div>
+ <div class="portlet-msg-body">
+ <h3>Delete '#{producer.selectedPropertyName}' registration
property description?</h3>
+
+ <p class="portlet-msg-alert">
+ You are about to delete the '#{producer.selectedPropertyName}'
registration property description!
+ This will trigger invalidation of consumer registrations which will have
to modify their registration
+ information.
+ </p>
+
+ <p class="portlet-class">Are you sure you want to
proceed?</p>
+
+ <h:form>
+ <h:commandButton value="Delete"
action="#{producer.deleteRegistrationProperty}"
+ styleClass="portlet-form-button
portlet-section-buttonrow"/>
+ <h:commandButton value="Cancel" action="producer"
+ styleClass="portlet-form-button
portlet-section-buttonrow"/>
+ </h:form>
+ </div>
+ </div>
+
+ </ui:define>
+
+</ui:decorate>
\ No newline at end of file
Modified:
branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/producer/producer.xhtml
===================================================================
---
branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/producer/producer.xhtml 2007-11-27
01:39:35 UTC (rev 9119)
+++
branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/producer/producer.xhtml 2007-11-27
03:07:34 UTC (rev 9120)
@@ -12,12 +12,15 @@
<h:selectBooleanCheckbox
value="#{producer.registrationRequiredForFullDescription}"/>
<h:outputText value="Access to full service description requires
consumers to be registered."/>
- <h:selectBooleanCheckbox
value="#{producer.registrationRequired}"/>
- <h:outputText value="Requires registration."/>
+ <h:selectBooleanCheckbox
value="#{producer.registrationRequired}" immediate="true"
+ onchange="this.form.submit()"
+
valueChangeListener="#{producer.requireRegistrationListener}"/>
+ <h:outputText
+ value="Requires registration. Modifying this information will trigger
invalidation of consumer registrations."/>
<h:outputText value=" "
rendered="#{producer.registrationRequired}"/>
- <h:panelGroup>
- <h:panelGrid columns="2"
rendered="#{producer.registrationRequired}" width="100%">
+ <h:panelGroup rendered="#{producer.registrationRequired}">
+ <h:panelGrid columns="2" width="100%">
<h:outputLabel value="Registration policy class name:"
for="registrationPolicy"/>
<h:inputText id="registrationPolicy"
value="#{producer.registrationPolicyClassName}" size="80"/>
@@ -57,6 +60,14 @@
<f:facet
name="header">Hint</f:facet>
<h:inputText value="#{property.hint}"
size="50"/>
</h:column>
+ <h:column>
+ <f:facet
name="header">Action</f:facet>
+ <h:commandLink action="confirmPropDeletion"
value="Remove"
+ styleClass="portlet-form-button"
+
actionListener="#{producer.selectProperty}">
+ <f:param name="propName"
value="#{property.nameAsString}"/>
+ </h:commandLink>
+ </h:column>
</h:dataTable>
</c:when>
<c:otherwise>
@@ -69,7 +80,11 @@
</h:panelGroup>
<h:outputText value=" "/>
- <h:commandButton action="#{producer.save}"
value="Save" styleClass="portlet-form-button"/>
+ <h:panelGroup styleClass="portlet-section-buttonrow">
+ <h:commandButton action="#{producer.save}"
value="Save" styleClass="portlet-form-button"/>
+ <h:commandButton action="#{producer.reloadConfiguration}"
value="Cancel"
+ styleClass="portlet-form-button"/>
+ </h:panelGroup>
</h:panelGrid>
</h:form>
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-11-27
01:39:35 UTC (rev 9119)
+++
branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/style.css 2007-11-27
03:07:34 UTC (rev 9120)
@@ -321,4 +321,18 @@
padding: 4px;
margin: 0;
display: block;
-}
\ No newline at end of file
+}
+
+.wsrp-consumers-ui .portlet-msg {
+ border: 1px solid #bbb;
+ margin: 2em auto;
+ padding: 1em;
+ width: 60%;
+}
+
+.wsrp-consumers-ui .portlet-msg-body {
+ position: relative;
+ top: -3em;
+ left: 3em;
+ width: 95%;
+}