JBoss Portal SVN: r6655 - in trunk: wsrp/src/resources/portal-wsrp-war/WEB-INF/jsp/consumers and 1 other directory.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2007-03-13 17:10:18 -0400 (Tue, 13 Mar 2007)
New Revision: 6655
Modified:
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/objectNavigation.xhtml
trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/jsp/consumers/consumer.jsp
Log:
- Minor fixes.
- WSRP GUI is now being re-written in JSF.
Modified: trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/objectNavigation.xhtml
===================================================================
--- trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/objectNavigation.xhtml 2007-03-13 17:30:51 UTC (rev 6654)
+++ trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/objectNavigation.xhtml 2007-03-13 21:10:18 UTC (rev 6655)
@@ -6,111 +6,113 @@
xmlns:pfc="http://www.jboss.com/portal/facelet/common"
xmlns:c="http://java.sun.com/jstl/core">
- <h:form>
+<h:form>
- <table width="100%">
+<table width="100%">
- <c:if test="#{not empty portalobjectmgr.selectedObject.portals}">
- <tbody class="portlet-section-header">
- <tr>
- <th>Portal</th>
- <th>Actions</th>
- </tr>
- </tbody>
- <tbody>
- <c:forEach items="#{portalobjectmgr.selectedObject.portals}" var="object" varStatus="status">
- <tr class="#{status.index % 2 == 0 ? 'portlet-section-body' : 'portlet-section-alternate'}">
- <td>
- <h:commandLink action="#{portalobjectmgr.selectObject}">
- <h:outputText value="#{object.name}"/>
- <f:param name="id" value="#{object.id}"/>
- </h:commandLink>
- </td>
- <td>
- <h:commandLink action="editPortalSecurity" actionListener="#{portalobjectmgr.selectObject}">
- <h:outputText value="Security"/>
- <f:param name="id" value="#{object.id}"/>
- </h:commandLink> | <h:commandLink action="editPortalTheme" actionListener="#{portalobjectmgr.selectObject}">
- <h:outputText value="Theme"/>
- <f:param name="id" value="#{object.id}"/>
- </h:commandLink> | <h:commandLink action="objects" actionListener="#{portalobjectmgr.destroyObject}">
- <h:outputText value="Destroy"/>
- <f:param name="id" value="#{object.id}"/>
- </h:commandLink>
- </td>
- </tr>
- </c:forEach>
- </tbody>
- </c:if>
+<c:if test="#{not empty portalobjectmgr.selectedObject.portals}">
+ <thead class="portlet-section-header">
+ <tr>
+ <th>Portal</th>
+ <th>Actions</th>
+ </tr>
+ </thead>
+ <tbody>
+ <c:forEach items="#{portalobjectmgr.selectedObject.portals}" var="object" varStatus="status">
+ <tr class="#{status.index % 2 == 0 ? 'portlet-section-body' : 'portlet-section-alternate'}">
+ <td>
+ <h:commandLink action="#{portalobjectmgr.selectObject}">
+ <h:outputText value="#{object.name}"/>
+ <f:param name="id" value="#{object.id}"/>
+ </h:commandLink>
+ </td>
+ <td>
+ <h:commandLink action="editPortalSecurity" actionListener="#{portalobjectmgr.selectObject}">
+ <h:outputText value="Security"/>
+ <f:param name="id" value="#{object.id}"/>
+ </h:commandLink> | <h:commandLink action="editPortalTheme"
+ actionListener="#{portalobjectmgr.selectObject}">
+ <h:outputText value="Theme"/>
+ <f:param name="id" value="#{object.id}"/>
+ </h:commandLink> | <h:commandLink action="objects" actionListener="#{portalobjectmgr.destroyObject}">
+ <h:outputText value="Destroy"/>
+ <f:param name="id" value="#{object.id}"/>
+ </h:commandLink>
+ </td>
+ </tr>
+ </c:forEach>
+ </tbody>
+</c:if>
- <c:if test="#{not empty portalobjectmgr.selectedObject.pages}">
- <tbody class="portlet-section-header">
- <tr>
- <th>Page</th>
- <th>Actions</th>
- </tr>
- </tbody>
- <tbody>
- <c:forEach items="#{portalobjectmgr.selectedObject.pages}" var="object" varStatus="status">
- <tr class="#{status.index % 2 == 0 ? 'portlet-section-body' : 'portlet-section-alternate'}">
- <td>
- <h:commandLink action="#{portalobjectmgr.selectObject}">
- <h:outputText value="#{object.name}"/>
- <f:param name="id" value="#{object.id}"/>
- </h:commandLink>
- </td>
- <td>
- <h:commandLink action="editPageLayout" actionListener="#{portalobjectmgr.selectObject}">
- <h:outputText value="Layout"/>
- <f:param name="id" value="#{object.id}"/>
- </h:commandLink> | <h:commandLink action="editPageSecurity" actionListener="#{portalobjectmgr.selectObject}">
- <h:outputText value="Security"/>
- <f:param name="id" value="#{object.id}"/>
- </h:commandLink> | <h:commandLink action="editPageTheme" actionListener="#{portalobjectmgr.selectObject}">
- <h:outputText value="Theme"/>
- <f:param name="id" value="#{object.id}"/>
- </h:commandLink> | <h:commandLink action="objects" actionListener="#{portalobjectmgr.destroyObject}">
- <h:outputText value="Destroy"/>
- <f:param name="id" value="#{object.id}"/>
- </h:commandLink>
- </td>
- </tr>
- </c:forEach>
- </tbody>
- </c:if>
+<c:if test="#{not empty portalobjectmgr.selectedObject.pages}">
+ <thead class="portlet-section-header">
+ <tr>
+ <th>Page</th>
+ <th>Actions</th>
+ </tr>
+ </thead>
+ <tbody>
+ <c:forEach items="#{portalobjectmgr.selectedObject.pages}" var="object" varStatus="status">
+ <tr class="#{status.index % 2 == 0 ? 'portlet-section-body' : 'portlet-section-alternate'}">
+ <td>
+ <h:commandLink action="#{portalobjectmgr.selectObject}">
+ <h:outputText value="#{object.name}"/>
+ <f:param name="id" value="#{object.id}"/>
+ </h:commandLink>
+ </td>
+ <td>
+ <h:commandLink action="editPageLayout" actionListener="#{portalobjectmgr.selectObject}">
+ <h:outputText value="Layout"/>
+ <f:param name="id" value="#{object.id}"/>
+ </h:commandLink> | <h:commandLink action="editPageSecurity"
+ actionListener="#{portalobjectmgr.selectObject}">
+ <h:outputText value="Security"/>
+ <f:param name="id" value="#{object.id}"/>
+ </h:commandLink> | <h:commandLink action="editPageTheme" actionListener="#{portalobjectmgr.selectObject}">
+ <h:outputText value="Theme"/>
+ <f:param name="id" value="#{object.id}"/>
+ </h:commandLink> | <h:commandLink action="objects" actionListener="#{portalobjectmgr.destroyObject}">
+ <h:outputText value="Destroy"/>
+ <f:param name="id" value="#{object.id}"/>
+ </h:commandLink>
+ </td>
+ </tr>
+ </c:forEach>
+ </tbody>
+</c:if>
- <c:if test="#{not empty portalobjectmgr.selectedObject.windows}">
- <tbody class="portlet-section-header">
- <tr>
- <th>Window</th>
- <th>Actions</th>
- </tr>
- </tbody>
- <tbody>
- <c:forEach items="#{portalobjectmgr.selectedObject.windows}" var="object" varStatus="status">
- <tr class="#{status.index % 2 == 0 ? 'portlet-section-body' : 'portlet-section-alternate'}">
- <td>
- <h:commandLink action="#{portalobjectmgr.selectObject}">
- <h:outputText value="#{object.name}"/>
- <f:param name="id" value="#{object.id}"/>
- </h:commandLink>
- </td>
- <td>
- <h:commandLink action="editWindowTheme" actionListener="#{portalobjectmgr.selectObject}">
- <h:outputText value="Theme"/>
- <f:param name="id" value="#{object.id}"/>
- </h:commandLink> | <h:commandLink action="portals" actionListener="#{portalobjectmgr.destroyObject}">
- <h:outputText value="Destroy"/>
- <f:param name="id" value="#{object.id}"/>
- </h:commandLink>
- </td>
- </tr>
- </c:forEach>
- </tbody>
- </c:if>
+<c:if test="#{not empty portalobjectmgr.selectedObject.windows}">
+ <thead class="portlet-section-header">
+ <tr>
+ <th>Window</th>
+ <th>Actions</th>
+ </tr>
+ </thead>
+ <tbody>
+ <c:forEach items="#{portalobjectmgr.selectedObject.windows}" var="object" varStatus="status">
+ <tr class="#{status.index % 2 == 0 ? 'portlet-section-body' : 'portlet-section-alternate'}">
+ <td>
+ <h:commandLink action="#{portalobjectmgr.selectObject}">
+ <h:outputText value="#{object.name}"/>
+ <f:param name="id" value="#{object.id}"/>
+ </h:commandLink>
+ </td>
+ <td>
+ <h:commandLink action="editWindowTheme" actionListener="#{portalobjectmgr.selectObject}">
+ <h:outputText value="Theme"/>
+ <f:param name="id" value="#{object.id}"/>
+ </h:commandLink> | <h:commandLink action="portals" actionListener="#{portalobjectmgr.destroyObject}">
+ <h:outputText value="Destroy"/>
+ <f:param name="id" value="#{object.id}"/>
+ </h:commandLink>
+ </td>
+ </tr>
+ </c:forEach>
+ </tbody>
+</c:if>
- </table>
+</table>
- </h:form>
+</h:form>
</div>
Modified: trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/jsp/consumers/consumer.jsp
===================================================================
--- trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/jsp/consumers/consumer.jsp 2007-03-13 17:30:51 UTC (rev 6654)
+++ trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/jsp/consumers/consumer.jsp 2007-03-13 21:10:18 UTC (rev 6655)
@@ -40,9 +40,12 @@
<tr>
<th>Cache expiration:</th>
- <td><input type="text" name="cache-expiration"
- value="<%=info.getExpirationCacheSeconds().intValue()%>"/> seconds
- </td>
+ <%
+ Integer cache = info.getExpirationCacheSeconds();
+ String value = (cache != null) ? "" + cache.intValue() : "UNSET";
+ %>
+ <td><input type="text" name="cache-expiration" value="<%=value%>"/> (seconds before expiration)</td>
+
</tr>
<tr>
@@ -174,8 +177,10 @@
<tr>
<td colspan="2">
<input type="submit" name="editConsumer" value="Save" class="portlet-form-button"/>
- <a href="<portlet:renderURL>
- <portlet:param name="<%=WSRPConsumerConfigurationPortlet.OP%>" value="<%=WSRPConsumerConfigurationPortlet.OP_LIST%>"/></portlet:renderURL>">
+ <a href="<portlet:actionURL>
+ <portlet:param name="<%=WSRPConsumerConfigurationPortlet.OP%>" value="<%=WSRPConsumerConfigurationPortlet.OP_LIST%>"/>
+ <portlet:param name="<%=WSRPConsumerConfigurationPortlet.ID%>" value="<%=consumer.getProducerId()%>"/>
+ </portlet:actionURL>">
<input type="button" value="Cancel" class="portlet-form-button"/></a>
</td>
</tr>
17 years, 6 months
JBoss Portal SVN: r6654 - trunk/wsrp/src/main/org/jboss/portal/test/wsrp/framework/support.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2007-03-13 13:30:51 -0400 (Tue, 13 Mar 2007)
New Revision: 6654
Modified:
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/framework/support/MockConsumerRegistry.java
Log:
- Correctly set the expiration cache value from createConsumer.
Modified: trunk/wsrp/src/main/org/jboss/portal/test/wsrp/framework/support/MockConsumerRegistry.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/test/wsrp/framework/support/MockConsumerRegistry.java 2007-03-13 16:32:18 UTC (rev 6653)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/framework/support/MockConsumerRegistry.java 2007-03-13 17:30:51 UTC (rev 6654)
@@ -77,6 +77,7 @@
public WSRPConsumer createConsumer(String id, Integer expirationCacheSeconds)
{
MockWSRPConsumer consumer = new MockWSRPConsumer(id);
+ consumer.getProducerInfo().setExpirationCacheSeconds(expirationCacheSeconds);
consumers.put(id, consumer);
return consumer;
}
17 years, 6 months
JBoss Portal SVN: r6653 - in trunk: cms/src/main/org/jboss/portal/test/cms/commands and 12 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-03-13 12:32:18 -0400 (Tue, 13 Mar 2007)
New Revision: 6653
Added:
trunk/common/src/main/org/jboss/portal/common/util/CLResourceLoader.java
trunk/common/src/main/org/jboss/portal/common/util/ResourceLoader.java
trunk/faces/src/main/org/jboss/portal/faces/portlet/
trunk/faces/src/main/org/jboss/portal/faces/portlet/BridgeInfo.java
trunk/faces/src/main/org/jboss/portal/faces/portlet/BridgePortletConfig.java
trunk/faces/src/main/org/jboss/portal/faces/portlet/JSFMetaBridgePortlet.java
Removed:
trunk/common/src/main/org/jboss/portal/common/util/CLLoader.java
trunk/common/src/main/org/jboss/portal/common/util/Loader.java
Modified:
trunk/cms/src/main/org/jboss/portal/test/cms/JackrabbitTestCase.java
trunk/cms/src/main/org/jboss/portal/test/cms/commands/AbstractCommandTestCase.java
trunk/common/src/main/org/jboss/portal/common/logging/LoaderRepositorySelector.java
trunk/core-admin/build.xml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/portlet.xml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/web.xml
trunk/core/build.xml
trunk/faces/build.xml
trunk/jems/src/main/org/jboss/portal/jems/hibernate/SessionFactoryBinder.java
trunk/server/src/main/org/jboss/portal/server/config/ServerConfigService.java
trunk/theme/src/main/org/jboss/portal/test/theme/TestLayoutServiceImpl.java
trunk/theme/src/main/org/jboss/portal/test/theme/TestThemeServiceImpl.java
trunk/theme/src/main/org/jboss/portal/test/theme/render/TestRenderedMarkup.java
Log:
- JSF meta bridge portlet which allow to run with Sun RI or myfaces JSF implementation.
Modified: trunk/cms/src/main/org/jboss/portal/test/cms/JackrabbitTestCase.java
===================================================================
--- trunk/cms/src/main/org/jboss/portal/test/cms/JackrabbitTestCase.java 2007-03-13 13:19:38 UTC (rev 6652)
+++ trunk/cms/src/main/org/jboss/portal/test/cms/JackrabbitTestCase.java 2007-03-13 16:32:18 UTC (rev 6653)
@@ -28,7 +28,7 @@
import org.apache.jackrabbit.name.QName;
import org.jboss.portal.cms.impl.jcr.jackrabbit.JackrabbitJCRService;
import org.jboss.portal.cms.util.RepositoryUtil;
-import org.jboss.portal.common.util.CLLoader;
+import org.jboss.portal.common.util.CLResourceLoader;
import org.jboss.portal.common.util.LoaderResource;
import javax.jcr.Node;
@@ -36,7 +36,6 @@
import javax.jcr.Session;
import javax.jcr.Workspace;
import javax.jcr.nodetype.NodeTypeManager;
-import java.util.Map;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -56,7 +55,7 @@
super.setUp();
// Load config
- LoaderResource res = new CLLoader().getResource("jcr/repository.xml");
+ LoaderResource res = new CLResourceLoader().getResource("jcr/repository.xml");
String config = res.asString();
jcr = new JackrabbitJCRService();
Modified: trunk/cms/src/main/org/jboss/portal/test/cms/commands/AbstractCommandTestCase.java
===================================================================
--- trunk/cms/src/main/org/jboss/portal/test/cms/commands/AbstractCommandTestCase.java 2007-03-13 13:19:38 UTC (rev 6652)
+++ trunk/cms/src/main/org/jboss/portal/test/cms/commands/AbstractCommandTestCase.java 2007-03-13 16:32:18 UTC (rev 6653)
@@ -23,14 +23,13 @@
package org.jboss.portal.test.cms.commands;
import org.jboss.portal.cms.impl.jcr.JCRCMS;
-import org.jboss.portal.common.util.CLLoader;
+import org.jboss.portal.common.util.CLResourceLoader;
import org.jboss.portal.common.util.LoaderResource;
import org.jboss.portal.common.util.XML;
import org.jboss.portal.test.cms.AbstractCMSTestCase;
import org.w3c.dom.Document;
import java.util.Locale;
-import java.util.Map;
/*
* Created on Sep 18, 2006
@@ -55,7 +54,7 @@
{
super.setUp();
- LoaderResource res = new CLLoader().getResource("jcr/repository.xml");
+ LoaderResource res = new CLResourceLoader().getResource("jcr/repository.xml");
Document config = res.asDocument(XML.getDocumentBuilderFactory().newDocumentBuilder());
service = new JCRCMS();
Modified: trunk/common/src/main/org/jboss/portal/common/logging/LoaderRepositorySelector.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/logging/LoaderRepositorySelector.java 2007-03-13 13:19:38 UTC (rev 6652)
+++ trunk/common/src/main/org/jboss/portal/common/logging/LoaderRepositorySelector.java 2007-03-13 16:32:18 UTC (rev 6653)
@@ -30,7 +30,7 @@
import org.apache.log4j.spi.RepositorySelector;
import org.apache.log4j.spi.RootCategory;
import org.apache.log4j.xml.DOMConfigurator;
-import org.jboss.portal.common.util.Loader;
+import org.jboss.portal.common.util.ResourceLoader;
import org.jboss.portal.common.util.Tools;
import org.w3c.dom.Document;
@@ -62,7 +62,7 @@
/**
* Register with this repository selector.
*/
- public static synchronized void register(ClassLoader classloader, Loader loader, String pathToLog4jFile)
+ public static synchronized void register(ClassLoader classloader, ResourceLoader loader, String pathToLog4jFile)
{
if (classloader == null)
{
Deleted: trunk/common/src/main/org/jboss/portal/common/util/CLLoader.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/util/CLLoader.java 2007-03-13 13:19:38 UTC (rev 6652)
+++ trunk/common/src/main/org/jboss/portal/common/util/CLLoader.java 2007-03-13 16:32:18 UTC (rev 6653)
@@ -1,104 +0,0 @@
-/******************************************************************************
- * 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.common.util;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision$
- */
-public class CLLoader implements Loader
-{
-
- private final ClassLoader loader;
-
- public CLLoader(ClassLoader loader)
- {
- if (loader == null)
- {
- throw new IllegalArgumentException("No classloader provided");
- }
- this.loader = loader;
- }
-
- public CLLoader()
- {
- this(Thread.currentThread().getContextClassLoader());
- }
-
- public InputStream load(String location)
- {
- return loader.getResourceAsStream(location);
- }
-
- public LoaderResource getResource(String location)
- {
- if (location == null)
- {
- throw new IllegalArgumentException("Location is null");
- }
- URL url = loader.getResource(location);
- return new URLResource(location, url);
- }
-
- private static class URLResource extends LoaderResource
- {
-
- private final URL url;
-
- public URLResource(String location, URL url)
- {
- super(location);
- this.url = url;
- }
-
- public boolean exists()
- {
- return URLTools.exists(url);
- }
-
- public InputStream asInputStream() throws IllegalStateException
- {
- if (!exists())
- {
- throw new IllegalStateException("Resource " + location + " does not exist");
- }
- try
- {
- return url.openStream();
- }
- catch (IOException e)
- {
- throw new IllegalStateException("Cannot open resource stream " + location);
- }
- }
-
- public String toString()
- {
- return "Resource[" + location + "," + url + "]";
- }
- }
-}
Copied: trunk/common/src/main/org/jboss/portal/common/util/CLResourceLoader.java (from rev 6642, trunk/common/src/main/org/jboss/portal/common/util/CLLoader.java)
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/util/CLResourceLoader.java (rev 0)
+++ trunk/common/src/main/org/jboss/portal/common/util/CLResourceLoader.java 2007-03-13 16:32:18 UTC (rev 6653)
@@ -0,0 +1,104 @@
+/******************************************************************************
+ * 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.common.util;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision$
+ */
+public class CLResourceLoader implements ResourceLoader
+{
+
+ private final ClassLoader loader;
+
+ public CLResourceLoader(ClassLoader loader)
+ {
+ if (loader == null)
+ {
+ throw new IllegalArgumentException("No classloader provided");
+ }
+ this.loader = loader;
+ }
+
+ public CLResourceLoader()
+ {
+ this(Thread.currentThread().getContextClassLoader());
+ }
+
+ public InputStream load(String location)
+ {
+ return loader.getResourceAsStream(location);
+ }
+
+ public LoaderResource getResource(String location)
+ {
+ if (location == null)
+ {
+ throw new IllegalArgumentException("Location is null");
+ }
+ URL url = loader.getResource(location);
+ return new URLResource(location, url);
+ }
+
+ private static class URLResource extends LoaderResource
+ {
+
+ private final URL url;
+
+ public URLResource(String location, URL url)
+ {
+ super(location);
+ this.url = url;
+ }
+
+ public boolean exists()
+ {
+ return URLTools.exists(url);
+ }
+
+ public InputStream asInputStream() throws IllegalStateException
+ {
+ if (!exists())
+ {
+ throw new IllegalStateException("Resource " + location + " does not exist");
+ }
+ try
+ {
+ return url.openStream();
+ }
+ catch (IOException e)
+ {
+ throw new IllegalStateException("Cannot open resource stream " + location);
+ }
+ }
+
+ public String toString()
+ {
+ return "Resource[" + location + "," + url + "]";
+ }
+ }
+}
Property changes on: trunk/common/src/main/org/jboss/portal/common/util/CLResourceLoader.java
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Deleted: trunk/common/src/main/org/jboss/portal/common/util/Loader.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/util/Loader.java 2007-03-13 13:19:38 UTC (rev 6652)
+++ trunk/common/src/main/org/jboss/portal/common/util/Loader.java 2007-03-13 16:32:18 UTC (rev 6653)
@@ -1,49 +0,0 @@
-/******************************************************************************
- * 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.common.util;
-
-import java.io.InputStream;
-
-/**
- * A generic interface which define loading capabilities.
- * The name format must follow the regular expression : ^(/[-a-zA-Z0-9_\.]+)+$
- *
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision$
- */
-public interface Loader
-{
-
- /** Helper to validate name. */
- String REGEX_NAME_VALIDATOR = "^(/[-a-zA-Z0-9_\\.]+)+$";
-
- /**
- * Returns an InputStream or null if not found.
- */
- InputStream load(String location);
-
- /**
- *
- */
- LoaderResource getResource(String location);
-}
Copied: trunk/common/src/main/org/jboss/portal/common/util/ResourceLoader.java (from rev 6642, trunk/common/src/main/org/jboss/portal/common/util/Loader.java)
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/util/ResourceLoader.java (rev 0)
+++ trunk/common/src/main/org/jboss/portal/common/util/ResourceLoader.java 2007-03-13 16:32:18 UTC (rev 6653)
@@ -0,0 +1,49 @@
+/******************************************************************************
+ * 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.common.util;
+
+import java.io.InputStream;
+
+/**
+ * A generic interface which define loading capabilities of resources.
+ * The name format must follow the regular expression : ^(/[-a-zA-Z0-9_\.]+)+$
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision$
+ */
+public interface ResourceLoader
+{
+
+ /** Helper to validate name. */
+ String REGEX_NAME_VALIDATOR = "^(/[-a-zA-Z0-9_\\.]+)+$";
+
+ /**
+ * Returns an InputStream or null if not found.
+ */
+ InputStream load(String location);
+
+ /**
+ *
+ */
+ LoaderResource getResource(String location);
+}
Property changes on: trunk/common/src/main/org/jboss/portal/common/util/ResourceLoader.java
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/core/build.xml
===================================================================
--- trunk/core/build.xml 2007-03-13 13:19:38 UTC (rev 6652)
+++ trunk/core/build.xml 2007-03-13 16:32:18 UTC (rev 6653)
@@ -337,12 +337,6 @@
<fileset dir="${apache.fileupload.lib}" includes="commons-fileupload.jar"/>
<fileset dir="${jakarta.io.lib}" includes="commons-io.jar"/>
<fileset dir="${portals.bridges.lib}" includes="portals-bridges-common.jar"/>
-
- <!-- For JSF -->
- <fileset dir="../core-admin/src/etc/sun-jsf" includes="jsf-example.jar"/>
- <fileset dir="${apache.lang.lib}" includes="commons-lang-2.0.jar"/>
- <fileset dir="${facelets.facelets.lib}" includes="jsf-facelets.jar"/>
- <fileset dir="${el.el.lib}" includes="el-api.jar,el-ri.jar"/>
</copy>
<!--dtd-->
Modified: trunk/core-admin/build.xml
===================================================================
--- trunk/core-admin/build.xml 2007-03-13 13:19:38 UTC (rev 6652)
+++ trunk/core-admin/build.xml 2007-03-13 16:32:18 UTC (rev 6653)
@@ -196,7 +196,16 @@
</copy>
<copy todir="${build.resources}/portal-admin.sar/lib">
<fileset dir="${build.lib}" includes="portal-core-admin-lib.jar"/>
+ <!--<fileset dir="." includes="jsf-portlet.jar"/>-->
+
+ <!-- For JSF -->
+ <fileset dir="../core-admin/src/etc/sun-jsf" includes="jsf-example.jar"/>
+ <!--<fileset dir="${apache.lang.lib}" includes="commons-lang-2.0.jar"/>-->
+ <fileset dir="${facelets.facelets.lib}" includes="jsf-facelets.jar"/>
+ <fileset dir="${el.el.lib}" includes="el-api.jar,el-ri.jar"/>
</copy>
+
+
<copy todir="${build.resources}/portal-admin.sar/portal-admin.war">
<fileset dir="${build.resources}/portal-admin-war"/>
<fileset dir="${source.bin}/portal-admin-war"/>
Modified: trunk/core-admin/src/resources/portal-admin-war/WEB-INF/portlet.xml
===================================================================
--- trunk/core-admin/src/resources/portal-admin-war/WEB-INF/portlet.xml 2007-03-13 13:19:38 UTC (rev 6652)
+++ trunk/core-admin/src/resources/portal-admin-war/WEB-INF/portlet.xml 2007-03-13 16:32:18 UTC (rev 6653)
@@ -31,9 +31,9 @@
<description>Administration Portlet</description>
<portlet-name>AdminPortlet</portlet-name>
<display-name>Administration Portlet</display-name>
- <portlet-class>org.apache.myfaces.portlet.MyFacesGenericPortlet</portlet-class>
+ <portlet-class>org.jboss.portal.faces.portlet.JSFMetaBridgePortlet</portlet-class>
<init-param>
- <name>default-view</name>
+ <name>VIEW</name>
<value>/WEB-INF/jsf/objects.xhtml</value>
</init-param>
<expiration-cache>-1</expiration-cache>
Modified: trunk/core-admin/src/resources/portal-admin-war/WEB-INF/web.xml
===================================================================
--- trunk/core-admin/src/resources/portal-admin-war/WEB-INF/web.xml 2007-03-13 13:19:38 UTC (rev 6652)
+++ trunk/core-admin/src/resources/portal-admin-war/WEB-INF/web.xml 2007-03-13 16:32:18 UTC (rev 6653)
@@ -27,6 +27,8 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4">
+
+ <!-- MyFaces specific configuration -->
<context-param>
<param-name>org.apache.myfaces.ALLOW_JAVASCRIPT</param-name>
<param-value>true</param-value>
@@ -47,6 +49,8 @@
<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>false</param-value>
@@ -59,6 +63,8 @@
<param-name>facelets.LIBRARIES</param-name>
<param-value>/WEB-INF/portal.taglib.xml</param-value>
</context-param>
+
+ <!-- JSF configuration -->
<context-param>
<param-name>javax.faces.DEFAULT_SUFFIX</param-name>
<param-value>.xhtml</param-value>
@@ -67,6 +73,15 @@
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>server</param-value>
</context-param>
+
+ <!-- -->
+ <servlet>
+ <servlet-name>Faces Servlet</servlet-name>
+ <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+
+ <!-- -->
<listener>
<listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
</listener>
Modified: trunk/faces/build.xml
===================================================================
--- trunk/faces/build.xml 2007-03-13 13:19:38 UTC (rev 6652)
+++ trunk/faces/build.xml 2007-03-13 16:32:18 UTC (rev 6653)
@@ -100,6 +100,7 @@
<!-- Configure modules -->
<call target="configure-modules"/>
<path id="dependentmodule.classpath">
+ <path refid="jboss.portlet-api.classpath"/>
<path refid="jboss.portal-common.classpath"/>
</path>
Added: trunk/faces/src/main/org/jboss/portal/faces/portlet/BridgeInfo.java
===================================================================
--- trunk/faces/src/main/org/jboss/portal/faces/portlet/BridgeInfo.java (rev 0)
+++ trunk/faces/src/main/org/jboss/portal/faces/portlet/BridgeInfo.java 2007-03-13 16:32:18 UTC (rev 6653)
@@ -0,0 +1,74 @@
+/******************************************************************************
+ * 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.faces.portlet;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class BridgeInfo
+{
+
+ /** . */
+ static final BridgeInfo SUN_JSF = new BridgeInfo(
+ "jsfportletbridge",
+ "com.sun.faces.portlet.FacesPortlet",
+ "com.sun.faces.portlet.INIT_VIEW");
+
+ /** . */
+ static final BridgeInfo MYFACES_JSF = new BridgeInfo(
+ "myfaces",
+ "org.apache.myfaces.portlet.MyFacesGenericPortlet",
+ "default-view");
+
+ /** . */
+ private final String name;
+
+ /** . */
+ private final String portletClassName;
+
+ /** . */
+ private final String initParamViewName;
+
+ public BridgeInfo(String name, String portletClassName, String initParamViewName)
+ {
+ this.name = name;
+ this.portletClassName = portletClassName;
+ this.initParamViewName = initParamViewName;
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public String getPortletClassName()
+ {
+ return portletClassName;
+ }
+
+ public String getInitParamViewName()
+ {
+ return initParamViewName;
+ }
+}
Added: trunk/faces/src/main/org/jboss/portal/faces/portlet/BridgePortletConfig.java
===================================================================
--- trunk/faces/src/main/org/jboss/portal/faces/portlet/BridgePortletConfig.java (rev 0)
+++ trunk/faces/src/main/org/jboss/portal/faces/portlet/BridgePortletConfig.java 2007-03-13 16:32:18 UTC (rev 6653)
@@ -0,0 +1,91 @@
+/******************************************************************************
+ * 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.faces.portlet;
+
+import org.jboss.portal.common.util.Tools;
+
+import javax.portlet.PortletConfig;
+import javax.portlet.PortletContext;
+import java.util.ResourceBundle;
+import java.util.Locale;
+import java.util.Enumeration;
+import java.util.List;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class BridgePortletConfig implements PortletConfig
+{
+
+ /** . */
+ private final PortletConfig delegate;
+
+ /** . */
+ private final BridgeInfo bridgeInfo;
+
+ public BridgePortletConfig(PortletConfig delegate, BridgeInfo bridgeInfo)
+ {
+ this.delegate = delegate;
+ this.bridgeInfo = bridgeInfo;
+ }
+
+ public String getPortletName()
+ {
+ return delegate.getPortletName();
+ }
+
+ public PortletContext getPortletContext()
+ {
+ return delegate.getPortletContext();
+ }
+
+ public ResourceBundle getResourceBundle(Locale locale)
+ {
+ return delegate.getResourceBundle(locale);
+ }
+
+ public String getInitParameter(String name) throws IllegalArgumentException
+ {
+ if (name == null)
+ {
+ throw new IllegalArgumentException();
+ }
+
+ //
+ if (bridgeInfo.getInitParamViewName().equals(name))
+ {
+ return delegate.getInitParameter("VIEW");
+ }
+
+ //
+ return delegate.getInitParameter(name);
+ }
+
+ public Enumeration getInitParameterNames()
+ {
+ List names = Tools.toList(delegate.getInitParameterNames());
+ names.add(bridgeInfo.getInitParamViewName());
+ return Tools.toEnumeration(names.iterator());
+ }
+}
Added: trunk/faces/src/main/org/jboss/portal/faces/portlet/JSFMetaBridgePortlet.java
===================================================================
--- trunk/faces/src/main/org/jboss/portal/faces/portlet/JSFMetaBridgePortlet.java (rev 0)
+++ trunk/faces/src/main/org/jboss/portal/faces/portlet/JSFMetaBridgePortlet.java 2007-03-13 16:32:18 UTC (rev 6653)
@@ -0,0 +1,113 @@
+/******************************************************************************
+ * 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.faces.portlet;
+
+import org.apache.log4j.Logger;
+
+import javax.portlet.Portlet;
+import javax.portlet.PortletConfig;
+import javax.portlet.PortletException;
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.PortletSecurityException;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.faces.FactoryFinder;
+import java.io.IOException;
+
+/**
+ * JSF portlet which works with every JSF implementation existing on my radar.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class JSFMetaBridgePortlet implements Portlet
+{
+
+ /** . */
+ private static final Logger log = Logger.getLogger(JSFMetaBridgePortlet.class);
+
+ /** . */
+ private Portlet bridge;
+
+ public void init(PortletConfig config) throws PortletException
+ {
+ BridgeInfo bridgeInfo;
+ String className = FactoryFinder.getFactory(FactoryFinder.APPLICATION_FACTORY).getClass().getName();
+ if ("com.sun.faces.application.ApplicationFactoryImpl".equals(className))
+ {
+ bridgeInfo = BridgeInfo.SUN_JSF;
+ }
+ else if ("org.apache.myfaces.application.ApplicationFactoryImpl".equals(className))
+ {
+ bridgeInfo = BridgeInfo.MYFACES_JSF;
+ }
+ else
+ {
+ throw new PortletException("No bridge detected for application factory " + className);
+ }
+
+ //
+ log.debug("Detected JSF bridge " + bridgeInfo.getName());
+
+ //
+ try
+ {
+ Class bridgeClass = Thread.currentThread().getContextClassLoader().loadClass(bridgeInfo.getPortletClassName());
+ log.debug("Obtain bridge class " + bridgeClass.getName());
+ bridge = (Portlet)bridgeClass.newInstance();
+ }
+ catch (ClassNotFoundException e)
+ {
+ log.error("Bridge class not available " + bridgeInfo.getPortletClassName(), e);
+ }
+ catch (IllegalAccessException e)
+ {
+ log.error("Bridge class not accessible", e);
+ }
+ catch (InstantiationException e)
+ {
+ log.error("Bridge class not instantiable", e);
+ }
+
+ //
+ PortletConfig bridgeConfig = new BridgePortletConfig(config, bridgeInfo);
+ bridge.init(bridgeConfig);
+ }
+
+ public void processAction(ActionRequest request, ActionResponse response) throws PortletException, PortletSecurityException, IOException
+ {
+ bridge.processAction(request, response);
+ }
+
+ public void render(RenderRequest request, RenderResponse response) throws PortletException, PortletSecurityException, IOException
+ {
+ bridge.render(request, response);
+ }
+
+ public void destroy()
+ {
+ bridge.destroy();
+ bridge = null;
+ }
+}
Modified: trunk/jems/src/main/org/jboss/portal/jems/hibernate/SessionFactoryBinder.java
===================================================================
--- trunk/jems/src/main/org/jboss/portal/jems/hibernate/SessionFactoryBinder.java 2007-03-13 13:19:38 UTC (rev 6652)
+++ trunk/jems/src/main/org/jboss/portal/jems/hibernate/SessionFactoryBinder.java 2007-03-13 16:32:18 UTC (rev 6653)
@@ -33,8 +33,7 @@
import org.hibernate.metadata.ClassMetadata;
import org.hibernate.tool.hbm2ddl.SchemaExport;
import org.hibernate.tool.hbm2ddl.SchemaUpdate;
-import org.hibernate.dialect.Dialect;
-import org.jboss.portal.common.util.CLLoader;
+import org.jboss.portal.common.util.CLResourceLoader;
import org.jboss.portal.common.util.LoaderResource;
import org.jboss.portal.common.util.Tools;
import org.jboss.portal.common.util.URLTools;
@@ -185,7 +184,7 @@
//
if (setupLocation != null)
{
- setupResource = new CLLoader().getResource(setupLocation);
+ setupResource = new CLResourceLoader().getResource(setupLocation);
}
// Perform configuration
Modified: trunk/server/src/main/org/jboss/portal/server/config/ServerConfigService.java
===================================================================
--- trunk/server/src/main/org/jboss/portal/server/config/ServerConfigService.java 2007-03-13 13:19:38 UTC (rev 6652)
+++ trunk/server/src/main/org/jboss/portal/server/config/ServerConfigService.java 2007-03-13 16:32:18 UTC (rev 6653)
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.portal.server.config;
-import org.jboss.portal.common.util.CLLoader;
+import org.jboss.portal.common.util.CLResourceLoader;
import org.jboss.portal.common.util.LoaderResource;
import org.jboss.portal.jems.as.system.AbstractJBossService;
@@ -108,7 +108,7 @@
protected void createService() throws Exception
{
- configResource = new CLLoader().getResource(configLocation);
+ configResource = new CLResourceLoader().getResource(configLocation);
if (configResource.exists())
{
properties.clear();
Modified: trunk/theme/src/main/org/jboss/portal/test/theme/TestLayoutServiceImpl.java
===================================================================
--- trunk/theme/src/main/org/jboss/portal/test/theme/TestLayoutServiceImpl.java 2007-03-13 13:19:38 UTC (rev 6652)
+++ trunk/theme/src/main/org/jboss/portal/test/theme/TestLayoutServiceImpl.java 2007-03-13 16:32:18 UTC (rev 6653)
@@ -24,7 +24,7 @@
import junit.framework.TestCase;
import org.jboss.portal.common.MediaType;
-import org.jboss.portal.common.util.CLLoader;
+import org.jboss.portal.common.util.CLResourceLoader;
import org.jboss.portal.common.util.LoaderResource;
import org.jboss.portal.theme.LayoutException;
import org.jboss.portal.theme.PortalLayout;
@@ -75,7 +75,7 @@
runtimeContext = TestHelper.createRuntimeContext();
- LoaderResource res = new CLLoader().getResource("xml/portal-layouts.xml");
+ LoaderResource res = new CLResourceLoader().getResource("xml/portal-layouts.xml");
assertNotNull("Layout xml could not be loaded", res);
Unmarshaller unmarshaller = null;
unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
@@ -87,7 +87,7 @@
layoutService.addLayout(runtimeContext, layoutMD);
}
- res = new CLLoader().getResource("xml/portal-renderSet.xml");
+ res = new CLResourceLoader().getResource("xml/portal-renderSet.xml");
unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
renderSets = (List)unmarshaller.unmarshal(res.asInputStream(), new RenderSetMetaDataFactory(), null);
for (Iterator i = renderSets.iterator(); i.hasNext();)
Modified: trunk/theme/src/main/org/jboss/portal/test/theme/TestThemeServiceImpl.java
===================================================================
--- trunk/theme/src/main/org/jboss/portal/test/theme/TestThemeServiceImpl.java 2007-03-13 13:19:38 UTC (rev 6652)
+++ trunk/theme/src/main/org/jboss/portal/test/theme/TestThemeServiceImpl.java 2007-03-13 16:32:18 UTC (rev 6653)
@@ -23,7 +23,7 @@
package org.jboss.portal.test.theme;
import junit.framework.TestCase;
-import org.jboss.portal.common.util.CLLoader;
+import org.jboss.portal.common.util.CLResourceLoader;
import org.jboss.portal.common.util.LoaderResource;
import org.jboss.portal.theme.PortalTheme;
import org.jboss.portal.theme.RuntimeContext;
@@ -57,7 +57,7 @@
themeService = new ThemeServiceImpl();
runtimeContext = TestHelper.createRuntimeContext();
- LoaderResource res = new CLLoader().getResource("xml/portal-themes.xml");
+ LoaderResource res = new CLResourceLoader().getResource("xml/portal-themes.xml");
Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
themes = (List)unmarshaller.unmarshal(res.asInputStream(), new PortalThemeMetaDataFactory(), null);
Modified: trunk/theme/src/main/org/jboss/portal/test/theme/render/TestRenderedMarkup.java
===================================================================
--- trunk/theme/src/main/org/jboss/portal/test/theme/render/TestRenderedMarkup.java 2007-03-13 13:19:38 UTC (rev 6652)
+++ trunk/theme/src/main/org/jboss/portal/test/theme/render/TestRenderedMarkup.java 2007-03-13 16:32:18 UTC (rev 6653)
@@ -23,7 +23,7 @@
import junit.framework.TestCase;
import org.jboss.portal.common.MediaType;
-import org.jboss.portal.common.util.CLLoader;
+import org.jboss.portal.common.util.CLResourceLoader;
import org.jboss.portal.common.util.LoaderResource;
import org.jboss.portal.server.ServerRequest;
import org.jboss.portal.server.util.HTTPStreamInfo;
@@ -90,7 +90,7 @@
layoutService = new LayoutServiceImpl();
runtimeContext = TestHelper.createRuntimeContext();
- LoaderResource res = new CLLoader().getResource("xml/portal-layouts.xml");
+ LoaderResource res = new CLResourceLoader().getResource("xml/portal-layouts.xml");
Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
List portalLayouts = (List)unmarshaller.unmarshal(res.asInputStream(), new PortalLayoutMetaDataFactory(), null);
@@ -101,7 +101,7 @@
}
layout = layoutService.getLayout("generic", true);
- res = new CLLoader().getResource("xml/portal-renderSet.xml");
+ res = new CLResourceLoader().getResource("xml/portal-renderSet.xml");
unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
List renderSets = (List)unmarshaller.unmarshal(res.asInputStream(), new RenderSetMetaDataFactory(), null);
for (Iterator i = renderSets.iterator(); i.hasNext();)
@@ -111,7 +111,7 @@
}
renderSet = layoutService.getRenderSet("divRenderer", MediaType.HTML);
- res = new CLLoader().getResource("xml/portal-themes.xml");
+ res = new CLResourceLoader().getResource("xml/portal-themes.xml");
unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
List themes = (List)unmarshaller.unmarshal(res.asInputStream(), new PortalThemeMetaDataFactory(), null);
17 years, 6 months
JBoss Portal SVN: r6652 - docs/trunk/referenceGuide/en/modules.
by portal-commits@lists.jboss.org
Author: bdaw
Date: 2007-03-13 09:19:38 -0400 (Tue, 13 Mar 2007)
New Revision: 6652
Modified:
docs/trunk/referenceGuide/en/modules/authentication.xml
docs/trunk/referenceGuide/en/modules/identity.xml
docs/trunk/referenceGuide/en/modules/ldap.xml
docs/trunk/referenceGuide/en/modules/sso.xml
Log:
some typos and tomcat sso howto
Modified: docs/trunk/referenceGuide/en/modules/authentication.xml
===================================================================
--- docs/trunk/referenceGuide/en/modules/authentication.xml 2007-03-13 11:45:23 UTC (rev 6651)
+++ docs/trunk/referenceGuide/en/modules/authentication.xml 2007-03-13 13:19:38 UTC (rev 6652)
@@ -53,7 +53,7 @@
<sect2>
<title>org.jboss.portal.identity.auth.DBIdentityLoginModule</title>
<para>This <emphasis>LoginModule</emphasis> implementation extends JBossSX <emphasis>org.jboss.security.auth.spi.DatabaseServerLoginModule</emphasis> and can be
- used to authenicate against Database. The main purpose of this module is to be configured directly against portal database (instead of using portal identity
+ used to authenticate against Database. The main purpose of this module is to be configured directly against portal database (instead of using portal identity
modules like in IdentityLoginModule). So if you are using custom LoginModule implementation you can place this module with "sufficient" flag. This can
be extremely useful. For example if you authenticate against LDAP server using JBossSX <emphasis>LdapLoginModule</emphasis> you can
fallback to users present in portal database and not present in LDAP like "admin" user. Please look into
Modified: docs/trunk/referenceGuide/en/modules/identity.xml
===================================================================
--- docs/trunk/referenceGuide/en/modules/identity.xml 2007-03-13 11:45:23 UTC (rev 6651)
+++ docs/trunk/referenceGuide/en/modules/identity.xml 2007-03-13 13:19:38 UTC (rev 6652)
@@ -373,11 +373,11 @@
<title>Identity configuration</title>
<para>At the beginning to understand identity configuration you need to understand how it is designed to work in portal.
Different identity services like UserModule, RoleModule and etc are just plain java classes that are instantiated and exposed
- by portal. So *example* UserModule service could be plain java bean object tha will be:
+ by portal. So *example* UserModule service could be plain java bean object that will be:
<itemizedlist>
- <listitem><emphasis role="bold">Instantiated</emphasis> using relfection</listitem>
+ <listitem><emphasis role="bold">Instantiated</emphasis> using reflection</listitem>
<listitem><emphasis role="bold">Initialized/Started</emphasis> by invoking some methods</listitem>
- <listitem><emphasis role="bold">Registered/Exposed</emphasis> using JNDI and/or mbeans (JBoss Mikrokernel) services, so
+ <listitem><emphasis role="bold">Registered/Exposed</emphasis> using JNDI and/or mbeans (JBoss Microkernel) services, so
other citizens of the portal can use it</listitem>
<listitem><emphasis role="bold">Managed</emphasis> in the matter of lifecycle - so it'll be stopped and unregistered during
portal shutdown</listitem>
@@ -387,11 +387,11 @@
custom ones - look on the methods that are leveraged by this framework.</note>
</para>
<para>
- In JBoss Portal we provide very flexible configuration. It's very easy to rearange and customize services,
+ In JBoss Portal we provide very flexible configuration. It's very easy to rearrange and customize services,
provide and plug in own implementations, extend current ones or extend identity model with own solutions using
provided configuration service.
</para>
- <para>To have the complete picture of the configuration of identity services let's start from it's root
+ <para>To have the complete picture of the configuration of identity services lets start from it's root
component. Whole configuration and setup of identity components is made by
<emphasis role="bold">IdentityServiceController</emphasis>. It brings to life and registers all other components
like UserModule, RoleModule, MembershipModule and UserProfileModule.
@@ -434,7 +434,7 @@
<emphasis role="bold">DefaultConfigFile</emphasis> - defines location of configuration file containing
default values. For each component defined in <emphasis role="bold">ConfigFile</emphasis> IdentityServiceController
will look into this location to grab set of default options. This simply makes the main configuration file
- simpler and shorter while still enabling more powerfull customization.
+ simpler and shorter while still enabling more powerful customization.
</para>
</listitem>
</itemizedlist>
@@ -470,7 +470,7 @@
<title>Datasources</title>
<para>This section defines datasource components. They will be processed and instantiated before components in
<emphasis role="bold">Module</emphasis> section, so they will be ready to serve them.</para>
- <note>This section isn't used whith Database configuration as in JBoss Portal services exposing Hibernate
+ <note>This section isn't used with Database configuration as in JBoss Portal services exposing Hibernate
are defined separately. It's used by LDAP configuration and we'll use it as an example</note>
<programlisting><![CDATA[
<datasource>
@@ -502,7 +502,7 @@
<note>If you look into JBoss Portal configuration files you will find that <![CDATA[<service-name/> and <class/>]]>
are specified in <emphasis role="bold">DefaultConfigFile</emphasis> and not in <emphasis role="bold">ConfigFile</emphasis>.
So this is how it works. Those two will be picked up from default configuration. The same rule takes place
- for options - additional will be picked up from default configuration. Whats linking configuration in those two files
+ for options - additional will be picked up from default configuration. What is linking configuration in those two files
is the <emphasis role="bold"><![CDATA[<name>]]></emphasis> tag.</note>
</sect3>
<sect3>
@@ -525,7 +525,7 @@
<value>java:/portal/IdentitySessionFactory</value>
</option>
<option>
- <name>jndiName</name>
+ <name>jNDIName</name>
<value>java:/portal/UserModule</value>
</option>
</config>
@@ -583,7 +583,7 @@
<sect3>
<title>Options</title>
<para>This section provides common options that are accessible by identity modules. We put here options
- that may need to be shared. They are groupped, and can have many values:</para>
+ that may need to be shared. They are grouped, and can have many values:</para>
<programlisting><![CDATA[
<options>
<!--Common options section-->
@@ -730,9 +730,9 @@
</properties>
]]>
</programlisting>
- Configuration file contains properties definition that can be retreived using <emphasis role="bold">PropertyInfo</emphasis> interface.
+ Configuration file contains properties definition that can be retrieved using <emphasis role="bold">PropertyInfo</emphasis> interface.
Every property that will be used in portal need to be registered here.
- <note>Some informations provided for property have big influence on the behaviour of UserProfileModule. For example
+ <note>Some information provided for property have big influence on the behaviour of UserProfileModule. For example
<emphasis>access-mode</emphasis> can made property read-only, and value provided in <emphasis>type</emphasis> will be checked
during <emphasis>setProperty()/getProperty()</emphasis> operations. On the other hand tags like <emphasis>usage</emphasis>,
<emphasis>description</emphasis> or <emphasis>display-name</emphasis> have mostly informational meaning at the moment</note>
@@ -766,7 +766,7 @@
<note>In current implementation <emphasis>column</emphasis> and <emphasis>dynamic</emphasis> mappings have the same effect, as database mappings are defined
in hibernate configuration.</note>
<note>Property can have both <emphasis>ldap</emphasis> and <emphasis>database</emphasis> mappings. In such situation when LDAP support is enabled <emphasis>ldap</emphasis> mapping will take precedense.
- Also even when using ldap some properties will be mapped to ldap and some to database. Its because LDAP schema doesn't support all attributes proper
+ Also even when using LDAP some properties will be mapped to LDAP and some to database. Its because LDAP schema doesn't support all attributes proper
to for portal properties. To solve this we have <emphasis role="bold">DelegatingUserProfileModuleImpl</emphasis> that will delegate method invocation to
<emphasis>ldap</emphasis> or <emphasis>database</emphasis> related <emphasis>UserProfile</emphasis> module. When <emphasis>LDAP</emphasis> support is enabled and
property need to be stored in database user will be synchronized into database when needed. This behaviour can be configured.</note>
@@ -808,7 +808,7 @@
<emphasis>sessionFactoryJNDIName</emphasis> - JNDI name under which hibernate SessionFactory object is registered
</listitem>
<listitem>
- <emphasis>jndiName</emphasis> - JNDI name under which this module should be registered
+ <emphasis>jNDIName</emphasis> - JNDI name under which this module should be registered
</listitem>
</itemizedlist>
</para>
@@ -836,7 +836,7 @@
<!--set of options that are set in instantiated object-->
<config>
<option>
- <name>jndiName</name>
+ <name>jNDIName</name>
<value>java:/portal/UserProfileModule</value>
</option>
<option>
Modified: docs/trunk/referenceGuide/en/modules/ldap.xml
===================================================================
--- docs/trunk/referenceGuide/en/modules/ldap.xml 2007-03-13 11:45:23 UTC (rev 6651)
+++ docs/trunk/referenceGuide/en/modules/ldap.xml 2007-03-13 13:19:38 UTC (rev 6652)
@@ -157,7 +157,7 @@
<para>For all modules you can set two config options:
<itemizedlist>
<listitem>
- <emphasis role="bold">jndiName</emphasis> - JNDI name under which this module will be registered
+ <emphasis role="bold">jNDIName</emphasis> - JNDI name under which this module will be registered
</listitem>
<listitem>
<emphasis role="bold">connectionJNDIName</emphasis> - JNDI name under which LDAP datasource is registered
Modified: docs/trunk/referenceGuide/en/modules/sso.xml
===================================================================
--- docs/trunk/referenceGuide/en/modules/sso.xml 2007-03-13 11:45:23 UTC (rev 6651)
+++ docs/trunk/referenceGuide/en/modules/sso.xml 2007-03-13 13:19:38 UTC (rev 6652)
@@ -10,11 +10,142 @@
<para>This chapter describes how to setup SSO in JBoss Portal</para>
<sect1>
<title>Overview of SSO in portal</title>
- <para>TODO:</para>
+ <para>Portal as an integration and aggregation platform provides some form of SSO by itself. When you log into
+ portal you gain access to many systems accessed with portlets using single identity. Still in many cases you
+ need to integrate portal infrastructure with other SSO enabled systems. There are many different Identity Management
+ solutions on the market. In most cases each SSO framework provides its own way to plug into JEE application. For custom configurations
+ you need to have good understanding of <link linkend="identity">JBoss Portal Identity management</link> and <link linkend="authentication">authentication</link>
+ mechanisms.</para>
</sect1>
<sect1>
<title>Using Tomcat Valve</title>
- <para>TODO:</para>
+ <para>JBoss Application Server embeds Apache Tomcat as default servlet container. Tomcat provides builtin SSO support
+ using a valve. The Single Sign On Valve caches credentials on the server side, and then invisibly authenticate users when they
+ reach different web applications. Credentials are stored in a host-wide session which means that SSO will be effective throughout the session.
+ </para>
+ <note>Below we will describe configuration using <emphasis>JBoss Application Server 4.0.5</emphasis>. For different versions it can be slightly different.</note>
+ <sect2>
+ <title>Enabling Tomcat SSO Valve</title>
+ <para>
+ To enable SSO valve in Tomcat you should edit <emphasis>$JBOSS_HOME/server/default/deploy/jbossweb-tomcat55.sar/server.xml</emphasis> file and uncomment
+ following line:
+ <programlisting>
+ <![CDATA[
+ <Valve className=’org.apache.catalina.authenticator.SingleSignOn’/>
+ ]]>
+ </programlisting>
+ </para>
+ </sect2>
+ <sect2>
+ <title>Example usage</title>
+ <para>
+ Lets look a little bit closer and configure SSO between portal and other web application. As an example
+ we'll use <emphasis>jmx-console</emphasis> web-app that comes with every JBoss Application Server installation.
+ You can find more information on how to secure <emphasis>jmx-console</emphasis> in <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=SecureTheJmxConsole">JBoss AS wiki</ulink>.
+ </para>
+ <orderedlist>
+ <listitem>
+ <para>Take a clean install of <emphasis>JBoss Application Server 4.0.5.GA</emphasis></para>
+ </listitem>
+ <listitem>
+ <para>Edit <emphasis>$JBOSS_HOME/server/default/deploy/jmx-console.war/WEB-INF/web.xml</emphasis> file and make sure it contains following content:</para>
+ <programlisting>
+ <![CDATA[
+ <security-constraint>
+ <web-resource-collection>
+ <web-resource-name>HtmlAdaptor</web-resource-name>
+ <description>An example security config that only allows users with the
+ role JBossAdmin to access the HTML JMX console web application
+ </description>
+ <url-pattern>/*</url-pattern>
+ <http-method>GET</http-method>
+ <http-method>POST</http-method>
+ </web-resource-collection>
+ <auth-constraint>
+ <role-name>Admin</role-name>
+ </auth-constraint>
+ </security-constraint>
+ <security-constraint>
+ <web-resource-collection>
+ <web-resource-name>Public</web-resource-name>
+ <url-pattern>/public/*</url-pattern>
+ <http-method>GET</http-method>
+ <http-method>POST</http-method>
+ </web-resource-collection>
+ </security-constraint>
+
+ <login-config>
+ <auth-method>BASIC</auth-method>
+ <realm-name>jmx-console</realm-name>
+ </login-config>
+
+
+ <security-role>
+ <role-name>Admin</role-name>
+ </security-role>
+ ]]>
+ </programlisting>
+ <para>This will secure <emphasis>jmx-console</emphasis> web application using BASIC browser authentication and restrict access for
+ users with <emphasis>Admin</emphasis> role only.</para>
+ </listitem>
+ <listitem>
+ <para>
+ Edit <emphasis>$JBOSS_HOME/server/default/conf/props/jmx-console-roles.properties</emphasis> file and make it contain:
+ </para>
+ <programlisting>
+ <![CDATA[
+ admin=JBossAdmin,HttpInvoker,Admin
+ ]]>
+ </programlisting>
+ <para>
+ This file is a simple identity store for this web application authentication. It will make user <emphasis>admin</emphasis> belongs to <emphasis>Admin</emphasis> role.
+ </para>
+ </listitem>
+ <listitem>
+ <para>Deploy JBoss Portal</para>
+ </listitem>
+ <listitem>
+ <para>Run JBoss Application Server</para>
+ </listitem>
+ <listitem>
+ <para>Now you can check that when you go to
+ <itemizedlist>
+ <listitem>
+ <emphasis>http://localhost:8080/portal</emphasis>
+ </listitem>
+ <listitem>
+ <emphasis>http://localhost:8080/jmx-console</emphasis>
+ </listitem>
+ </itemizedlist>
+ you need to authenticate separately into each of those web applications.
+ </para>
+ </listitem>
+ <listitem>
+ <para>Shutdown Application Server</para>
+ </listitem>
+ <listitem>
+ <para>
+ Edit <emphasis>$JBOSS_HOME/server/default/deploy/jbossweb-tomcat55.sar/server.xml</emphasis> file and uncomment
+ following line:
+ <programlisting>
+ <![CDATA[
+ <Valve className=’org.apache.catalina.authenticator.SingleSignOn’/>
+ ]]>
+ </programlisting>
+ </para>
+ <para>
+ Run JBoss Application Server.
+ </para>
+ </listitem>
+ </orderedlist>
+ <para>
+ Now if you log into portal as user <emphasis>admin</emphasis> with password <emphasis>admin</emphasis>, you won't
+ be asked for credentials when accessing <emphasis>jmx-console</emphasis>. This should work in both directions.
+ </para>
+ <note>Please note that in this example <emphasis>jmx-console</emphasis> uses <emphasis>BASIC</emphasis> authentication method.
+ This means that user credentials are cached on the client side by browser and passed on each request. Once authenticated to clear
+ authentication cache you may need to restart browser.</note>
+ </sect2>
</sect1>
<sect1>
<title>Using external authentication providers</title>
17 years, 6 months
JBoss Portal SVN: r6651 - trunk/core/src/main/org/jboss/portal/core/metadata/portlet.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2007-03-13 07:45:23 -0400 (Tue, 13 Mar 2007)
New Revision: 6651
Modified:
trunk/core/src/main/org/jboss/portal/core/metadata/portlet/ScriptElementMetaData.java
Log:
Fix: header content script element was empty [JBPORTAL-1317]
Modified: trunk/core/src/main/org/jboss/portal/core/metadata/portlet/ScriptElementMetaData.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/metadata/portlet/ScriptElementMetaData.java 2007-03-13 05:39:05 UTC (rev 6650)
+++ trunk/core/src/main/org/jboss/portal/core/metadata/portlet/ScriptElementMetaData.java 2007-03-13 11:45:23 UTC (rev 6651)
@@ -62,7 +62,7 @@
{
attributes.add(new MarkupAttribute("src", srcAttribute, MarkupAttribute.Type.URI));
}
- return new MarkupElement("script", null, true, (MarkupAttribute[])attributes.toArray(new MarkupAttribute[attributes.size()]));
+ return new MarkupElement("script", getBodyContent(), true, (MarkupAttribute[])attributes.toArray(new MarkupAttribute[attributes.size()]));
}
public String getSrcAttribute()
17 years, 6 months
JBoss Portal SVN: r6650 - in trunk/wsrp/src: main/org/jboss/portal/wsrp/consumer and 4 other directories.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2007-03-13 01:39:05 -0400 (Tue, 13 Mar 2007)
New Revision: 6650
Modified:
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/framework/support/MockConsumerRegistry.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ConsumerRegistry.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ConsumerRegistryService.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/deployment/WSRPConsumerService.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/deployment/WSRPDeploymentFactory.java
trunk/wsrp/src/resources/portal-wsrp-sar/META-INF/jboss-service.xml
trunk/wsrp/src/resources/portal-wsrp-sar/conf/consumer/hibernate/domain.hbm.xml
trunk/wsrp/src/resources/portal-wsrp-sar/wsrp-aop.xml
Log:
- Fixed mapping of registration properties in Hibernate configuration, which seems to have fixed the deployer issues! YEAH! ^_^
- ConsumerRegister.createConsumer takes cache expiration parameters since it allows for the cache value to be persisted if something goes wrong later.
- WSRPDeploymentFactory now handles persistence errors better.
- ProducerInfo.*register now properly update the state in DB and deregister doesn't reset the registration if the deregister operation failed.
- Improved service and AOP configuration.
Modified: trunk/wsrp/src/main/org/jboss/portal/test/wsrp/framework/support/MockConsumerRegistry.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/test/wsrp/framework/support/MockConsumerRegistry.java 2007-03-13 05:30:34 UTC (rev 6649)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/framework/support/MockConsumerRegistry.java 2007-03-13 05:39:05 UTC (rev 6650)
@@ -74,7 +74,7 @@
return null;
}
- public WSRPConsumer createConsumer(String id)
+ public WSRPConsumer createConsumer(String id, Integer expirationCacheSeconds)
{
MockWSRPConsumer consumer = new MockWSRPConsumer(id);
consumers.put(id, consumer);
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ConsumerRegistry.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ConsumerRegistry.java 2007-03-13 05:30:34 UTC (rev 6649)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ConsumerRegistry.java 2007-03-13 05:39:05 UTC (rev 6650)
@@ -40,7 +40,7 @@
FederatingPortletInvoker getFederatingPortletInvoker();
- WSRPConsumer createConsumer(String id);
+ WSRPConsumer createConsumer(String id, Integer expirationCacheSeconds);
void persistConsumer(WSRPConsumer consumer);
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ConsumerRegistryService.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ConsumerRegistryService.java 2007-03-13 05:30:34 UTC (rev 6649)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ConsumerRegistryService.java 2007-03-13 05:39:05 UTC (rev 6650)
@@ -62,7 +62,7 @@
return federatingPortletInvoker;
}
- public WSRPConsumer createConsumer(String id)
+ public WSRPConsumer createConsumer(String id, Integer expirationCacheSeconds)
{
ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(id, "Consumer identifier", "createConsumer");
@@ -76,6 +76,7 @@
info.setId(id);
info.setRegistry(this);
info.setRegistrationInfo(nullRegistration);
+ info.setExpirationCacheSeconds(expirationCacheSeconds);
try
{
@@ -122,8 +123,6 @@
protected void startService() throws Exception
{
- super.startService();
-
InitialContext initialContext = new InitialContext();
sessionFactory = (SessionFactory)initialContext.lookup(sessionFactoryJNDIName);
@@ -195,10 +194,9 @@
{
ParameterValidation.throwIllegalArgExceptionIfNull(producerInfo, "ProducerInfo");
+ Session session = sessionFactory.getCurrentSession();
try
{
- Session session = sessionFactory.getCurrentSession();
-
session.update(producerInfo);
}
catch (HibernateException e)
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-13 05:30:34 UTC (rev 6649)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java 2007-03-13 05:39:05 UTC (rev 6650)
@@ -614,6 +614,7 @@
public void register() throws PortletInvokerException
{
register(null);
+ registry.updateProducerInfo(this);
}
private void register(ServiceDescription serviceDescription) throws PortletInvokerException
@@ -672,15 +673,13 @@
try
{
persistentEndpointInfo.getRegistrationService().deregister(getRegistrationContext());
+ persistentRegistrationInfo.resetRegistration();
+ registry.updateProducerInfo(this);
}
catch (Exception e)
{
throw new PortletInvokerException("Couldn't deregister with producer '" + persistentId + "'", e);
}
- finally
- {
- persistentRegistrationInfo.resetRegistration();
- }
}
}
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/deployment/WSRPConsumerService.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/deployment/WSRPConsumerService.java 2007-03-13 05:30:34 UTC (rev 6649)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/deployment/WSRPConsumerService.java 2007-03-13 05:39:05 UTC (rev 6650)
@@ -22,10 +22,10 @@
******************************************************************************/
package org.jboss.portal.wsrp.deployment;
+import org.jboss.portal.jems.as.system.AbstractJBossService;
+import org.jboss.portal.portlet.PortletInvoker;
import org.jboss.portal.portlet.federation.FederatingPortletInvoker;
import org.jboss.portal.portlet.federation.spi.PortletInvokerRegistration;
-import org.jboss.portal.jems.as.system.AbstractJBossService;
-import org.jboss.portal.portlet.PortletInvoker;
import org.jboss.portal.wsrp.WSRPConsumer;
/**
@@ -82,6 +82,6 @@
{
consumer.stop();
federatingPortletInvoker.unregisterInvoker(this);
- super.stop();
+ super.stopService();
}
}
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/deployment/WSRPDeploymentFactory.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/deployment/WSRPDeploymentFactory.java 2007-03-13 05:30:34 UTC (rev 6649)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/deployment/WSRPDeploymentFactory.java 2007-03-13 05:39:05 UTC (rev 6650)
@@ -107,17 +107,13 @@
return null;
}
- // consumer didn't exist in the database, so create one and configure it
- consumer = consumerRegistry.createConsumer(id);
- ProducerInfo info = consumer.getProducerInfo();
-
String expirationCache = attrs.getValue("expiration-cache");
+ Integer expirationCacheSeconds = null;
if (expirationCache != null)
{
try
{
- Integer expirationCacheSeconds = new Integer(expirationCache);
- info.setExpirationCacheSeconds(expirationCacheSeconds);
+ expirationCacheSeconds = new Integer(expirationCache);
}
catch (NumberFormatException e)
{
@@ -125,6 +121,9 @@
}
}
+ // consumer didn't exist in the database, so create one and configure it
+ consumer = consumerRegistry.createConsumer(id, expirationCacheSeconds);
+
service.setConsumer(consumer);
return service;
@@ -288,7 +287,17 @@
}
// update the producer info once the whole information is known
- consumerRegistry.updateProducerInfo(info);
+ try
+ {
+ consumerRegistry.updateProducerInfo(info);
+ }
+ catch (Exception e)
+ {
+ // if we couldn't update the info, remove it from the list of service to be activated
+ deployment.getServices().remove(service);
+ log.info("Couldn't update the ProducerInfo for Consumer '" + info.getId() + "'", e);
+ return;
+ }
log.info(message);
}
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-13 05:30:34 UTC (rev 6649)
+++ trunk/wsrp/src/resources/portal-wsrp-sar/META-INF/jboss-service.xml 2007-03-13 05:39:05 UTC (rev 6650)
@@ -127,7 +127,7 @@
<!-- Deployer for *-wsrp.xml files. Deploys default-wsrp.xml which contains the 'self' consumer -->
<mbean code="org.jboss.portal.wsrp.deployment.WSRPDeployer" name="portal.wsrp:service=WSRPDeployer">
<attribute name="DefaultWSRPLocation">default-wsrp.xml</attribute>
- <depends>portal:service=Hibernate,type=WSRPConsumer</depends>
+ <depends>jboss.system:service=MainDeployer</depends>
<depends optional-attribute-name="ConsumerRegistry"
proxy-type="attribute">portal.wsrp:service=ConsumersRegistry</depends>
<depends optional-attribute-name="EntityResolver"
Modified: trunk/wsrp/src/resources/portal-wsrp-sar/conf/consumer/hibernate/domain.hbm.xml
===================================================================
--- trunk/wsrp/src/resources/portal-wsrp-sar/conf/consumer/hibernate/domain.hbm.xml 2007-03-13 05:30:34 UTC (rev 6649)
+++ trunk/wsrp/src/resources/portal-wsrp-sar/conf/consumer/hibernate/domain.hbm.xml 2007-03-13 05:39:05 UTC (rev 6650)
@@ -78,8 +78,8 @@
<property name="registrationState" column="STATE" type="binary"/>
<map name="registrationProperties" cascade="all" lazy="false">
<cache usage="@portal.hibernate.cache.usage@"/>
- <key column="REG_PROP_PK"/>
- <map-key type="string" column="NAME"/>
+ <key column="REG_PK" not-null="true"/>
+ <map-key type="string" column="name"/>
<one-to-many class="org.jboss.portal.wsrp.consumer.RegistrationProperty"/>
</map>
</class>
@@ -91,7 +91,7 @@
<param name="sequence">wsrpconsumer_seq</param>
</generator>
</id>
- <property name="name" type="java.lang.String" not-null="true"/>
+ <property name="name" type="java.lang.String" not-null="true" insert="false" update="false"/>
<property name="value" type="java.lang.String" not-null="true"/>
<property name="invalid" type="boolean"/>
<property name="lang" type="java.lang.String"/>
Modified: trunk/wsrp/src/resources/portal-wsrp-sar/wsrp-aop.xml
===================================================================
--- trunk/wsrp/src/resources/portal-wsrp-sar/wsrp-aop.xml 2007-03-13 05:30:34 UTC (rev 6649)
+++ trunk/wsrp/src/resources/portal-wsrp-sar/wsrp-aop.xml 2007-03-13 05:39:05 UTC (rev 6650)
@@ -30,7 +30,7 @@
<trans-attribute>Required</trans-attribute>
</method>
<method name="activateConsumerWith">
- <trans-attribute>RequiresNew</trans-attribute>
+ <trans-attribute>Required</trans-attribute>
</method>
<method name="updateProducerInfo">
<trans-attribute>Required</trans-attribute>
17 years, 6 months
JBoss Portal SVN: r6649 - trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/jsp/consumers.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2007-03-13 01:30:34 -0400 (Tue, 13 Mar 2007)
New Revision: 6649
Modified:
trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/jsp/consumers/view.jsp
Log:
- Removed Active? column. Should use highlighting of some sort to show active consumers better.
Modified: trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/jsp/consumers/view.jsp
===================================================================
--- trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/jsp/consumers/view.jsp 2007-03-13 05:28:50 UTC (rev 6648)
+++ trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/jsp/consumers/view.jsp 2007-03-13 05:30:34 UTC (rev 6649)
@@ -15,7 +15,6 @@
<caption>Configured WSRP Consumers</caption>
<thead>
<tr>
- <th class="portlet-table-header">Active?</th>
<th class="portlet-table-header">Name</th>
<th class="portlet-table-header">Action</th>
</tr>
@@ -36,8 +35,6 @@
boolean isRegistered = (regInfo != null && regInfo.isRegistrationValid());
%>
<tr>
- <td class="<%=style%>"><%= isActive ? "x" : ""%>
- </td>
<td class="<%=style%>"><a href="<portlet:renderURL>
<portlet:param name="<%=WSRPConsumerConfigurationPortlet.OP%>" value="<%=WSRPConsumerConfigurationPortlet.OP_CONFIGURE%>" />
<portlet:param name="<%=WSRPConsumerConfigurationPortlet.ID%>" value="<%=id%>"/>
17 years, 6 months
JBoss Portal SVN: r6648 - trunk/registration/src/main/org/jboss/portal/registration/impl.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2007-03-13 01:28:50 -0400 (Tue, 13 Mar 2007)
New Revision: 6648
Modified:
trunk/registration/src/main/org/jboss/portal/registration/impl/RegistrationManagerImpl.java
Log:
- Comment call to clearAssociatedState since it's not implemented yet. More importantly, do we need a call to clear associated state?
Modified: trunk/registration/src/main/org/jboss/portal/registration/impl/RegistrationManagerImpl.java
===================================================================
--- trunk/registration/src/main/org/jboss/portal/registration/impl/RegistrationManagerImpl.java 2007-03-13 00:10:35 UTC (rev 6647)
+++ trunk/registration/src/main/org/jboss/portal/registration/impl/RegistrationManagerImpl.java 2007-03-13 05:28:50 UTC (rev 6648)
@@ -232,7 +232,7 @@
ParameterValidation.throwIllegalArgExceptionIfNull(registration, "Registration");
registration.setStatus(RegistrationStatus.INVALID); // just in case...
- registration.clearAssociatedState();
+// registration.clearAssociatedState(); // todo: do we need to clear associated state?
persistenceManager.removeRegistration(registration.getId());
}
@@ -330,7 +330,7 @@
{
Registration reg = (Registration)regs.next();
reg.setStatus(RegistrationStatus.INVALID);
- reg.clearAssociatedState(); //todo: or should we wait until current operations are done?
+// reg.clearAssociatedState(); //todo: do we need to clear the associateed state? If we do, should we wait until current operations are done?
}
}
17 years, 6 months
JBoss Portal SVN: r6647 - trunk/core/src/resources/portal-core-sar/META-INF.
by portal-commits@lists.jboss.org
Author: bdaw
Date: 2007-03-12 20:10:35 -0400 (Mon, 12 Mar 2007)
New Revision: 6647
Modified:
trunk/core/src/resources/portal-core-sar/META-INF/jboss-service.xml
Log:
- cache user principal in UserInterceptor
Modified: trunk/core/src/resources/portal-core-sar/META-INF/jboss-service.xml
===================================================================
--- trunk/core/src/resources/portal-core-sar/META-INF/jboss-service.xml 2007-03-13 00:03:58 UTC (rev 6646)
+++ trunk/core/src/resources/portal-core-sar/META-INF/jboss-service.xml 2007-03-13 00:10:35 UTC (rev 6647)
@@ -103,7 +103,7 @@
xmbean-dd=""
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
<xmbean/>
- <!--<attribute name="cacheUser">true</attribute>-->
+ <attribute name="CacheUser">true</attribute>
<depends>portal:service=Module,type=IdentityServiceController</depends>
</mbean>
<mbean
17 years, 6 months
JBoss Portal SVN: r6646 - in trunk/core/src: main/org/jboss/portal/core/controller/portlet and 1 other directories.
by portal-commits@lists.jboss.org
Author: bdaw
Date: 2007-03-12 20:03:58 -0400 (Mon, 12 Mar 2007)
New Revision: 6646
Added:
trunk/core/src/main/org/jboss/portal/core/controller/portlet/CachedUserImpl.java
Modified:
trunk/core/src/main/org/jboss/portal/core/aspects/server/UserInterceptor.java
trunk/core/src/main/org/jboss/portal/core/controller/portlet/ControllerUserContext.java
trunk/core/src/resources/portal-core-sar/META-INF/jboss-service.xml
Log:
- cache user principal in UserInterceptor
Modified: trunk/core/src/main/org/jboss/portal/core/aspects/server/UserInterceptor.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/aspects/server/UserInterceptor.java 2007-03-12 20:19:07 UTC (rev 6645)
+++ trunk/core/src/main/org/jboss/portal/core/aspects/server/UserInterceptor.java 2007-03-13 00:03:58 UTC (rev 6646)
@@ -25,6 +25,7 @@
import org.jboss.logging.Logger;
import org.jboss.portal.common.invocation.InvocationException;
import org.jboss.portal.core.CoreConstants;
+import org.jboss.portal.core.controller.portlet.CachedUserImpl;
import org.jboss.portal.identity.NoSuchUserException;
import org.jboss.portal.identity.User;
import org.jboss.portal.identity.UserModule;
@@ -42,6 +43,7 @@
import java.io.Serializable;
import java.security.Principal;
import java.util.Date;
+import java.util.Map;
/**
* The interceptor is responsible for managing the user identity lifecycle based on the principal name returned by the
@@ -62,6 +64,11 @@
/** User. */
protected UserModule userModule = null;
+ /** UserProfile */
+ protected UserProfileModule userProfileModule = null;
+
+ protected boolean cacheUser = true;
+
public UserModule getUserModule()
{
if (userModule == null)
@@ -78,6 +85,23 @@
return userModule;
}
+ public UserProfileModule getUserProfileModule()
+ {
+ if (userProfileModule == null)
+ {
+ try
+ {
+ userProfileModule = (UserProfileModule)new InitialContext().lookup("java:portal/UserProfileModule");
+ }
+ catch (NamingException e)
+ {
+ log.error("could not obtain UserProfileModule: ", e);
+ }
+ }
+ return userProfileModule;
+ }
+
+
public void setUserModule(UserModule userModule)
{
this.userModule = userModule;
@@ -100,6 +124,8 @@
{
String userName = userPrincipal.getName();
+
+
//
try
{
@@ -108,9 +134,27 @@
log.trace("About to fetch user=" + userName);
}
- // Lookup
- user = getUserModule().findUserByUserName(userName);
+ if (isCacheUser())
+ {
+ //try to obtain cached user
+ user = (User)invocation.getContext().getAttributeResolver(ServerInvocation.PRINCIPAL_SCOPE).getAttribute("cachedUser");
+ //create new cached one
+ if (user == null)
+ {
+ user = getUserModule().findUserByUserName(userName);
+ Map props = getUserProfileModule().getProperties(user);
+ user = new CachedUserImpl(user.getId(), user.getUserName(), props);
+
+ //cache user
+ invocation.getContext().setAttribute(ServerInvocation.PRINCIPAL_SCOPE, "cachedUser", user);
+ }
+ }
+ else
+ {
+ // Lookup
+ user = getUserModule().findUserByUserName(userName);
+ }
//
if (trace)
{
@@ -194,6 +238,17 @@
}
}
+
+ public boolean isCacheUser()
+ {
+ return cacheUser;
+ }
+
+ public void setCacheUser(boolean cacheUser)
+ {
+ this.cacheUser = cacheUser;
+ }
+
/** Implement the last login date feature. */
private static class UserFinalizer implements Serializable, HttpSessionBindingListener
{
@@ -244,7 +299,6 @@
UserModule userModule = null;
UserProfileModule userProfileModule = null;
- //TODO: identity - code change
try
{
userModule = (UserModule)new InitialContext().lookup("java:portal/UserModule");
Added: trunk/core/src/main/org/jboss/portal/core/controller/portlet/CachedUserImpl.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/controller/portlet/CachedUserImpl.java (rev 0)
+++ trunk/core/src/main/org/jboss/portal/core/controller/portlet/CachedUserImpl.java 2007-03-13 00:03:58 UTC (rev 6646)
@@ -0,0 +1,82 @@
+/*
+* 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.core.controller.portlet;
+
+import org.jboss.portal.identity.User;
+
+import java.util.Map;
+
+/**
+ * Simple POJO to cache user data
+ *
+ * @author <a href="mailto:boleslaw dot dawidowicz at redhat anotherdot com">Boleslaw Dawidowicz</a>
+ * @version $Revision: 0.1 $
+ */
+public class CachedUserImpl implements User
+{
+ private static final org.jboss.logging.Logger log = org.jboss.logging.Logger.getLogger(CachedUserImpl.class);
+
+ private Object id;
+
+ private String name;
+
+ private Map profile;
+
+ //restrict constructor
+ private CachedUserImpl()
+ {
+ }
+
+ public CachedUserImpl(Object id, String name, Map profile)
+ {
+ this.id = id;
+ this.name = name;
+ this.profile = profile;
+ }
+
+ public Object getId()
+ {
+ return id;
+ }
+
+ public String getUserName()
+ {
+ return name;
+ }
+
+ public void updatePassword(String password)
+ {
+ log.error("Cached user. Password cannot be updated using this object. Obtain User using UserModule.");
+ }
+
+ public boolean validatePassword(String password)
+ {
+ log.error("Cached user. Password cannot be validated using this object. Obtain User using UserModule.");
+ return false;
+ }
+
+ public Map getProfile()
+ {
+ return profile;
+ }
+}
Modified: trunk/core/src/main/org/jboss/portal/core/controller/portlet/ControllerUserContext.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/controller/portlet/ControllerUserContext.java 2007-03-12 20:19:07 UTC (rev 6645)
+++ trunk/core/src/main/org/jboss/portal/core/controller/portlet/ControllerUserContext.java 2007-03-13 00:03:58 UTC (rev 6646)
@@ -67,6 +67,14 @@
{
User user = getUser();
+ //check if user has been cached and obtain profile from it.
+ if (user instanceof CachedUserImpl)
+ {
+ return ((CachedUserImpl)user).getProfile();
+ }
+
+ //if user was not cached - obtain profile in traditional way.
+
UserProfileModule userProfileModule = null;
//MARK: identity code change
Modified: trunk/core/src/resources/portal-core-sar/META-INF/jboss-service.xml
===================================================================
--- trunk/core/src/resources/portal-core-sar/META-INF/jboss-service.xml 2007-03-12 20:19:07 UTC (rev 6645)
+++ trunk/core/src/resources/portal-core-sar/META-INF/jboss-service.xml 2007-03-13 00:03:58 UTC (rev 6646)
@@ -103,6 +103,7 @@
xmbean-dd=""
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
<xmbean/>
+ <!--<attribute name="cacheUser">true</attribute>-->
<depends>portal:service=Module,type=IdentityServiceController</depends>
</mbean>
<mbean
17 years, 6 months