From do-not-reply at jboss.org Tue Jan 4 04:57:02 2011
Content-Type: multipart/mixed; boundary="===============6558045032553344593=="
MIME-Version: 1.0
From: do-not-reply at jboss.org
To: gatein-commits at lists.jboss.org
Subject: [gatein-commits] gatein SVN: r5675 - in
components/wsrp/branches/2.0.x/admin-gui/src/main: webapp/WEB-INF and 3 other
directories.
Date: Tue, 04 Jan 2011 04:57:02 -0500
Message-ID: <201101040957.p049v22Y023221@svn01.web.mwc.hst.phx2.redhat.com>
--===============6558045032553344593==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Author: chris.laprun(a)jboss.com
Date: 2011-01-04 04:57:01 -0500 (Tue, 04 Jan 2011)
New Revision: 5675
Added:
components/wsrp/branches/2.0.x/admin-gui/src/main/java/org/gatein/wsrp/a=
dmin/ui/RedirectToErrorIfWSRPUnavailablePhaseListener.java
components/wsrp/branches/2.0.x/admin-gui/src/main/java/org/gatein/wsrp/a=
dmin/ui/WSRPVersionBean.java
Modified:
components/wsrp/branches/2.0.x/admin-gui/src/main/webapp/WEB-INF/classes=
/Resource.properties
components/wsrp/branches/2.0.x/admin-gui/src/main/webapp/WEB-INF/classes=
/Resource_fr.properties
components/wsrp/branches/2.0.x/admin-gui/src/main/webapp/WEB-INF/faces-c=
onfig.xml
components/wsrp/branches/2.0.x/admin-gui/src/main/webapp/jsf/common/temp=
late.xhtml
components/wsrp/branches/2.0.x/admin-gui/src/main/webapp/jsf/error.xhtml
components/wsrp/branches/2.0.x/admin-gui/src/main/webapp/jsf/errorTempla=
te.xhtml
Log:
- GTNWSRP-191: Added PhaseListener to check if the WSRP service is availabl=
e before restoring the view.
- GTNWSRP-193: Added WSRPVersionBean to display version of the WSRP service.
Added: components/wsrp/branches/2.0.x/admin-gui/src/main/java/org/gatein/ws=
rp/admin/ui/RedirectToErrorIfWSRPUnavailablePhaseListener.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- components/wsrp/branches/2.0.x/admin-gui/src/main/java/org/gatein/wsrp/=
admin/ui/RedirectToErrorIfWSRPUnavailablePhaseListener.java =
(rev 0)
+++ components/wsrp/branches/2.0.x/admin-gui/src/main/java/org/gatein/wsrp/=
admin/ui/RedirectToErrorIfWSRPUnavailablePhaseListener.java 2011-01-04 09:5=
7:01 UTC (rev 5675)
@@ -0,0 +1,69 @@
+/*
+ * JBoss, a division of Red Hat
+ * Copyright 2011, 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.gatein.wsrp.admin.ui;
+
+import javax.faces.application.NavigationHandler;
+import javax.faces.context.ExternalContext;
+import javax.faces.context.FacesContext;
+import javax.faces.event.PhaseEvent;
+import javax.faces.event.PhaseId;
+import javax.faces.event.PhaseListener;
+import java.util.Map;
+
+/**
+ * @author Chris Laprun
+ * @version $Revision$
+ */
+public class RedirectToErrorIfWSRPUnavailablePhaseListener implements Phas=
eListener
+{
+ /** Same value as used in faces-config.xml to set the ConsumerRegistry =
*/
+ private static final String CONSUMER_REGISTRY =3D "ConsumerRegistry";
+ /** Same value as used in faces-config.xml to set the ProducerConfigura=
tionService */
+ private static final String PRODUCER_CONFIGURATION_SERVICE =3D "Produce=
rConfigurationService";
+
+ public void afterPhase(PhaseEvent event)
+ {
+ // nothing to do
+ }
+
+ public void beforePhase(PhaseEvent event)
+ {
+ FacesContext context =3D event.getFacesContext();
+
+ // if we don't have a ConsumerRegistry or ProducerConfigurationServi=
ce set in the application scope, then it means
+ // that the WSRP is not properly setup and we need to redirect to th=
e error page
+ ExternalContext externalContext =3D context.getExternalContext();
+ Map applicationMap =3D externalContext.getApplicatio=
nMap();
+ if (!applicationMap.containsKey(CONSUMER_REGISTRY) || !applicationMa=
p.containsKey(PRODUCER_CONFIGURATION_SERVICE))
+ {
+ NavigationHandler navigationHandler =3D context.getApplication().=
getNavigationHandler();
+ navigationHandler.handleNavigation(context, null, "error");
+ }
+ }
+
+ public PhaseId getPhaseId()
+ {
+ return PhaseId.RESTORE_VIEW;
+ }
+}
Added: components/wsrp/branches/2.0.x/admin-gui/src/main/java/org/gatein/ws=
rp/admin/ui/WSRPVersionBean.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- components/wsrp/branches/2.0.x/admin-gui/src/main/java/org/gatein/wsrp/=
admin/ui/WSRPVersionBean.java (rev 0)
+++ components/wsrp/branches/2.0.x/admin-gui/src/main/java/org/gatein/wsrp/=
admin/ui/WSRPVersionBean.java 2011-01-04 09:57:01 UTC (rev 5675)
@@ -0,0 +1,38 @@
+/*
+ * JBoss, a division of Red Hat
+ * Copyright 2011, 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.gatein.wsrp.admin.ui;
+
+import org.gatein.wsrp.WSRPConstants;
+
+/**
+ * @author Chris Laprun
+ * @version $Revision$
+ */
+public class WSRPVersionBean
+{
+ public String getVersion()
+ {
+ return WSRPConstants.WSRP_SERVICE_VERSION;
+ }
+}
Modified: components/wsrp/branches/2.0.x/admin-gui/src/main/webapp/WEB-INF/=
classes/Resource.properties
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- components/wsrp/branches/2.0.x/admin-gui/src/main/webapp/WEB-INF/classe=
s/Resource.properties 2011-01-04 07:51:30 UTC (rev 5674)
+++ components/wsrp/branches/2.0.x/admin-gui/src/main/webapp/WEB-INF/classe=
s/Resource.properties 2011-01-04 09:57:01 UTC (rev 5675)
@@ -1,6 +1,6 @@
#
# JBoss, a division of Red Hat
-# Copyright 2010, Red Hat Middleware, LLC, and individual
+# Copyright 2011, 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.
@@ -220,4 +220,5 @@
org.jboss.portal.object.name.admin.WSRP=3DWSRP
=
INVALID_NAME_ERROR=3D''{0}'' is an invalid {1} name: Cannot be null, empty=
or contain '/', '.', '\\', '<', '>', '(', ')', '=3D' or '%5c'
-DUPLICATE_ERROR=3DA {1} named ''{0}'' already exists! =
\ No newline at end of file
+DUPLICATE_ERROR=3DA {1} named ''{0}'' already exists! =
+unavailable_service =3D WSRP service is unavailble. Please activate it bef=
ore using this portlet.
\ No newline at end of file
Modified: components/wsrp/branches/2.0.x/admin-gui/src/main/webapp/WEB-INF/=
classes/Resource_fr.properties
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- components/wsrp/branches/2.0.x/admin-gui/src/main/webapp/WEB-INF/classe=
s/Resource_fr.properties 2011-01-04 07:51:30 UTC (rev 5674)
+++ components/wsrp/branches/2.0.x/admin-gui/src/main/webapp/WEB-INF/classe=
s/Resource_fr.properties 2011-01-04 09:57:01 UTC (rev 5675)
@@ -1,6 +1,6 @@
#
# JBoss, a division of Red Hat
-# Copyright 2010, Red Hat Middleware, LLC, and individual
+# Copyright 2011, 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.
@@ -182,4 +182,5 @@
edit_consumer_import_title=3DPortlets en import
bean_consumermanager_refresh_failure_wsdl=3DLe rafra\u00eechissement a \u0=
0e9chou\u00e9 (probablement \u00e0 cause d'URL WSDL non valide)
producer_config_wsdl_v1=3DAdresse WSDL pour le Producteur WSRP v1:
-producer_config_wsdl_v2=3DAdresse WSDL pour le Producteur WSRP v2:
\ No newline at end of file
+producer_config_wsdl_v2=3DAdresse WSDL pour le Producteur WSRP v2:
+unavailable_service=3DLe service WSRP n''est pas disponible. Veuillez l''a=
ctiver avant d'utiliser cette portlet.
\ No newline at end of file
Modified: components/wsrp/branches/2.0.x/admin-gui/src/main/webapp/WEB-INF/=
faces-config.xml
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- components/wsrp/branches/2.0.x/admin-gui/src/main/webapp/WEB-INF/faces-=
config.xml 2011-01-04 07:51:30 UTC (rev 5674)
+++ components/wsrp/branches/2.0.x/admin-gui/src/main/webapp/WEB-INF/faces-=
config.xml 2011-01-04 09:57:01 UTC (rev 5675)
@@ -1,7 +1,7 @@
+
+
Modified: components/wsrp/branches/2.0.x/admin-gui/src/main/webapp/jsf/comm=
on/template.xhtml
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- components/wsrp/branches/2.0.x/admin-gui/src/main/webapp/jsf/common/tem=
plate.xhtml 2011-01-04 07:51:30 UTC (rev 5674)
+++ components/wsrp/branches/2.0.x/admin-gui/src/main/webapp/jsf/common/tem=
plate.xhtml 2011-01-04 09:57:01 UTC (rev 5675)
@@ -1,6 +1,6 @@
=
+ xmlns:h=3D"http://java.sun.com/jsf/html">
- An Error Has Occured.
+
+
+
+
+
+
+ #{i18n.unavailable_service}
+
+
+
\ No newline at end of file
Modified: components/wsrp/branches/2.0.x/admin-gui/src/main/webapp/jsf/erro=
rTemplate.xhtml
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- components/wsrp/branches/2.0.x/admin-gui/src/main/webapp/jsf/errorTempl=
ate.xhtml 2011-01-04 07:51:30 UTC (rev 5674)
+++ components/wsrp/branches/2.0.x/admin-gui/src/main/webapp/jsf/errorTempl=
ate.xhtml 2011-01-04 09:57:01 UTC (rev 5675)
@@ -1,6 +1,6 @@