JBoss Portal SVN: r6375 - trunk/core/src/main/org/jboss/portal/core/model/portal/command.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2007-02-22 08:32:54 -0500 (Thu, 22 Feb 2007)
New Revision: 6375
Modified:
trunk/core/src/main/org/jboss/portal/core/model/portal/command/RenderPageCommand.java
Log:
Default to "generic" layout
Modified: trunk/core/src/main/org/jboss/portal/core/model/portal/command/RenderPageCommand.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/model/portal/command/RenderPageCommand.java 2007-02-22 12:59:18 UTC (rev 6374)
+++ trunk/core/src/main/org/jboss/portal/core/model/portal/command/RenderPageCommand.java 2007-02-22 13:32:54 UTC (rev 6375)
@@ -304,10 +304,10 @@
{
String layoutIdString = page.getProperty(ThemeConstants.PORTAL_PROP_LAYOUT);
- // Last resort: use the nodesk layout
+ // Last resort: use the generic layout
if (layoutIdString == null)
{
- layoutIdString = "nodesk";
+ layoutIdString = "generic";
}
//
19 years, 2 months
JBoss Portal SVN: r6374 - in trunk: core/src/bin/portal-core-war/layouts/generic and 3 other directories.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2007-02-22 07:59:18 -0500 (Thu, 22 Feb 2007)
New Revision: 6374
Added:
trunk/core-cms/src/bin/portal-cms-sar/portal/cms/conf/default-content/default/images/homeimg_cornerelement.png
trunk/core-cms/src/bin/portal-cms-sar/portal/cms/conf/default-content/default/images/homeimg_jbosslogo.png
trunk/core-cms/src/bin/portal-cms-sar/portal/cms/conf/default-content/default/images/homeimg_main.png
Removed:
trunk/core-cms/src/bin/portal-cms-sar/portal/cms/conf/default-content/default/images/homeimg_jbosslogo.gif
trunk/core-cms/src/bin/portal-cms-sar/portal/cms/conf/default-content/default/images/homeimg_main.jpg
Modified:
trunk/core-cms/src/bin/portal-cms-sar/portal/cms/conf/default-content/default/index.html
trunk/core-samples/src/bin/portal-samples-war/images/accessorize.gif
trunk/core-samples/src/bin/portal-samples-war/images/dodemo.gif
trunk/core-samples/src/bin/portal-samples-war/images/getcode.gif
trunk/core/src/bin/portal-core-war/images/user/edit_profile.gif
trunk/core/src/bin/portal-core-war/layouts/generic/index.jsp
trunk/core/src/bin/portal-core-war/layouts/generic/maximized.jsp
Log:
cosmetic
Modified: trunk/core/src/bin/portal-core-war/images/user/edit_profile.gif
===================================================================
(Binary files differ)
Modified: trunk/core/src/bin/portal-core-war/layouts/generic/index.jsp
===================================================================
--- trunk/core/src/bin/portal-core-war/layouts/generic/index.jsp 2007-02-22 00:17:35 UTC (rev 6373)
+++ trunk/core/src/bin/portal-core-war/layouts/generic/index.jsp 2007-02-22 12:59:18 UTC (rev 6374)
@@ -8,8 +8,8 @@
<meta http-equiv="Content-Type" content="text/html;"/>
<!-- to correct the unsightly Flash of Unstyled Content. -->
<script type="text/javascript"></script>
- <!-- inject the theme; default to the renaissance theme if nothing is selected for the portal or the page -->
- <p:theme themeName='renaissance'/>
+ <!-- inject the theme; default to the Renaissance theme if nothing is selected for the portal or the page -->
+ <p:theme themeName="renaissance"/>
<!-- insert header content that was possibly set by portlets on the page -->
<p:headerContent/>
</head>
Modified: trunk/core/src/bin/portal-core-war/layouts/generic/maximized.jsp
===================================================================
--- trunk/core/src/bin/portal-core-war/layouts/generic/maximized.jsp 2007-02-22 00:17:35 UTC (rev 6373)
+++ trunk/core/src/bin/portal-core-war/layouts/generic/maximized.jsp 2007-02-22 12:59:18 UTC (rev 6374)
@@ -9,7 +9,7 @@
<!-- to correct the unsightly Flash of Unstyled Content. -->
<script type="text/javascript"></script>
<!-- use the renaissance theme if nothing else was defined for the portal or the page -->
- <p:theme themeName='renaissance'/>
+ <p:theme themeName="renaissance"/>
<!-- inject header content that was generated by the portlets on the requested page -->
<p:headerContent/>
</head>
Added: trunk/core-cms/src/bin/portal-cms-sar/portal/cms/conf/default-content/default/images/homeimg_cornerelement.png
===================================================================
(Binary files differ)
Property changes on: trunk/core-cms/src/bin/portal-cms-sar/portal/cms/conf/default-content/default/images/homeimg_cornerelement.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Deleted: trunk/core-cms/src/bin/portal-cms-sar/portal/cms/conf/default-content/default/images/homeimg_jbosslogo.gif
===================================================================
(Binary files differ)
Added: trunk/core-cms/src/bin/portal-cms-sar/portal/cms/conf/default-content/default/images/homeimg_jbosslogo.png
===================================================================
(Binary files differ)
Property changes on: trunk/core-cms/src/bin/portal-cms-sar/portal/cms/conf/default-content/default/images/homeimg_jbosslogo.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Deleted: trunk/core-cms/src/bin/portal-cms-sar/portal/cms/conf/default-content/default/images/homeimg_main.jpg
===================================================================
(Binary files differ)
Added: trunk/core-cms/src/bin/portal-cms-sar/portal/cms/conf/default-content/default/images/homeimg_main.png
===================================================================
(Binary files differ)
Property changes on: trunk/core-cms/src/bin/portal-cms-sar/portal/cms/conf/default-content/default/images/homeimg_main.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/core-cms/src/bin/portal-cms-sar/portal/cms/conf/default-content/default/index.html
===================================================================
--- trunk/core-cms/src/bin/portal-cms-sar/portal/cms/conf/default-content/default/index.html 2007-02-22 00:17:35 UTC (rev 6373)
+++ trunk/core-cms/src/bin/portal-cms-sar/portal/cms/conf/default-content/default/index.html 2007-02-22 12:59:18 UTC (rev 6374)
@@ -9,7 +9,6 @@
}
#welcomegreybox {
- background-color: #f4f4f4;
padding: 15px;
margin-bottom: 30px;
}
@@ -25,14 +24,11 @@
}
</style>
-<table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td width="560"><img src="default/images/homeimg_main.jpg" width="560" height="160"/></td>
- <td align="right" valign="top" bgcolor="#7AB5E0"><img src="default/images/homeimg_cornerelement.gif" width="2"
- height="2"/></td>
- </tr>
-</table>
-<div id="welcomelogo"><img src="default/images/homeimg_jbosslogo.gif" width="143" height="64"/></div>
+<div>
+ <img src="default/images/homeimg_main.png" width="560" height="160"/>
+</div>
+
+<div id="welcomelogo"><img src="default/images/homeimg_jbosslogo.png" width="143" height="64"/></div>
<p id="welcometext">JBoss Portal provides an open source platform for hosting and serving a portal Web interface,
publishing and managing its content, and customizing its experience. While most packaged Portal frameworks help
enterprises launch Portals more quickly, only JBoss Portal delivers the benefits of a zero-cost open source license
Modified: trunk/core-samples/src/bin/portal-samples-war/images/accessorize.gif
===================================================================
(Binary files differ)
Modified: trunk/core-samples/src/bin/portal-samples-war/images/dodemo.gif
===================================================================
(Binary files differ)
Modified: trunk/core-samples/src/bin/portal-samples-war/images/getcode.gif
===================================================================
(Binary files differ)
19 years, 2 months
JBoss Portal SVN: r6372 - trunk/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2007-02-21 19:13:52 -0500 (Wed, 21 Feb 2007)
New Revision: 6372
Modified:
trunk/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/create.jsp
Log:
Fixed typo
Modified: trunk/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/create.jsp
===================================================================
--- trunk/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/create.jsp 2007-02-22 00:01:21 UTC (rev 6371)
+++ trunk/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/create.jsp 2007-02-22 00:13:52 UTC (rev 6372)
@@ -65,10 +65,7 @@
</td>
</tr>
<tr>
- <td
- ">
- ${n:i18n("CMS_DESCRIPTION")}:
- </td>
+ <td>${n:i18n("CMS_DESCRIPTION")}:</td>
<td><input type="text" size="40" maxlength="80"
name="description" value=""
class="portlet-form-input-field"/></td>
19 years, 2 months
JBoss Portal SVN: r6371 - in trunk: build/ide/intellij/idea60/modules/core-cms and 8 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-02-21 19:01:21 -0500 (Wed, 21 Feb 2007)
New Revision: 6371
Added:
trunk/core-cms/src/main/org/jboss/portal/core/cms/content/CMSFaceletContentEditor.java
trunk/core-cms/src/resources/portal-cms-sar/content/
trunk/core-cms/src/resources/portal-cms-sar/content/editor.xhtml
Modified:
trunk/build/ide/intellij/idea60/modules/core-admin/core-admin.iml
trunk/build/ide/intellij/idea60/modules/core-cms/core-cms.iml
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/content/ContentEditorRegistryBean.java
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/content/ContentEditorTagHandler.java
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsp/management/plugins/manager.xhtml
trunk/core-cms/build.xml
trunk/core-cms/src/resources/portal-cms-sar/META-INF/jboss-service.xml
trunk/tools/etc/buildfragments/modules.ent
Log:
added plugin selection via content type and added embryon of cms plugin
Modified: trunk/build/ide/intellij/idea60/modules/core-admin/core-admin.iml
===================================================================
--- trunk/build/ide/intellij/idea60/modules/core-admin/core-admin.iml 2007-02-21 22:55:25 UTC (rev 6370)
+++ trunk/build/ide/intellij/idea60/modules/core-admin/core-admin.iml 2007-02-22 00:01:21 UTC (rev 6371)
@@ -90,6 +90,16 @@
</orderEntry>
<orderEntry type="module" module-name="format" />
<orderEntry type="module" module-name="portlet-federation" />
+ <orderEntry type="module" module-name="jems" />
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/el/lib/el-api.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
<orderEntryProperties />
</component>
<component name="VcsManagerConfiguration">
Modified: trunk/build/ide/intellij/idea60/modules/core-cms/core-cms.iml
===================================================================
--- trunk/build/ide/intellij/idea60/modules/core-cms/core-cms.iml 2007-02-21 22:55:25 UTC (rev 6370)
+++ trunk/build/ide/intellij/idea60/modules/core-cms/core-cms.iml 2007-02-22 00:01:21 UTC (rev 6371)
@@ -53,6 +53,7 @@
<orderEntry type="module" module-name="identity" />
<orderEntry type="module" module-name="common" />
<orderEntry type="module" module-name="theme" />
+ <orderEntry type="module" module-name="core-admin" />
<orderEntryProperties />
</component>
<component name="VcsManagerConfiguration">
Modified: trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/content/ContentEditorRegistryBean.java
===================================================================
--- trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/content/ContentEditorRegistryBean.java 2007-02-21 22:55:25 UTC (rev 6370)
+++ trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/content/ContentEditorRegistryBean.java 2007-02-22 00:01:21 UTC (rev 6371)
@@ -25,9 +25,13 @@
import org.jboss.portal.faces.el.PropertyAccessor;
import org.jboss.portal.core.model.content.ContentType;
+import javax.faces.model.SelectItem;
import java.util.Map;
import java.util.HashMap;
import java.util.Iterator;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Set;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -42,9 +46,12 @@
/** . */
private PropertyAccessor editors;
+ /** . */
+ private String selectedType;
public ContentEditorRegistryBean()
{
+ selectedType = "portlet";
editors = new PropertyAccessor()
{
public Class getType(Object propertyName)
@@ -73,7 +80,31 @@
return null;
}
+ public List getAvailableTypes()
+ {
+ Set types = registry.getContentTypes();
+ List items = new ArrayList(types.size());
+ for (Iterator i = types.iterator();i.hasNext();)
+ {
+ ContentType def = (ContentType)i.next();
+ SelectItem item = new SelectItem();
+ item.setValue(def.toString());
+ item.setLabel(def.toString());
+ items.add(item);
+ }
+ return items;
+ }
+ public String getSelectedType()
+ {
+ return selectedType;
+ }
+
+ public void setSelectedType(String selectedType)
+ {
+ this.selectedType = selectedType;
+ }
+
public ContentEditorRegistry getRegistry()
{
return registry;
Modified: trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/content/ContentEditorTagHandler.java
===================================================================
--- trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/content/ContentEditorTagHandler.java 2007-02-21 22:55:25 UTC (rev 6370)
+++ trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/content/ContentEditorTagHandler.java 2007-02-22 00:01:21 UTC (rev 6371)
@@ -55,6 +55,9 @@
private final TagAttribute src;
/** . */
+ private final TagAttribute contentType;
+
+ /** . */
private final TagAttribute contentURI;
public ContentEditorTagHandler(TagConfig tagConfig)
@@ -64,6 +67,7 @@
//
this.src = this.getRequiredAttribute("src");
this.contentURI = this.getRequiredAttribute("contentURI");
+ this.contentType = this.getRequiredAttribute("contentType");
}
public ContentEditorRegistry getRegistry()
@@ -79,10 +83,22 @@
public void apply(FaceletContext ctx, UIComponent parent) throws IOException, FacesException, FaceletException, ELException
{
ExpressionFactory f = ctx.getExpressionFactory();
+
ValueExpression ve = f.createValueExpression(ctx, "#{applicationScope.ContentEditorRegistry}", ContentEditorRegistry.class);
ContentEditorRegistry registry = (ContentEditorRegistry)ve.getValue(ctx);
- FaceletContentEditor editor = (FaceletContentEditor)registry.getEditor(ContentType.PORTLET);
+
+ // Get content type value
+ ValueExpression contentTypeValue = contentType.getValueExpression(ctx, Object.class);
+ String contentTypeString = (String)contentTypeValue.getValue(ctx);
+ ContentType ct = ContentType.create(contentTypeString);
+
+ // Get editor
+ FaceletContentEditor editor = (FaceletContentEditor)registry.getEditor(ct);
+
+ // Get editor URL
URL url = editor.getFaceletURL();
+
+ // Do the include stuff
VariableMapper orig = ctx.getVariableMapper();
ctx.setVariableMapper(new VariableMapperWrapper(orig));
try
Modified: trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsp/management/plugins/manager.xhtml
===================================================================
--- trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsp/management/plugins/manager.xhtml 2007-02-21 22:55:25 UTC (rev 6370)
+++ trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsp/management/plugins/manager.xhtml 2007-02-22 00:01:21 UTC (rev 6371)
@@ -148,13 +148,23 @@
<h:outputText style="font-weight:bold;" value="Type: "/>
<f:verbatim>Window<br/></f:verbatim>
+ <h:form id="content_type_form">
+ <h:selectOneMenu
+ value="#{registry.selectedType}">
+ <f:selectItems value="#{registry.availableTypes}"/>
+ </h:selectOneMenu>
+ <h:commandButton value="Change content type"/>
+ </h:form>
+
<h:form id="window_form">
<ct:content
src="bilto_src"
+ contentType="#{registry.selectedType}"
contentURI="#{portalobjectmgr.selectedObject.instanceRef}"/>
<br/>
<h:commandButton value="Change instance"/>
</h:form>
+
<h:outputLink value="#{portalobjectmgr.previewURL}" title="Preview link" target="_blank">Preview link</h:outputLink>
</h:panelGroup>
Modified: trunk/core-cms/build.xml
===================================================================
--- trunk/core-cms/build.xml 2007-02-21 22:55:25 UTC (rev 6370)
+++ trunk/core-cms/build.xml 2007-02-22 00:01:21 UTC (rev 6371)
@@ -133,6 +133,7 @@
<path refid="jboss.portal-test.classpath"/>
<path refid="jboss.portal-core.classpath"/>
<path refid="jboss.portal-workflow.classpath"/>
+ <path refid="jboss.portal-core-admin.classpath"/>
</path>
<!--+=======================================+-->
Added: trunk/core-cms/src/main/org/jboss/portal/core/cms/content/CMSFaceletContentEditor.java
===================================================================
--- trunk/core-cms/src/main/org/jboss/portal/core/cms/content/CMSFaceletContentEditor.java (rev 0)
+++ trunk/core-cms/src/main/org/jboss/portal/core/cms/content/CMSFaceletContentEditor.java 2007-02-22 00:01:21 UTC (rev 6371)
@@ -0,0 +1,33 @@
+/******************************************************************************
+ * 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.cms.content;
+
+import org.jboss.portal.core.portlet.management.content.AbstractFaceletContentEditor;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class CMSFaceletContentEditor extends AbstractFaceletContentEditor
+{
+}
Modified: trunk/core-cms/src/resources/portal-cms-sar/META-INF/jboss-service.xml
===================================================================
--- trunk/core-cms/src/resources/portal-cms-sar/META-INF/jboss-service.xml 2007-02-21 22:55:25 UTC (rev 6370)
+++ trunk/core-cms/src/resources/portal-cms-sar/META-INF/jboss-service.xml 2007-02-22 00:01:21 UTC (rev 6371)
@@ -686,6 +686,19 @@
<attribute name="ContentType">cms</attribute>
</mbean>
+ <mbean
+ code="org.jboss.portal.core.cms.content.CMSFaceletContentEditor"
+ name="portal:service=ContentEditor,type=cms2"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <attribute name="ContentType">cms</attribute>
+ <attribute name="FaceletPath">content/editor.xhtml</attribute>
+ <depends
+ optional-attribute-name="Registry"
+ proxy-type="attribute">portal:service=ContentEditorRegistry2</depends>
+ </mbean>
+
<!-- Content renderer integration -->
<mbean
code="org.jboss.portal.core.cms.content.CMSContentRenderer"
Added: trunk/core-cms/src/resources/portal-cms-sar/content/editor.xhtml
===================================================================
--- trunk/core-cms/src/resources/portal-cms-sar/content/editor.xhtml (rev 0)
+++ trunk/core-cms/src/resources/portal-cms-sar/content/editor.xhtml 2007-02-22 00:01:21 UTC (rev 6371)
@@ -0,0 +1,9 @@
+<div
+ 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">
+
+ <h:outputText value="TOTO"/>
+
+</div>
\ No newline at end of file
Modified: trunk/tools/etc/buildfragments/modules.ent
===================================================================
--- trunk/tools/etc/buildfragments/modules.ent 2007-02-21 22:55:25 UTC (rev 6370)
+++ trunk/tools/etc/buildfragments/modules.ent 2007-02-22 00:01:21 UTC (rev 6371)
@@ -99,6 +99,13 @@
<pathelement path="${jboss.portal-core.lib}/jboss-portlet-api-lib.jar"/>
</path>
+ <!-- core-admin -->
+ <property name="jboss.portal-core-admin.root" value="${project.root}/core-admin/output"/>
+ <property name="jboss.portal-core-admin.lib" value="${jboss.portal-core-admin.root}/lib"/>
+ <path id="jboss.portal-core-admin.classpath">
+ <pathelement path="${jboss.portal-core-admin.lib}/portal-core-admin-lib.jar"/>
+ </path>
+
<!-- core-cms -->
<property name="jboss.portal-core-cms.root" value="${project.root}/core-cms/output"/>
<property name="jboss.portal-core-cms.lib" value="${jboss.portal-core-cms.root}/lib"/>
19 years, 2 months
JBoss Portal SVN: r6370 - in trunk: core-admin/src/main/org/jboss/portal/core/portlet/management and 11 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-02-21 17:55:25 -0500 (Wed, 21 Feb 2007)
New Revision: 6370
Added:
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/content/
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/content/AbstractContentEditor.java
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/content/AbstractFaceletContentEditor.java
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/content/ContentEditor.java
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/content/ContentEditorRegistry.java
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/content/ContentEditorRegistryBean.java
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/content/ContentEditorRegistryService.java
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/content/ContentEditorTagHandler.java
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/content/FaceletContentEditor.java
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/content/PortletContentEditor.java
trunk/core-admin/src/resources/portal-admin-sar/
trunk/core-admin/src/resources/portal-admin-sar/META-INF/
trunk/core-admin/src/resources/portal-admin-sar/META-INF/jboss-service.xml
trunk/core-admin/src/resources/portal-admin-sar/content/
trunk/core-admin/src/resources/portal-admin-sar/content/editor.xhtml
trunk/core-admin/src/resources/portal-admin-war/META-INF/
trunk/core-admin/src/resources/portal-admin-war/META-INF/content.taglib.xml
Modified:
trunk/core-admin/build.xml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/faces-config.xml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jboss-portlet.xml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsp/management/index.xhtml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsp/management/plugins/manager.xhtml
trunk/faces/src/main/org/jboss/portal/faces/el/DelegatingPropertyResolver.java
trunk/faces/src/main/org/jboss/portal/faces/el/PropertyAccessor.java
trunk/faces/src/main/org/jboss/portal/faces/el/TypeDef.java
Log:
started to work on the content editor plugin for the JSF management app : for now the portlet instance choice for a window is integrated outside of the war file. Need to make the same for CMS content.
Modified: trunk/core-admin/build.xml
===================================================================
--- trunk/core-admin/build.xml 2007-02-21 20:37:57 UTC (rev 6369)
+++ trunk/core-admin/build.xml 2007-02-21 22:55:25 UTC (rev 6370)
@@ -96,6 +96,7 @@
<path refid="apache.log4j.classpath"/>
<path refid="sun.servlet.classpath"/>
<path refid="facelets.facelets.classpath"/>
+ <path refid="el.el.classpath"/>
<pathelement location="${source.etc}/sun-jsf/jsf-example.jar"/>
</path>
@@ -189,20 +190,22 @@
</fileset>
</jar>
- <!-- portal-admin.war -->
- <copy todir="${build.resources}/portal-admin.war">
- <fileset dir="${build.resources}/portal-admin-war"/>
- <fileset dir="${source.bin}/portal-admin-war"/>
+ <!-- portal-admin.sar -->
+ <copy todir="${build.resources}/portal-admin.sar">
+ <fileset dir="${build.resources}/portal-admin-sar"/>
</copy>
- <copy todir="${build.resources}/portal-admin.war/WEB-INF/lib">
+ <copy todir="${build.resources}/portal-admin.sar/lib">
<fileset dir="${build.lib}" includes="portal-core-admin-lib.jar"/>
-
<fileset dir="${facelets.facelets.lib}" includes="jsf-facelets.jar"/>
<fileset dir="${apache.tomahawk.lib}" includes="tomahawk.jar"/>
<fileset dir="${source.etc}/sun-jsf" includes="jsf-example.jar"/>
<fileset dir="${apache.lang.lib}" includes="commons-lang-2.0.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"/>
+ </copy>
</target>
@@ -211,8 +214,8 @@
<target name="output" depends="artifacts">
<!-- Build archives -->
<implode
- dir="${build.resources}/portal-admin.war"
- tofile="${build.lib}/portal-admin.war"/>
+ dir="${build.resources}/portal-admin.sar"
+ tofile="${build.lib}/portal-admin.sar"/>
</target>
<!-- ================================================================== -->
@@ -255,7 +258,7 @@
description="Deploy."
depends="output">
<require file="${jboss.home}/server/${portal.deploy.dir}"/>
- <copy file="${build.lib}/portal-admin.war" todir="${jboss.home}/server/${portal.deploy.dir}" overwrite="true"/>
+ <copy file="${build.lib}/portal-admin.sar" todir="${jboss.home}/server/${portal.deploy.dir}" overwrite="true"/>
</target>
<!--
@@ -265,7 +268,7 @@
description="Undeploy."
depends="init">
<require file="${jboss.home}/server/${portal.deploy.dir}"/>
- <delete file="${jboss.home}/server/${portal.deploy.dir}/portal-admin.war"/>
+ <delete file="${jboss.home}/server/${portal.deploy.dir}/portal-admin.sar"/>
</target>
</project>
Added: trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/content/AbstractContentEditor.java
===================================================================
--- trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/content/AbstractContentEditor.java (rev 0)
+++ trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/content/AbstractContentEditor.java 2007-02-21 22:55:25 UTC (rev 6370)
@@ -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.core.portlet.management.content;
+
+import org.jboss.portal.jems.as.system.AbstractJBossService;
+import org.jboss.portal.core.model.content.ContentType;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class AbstractContentEditor extends AbstractJBossService implements ContentEditor
+{
+
+ /** . */
+ private String contentType;
+
+ /** . */
+ private ContentEditorRegistry registry;
+
+ /** . */
+ private ContentType registeredContentType;
+
+ public ContentEditorRegistry getRegistry()
+ {
+ return registry;
+ }
+
+ public void setRegistry(ContentEditorRegistry registry)
+ {
+ this.registry = registry;
+ }
+
+ public String getContentType()
+ {
+ return contentType;
+ }
+
+ public void setContentType(String contentType)
+ {
+ this.contentType = contentType;
+ }
+
+ protected void startService() throws Exception
+ {
+ registeredContentType = ContentType.create(contentType);
+ registry.registerEditor(registeredContentType, this);
+ }
+
+ protected void stopService() throws Exception
+ {
+ registry.unregisterEditor(registeredContentType);
+ }
+}
Added: trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/content/AbstractFaceletContentEditor.java
===================================================================
--- trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/content/AbstractFaceletContentEditor.java (rev 0)
+++ trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/content/AbstractFaceletContentEditor.java 2007-02-21 22:55:25 UTC (rev 6370)
@@ -0,0 +1,70 @@
+/******************************************************************************
+ * 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.portlet.management.content;
+
+import java.net.URL;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public abstract class AbstractFaceletContentEditor extends AbstractContentEditor implements FaceletContentEditor
+{
+
+ /** . */
+ private String faceletPath;
+
+ /** . */
+ private URL faceletURL;
+
+ public String getFaceletPath()
+ {
+ return faceletPath;
+ }
+
+ public void setFaceletPath(String faceletPath)
+ {
+ this.faceletPath = faceletPath;
+ }
+
+ protected void startService() throws Exception
+ {
+ faceletURL = Thread.currentThread().getContextClassLoader().getResource(faceletPath);
+
+ //
+ super.startService();
+ }
+
+ protected void stopService() throws Exception
+ {
+ super.stopService();
+
+ //
+ faceletURL = null;
+ }
+
+ public URL getFaceletURL()
+ {
+ return faceletURL;
+ }
+}
Added: trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/content/ContentEditor.java
===================================================================
--- trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/content/ContentEditor.java (rev 0)
+++ trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/content/ContentEditor.java 2007-02-21 22:55:25 UTC (rev 6370)
@@ -0,0 +1,33 @@
+/******************************************************************************
+ * 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.portlet.management.content;
+
+import java.net.URL;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public interface ContentEditor
+{
+}
Added: trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/content/ContentEditorRegistry.java
===================================================================
--- trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/content/ContentEditorRegistry.java (rev 0)
+++ trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/content/ContentEditorRegistry.java 2007-02-21 22:55:25 UTC (rev 6370)
@@ -0,0 +1,39 @@
+/******************************************************************************
+ * 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.portlet.management.content;
+
+import org.jboss.portal.core.model.content.ContentType;
+
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public interface ContentEditorRegistry
+{
+ Set getContentTypes();
+ void registerEditor(ContentType contentType, ContentEditor editor);
+ void unregisterEditor(ContentType contentType);
+ ContentEditor getEditor(ContentType contentType);
+}
Added: trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/content/ContentEditorRegistryBean.java
===================================================================
--- trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/content/ContentEditorRegistryBean.java (rev 0)
+++ trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/content/ContentEditorRegistryBean.java 2007-02-21 22:55:25 UTC (rev 6370)
@@ -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.core.portlet.management.content;
+
+import org.jboss.portal.faces.el.PropertyAccessor;
+import org.jboss.portal.core.model.content.ContentType;
+
+import java.util.Map;
+import java.util.HashMap;
+import java.util.Iterator;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class ContentEditorRegistryBean
+{
+
+ /** . */
+ private ContentEditorRegistry registry;
+
+ /** . */
+ private PropertyAccessor editors;
+
+
+ public ContentEditorRegistryBean()
+ {
+ editors = new PropertyAccessor()
+ {
+ public Class getType(Object propertyName)
+ {
+ ContentEditor editor = getEditor(propertyName);
+ if (editor != null)
+ {
+ return editor.getClass();
+ }
+ return null;
+ }
+ public Object getValue(Object propertyName)
+ {
+ return getEditor(propertyName);
+ }
+ };
+ }
+
+ private ContentEditor getEditor(Object propertyName)
+ {
+ if (propertyName instanceof String)
+ {
+ ContentType ct = ContentType.create((String)propertyName);
+ return registry.getEditor(ct);
+ }
+ return null;
+ }
+
+
+ public ContentEditorRegistry getRegistry()
+ {
+ return registry;
+ }
+
+ public void setRegistry(ContentEditorRegistry registry)
+ {
+ this.registry = registry;
+ }
+
+ public PropertyAccessor getEditors()
+ {
+ return editors;
+ }
+}
Added: trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/content/ContentEditorRegistryService.java
===================================================================
--- trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/content/ContentEditorRegistryService.java (rev 0)
+++ trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/content/ContentEditorRegistryService.java 2007-02-21 22:55:25 UTC (rev 6370)
@@ -0,0 +1,65 @@
+/******************************************************************************
+ * 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.portlet.management.content;
+
+import org.jboss.portal.core.model.content.ContentType;
+import org.jboss.portal.common.util.CopyOnWriteRegistry;
+import org.jboss.portal.jems.as.system.AbstractJBossService;
+
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class ContentEditorRegistryService extends AbstractJBossService implements ContentEditorRegistry
+{
+
+ /** . */
+ private final CopyOnWriteRegistry registry;
+
+ public ContentEditorRegistryService()
+ {
+ registry = new CopyOnWriteRegistry();
+ }
+
+ public Set getContentTypes()
+ {
+ return registry.getKeys();
+ }
+
+ public void registerEditor(ContentType contentType, ContentEditor editor)
+ {
+ registry.register(contentType, editor);
+ }
+
+ public void unregisterEditor(ContentType contentType)
+ {
+ registry.unregister(contentType);
+ }
+
+ public ContentEditor getEditor(ContentType contentType)
+ {
+ return (ContentEditor)registry.getRegistration(contentType);
+ }
+}
Added: trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/content/ContentEditorTagHandler.java
===================================================================
--- trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/content/ContentEditorTagHandler.java (rev 0)
+++ trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/content/ContentEditorTagHandler.java 2007-02-21 22:55:25 UTC (rev 6370)
@@ -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.core.portlet.management.content;
+
+import com.sun.facelets.tag.TagHandler;
+import com.sun.facelets.tag.TagConfig;
+import com.sun.facelets.tag.TagAttribute;
+import com.sun.facelets.FaceletContext;
+import com.sun.facelets.FaceletException;
+import com.sun.facelets.el.VariableMapperWrapper;
+
+import javax.faces.component.UIComponent;
+import javax.faces.FacesException;
+import javax.el.ELException;
+import javax.el.ValueExpression;
+import javax.el.ExpressionFactory;
+import javax.el.VariableMapper;
+import javax.el.ELContext;
+import java.io.IOException;
+import java.net.URL;
+
+import org.jboss.portal.core.model.content.ContentType;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class ContentEditorTagHandler extends TagHandler
+{
+
+ /** . */
+ private ContentEditorRegistry registry;
+
+ /** . */
+ private final TagAttribute src;
+
+ /** . */
+ private final TagAttribute contentURI;
+
+ public ContentEditorTagHandler(TagConfig tagConfig)
+ {
+ super(tagConfig);
+
+ //
+ this.src = this.getRequiredAttribute("src");
+ this.contentURI = this.getRequiredAttribute("contentURI");
+ }
+
+ public ContentEditorRegistry getRegistry()
+ {
+ return registry;
+ }
+
+ public void setRegistry(ContentEditorRegistry registry)
+ {
+ this.registry = registry;
+ }
+
+ public void apply(FaceletContext ctx, UIComponent parent) throws IOException, FacesException, FaceletException, ELException
+ {
+ ExpressionFactory f = ctx.getExpressionFactory();
+ ValueExpression ve = f.createValueExpression(ctx, "#{applicationScope.ContentEditorRegistry}", ContentEditorRegistry.class);
+ ContentEditorRegistry registry = (ContentEditorRegistry)ve.getValue(ctx);
+ FaceletContentEditor editor = (FaceletContentEditor)registry.getEditor(ContentType.PORTLET);
+ URL url = editor.getFaceletURL();
+ VariableMapper orig = ctx.getVariableMapper();
+ ctx.setVariableMapper(new VariableMapperWrapper(orig));
+ try
+ {
+ nextHandler.apply(ctx, null);
+
+ //
+ ValueExpression valueVE = contentURI.getValueExpression(ctx, Object.class);
+ ctx.getVariableMapper().setVariable(contentURI.getLocalName(), valueVE);
+
+ //
+ ctx.includeFacelet(parent, url);
+ }
+ finally
+ {
+ ctx.setVariableMapper(orig);
+ }
+ }
+}
Added: trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/content/FaceletContentEditor.java
===================================================================
--- trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/content/FaceletContentEditor.java (rev 0)
+++ trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/content/FaceletContentEditor.java 2007-02-21 22:55:25 UTC (rev 6370)
@@ -0,0 +1,34 @@
+/******************************************************************************
+ * 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.portlet.management.content;
+
+import java.net.URL;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public interface FaceletContentEditor extends ContentEditor
+{
+ URL getFaceletURL();
+}
Added: trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/content/PortletContentEditor.java
===================================================================
--- trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/content/PortletContentEditor.java (rev 0)
+++ trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/content/PortletContentEditor.java 2007-02-21 22:55:25 UTC (rev 6370)
@@ -0,0 +1,69 @@
+/******************************************************************************
+ * 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.portlet.management.content;
+
+import org.jboss.portal.core.model.instance.InstanceContainer;
+import org.jboss.portal.core.model.instance.InstanceDefinition;
+
+import javax.faces.model.SelectItem;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class PortletContentEditor extends AbstractFaceletContentEditor
+{
+
+ /** . */
+ private InstanceContainer instanceContainer;
+
+ public InstanceContainer getInstanceContainer()
+ {
+ return instanceContainer;
+ }
+
+ public void setInstanceContainer(InstanceContainer instanceContainer)
+ {
+ this.instanceContainer = instanceContainer;
+ }
+
+ public List getInstances()
+ {
+ Collection definitions = instanceContainer.getDefinitions();
+ List items = new ArrayList(definitions.size());
+ for (Iterator i = definitions.iterator();i.hasNext();)
+ {
+ InstanceDefinition def = (InstanceDefinition)i.next();
+ SelectItem item = new SelectItem();
+ item.setValue(def.getId());
+ item.setDescription("blah");
+ item.setLabel(def.getId());
+ items.add(item);
+ }
+ return items;
+ }
+}
Added: trunk/core-admin/src/resources/portal-admin-sar/META-INF/jboss-service.xml
===================================================================
--- trunk/core-admin/src/resources/portal-admin-sar/META-INF/jboss-service.xml (rev 0)
+++ trunk/core-admin/src/resources/portal-admin-sar/META-INF/jboss-service.xml 2007-02-21 22:55:25 UTC (rev 6370)
@@ -0,0 +1,52 @@
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ 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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<server>
+
+ <!-- -->
+ <mbean
+ code="org.jboss.portal.core.portlet.management.content.ContentEditorRegistryService"
+ name="portal:service=ContentEditorRegistry2"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ </mbean>
+
+ <!-- -->
+ <mbean
+ code="org.jboss.portal.core.portlet.management.content.PortletContentEditor"
+ name="portal:service=ContentEditor,type=portlet2"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <attribute name="ContentType">portlet</attribute>
+ <attribute name="FaceletPath">content/editor.xhtml</attribute>
+ <depends
+ optional-attribute-name="Registry"
+ proxy-type="attribute">portal:service=ContentEditorRegistry2</depends>
+ <depends
+ optional-attribute-name="InstanceContainer"
+ proxy-type="attribute">portal:container=Instance</depends>
+ </mbean>
+
+</server>
Added: trunk/core-admin/src/resources/portal-admin-sar/content/editor.xhtml
===================================================================
--- trunk/core-admin/src/resources/portal-admin-sar/content/editor.xhtml (rev 0)
+++ trunk/core-admin/src/resources/portal-admin-sar/content/editor.xhtml 2007-02-21 22:55:25 UTC (rev 6370)
@@ -0,0 +1,12 @@
+<div
+ 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">
+
+ <h:selectOneListbox
+ value="#{contentURI}">
+ <f:selectItems value="#{registry.editors.portlet.instances}"/>
+ </h:selectOneListbox>
+
+</div>
\ No newline at end of file
Added: trunk/core-admin/src/resources/portal-admin-war/META-INF/content.taglib.xml
===================================================================
--- trunk/core-admin/src/resources/portal-admin-war/META-INF/content.taglib.xml (rev 0)
+++ trunk/core-admin/src/resources/portal-admin-war/META-INF/content.taglib.xml 2007-02-21 22:55:25 UTC (rev 6370)
@@ -0,0 +1,10 @@
+<!DOCTYPE facelet-taglib PUBLIC
+ "-//Sun Microsystems, Inc.//DTD Facelet Taglib 1.0//EN"
+ "http://java.sun.com/dtd/facelet-taglib_1_0.dtd">
+<facelet-taglib>
+ <namespace>http://www.julien.com</namespace>
+ <tag>
+ <tag-name>content</tag-name>
+ <handler-class>org.jboss.portal.core.portlet.management.content.ContentEditorTagHandler</handler-class>
+ </tag>
+</facelet-taglib>
\ No newline at end of file
Modified: trunk/core-admin/src/resources/portal-admin-war/WEB-INF/faces-config.xml
===================================================================
--- trunk/core-admin/src/resources/portal-admin-war/WEB-INF/faces-config.xml 2007-02-21 20:37:57 UTC (rev 6369)
+++ trunk/core-admin/src/resources/portal-admin-war/WEB-INF/faces-config.xml 2007-02-21 22:55:25 UTC (rev 6370)
@@ -180,6 +180,17 @@
</managed-property>
</managed-bean>
+ <!-- The content editor registry bean -->
+ <managed-bean>
+ <managed-bean-name>registry</managed-bean-name>
+ <managed-bean-class>org.jboss.portal.core.portlet.management.content.ContentEditorRegistryBean</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ <managed-property>
+ <property-name>registry</property-name>
+ <value>#{applicationScope.ContentEditorRegistry}</value>
+ </managed-property>
+ </managed-bean>
+
<navigation-rule>
<navigation-case>
<from-outcome>portalobjects</from-outcome>
Modified: trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jboss-portlet.xml
===================================================================
--- trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jboss-portlet.xml 2007-02-21 20:37:57 UTC (rev 6369)
+++ trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jboss-portlet.xml 2007-02-21 22:55:25 UTC (rev 6370)
@@ -99,7 +99,7 @@
</service>
<service>
<service-name>ContentEditorRegistry</service-name>
- <service-class>org.jboss.portal.core.portlet.dashboard.ContentEditorRegistry</service-class>
- <service-ref>:service=ContentEditorRegistry</service-ref>
+ <service-class>org.jboss.portal.core.portlet.management.content.ContentEditorRegistry</service-class>
+ <service-ref>:service=ContentEditorRegistry2</service-ref>
</service>
</portlet-app>
Modified: trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsp/management/index.xhtml
===================================================================
--- trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsp/management/index.xhtml 2007-02-21 20:37:57 UTC (rev 6369)
+++ trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsp/management/index.xhtml 2007-02-21 22:55:25 UTC (rev 6370)
@@ -13,6 +13,7 @@
cellpadding="2"
rowClasses="vertTop"
columnClasses=",,content">
+
<h:panelGroup id="pg1">
<h:form id="foo">
<t:tree2
Modified: trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsp/management/plugins/manager.xhtml
===================================================================
--- trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsp/management/plugins/manager.xhtml 2007-02-21 20:37:57 UTC (rev 6369)
+++ trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsp/management/plugins/manager.xhtml 2007-02-21 22:55:25 UTC (rev 6370)
@@ -3,7 +3,8 @@
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:t="http://myfaces.apache.org/tomahawk">
+ xmlns:t="http://myfaces.apache.org/tomahawk"
+ xmlns:ct="http://www.julien.com">
<br/>
<!-- Context tab -->
<h:panelGroup
@@ -145,15 +146,17 @@
<h:outputText value="#{portalobjectmgr.selectedObject.name}"/>
<f:verbatim><br/><br/></f:verbatim>
<h:outputText style="font-weight:bold;" value="Type: "/>
- <f:verbatim>WINDOW<br/></f:verbatim>
+ <f:verbatim>Window<br/></f:verbatim>
+
<h:form id="window_form">
- <h:selectOneMenu value="#{portalobjectmgr.selectedObject.instanceRef}">
- <f:selectItems value="#{portalobjectmgr.instanceItems}"/>
- </h:selectOneMenu>
+ <ct:content
+ src="bilto_src"
+ contentURI="#{portalobjectmgr.selectedObject.instanceRef}"/>
<br/>
<h:commandButton value="Change instance"/>
</h:form>
<h:outputLink value="#{portalobjectmgr.previewURL}" title="Preview link" target="_blank">Preview link</h:outputLink>
+
</h:panelGroup>
<br/>
<h:panelGroup
Modified: trunk/faces/src/main/org/jboss/portal/faces/el/DelegatingPropertyResolver.java
===================================================================
--- trunk/faces/src/main/org/jboss/portal/faces/el/DelegatingPropertyResolver.java 2007-02-21 20:37:57 UTC (rev 6369)
+++ trunk/faces/src/main/org/jboss/portal/faces/el/DelegatingPropertyResolver.java 2007-02-21 22:55:25 UTC (rev 6370)
@@ -80,7 +80,7 @@
TypeDef typeDef = resolveTypeDef(base);
if (typeDef != null)
{
- PropertyDef propDef = typeDef.getAccessor(property);
+ PropertyDef propDef = typeDef.getAccessor(base, property);
if (propDef != null)
{
return propDef.getType();
@@ -104,7 +104,7 @@
TypeDef map = resolveTypeDef(base);
if (map != null)
{
- PropertyDef nav = map.getAccessor(property);
+ PropertyDef nav = map.getAccessor(base, property);
if (nav != null)
{
try
Modified: trunk/faces/src/main/org/jboss/portal/faces/el/PropertyAccessor.java
===================================================================
--- trunk/faces/src/main/org/jboss/portal/faces/el/PropertyAccessor.java 2007-02-21 20:37:57 UTC (rev 6369)
+++ trunk/faces/src/main/org/jboss/portal/faces/el/PropertyAccessor.java 2007-02-21 22:55:25 UTC (rev 6370)
@@ -23,6 +23,8 @@
package org.jboss.portal.faces.el;
/**
+ * Defines an object to access the state and metadata of a property.
+ *
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision$
*/
Modified: trunk/faces/src/main/org/jboss/portal/faces/el/TypeDef.java
===================================================================
--- trunk/faces/src/main/org/jboss/portal/faces/el/TypeDef.java 2007-02-21 20:37:57 UTC (rev 6369)
+++ trunk/faces/src/main/org/jboss/portal/faces/el/TypeDef.java 2007-02-21 22:55:25 UTC (rev 6370)
@@ -60,17 +60,17 @@
accessors = copy;
}
- public PropertyDef getAccessor(Object propertyName)
+ public PropertyDef getAccessor(Object base, Object propertyName)
{
PropertyDef def = (PropertyDef)accessors.get(propertyName);
if (def == null)
{
- def = resolveDef(propertyName);
+ def = resolveDef(base, propertyName);
}
return def;
}
- protected PropertyDef resolveDef(Object propertyName)
+ protected PropertyDef resolveDef(Object base, Object propertyName)
{
return null;
}
19 years, 2 months
JBoss Portal SVN: r6369 - in branches/JBoss_Portal_Branch_2_4/wsrp: src/main/org/jboss/portal/test/wsrp and 2 other directories.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2007-02-21 15:37:57 -0500 (Wed, 21 Feb 2007)
New Revision: 6369
Added:
branches/JBoss_Portal_Branch_2_4/wsrp/src/main/org/jboss/portal/test/wsrp/other/
branches/JBoss_Portal_Branch_2_4/wsrp/src/main/org/jboss/portal/test/wsrp/other/ProducerSessionInformationTestCase.java
branches/JBoss_Portal_Branch_2_4/wsrp/src/main/org/jboss/portal/test/wsrp/other/UserContextConverterTestCase.java
Removed:
branches/JBoss_Portal_Branch_2_4/wsrp/src/main/org/jboss/portal/test/wsrp/ProducerSessionInformationTestCase.java
Modified:
branches/JBoss_Portal_Branch_2_4/wsrp/build.xml
branches/JBoss_Portal_Branch_2_4/wsrp/src/main/org/jboss/portal/wsrp/UserContextConverter.java
Log:
- Backported fix for JBPORTAL-1260
- Moved ProducerSessionInformationTestCase to new other directory.
- Added UserContextConverterTestCase.
Modified: branches/JBoss_Portal_Branch_2_4/wsrp/build.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_4/wsrp/build.xml 2007-02-21 20:24:08 UTC (rev 6368)
+++ branches/JBoss_Portal_Branch_2_4/wsrp/build.xml 2007-02-21 20:37:57 UTC (rev 6369)
@@ -337,7 +337,7 @@
<target name="package-other-test" description="Generates the test artifacts" depends="init">
<jar jarfile="${build.lib}/test-other-lib.jar">
<fileset dir="${build.classes}/">
- <include name="org/jboss/portal/test/wsrp/*TestCase.class"/>
+ <include name="org/jboss/portal/test/wsrp/other/*TestCase.class"/>
</fileset>
</jar>
</target>
@@ -588,7 +588,8 @@
<target name="other-test" depends="package-other-test">
<execute-tests>
<x-test>
- <test todir="${test.reports}" name="org.jboss.portal.test.wsrp.ProducerSessionInformationTestCase"/>
+ <test todir="${test.reports}" name="org.jboss.portal.test.wsrp.other.ProducerSessionInformationTestCase"/>
+ <test todir="${test.reports}" name="org.jboss.portal.test.wsrp.other.UserContextConverterTestCase"/>
</x-test>
<x-sysproperty>
<sysproperty key="test.root" value="${build.lib}"/>
Deleted: branches/JBoss_Portal_Branch_2_4/wsrp/src/main/org/jboss/portal/test/wsrp/ProducerSessionInformationTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_4/wsrp/src/main/org/jboss/portal/test/wsrp/ProducerSessionInformationTestCase.java 2007-02-21 20:24:08 UTC (rev 6368)
+++ branches/JBoss_Portal_Branch_2_4/wsrp/src/main/org/jboss/portal/test/wsrp/ProducerSessionInformationTestCase.java 2007-02-21 20:37:57 UTC (rev 6369)
@@ -1,157 +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.test.wsrp;
-
-import junit.framework.TestCase;
-import org.apache.commons.httpclient.Cookie;
-import org.jboss.portal.wsrp.WSRPConstants;
-import org.jboss.portal.wsrp.WSRPTypeFactory;
-import org.jboss.portal.wsrp.consumer.ProducerSessionInformation;
-
-/**
- * @author <a href="mailto:chris.laprun@jboss.com?subject=org.jboss.portal.test.wsrp.ProducerSessionInformationTestCase">Chris
- * Laprun</a>
- * @version $Revision$
- * @since 2.4
- */
-public class ProducerSessionInformationTestCase extends TestCase
-{
- ProducerSessionInformation info;
-
- protected void setUp() throws Exception
- {
- info = new ProducerSessionInformation();
- }
-
- public void testUserCookie() throws Exception
- {
- assertNull(info.getUserCookie());
-
- Cookie[] cookies = new Cookie[]{createCookie("name", "value", 1)};
- info.setUserCookie(cookies);
-
- assertEquals("name=value", info.getUserCookie());
-
- // wait for cookie expiration
- Thread.sleep(1000);
- assertNull(info.getUserCookie()); // we shouldn't have a cookie now
-
- cookies = new Cookie[]{createCookie("name1", "value1", 1), createCookie("name2", "value2", 3)};
- info.setUserCookie(cookies);
- assertEquals("name1=value1;name2=value2", info.getUserCookie());
-
- Thread.sleep(1000);
- assertEquals("name2=value2", info.getUserCookie());
-
- try
- {
- info.setUserCookie(null);
- fail("Should have thrown an IllegalArgumentException");
- }
- catch (IllegalArgumentException e)
- {
- //expected
- }
- }
-
- public void testGroupCookies() throws Exception
- {
- String groupId = "groupId";
-
- try
- {
- info.setGroupCookieFor(groupId, new Cookie[]{createCookie("name1", "value1", 1), createCookie("name2", "value2", -1)});
- fail("Cannot add group cookie if not perGroup");
- }
- catch (IllegalStateException e)
- {
- //expected
- }
-
- info.setPerGroupCookies(true);
- info.setGroupCookieFor(groupId, new Cookie[]{createCookie("name1", "value1", 1),
- createCookie("name2", "value2", WSRPConstants.SESSION_NEVER_EXPIRES)});
-
- assertEquals("name1=value1;name2=value2", info.getGroupCookieFor(groupId));
-
- Thread.sleep(1000);
- assertEquals("name2=value2", info.getGroupCookieFor(groupId));
-
- info.clearGroupCookies();
- assertNull(info.getGroupCookieFor(groupId));
- }
-
- public void testSessionForPortlet() throws Exception
- {
- String handle = "handle";
- String handle2 = "handle2";
- String sid = "id";
- String sid2 = "id2";
-
- assertNull(info.getSessionIdForPortlet(handle));
- assertEquals(0, info.getNumberOfSessions());
-
- info.addSessionForPortlet(handle, WSRPTypeFactory.createSessionContext(sid, 1));
- info.addSessionForPortlet(handle2, WSRPTypeFactory.createSessionContext(sid2, 3));
-
- assertNull(info.getSessionIdForPortlet("unknown"));
-
- assertEquals(sid, info.getSessionIdForPortlet(handle));
- assertEquals(2, info.getNumberOfSessions());
-
- Thread.sleep(1000);
- assertNull(info.getSessionIdForPortlet(handle));
- assertEquals(sid2, info.getSessionIdForPortlet(handle2));
- assertEquals(1, info.getNumberOfSessions());
-
- info.removeSessionIdForPortlet(handle2);
- assertEquals(0, info.getNumberOfSessions());
- }
-
- public void testReplaceUserCookies() throws Exception
- {
- info.setUserCookie(new Cookie[]{createCookie("name", "value", 1)});
-
- info.replaceUserCookiesWith(null);
- assertEquals("name=value", info.getUserCookie());
-
- ProducerSessionInformation other = new ProducerSessionInformation();
-
- info.replaceUserCookiesWith(other);
- assertEquals("name=value", info.getUserCookie());
-
- other.setUserCookie(new Cookie[]{createCookie("name2", "value2", 1)});
- info.replaceUserCookiesWith(other);
- assertEquals("name2=value2", info.getUserCookie());
-
- Thread.sleep(1000);
- info.replaceUserCookiesWith(other);
- assertNull(info.getUserCookie());
- }
-
- private Cookie createCookie(String name, String value, int secondsBeforeExpiration)
- {
- return new Cookie("domain", name, value, "path", secondsBeforeExpiration, false);
- }
-}
Copied: branches/JBoss_Portal_Branch_2_4/wsrp/src/main/org/jboss/portal/test/wsrp/other/ProducerSessionInformationTestCase.java (from rev 6363, branches/JBoss_Portal_Branch_2_4/wsrp/src/main/org/jboss/portal/test/wsrp/ProducerSessionInformationTestCase.java)
===================================================================
--- branches/JBoss_Portal_Branch_2_4/wsrp/src/main/org/jboss/portal/test/wsrp/other/ProducerSessionInformationTestCase.java (rev 0)
+++ branches/JBoss_Portal_Branch_2_4/wsrp/src/main/org/jboss/portal/test/wsrp/other/ProducerSessionInformationTestCase.java 2007-02-21 20:37:57 UTC (rev 6369)
@@ -0,0 +1,157 @@
+/******************************************************************************
+ * 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.test.wsrp.other;
+
+import junit.framework.TestCase;
+import org.apache.commons.httpclient.Cookie;
+import org.jboss.portal.wsrp.WSRPConstants;
+import org.jboss.portal.wsrp.WSRPTypeFactory;
+import org.jboss.portal.wsrp.consumer.ProducerSessionInformation;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com?subject=org.jboss.portal.test.wsrp.other.ProducerSessionInformationTestCase">Chris
+ * Laprun</a>
+ * @version $Revision$
+ * @since 2.4
+ */
+public class ProducerSessionInformationTestCase extends TestCase
+{
+ ProducerSessionInformation info;
+
+ protected void setUp() throws Exception
+ {
+ info = new ProducerSessionInformation();
+ }
+
+ public void testUserCookie() throws Exception
+ {
+ assertNull(info.getUserCookie());
+
+ Cookie[] cookies = new Cookie[]{createCookie("name", "value", 1)};
+ info.setUserCookie(cookies);
+
+ assertEquals("name=value", info.getUserCookie());
+
+ // wait for cookie expiration
+ Thread.sleep(1000);
+ assertNull(info.getUserCookie()); // we shouldn't have a cookie now
+
+ cookies = new Cookie[]{createCookie("name1", "value1", 1), createCookie("name2", "value2", 3)};
+ info.setUserCookie(cookies);
+ assertEquals("name1=value1;name2=value2", info.getUserCookie());
+
+ Thread.sleep(1000);
+ assertEquals("name2=value2", info.getUserCookie());
+
+ try
+ {
+ info.setUserCookie(null);
+ fail("Should have thrown an IllegalArgumentException");
+ }
+ catch (IllegalArgumentException e)
+ {
+ //expected
+ }
+ }
+
+ public void testGroupCookies() throws Exception
+ {
+ String groupId = "groupId";
+
+ try
+ {
+ info.setGroupCookieFor(groupId, new Cookie[]{createCookie("name1", "value1", 1), createCookie("name2", "value2", -1)});
+ fail("Cannot add group cookie if not perGroup");
+ }
+ catch (IllegalStateException e)
+ {
+ //expected
+ }
+
+ info.setPerGroupCookies(true);
+ info.setGroupCookieFor(groupId, new Cookie[]{createCookie("name1", "value1", 1),
+ createCookie("name2", "value2", WSRPConstants.SESSION_NEVER_EXPIRES)});
+
+ assertEquals("name1=value1;name2=value2", info.getGroupCookieFor(groupId));
+
+ Thread.sleep(1000);
+ assertEquals("name2=value2", info.getGroupCookieFor(groupId));
+
+ info.clearGroupCookies();
+ assertNull(info.getGroupCookieFor(groupId));
+ }
+
+ public void testSessionForPortlet() throws Exception
+ {
+ String handle = "handle";
+ String handle2 = "handle2";
+ String sid = "id";
+ String sid2 = "id2";
+
+ assertNull(info.getSessionIdForPortlet(handle));
+ assertEquals(0, info.getNumberOfSessions());
+
+ info.addSessionForPortlet(handle, WSRPTypeFactory.createSessionContext(sid, 1));
+ info.addSessionForPortlet(handle2, WSRPTypeFactory.createSessionContext(sid2, 3));
+
+ assertNull(info.getSessionIdForPortlet("unknown"));
+
+ assertEquals(sid, info.getSessionIdForPortlet(handle));
+ assertEquals(2, info.getNumberOfSessions());
+
+ Thread.sleep(1000);
+ assertNull(info.getSessionIdForPortlet(handle));
+ assertEquals(sid2, info.getSessionIdForPortlet(handle2));
+ assertEquals(1, info.getNumberOfSessions());
+
+ info.removeSessionIdForPortlet(handle2);
+ assertEquals(0, info.getNumberOfSessions());
+ }
+
+ public void testReplaceUserCookies() throws Exception
+ {
+ info.setUserCookie(new Cookie[]{createCookie("name", "value", 1)});
+
+ info.replaceUserCookiesWith(null);
+ assertEquals("name=value", info.getUserCookie());
+
+ ProducerSessionInformation other = new ProducerSessionInformation();
+
+ info.replaceUserCookiesWith(other);
+ assertEquals("name=value", info.getUserCookie());
+
+ other.setUserCookie(new Cookie[]{createCookie("name2", "value2", 1)});
+ info.replaceUserCookiesWith(other);
+ assertEquals("name2=value2", info.getUserCookie());
+
+ Thread.sleep(1000);
+ info.replaceUserCookiesWith(other);
+ assertNull(info.getUserCookie());
+ }
+
+ private Cookie createCookie(String name, String value, int secondsBeforeExpiration)
+ {
+ return new Cookie("domain", name, value, "path", secondsBeforeExpiration, false);
+ }
+}
Property changes on: branches/JBoss_Portal_Branch_2_4/wsrp/src/main/org/jboss/portal/test/wsrp/other/ProducerSessionInformationTestCase.java
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Added: branches/JBoss_Portal_Branch_2_4/wsrp/src/main/org/jboss/portal/test/wsrp/other/UserContextConverterTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_4/wsrp/src/main/org/jboss/portal/test/wsrp/other/UserContextConverterTestCase.java (rev 0)
+++ branches/JBoss_Portal_Branch_2_4/wsrp/src/main/org/jboss/portal/test/wsrp/other/UserContextConverterTestCase.java 2007-02-21 20:37:57 UTC (rev 6369)
@@ -0,0 +1,47 @@
+/******************************************************************************
+ * 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. *
+ ******************************************************************************/
+
+package org.jboss.portal.test.wsrp.other;
+
+import junit.framework.TestCase;
+import org.jboss.xb.binding.SimpleTypeBindings;
+
+import java.util.Calendar;
+
+/**
+ * Needs more complete tests!!
+ *
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision$
+ * @since 2.4
+ */
+public class UserContextConverterTestCase extends TestCase
+{
+ public void testDateFormat()
+ {
+ String dateAsString = "1983-12-11T00:00:00.000+01:00";
+ Calendar bdate = SimpleTypeBindings.unmarshalDateTime(dateAsString);
+ String result = SimpleTypeBindings.marshalDateTime(bdate);
+ assertEquals(dateAsString, result);
+ }
+}
Property changes on: branches/JBoss_Portal_Branch_2_4/wsrp/src/main/org/jboss/portal/test/wsrp/other/UserContextConverterTestCase.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: branches/JBoss_Portal_Branch_2_4/wsrp/src/main/org/jboss/portal/wsrp/UserContextConverter.java
===================================================================
--- branches/JBoss_Portal_Branch_2_4/wsrp/src/main/org/jboss/portal/wsrp/UserContextConverter.java 2007-02-21 20:24:08 UTC (rev 6368)
+++ branches/JBoss_Portal_Branch_2_4/wsrp/src/main/org/jboss/portal/wsrp/UserContextConverter.java 2007-02-21 20:37:57 UTC (rev 6369)
@@ -34,14 +34,11 @@
import org.jboss.portal.wsrp.core.Telecom;
import org.jboss.portal.wsrp.core.TelephoneNum;
import org.jboss.portal.wsrp.core.UserProfile;
+import org.jboss.xb.binding.SimpleTypeBindings;
-import java.text.DateFormat;
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collections;
-import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
@@ -54,8 +51,6 @@
*/
public class UserContextConverter
{
- public static final String XSD_DATETIME_FORMAT = "yyy-MM-dd'T'HH:mm:ss";
-
public static UserContext createPortalUserContextFrom(org.jboss.portal.wsrp.core.UserContext userContext,
String[] desiredLocales, String preferredLocale)
{
@@ -87,19 +82,7 @@
String bdateAsString = (String)userInfos.get(P3PConstants.INFO_USER_BDATE);
if (bdateAsString != null)
{
- Locale locale = userContext.getLocale();
- SimpleDateFormat format = new SimpleDateFormat(XSD_DATETIME_FORMAT, locale);
- format.setLenient(false); // should maybe make it lenient?
- try
- {
- Date date = format.parse(bdateAsString);
- bdate = Calendar.getInstance(locale);
- bdate.setTime(date);
- }
- catch (ParseException e)
- {
- throw new IllegalArgumentException(bdateAsString + " is not a valid birthday date!");
- }
+ bdate = SimpleTypeBindings.unmarshalDateTime(bdateAsString);
}
EmployerInfo employerInfo = new EmployerInfo((String)userInfos.get(P3PConstants.INFO_USER_EMPLOYER),
@@ -185,8 +168,7 @@
Calendar bdate = profile.getBdate();
if (bdate != null)
{
- DateFormat dateFormat = new SimpleDateFormat(XSD_DATETIME_FORMAT, getLocale());
- infos.put(P3PConstants.INFO_USER_BDATE, dateFormat.format(bdate));
+ infos.put(P3PConstants.INFO_USER_BDATE, SimpleTypeBindings.marshalDateTime(bdate));
}
infos.put(P3PConstants.INFO_USER_GENDER, profile.getGender());
19 years, 2 months
JBoss Portal SVN: r6368 - in trunk/workflow: src/resources and 1 other directory.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2007-02-21 15:24:08 -0500 (Wed, 21 Feb 2007)
New Revision: 6368
Removed:
trunk/workflow/src/resources/portal-workflow-jar/
Modified:
trunk/workflow/build.xml
Log:
Crappy tools don't like empty directories
Modified: trunk/workflow/build.xml
===================================================================
--- trunk/workflow/build.xml 2007-02-21 20:03:17 UTC (rev 6367)
+++ trunk/workflow/build.xml 2007-02-21 20:24:08 UTC (rev 6368)
@@ -169,7 +169,7 @@
<jar jarfile="${build.lib}/portal-workflow-lib.jar" manifest="${build.etc}/portal-workflow-lib-jar.mf">
<fileset dir="${build.classes}"/>
- <fileset dir="${build.resources}/portal-workflow-jar"/>
+ <!--fileset dir="${build.resources}/portal-workflow-jar"/-->
</jar>
<!-- create the war file, not needed anymore -->
19 years, 2 months
JBoss Portal SVN: r6367 - in branches/JBoss_Portal_Branch_2_4/test/src: resources/portal-test-jar/org/jboss/portal/test/framework/container and 1 other directory.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2007-02-21 15:03:17 -0500 (Wed, 21 Feb 2007)
New Revision: 6367
Modified:
branches/JBoss_Portal_Branch_2_4/test/src/main/org/jboss/portal/test/framework/server/Node.java
branches/JBoss_Portal_Branch_2_4/test/src/main/org/jboss/portal/test/framework/server/NodeId.java
branches/JBoss_Portal_Branch_2_4/test/src/main/org/jboss/portal/test/framework/server/NodeManager.java
branches/JBoss_Portal_Branch_2_4/test/src/resources/portal-test-jar/org/jboss/portal/test/framework/container/jboss-beans.xml
Log:
Reverted http://fisheye.jboss.org/changelog/Portal/branches/JBoss_Portal_Branch_2_...
Modified: branches/JBoss_Portal_Branch_2_4/test/src/main/org/jboss/portal/test/framework/server/Node.java
===================================================================
--- branches/JBoss_Portal_Branch_2_4/test/src/main/org/jboss/portal/test/framework/server/Node.java 2007-02-21 18:28:18 UTC (rev 6366)
+++ branches/JBoss_Portal_Branch_2_4/test/src/main/org/jboss/portal/test/framework/server/Node.java 2007-02-21 20:03:17 UTC (rev 6367)
@@ -31,16 +31,20 @@
public class Node
{
- /** . */
private final NodeId id;
- /** . */
- private final MBeanServer server;
+ private MBeanServer server;
- public Node(String id, MBeanServer server)
+ private NodeManager nodeManager;
+
+ public Node(String id, MBeanServer server, NodeManager nodeManager)
{
this.id = new NodeId(id);
this.server = server;
+ this.nodeManager = nodeManager;
+
+ //
+ nodeManager.nodeMap.put(this.id, this);
}
public NodeId getId()
Modified: branches/JBoss_Portal_Branch_2_4/test/src/main/org/jboss/portal/test/framework/server/NodeId.java
===================================================================
--- branches/JBoss_Portal_Branch_2_4/test/src/main/org/jboss/portal/test/framework/server/NodeId.java 2007-02-21 18:28:18 UTC (rev 6366)
+++ branches/JBoss_Portal_Branch_2_4/test/src/main/org/jboss/portal/test/framework/server/NodeId.java 2007-02-21 20:03:17 UTC (rev 6367)
@@ -40,7 +40,6 @@
/** . */
public static final NodeId PORTS_02 = new NodeId("ports-02");
- /** . */
private final String value;
public NodeId(String value)
@@ -63,12 +62,19 @@
{
return true;
}
- if (o instanceof NodeId)
+ if (o == null || getClass() != o.getClass())
{
- NodeId that = (NodeId)o;
- return value.equals(that.value);
+ return false;
}
- return false;
+
+ final NodeId nodeId = (NodeId)o;
+
+ if (!value.equals(nodeId.value))
+ {
+ return false;
+ }
+
+ return true;
}
public int hashCode()
Modified: branches/JBoss_Portal_Branch_2_4/test/src/main/org/jboss/portal/test/framework/server/NodeManager.java
===================================================================
--- branches/JBoss_Portal_Branch_2_4/test/src/main/org/jboss/portal/test/framework/server/NodeManager.java 2007-02-21 18:28:18 UTC (rev 6366)
+++ branches/JBoss_Portal_Branch_2_4/test/src/main/org/jboss/portal/test/framework/server/NodeManager.java 2007-02-21 20:03:17 UTC (rev 6367)
@@ -33,17 +33,16 @@
public class NodeManager
{
- /** The nodes. */
- private final Map nodeMap;
+ Map nodeMap;
- public NodeManager(Node[] nodes)
+ public NodeManager()
{
- this.nodeMap = new HashMap();
- for (int i = 0;i < nodes.length;i++)
- {
- Node node = nodes[i];
- nodeMap.put(node.getId(), node);
- }
+ nodeMap = new HashMap();
+// for (Iterator i = nodes.iterator(); i.hasNext();)
+// {
+// Node node = (Node)i.next();
+// nodeMap.put(node.getId(), node);
+// }
}
public Collection getNodes()
Modified: branches/JBoss_Portal_Branch_2_4/test/src/resources/portal-test-jar/org/jboss/portal/test/framework/container/jboss-beans.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_4/test/src/resources/portal-test-jar/org/jboss/portal/test/framework/container/jboss-beans.xml 2007-02-21 18:28:18 UTC (rev 6366)
+++ branches/JBoss_Portal_Branch_2_4/test/src/resources/portal-test-jar/org/jboss/portal/test/framework/container/jboss-beans.xml 2007-02-21 20:03:17 UTC (rev 6367)
@@ -88,6 +88,7 @@
<constructor>
<parameter><value>default</value></parameter>
<parameter><inject bean="MBeanServerFactory0" property="server"/></parameter>
+ <parameter><inject bean="NodeManager"/></parameter>
</constructor>
</bean>
@@ -95,6 +96,7 @@
<constructor>
<parameter><value>ports-01</value></parameter>
<parameter><inject bean="MBeanServerFactory1" property="server"/></parameter>
+ <parameter><inject bean="NodeManager"/></parameter>
</constructor>
</bean>
@@ -102,19 +104,11 @@
<constructor>
<parameter><value>ports-02</value></parameter>
<parameter><inject bean="MBeanServerFactory2" property="server"/></parameter>
+ <parameter><inject bean="NodeManager"/></parameter>
</constructor>
</bean>
<bean name="NodeManager" class="org.jboss.portal.test.framework.server.NodeManager">
- <constructor>
- <parameter>
- <array class="[org.jboss.portal.test.framework.server.Node;">
- <inject bean="Node0"/>
- <inject bean="Node1"/>
- <inject bean="Node2"/>
- </array>
- </parameter>
- </constructor>
</bean>
<bean name="Deployer" class="org.jboss.portal.test.framework.deployment.Deployer">
19 years, 2 months
JBoss Portal SVN: r6366 - in trunk/wsrp/src: main/org/jboss/portal/wsrp/services and 2 other directories.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2007-02-21 13:28:18 -0500 (Wed, 21 Feb 2007)
New Revision: 6366
Modified:
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/EndpointConfigurationInfo.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RegistrationInfo.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/services/CachingServiceFactory.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/services/RMIInvokerServiceFactory.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/services/SOAPInvokerServiceFactory.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/services/ServiceFactory.java
trunk/wsrp/src/resources/tests/test-wsrp-consumer-sar/META-INF/jboss-service.xml
trunk/wsrp/src/resources/tests/test-wsrp-producer-sar/META-INF/jboss-service.xml
Log:
- EndpointConfigurationInfo should now properly return the correct URLs and update the associated ServiceFactory when needed.
- Added setters on ServiceFactory and updated ServiceFactory implementations accordingly.
- Thinking of phasing out SOAPInvokerServiceFactory and RMIInvokerServiceFactory (already, replaced it in the test configuration).
- Tests all pass now.
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/EndpointConfigurationInfo.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/EndpointConfigurationInfo.java 2007-02-21 18:23:06 UTC (rev 6365)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/EndpointConfigurationInfo.java 2007-02-21 18:28:18 UTC (rev 6366)
@@ -52,8 +52,6 @@
// transient variables
/** Access to the WS */
private ServiceFactory serviceFactory;
- /** Whether the service factory needs refreshing */
- private boolean dirty;
static final String SERVICE_DESCRIPTION = "service description";
static final String MARKUP = "markup";
@@ -90,99 +88,122 @@
public boolean usesWSDL()
{
- return wsdlDefinitionURL != null;
+ return serviceFactory instanceof RemoteSOAPInvokerServiceFactory ||
+ (wsdlDefinitionURL != null && serviceDescriptionURL == null && markupURL == null && portletManagementURL == null
+ && registrationURL == null);
}
public String getWsdlDefinitionURL()
{
+ if (serviceFactory instanceof RemoteSOAPInvokerServiceFactory)
+ {
+ wsdlDefinitionURL = ((RemoteSOAPInvokerServiceFactory)serviceFactory).getWsdlDefinitionURL();
+ }
+
return wsdlDefinitionURL;
}
public String getServiceDescriptionURL()
{
+ if (serviceFactory != null)
+ {
+ serviceDescriptionURL = serviceFactory.getServiceDescriptionURL();
+ }
return serviceDescriptionURL;
}
public String getMarkupURL()
{
+ if (serviceFactory != null)
+ {
+ markupURL = serviceFactory.getMarkupURL();
+ }
return markupURL;
}
public String getPortletManagementURL()
{
+ if (serviceFactory != null)
+ {
+ portletManagementURL = serviceFactory.getPortletManagementURL();
+ }
return portletManagementURL;
}
public String getRegistrationURL()
{
+ if (serviceFactory != null)
+ {
+ registrationURL = serviceFactory.getRegistrationURL();
+ }
return registrationURL;
}
public void setServiceDescriptionURL(String serviceDescriptionURL)
{
+ serviceFactory.setServiceDescriptionURL(serviceDescriptionURL);
this.serviceDescriptionURL = serviceDescriptionURL;
- dirty = true;
}
public void setMarkupURL(String markupURL)
{
+ serviceFactory.setMarkupURL(markupURL);
this.markupURL = markupURL;
- dirty = true;
}
public void setRegistrationURL(String registrationURL)
{
+ serviceFactory.setRegistrationURL(registrationURL);
this.registrationURL = registrationURL;
- dirty = true;
}
public void setPortletManagementURL(String portletManagementURL)
{
+ serviceFactory.setPortletManagementURL(portletManagementURL);
this.portletManagementURL = portletManagementURL;
- dirty = true;
}
public void setWsdlDefinitionURL(String wsdlDefinitionURL)
{
this.wsdlDefinitionURL = wsdlDefinitionURL;
- dirty = true;
+ if (!(serviceFactory instanceof RemoteSOAPInvokerServiceFactory))
+ {
+ serviceFactory = new RemoteSOAPInvokerServiceFactory();
+ }
+ ((RemoteSOAPInvokerServiceFactory)serviceFactory).setWsdlDefinitionURL(wsdlDefinitionURL);
}
- public void refreshServiceFactory()
+ public void initServiceFactoryIfNeeded()
{
- if (dirty)
+ if (serviceFactory == null)
{
- // todo: implement update of service factory when URLs are changed...
- if (serviceFactory == null)
+ if (usesWSDL())
{
- if (usesWSDL())
- {
- serviceFactory = new RemoteSOAPInvokerServiceFactory();
- ((RemoteSOAPInvokerServiceFactory)serviceFactory).setWsdlDefinitionURL(wsdlDefinitionURL);
- }
- else
- {
- serviceFactory = new PerEndpointSOAPInvokerServiceFactory();
- ((PerEndpointSOAPInvokerServiceFactory)serviceFactory).setServiceDescriptionURL(serviceDescriptionURL);
- ((PerEndpointSOAPInvokerServiceFactory)serviceFactory).setMarkupURL(markupURL);
- ((PerEndpointSOAPInvokerServiceFactory)serviceFactory).setPortletManagementURL(portletManagementURL);
- ((PerEndpointSOAPInvokerServiceFactory)serviceFactory).setRegistrationURL(registrationURL);
- }
+ serviceFactory = new RemoteSOAPInvokerServiceFactory();
+ ((RemoteSOAPInvokerServiceFactory)serviceFactory).setWsdlDefinitionURL(wsdlDefinitionURL);
}
+ else
+ {
+ serviceFactory = new PerEndpointSOAPInvokerServiceFactory();
+ serviceFactory.setServiceDescriptionURL(serviceDescriptionURL);
+ serviceFactory.setMarkupURL(markupURL);
+ serviceFactory.setPortletManagementURL(portletManagementURL);
+ serviceFactory.setRegistrationURL(registrationURL);
+ }
+ }
- dirty = false;
- }
}
ServiceFactory getServiceFactory()
{
- refreshServiceFactory();
+ initServiceFactoryIfNeeded();
return serviceFactory;
}
void setServiceFactory(ServiceFactory serviceFactory)
{
ParameterValidation.throwIllegalArgExceptionIfNull(serviceFactory, "ServiceFactory");
+
this.serviceFactory = serviceFactory;
serviceDescriptionURL = serviceFactory.getServiceDescriptionURL();
markupURL = serviceFactory.getMarkupURL();
@@ -194,7 +215,6 @@
wsdlDefinitionURL = ((RemoteSOAPInvokerServiceFactory)serviceFactory).getWsdlDefinitionURL();
}
- dirty = false;
}
WSRP_v1_ServiceDescription_PortType getServiceDescriptionService() throws InvokerUnavailableException
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RegistrationInfo.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RegistrationInfo.java 2007-02-21 18:23:06 UTC (rev 6365)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RegistrationInfo.java 2007-02-21 18:28:18 UTC (rev 6366)
@@ -386,8 +386,15 @@
public RegistrationContext getRegistrationContext()
{
- RegistrationContext registrationContext = WSRPTypeFactory.createRegistrationContext(registrationHandle);
- registrationContext.setRegistrationState(registrationState);
- return registrationContext;
+ if (registrationHandle != null)
+ {
+ RegistrationContext registrationContext = WSRPTypeFactory.createRegistrationContext(registrationHandle);
+ registrationContext.setRegistrationState(registrationState);
+ return registrationContext;
+ }
+ else
+ {
+ return null;
+ }
}
}
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/services/CachingServiceFactory.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/services/CachingServiceFactory.java 2007-02-21 18:23:06 UTC (rev 6365)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/services/CachingServiceFactory.java 2007-02-21 18:28:18 UTC (rev 6366)
@@ -47,7 +47,7 @@
{
if (delegate == null)
{
- throw new IllegalStateException("No static service factory");
+ throw new IllegalStateException("No delegate service factory");
}
if (clazz == null)
{
@@ -118,4 +118,41 @@
}
return null;
}
+
+
+ public void setServiceDescriptionURL(String serviceDescriptionURL)
+ {
+ if (delegate == null)
+ {
+ throw new IllegalStateException("No delegate service factory");
+ }
+ delegate.setServiceDescriptionURL(serviceDescriptionURL);
+ }
+
+ public void setMarkupURL(String markupURL)
+ {
+ if (delegate == null)
+ {
+ throw new IllegalStateException("No delegate service factory");
+ }
+ delegate.setMarkupURL(markupURL);
+ }
+
+ public void setRegistrationURL(String registrationURL)
+ {
+ if (delegate == null)
+ {
+ throw new IllegalStateException("No delegate service factory");
+ }
+ delegate.setRegistrationURL(registrationURL);
+ }
+
+ public void setPortletManagementURL(String portletManagementURL)
+ {
+ if (delegate == null)
+ {
+ throw new IllegalStateException("No delegate service factory");
+ }
+ delegate.setPortletManagementURL(portletManagementURL);
+ }
}
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/services/RMIInvokerServiceFactory.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/services/RMIInvokerServiceFactory.java 2007-02-21 18:23:06 UTC (rev 6365)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/services/RMIInvokerServiceFactory.java 2007-02-21 18:28:18 UTC (rev 6366)
@@ -72,4 +72,20 @@
{
return null;
}
+
+ public void setServiceDescriptionURL(String serviceDescriptionURL)
+ {
+ }
+
+ public void setMarkupURL(String markupURL)
+ {
+ }
+
+ public void setRegistrationURL(String registrationURL)
+ {
+ }
+
+ public void setPortletManagementURL(String portletManagementURL)
+ {
+ }
}
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/services/SOAPInvokerServiceFactory.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/services/SOAPInvokerServiceFactory.java 2007-02-21 18:23:06 UTC (rev 6365)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/services/SOAPInvokerServiceFactory.java 2007-02-21 18:28:18 UTC (rev 6366)
@@ -109,4 +109,24 @@
{
return endpointURL + PORT_NAMES.get(WSRP_v1_PortletManagement_PortType.class);
}
+
+ public void setServiceDescriptionURL(String serviceDescriptionURL)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public void setMarkupURL(String markupURL)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public void setRegistrationURL(String registrationURL)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public void setPortletManagementURL(String portletManagementURL)
+ {
+ throw new UnsupportedOperationException();
+ }
}
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/services/ServiceFactory.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/services/ServiceFactory.java 2007-02-21 18:23:06 UTC (rev 6365)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/services/ServiceFactory.java 2007-02-21 18:28:18 UTC (rev 6366)
@@ -43,4 +43,12 @@
String getRegistrationURL();
String getPortletManagementURL();
+
+ void setServiceDescriptionURL(String serviceDescriptionURL);
+
+ void setMarkupURL(String markupURL);
+
+ void setRegistrationURL(String registrationURL);
+
+ void setPortletManagementURL(String portletManagementURL);
}
Modified: trunk/wsrp/src/resources/tests/test-wsrp-consumer-sar/META-INF/jboss-service.xml
===================================================================
--- trunk/wsrp/src/resources/tests/test-wsrp-consumer-sar/META-INF/jboss-service.xml 2007-02-21 18:23:06 UTC (rev 6365)
+++ trunk/wsrp/src/resources/tests/test-wsrp-consumer-sar/META-INF/jboss-service.xml 2007-02-21 18:28:18 UTC (rev 6366)
@@ -64,12 +64,17 @@
<!-- -->
<mbean
- code="org.jboss.portal.wsrp.services.SOAPInvokerServiceFactory"
+ code="org.jboss.portal.wsrp.services.PerEndpointSOAPInvokerServiceFactory"
name="portal.wsrp:service=ServiceFactory"
xmbean-dd=""
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
<xmbean/>
- <attribute name="EndpointURL">http://localhost:8080/test-wsrp-consumer</attribute>
+ <attribute
+ name="ServiceDescriptionURL">http://localhost:8080/test-wsrp-consumer/ServiceDescriptionService</attribute>
+ <attribute name="MarkupURL">http://localhost:8080/test-wsrp-consumer/MarkupService</attribute>
+ <attribute name="RegistrationURL">http://localhost:8080/test-wsrp-consumer/RegistrationService</attribute>
+ <attribute
+ name="PortletManagementURL">http://localhost:8080/test-wsrp-consumer/PortletManagementService</attribute>
<attribute name="Env">
java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
java.naming.provider.url=jnp://localhost:1099
@@ -97,7 +102,8 @@
xmbean-dd=""
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
<xmbean/>
- <depends optional-attribute-name="ServiceFactory" proxy-type="attribute">portal.wsrp:service=CachingServiceFactory</depends>
+ <depends optional-attribute-name="ServiceFactory"
+ proxy-type="attribute">portal.wsrp:service=CachingServiceFactory</depends>
</mbean>
</server>
Modified: trunk/wsrp/src/resources/tests/test-wsrp-producer-sar/META-INF/jboss-service.xml
===================================================================
--- trunk/wsrp/src/resources/tests/test-wsrp-producer-sar/META-INF/jboss-service.xml 2007-02-21 18:23:06 UTC (rev 6365)
+++ trunk/wsrp/src/resources/tests/test-wsrp-producer-sar/META-INF/jboss-service.xml 2007-02-21 18:28:18 UTC (rev 6366)
@@ -215,12 +215,17 @@
<!-- -->
<mbean
- code="org.jboss.portal.wsrp.services.SOAPInvokerServiceFactory"
+ code="org.jboss.portal.wsrp.services.PerEndpointSOAPInvokerServiceFactory"
name="portal.wsrp:service=ServiceFactory"
xmbean-dd=""
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
<xmbean/>
- <attribute name="EndpointURL">http://localhost:8080/test-wsrp-producer</attribute>
+ <attribute
+ name="ServiceDescriptionURL">http://localhost:8080/test-wsrp-producer/ServiceDescriptionService</attribute>
+ <attribute name="MarkupURL">http://localhost:8080/test-wsrp-producer/MarkupService</attribute>
+ <attribute name="RegistrationURL">http://localhost:8080/test-wsrp-producer/RegistrationService</attribute>
+ <attribute
+ name="PortletManagementURL">http://localhost:8080/test-wsrp-producer/PortletManagementService</attribute>
<attribute name="Env">
java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
java.naming.provider.url=jnp://localhost:1099
19 years, 2 months