JBoss Portal SVN: r12700 - modules/cms/tags/JBP_CMS_1_2_4/build.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2009-01-29 11:30:25 -0500 (Thu, 29 Jan 2009)
New Revision: 12700
Modified:
modules/cms/tags/JBP_CMS_1_2_4/build/pom.xml
Log:
oups
Modified: modules/cms/tags/JBP_CMS_1_2_4/build/pom.xml
===================================================================
--- modules/cms/tags/JBP_CMS_1_2_4/build/pom.xml 2009-01-29 16:28:55 UTC (rev 12699)
+++ modules/cms/tags/JBP_CMS_1_2_4/build/pom.xml 2009-01-29 16:30:25 UTC (rev 12700)
@@ -29,7 +29,7 @@
<version.log4j>1.2.14</version.log4j>
<version.slf4j>1.3.0</version.slf4j>
<version.jboss.cache>1.4.1.SP3</version.jboss.cache>
- <version.jgroups>>2.4.4.GA-brew</version.jgroups>
+ <version.jgroups>2.4.4.GA-brew</version.jgroups>
<version.jboss.hibernate>3.2.4.SP1</version.jboss.hibernate>
<version.jbpm>3.2.2</version.jbpm>
<version.jboss.jbossas>4.2.2.GA</version.jboss.jbossas>
15 years, 3 months
JBoss Portal SVN: r12699 - in modules/cms/tags/JBP_CMS_1_2_4: build and 1 other directories.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2009-01-29 11:28:55 -0500 (Thu, 29 Jan 2009)
New Revision: 12699
Modified:
modules/cms/tags/JBP_CMS_1_2_4/build/pom.xml
modules/cms/tags/JBP_CMS_1_2_4/cms-jackrabbit/pom.xml
modules/cms/tags/JBP_CMS_1_2_4/pom.xml
Log:
1.2.4
Modified: modules/cms/tags/JBP_CMS_1_2_4/build/pom.xml
===================================================================
--- modules/cms/tags/JBP_CMS_1_2_4/build/pom.xml 2009-01-29 16:26:57 UTC (rev 12698)
+++ modules/cms/tags/JBP_CMS_1_2_4/build/pom.xml 2009-01-29 16:28:55 UTC (rev 12699)
@@ -18,7 +18,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.portal.cms</groupId>
<artifactId>module-parent</artifactId>
- <version>trunk-SNAPSHOT</version>
+ <version>1.2.4</version>
<packaging>pom</packaging>
<name>JBoss Portal CMS</name>
<url>http://www.jboss.com/products/jbossmc</url>
Modified: modules/cms/tags/JBP_CMS_1_2_4/cms-jackrabbit/pom.xml
===================================================================
--- modules/cms/tags/JBP_CMS_1_2_4/cms-jackrabbit/pom.xml 2009-01-29 16:26:57 UTC (rev 12698)
+++ modules/cms/tags/JBP_CMS_1_2_4/cms-jackrabbit/pom.xml 2009-01-29 16:28:55 UTC (rev 12699)
@@ -5,7 +5,7 @@
<groupId>org.jboss.portal.cms</groupId>
<artifactId>module-parent</artifactId>
<relativePath>../build/pom.xml</relativePath>
- <version>trunk-SNAPSHOT</version>
+ <version>1.2.4</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>cms-jackrabbit</artifactId>
Modified: modules/cms/tags/JBP_CMS_1_2_4/pom.xml
===================================================================
--- modules/cms/tags/JBP_CMS_1_2_4/pom.xml 2009-01-29 16:26:57 UTC (rev 12698)
+++ modules/cms/tags/JBP_CMS_1_2_4/pom.xml 2009-01-29 16:28:55 UTC (rev 12699)
@@ -5,7 +5,7 @@
<artifactId>module-aggregator</artifactId>
<packaging>pom</packaging>
<name>JBoss Portal CMS Module</name>
- <version>trunk-SNAPSHOT</version>
+ <version>1.2.4</version>
<url>http://labs.jboss.com/jbossportal</url>
<dependencies/>
15 years, 3 months
JBoss Portal SVN: r12698 - modules/cms/tags.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2009-01-29 11:26:57 -0500 (Thu, 29 Jan 2009)
New Revision: 12698
Added:
modules/cms/tags/JBP_CMS_1_2_4/
Log:
Tagging CMS 1.2.4
Copied: modules/cms/tags/JBP_CMS_1_2_4 (from rev 12697, modules/cms/trunk)
15 years, 3 months
JBoss Portal SVN: r12697 - modules/cms/trunk/build.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2009-01-29 11:25:46 -0500 (Thu, 29 Jan 2009)
New Revision: 12697
Modified:
modules/cms/trunk/build/pom.xml
Log:
use correct versions
Modified: modules/cms/trunk/build/pom.xml
===================================================================
--- modules/cms/trunk/build/pom.xml 2009-01-29 12:58:27 UTC (rev 12696)
+++ modules/cms/trunk/build/pom.xml 2009-01-29 16:25:46 UTC (rev 12697)
@@ -29,7 +29,7 @@
<version.log4j>1.2.14</version.log4j>
<version.slf4j>1.3.0</version.slf4j>
<version.jboss.cache>1.4.1.SP3</version.jboss.cache>
- <version.jgroups>2.4.1</version.jgroups>
+ <version.jgroups>>2.4.4.GA-brew</version.jgroups>
<version.jboss.hibernate>3.2.4.SP1</version.jboss.hibernate>
<version.jbpm>3.2.2</version.jbpm>
<version.jboss.jbossas>4.2.2.GA</version.jboss.jbossas>
@@ -44,10 +44,10 @@
<version.ehcache>1.4.1</version.ehcache>
<version.javax.jcr>1.0</version.javax.jcr>
<version.jackrabbit.core>1.4.5</version.jackrabbit.core>
- <version.jboss.portal.common>1.2.0</version.jboss.portal.common>
- <version.jboss.portal.identity>1.0.2</version.jboss.portal.identity>
- <version.jboss.portal.test>1.2.1</version.jboss.portal.test>
- <version.jboss.portal>2.7.0.CR1</version.jboss.portal>
+ <version.jboss.portal.common>1.2.3</version.jboss.portal.common>
+ <version.jboss.portal.identity>1.0.6</version.jboss.portal.identity>
+ <version.jboss.portal.test>1.2.2</version.jboss.portal.test>
+ <version.jboss.portal>2.7.1.GA</version.jboss.portal>
</properties>
15 years, 3 months
JBoss Portal SVN: r12696 - in branches/Enterprise_Portal_Platform_4_3: core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/classes and 3 other directories.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2009-01-29 07:58:27 -0500 (Thu, 29 Jan 2009)
New Revision: 12696
Modified:
branches/Enterprise_Portal_Platform_4_3/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ConsumerManagerBean.java
branches/Enterprise_Portal_Platform_4_3/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/classes/Resource.properties
branches/Enterprise_Portal_Platform_4_3/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/classes/Resource_fr.properties
branches/Enterprise_Portal_Platform_4_3/core-wsrp/src/resources/portal-wsrp-admin-war/jsf/consumers/consumers.xhtml
branches/Enterprise_Portal_Platform_4_3/wsrp/src/main/org/jboss/portal/test/wsrp/framework/support/MockConsumerRegistry.java
branches/Enterprise_Portal_Platform_4_3/wsrp/src/main/org/jboss/portal/wsrp/consumer/ConsumerRegistry.java
branches/Enterprise_Portal_Platform_4_3/wsrp/src/main/org/jboss/portal/wsrp/consumer/ConsumerRegistryService.java
branches/Enterprise_Portal_Platform_4_3/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java
Log:
- JBPORTAL-2284: Fixed error in eraseRegistrationInfo, removed checks for null RegistrationInfo as it never is null now.
- JBPORTAL-2287: Added possibility to reload the consumers from the database.
Modified: branches/Enterprise_Portal_Platform_4_3/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ConsumerManagerBean.java
===================================================================
--- branches/Enterprise_Portal_Platform_4_3/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ConsumerManagerBean.java 2009-01-29 01:25:15 UTC (rev 12695)
+++ branches/Enterprise_Portal_Platform_4_3/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ConsumerManagerBean.java 2009-01-29 12:58:27 UTC (rev 12696)
@@ -83,11 +83,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/Enterprise_Portal_Platform_4_3/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/classes/Resource.properties
===================================================================
--- branches/Enterprise_Portal_Platform_4_3/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/classes/Resource.properties 2009-01-29 01:25:15 UTC (rev 12695)
+++ branches/Enterprise_Portal_Platform_4_3/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/classes/Resource.properties 2009-01-29 12:58:27 UTC (rev 12696)
@@ -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/Enterprise_Portal_Platform_4_3/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/classes/Resource_fr.properties
===================================================================
--- branches/Enterprise_Portal_Platform_4_3/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/classes/Resource_fr.properties 2009-01-29 01:25:15 UTC (rev 12695)
+++ branches/Enterprise_Portal_Platform_4_3/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/classes/Resource_fr.properties 2009-01-29 12:58:27 UTC (rev 12696)
@@ -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/Enterprise_Portal_Platform_4_3/core-wsrp/src/resources/portal-wsrp-admin-war/jsf/consumers/consumers.xhtml
===================================================================
--- branches/Enterprise_Portal_Platform_4_3/core-wsrp/src/resources/portal-wsrp-admin-war/jsf/consumers/consumers.xhtml 2009-01-29 01:25:15 UTC (rev 12695)
+++ branches/Enterprise_Portal_Platform_4_3/core-wsrp/src/resources/portal-wsrp-admin-war/jsf/consumers/consumers.xhtml 2009-01-29 12:58:27 UTC (rev 12696)
@@ -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/Enterprise_Portal_Platform_4_3/wsrp/src/main/org/jboss/portal/test/wsrp/framework/support/MockConsumerRegistry.java
===================================================================
--- branches/Enterprise_Portal_Platform_4_3/wsrp/src/main/org/jboss/portal/test/wsrp/framework/support/MockConsumerRegistry.java 2009-01-29 01:25:15 UTC (rev 12695)
+++ branches/Enterprise_Portal_Platform_4_3/wsrp/src/main/org/jboss/portal/test/wsrp/framework/support/MockConsumerRegistry.java 2009-01-29 12:58:27 UTC (rev 12696)
@@ -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/Enterprise_Portal_Platform_4_3/wsrp/src/main/org/jboss/portal/wsrp/consumer/ConsumerRegistry.java
===================================================================
--- branches/Enterprise_Portal_Platform_4_3/wsrp/src/main/org/jboss/portal/wsrp/consumer/ConsumerRegistry.java 2009-01-29 01:25:15 UTC (rev 12695)
+++ branches/Enterprise_Portal_Platform_4_3/wsrp/src/main/org/jboss/portal/wsrp/consumer/ConsumerRegistry.java 2009-01-29 12:58:27 UTC (rev 12696)
@@ -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/Enterprise_Portal_Platform_4_3/wsrp/src/main/org/jboss/portal/wsrp/consumer/ConsumerRegistryService.java
===================================================================
--- branches/Enterprise_Portal_Platform_4_3/wsrp/src/main/org/jboss/portal/wsrp/consumer/ConsumerRegistryService.java 2009-01-29 01:25:15 UTC (rev 12695)
+++ branches/Enterprise_Portal_Platform_4_3/wsrp/src/main/org/jboss/portal/wsrp/consumer/ConsumerRegistryService.java 2009-01-29 12:58:27 UTC (rev 12696)
@@ -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>();
Modified: branches/Enterprise_Portal_Platform_4_3/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java
===================================================================
--- branches/Enterprise_Portal_Platform_4_3/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java 2009-01-29 01:25:15 UTC (rev 12695)
+++ branches/Enterprise_Portal_Platform_4_3/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java 2009-01-29 12:58:27 UTC (rev 12696)
@@ -177,10 +177,7 @@
public RegistrationInfo getRegistrationInfo()
{
// update parent since it might not be set when unfrozen from Hibernate
- if (persistentRegistrationInfo != null)
- {
- persistentRegistrationInfo.setParent(this);
- }
+ persistentRegistrationInfo.setParent(this);
return persistentRegistrationInfo;
}
@@ -191,35 +188,30 @@
public boolean isRegistered()
{
- if (persistentRegistrationInfo != null)
+ Boolean valid = persistentRegistrationInfo.isRegistrationValid();
+ if (valid == null)
{
- Boolean valid = persistentRegistrationInfo.isRegistrationValid();
- if (valid == null)
- {
- return persistentRegistrationInfo.getRegistrationHandle() != null;
- }
- else
- {
- return valid;
- }
+ return persistentRegistrationInfo.getRegistrationHandle() != null;
}
-
- return false;
+ else
+ {
+ return valid;
+ }
}
public boolean isRegistrationRequired()
{
- return persistentRegistrationInfo != null && persistentRegistrationInfo.isRegistrationDeterminedRequired();
+ return persistentRegistrationInfo.isRegistrationDeterminedRequired();
}
public boolean isRegistrationChecked()
{
- return persistentRegistrationInfo != null && persistentRegistrationInfo.isRegistrationRequired() != null;
+ return persistentRegistrationInfo.isRegistrationRequired() != null;
}
public boolean hasLocalRegistrationInfo()
{
- return persistentRegistrationInfo != null && persistentRegistrationInfo.hasLocalInfo();
+ return persistentRegistrationInfo.hasLocalInfo();
}
/**
@@ -251,7 +243,7 @@
public boolean isModifyRegistrationRequired()
{
- return isModifyRegistrationRequired || (persistentRegistrationInfo != null && persistentRegistrationInfo.isModifyRegistrationNeeded());
+ return isModifyRegistrationRequired || persistentRegistrationInfo.isModifyRegistrationNeeded();
}
// FIX-ME: remove when a better dirty management is in place at property level
@@ -346,8 +338,7 @@
try
{
// if we don't yet have registration information, get an unregistered service description
- boolean unmanaged = persistentRegistrationInfo == null || persistentRegistrationInfo.isUndetermined();
- serviceDescription = getUnmanagedServiceDescription(unmanaged);
+ serviceDescription = getUnmanagedServiceDescription(persistentRegistrationInfo.isUndetermined());
result.setServiceDescription(serviceDescription);
}
catch (OperationFailedFault operationFailedFault)
@@ -789,7 +780,7 @@
public RegistrationContext getRegistrationContext() throws PortletInvokerException
{
- if (persistentRegistrationInfo == null || persistentRegistrationInfo.isUndetermined())
+ if (persistentRegistrationInfo.isUndetermined())
{
refresh(false);
}
@@ -799,10 +790,7 @@
public void resetRegistration() throws PortletInvokerException
{
- if (persistentRegistrationInfo != null)
- {
- persistentRegistrationInfo.resetRegistration();
- }
+ persistentRegistrationInfo.resetRegistration();
invalidateCache();
registry.updateProducerInfo(this);
@@ -865,11 +853,6 @@
*/
private RefreshResult register(ServiceDescription serviceDescription, boolean forceRefresh) throws PortletInvokerException
{
- if (persistentRegistrationInfo == null)
- {
- persistentRegistrationInfo = new RegistrationInfo(this);
- }
-
if (!isRegistered())
{
persistentEndpointInfo.refresh();
@@ -957,7 +940,7 @@
public void modifyRegistration() throws PortletInvokerException
{
- if (persistentRegistrationInfo != null && persistentRegistrationInfo.getRegistrationHandle() != null)
+ if (persistentRegistrationInfo.getRegistrationHandle() != null)
{
persistentEndpointInfo.refresh();
@@ -1009,11 +992,6 @@
private RefreshResult internalRefreshRegistration(ServiceDescription serviceDescription, boolean mergeWithLocalInfo, boolean forceRefresh, boolean forceCheckOfExtraProps) throws PortletInvokerException
{
- if (persistentRegistrationInfo == null)
- {
- persistentRegistrationInfo = new RegistrationInfo(this);
- }
-
RefreshResult result =
persistentRegistrationInfo.refresh(serviceDescription, persistentId, mergeWithLocalInfo, forceRefresh, forceCheckOfExtraProps);
@@ -1025,7 +1003,6 @@
public boolean isRefreshNeeded(boolean considerCache)
{
boolean result = (considerCache && isCacheExpired())
- || persistentRegistrationInfo == null
|| persistentRegistrationInfo.isRefreshNeeded()
|| persistentEndpointInfo.isRefreshNeeded();
if (result)
@@ -1044,7 +1021,7 @@
public void eraseRegistrationInfo()
{
- persistentRegistrationInfo = null;
+ persistentRegistrationInfo = RegistrationInfo.createUndeterminedRegistration(this);
registry.updateProducerInfo(this);
15 years, 4 months
JBoss Portal SVN: r12695 - in modules/cms/trunk/cms-jackrabbit/src: test/java/org/jboss/portal/cms/test/commands and 1 other directory.
by portal-commits@lists.jboss.org
Author: sohil.shah(a)jboss.com
Date: 2009-01-28 20:25:15 -0500 (Wed, 28 Jan 2009)
New Revision: 12695
Modified:
modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/impl/ContentImpl.java
modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/commands/TestFileCreate.java
Log:
Oracle workaround for usecase where content is empty during file creation
Modified: modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/impl/ContentImpl.java
===================================================================
--- modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/impl/ContentImpl.java 2009-01-29 00:30:45 UTC (rev 12694)
+++ modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/impl/ContentImpl.java 2009-01-29 01:25:15 UTC (rev 12695)
@@ -108,13 +108,21 @@
/** @return Returns the content. */
public InputStream getStream()
{
- return new ByteArrayInputStream(bytes);
+ return new ByteArrayInputStream(this.getBytes());
}
/** @return Returns the content. */
public byte[] getBytes()
{
- return bytes;
+ //Code Around for issues with Oracle JDBC Driver. An empty byte array translates into a NULL Blob which blows up since
+ //The column is NON-NULLABLE. All other tested database drivers mysql5, postgresql8, hsqldb etc are just fine since they translate into an
+ //empty BLOB object
+ if(this.bytes == null || this.bytes.length==0)
+ {
+ this.bytes = " ".getBytes();
+ }
+
+ return this.bytes;
}
public String getContentAsString()
@@ -123,19 +131,19 @@
{
try
{
- return new String(bytes, encoding);
+ return new String(this.getBytes(), encoding);
}
catch (UnsupportedEncodingException e)
{
}
}
- return new String(bytes);
+ return new String(this.getBytes());
}
/** @param stream The content to set. */
public void setStream(InputStream stream)
{
- bytes = FileUtil.getBytes(stream);
+ this.bytes = FileUtil.getBytes(stream);
}
/** @param bytes The content to set. */
Modified: modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/commands/TestFileCreate.java
===================================================================
--- modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/commands/TestFileCreate.java 2009-01-29 00:30:45 UTC (rev 12694)
+++ modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/commands/TestFileCreate.java 2009-01-29 01:25:15 UTC (rev 12695)
@@ -187,6 +187,36 @@
assertEquals("Content Incorrect", new String(cour.getContent().getBytes()), "1234567890");
}
+ @Test
+ public void testEmptyFileCreate() throws Exception
+ {
+ String path = "/emptyfile.gif";
+
+ //create file english
+ File file = new FileImpl();
+ file.setBasePath(path);
+
+ Content content = new ContentImpl();
+ content.setEncoding("UTF-8");
+ content.setTitle("English Title");
+ content.setDescription("English Description");
+ content.setBasePath(path + "/" + Locale.ENGLISH.getLanguage());
+ content.setBytes("".getBytes());
+ content.setMimeType("image/gif");
+ file.setContent(Locale.ENGLISH, content);
+
+ Command createFileCMD = service.getCommandFactory().createNewFileCommand(file, content);
+ service.execute(createFileCMD);
+
+ //Assert the state of the newly created file
+ Command readFileCmd = service.getCommandFactory().createFileGetCommand(path, Locale.ENGLISH);
+ File storedFile = (File)service.execute(readFileCmd);
+
+ assertNotNull("File not successfully stored!!", storedFile);
+ assertEquals("Encoding does not match!!", file.getContent().getEncoding(), "UTF-8");
+ assertEquals("Bytes Check", file.getContent().getContentAsString().trim(), "");
+ }
+
/**
*
* @param path
@@ -208,5 +238,5 @@
Command createFileCMD = service.getCommandFactory().createNewFileCommand(file, content);
service.execute(createFileCMD);
- }
+ }
}
15 years, 4 months
JBoss Portal SVN: r12694 - in branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal: wsrp/consumer and 1 other directory.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2009-01-28 19:30:45 -0500 (Wed, 28 Jan 2009)
New Revision: 12694
Modified:
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/test/wsrp/consumer/ConsumerRegistryTestCase.java
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/test/wsrp/consumer/ProducerInfoTestCase.java
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/consumer/RegistrationInfo.java
Log:
- JBPORTAL-2284: ProducerInfo are now created with a RegistrationInfo that's marked as undetermined instead of null. (merged both 12686 and 12692).
Modified: branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/test/wsrp/consumer/ConsumerRegistryTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/test/wsrp/consumer/ConsumerRegistryTestCase.java 2009-01-29 00:03:31 UTC (rev 12693)
+++ branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/test/wsrp/consumer/ConsumerRegistryTestCase.java 2009-01-29 00:30:45 UTC (rev 12694)
@@ -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. *
@@ -31,6 +31,7 @@
import org.jboss.portal.wsrp.consumer.ConsumerRegistry;
import org.jboss.portal.wsrp.consumer.EndpointConfigurationInfo;
import org.jboss.portal.wsrp.consumer.ProducerInfo;
+import org.jboss.portal.wsrp.consumer.RegistrationInfo;
import java.util.Collection;
@@ -77,7 +78,8 @@
assertNotNull(endpoint);
assertEquals(EndpointConfigurationInfo.UNSET, endpoint.getServiceDescriptionURL());
assertEquals(EndpointConfigurationInfo.UNSET, endpoint.getMarkupURL());
- assertNull(info.getRegistrationInfo());
+ RegistrationInfo regInfo = info.getRegistrationInfo();
+ assertTrue(regInfo.isUndetermined());
TransactionAssert.commitTransaction();
TransactionAssert.beginTransaction();
@@ -103,7 +105,7 @@
assertNotNull(endpoint);
assertEquals(EndpointConfigurationInfo.UNSET, endpoint.getServiceDescriptionURL());
assertEquals(EndpointConfigurationInfo.UNSET, endpoint.getMarkupURL());
- assertNull(info.getRegistrationInfo());
+ assertTrue(info.getRegistrationInfo().isUndetermined());
assertNull(registry.getConsumer("inexistent"));
Collection consumers = registry.getConfiguredConsumers();
Modified: branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/test/wsrp/consumer/ProducerInfoTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/test/wsrp/consumer/ProducerInfoTestCase.java 2009-01-29 00:03:31 UTC (rev 12693)
+++ branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/test/wsrp/consumer/ProducerInfoTestCase.java 2009-01-29 00:30:45 UTC (rev 12694)
@@ -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. *
@@ -152,7 +152,8 @@
public void testRefreshAndRegistration() throws Exception
{
assertFalse(info.isRegistered());
- assertNull(info.getRegistrationInfo());
+ RegistrationInfo regInfo = info.getRegistrationInfo();
+ assertTrue(regInfo.isUndetermined());
ServiceDescriptionBehavior sd = new ServiceDescriptionBehavior();
sd.setRequiresRegistration(true);
@@ -173,7 +174,8 @@
public void testGetRegistrationContext() throws Exception
{
assertFalse(info.isRegistered());
- assertNull(info.getRegistrationInfo());
+ RegistrationInfo regInfo = info.getRegistrationInfo();
+ assertTrue(regInfo.isUndetermined());
ServiceDescriptionBehavior sd = new ServiceDescriptionBehavior();
sd.setRequiresRegistration(true);
Modified: branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java 2009-01-29 00:03:31 UTC (rev 12693)
+++ branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java 2009-01-29 00:30:45 UTC (rev 12694)
@@ -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. *
@@ -123,6 +123,7 @@
public ProducerInfo()
{
persistentEndpointInfo = new EndpointConfigurationInfo(this);
+ persistentRegistrationInfo = RegistrationInfo.createUndeterminedRegistration(this);
}
public ConsumerRegistry getRegistry()
@@ -176,10 +177,7 @@
public RegistrationInfo getRegistrationInfo()
{
// update parent since it might not be set when unfrozen from Hibernate
- if (persistentRegistrationInfo != null)
- {
- persistentRegistrationInfo.setParent(this);
- }
+ persistentRegistrationInfo.setParent(this);
return persistentRegistrationInfo;
}
@@ -190,35 +188,30 @@
public boolean isRegistered()
{
- if (persistentRegistrationInfo != null)
+ Boolean valid = persistentRegistrationInfo.isRegistrationValid();
+ if (valid == null)
{
- Boolean valid = persistentRegistrationInfo.isRegistrationValid();
- if (valid == null)
- {
- return persistentRegistrationInfo.getRegistrationHandle() != null;
- }
- else
- {
- return valid;
- }
+ return persistentRegistrationInfo.getRegistrationHandle() != null;
}
-
- return false;
+ else
+ {
+ return valid;
+ }
}
public boolean isRegistrationRequired()
{
- return persistentRegistrationInfo != null && persistentRegistrationInfo.isRegistrationDeterminedRequired();
+ return persistentRegistrationInfo.isRegistrationDeterminedRequired();
}
public boolean isRegistrationChecked()
{
- return persistentRegistrationInfo != null && persistentRegistrationInfo.isRegistrationRequired() != null;
+ return persistentRegistrationInfo.isRegistrationRequired() != null;
}
public boolean hasLocalRegistrationInfo()
{
- return persistentRegistrationInfo != null && persistentRegistrationInfo.hasLocalInfo();
+ return persistentRegistrationInfo.hasLocalInfo();
}
/**
@@ -250,7 +243,7 @@
public boolean isModifyRegistrationRequired()
{
- return isModifyRegistrationRequired || (persistentRegistrationInfo != null && persistentRegistrationInfo.isModified());
+ return isModifyRegistrationRequired || persistentRegistrationInfo.isModified();
}
// FIX-ME: remove when a better dirty management is in place at property level
@@ -308,7 +301,7 @@
{
ServiceDescription serviceDescription;
- if(isModifyRegistrationRequired)
+ if (isModifyRegistrationRequired)
{
return new RefreshResult(RefreshResult.Status.MODIFY_REGISTRATION_REQUIRED);
}
@@ -345,7 +338,7 @@
try
{
// if we don't yet have registration information, get an unregistered service description
- serviceDescription = getUnmanagedServiceDescription(persistentRegistrationInfo == null);
+ serviceDescription = getUnmanagedServiceDescription(persistentRegistrationInfo.isUndetermined());
result.setServiceDescription(serviceDescription);
}
catch (OperationFailedFault operationFailedFault)
@@ -409,7 +402,7 @@
}
private RefreshResult refreshInfo(boolean forceRefresh, ServiceDescription serviceDescription, RefreshResult result)
- throws PortletInvokerException
+ throws PortletInvokerException
{
// do we need to call initCookie or not?
requiresInitCookie = serviceDescription.getRequiresInitCookie();
@@ -542,8 +535,8 @@
if (info.isUsesMethodGet())
{
log.warn("Portlet '" + portletHandle
- + "' uses the GET method in forms. Since we don't handle this, this portlet will be excluded from " +
- "the list of offered portlets for producer " + persistentId);
+ + "' uses the GET method in forms. Since we don't handle this, this portlet will be excluded from " +
+ "the list of offered portlets for producer " + persistentId);
}
else
{
@@ -616,7 +609,7 @@
catch (Exception e)
{
log.debug("Couldn't get portlet via getPortletDescription for producer '" + persistentId
- + "'. Attempting to retrieve it from the service description as this producer might not support the PortletManagement interface.", e);
+ + "'. Attempting to retrieve it from the service description as this producer might not support the PortletManagement interface.", e);
justRefreshed = refresh(true);
portlet = getPortletFromCaches(portletHandle, justRefreshed);
@@ -686,7 +679,7 @@
private boolean isCacheExpired()
{
boolean result = !useCache() || System.currentTimeMillis() > expirationTimeMillis || popsMap == null
- || portletGroups == null;
+ || portletGroups == null;
if (result)
{
log.debug("Cache expired or not used");
@@ -765,7 +758,7 @@
{
Throwable cause = e.getCause();
throw new InvokerUnavailableException("Problem getting service description for producer "
- + persistentId + ", please see the logs for more information. ", cause == null ? e : cause);
+ + persistentId + ", please see the logs for more information. ", cause == null ? e : cause);
}
private GetServiceDescription getServiceDescriptionRequest(boolean asUnregistred) throws PortletInvokerException
@@ -787,7 +780,7 @@
public RegistrationContext getRegistrationContext() throws PortletInvokerException
{
- if (persistentRegistrationInfo == null)
+ if (persistentRegistrationInfo.isUndetermined())
{
refresh(false);
}
@@ -797,10 +790,7 @@
public void resetRegistration() throws PortletInvokerException
{
- if (persistentRegistrationInfo != null)
- {
- persistentRegistrationInfo.resetRegistration();
- }
+ persistentRegistrationInfo.resetRegistration();
invalidateCache();
registry.updateProducerInfo(this);
@@ -835,7 +825,7 @@
throw new RuntimeException("Couldn't reset registration", e);
}
throw new IllegalArgumentException("Couldn't get property descriptions for portlet '" + portletHandle
- + "' because the provided registration is invalid!");
+ + "' because the provided registration is invalid!");
}
catch (Exception e)
{
@@ -863,11 +853,6 @@
*/
private RefreshResult register(ServiceDescription serviceDescription, boolean forceRefresh) throws PortletInvokerException
{
- if (persistentRegistrationInfo == null)
- {
- persistentRegistrationInfo = new RegistrationInfo(this);
- }
-
if (!isRegistered())
{
persistentEndpointInfo.refresh();
@@ -887,7 +872,7 @@
{
log.debug("Attempting registration");
RegistrationContext registrationContext = persistentEndpointInfo.getRegistrationService()
- .register(persistentRegistrationInfo.getRegistrationData());
+ .register(persistentRegistrationInfo.getRegistrationData());
if (registrationContext == null)
{
@@ -897,7 +882,7 @@
persistentRegistrationInfo.setRegistrationContext(registrationContext);
String msg = "Consumer with id '" + persistentId + "' successfully registered with handle: '"
- + registrationContext.getRegistrationHandle() + "'";
+ + registrationContext.getRegistrationHandle() + "'";
log.debug(msg);
RefreshResult res = new RefreshResult();
res.setRegistrationResult(result);
@@ -955,7 +940,7 @@
public void modifyRegistration() throws PortletInvokerException
{
- if (persistentRegistrationInfo != null && persistentRegistrationInfo.getRegistrationHandle() != null)
+ if (persistentRegistrationInfo.getRegistrationHandle() != null)
{
persistentEndpointInfo.refresh();
@@ -963,7 +948,7 @@
{
RegistrationContext registrationContext = getRegistrationContext();
ModifyRegistration modifyRegistration = WSRPTypeFactory.createModifyRegistration(registrationContext,
- persistentRegistrationInfo.getRegistrationData());
+ persistentRegistrationInfo.getRegistrationData());
RegistrationState state = persistentEndpointInfo.getRegistrationService().modifyRegistration(modifyRegistration);
// force refresh of internal RegistrationInfo state
@@ -993,7 +978,7 @@
else
{
throw new IllegalStateException("Cannot modify registration for producer '" + persistentId
- + "' as it's not registered");
+ + "' as it's not registered");
}
}
@@ -1007,13 +992,8 @@
private RefreshResult internalRefreshRegistration(ServiceDescription serviceDescription, boolean mergeWithLocalInfo, boolean forceRefresh, boolean forceCheckOfExtraProps) throws PortletInvokerException
{
- if (persistentRegistrationInfo == null)
- {
- persistentRegistrationInfo = new RegistrationInfo(this);
- }
-
RefreshResult result =
- persistentRegistrationInfo.refresh(serviceDescription, persistentId, mergeWithLocalInfo, forceRefresh, forceCheckOfExtraProps);
+ persistentRegistrationInfo.refresh(serviceDescription, persistentId, mergeWithLocalInfo, forceRefresh, forceCheckOfExtraProps);
log.debug("Refreshed registration information for consumer with id '" + persistentId + "'");
@@ -1023,9 +1003,8 @@
public boolean isRefreshNeeded(boolean considerCache)
{
boolean result = (considerCache && isCacheExpired())
- || persistentRegistrationInfo == null
- || persistentRegistrationInfo.isRefreshNeeded()
- || persistentEndpointInfo.isRefreshNeeded();
+ || persistentRegistrationInfo.isRefreshNeeded()
+ || persistentEndpointInfo.isRefreshNeeded();
if (result)
{
log.debug("Refresh needed for producer '" + persistentId + "'");
@@ -1042,7 +1021,7 @@
public void eraseRegistrationInfo()
{
- persistentRegistrationInfo = null;
+ persistentRegistrationInfo = RegistrationInfo.createUndeterminedRegistration(this);
registry.updateProducerInfo(this);
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 2009-01-29 00:03:31 UTC (rev 12693)
+++ branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/consumer/RegistrationInfo.java 2009-01-29 00:30:45 UTC (rev 12694)
@@ -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. *
@@ -67,6 +67,12 @@
private transient boolean dirty;
private transient ProducerInfo parent;
+ /**
+ * Marker string to identify a RegistrationInfo created for a producer that might not require registration as a work
+ * around https://jira.jboss.org/jira/browse/JBPORTAL-2284
+ */
+ private static final String UNDETERMINED_REGISTRATION = "__JBP__UNDETERMINED__REGISTRATION__";
+
public RegistrationInfo(ProducerInfo producerInfo)
{
this();
@@ -75,6 +81,18 @@
parent = producerInfo;
}
+ static RegistrationInfo createUndeterminedRegistration(ProducerInfo producerInfo)
+ {
+ RegistrationInfo info = new RegistrationInfo(producerInfo);
+ info.setConsumerName(UNDETERMINED_REGISTRATION);
+ return info;
+ }
+
+ public boolean isUndetermined()
+ {
+ return UNDETERMINED_REGISTRATION.equals(persistentConsumerName);
+ }
+
public RegistrationInfo(ProducerInfo producerInfo, boolean requiresRegistration)
{
this(producerInfo);
@@ -377,6 +395,12 @@
if (forceRefresh || isRefreshNeeded())
{
+ // if we were previously undetermined, become determined! :)
+ if (isUndetermined())
+ {
+ setConsumerName(WSRPConstants.DEFAULT_CONSUMER_NAME);
+ }
+
// get a service description if we don't already have one
if (serviceDescription == null && parent != null)
{
15 years, 4 months
JBoss Portal SVN: r12693 - in branches/JBoss_Portal_Branch_2_7: core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/classes and 3 other directories.
by portal-commits@lists.jboss.org
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>();
15 years, 4 months
JBoss Portal SVN: r12692 - branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/consumer.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2009-01-28 18:55:56 -0500 (Wed, 28 Jan 2009)
New Revision: 12692
Modified:
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java
Log:
- JBPORTAL-2284: Fixed error in eraseRegistrationInfo, removed checks for null RegistrationInfo as it never is null now.
Modified: branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java 2009-01-28 20:54:46 UTC (rev 12691)
+++ branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java 2009-01-28 23:55:56 UTC (rev 12692)
@@ -177,10 +177,7 @@
public RegistrationInfo getRegistrationInfo()
{
// update parent since it might not be set when unfrozen from Hibernate
- if (persistentRegistrationInfo != null)
- {
- persistentRegistrationInfo.setParent(this);
- }
+ persistentRegistrationInfo.setParent(this);
return persistentRegistrationInfo;
}
@@ -191,35 +188,30 @@
public boolean isRegistered()
{
- if (persistentRegistrationInfo != null)
+ Boolean valid = persistentRegistrationInfo.isRegistrationValid();
+ if (valid == null)
{
- Boolean valid = persistentRegistrationInfo.isRegistrationValid();
- if (valid == null)
- {
- return persistentRegistrationInfo.getRegistrationHandle() != null;
- }
- else
- {
- return valid;
- }
+ return persistentRegistrationInfo.getRegistrationHandle() != null;
}
-
- return false;
+ else
+ {
+ return valid;
+ }
}
public boolean isRegistrationRequired()
{
- return persistentRegistrationInfo != null && persistentRegistrationInfo.isRegistrationDeterminedRequired();
+ return persistentRegistrationInfo.isRegistrationDeterminedRequired();
}
public boolean isRegistrationChecked()
{
- return persistentRegistrationInfo != null && persistentRegistrationInfo.isRegistrationRequired() != null;
+ return persistentRegistrationInfo.isRegistrationRequired() != null;
}
public boolean hasLocalRegistrationInfo()
{
- return persistentRegistrationInfo != null && persistentRegistrationInfo.hasLocalInfo();
+ return persistentRegistrationInfo.hasLocalInfo();
}
/**
@@ -251,7 +243,7 @@
public boolean isModifyRegistrationRequired()
{
- return isModifyRegistrationRequired || (persistentRegistrationInfo != null && persistentRegistrationInfo.isModifyRegistrationNeeded());
+ return isModifyRegistrationRequired || persistentRegistrationInfo.isModifyRegistrationNeeded();
}
// FIX-ME: remove when a better dirty management is in place at property level
@@ -346,8 +338,7 @@
try
{
// if we don't yet have registration information, get an unregistered service description
- boolean unmanaged = persistentRegistrationInfo == null || persistentRegistrationInfo.isUndetermined();
- serviceDescription = getUnmanagedServiceDescription(unmanaged);
+ serviceDescription = getUnmanagedServiceDescription(persistentRegistrationInfo.isUndetermined());
result.setServiceDescription(serviceDescription);
}
catch (OperationFailedFault operationFailedFault)
@@ -789,7 +780,7 @@
public RegistrationContext getRegistrationContext() throws PortletInvokerException
{
- if (persistentRegistrationInfo == null || persistentRegistrationInfo.isUndetermined())
+ if (persistentRegistrationInfo.isUndetermined())
{
refresh(false);
}
@@ -799,10 +790,7 @@
public void resetRegistration() throws PortletInvokerException
{
- if (persistentRegistrationInfo != null)
- {
- persistentRegistrationInfo.resetRegistration();
- }
+ persistentRegistrationInfo.resetRegistration();
invalidateCache();
registry.updateProducerInfo(this);
@@ -865,11 +853,6 @@
*/
private RefreshResult register(ServiceDescription serviceDescription, boolean forceRefresh) throws PortletInvokerException
{
- if (persistentRegistrationInfo == null)
- {
- persistentRegistrationInfo = new RegistrationInfo(this);
- }
-
if (!isRegistered())
{
persistentEndpointInfo.refresh();
@@ -957,7 +940,7 @@
public void modifyRegistration() throws PortletInvokerException
{
- if (persistentRegistrationInfo != null && persistentRegistrationInfo.getRegistrationHandle() != null)
+ if (persistentRegistrationInfo.getRegistrationHandle() != null)
{
persistentEndpointInfo.refresh();
@@ -1009,11 +992,6 @@
private RefreshResult internalRefreshRegistration(ServiceDescription serviceDescription, boolean mergeWithLocalInfo, boolean forceRefresh, boolean forceCheckOfExtraProps) throws PortletInvokerException
{
- if (persistentRegistrationInfo == null)
- {
- persistentRegistrationInfo = new RegistrationInfo(this);
- }
-
RefreshResult result =
persistentRegistrationInfo.refresh(serviceDescription, persistentId, mergeWithLocalInfo, forceRefresh, forceCheckOfExtraProps);
@@ -1025,7 +1003,6 @@
public boolean isRefreshNeeded(boolean considerCache)
{
boolean result = (considerCache && isCacheExpired())
- || persistentRegistrationInfo == null
|| persistentRegistrationInfo.isRefreshNeeded()
|| persistentEndpointInfo.isRefreshNeeded();
if (result)
@@ -1044,7 +1021,7 @@
public void eraseRegistrationInfo()
{
- persistentRegistrationInfo = null;
+ persistentRegistrationInfo = RegistrationInfo.createUndeterminedRegistration(this);
registry.updateProducerInfo(this);
15 years, 4 months
JBoss Portal SVN: r12691 - in tags/Enterprise_Portal_Platform_4_3_GA: jems/src/main/org/jboss/portal/jems/hibernate and 2 other directories.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2009-01-28 15:54:46 -0500 (Wed, 28 Jan 2009)
New Revision: 12691
Modified:
tags/Enterprise_Portal_Platform_4_3_GA/core-admin/src/resources/portal-admin-war/jsf/common/editPageLayout.xhtml
tags/Enterprise_Portal_Platform_4_3_GA/jems/src/main/org/jboss/portal/jems/hibernate/DialectFactory.java
tags/Enterprise_Portal_Platform_4_3_GA/jems/src/main/org/jboss/portal/jems/hibernate/OracleStringUserType.java
tags/Enterprise_Portal_Platform_4_3_GA/wsrp/src/main/org/jboss/portal/test/wsrp/consumer/ConsumerRegistryTestCase.java
tags/Enterprise_Portal_Platform_4_3_GA/wsrp/src/main/org/jboss/portal/test/wsrp/consumer/ProducerInfoTestCase.java
tags/Enterprise_Portal_Platform_4_3_GA/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java
tags/Enterprise_Portal_Platform_4_3_GA/wsrp/src/main/org/jboss/portal/wsrp/consumer/RegistrationInfo.java
Log:
- Use correct dialects
- JBPORTAL-2284: ProducerInfo are now created with a RegistrationInfo that's marked as undetermined instead of null.
- namespace fix in portlet layout
Modified: tags/Enterprise_Portal_Platform_4_3_GA/core-admin/src/resources/portal-admin-war/jsf/common/editPageLayout.xhtml
===================================================================
--- tags/Enterprise_Portal_Platform_4_3_GA/core-admin/src/resources/portal-admin-war/jsf/common/editPageLayout.xhtml 2009-01-28 20:34:56 UTC (rev 12690)
+++ tags/Enterprise_Portal_Platform_4_3_GA/core-admin/src/resources/portal-admin-war/jsf/common/editPageLayout.xhtml 2009-01-28 20:54:46 UTC (rev 12691)
@@ -56,7 +56,7 @@
initialMode="edit_content"
initialWindowState="normal"
renderParameters="#{pageManager.selectedRenderParameters}"
- onClick="url.setParameter('windowName', document.getElementById(document.getElementById('namespaceHolder').value + ':windowForm:windowName').value);"/>
+ onClick="url.setParameter('windowName', document.getElementById(document.getElementById('namespaceHolder').value).value);"/>
<input type="hidden" value="#{pageManager.namespace}" id="namespaceHolder"/>
</td>
</tr>
Modified: tags/Enterprise_Portal_Platform_4_3_GA/jems/src/main/org/jboss/portal/jems/hibernate/DialectFactory.java
===================================================================
--- tags/Enterprise_Portal_Platform_4_3_GA/jems/src/main/org/jboss/portal/jems/hibernate/DialectFactory.java 2009-01-28 20:34:56 UTC (rev 12690)
+++ tags/Enterprise_Portal_Platform_4_3_GA/jems/src/main/org/jboss/portal/jems/hibernate/DialectFactory.java 2009-01-28 20:54:46 UTC (rev 12691)
@@ -23,6 +23,9 @@
package org.jboss.portal.jems.hibernate;
import org.hibernate.HibernateException;
+import org.hibernate.dialect.Oracle10gDialect;
+import org.hibernate.dialect.Oracle8iDialect;
+import org.hibernate.dialect.Oracle9iDialect;
import java.util.HashMap;
import java.util.Map;
@@ -91,29 +94,33 @@
private static final Map MAPPERS = new HashMap();
- static
- {
- // TODO : this is the stuff it'd be nice to move to a properties file or some other easily user-editable place
- MAPPERS.put("HSQL Database Engine", new VersionInsensitiveMapper("org.hibernate.dialect.HSQLDialect"));
- MAPPERS.put("DB2/NT", new VersionInsensitiveMapper("org.hibernate.dialect.DB2Dialect"));
- MAPPERS.put("MySQL", new VersionInsensitiveMapper("org.hibernate.dialect.MySQLDialect"));
- MAPPERS.put("PostgreSQL", new VersionInsensitiveMapper("org.hibernate.dialect.PostgreSQLDialect"));
- MAPPERS.put("Microsoft SQL Server Database", new VersionInsensitiveMapper("org.hibernate.dialect.SQLServerDialect"));
- MAPPERS.put("Microsoft SQL Server", new VersionInsensitiveMapper("org.hibernate.dialect.SQLServerDialect"));
- MAPPERS.put("Sybase SQL Server", new VersionInsensitiveMapper("org.hibernate.dialect.SybaseDialect"));
- MAPPERS.put("Informix Dynamic Server", new VersionInsensitiveMapper("org.hibernate.dialect.InformixDialect"));
+ static {
+ // TODO : this is the stuff it'd be nice to move to a properties file or some other easily user-editable place
+ MAPPERS.put( "HSQL Database Engine", new VersionInsensitiveMapper( "org.hibernate.dialect.HSQLDialect" ) );
+ MAPPERS.put( "DB2/NT", new VersionInsensitiveMapper( "org.hibernate.dialect.DB2Dialect" ) );
+ MAPPERS.put( "DB2/LINUX", new VersionInsensitiveMapper( "org.hibernate.dialect.DB2Dialect" ) );
+ MAPPERS.put( "MySQL", new VersionInsensitiveMapper( "org.hibernate.dialect.MySQLDialect" ) );
+ MAPPERS.put( "PostgreSQL", new VersionInsensitiveMapper( "org.hibernate.dialect.PostgreSQLDialect" ) );
+ MAPPERS.put( "Microsoft SQL Server Database", new VersionInsensitiveMapper( "org.hibernate.dialect.SQLServerDialect" ) );
+ MAPPERS.put( "Microsoft SQL Server", new VersionInsensitiveMapper( "org.hibernate.dialect.SQLServerDialect" ) );
+ MAPPERS.put( "Sybase SQL Server", new VersionInsensitiveMapper( "org.hibernate.dialect.SybaseDialect" ) );
+ MAPPERS.put( "Adaptive Server Enterprise", new VersionInsensitiveMapper( "org.hibernate.dialect.SybaseDialect" ) );
+ MAPPERS.put( "Informix Dynamic Server", new VersionInsensitiveMapper( "org.hibernate.dialect.InformixDialect" ) );
+ MAPPERS.put( "Apache Derby", new VersionInsensitiveMapper( "org.hibernate.dialect.DerbyDialect" ) );
- MAPPERS.put(
- "Oracle",
- new DatabaseDialectMapper()
- {
- public String getDialectClass(int majorVersion)
- {
- return majorVersion > 8
- ? "org.hibernate.dialect.Oracle9Dialect"
- : "org.hibernate.dialect.OracleDialect";
- }
- }
- );
- }
+ MAPPERS.put(
+ "Oracle",
+ new DatabaseDialectMapper() {
+ public String getDialectClass(int majorVersion) {
+ switch ( majorVersion ) {
+ case 8: return Oracle8iDialect.class.getName();
+ case 9: return Oracle9iDialect.class.getName();
+ case 10: return Oracle10gDialect.class.getName();
+ default: throw new HibernateException( "unknown Oracle major version [" + majorVersion + "]" );
+ }
+ }
+ }
+ );
+ }
+
}
Modified: tags/Enterprise_Portal_Platform_4_3_GA/jems/src/main/org/jboss/portal/jems/hibernate/OracleStringUserType.java
===================================================================
--- tags/Enterprise_Portal_Platform_4_3_GA/jems/src/main/org/jboss/portal/jems/hibernate/OracleStringUserType.java 2009-01-28 20:34:56 UTC (rev 12690)
+++ tags/Enterprise_Portal_Platform_4_3_GA/jems/src/main/org/jboss/portal/jems/hibernate/OracleStringUserType.java 2009-01-28 20:54:46 UTC (rev 12691)
@@ -30,9 +30,6 @@
import org.hibernate.Hibernate;
import org.hibernate.HibernateException;
-import org.hibernate.dialect.Dialect;
-import org.hibernate.dialect.Oracle9Dialect;
-import org.hibernate.dialect.OracleDialect;
import org.hibernate.usertype.UserType;
/**
Modified: tags/Enterprise_Portal_Platform_4_3_GA/wsrp/src/main/org/jboss/portal/test/wsrp/consumer/ConsumerRegistryTestCase.java
===================================================================
--- tags/Enterprise_Portal_Platform_4_3_GA/wsrp/src/main/org/jboss/portal/test/wsrp/consumer/ConsumerRegistryTestCase.java 2009-01-28 20:34:56 UTC (rev 12690)
+++ tags/Enterprise_Portal_Platform_4_3_GA/wsrp/src/main/org/jboss/portal/test/wsrp/consumer/ConsumerRegistryTestCase.java 2009-01-28 20:54:46 UTC (rev 12691)
@@ -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. *
@@ -31,6 +31,7 @@
import org.jboss.portal.wsrp.consumer.ConsumerRegistry;
import org.jboss.portal.wsrp.consumer.EndpointConfigurationInfo;
import org.jboss.portal.wsrp.consumer.ProducerInfo;
+import org.jboss.portal.wsrp.consumer.RegistrationInfo;
import java.util.Collection;
@@ -77,7 +78,8 @@
assertNotNull(endpoint);
assertEquals(EndpointConfigurationInfo.UNSET, endpoint.getServiceDescriptionURL());
assertEquals(EndpointConfigurationInfo.UNSET, endpoint.getMarkupURL());
- assertNull(info.getRegistrationInfo());
+ RegistrationInfo regInfo = info.getRegistrationInfo();
+ assertTrue(regInfo.isUndetermined());
TransactionAssert.commitTransaction();
TransactionAssert.beginTransaction();
@@ -103,7 +105,7 @@
assertNotNull(endpoint);
assertEquals(EndpointConfigurationInfo.UNSET, endpoint.getServiceDescriptionURL());
assertEquals(EndpointConfigurationInfo.UNSET, endpoint.getMarkupURL());
- assertNull(info.getRegistrationInfo());
+ assertTrue(info.getRegistrationInfo().isUndetermined());
assertNull(registry.getConsumer("inexistent"));
Collection consumers = registry.getConfiguredConsumers();
Modified: tags/Enterprise_Portal_Platform_4_3_GA/wsrp/src/main/org/jboss/portal/test/wsrp/consumer/ProducerInfoTestCase.java
===================================================================
--- tags/Enterprise_Portal_Platform_4_3_GA/wsrp/src/main/org/jboss/portal/test/wsrp/consumer/ProducerInfoTestCase.java 2009-01-28 20:34:56 UTC (rev 12690)
+++ tags/Enterprise_Portal_Platform_4_3_GA/wsrp/src/main/org/jboss/portal/test/wsrp/consumer/ProducerInfoTestCase.java 2009-01-28 20:54:46 UTC (rev 12691)
@@ -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. *
@@ -152,7 +152,8 @@
public void testRefreshAndRegistration() throws Exception
{
assertFalse(info.isRegistered());
- assertNull(info.getRegistrationInfo());
+ RegistrationInfo regInfo = info.getRegistrationInfo();
+ assertTrue(regInfo.isUndetermined());
ServiceDescriptionBehavior sd = new ServiceDescriptionBehavior();
sd.setRequiresRegistration(true);
@@ -173,7 +174,8 @@
public void testGetRegistrationContext() throws Exception
{
assertFalse(info.isRegistered());
- assertNull(info.getRegistrationInfo());
+ RegistrationInfo regInfo = info.getRegistrationInfo();
+ assertTrue(regInfo.isUndetermined());
ServiceDescriptionBehavior sd = new ServiceDescriptionBehavior();
sd.setRequiresRegistration(true);
Modified: tags/Enterprise_Portal_Platform_4_3_GA/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java
===================================================================
--- tags/Enterprise_Portal_Platform_4_3_GA/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java 2009-01-28 20:34:56 UTC (rev 12690)
+++ tags/Enterprise_Portal_Platform_4_3_GA/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java 2009-01-28 20:54:46 UTC (rev 12691)
@@ -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. *
@@ -123,6 +123,7 @@
public ProducerInfo()
{
persistentEndpointInfo = new EndpointConfigurationInfo(this);
+ persistentRegistrationInfo = RegistrationInfo.createUndeterminedRegistration(this);
}
public ConsumerRegistry getRegistry()
@@ -345,7 +346,8 @@
try
{
// if we don't yet have registration information, get an unregistered service description
- serviceDescription = getUnmanagedServiceDescription(persistentRegistrationInfo == null);
+ boolean unmanaged = persistentRegistrationInfo == null || persistentRegistrationInfo.isUndetermined();
+ serviceDescription = getUnmanagedServiceDescription(unmanaged);
result.setServiceDescription(serviceDescription);
}
catch (OperationFailedFault operationFailedFault)
@@ -409,7 +411,7 @@
}
private RefreshResult refreshInfo(boolean forceRefresh, ServiceDescription serviceDescription, RefreshResult result)
- throws PortletInvokerException
+ throws PortletInvokerException
{
// do we need to call initCookie or not?
requiresInitCookie = serviceDescription.getRequiresInitCookie();
@@ -542,8 +544,8 @@
if (info.isUsesMethodGet())
{
log.warn("Portlet '" + portletHandle
- + "' uses the GET method in forms. Since we don't handle this, this portlet will be excluded from " +
- "the list of offered portlets for producer " + persistentId);
+ + "' uses the GET method in forms. Since we don't handle this, this portlet will be excluded from " +
+ "the list of offered portlets for producer " + persistentId);
}
else
{
@@ -616,7 +618,7 @@
catch (Exception e)
{
log.debug("Couldn't get portlet via getPortletDescription for producer '" + persistentId
- + "'. Attempting to retrieve it from the service description as this producer might not support the PortletManagement interface.", e);
+ + "'. Attempting to retrieve it from the service description as this producer might not support the PortletManagement interface.", e);
justRefreshed = refresh(true);
portlet = getPortletFromCaches(portletHandle, justRefreshed);
@@ -686,7 +688,7 @@
private boolean isCacheExpired()
{
boolean result = !useCache() || System.currentTimeMillis() > expirationTimeMillis || popsMap == null
- || portletGroups == null;
+ || portletGroups == null;
if (result)
{
log.debug("Cache expired or not used");
@@ -765,7 +767,7 @@
{
Throwable cause = e.getCause();
throw new InvokerUnavailableException("Problem getting service description for producer "
- + persistentId + ", please see the logs for more information. ", cause == null ? e : cause);
+ + persistentId + ", please see the logs for more information. ", cause == null ? e : cause);
}
private GetServiceDescription getServiceDescriptionRequest(boolean asUnregistred) throws PortletInvokerException
@@ -787,7 +789,7 @@
public RegistrationContext getRegistrationContext() throws PortletInvokerException
{
- if (persistentRegistrationInfo == null)
+ if (persistentRegistrationInfo == null || persistentRegistrationInfo.isUndetermined())
{
refresh(false);
}
@@ -835,7 +837,7 @@
throw new RuntimeException("Couldn't reset registration", e);
}
throw new IllegalArgumentException("Couldn't get property descriptions for portlet '" + portletHandle
- + "' because the provided registration is invalid!");
+ + "' because the provided registration is invalid!");
}
catch (Exception e)
{
@@ -887,7 +889,7 @@
{
log.debug("Attempting registration");
RegistrationContext registrationContext = persistentEndpointInfo.getRegistrationService()
- .register(persistentRegistrationInfo.getRegistrationData());
+ .register(persistentRegistrationInfo.getRegistrationData());
if (registrationContext == null)
{
@@ -897,7 +899,7 @@
persistentRegistrationInfo.setRegistrationContext(registrationContext);
String msg = "Consumer with id '" + persistentId + "' successfully registered with handle: '"
- + registrationContext.getRegistrationHandle() + "'";
+ + registrationContext.getRegistrationHandle() + "'";
log.debug(msg);
RefreshResult res = new RefreshResult();
res.setRegistrationResult(result);
@@ -963,7 +965,7 @@
{
RegistrationContext registrationContext = getRegistrationContext();
ModifyRegistration modifyRegistration = WSRPTypeFactory.createModifyRegistration(registrationContext,
- persistentRegistrationInfo.getRegistrationData());
+ persistentRegistrationInfo.getRegistrationData());
RegistrationState state = persistentEndpointInfo.getRegistrationService().modifyRegistration(modifyRegistration);
// force refresh of internal RegistrationInfo state
@@ -993,7 +995,7 @@
else
{
throw new IllegalStateException("Cannot modify registration for producer '" + persistentId
- + "' as it's not registered");
+ + "' as it's not registered");
}
}
@@ -1013,7 +1015,7 @@
}
RefreshResult result =
- persistentRegistrationInfo.refresh(serviceDescription, persistentId, mergeWithLocalInfo, forceRefresh, forceCheckOfExtraProps);
+ persistentRegistrationInfo.refresh(serviceDescription, persistentId, mergeWithLocalInfo, forceRefresh, forceCheckOfExtraProps);
log.debug("Refreshed registration information for consumer with id '" + persistentId + "'");
@@ -1023,9 +1025,9 @@
public boolean isRefreshNeeded(boolean considerCache)
{
boolean result = (considerCache && isCacheExpired())
- || persistentRegistrationInfo == null
- || persistentRegistrationInfo.isRefreshNeeded()
- || persistentEndpointInfo.isRefreshNeeded();
+ || persistentRegistrationInfo == null
+ || persistentRegistrationInfo.isRefreshNeeded()
+ || persistentEndpointInfo.isRefreshNeeded();
if (result)
{
log.debug("Refresh needed for producer '" + persistentId + "'");
Modified: tags/Enterprise_Portal_Platform_4_3_GA/wsrp/src/main/org/jboss/portal/wsrp/consumer/RegistrationInfo.java
===================================================================
--- tags/Enterprise_Portal_Platform_4_3_GA/wsrp/src/main/org/jboss/portal/wsrp/consumer/RegistrationInfo.java 2009-01-28 20:34:56 UTC (rev 12690)
+++ tags/Enterprise_Portal_Platform_4_3_GA/wsrp/src/main/org/jboss/portal/wsrp/consumer/RegistrationInfo.java 2009-01-28 20:54:46 UTC (rev 12691)
@@ -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. *
@@ -68,6 +68,12 @@
private transient boolean modifyRegistrationNeeded;
private transient ProducerInfo parent;
+ /**
+ * Marker string to identify a RegistrationInfo created for a producer that might not require registration as a work
+ * around https://jira.jboss.org/jira/browse/JBPORTAL-2284
+ */
+ private static final String UNDETERMINED_REGISTRATION = "__JBP__UNDETERMINED__REGISTRATION__";
+
public RegistrationInfo(ProducerInfo producerInfo)
{
this();
@@ -76,6 +82,18 @@
parent = producerInfo;
}
+ static RegistrationInfo createUndeterminedRegistration(ProducerInfo producerInfo)
+ {
+ RegistrationInfo info = new RegistrationInfo(producerInfo);
+ info.setConsumerName(UNDETERMINED_REGISTRATION);
+ return info;
+ }
+
+ public boolean isUndetermined()
+ {
+ return UNDETERMINED_REGISTRATION.equals(persistentConsumerName);
+ }
+
public RegistrationInfo(ProducerInfo producerInfo, boolean requiresRegistration)
{
this(producerInfo);
@@ -379,6 +397,12 @@
if (forceRefresh || isRefreshNeeded())
{
+ // if we were previously undetermined, become determined! :)
+ if (isUndetermined())
+ {
+ setConsumerName(WSRPConstants.DEFAULT_CONSUMER_NAME);
+ }
+
// get a service description if we don't already have one
if (serviceDescription == null && parent != null)
{
15 years, 4 months