Author: chris.laprun(a)jboss.com
Date: 2010-11-19 17:29:29 -0500 (Fri, 19 Nov 2010)
New Revision: 5189
Modified:
components/wsrp/trunk/admin-gui/src/main/java/org/gatein/wsrp/admin/ui/BeanContext.java
components/wsrp/trunk/admin-gui/src/main/java/org/gatein/wsrp/admin/ui/JSFBeanContext.java
components/wsrp/trunk/admin-gui/src/main/java/org/gatein/wsrp/admin/ui/ProducerBean.java
components/wsrp/trunk/admin-gui/src/main/webapp/WEB-INF/classes/Resource.properties
components/wsrp/trunk/admin-gui/src/main/webapp/WEB-INF/classes/Resource_fr.properties
components/wsrp/trunk/admin-gui/src/main/webapp/jsf/producer/producer.xhtml
components/wsrp/trunk/admin-gui/src/main/webapp/styles/style.css
components/wsrp/trunk/admin-gui/src/test/java/org/gatein/wsrp/other/ConsumerBeanTestCase.java
Log:
- GTNWSRP-168: Display WSDL address for producer (currently hardcodes context path and
servlet path, though).
Modified:
components/wsrp/trunk/admin-gui/src/main/java/org/gatein/wsrp/admin/ui/BeanContext.java
===================================================================
---
components/wsrp/trunk/admin-gui/src/main/java/org/gatein/wsrp/admin/ui/BeanContext.java 2010-11-19
21:55:42 UTC (rev 5188)
+++
components/wsrp/trunk/admin-gui/src/main/java/org/gatein/wsrp/admin/ui/BeanContext.java 2010-11-19
22:29:29 UTC (rev 5189)
@@ -81,6 +81,8 @@
protected abstract Locale getLocale();
+ public abstract String getServerAddress();
+
public void createErrorMessage(String localizedMessageId, Object... params)
{
createLocalizedMessage(STATUS, localizedMessageId, getErrorSeverity(), params);
Modified:
components/wsrp/trunk/admin-gui/src/main/java/org/gatein/wsrp/admin/ui/JSFBeanContext.java
===================================================================
---
components/wsrp/trunk/admin-gui/src/main/java/org/gatein/wsrp/admin/ui/JSFBeanContext.java 2010-11-19
21:55:42 UTC (rev 5188)
+++
components/wsrp/trunk/admin-gui/src/main/java/org/gatein/wsrp/admin/ui/JSFBeanContext.java 2010-11-19
22:29:29 UTC (rev 5189)
@@ -23,12 +23,15 @@
package org.gatein.wsrp.admin.ui;
+import org.gatein.common.net.URLTools;
import org.gatein.common.util.ParameterValidation;
import javax.faces.application.FacesMessage;
import javax.faces.component.UIComponent;
import javax.faces.component.UIViewRoot;
import javax.faces.context.FacesContext;
+import javax.portlet.PortletRequest;
+import javax.servlet.http.HttpServletRequest;
import java.util.Locale;
import java.util.Map;
@@ -137,6 +140,28 @@
return getRequestLocale();
}
+ public String getServerAddress()
+ {
+ Object request =
FacesContext.getCurrentInstance().getExternalContext().getRequest();
+ String serverAddress;
+ if (request instanceof PortletRequest)
+ {
+ // basically copy URLTools.getServerAddressFrom implementation
+ PortletRequest portletRequest = (PortletRequest)request;
+ String scheme = portletRequest.getScheme();
+ String host = portletRequest.getServerName();
+ int port = portletRequest.getServerPort();
+
+ return scheme + URLTools.SCH_END + host + URLTools.PORT_END + port;
+ }
+ else
+ {
+ serverAddress = URLTools.getServerAddressFrom((HttpServletRequest)request);
+ }
+
+ return serverAddress;
+ }
+
public static Locale getRequestLocale()
{
return FacesContext.getCurrentInstance().getExternalContext().getRequestLocale();
Modified:
components/wsrp/trunk/admin-gui/src/main/java/org/gatein/wsrp/admin/ui/ProducerBean.java
===================================================================
---
components/wsrp/trunk/admin-gui/src/main/java/org/gatein/wsrp/admin/ui/ProducerBean.java 2010-11-19
21:55:42 UTC (rev 5188)
+++
components/wsrp/trunk/admin-gui/src/main/java/org/gatein/wsrp/admin/ui/ProducerBean.java 2010-11-19
22:29:29 UTC (rev 5189)
@@ -246,6 +246,16 @@
return registrationConfiguration;
}
+ public String getV1WSDL()
+ {
+ return beanContext.getServerAddress() +
"/wsrp-producer/v1/MarkupService?wsdl";
+ }
+
+ public String getV2WSDL()
+ {
+ return beanContext.getServerAddress() +
"/wsrp-producer/v2/MarkupService?wsdl";
+ }
+
private static class RegistrationConfiguration
{
private List<RegistrationPropertyDescription> registrationProperties;
Modified:
components/wsrp/trunk/admin-gui/src/main/webapp/WEB-INF/classes/Resource.properties
===================================================================
---
components/wsrp/trunk/admin-gui/src/main/webapp/WEB-INF/classes/Resource.properties 2010-11-19
21:55:42 UTC (rev 5188)
+++
components/wsrp/trunk/admin-gui/src/main/webapp/WEB-INF/classes/Resource.properties 2010-11-19
22:29:29 UTC (rev 5189)
@@ -168,6 +168,8 @@
producer_config_add_reg_prop = Add property
producer_config_save = Save
producer_config_cancel = Cancel
+producer_config_wsdl_v1 = Producer WSDL address for WSRP v1:
+producer_config_wsdl_v2 = Producer WSDL address for WSRP v2:
## Localized messages in JSF beans
Modified:
components/wsrp/trunk/admin-gui/src/main/webapp/WEB-INF/classes/Resource_fr.properties
===================================================================
---
components/wsrp/trunk/admin-gui/src/main/webapp/WEB-INF/classes/Resource_fr.properties 2010-11-19
21:55:42 UTC (rev 5188)
+++
components/wsrp/trunk/admin-gui/src/main/webapp/WEB-INF/classes/Resource_fr.properties 2010-11-19
22:29:29 UTC (rev 5189)
@@ -180,4 +180,6 @@
edit_consumer_export_title=Portlets en export
edit_consumer_import=Importer portlets
edit_consumer_import_title=Portlets en import
-bean_consumermanager_refresh_failure_wsdl=Le rafra\u00eechissement a \u00e9chou\u00e9
(probablement \u00e0 cause d'URL WSDL non valide)
\ No newline at end of file
+bean_consumermanager_refresh_failure_wsdl=Le rafra\u00eechissement a \u00e9chou\u00e9
(probablement \u00e0 cause d'URL WSDL non valide)
+producer_config_wsdl_v1=Adresse WSDL pour le Producteur WSRP v1:
+producer_config_wsdl_v2=Adresse WSDL pour le Producteur WSRP v2:
\ No newline at end of file
Modified: components/wsrp/trunk/admin-gui/src/main/webapp/jsf/producer/producer.xhtml
===================================================================
--- components/wsrp/trunk/admin-gui/src/main/webapp/jsf/producer/producer.xhtml 2010-11-19
21:55:42 UTC (rev 5188)
+++ components/wsrp/trunk/admin-gui/src/main/webapp/jsf/producer/producer.xhtml 2010-11-19
22:29:29 UTC (rev 5189)
@@ -21,6 +21,8 @@
~ 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-->
+
+
<ui:decorate template="producerTemplate.xhtml"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
@@ -31,6 +33,16 @@
<ui:param name="title"
value="#{i18n.producer_config_title}"/>
<ui:define name="content">
+
+ <p id="producer-wsdl">
+ #{i1
+ 8n
+ .producer_config_wsdl_v1} <h:outputLink
value="#{producer.v1WSDL}">#{producer.v1WSDL}</h:outputLink>
+ <br/>
+ #{i18n.producer_config_wsdl_v2} <h:outputLink
value="#{producer.v2WSDL}">#{ .v
+ 2WSDL}</h:outputLink>
+ </p>
+
<h:form id="producer-form">
<h:panelGrid columns="2" width="100%">
<h:selectBooleanCheckbox id="cons-reg-req-check"
@@ -99,21 +111,28 @@
rowClasses="EvenRow,OddRow"
styleClass="UIGrid ConsumerGrid"
width="100%">
<h:column>
- <f:facet
name="header">#{i18n.producer_config_reg_prop_name}</f:facet>
+ <f:facet name="header">#{i18n.pro
+ e}</f:facet>
<h:inputText id="name"
value="#{property.nameAsString}" size="21"/>
</h:column>
<h:column>
- <f:facet
name="header">#{i18n.producer_config_reg_prop_type}</f:facet>
+ <f:facet name="header">#{i1
+ _p
+ rop_type}</f:facet>
<h:selectOneListbox id="producer-list"
disabled="true">
<f:selectItems
value="#{producer.supportedPropertyTypes}"/>
</h:selectOneListbox>
</h:column>
<h:column>
- <f:facet
name="header">#{i18n.producer_config_reg_prop_label}</f:facet>
+ <f:facet name="header">#{i18
+ p_
+ label}</f:facet>
<h:inputText id="label"
value="#{property.label}" size="21"/>
</h:column>
<h:column>
- <f:facet
name="header">#{i18n.producer_config_reg_prop_hint}</f:facet>
+ <f:facet name="header">#{i1
+ op
+ _hint}</f:facet>
<h:inputText id="hint"
value="#{property.hint}" size="21"/>
</h:column>
<h:column>
Modified: components/wsrp/trunk/admin-gui/src/main/webapp/styles/style.css
===================================================================
--- components/wsrp/trunk/admin-gui/src/main/webapp/styles/style.css 2010-11-19 21:55:42
UTC (rev 5188)
+++ components/wsrp/trunk/admin-gui/src/main/webapp/styles/style.css 2010-11-19 22:29:29
UTC (rev 5189)
@@ -412,3 +412,13 @@
width: 7%;
}
+.wsrp-consumers-ui #producer-wsdl {
+ border: 1px solid #fc6;
+ font-weight: bold;
+ color: #fff;
+ font-size: 11px;
+ background-color: #ffa200;
+ -moz-border-radius: 6px;
+ -webkit-border-radius: 6px;
+ padding: .5em;
+}
\ No newline at end of file
Modified:
components/wsrp/trunk/admin-gui/src/test/java/org/gatein/wsrp/other/ConsumerBeanTestCase.java
===================================================================
---
components/wsrp/trunk/admin-gui/src/test/java/org/gatein/wsrp/other/ConsumerBeanTestCase.java 2010-11-19
21:55:42 UTC (rev 5188)
+++
components/wsrp/trunk/admin-gui/src/test/java/org/gatein/wsrp/other/ConsumerBeanTestCase.java 2010-11-19
22:29:29 UTC (rev 5189)
@@ -151,6 +151,11 @@
return Locale.getDefault();
}
+ public String getServerAddress()
+ {
+ throw new NotYetImplemented();
+ }
+
public Map<String, Object> getSessionMap()
{
throw new NotYetImplemented();