Author: chris.laprun(a)jboss.com
Date: 2007-03-15 15:58:37 -0400 (Thu, 15 Mar 2007)
New Revision: 6694
Modified:
trunk/wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ConsumerManagerBean.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ConsumerRegistryService.java
trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/faces-config.xml
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:
- More consumer configuration GUI: fixed de/activate and back button on consumer
configuration page.
- Fixed ConsumerRegistryService.startOrStopConsumer.
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-03-15
19:25:36 UTC (rev 6693)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ConsumerManagerBean.java 2007-03-15
19:58:37 UTC (rev 6694)
@@ -75,13 +75,15 @@
{
registry.deactivateConsumerWith(selectedId);
}
+
+ return listConsumers();
}
else
{
// todo: error message
}
- return "index";
+ return null;
}
public String registerConsumer()
@@ -118,6 +120,11 @@
return null;
}
+ public String listConsumers()
+ {
+ return "index";
+ }
+
private String refreshConsumerId()
{
selectedId = getParameter("id");
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ConsumerRegistryService.java
===================================================================
---
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ConsumerRegistryService.java 2007-03-15
19:25:36 UTC (rev 6693)
+++
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ConsumerRegistryService.java 2007-03-15
19:58:37 UTC (rev 6694)
@@ -28,7 +28,9 @@
import org.hibernate.SessionFactory;
import org.jboss.portal.common.util.ParameterValidation;
import org.jboss.portal.jems.as.system.AbstractJBossService;
+import org.jboss.portal.portlet.PortletInvoker;
import org.jboss.portal.portlet.PortletInvokerException;
+import org.jboss.portal.portlet.federation.FederatedPortletInvoker;
import org.jboss.portal.portlet.federation.FederatingPortletInvoker;
import org.jboss.portal.wsrp.WSRPConsumer;
import org.jboss.portal.wsrp.deployment.WSRPConsumerService;
@@ -259,26 +261,45 @@
private void startOrStopConsumer(String id, boolean start)
{
- WSRPConsumer consumer = getConsumer(id);
+ WSRPConsumer consumer;
- if (consumer == null)
- {
- throw new ConsumerException("Consumer with id '" + id +
"' doesn't exist!");
- }
-
- WSRPConsumerService service = new WSRPConsumerService();
- service.setConsumer(consumer);
- service.setFederatingPortletInvoker(federatingPortletInvoker);
-
try
{
if (start)
{
+ consumer = getConsumer(id);
+
+ if (consumer == null)
+ {
+ throw new IllegalArgumentException("Consumer with id '" + id
+ "' doesn't exist!");
+ }
+
+ WSRPConsumerService service = new WSRPConsumerService();
+ service.setConsumer(consumer);
+ service.setFederatingPortletInvoker(federatingPortletInvoker);
service.start();
}
else
{
- service.stop();
+ FederatedPortletInvoker fedInvoker =
federatingPortletInvoker.getFederatedInvoker(id);
+ if (fedInvoker != null)
+ {
+ PortletInvoker invoker = fedInvoker.getPortletInvoker();
+ if (invoker instanceof WSRPConsumer)
+ {
+ consumer = (WSRPConsumer)invoker;
+ federatingPortletInvoker.unregisterInvoker(id);
+ consumer.stop();
+ }
+ else
+ {
+ throw new IllegalArgumentException("PortletInvoker with id
'" + id + "' is not a WSRPConsumer!");
+ }
+ }
+ else
+ {
+ throw new IllegalArgumentException("There is no registered
PortletInvoker with id '" + id + "'");
+ }
}
}
catch (Exception e)
@@ -287,6 +308,6 @@
}
// update ProducerInfo
- updateProducerInfo(service.getConsumer().getProducerInfo());
+ updateProducerInfo(consumer.getProducerInfo());
}
}
Modified: trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/faces-config.xml
===================================================================
--- trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/faces-config.xml 2007-03-15 19:25:36
UTC (rev 6693)
+++ trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/faces-config.xml 2007-03-15 19:58:37
UTC (rev 6694)
@@ -52,13 +52,5 @@
<from-outcome>configureConsumer</from-outcome>
<to-view-id>/WEB-INF/jsf/consumers/editConsumer.xhtml</to-view-id>
</navigation-case>
- </navigation-rule>
-
- <navigation-rule>
- <from-view-id>/WEB-INF/jsf/consumers/editConsumer.xhtml</from-view-id>
- <navigation-case>
- <from-outcome>index</from-outcome>
- <to-view-id>/WEB-INF/jsf/consumers/consumers.xhtml</to-view-id>
- </navigation-case>
- </navigation-rule>
+ </navigation-rule>
</faces-config>
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-03-15
19:25:36 UTC (rev 6693)
+++
trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/jsf/consumers/consumers.xhtml 2007-03-15
19:58:37 UTC (rev 6694)
@@ -39,7 +39,7 @@
</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"}'/>
+ <h:outputText value="#{consumer.producerInfo.active ?
'Deactivate' : 'Activate'}"/>
</h:commandLink>
<c:if test="#{consumer.producerInfo.active}"> |
<h:commandLink
action="#{consumersMgr.registerConsumer}">
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-03-15
19:25:36 UTC (rev 6693)
+++
trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/jsf/consumers/editConsumer.xhtml 2007-03-15
19:58:37 UTC (rev 6694)
@@ -101,7 +101,7 @@
</table>
<hr/>
+</h:form>
- <h:commandButton action="index" value="Back"/>
-</h:form>
+<h:form><h:commandButton action="#{consumersMgr.listConsumers}"
value="Back"/></h:form>
</div>
\ No newline at end of file
Show replies by date