Author: chris.laprun(a)jboss.com
Date: 2009-01-28 19:03:31 -0500 (Wed, 28 Jan 2009)
New Revision: 12693
Modified:
branches/JBoss_Portal_Branch_2_7/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ConsumerManagerBean.java
branches/JBoss_Portal_Branch_2_7/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/classes/Resource.properties
branches/JBoss_Portal_Branch_2_7/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/classes/Resource_fr.properties
branches/JBoss_Portal_Branch_2_7/core-wsrp/src/resources/portal-wsrp-admin-war/jsf/consumers/consumers.xhtml
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/test/wsrp/framework/support/MockConsumerRegistry.java
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/consumer/ConsumerRegistry.java
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/consumer/ConsumerRegistryService.java
Log:
- JBPORTAL-2287: Added possibility to reload the consumers from the database.
Modified:
branches/JBoss_Portal_Branch_2_7/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ConsumerManagerBean.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ConsumerManagerBean.java 2009-01-28
23:55:56 UTC (rev 12692)
+++
branches/JBoss_Portal_Branch_2_7/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ConsumerManagerBean.java 2009-01-29
00:03:31 UTC (rev 12693)
@@ -86,11 +86,22 @@
return registry.getConsumer(selectedId);
}
+ public boolean isConsumersEmpty()
+ {
+ return registry.getConfiguredConsumers().isEmpty();
+ }
+
public List<WSRPConsumer> getConsumers()
{
return registry.getConfiguredConsumers();
}
+ public String reload()
+ {
+ registry.reloadConsumers();
+ return CONSUMERS;
+ }
+
public String activateConsumer()
{
if (refreshConsumerId() != null)
Modified:
branches/JBoss_Portal_Branch_2_7/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/classes/Resource.properties
===================================================================
---
branches/JBoss_Portal_Branch_2_7/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/classes/Resource.properties 2009-01-28
23:55:56 UTC (rev 12692)
+++
branches/JBoss_Portal_Branch_2_7/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/classes/Resource.properties 2009-01-29
00:03:31 UTC (rev 12693)
@@ -1,6 +1,6 @@
################################################################################
# JBoss, a division of Red Hat #
-# Copyright 2008, Red Hat Middleware, LLC, and individual #
+# Copyright 2009, Red Hat Middleware, LLC, and individual #
# contributors as indicated by the @authors tag. See the #
# copyright.txt in the distribution for a full listing of #
# individual contributors. #
@@ -21,43 +21,8 @@
# 02110-1301 USA, or see the FSF site:
http://www.fsf.org. #
################################################################################
-## WSRP GUI localization
+delete_registration_cancel = Cancel
-# JBoss Portal display information
-org.jboss.portal.object.name.WSRPConfigurationPortlet = WSRP Configuration
-org.jboss.portal.instance.name.WSRPConfigurationPortletInstance = WSRP Configuration
Portlet
-
-# Tabs
-nav_tabs_consumers = Consumers Configuration
-nav_tabs_producer_config = Producer Configuration
-nav_tabs_producer_management = Producer Management
-
-# Object path in consumer template
-path_consumers_root = Consumers
-path_consumers_consumer = Consumer ''{0}'' configuration
-path_consumers_active = active
-path_consumers_inactive = inactive
-path_consumers_refreshNeeded = (refresh needed)
-
-# Confirm deletion of a consumer screen
-confirm_delete_consumer_title = Delete ''{0}'' consumer?
-confirm_delete_consumer_message = You are about to delete the ''{0}''
consumer!
-confirm_detete_consumer_proceed = Are you sure you want to proceed?
-confirm_delete_consumer_submit = Delete consumer
-confirm_delete_consumer_cancel = Cancel
-
-# Confirm deletion of local registration information screen
-confirm_delete_registration_title = Delete local registration for ''{0}''
consumer?
-confirm_delete_registration_message = You are about to delete the local registration
information for the ''{0}'' consumer! \n\
-This is only needed if this consumer had previously registered with the remote producer
and this producer \n\
-has been modified to not require registration anymore. \n\
-Only erase local registration information if you experience errors with the producer due
to this \n\
-particular situation. Erasing local registration when not required might lead to
inability to work with \n\
-this producer anymore.
-confirm_delete_registration_proceed = Are you sure you want to proceed?
-confirm_delete_registration_submit = Erase local registration
-confirm_delete_registration_cancel = Cancel
-
# Consumers screen
consumers_title = Manage Consumers
consumers_create_title = Create a consumer named:
@@ -74,6 +39,7 @@
consumers_table_action_register = Register
consumers_table_action_deregister = Deregister
consumers_table_action_delete = Delete
+consumers_table_reload = Reload consumers
# Consumer editing screen
edit_consumer_producer = Producer id:
@@ -172,4 +138,6 @@
registration_property_status_missing_value = Missing value
registration_property_status_unchecked_value = Undetermined status
registration_property_status_invalid_value = Invalid value
-registration_property_status_valid = Valid
\ No newline at end of file
+registration_property_status_valid = Valid
+
+org.jboss.portal.object.name.admin.WSRP=WSRP
\ No newline at end of file
Modified:
branches/JBoss_Portal_Branch_2_7/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/classes/Resource_fr.properties
===================================================================
---
branches/JBoss_Portal_Branch_2_7/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/classes/Resource_fr.properties 2009-01-28
23:55:56 UTC (rev 12692)
+++
branches/JBoss_Portal_Branch_2_7/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/classes/Resource_fr.properties 2009-01-29
00:03:31 UTC (rev 12693)
@@ -1,6 +1,6 @@
################################################################################
# JBoss, a division of Red Hat #
-# Copyright 2008, Red Hat Middleware, LLC, and individual #
+# Copyright 2009, Red Hat Middleware, LLC, and individual #
# contributors as indicated by the @authors tag. See the #
# copyright.txt in the distribution for a full listing of #
# individual contributors. #
@@ -18,37 +18,10 @@
# You should have received a copy of the GNU Lesser General Public #
# License along with this software; if not, write to the Free #
# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA #
-# 02110-1301 USA, or see the FSF site:
http://www.fsf.org. #
`
+# 02110-1301 USA, or see the FSF site:
http://www.fsf.org. #
################################################################################
-# JBoss Portal display information
-org.jboss.portal.object.name.WSRPConfigurationPortlet = Configuration WSRP
-org.jboss.portal.instance.name.WSRPConfigurationPortletInstance = Portlet de
Configuration pour WSRP
-nav_tabs_consumers = Configuration Consommateurs
-nav_tabs_producer_config = Configuration Producteur
-nav_tabs_producer_management = Gestion Producteur
-
-path_consumers_root = Consommateurs
-path_consumers_consumer = Configuration du consommateur ''{0}''
-path_consumers_active = actif
-path_consumers_inactive = inactif
-path_consumers_refreshNeeded = (rafra\u00eechissement requis)
-confirm_delete_consumer_cancel=Annuler
-confirm_delete_consumer_message=Vous \u00eates sur le point d''effacer le
concommateur ''{0}''!
-confirm_delete_consumer_submit=Effacer consommateur
-confirm_delete_consumer_title=Voulez-vous r\u00e9ellement effacer le consommateur
''{0}''?
-confirm_detete_consumer_proceed=\u00cates-vous certains de vouloir proc\u00e9der?
-confirm_delete_registration_cancel=Annuler
-confirm_delete_registration_message=Vous \u00eates sur le point d''effacer les
informations locales d''enregistrement pour le consommateur
''{0}''! \n\
-Ceci n''est uniquement requis dans le cas o\u00f9 ce consommateur se serait
enregistr\u00e9 aupr\u00e8s d''un producteur distant \n\
-qui aurait ensuite \u00e9t\u00e9 modifi\u00e9 pour ne plus requerir
d''enregistrement. \n\
-N''effacez les informations locales d''enregistrement que si vous
rencontrez des probl\u00e8mes, sp\u00e9cifiques \u00e0 cette \n\
-situation, avec le producteur distant. Effacer les donn\u00e9es d''enregistrement
quand ce n''est pas requis peut entra\u00eener \n\
-l''incapacit\u00e9 future d''acc\u00e9der \u00e0 ce producteur.
-confirm_delete_registration_proceed=\u00cates-vous certains de vouloir proc\u00e9der?
-confirm_delete_registration_submit=Effacer enregistrement
-confirm_delete_registration_title=Voulez-vous r\u00e9ellement effacer
l''enregistrement du consommateur ''{0}''?
-consumers_create_submit=Cr\u00e9er Consommateur
+ommateur
consumers_create_title=Cr\u00e9er un consommateur nomm\u00e9:
consumers_table_action_activate=Activer
consumers_table_action_configure=Configurer
@@ -142,4 +115,6 @@
registration_property_status_missing=Manquant
registration_property_status_missing_value=Valeur manquante
registration_property_status_unchecked_value=Status ind\u00e9termin\u00e9
-registration_property_status_valid=Valide
\ No newline at end of file
+registration_property_status_valid=Valide
+org.jboss.portal.object.name.admin.WSRP=WSRP
+consumers_table_reload=Recharger consommateurs
\ No newline at end of file
Modified:
branches/JBoss_Portal_Branch_2_7/core-wsrp/src/resources/portal-wsrp-admin-war/jsf/consumers/consumers.xhtml
===================================================================
---
branches/JBoss_Portal_Branch_2_7/core-wsrp/src/resources/portal-wsrp-admin-war/jsf/consumers/consumers.xhtml 2009-01-28
23:55:56 UTC (rev 12692)
+++
branches/JBoss_Portal_Branch_2_7/core-wsrp/src/resources/portal-wsrp-admin-war/jsf/consumers/consumers.xhtml 2009-01-29
00:03:31 UTC (rev 12693)
@@ -1,3 +1,26 @@
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2009, Red Hat Middleware, LLC, and individual
+ ~ contributors as indicated by the @authors tag. See the
+ ~ copyright.txt in the distribution for a full listing of
+ ~ individual contributors.
+ ~
+ ~ This is free software; you can redistribute it and/or modify it
+ ~ under the terms of the GNU Lesser General Public License as
+ ~ published by the Free Software Foundation; either version 2.1 of
+ ~ the License, or (at your option) any later version.
+ ~
+ ~ This software is distributed in the hope that it will be useful,
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ ~ Lesser General Public License for more details.
+ ~
+ ~ You should have received a copy of the GNU Lesser General Public
+ ~ License along with this software; if not, write to the Free
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ ~ 02110-1301 USA, or see the FSF site:
http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
<ui:decorate template="consumerTemplate.xhtml"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
@@ -18,16 +41,20 @@
<h:message for="consumerName"
errorClass="portlet-msg-error"/>
</h:form>
+ <br/>
+
<!-- Consumers list -->
<h:form id="consumer-list-form">
- <h:dataTable id="consumersList"
value="#{consumersMgr.consumers}" var="cons" rendered="#{!empty
consumersMgr.consumers}"
+ <h:dataTable id="consumersList"
value="#{consumersMgr.consumers}" var="cons"
+ rendered="#{!consumersMgr.consumersEmpty}"
rowClasses="portlet-section-body,portlet-section-alternate"
headerClass="portlet-section-header"
styleClass="datatable objectList"
width="100%">
<h:column>
<f:facet name="header">
#{i18n.consumers_table_column_consumer}
<div style="font-size: 90%; display:inline; font-weight:
normal;">
- [#{i18n.consumers_table_column_consumer_status} <span
class="active">#{i18n.path_consumers_active}</span>,
+ [#{i18n.consumers_table_column_consumer_status} <span
+
class="active">#{i18n.path_consumers_active}</span>,
<span
class="inactive">#{i18n.path_consumers_inactive}</span>,
<span
class="needsRefresh">#{i18n.path_consumers_refreshNeeded}</span>]
</div>
@@ -50,13 +77,14 @@
<f:param name="id"
value="#{cons.producerId}"/>
#{i18n.consumers_table_action_refresh}
</h:commandLink> |
- <h:commandLink action="#{consumersMgr.activateConsumer}"
id="activate"
+ <h:commandLink action="#{consumersMgr.activateConsumer}"
id="activate"
styleClass="#{cons.active ? 'actionDeactivate'
: 'actionActivate'}">
<f:param name="id"
value="#{cons.producerId}"/>
<f:param name="activate"
value="#{!cons.active}"/>
#{cons.active ? i18n.consumers_table_action_deactivate :
i18n.consumers_table_action_activate}
</h:commandLink>
- <h:panelGroup rendered="#{!cons.refreshNeeded and cons.active and
cons.producerInfo.registrationRequired}">
+ <h:panelGroup
+ rendered="#{!cons.refreshNeeded and cons.active and
cons.producerInfo.registrationRequired}">
|
<h:commandLink action="#{consumersMgr.registerConsumer}"
id="register"
styleClass="action#{cons.producerInfo.registered ?
'Deregister' : 'Register'}">
@@ -65,7 +93,7 @@
#{cons.producerInfo.registered ?
i18n.consumers_table_action_deregister : i18n.consumers_table_action_register}
</h:commandLink>
</h:panelGroup> |
- <h:commandLink action="confirmDeleteConsumer"
styleClass="actionDelete" id="delete"
+ <h:commandLink action="confirmDeleteConsumer"
styleClass="actionDelete" id="delete"
actionListener="#{consumersMgr.selectConsumer}">
<f:param name="id"
value="#{cons.producerId}"/>
#{i18n.consumers_table_action_delete}
@@ -73,5 +101,10 @@
</h:column>
</h:dataTable>
</h:form>
+
+ <h:form>
+ <h:commandButton id="createConsumerButton"
action="#{consumersMgr.reload}"
+ value="#{i18n.consumers_table_reload}"
styleClass="portlet-form-button"/>
+ </h:form>
</ui:define>
</ui:decorate>
\ No newline at end of file
Modified:
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/test/wsrp/framework/support/MockConsumerRegistry.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/test/wsrp/framework/support/MockConsumerRegistry.java 2009-01-28
23:55:56 UTC (rev 12692)
+++
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/test/wsrp/framework/support/MockConsumerRegistry.java 2009-01-29
00:03:31 UTC (rev 12693)
@@ -1,6 +1,6 @@
/******************************************************************************
* JBoss, a division of Red Hat *
- * Copyright 2007, Red Hat Middleware, LLC, and individual *
+ * Copyright 2009, Red Hat Middleware, LLC, and individual *
* contributors as indicated by the @authors tag. See the *
* copyright.txt in the distribution for a full listing of *
* individual contributors. *
@@ -56,13 +56,7 @@
*/
public MockConsumerRegistry()
{
- consumers.put(CONSUMER1, new MockWSRPConsumer(CONSUMER1));
- MockWSRPConsumer consumer = new MockWSRPConsumer(CONSUMER2);
- consumer.getProducerInfo().setActive(true);
- EndpointConfigurationInfo info =
consumer.getProducerInfo().getEndpointConfigurationInfo();
- info.setServiceDescriptionURL(MOCK_SERVICE_DESCRIPTION);
- info.setMarkupURL(MOCK_MARKUP);
- consumers.put(CONSUMER2, consumer);
+ reloadConsumers();
}
public List<WSRPConsumer> getConfiguredConsumers()
@@ -118,4 +112,16 @@
{
// do nothing
}
+
+ public void reloadConsumers()
+ {
+ consumers.clear();
+ consumers.put(CONSUMER1, new MockWSRPConsumer(CONSUMER1));
+ MockWSRPConsumer consumer = new MockWSRPConsumer(CONSUMER2);
+ consumer.getProducerInfo().setActive(true);
+ EndpointConfigurationInfo info =
consumer.getProducerInfo().getEndpointConfigurationInfo();
+ info.setServiceDescriptionURL(MOCK_SERVICE_DESCRIPTION);
+ info.setMarkupURL(MOCK_MARKUP);
+ consumers.put(CONSUMER2, consumer);
+ }
}
Modified:
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/consumer/ConsumerRegistry.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/consumer/ConsumerRegistry.java 2009-01-28
23:55:56 UTC (rev 12692)
+++
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/consumer/ConsumerRegistry.java 2009-01-29
00:03:31 UTC (rev 12693)
@@ -1,24 +1,25 @@
-/*
-* JBoss, a division of Red Hat
-* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2009, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
package org.jboss.portal.wsrp.consumer;
@@ -60,4 +61,6 @@
void registerOrDeregisterConsumerWith(String id, boolean register) throws
ConsumerException;
void destroyConsumer(String id) throws ConsumerException;
+
+ void reloadConsumers();
}
\ No newline at end of file
Modified:
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/consumer/ConsumerRegistryService.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/consumer/ConsumerRegistryService.java 2009-01-28
23:55:56 UTC (rev 12692)
+++
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/consumer/ConsumerRegistryService.java 2009-01-29
00:03:31 UTC (rev 12693)
@@ -1,6 +1,6 @@
/******************************************************************************
* JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * Copyright 2009, Red Hat Middleware, LLC, and individual *
* contributors as indicated by the @authors tag. See the *
* copyright.txt in the distribution for a full listing of *
* individual contributors. *
@@ -262,7 +262,11 @@
{
InitialContext initialContext = new InitialContext();
sessionFactory = (SessionFactory)initialContext.lookup(sessionFactoryJNDIName);
+ reloadConsumers();
+ }
+ public void reloadConsumers()
+ {
// load the configured consumers
consumers = new TreeMap<String, WSRPConsumer>();