Author: chris.laprun(a)jboss.com
Date: 2007-03-14 01:34:40 -0400 (Wed, 14 Mar 2007)
New Revision: 6661
Added:
trunk/wsrp/src/main/org/jboss/portal/wsrp/admin/
trunk/wsrp/src/main/org/jboss/portal/wsrp/admin/ui/
trunk/wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ConsumerManagerBean.java
trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/faces-config.xml
trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/jsf/
trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/jsf/consumers/
trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/jsf/consumers/consumers.xhtml
trunk/wsrp/src/resources/portal-wsrp-war/style.css
Modified:
trunk/wsrp/build.xml
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java
trunk/wsrp/src/resources/portal-wsrp-sar/META-INF/jboss-service.xml
trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/jboss-portlet.xml
trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/portlet.xml
trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/web.xml
trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/wsrp-object.xml
Log:
- Started JSF implementation of WSRP Consumers configuration.
- Renamed portal.wsrp:service=ConsumersRegistry service to
portal.wsrp:service=ConsumerRegistry.
- Added ProducerInfo.isRegistered method.
Modified: trunk/wsrp/build.xml
===================================================================
--- trunk/wsrp/build.xml 2007-03-14 05:32:02 UTC (rev 6660)
+++ trunk/wsrp/build.xml 2007-03-14 05:34:40 UTC (rev 6661)
@@ -138,6 +138,7 @@
<path refid="jboss.portal-portlet.classpath"/>
<path refid="jboss.portal-portlet-federation.classpath"/>
<path refid="jboss.portal-test.classpath"/>
+ <path refid="jboss.portal-faces.classpath"/>
</path>
<!--+=======================================+-->
@@ -281,6 +282,12 @@
</fileset>
<!--<fileset
dir="${build.resources}/portal-wsrp-lib-jar"/>-->
</jar>
+ <copy todir="${build.resources}/portal-wsrp-war/lib">
+ <!-- For JSF -->
+ <fileset dir="../core-admin/src/etc/sun-jsf"
includes="jsf-example.jar"/>
+ <fileset dir="${facelets.facelets.lib}"
includes="jsf-facelets.jar"/>
+ <fileset dir="${el.el.lib}"
includes="el-api.jar,el-ri.jar"/>
+ </copy>
<jar jarfile="${build.lib}/portal-wsrp-test-lib.jar">
<fileset dir="${build.classes}">
<include name="org/jboss/portal/test/**"/>
Added: trunk/wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ConsumerManagerBean.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ConsumerManagerBean.java
(rev 0)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ConsumerManagerBean.java 2007-03-14
05:34:40 UTC (rev 6661)
@@ -0,0 +1,73 @@
+/*
+* 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.
+*/
+
+package org.jboss.portal.wsrp.admin.ui;
+
+import org.jboss.portal.wsrp.consumer.ConsumerRegistry;
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
+ * @version $Revision$
+ * @since 2.6
+ */
+public class ConsumerManagerBean
+{
+ private ConsumerRegistry registry;
+
+ public ConsumerRegistry getRegistry()
+ {
+ return registry;
+ }
+
+ public void setRegistry(ConsumerRegistry registry)
+ {
+ this.registry = registry;
+ }
+
+ public Collection getConsumers()
+ {
+ return new ArrayList(registry.getConfiguredConsumers());
+ }
+
+ public void activateConsumer()
+ {
+
+ }
+
+ public void registerConsumer()
+ {
+
+ }
+
+ public void destroyConsumer()
+ {
+
+ }
+
+ public void configureConsumer()
+ {
+
+ }
+}
\ No newline at end of file
Property changes on:
trunk/wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ConsumerManagerBean.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java 2007-03-14
05:32:02 UTC (rev 6660)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java 2007-03-14
05:34:40 UTC (rev 6661)
@@ -161,6 +161,11 @@
this.persistentRegistrationInfo = registrationInfo;
}
+ public boolean isRegistered()
+ {
+ return persistentRegistrationInfo != null &&
persistentRegistrationInfo.isRegistrationValid();
+ }
+
/**
* Determines whether the associated consumer is active.
*
Modified: trunk/wsrp/src/resources/portal-wsrp-sar/META-INF/jboss-service.xml
===================================================================
--- trunk/wsrp/src/resources/portal-wsrp-sar/META-INF/jboss-service.xml 2007-03-14
05:32:02 UTC (rev 6660)
+++ trunk/wsrp/src/resources/portal-wsrp-sar/META-INF/jboss-service.xml 2007-03-14
05:34:40 UTC (rev 6661)
@@ -129,7 +129,7 @@
<attribute
name="DefaultWSRPLocation">default-wsrp.xml</attribute>
<depends>jboss.system:service=MainDeployer</depends>
<depends optional-attribute-name="ConsumerRegistry"
-
proxy-type="attribute">portal.wsrp:service=ConsumersRegistry</depends>
+
proxy-type="attribute">portal.wsrp:service=ConsumerRegistry</depends>
<depends optional-attribute-name="EntityResolver"
proxy-type="attribute">portal.wsrp:service=EntityResolver</depends>
</mbean>
@@ -151,7 +151,7 @@
<!-- Consumers registry for WSRP consumers -->
<mbean code="org.jboss.portal.wsrp.consumer.ConsumerRegistryService"
- name="portal.wsrp:service=ConsumersRegistry"
+ name="portal.wsrp:service=ConsumerRegistry"
xmbean-dd=""
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
<xmbean/>
<depends>portal:service=Hibernate,type=WSRPConsumer</depends>
Added: trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/faces-config.xml
===================================================================
--- trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/faces-config.xml
(rev 0)
+++ trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/faces-config.xml 2007-03-14 05:34:40
UTC (rev 6661)
@@ -0,0 +1,52 @@
+<?xml version="1.0"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2007, 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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces
Config 1.0//EN"
+ "http://java.sun.com/dtd/web-facesconfig_1_0.dtd">
+
+<faces-config>
+
+ <!-- Facelet portlet view handler-->
+ <application>
+
<view-handler>com.sun.facelets.FaceletPortletViewHandler</view-handler>
+ </application>
+
+ <managed-bean>
+ <managed-bean-name>consumersMgr</managed-bean-name>
+
<managed-bean-class>org.jboss.portal.wsrp.admin.ui.ConsumerManagerBean</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ <managed-property>
+ <property-name>registry</property-name>
+
<property-class>org.jboss.portal.wsrp.consumer.ConsumerRegistry</property-class>
+ <value>#{applicationScope.ConsumerRegistry}</value>
+ </managed-property>
+ </managed-bean>
+
+ <navigation-rule>
+ <navigation-case>
+ <from-outcome>index</from-outcome>
+ <to-view-id>/WEB-INF/jsf/consumers/consumers.xhtml</to-view-id>
+ </navigation-case>
+ </navigation-rule>
+</faces-config>
Modified: trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/jboss-portlet.xml
===================================================================
--- trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/jboss-portlet.xml 2007-03-14 05:32:02
UTC (rev 6660)
+++ trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/jboss-portlet.xml 2007-03-14 05:34:40
UTC (rev 6661)
@@ -22,10 +22,19 @@
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!DOCTYPE portlet-app PUBLIC "-//JBoss Portal//DTD JBoss Portlet 2.6//EN"
"http://www.jboss.org/portal/dtd/jboss-portlet_2_6.dtd">
<portlet-app>
+ <portlet>
+ <portlet-name>WSRPConsumersConfigurationPortlet</portlet-name>
+ <transaction>
+ <trans-attribute>Required</trans-attribute>
+ </transaction>
+ <header-content>
+ <link rel="stylesheet" type="text/css"
href="/style.css" title="" media="screen"/>
+ </header-content>
+ </portlet>
<service>
- <service-name>ConsumersRegistry</service-name>
+ <service-name>ConsumerRegistry</service-name>
<service-class>org.jboss.portal.wsrp.consumer.ConsumerRegistry</service-class>
- <service-ref>portal.wsrp:service=ConsumersRegistry</service-ref>
+ <service-ref>portal.wsrp:service=ConsumerRegistry</service-ref>
</service>
</portlet-app>
Added: trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/jsf/consumers/consumers.xhtml
===================================================================
--- trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/jsf/consumers/consumers.xhtml
(rev 0)
+++
trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/jsf/consumers/consumers.xhtml 2007-03-14
05:34:40 UTC (rev 6661)
@@ -0,0 +1,53 @@
+<div class="wsrp-consumers-ui"
+
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:c="http://java.sun.com/jstl/core">
+
+ <h1 class="portlet">Configured WSRP Consumers</h1>
+
+ <hr/>
+
+ <h:form>
+ <table width="100%" class="portlet-table-body">
+ <thead class="portlet-table-header">
+ <tr>
+ <th>Consumer</th>
+ <th>Actions</th>
+ </tr>
+ </thead>
+ <tfoot class="portlet-table-footer">
+ <tr>
+ <th>Consumer</th>
+ <th>Actions</th>
+ </tr>
+ </tfoot>
+ <tbody>
+ <c:forEach items="#{consumersMgr.consumers}"
var="consumer" varStatus="status">
+ <tr class="status.index % 2 == 0 ? 'portlet-table-body' :
'portlet-table-alternate'">
+ <td>
+ <h:commandLink
action="#{consumersMgr.configureConsumer}">
+ <h:outputText value="#{consumer.producerId}"/>
+ </h:commandLink>
+ </td>
+ <td>
+ <h:commandLink
action="#{consumersMgr.configureConsumer}">
+ <h:outputText value="Configure"/>
+ </h:commandLink> | <h:commandLink
action="#{consumersMgr.activateConsumer}">
+ <h:outputText value='#{consumer.producerInfo.active ?
"Deactivate" : "Activate"}'/>
+ </h:commandLink>
+ <c:if test="#{consumer.producerInfo.active}"> |
<h:commandLink
+ action="#{consumersMgr.registerConsumer}">
+ <h:outputText value="#{consumer.producerInfo.registered ?
'Deregister' : 'Register'}"/>
+ </h:commandLink>
+ </c:if> | <h:commandLink
action="#{consumersMgr.destroyConsumer}">
+ <h:outputText value="Destroy"/>
+ </h:commandLink>
+ </td>
+ </tr>
+ </c:forEach>
+ </tbody>
+ </table>
+ </h:form>
+</div>
\ No newline at end of file
Modified: trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/portlet.xml
===================================================================
--- trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/portlet.xml 2007-03-14 05:32:02 UTC
(rev 6660)
+++ trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/portlet.xml 2007-03-14 05:34:40 UTC
(rev 6661)
@@ -1,6 +1,6 @@
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~ JBoss, a division of Red Hat ~
- ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
+ ~ Copyright 2007, 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. ~
@@ -29,14 +29,20 @@
<description>Configuration portlet for WSRP remote
producers.</description>
<portlet-name>WSRPConsumersConfigurationPortlet</portlet-name>
<display-name>WSRP Consumers Configuration</display-name>
-
<portlet-class>org.jboss.portal.wsrp.portlet.consumers.WSRPConsumerConfigurationPortlet</portlet-class>
+
<portlet-class>org.jboss.portal.faces.portlet.JSFMetaBridgePortlet</portlet-class>
+ <init-param>
+ <name>VIEW</name>
+ <value>/WEB-INF/jsf/consumers/consumers.xhtml</value>
+ </init-param>
+ <expiration-cache>-1</expiration-cache>
<supports>
<mime-type>text/html</mime-type>
<portlet-mode>VIEW</portlet-mode>
</supports>
<portlet-info>
<title>WSRP Consumers Configuration</title>
+ <keywords>management,admin,wsrp</keywords>
</portlet-info>
- </portlet>
+ </portlet>
</portlet-app>
Modified: trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/web.xml
===================================================================
--- trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/web.xml 2007-03-14 05:32:02 UTC (rev
6660)
+++ trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/web.xml 2007-03-14 05:34:40 UTC (rev
6661)
@@ -32,23 +32,27 @@
<filter-name>ServletAccessFilter</filter-name>
<filter-class>org.jboss.portal.wsrp.servlet.ServletAccessFilter</filter-class>
</filter>
+ <filter-mapping>
+ <filter-name>ServletAccessFilter</filter-name>
+ <url-pattern>/*</url-pattern>
+ </filter-mapping>
+
+ <!-- Wraps WSRP requests in transactions -->
<filter>
<filter-name>TransactionFilter</filter-name>
<filter-class>org.jboss.portal.wsrp.servlet.TransactionFilter</filter-class>
</filter>
+ <filter-mapping>
+ <filter-name>TransactionFilter</filter-name>
+ <url-pattern>/*</url-pattern>
+ </filter-mapping>
+
+ <!-- Fixes port numbers that are not properly propagated by JBoss WS -->
<filter>
<filter-name>WSDLPortFixFilter</filter-name>
<filter-class>org.jboss.portal.wsrp.servlet.WSDLPortFixFilter</filter-class>
</filter>
<filter-mapping>
- <filter-name>ServletAccessFilter</filter-name>
- <url-pattern>/*</url-pattern>
- </filter-mapping>
- <filter-mapping>
- <filter-name>TransactionFilter</filter-name>
- <url-pattern>/*</url-pattern>
- </filter-mapping>
- <filter-mapping>
<filter-name>WSDLPortFixFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
@@ -92,7 +96,7 @@
</init-param>
</servlet>
- <!-- Mappings -->
+ <!-- WSRP endpoint mappings -->
<servlet-mapping>
<servlet-name>ServiceDescriptionService</servlet-name>
<url-pattern>/ServiceDescriptionService</url-pattern>
@@ -109,6 +113,60 @@
<servlet-name>PortletManagementService</servlet-name>
<url-pattern>/PortletManagementService</url-pattern>
</servlet-mapping>
+
+ <!-- MyFaces specific configuration -->
+ <context-param>
+ <param-name>org.apache.myfaces.ALLOW_JAVASCRIPT</param-name>
+ <param-value>true</param-value>
+ </context-param>
+ <context-param>
+ <param-name>org.apache.myfaces.DETECT_JAVASCRIPT</param-name>
+ <param-value>false</param-value>
+ </context-param>
+ <context-param>
+ <param-name>org.apache.myfaces.AUTO_SCROLL</param-name>
+ <param-value>false</param-value>
+ </context-param>
+ <context-param>
+ <param-name>org.apache.myfaces.CHECK_EXTENSIONS_FILTER</param-name>
+ <param-value>false</param-value>
+ </context-param>
+ <context-param>
+ <param-name>org.apache.myfaces.PRETTY_HTML</param-name>
+ <param-value>true</param-value>
+ </context-param>
+
+ <!-- Facelet configuration -->
+ <context-param>
+ <param-name>facelets.DEVELOPMENT</param-name>
+ <param-value>true</param-value>
+ </context-param>
+ <context-param>
+ <param-name>facelets.SKIP_COMMENTS</param-name>
+ <param-value>true</param-value>
+ </context-param>
+
+ <!-- JSF configuration -->
+ <context-param>
+ <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
+ <param-value>.xhtml</param-value>
+ </context-param>
+ <context-param>
+ <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
+ <param-value>server</param-value>
+ </context-param>
+
+ <!-- JSF entry point -->
+ <servlet>
+ <servlet-name>Faces Servlet</servlet-name>
+ <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+
+ <!-- Bootstrap MyFaces -->
+ <listener>
+
<listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
+ </listener>
</web-app>
Modified: trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/wsrp-object.xml
===================================================================
--- trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/wsrp-object.xml 2007-03-14 05:32:02
UTC (rev 6660)
+++ trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/wsrp-object.xml 2007-03-14 05:34:40
UTC (rev 6661)
@@ -22,9 +22,7 @@
~ 02110-1301 USA, or see the FSF site:
http://www.fsf.org. ~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
-<!DOCTYPE deployments PUBLIC
- "-//JBoss Portal//DTD Portal Object 2.6//EN"
- "http://www.jboss.org/portal/dtd/portal-object_2_6.dtd">
+<!DOCTYPE deployments PUBLIC "-//JBoss Portal//DTD Portal Object 2.6//EN"
"http://www.jboss.org/portal/dtd/portal-object_2_6.dtd">
<deployments>
<deployment>
@@ -32,18 +30,24 @@
<if-exists>keep</if-exists>
<page>
<page-name>WSRP</page-name>
+ <security-constraint>
+ <policy-permission>
+ <action-name>viewrecursive</action-name>
+ <role-name>Admin</role-name>
+ </policy-permission>
+ </security-constraint>
<window>
<window-name>WSRPConsumersConfigurationPortletWindow</window-name>
<instance-ref>WSRPConsumersConfigurationPortletInstance</instance-ref>
<region>center</region>
<height>0</height>
</window>
- <security-constraint>
- <policy-permission>
- <role-name>Admin</role-name>
- <action-name>viewrecursive</action-name>
- </policy-permission>
- </security-constraint>
+ <window>
+ <window-name>CatalogPortletWindow</window-name>
+ <instance-ref>CatalogPortletInstance</instance-ref>
+ <region>left</region>
+ <height>0</height>
+ </window>
</page>
</deployment>
</deployments>
Added: trunk/wsrp/src/resources/portal-wsrp-war/style.css
===================================================================
--- trunk/wsrp/src/resources/portal-wsrp-war/style.css (rev 0)
+++ trunk/wsrp/src/resources/portal-wsrp-war/style.css 2007-03-14 05:34:40 UTC (rev 6661)
@@ -0,0 +1,16 @@
+.wsrp-consumers-ui table {
+ border: 0;
+ border-collapse: separate;
+}
+
+.wsrp-consumers-ui th {
+ text-align: left;
+ border: 0;
+ border-bottom: 1px solid;
+}
+
+.wsrp-consumers-ui td {
+ border: 0;
+ padding-bottom: 2px;
+ padding-top: 2px;
+}