JBoss Portal SVN: r6074 - in trunk/core-samples/src/main/org/jboss/portal/core/portlet: plugins and 1 other directory.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-01-23 08:00:22 -0500 (Tue, 23 Jan 2007)
New Revision: 6074
Added:
trunk/core-samples/src/main/org/jboss/portal/core/portlet/plugins/
trunk/core-samples/src/main/org/jboss/portal/core/portlet/plugins/HeaderContentPortlet.java
Log:
added header content portlet to core-samples
Added: trunk/core-samples/src/main/org/jboss/portal/core/portlet/plugins/HeaderContentPortlet.java
===================================================================
--- trunk/core-samples/src/main/org/jboss/portal/core/portlet/plugins/HeaderContentPortlet.java (rev 0)
+++ trunk/core-samples/src/main/org/jboss/portal/core/portlet/plugins/HeaderContentPortlet.java 2007-01-23 13:00:22 UTC (rev 6074)
@@ -0,0 +1,58 @@
+/******************************************************************************
+ * 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.plugins;
+
+import org.apache.log4j.Logger;
+
+import javax.portlet.GenericPortlet;
+import javax.portlet.PortletException;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import java.io.IOException;
+import java.io.Writer;
+
+/*
+ * Portlet to demonstrate the declarative header content feature.
+ * <p>This portlet injects css into the html HEAD tag via jboss-portlet.xml</p>
+ *
+ * @author <a href="mailto:mholzner@novell.com">Martin Holzner</a>
+ * @version $Revision: 5448 $
+*/
+
+public class HeaderContentPortlet extends GenericPortlet
+{
+ private static Logger log = Logger.getLogger(HeaderContentPortlet.class);
+
+ public void doView(RenderRequest req, RenderResponse res)
+ throws PortletException, IOException
+ {
+ log.debug("doView(): ...");
+
+ res.setContentType("text/html");
+ Writer writer = res.getWriter();
+ writer.write("<div id='Introducing-HeaderContent'/>");
+ writer.write("<div class=\"portlet-section-body\"><p id='rewrite-js'><button id=\"Introducing-HeaderContentInput\" class=\"portlet-form-button\" type='button' onClick='injectJS()'>Call injected javascript</button></p></div>");
+ writer.flush();
+ writer.close();
+ }
+}
Property changes on: trunk/core-samples/src/main/org/jboss/portal/core/portlet/plugins/HeaderContentPortlet.java
___________________________________________________________________
Name: svn:executable
+ *
17 years, 4 months
JBoss Portal SVN: r6073 - trunk/server/src/main/org/jboss/portal/server/deployment.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-01-22 20:32:28 -0500 (Mon, 22 Jan 2007)
New Revision: 6073
Modified:
trunk/server/src/main/org/jboss/portal/server/deployment/WebAppIntercepter.java
Log:
JBPORTAL-1214 : Use the same URL key for the map of web app to deployed portlet applications
Modified: trunk/server/src/main/org/jboss/portal/server/deployment/WebAppIntercepter.java
===================================================================
--- trunk/server/src/main/org/jboss/portal/server/deployment/WebAppIntercepter.java 2007-01-23 00:42:45 UTC (rev 6072)
+++ trunk/server/src/main/org/jboss/portal/server/deployment/WebAppIntercepter.java 2007-01-23 01:32:28 UTC (rev 6073)
@@ -96,6 +96,23 @@
return new ArrayList(deployments.keySet());
}
+ private WebApplication findWebApp(DeploymentInfo info) throws Exception
+ {
+ // Get all the deployed web applications, our must be among these
+ Iterator iterator = (Iterator)server.getAttribute(interceptedDeployer, "DeployedApplications");
+ while (iterator.hasNext())
+ {
+ WebApplication webApp = (WebApplication)iterator.next();
+ if (info == webApp.getDeploymentInfo())
+ {
+ return webApp;
+ }
+ }
+
+ // Not found
+ return null;
+ }
+
/** Only take care of start notifications. */
public void handleNotification(Notification notification, Object handback)
{
@@ -118,31 +135,28 @@
// Create the portal web app
DeploymentInfo info = (DeploymentInfo)notification.getUserData();
+
+ //
+ URL keyURL = info.url;
+
+ //
if (start)
{
- // Get all the deployed web applications, our must be among these
- Iterator iterator = (Iterator)server.getAttribute(interceptedDeployer, "DeployedApplications");
- while (iterator.hasNext())
- {
- WebApplication webApp = (WebApplication)iterator.next();
- if (info == webApp.getDeploymentInfo())
- {
- PortalWebApp pwa = factory.create(webApp);
- URL url = info.url;
- deployments.put(url, pwa);
- log.debug("Seen URL " + url + " about to deploy");
- deploy(pwa);
- }
- }
+ WebApplication webApp = findWebApp(info);
+ PortalWebApp pwa = factory.create(webApp);
+ deployments.put(keyURL, pwa);
+ log.debug("Seen URL " + keyURL + " about to deploy");
+ deploy(pwa);
}
if (stop)
{
// Look if we have something for that url
- PortalWebApp pwa = (PortalWebApp)deployments.remove(info.url);
+ PortalWebApp pwa = (PortalWebApp)deployments.remove(keyURL);
// Notify
if (pwa != null)
{
+ log.debug("Undeploying URL " + keyURL);
undeploy(pwa);
}
}
@@ -180,11 +194,12 @@
while (iterator.hasNext())
{
WebApplication webApp = (WebApplication)iterator.next();
- if (!deployments.containsKey(webApp.getURL()))
+ URL keyURL = webApp.getDeploymentInfo().url;
+ if (!deployments.containsKey(keyURL))
{
PortalWebApp pwa = factory.create(webApp);
- deployments.put(pwa.getURL(), pwa);
- log.debug("Seen URL " + pwa.getURL() + " about to deploy");
+ deployments.put(keyURL, pwa);
+ log.debug("Seen URL " + keyURL + " about to deploy");
deploy(pwa);
}
}
@@ -202,11 +217,13 @@
if (currentInterceptedDeployer != null)
{
// Remove all previously deployed applications
- for (Iterator i = deployments.values().iterator(); i.hasNext();)
+ for (Iterator i = deployments.entrySet().iterator(); i.hasNext();)
{
- PortalWebApp pwa = (PortalWebApp)i.next();
+ Map.Entry entry = (Map.Entry)i.next();
+ URL keyURL = (URL)entry.getKey();
+ PortalWebApp pwa = (PortalWebApp)entry.getValue();
i.remove();
- log.debug("Removing URL " + pwa.getURL());
+ log.debug("Removing web application with URL " + keyURL);
undeploy(pwa);
}
17 years, 4 months
JBoss Portal SVN: r6072 - trunk/core-samples/src/main/org/jboss/portal/core/portlet/test.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-01-22 19:42:45 -0500 (Mon, 22 Jan 2007)
New Revision: 6072
Modified:
trunk/core-samples/src/main/org/jboss/portal/core/portlet/test/EncodingPortlet.java
Log:
minor reformat of encoding portlet
Modified: trunk/core-samples/src/main/org/jboss/portal/core/portlet/test/EncodingPortlet.java
===================================================================
--- trunk/core-samples/src/main/org/jboss/portal/core/portlet/test/EncodingPortlet.java 2007-01-22 21:34:57 UTC (rev 6071)
+++ trunk/core-samples/src/main/org/jboss/portal/core/portlet/test/EncodingPortlet.java 2007-01-23 00:42:45 UTC (rev 6072)
@@ -56,23 +56,23 @@
//
writer.print(
- "<div> Text to pass : " +
- "<form action=\"" + resp.createRenderURL() + "\" method=\"post\"\" accept-charset=\"" + resp.getCharacterEncoding() + "\" >" +
- "<input type=\"text\" name=\"text\" value=\"\"/>" +
- "<input type=\"submit\" value=\"Submit to render phase\"/>" +
- "</form>" +
- "<form action=\"" + resp.createActionURL() + "\" method=\"post\"\" accept-charset=\"" + resp.getCharacterEncoding() + "\" >" +
- "<input type=\"text\" name=\"text\" value=\"\"/>" +
- "<input type=\"submit\" value=\"Submit to action phase\"/>" +
- "</form>" +
- "</div>");
+ "<div> Text to pass : " +
+ "<form action=\"" + resp.createRenderURL() + "\" method=\"post\"\">" +
+ "<input type=\"text\" name=\"text\" value=\"\"/>" +
+ "<input type=\"submit\" value=\"Submit to render phase\"/>" +
+ "</form>" +
+ "<form action=\"" + resp.createActionURL() + "\" method=\"post\"\">" +
+ "<input type=\"text\" name=\"text\" value=\"\"/>" +
+ "<input type=\"submit\" value=\"Submit to action phase\"/>" +
+ "</form>" +
+ "</div>");
//
writer.println(
- "<div>" + "Text retrieved from request parameter: " +
- "</div>" +
- "<div>" +
- "<textarea name=\"text\" cols=\"20\" rows=\"4\" wrap=\"virtual\">");
+ "<div>" + "Text retrieved from request parameter: " +
+ "</div>" +
+ "<div>" +
+ "<textarea name=\"text\" cols=\"20\" rows=\"4\" wrap=\"virtual\">");
if (param != null)
{
@@ -81,13 +81,13 @@
writer.println(
"</textarea>" +
- "</div>");
+ "</div>");
writer.println(
- "<div>" + "Text retrieved from portlet session (value set during Action Phase): " +
- "</div>" +
- "<div>" +
- "<textarea name=\"text\" cols=\"20\" rows=\"4\" wrap=\"virtual\">");
+ "<div>" + "Text retrieved from portlet session (value set during Action Phase): " +
+ "</div>" +
+ "<div>" +
+ "<textarea name=\"text\" cols=\"20\" rows=\"4\" wrap=\"virtual\">");
if (attr != null)
{
@@ -96,7 +96,7 @@
writer.println(
"</textarea>" +
- "</div>");
+ "</div>");
//
writer.close();
17 years, 4 months
JBoss Portal SVN: r6071 - in trunk: core/src/main/org/jboss/portal/core/portlet and 1 other directory.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-01-22 16:34:57 -0500 (Mon, 22 Jan 2007)
New Revision: 6071
Removed:
trunk/core/src/main/org/jboss/portal/core/portlet/plugins/
trunk/core/src/main/org/jboss/portal/core/portlet/theme/
Modified:
trunk/build/build.xml
Log:
include core integration modules in default build
Modified: trunk/build/build.xml
===================================================================
--- trunk/build/build.xml 2007-01-22 21:24:14 UTC (rev 6070)
+++ trunk/build/build.xml 2007-01-22 21:34:57 UTC (rev 6071)
@@ -127,6 +127,9 @@
<module name="format"/>
<module name="samples"/>
<module name="core"/>
+ <module name="core-cms"/>
+ <module name="core-management"/>
+ <module name="core-samples"/>
<module name="wsrp"/>
<module name="registration"/>
<module name="workflow"/>
@@ -135,7 +138,7 @@
<group name="portal">
<include
- modules="common, test, api, faces, jems, server, security, identity, format, portlet, federation, theme, workflow, cms, bridge, samples, registration, wsrp, core"/>
+ modules="common, test, api, faces, jems, server, security, identity, format, portlet, federation, theme, workflow, cms, bridge, samples, registration, wsrp, core, core-cms, core-management, core-samples"/>
</group>
<group name="cms">
17 years, 4 months
JBoss Portal SVN: r6070 - in trunk/build/ide/intellij/idea60/modules: core-samples and 1 other directory.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-01-22 16:24:14 -0500 (Mon, 22 Jan 2007)
New Revision: 6070
Added:
trunk/build/ide/intellij/idea60/modules/core-samples/
trunk/build/ide/intellij/idea60/modules/core-samples/core-samples.iml
Log:
added intellij core-samples module
Added: trunk/build/ide/intellij/idea60/modules/core-samples/core-samples.iml
===================================================================
--- trunk/build/ide/intellij/idea60/modules/core-samples/core-samples.iml (rev 0)
+++ trunk/build/ide/intellij/idea60/modules/core-samples/core-samples.iml 2007-01-22 21:24:14 UTC (rev 6070)
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module version="4" relativePaths="true" type="JAVA_MODULE">
+ <component name="ModuleRootManager" />
+ <component name="NewModuleRootManager" inherit-compiler-output="true">
+ <exclude-output />
+ <content url="file://$MODULE_DIR$/../../../../../../core-samples">
+ <sourceFolder url="file://$MODULE_DIR$/../../../../../../core-samples/src/main" isTestSource="false" />
+ </content>
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ <orderEntry type="module" module-name="format" />
+ <orderEntry type="module" module-name="core" />
+ <orderEntry type="module" module-name="portlet" />
+ <orderEntry type="module" module-name="api" />
+ <orderEntry type="module" module-name="identity" />
+ <orderEntry type="module" module-name="common" />
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jbossas/core-libs/lib/jboss-j2ee.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/apache-log4j/lib/log4j.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntryProperties />
+ </component>
+</module>
+
17 years, 4 months
JBoss Portal SVN: r6069 - in trunk: core and 33 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-01-22 15:55:54 -0500 (Mon, 22 Jan 2007)
New Revision: 6069
Added:
trunk/core-samples/
trunk/core-samples/build.bat
trunk/core-samples/build.sh
trunk/core-samples/build.xml
trunk/core-samples/src/
trunk/core-samples/src/bin/
trunk/core-samples/src/bin/portal-samples-war/
trunk/core-samples/src/bin/portal-samples-war/images/
trunk/core-samples/src/bin/portal-samples-war/images/accessorize.gif
trunk/core-samples/src/bin/portal-samples-war/images/developers_banner.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-samples/src/bin/portal-samples-war/portlet-styles/
trunk/core-samples/src/bin/portal-samples-war/portlet-styles/HeaderContent.css
trunk/core-samples/src/bin/portal-samples-war/portlet-styles/HeaderContent.js
trunk/core-samples/src/main/
trunk/core-samples/src/main/org/
trunk/core-samples/src/main/org/jboss/
trunk/core-samples/src/main/org/jboss/portal/
trunk/core-samples/src/main/org/jboss/portal/core/
trunk/core-samples/src/main/org/jboss/portal/core/portlet/
trunk/core-samples/src/main/org/jboss/portal/core/portlet/test/
trunk/core-samples/src/main/org/jboss/portal/core/portlet/test/BasicPortlet.java
trunk/core-samples/src/main/org/jboss/portal/core/portlet/test/CharsetPortlet.java
trunk/core-samples/src/main/org/jboss/portal/core/portlet/test/CounterPortlet.java
trunk/core-samples/src/main/org/jboss/portal/core/portlet/test/EncodingPortlet.java
trunk/core-samples/src/main/org/jboss/portal/core/portlet/test/ExceptionPortlet.java
trunk/core-samples/src/main/org/jboss/portal/core/portlet/test/PortletSessionPortlet.java
trunk/core-samples/src/main/org/jboss/portal/core/portlet/test/TestPortlet.java
trunk/core-samples/src/main/org/jboss/portal/core/portlet/test/URLPortlet.java
trunk/core-samples/src/main/org/jboss/portal/core/portlet/test/event/
trunk/core-samples/src/main/org/jboss/portal/core/portlet/test/event/PortletA.java
trunk/core-samples/src/main/org/jboss/portal/core/portlet/test/event/PortletB.java
trunk/core-samples/src/main/org/jboss/portal/core/portlet/test/event/WindowConstraintEventListener.java
trunk/core-samples/src/resources/
trunk/core-samples/src/resources/portal-samples-sar/
trunk/core-samples/src/resources/portal-samples-sar/META-INF/
trunk/core-samples/src/resources/portal-samples-sar/META-INF/jboss-service.xml
trunk/core-samples/src/resources/portal-samples-war/
trunk/core-samples/src/resources/portal-samples-war/WEB-INF/
trunk/core-samples/src/resources/portal-samples-war/WEB-INF/classes/
trunk/core-samples/src/resources/portal-samples-war/WEB-INF/classes/NewsResource.properties
trunk/core-samples/src/resources/portal-samples-war/WEB-INF/classes/NewsResource_fr.properties
trunk/core-samples/src/resources/portal-samples-war/WEB-INF/default-object.xml
trunk/core-samples/src/resources/portal-samples-war/WEB-INF/jboss-app.xml
trunk/core-samples/src/resources/portal-samples-war/WEB-INF/jboss-portlet.xml
trunk/core-samples/src/resources/portal-samples-war/WEB-INF/jsp/
trunk/core-samples/src/resources/portal-samples-war/WEB-INF/jsp/info/
trunk/core-samples/src/resources/portal-samples-war/WEB-INF/jsp/info/view.jsp
trunk/core-samples/src/resources/portal-samples-war/WEB-INF/jsp/news/
trunk/core-samples/src/resources/portal-samples-war/WEB-INF/jsp/news/edit.jsp
trunk/core-samples/src/resources/portal-samples-war/WEB-INF/jsp/theme/
trunk/core-samples/src/resources/portal-samples-war/WEB-INF/jsp/theme/wsrpSelectorTest.jsp
trunk/core-samples/src/resources/portal-samples-war/WEB-INF/jsp/weather/
trunk/core-samples/src/resources/portal-samples-war/WEB-INF/jsp/weather/edit.jsp
trunk/core-samples/src/resources/portal-samples-war/WEB-INF/portlet-instances.xml
trunk/core-samples/src/resources/portal-samples-war/WEB-INF/portlet.xml
trunk/core-samples/src/resources/portal-samples-war/WEB-INF/web.xml
trunk/core-samples/src/resources/portal-samples-war/WEB-INF/xsl/
trunk/core-samples/src/resources/portal-samples-war/WEB-INF/xsl/news/
trunk/core-samples/src/resources/portal-samples-war/WEB-INF/xsl/news/Rss1.xsl
trunk/core-samples/src/resources/portal-samples-war/WEB-INF/xsl/news/Rss2.xsl
trunk/core-samples/src/resources/portal-samples-war/WEB-INF/xsl/weather/
trunk/core-samples/src/resources/portal-samples-war/WEB-INF/xsl/weather/Rss.xsl
Removed:
trunk/core/src/bin/portal-samples-war/
trunk/core/src/main/org/jboss/portal/core/portlet/test/
trunk/core/src/resources/portal-samples-war/
Modified:
trunk/core/build.xml
trunk/core/src/resources/portal-core-sar/META-INF/jboss-service.xml
trunk/identity/src/main/org/jboss/portal/identity/db/HibernateUserModuleImpl.java
Log:
moved samples to core-samples
Modified: trunk/core/build.xml
===================================================================
--- trunk/core/build.xml 2007-01-22 20:08:21 UTC (rev 6068)
+++ trunk/core/build.xml 2007-01-22 20:55:54 UTC (rev 6069)
@@ -305,11 +305,6 @@
<fileset dir="${build.resources}/portal-core-war"/>
<fileset dir="${source.bin}/portal-core-war"/>
</copy>
- <!-- portal-samples.war -->
- <copy todir="${build.resources}/jboss-portal/portal-samples.war">
- <fileset dir="${source.bin}/portal-samples-war"/>
- <fileset dir="${build.resources}/portal-samples-war"/>
- </copy>
<!-- portal-ajax.war -->
<copy todir="${build.resources}/jboss-portal/portal-ajax.war">
<fileset dir="${jboss.portal-theme.root}/resources/portal-ajax-war"/>
@@ -333,7 +328,6 @@
<fileset dir="${jboss.portlet-api.root}/lib" includes="portal-api-lib.jar"/>
<fileset dir="${jboss.portal-theme.root}/lib" includes="portal-theme-lib.jar"/>
<fileset dir="${jboss.portal-security.root}/lib" includes="portal-security-lib.jar"/>
- <fileset dir="${jboss.portal-samples.root}/lib" includes="portal-samples-lib.jar"/>
<fileset dir="${jboss.portal-identity.root}/lib" includes="portal-identity-lib.jar"/>
<fileset dir="${jboss.portal-registration.root}/lib" includes="portal-registration-lib.jar"/>
<fileset dir="${ehcache.ehcache.lib}" includes="ehcache.jar"/>
Modified: trunk/core/src/resources/portal-core-sar/META-INF/jboss-service.xml
===================================================================
--- trunk/core/src/resources/portal-core-sar/META-INF/jboss-service.xml 2007-01-22 20:08:21 UTC (rev 6068)
+++ trunk/core/src/resources/portal-core-sar/META-INF/jboss-service.xml 2007-01-22 20:55:54 UTC (rev 6069)
@@ -480,32 +480,6 @@
<xmbean/>
</mbean>
- <!-- A sample listener -->
- <mbean
- code="org.jboss.portal.core.event.PortalEventListenerServiceImpl"
- name="portal:service=ListenerService,type=test_listener"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- <depends
- optional-attribute-name="Registry"
- proxy-type="attribute">portal:service=ListenerRegistry</depends>
- <attribute name="RegistryId">test_listener</attribute>
- <attribute name="ListenerClassName">org.jboss.portal.core.portlet.test.event.PortletB$Listener</attribute>
- </mbean>
- <mbean
- code="org.jboss.portal.core.event.PortalEventListenerServiceImpl"
- name="portal:service=ListenerService,type=window_listener"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- <depends
- optional-attribute-name="Registry"
- proxy-type="attribute">portal:service=ListenerRegistry</depends>
- <attribute name="RegistryId">window_event_listener</attribute>
- <attribute name="ListenerClassName">org.jboss.portal.core.portlet.test.event.WindowConstraintEventListener</attribute>
- </mbean>
-
<!-- The different containers -->
<mbean
code="org.jboss.portal.core.impl.model.instance.PersistentInstanceContainer"
Added: trunk/core-samples/build.bat
===================================================================
--- trunk/core-samples/build.bat (rev 0)
+++ trunk/core-samples/build.bat 2007-01-22 20:55:54 UTC (rev 6069)
@@ -0,0 +1,54 @@
+@echo off
+rem
+rem Invokes a script of the same name in the 'tools' module.
+rem
+rem The 'tools' module is expected to be a peer directory of the directory
+rem in which this script lives.
+rem
+rem @author Jason Dillon <jason(a)planet57.com>
+rem
+
+rem $Id: build.bat 2 2005-01-14 23:01:32Z vietj $
+
+setlocal
+
+set PROGNAME=%~nx0
+set DIRNAME=%~dp0
+
+rem Legacy shell support
+if x%PROGNAME%==x set PROGNAME=build.bat
+if x%DIRNAME%==x set DIRNAME=.\
+
+set MODULE_ROOT=%DIRNAME%
+if x%TOOLS_ROOT%==x set TOOLS_ROOT=%DIRNAME%..\tools
+set TARGET=%TOOLS_ROOT%\bin\build.bat
+set ARGS=%*
+
+rem Start'er up yo
+goto main
+
+:debug
+if not x%DEBUG%==x echo %PROGNAME%: %*
+goto :EOF
+
+:main
+call :debug PROGNAME=%PROGNAME%
+call :debug DIRNAME=%DIRNAME%
+call :debug TOOLS_ROOT=%TOOLS_ROOT%
+call :debug TARGET=%TARGET%
+
+if exist %TARGET% call :call-script & goto :EOF
+rem else fail, we can not go on
+
+echo %PROGNAME%: *ERROR* The target executable does not exist:
+echo %PROGNAME%:
+echo %PROGNAME%: %TARGET%
+echo %PROGNAME%:
+echo %PROGNAME%: Please make sure you have checked out the 'tools' module
+echo %PROGNAME%: and make sure it is up to date.
+goto :EOF
+
+:call-script
+call :debug Executing %TARGET% %ARGS%
+call %TARGET% %ARGS%
+goto :EOF
Property changes on: trunk/core-samples/build.bat
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/core-samples/build.sh
===================================================================
--- trunk/core-samples/build.sh (rev 0)
+++ trunk/core-samples/build.sh 2007-01-22 20:55:54 UTC (rev 6069)
@@ -0,0 +1,49 @@
+#!/bin/sh
+##
+## Invokes a script of the same name in the 'tools' module.
+##
+## The 'tools' module is expected to be a peer directory of the directory
+## in which this script lives.
+##
+## @author Jason Dillon <jason(a)planet57.com>
+##
+
+# $Id: build.sh 2 2005-01-14 23:01:32Z vietj $
+
+PROGNAME=`basename $0`
+DIRNAME=`dirname $0`
+
+# Buss it yo
+main() {
+ if [ "x$TOOLS_ROOT" = "x" ]; then
+ TOOLS_ROOT=`cd $DIRNAME/../tools && pwd`
+ fi
+
+ MODULE_ROOT=`cd $DIRNAME; pwd`
+ export TOOLS_ROOT MODULE_ROOT DEBUG TRACE
+
+ # Where is the target script?
+ target="$TOOLS_ROOT/bin/$PROGNAME"
+ if [ ! -f "$target" ]; then
+ echo "${PROGNAME}: *ERROR* The target executable does not exist:"
+ echo "${PROGNAME}:"
+ echo "${PROGNAME}: $target"
+ echo "${PROGNAME}:"
+ echo "${PROGNAME}: Please make sure you have checked out the 'tools' module"
+ echo "${PROGNAME}: and make sure it is up to date."
+ exit 2
+ fi
+
+ # Get busy yo!
+ if [ "x$DEBUG" != "x" ]; then
+ echo "${PROGNAME}: Executing: /bin/sh $target $@"
+ fi
+ if [ "x$TRACE" = "x" ]; then
+ exec /bin/sh $target "$@"
+ else
+ exec /bin/sh -x $target "$@"
+ fi
+}
+
+# Lets get ready to rumble!
+main "$@"
Property changes on: trunk/core-samples/build.sh
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/core-samples/build.xml
===================================================================
--- trunk/core-samples/build.xml (rev 0)
+++ trunk/core-samples/build.xml 2007-01-22 20:55:54 UTC (rev 6069)
@@ -0,0 +1,324 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ 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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<!DOCTYPE project [
+ <!ENTITY libraries SYSTEM "../thirdparty/libraries.ent">
+ <!ENTITY buildmagic SYSTEM "../tools/etc/buildfragments/buildmagic.ent">
+ <!ENTITY tools SYSTEM "../tools/etc/buildfragments/tools.ent">
+ <!ENTITY modules SYSTEM "../tools/etc/buildfragments/modules.ent">
+ <!ENTITY defaults SYSTEM "../tools/etc/buildfragments/defaults.ent">
+ <!ENTITY targets SYSTEM "../tools/etc/buildfragments/targets.ent">
+ ]>
+
+<!--+======================================================================+-->
+<!--| JBoss Portal (The OpenSource Portal) Build File |-->
+<!--| |-->
+<!--| Distributable under LGPL license. |-->
+<!--| See terms of license at http://www.gnu.org. |-->
+<!--| |-->
+<!--| This file has been designed to work with the 'tools' module and |-->
+<!--| Buildmagic extentions. |-->
+<!--+======================================================================+-->
+
+<project default="main" name="JBoss Portal">
+
+ <!--+====================================================================+-->
+ <!--| Setup |-->
+ <!--| |-->
+ <!--| Include the common build elements. |-->
+ <!--| |-->
+ <!--| This defines several different targets, properties and paths. |-->
+ <!--| It also sets up the basic extention tasks amoung other things. |-->
+ <!--+====================================================================+-->
+
+ &buildmagic;
+ &modules;
+ &defaults;
+ &tools;
+ &targets;
+
+ <!-- ================================================================== -->
+ <!-- Initialization -->
+ <!-- ================================================================== -->
+
+ <!--
+ | Initialize the build system. Must depend on '_buildmagic:init'.
+ | Other targets should depend on 'init' or things will mysteriously fail.
+ -->
+
+ <target name="init" unless="init.disable" depends="_buildmagic:init">
+ </target>
+
+ <!--+====================================================================+-->
+ <!--| Configuration |-->
+ <!--| |-->
+ <!--| This target is invoked by the Buildmagic initialization logic |-->
+ <!--| and should contain module specific configuration elements. |-->
+ <!--+====================================================================+-->
+
+ <target name="configure" unless="configure.disable">
+
+ <!-- Configure some properties -->
+ <property name="jboss-junit-configuration" value=""/>
+ <property name="junit.formatter.usefile" value="true"/>
+
+ <!-- Configure thirdparty libraries -->
+ &libraries;
+
+ <path id="library.classpath">
+ <path refid="jboss.jbossxb.classpath"/>
+ <path refid="jboss.cache.classpath"/>
+ <path refid="jbossas/core.libs.classpath"/>
+ <path refid="hibernate.hibernate.classpath"/>
+ <path refid="apache.ant.classpath"/>
+ <path refid="apache.myfaces.classpath"/>
+ <path refid="apache.tomahawk.classpath"/>
+ <path refid="apache.log4j.classpath"/>
+ <path refid="junit.junit.classpath"/>
+ <path refid="sun.servlet.classpath"/>
+ <path refid="jakarta.cactus.classpath"/>
+ <path refid="apache.fileupload.classpath"/>
+ <path refid="jakarta.io.classpath"/>
+ <path refid="oswego.concurrent.classpath"/>
+ <path refid="sun.javamail.classpath"/>
+ <path refid="jwebunit.jwebunit.classpath"/>
+ <path refid="dbunit.dbunit.classpath"/>
+ <path refid="sun.jaf.classpath"/>
+ <path refid="portals.bridges.classpath"/>
+ <path refid="beanshell.beanshell.classpath"/>
+ <path refid="facelets.facelets.classpath"/>
+ <path refid="dom4j.dom4j.classpath"/>
+ <path refid="jboss.aop.classpath"/>
+ <path refid="trove.trove.classpath"/>
+ <path refid="qdox.qdox.classpath"/>
+ <pathelement location="${source.etc}/sun-jsf/jsf-example.jar"/>
+ </path>
+
+ <!-- Configure modules -->
+ <call target="configure-modules"/>
+ <path id="dependentmodule.classpath">
+ <path refid="jboss.portal-common.classpath"/>
+ <path refid="jboss.portal-theme.classpath"/>
+ <path refid="jboss.portal-core.classpath"/>
+ <path refid="jboss.portal-format.classpath"/>
+ <path refid="jboss.portal-identity.classpath"/>
+ <path refid="jboss.portal-portlet.classpath"/>
+ <path refid="jboss.portlet-api.classpath"/>
+ </path>
+
+ <!--+=======================================+-->
+ <!--| Override any default properties here. |-->
+ <!--+=======================================+-->
+
+ <!-- Configure defaults & build tools -->
+ <call target="configure-defaults"/>
+ <call target="configure-tools"/>
+ <call target="configure-explode"/>
+
+ <!--+=======================================+-->
+ <!--| Define module specific elements here. |-->
+ <!--+=======================================+-->
+ <property name="javadoc.private" value="true"/>
+ <property name="javadoc.protected" value="false"/>
+
+ <taskdef name="explode"
+ classname="org.jboss.portal.common.ant.Explode"
+ classpathref="explode.task.classpath"/>
+ <taskdef name="implode"
+ classname="org.jboss.portal.common.ant.Implode"
+ classpathref="explode.task.classpath"/>
+
+ </target>
+
+ <target name="configure-explode">
+ <path id="explode.task.classpath">
+ <pathelement location="${project.tools}/lib/explode.jar"/>
+ <path refid="apache.ant.classpath"/>
+ </path>
+ <taskdef
+ name="explode"
+ classname="org.jboss.portal.common.ant.Explode"
+ classpathref="explode.task.classpath"/>
+ </target>
+
+ <!--+====================================================================+-->
+ <!--| Compile |-->
+ <!--| |-->
+ <!--| This target should depend on other compile-* targets for each |-->
+ <!--| different type of compile that needs to be performed, short of |-->
+ <!--| documentation compiles. |-->
+ <!--+====================================================================+-->
+
+ <target name="compile"
+ description="Compile all source files."
+ depends="_default:compile-classes,
+ _default:compile-etc,
+ _default:compile-resources">
+ <!-- Add module specific elements here. -->
+ </target>
+
+ <!--+====================================================================+-->
+ <!--| Generate Output |-->
+ <!--| |-->
+ <!--| Generates the target output for this module. Target output is |-->
+ <!--| the output which is ment to be released or used by external |-->
+ <!--| modules. |-->
+ <!--+====================================================================+-->
+
+ <target name="artifacts"
+ description="Generate all target output."
+ depends="compile">
+
+ <mkdir dir="${build.lib}"/>
+
+ <!-- portal-samples-lib.jar -->
+ <jar jarfile="${build.lib}/portal-core-samples-lib.jar">
+ <fileset dir="${build.classes}">
+ </fileset>
+ </jar>
+
+ <!-- portal-samples.sar -->
+ <copy todir="${build.resources}/portal-samples">
+ <fileset dir="${build.resources}/portal-samples-sar"/>
+ </copy>
+
+ <!-- portal-samples.war -->
+ <copy todir="${build.resources}/portal-samples/portal-samples.war">
+ <fileset dir="${source.bin}/portal-samples-war"/>
+ <fileset dir="${build.resources}/portal-samples-war"/>
+ </copy>
+
+ <!-- hibernate configuration for identity -->
+ <copy todir="${build.resources}/portal-samples/lib">
+ <fileset dir="${build.lib}" includes="portal-core-samples-lib.jar"/>
+ <fileset dir="${jboss.portal-samples.root}/lib" includes="portal-samples-lib.jar"/>
+ </copy>
+ </target>
+
+ <!-- Build the jboss-portal-ha.sar -->
+ <target name="output-ha" depends="artifacts">
+ <copy todir="${build.resources}/portal-samples-ha.sar">
+ <fileset dir="${build.resources}/portal-samples" excludes="**/*.xml"/>
+ </copy>
+ <copy todir="${build.resources}/portal-samples-ha.sar">
+ <filterset>
+ <filtersfile file="../build/etc/clustered.properties"/>
+ </filterset>
+ <fileset dir="${build.resources}/portal-samples" includes="**/*.xml"/>
+ </copy>
+ <implode
+ dir="${build.resources}/portal-samples-ha.sar"
+ tofile="${build.lib}/portal-samples-ha.sar"/>
+ </target>
+
+ <!-- Build the jboss-portal.sar -->
+ <target name="output" depends="artifacts">
+ <copy todir="${build.resources}/portal-samples.sar">
+ <fileset dir="${build.resources}/portal-samples" excludes="**/*.xml"/>
+ </copy>
+ <copy todir="${build.resources}/portal-samples.sar">
+ <filterset>
+ <filtersfile file="../build/etc/single.properties"/>
+ </filterset>
+ <fileset dir="${build.resources}/portal-samples" includes="**/*.xml"/>
+ </copy>
+ <implode
+ dir="${build.resources}/portal-samples.sar"
+ tofile="${build.lib}/portal-samples.sar"/>
+ </target>
+
+ <!-- create artifacts for running the portlet tests (except TCK) target output should have already been executed -->
+ <target name="package-tests" depends="init">
+ </target>
+
+ <!-- ================================================================== -->
+ <!-- Cleaning -->
+ <!-- ================================================================== -->
+
+ <!-- Clean up all build output -->
+ <target name="clean" depends="_default:clean">
+ <!-- Add module specific elements here. -->
+ </target>
+
+ <!--+====================================================================+-->
+ <!--| Documents |-->
+ <!--| |-->
+ <!--| Generate all documentation for this module. |-->
+ <!--+====================================================================+-->
+
+ <target name="docs" depends="_default:docs">
+ <!-- Add module specific elements here. -->
+ </target>
+
+ <!-- ================================================================== -->
+ <!-- Misc. -->
+ <!-- ================================================================== -->
+
+ <target name="main" depends="most"/>
+ <target name="all" depends="_default:all"/>
+ <target name="most" depends="_default:most"/>
+ <target name="help" depends="_default:help"/>
+
+ <!-- ================================================================== -->
+ <!-- Deployment -->
+ <!-- ================================================================== -->
+
+ <!--
+ | Deploy the application
+ -->
+
+ <target name="deploy"
+ description="Deploy."
+ depends="output">
+ <require file="${jboss.home}/server/${portal.deploy.dir}"/>
+ <copy file="${build.lib}/portal-samples.sar" todir="${jboss.home}/server/${portal.deploy.dir}" overwrite="true"/>
+ </target>
+
+ <target name="deploy-ha"
+ description="Deploy high availability."
+ depends="output-ha">
+ <require file="${jboss.home}/server/${portal-ha.deploy.dir}"/>
+ <copy file="${build.lib}/portal-samples-ha.sar" todir="${jboss.home}/server/${portal-ha.deploy.dir}"/>
+ </target>
+
+ <!--
+ | Undeploy the application
+ -->
+ <target name="undeploy"
+ description="Undeploy."
+ depends="init">
+ <require file="${jboss.home}/server/${portal.deploy.dir}"/>
+ <delete file="${jboss.home}/server/${portal.deploy.dir}/portal-samples.sar"/>
+ </target>
+
+ <target name="undeploy-ha"
+ description="Undeploy."
+ depends="init">
+ <require file="${jboss.home}/server/${portal-ha.deploy.dir}"/>
+ <delete file="${jboss.home}/server/${portal-ha.deploy.dir}/portal-samples-ha.sar"/>
+ </target>
+
+ <target name="tests" depends="init, _buildmagic:configure:deployment">
+ </target>
+</project>
Added: trunk/core-samples/src/bin/portal-samples-war/images/accessorize.gif
===================================================================
(Binary files differ)
Property changes on: trunk/core-samples/src/bin/portal-samples-war/images/accessorize.gif
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added: trunk/core-samples/src/bin/portal-samples-war/images/developers_banner.gif
===================================================================
(Binary files differ)
Property changes on: trunk/core-samples/src/bin/portal-samples-war/images/developers_banner.gif
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added: trunk/core-samples/src/bin/portal-samples-war/images/dodemo.gif
===================================================================
(Binary files differ)
Property changes on: trunk/core-samples/src/bin/portal-samples-war/images/dodemo.gif
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added: trunk/core-samples/src/bin/portal-samples-war/images/getcode.gif
===================================================================
(Binary files differ)
Property changes on: trunk/core-samples/src/bin/portal-samples-war/images/getcode.gif
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added: trunk/core-samples/src/bin/portal-samples-war/portlet-styles/HeaderContent.css
===================================================================
--- trunk/core-samples/src/bin/portal-samples-war/portlet-styles/HeaderContent.css (rev 0)
+++ trunk/core-samples/src/bin/portal-samples-war/portlet-styles/HeaderContent.css 2007-01-22 20:55:54 UTC (rev 6069)
@@ -0,0 +1,13 @@
+#Introducing-HeaderContent {
+/* Original Logo...*/
+ background-image: url( ../images/developers_banner.gif );
+ background-repeat: no-repeat;
+ width: 187px;
+ height: 120px;
+}
+
+#Introducing-HeaderContentInput {
+ position: relative;
+ top: 85px;
+ left: 3px;
+}
Property changes on: trunk/core-samples/src/bin/portal-samples-war/portlet-styles/HeaderContent.css
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/core-samples/src/bin/portal-samples-war/portlet-styles/HeaderContent.js
===================================================================
--- trunk/core-samples/src/bin/portal-samples-war/portlet-styles/HeaderContent.js (rev 0)
+++ trunk/core-samples/src/bin/portal-samples-war/portlet-styles/HeaderContent.js 2007-01-22 20:55:54 UTC (rev 6069)
@@ -0,0 +1,5 @@
+// simple test java script
+function injectJS()
+{
+ alert('hello from the injected java script!');
+}
Property changes on: trunk/core-samples/src/bin/portal-samples-war/portlet-styles/HeaderContent.js
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/core-samples/src/main/org/jboss/portal/core/portlet/test/BasicPortlet.java
===================================================================
--- trunk/core-samples/src/main/org/jboss/portal/core/portlet/test/BasicPortlet.java (rev 0)
+++ trunk/core-samples/src/main/org/jboss/portal/core/portlet/test/BasicPortlet.java 2007-01-22 20:55:54 UTC (rev 6069)
@@ -0,0 +1,149 @@
+/******************************************************************************
+ * 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.test;
+
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.Portlet;
+import javax.portlet.PortletConfig;
+import javax.portlet.PortletException;
+import javax.portlet.PortletSecurityException;
+import javax.portlet.PortletURL;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.WindowState;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.util.Iterator;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public class BasicPortlet implements Portlet
+{
+
+ private PortletConfig config;
+
+ public void init(PortletConfig config) throws PortletException
+ {
+ this.config = config;
+ }
+
+ public void processAction(ActionRequest request, ActionResponse response) throws PortletException, PortletSecurityException, IOException
+ {
+ for (Iterator i = request.getParameterMap().entrySet().iterator(); i.hasNext();)
+ {
+ Map.Entry entry = (Map.Entry)i.next();
+ String name = (String)entry.getKey();
+ String[] values = (String[])entry.getValue();
+ response.setRenderParameter(name + " from action", values);
+ }
+ response.setWindowState(request.getWindowState());
+ }
+
+ public void render(RenderRequest request, RenderResponse response) throws PortletException, PortletSecurityException, IOException
+ {
+ response.setContentType("text/html");
+ PrintWriter writer = response.getWriter();
+
+ //
+ writer.write("window state : " + request.getWindowState());
+ writer.write("<table><th><td>name</td><td>value</td></th>");
+ for (Iterator i = request.getParameterMap().entrySet().iterator(); i.hasNext();)
+ {
+ Map.Entry entry = (Map.Entry)i.next();
+ String name = (String)entry.getKey();
+ String[] values = (String[])entry.getValue();
+ writer.write("<tr><td>" + name + "</td><td>" + values[0] + "</td></tr>");
+ }
+ writer.write("</table>");
+
+ //
+ PortletURL renderURL = response.createRenderURL();
+ writeLink(writer, renderURL, "empty");
+
+ //
+ renderURL.setParameter("foo", "bar");
+ writeLink(writer, renderURL, "foo=bar");
+
+ //
+ renderURL.setWindowState(WindowState.MAXIMIZED);
+ writeLink(writer, renderURL, "maximized,foo=bar");
+
+ //
+ renderURL = response.createRenderURL();
+ renderURL.setWindowState(WindowState.MAXIMIZED);
+ writeLink(writer, renderURL, "maximized");
+
+ //
+ renderURL = response.createRenderURL();
+ renderURL.setWindowState(WindowState.NORMAL);
+ writeLink(writer, renderURL, "normal");
+
+ //
+ renderURL.setWindowState(WindowState.NORMAL);
+ renderURL.setParameter("foo", "bar");
+ writeLink(writer, renderURL, "normal,foo=bar");
+
+ PortletURL actionURL = response.createActionURL();
+ writeLink(writer, actionURL, "empty");
+
+ //
+ actionURL.setParameter("foo", "bar");
+ writeLink(writer, actionURL, "foo=bar");
+
+ //
+ actionURL.setWindowState(WindowState.MAXIMIZED);
+ writeLink(writer, actionURL, "maximized,foo=bar");
+
+ //
+ actionURL = response.createRenderURL();
+ actionURL.setWindowState(WindowState.MAXIMIZED);
+ writeLink(writer, actionURL, "maximized");
+
+ //
+ actionURL = response.createRenderURL();
+ actionURL.setWindowState(WindowState.NORMAL);
+ writeLink(writer, actionURL, "normal");
+
+ //
+ actionURL.setWindowState(WindowState.NORMAL);
+ actionURL.setParameter("foo", "bar");
+ writeLink(writer, actionURL, "normal,foo=bar");
+
+ //
+ writer.close();
+ }
+
+ private void writeLink(PrintWriter writer, PortletURL url, String label)
+ {
+ writer.print("<div><a href=\"" + url + "\">" + label + "</a></div>");
+ }
+
+ public void destroy()
+ {
+ this.config = null;
+ }
+}
Property changes on: trunk/core-samples/src/main/org/jboss/portal/core/portlet/test/BasicPortlet.java
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/core-samples/src/main/org/jboss/portal/core/portlet/test/CharsetPortlet.java
===================================================================
--- trunk/core-samples/src/main/org/jboss/portal/core/portlet/test/CharsetPortlet.java (rev 0)
+++ trunk/core-samples/src/main/org/jboss/portal/core/portlet/test/CharsetPortlet.java 2007-01-22 20:55:54 UTC (rev 6069)
@@ -0,0 +1,183 @@
+/******************************************************************************
+ * 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.test;
+
+import org.apache.log4j.Logger;
+import org.jboss.portal.format.util.EntityTable;
+
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.GenericPortlet;
+import javax.portlet.PortletException;
+import javax.portlet.PortletSecurityException;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import java.io.IOException;
+import java.io.PrintWriter;
+
+/**
+ * This portlet is used to display a form that helps to test the charset handling by the portal and the client. When a
+ * fault occurs it may be the client fault (for instance the char with unicode value 160 fail the test in firefox but
+ * succeds in IE6).
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public class CharsetPortlet extends GenericPortlet
+{
+
+ private static final Logger log = Logger.getLogger(CharsetPortlet.class);
+
+ public void processAction(ActionRequest req, ActionResponse resp) throws PortletException, PortletSecurityException, IOException
+ {
+ //
+ String fromString = req.getParameter("from");
+ String toString = req.getParameter("to");
+ int from = 0;
+ int to = 0;
+ try
+ {
+ from = Integer.parseInt(fromString);
+ to = Integer.parseInt(toString);
+ }
+ catch (NumberFormatException ignore)
+ {
+ //
+ }
+
+ //
+ StringBuffer buffer = new StringBuffer();
+ for (int i = from; i < to; i++)
+ {
+ char c = (char)i;
+ buffer.append(c);
+ }
+
+ //
+ String text = req.getParameter("text");
+ boolean same = buffer.toString().equals(text);
+
+ //
+ if (!same)
+ {
+ log.error("The input does not match the expected string");
+ log.error("Expected string " + buffer);
+ log.error("Received string " + text);
+ }
+
+ //
+ resp.setRenderParameter("from", "" + from);
+ resp.setRenderParameter("to", "" + to);
+ resp.setRenderParameter("same", "" + same);
+ }
+
+ protected void doView(RenderRequest req, RenderResponse resp) throws PortletException, PortletSecurityException, IOException
+ {
+ String sameString = req.getParameter("same");
+ Boolean same = null;
+ if ("true".equalsIgnoreCase(sameString))
+ {
+ same = Boolean.TRUE;
+ }
+ else if ("false".equalsIgnoreCase(sameString))
+ {
+ same = Boolean.FALSE;
+ }
+
+ //
+ String fromString = req.getParameter("from");
+ String toString = req.getParameter("to");
+ int from = 65;
+ int to = 256;
+ try
+ {
+ from = Integer.parseInt(fromString);
+ to = from + 16;
+ to = Integer.parseInt(toString);
+ }
+ catch (NumberFormatException ignore)
+ {
+ //
+ }
+
+ //
+ if (to <= from)
+ {
+ to = from + 16;
+ }
+
+ //
+ resp.setContentType("text/html");
+ PrintWriter writer = resp.getWriter();
+
+ //
+ if (same == Boolean.TRUE)
+ {
+ writer.print("The input matched the expected result");
+ }
+ else if (same == Boolean.FALSE)
+ {
+ writer.print("The input did not matched the expected result");
+ }
+
+ //
+ writer.print(
+ "<div> Testing range : " +
+ "<form action=\"" + resp.createRenderURL() + "\" method=\"post\"\">" +
+ "<input type=\"text\" name=\"from\" value=\"" + from + "\"/>" +
+ "<input type=\"text\" name=\"to\" value=\"" + to + "\"/>" +
+ "<input type=\"submit\" value=\"change\"/>" +
+ "</form>" +
+ "</div>");
+
+ //
+ writer.println(
+ "<div>" +
+ "<form action=\"" + resp.createActionURL() + "\" accept-charset=\"" + resp.getCharacterEncoding() + "\" method=\"post\">" +
+ "<input type=\"hidden\" name=\"from\" value=\"" + from + "\"/>" +
+ "<input type=\"hidden\" name=\"to\" value=\"" + to + "\"/>" +
+ "<textarea name=\"text\" cols=\"20\" rows=\"10\" wrap=\"virtual\">");
+ for (int i = from; i < to; i++)
+ {
+ char c = (char)i;
+ String s = EntityTable.FULL.lookup(c);
+ if (s == null)
+ {
+ writer.print(c);
+ }
+ else
+ {
+ writer.print("&" + s + ";");
+ }
+ }
+ writer.println(
+ "</textarea>" +
+ "<input type=\"submit\" value=\"check\"/>" +
+ "</form>" +
+ "</div>");
+
+ //
+ writer.close();
+ }
+
+}
Property changes on: trunk/core-samples/src/main/org/jboss/portal/core/portlet/test/CharsetPortlet.java
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/core-samples/src/main/org/jboss/portal/core/portlet/test/CounterPortlet.java
===================================================================
--- trunk/core-samples/src/main/org/jboss/portal/core/portlet/test/CounterPortlet.java (rev 0)
+++ trunk/core-samples/src/main/org/jboss/portal/core/portlet/test/CounterPortlet.java 2007-01-22 20:55:54 UTC (rev 6069)
@@ -0,0 +1,75 @@
+/******************************************************************************
+ * 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.test;
+
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.GenericPortlet;
+import javax.portlet.PortletException;
+import javax.portlet.PortletSecurityException;
+import javax.portlet.PortletSession;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import java.io.IOException;
+import java.io.PrintWriter;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public class CounterPortlet extends GenericPortlet
+{
+
+ public void processAction(ActionRequest req, ActionResponse resp) throws PortletException, PortletSecurityException, IOException
+ {
+ }
+
+ protected void doView(RenderRequest req, RenderResponse resp) throws PortletException, PortletSecurityException, IOException
+ {
+ resp.setContentType("text/html");
+ PrintWriter writer = resp.getWriter();
+
+ //
+ PortletSession session = req.getPortletSession();
+ int count = 0;
+ if (session.getAttribute("count") != null)
+ {
+ count = ((Integer)session.getAttribute("count")).intValue() + 1;
+ }
+ session.setAttribute("count", new Integer(count));
+ writer.write("<p>");
+ writer.write("<div class=\"portlet-section-header\">Render call count</div>");
+ writer.write("<div class=\"portlet-section-body\">");
+ writer.write("<div>" + count + "</div>");
+ writer.write("</div>");
+ writer.write("</p>");
+
+ writer.write("<div class=\"portlet-section-header\">Render call count</div>");
+ writer.write("<div><a href=\"" + resp.createActionURL() + "\">action</a></div");
+ writer.write("<div><a href=\"" + resp.createRenderURL() + "\">render</a></div");
+
+ //
+ writer.close();
+ }
+
+}
Property changes on: trunk/core-samples/src/main/org/jboss/portal/core/portlet/test/CounterPortlet.java
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/core-samples/src/main/org/jboss/portal/core/portlet/test/EncodingPortlet.java
===================================================================
--- trunk/core-samples/src/main/org/jboss/portal/core/portlet/test/EncodingPortlet.java (rev 0)
+++ trunk/core-samples/src/main/org/jboss/portal/core/portlet/test/EncodingPortlet.java 2007-01-22 20:55:54 UTC (rev 6069)
@@ -0,0 +1,105 @@
+/******************************************************************************
+ * 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.test;
+
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.GenericPortlet;
+import javax.portlet.PortletException;
+import javax.portlet.PortletSecurityException;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import java.io.IOException;
+import java.io.PrintWriter;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw Dawidowicz</a>
+ * @version $Revision: 5448 $
+ */
+public class EncodingPortlet extends GenericPortlet
+{
+
+ public void processAction(ActionRequest req, ActionResponse resp) throws PortletException, PortletSecurityException, IOException
+ {
+ resp.setRenderParameter("text", req.getParameter("text"));
+ req.getPortletSession().setAttribute("text", req.getParameter("text"));
+
+ }
+
+ protected void doView(RenderRequest req, RenderResponse resp) throws PortletException, PortletSecurityException, IOException
+ {
+ resp.setContentType("text/html");
+ PrintWriter writer = resp.getWriter();
+
+ String param = req.getParameter("text");
+ String attr = (String)req.getPortletSession().getAttribute("text");
+
+ //
+ writer.print(
+ "<div> Text to pass : " +
+ "<form action=\"" + resp.createRenderURL() + "\" method=\"post\"\" accept-charset=\"" + resp.getCharacterEncoding() + "\" >" +
+ "<input type=\"text\" name=\"text\" value=\"\"/>" +
+ "<input type=\"submit\" value=\"Submit to render phase\"/>" +
+ "</form>" +
+ "<form action=\"" + resp.createActionURL() + "\" method=\"post\"\" accept-charset=\"" + resp.getCharacterEncoding() + "\" >" +
+ "<input type=\"text\" name=\"text\" value=\"\"/>" +
+ "<input type=\"submit\" value=\"Submit to action phase\"/>" +
+ "</form>" +
+ "</div>");
+
+ //
+ writer.println(
+ "<div>" + "Text retrieved from request parameter: " +
+ "</div>" +
+ "<div>" +
+ "<textarea name=\"text\" cols=\"20\" rows=\"4\" wrap=\"virtual\">");
+
+ if (param != null)
+ {
+ writer.println(param);
+ }
+
+ writer.println(
+ "</textarea>" +
+ "</div>");
+
+ writer.println(
+ "<div>" + "Text retrieved from portlet session (value set during Action Phase): " +
+ "</div>" +
+ "<div>" +
+ "<textarea name=\"text\" cols=\"20\" rows=\"4\" wrap=\"virtual\">");
+
+ if (attr != null)
+ {
+ writer.println(attr);
+ }
+
+ writer.println(
+ "</textarea>" +
+ "</div>");
+
+ //
+ writer.close();
+ }
+
+}
Property changes on: trunk/core-samples/src/main/org/jboss/portal/core/portlet/test/EncodingPortlet.java
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/core-samples/src/main/org/jboss/portal/core/portlet/test/ExceptionPortlet.java
===================================================================
--- trunk/core-samples/src/main/org/jboss/portal/core/portlet/test/ExceptionPortlet.java (rev 0)
+++ trunk/core-samples/src/main/org/jboss/portal/core/portlet/test/ExceptionPortlet.java 2007-01-22 20:55:54 UTC (rev 6069)
@@ -0,0 +1,93 @@
+/******************************************************************************
+ * 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.test;
+
+import org.jboss.portlet.JBossPortlet;
+import org.jboss.portlet.JBossRenderRequest;
+import org.jboss.portlet.JBossRenderResponse;
+
+import javax.portlet.PortletException;
+import javax.portlet.PortletSecurityException;
+import javax.portlet.PortletURL;
+import java.io.IOException;
+import java.io.PrintWriter;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public class ExceptionPortlet extends JBossPortlet
+{
+
+ protected void doView(JBossRenderRequest req, JBossRenderResponse resp) throws PortletException, PortletSecurityException, IOException
+ {
+ String op = req.getParameter("op");
+
+ // Throw any required exception
+ if ("portletexception".equals(op))
+ {
+ throw new PortletException();
+ }
+ if ("portletsecurityexception".equals(op))
+ {
+ throw new PortletSecurityException("");
+ }
+ if ("ioexception".equals(op))
+ {
+ throw new IOException();
+ }
+ if ("runtimeexception".equals(op))
+ {
+ throw new RuntimeException();
+ }
+
+ //
+ resp.setContentType("text/html");
+ PrintWriter writer = resp.getWriter();
+ PortletURL renderURL = resp.createRenderURL();
+ PortletURL actionURL = resp.createActionURL();
+
+ //
+ writer.write("<p>");
+ writer.write("<div class=\"portlet-section-header\">Throw :</div>");
+ writer.write("<div class=\"portlet-section-body\">");
+ renderURL.setParameter("op", "portletexception");
+ writer.write("<div><a href=\"" + renderURL + "\">render PortletException</a></div>");
+ renderURL.setParameter("op", "portletsecurityexception");
+ writer.write("<div><a href=\"" + renderURL + "\">render PortletSecurityException</a></div>");
+ renderURL.setParameter("op", "ioexception");
+ writer.write("<div><a href=\"" + renderURL + "\">render IOException</a></div>");
+ renderURL.setParameter("op", "runtimeexception");
+ writer.write("<div><a href=\"" + renderURL + "\">render RuntimeException</a></div>");
+ actionURL.setParameter("op", "portletexception");
+ writer.write("<div><a href=\"" + actionURL + "\">action PortletException</a></div>");
+ actionURL.setParameter("op", "portletsecurityexception");
+ writer.write("<div><a href=\"" + actionURL + "\">action PortletSecurityException</a></div>");
+ actionURL.setParameter("op", "ioexception");
+ writer.write("<div><a href=\"" + actionURL + "\">action IOException</a></div>");
+ actionURL.setParameter("op", "runtimeexception");
+ writer.write("<div><a href=\"" + actionURL + "\">action RuntimeException</a></div>");
+ writer.write("</div>");
+ writer.write("</p>");
+ }
+}
Property changes on: trunk/core-samples/src/main/org/jboss/portal/core/portlet/test/ExceptionPortlet.java
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/core-samples/src/main/org/jboss/portal/core/portlet/test/PortletSessionPortlet.java
===================================================================
--- trunk/core-samples/src/main/org/jboss/portal/core/portlet/test/PortletSessionPortlet.java (rev 0)
+++ trunk/core-samples/src/main/org/jboss/portal/core/portlet/test/PortletSessionPortlet.java 2007-01-22 20:55:54 UTC (rev 6069)
@@ -0,0 +1,113 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.core.portlet.test;
+
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.GenericPortlet;
+import javax.portlet.PortletException;
+import javax.portlet.PortletSession;
+import javax.portlet.PortletURL;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.util.Enumeration;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public class PortletSessionPortlet extends GenericPortlet
+{
+ public void processAction(ActionRequest req, ActionResponse resp) throws PortletException, IOException
+ {
+ String name = req.getParameter("name");
+ String value = req.getParameter("value");
+ boolean portletScope = req.getParameter("portlet") != null;
+ if (name != null && value != null)
+ {
+ req.getPortletSession().setAttribute(name, value, portletScope ? PortletSession.PORTLET_SCOPE : PortletSession.APPLICATION_SCOPE);
+ }
+ if (req.getParameter("invalidate") != null)
+ {
+ req.getPortletSession().invalidate();
+ }
+ }
+
+ public void render(RenderRequest req, RenderResponse resp) throws PortletException, IOException
+ {
+ PortletSession session = req.getPortletSession(false);
+ PortletURL purl = resp.createActionURL();
+
+ //
+ resp.setContentType("text/html");
+ PrintWriter writer = resp.getWriter();
+
+ //
+ if (session == null)
+ {
+ writer.println("No session");
+ }
+ else
+ {
+ writer.println("Session id = " + session.getId());
+ writer.println("<br/>");
+
+ //
+ print(session, PortletSession.PORTLET_SCOPE, writer);
+ writer.println("<br/>");
+
+ //
+ print(session, PortletSession.APPLICATION_SCOPE, writer);
+ writer.println("<br/>");
+
+ }
+
+ //
+ writer.println("<form action=\"" + purl.toString() + "\" method=\"post\">");
+ writer.println("<input type=\"text\" name=\"name\"/>");
+ writer.println("<input type=\"text\" name=\"value\"/>");
+ writer.println("<input type=\"submit\" name=\"portlet\" value=\"Add to portlet scope\"/>");
+ writer.println("<input type=\"submit\" name=\"application\" value=\"Add to application scope\"/>");
+ writer.println("</form><br/>");
+
+ //
+ purl.setParameter("invalidate", "true");
+ writer.println("<a href=\"" + purl.toString() + "\">invalidate</a><br/>");
+ }
+
+ private void print(PortletSession session, int scope, PrintWriter writer)
+ {
+ writer.println("<table>");
+ writer.println("<tr><td>name</td><td>value</td>");
+ for (Enumeration e = session.getAttributeNames(scope); e.hasMoreElements();)
+ {
+ String name = (String)e.nextElement();
+ Object value = session.getAttribute(name, scope);
+ writer.println("<tr><td>" + name + "</td><td>" + value + "</td>");
+ }
+ writer.println("</table>");
+ }
+
+}
Property changes on: trunk/core-samples/src/main/org/jboss/portal/core/portlet/test/PortletSessionPortlet.java
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/core-samples/src/main/org/jboss/portal/core/portlet/test/TestPortlet.java
===================================================================
--- trunk/core-samples/src/main/org/jboss/portal/core/portlet/test/TestPortlet.java (rev 0)
+++ trunk/core-samples/src/main/org/jboss/portal/core/portlet/test/TestPortlet.java 2007-01-22 20:55:54 UTC (rev 6069)
@@ -0,0 +1,238 @@
+/******************************************************************************
+ * 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.test;
+
+import org.jboss.portal.common.transaction.TransactionManagerProvider;
+import org.jboss.portal.core.CoreConstants;
+import org.jboss.portal.identity.User;
+import org.jboss.portlet.JBossActionRequest;
+import org.jboss.portlet.JBossActionResponse;
+import org.jboss.portlet.JBossPortlet;
+import org.jboss.portlet.JBossRenderRequest;
+import org.jboss.portlet.JBossRenderResponse;
+
+import javax.portlet.PortalContext;
+import javax.portlet.PortletException;
+import javax.portlet.PortletRequest;
+import javax.portlet.PortletSecurityException;
+import javax.portlet.PortletURL;
+import javax.transaction.Transaction;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.util.Enumeration;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5883 $
+ */
+public class TestPortlet extends JBossPortlet
+{
+
+ public void main(JBossActionRequest req, JBossActionResponse resp)
+ {
+ }
+
+ public void addrole(JBossActionRequest req, JBossActionResponse resp)
+ {
+ String role = req.getParameter("role");
+ Set roles = (Set)req.getPortletSession().getAttribute("roles");
+ if (roles == null)
+ {
+ roles = new HashSet();
+ req.getPortletSession().setAttribute("roles", roles);
+ }
+ roles.add(role);
+ }
+
+ public void testaction(JBossActionRequest req, JBossActionResponse resp)
+ {
+ resp.setRenderParameter("name", "value");
+ }
+
+ protected void doView(JBossRenderRequest req, JBossRenderResponse resp) throws PortletException, PortletSecurityException, IOException
+ {
+ resp.setContentType("text/html");
+ PrintWriter writer = resp.getWriter();
+
+ //
+ User user = req.getUser();
+ if (user != null)
+ {
+ writer.write("<p>");
+ writer.write("<div class=\"portlet-section-header\">User infos</div>");
+ writer.write("<div class=\"portlet-section-body\">");
+
+ //TODO: update this with new Identity API
+ //writer.write("<div>Last visit date : " + user.getLastVisitDate() + "</div>");
+ writer.write("</div>");
+ writer.write("</p>");
+ }
+
+ //
+ writer.write("<p>");
+ writer.write("<div class=\"portlet-section-header\">Portlet security infos</div>");
+ writer.write("<div class=\"portlet-section-body\">");
+ writer.write("<div>RemoteUser : " + req.getRemoteUser() + "</div>");
+ writer.write("<div>Principal : " + req.getUserPrincipal() + "</div>");
+ writer.write("</div>");
+ writer.write("</p>");
+
+ //
+ writer.write("<p>");
+ writer.write("<div class=\"portlet-section-header\">Portlet security role test</div>");
+ Set roles = (Set)req.getPortletSession().getAttribute("roles");
+ if (roles != null)
+ {
+ writer.write("<div class=\"portlet-section-body\">");
+ for (Iterator i = roles.iterator(); i.hasNext();)
+ {
+ String role = (String)i.next();
+ writer.write("<div>" + role + " " + req.isUserInRole(role) + "</div>");
+ }
+ writer.write("</div>");
+ }
+ PortletURL roleURL = resp.createActionURL();
+ roleURL.setParameter("op", "addrole");
+ writer.write("<div>" +
+ "<form action=\"" + roleURL + "\" method=\"post\">" +
+ "<input class=\"portlet-form-input-field\" type=\"text\" name=\"role\" value=\"\"/>" +
+ "<input class=\"portlet-form-button\" type=\"submit\" value=\"add role\"/>" +
+ "</form>" +
+ "</div>");
+ writer.write("</p>");
+
+ //
+ writer.write("<p>");
+ writer.write("<div class=\"portlet-section-header\">Capabilities</div>");
+ writer.write("<div class=\"portlet-section-body\">");
+ writer.write("<div>Content type " + req.getResponseContentType() + "</div>");
+ writer.write("<div>Preferred markup " + req.getProperty(CoreConstants.REQ_PROP_PREFERRED_MARKUP) + "</div>");
+ writer.write("</div>");
+ writer.write("</p>");
+
+ //
+ PortletURL url = resp.createRenderURL();
+ url.setSecure(false);
+ String httpURL = url.toString();
+ url.setSecure(true);
+ String httpsURL = url.toString();
+ writer.write("<p>");
+ writer.write("<div class=\"portlet-section-header\">Secure</div>");
+ writer.write("<div class=\"portlet-section-body\">");
+ writer.write("<div><a href=\"" + httpURL + "\">http</a></div>");
+ writer.write("<div><a href=\"" + httpsURL + "\">https</a></div>");
+ writer.write("</div>");
+ writer.write("</p>");
+
+ writer.write("<p>");
+ writer.write("<div class=\"portlet-section-header\">Path</div>");
+ writer.write("<div class=\"portlet-section-body\">");
+ writer.write("<div>portal path info = " + req.getAttribute("PATH") + "</div>");
+ writer.write("<div>portal path info = " + req.getParameter("PATH") + "</div>");
+ writer.write("</div>");
+ writer.write("</p>");
+
+ //
+ writer.write("<p>");
+ writer.write("<div class=\"portlet-section-header\">Portal infos</div>");
+ writer.write("<div class=\"portlet-section-body\">");
+ PortalContext portalCtx = req.getPortalContext();
+ writer.write("<div>version : " + portalCtx.getPortalInfo() + "</div>");
+ for (Enumeration e = portalCtx.getPropertyNames(); e.hasMoreElements();)
+ {
+ String propertyName = (String)e.nextElement();
+ String propertyValue = portalCtx.getProperty(propertyName);
+ writer.write("<div>" + propertyName + " : " + propertyValue + "</div>");
+ }
+ writer.write("</div>");
+ writer.write("</p>");
+
+ //
+ writer.write("<p>");
+ writer.write("<div class=\"portlet-section-header\">Request attributes</div>");
+ writer.write("<div class=\"portlet-section-body\">");
+ for (Enumeration e = req.getAttributeNames(); e.hasMoreElements();)
+ {
+ String name = (String)e.nextElement();
+ Object value = req.getAttribute(name);
+ writer.write("<div>" + name + " : " + value + "</div>");
+ }
+ writer.write("</div>");
+ writer.write("</p>");
+
+ // User properties
+ Map userInfoMap = (Map)req.getAttribute(PortletRequest.USER_INFO);
+ writer.write("<p>");
+ writer.write("<div class=\"portlet-section-header\">User properties</div>");
+ writer.write("<div class=\"portlet-section-body\">");
+ if (userInfoMap != null)
+ {
+ for (Iterator i = userInfoMap.entrySet().iterator(); i.hasNext();)
+ {
+ Map.Entry entry = (Map.Entry)i.next();
+ String key = (String)entry.getKey();
+ String value = (String)entry.getValue();
+ writer.write("<div>" + key + " : " + value + "</div>");
+ }
+ }
+ writer.write("</div>");
+ writer.write("</p>");
+
+ //
+ PortletURL actionURL = resp.createActionURL();
+ actionURL.setParameter("op", "testaction");
+ writer.write("<p>");
+ writer.write("<div class=\"portlet-section-header\">Test action</div>");
+ writer.write("<div class=\"portlet-section-body\">");
+ writer.write("<div><a href=\"" + actionURL + "\">action</a></div>");
+ writer.write("</div>");
+ writer.write("</p>");
+
+ //
+ writer.write("<p>");
+ writer.write("<div class=\"portlet-section-header\">Test current transaction</div>");
+ writer.write("<div class=\"portlet-section-body\">");
+ writer.write("<div>" + getCurrentTransaction() + "</div>");
+ writer.write("</div>");
+ writer.write("</p>");
+
+ //
+ writer.close();
+ }
+
+ private Transaction getCurrentTransaction()
+ {
+ try
+ {
+ return TransactionManagerProvider.JBOSS_PROVIDER.getTransactionManager().getTransaction();
+ }
+ catch (Exception e)
+ {
+ return null;
+ }
+ }
+}
Property changes on: trunk/core-samples/src/main/org/jboss/portal/core/portlet/test/TestPortlet.java
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/core-samples/src/main/org/jboss/portal/core/portlet/test/URLPortlet.java
===================================================================
--- trunk/core-samples/src/main/org/jboss/portal/core/portlet/test/URLPortlet.java (rev 0)
+++ trunk/core-samples/src/main/org/jboss/portal/core/portlet/test/URLPortlet.java 2007-01-22 20:55:54 UTC (rev 6069)
@@ -0,0 +1,118 @@
+/******************************************************************************
+ * 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.test;
+
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.GenericPortlet;
+import javax.portlet.PortletException;
+import javax.portlet.PortletURL;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.util.Enumeration;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public class URLPortlet extends GenericPortlet
+{
+ public void processAction(ActionRequest req, ActionResponse resp) throws PortletException, IOException
+ {
+ for (Enumeration e = req.getParameterNames(); e.hasMoreElements();)
+ {
+ String name = (String)e.nextElement();
+ String value = req.getParameter(name);
+ if (!"name".equals(name) && !"value".equals(name))
+ {
+ resp.setRenderParameter(name, value);
+ }
+ }
+ String name = req.getParameter("name");
+ String value = req.getParameter("value");
+ if (name != null && value != null)
+ {
+ resp.setRenderParameter(name, value);
+ }
+ }
+
+ public void render(RenderRequest req, RenderResponse resp) throws PortletException, IOException
+ {
+ String color = req.getParameter("color");
+ if (color == null)
+ {
+ color = "white";
+ }
+
+ resp.setContentType("text/html");
+ PrintWriter writer = resp.getWriter();
+
+ //
+ PortletURL renderURL = resp.createRenderURL();
+
+ //
+ renderURL.setParameter("color", "blue");
+ String blueURL = renderURL.toString();
+
+ //
+ renderURL.setParameter("color", "red");
+ String redURL = renderURL.toString();
+
+ //
+ renderURL.setParameter("color", "white");
+ String whiteURL = renderURL.toString();
+
+ //
+ writer.print("<a href=\"" + blueURL + "\">blue</a> -");
+ writer.print("<a href=\"" + redURL + "\">red</a> -");
+ writer.print("<a href=\"" + whiteURL + "\">white</a><br/>");
+
+ //
+// PortletURL actionURL = resp.createActionURL();
+ writer.print("Parameters :<br/>");
+ writer.print("<table bgcolor=\"" + color + "\">");
+ writer.print("<tr><td>Name</td><td>value</td></tr>");
+ for (Enumeration e = req.getParameterNames(); e.hasMoreElements();)
+ {
+ String name = (String)e.nextElement();
+ String value = req.getParameter(name);
+ writer.print("<tr><td>" + name + "</td><td>" + value + "</td></tr>");
+// actionURL.setParameter(name, value);
+ }
+ writer.print("</table>");
+/*
+ writer.print("<form action=\"" + actionURL.toString() + "\" method=\"post\">");
+ writer.print("<input type=\"text\" name=\"name\"/>");
+ writer.print("<input type=\"text\" name=\"value\"/>");
+ writer.print("<input type=\"submit\" value=\"add\"/>");
+ writer.print("</form>");
+*/
+
+ //
+ writer.print("<a href=\"" + req.getContextPath() + "/test.txt\">test</a>");
+
+ writer.close();
+ }
+}
\ No newline at end of file
Property changes on: trunk/core-samples/src/main/org/jboss/portal/core/portlet/test/URLPortlet.java
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/core-samples/src/main/org/jboss/portal/core/portlet/test/event/PortletA.java
===================================================================
--- trunk/core-samples/src/main/org/jboss/portal/core/portlet/test/event/PortletA.java (rev 0)
+++ trunk/core-samples/src/main/org/jboss/portal/core/portlet/test/event/PortletA.java 2007-01-22 20:55:54 UTC (rev 6069)
@@ -0,0 +1,53 @@
+/******************************************************************************
+ * 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.test.event;
+
+import javax.portlet.GenericPortlet;
+import javax.portlet.PortletException;
+import javax.portlet.PortletSecurityException;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import java.io.IOException;
+import java.io.PrintWriter;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public class PortletA extends GenericPortlet
+{
+ protected void doView(RenderRequest request, RenderResponse response) throws PortletException, PortletSecurityException, IOException
+ {
+ response.setContentType("text/html");
+ PrintWriter writer = response.getWriter();
+ writer.println("<form action=\"" + response.createActionURL() + "\" method=\"post\">");
+ writer.println("<select name=\"color\">");
+ writer.println("<option>blue</option>");
+ writer.println("<option>red</option>");
+ writer.println("<option>black</option>");
+ writer.println("</select>");
+ writer.println("<input type=\"submit\"/>");
+ writer.println("</form>");
+ writer.close();
+ }
+}
Property changes on: trunk/core-samples/src/main/org/jboss/portal/core/portlet/test/event/PortletA.java
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/core-samples/src/main/org/jboss/portal/core/portlet/test/event/PortletB.java
===================================================================
--- trunk/core-samples/src/main/org/jboss/portal/core/portlet/test/event/PortletB.java (rev 0)
+++ trunk/core-samples/src/main/org/jboss/portal/core/portlet/test/event/PortletB.java 2007-01-22 20:55:54 UTC (rev 6069)
@@ -0,0 +1,108 @@
+/******************************************************************************
+ * 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.test.event;
+
+import org.jboss.portal.WindowState;
+import org.jboss.portal.api.node.PortalNode;
+import org.jboss.portal.api.node.event.PortalNodeEvent;
+import org.jboss.portal.api.node.event.PortalNodeEventContext;
+import org.jboss.portal.api.node.event.PortalNodeEventListener;
+import org.jboss.portal.api.node.event.WindowActionEvent;
+
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.GenericPortlet;
+import javax.portlet.PortletException;
+import javax.portlet.PortletSecurityException;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import java.io.IOException;
+import java.io.PrintWriter;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public class PortletB extends GenericPortlet
+{
+
+ public void processAction(ActionRequest request, ActionResponse response) throws PortletException, PortletSecurityException, IOException
+ {
+ String color = request.getParameter("color");
+ if (color != null)
+ {
+ response.setRenderParameter("color", color);
+ }
+ }
+
+ protected void doView(RenderRequest request, RenderResponse response) throws PortletException, PortletSecurityException, IOException
+ {
+ String color = request.getParameter("color");
+ response.setContentType("text/html");
+ PrintWriter writer = response.getWriter();
+ writer.println("<div" +
+ (color == null ? "" : " style=\"color:" + color + ";\"") +
+ ">some text in color</div>");
+ writer.close();
+ }
+
+ public static class Listener implements PortalNodeEventListener
+ {
+ public PortalNodeEvent onEvent(PortalNodeEventContext context, PortalNodeEvent event)
+ {
+ PortalNode node = event.getNode();
+
+ // Get node name
+ String nodeName = node.getName();
+
+ // See if we need to create a new event or not
+ WindowActionEvent newEvent = null;
+ if (nodeName.equals("PortletAWindow") && event instanceof WindowActionEvent)
+ {
+ // Find window B
+ WindowActionEvent wae = (WindowActionEvent)event;
+ PortalNode windowB = node.resolve("../PortletBWindow");
+ if (windowB != null)
+ {
+ // We can redirect
+ newEvent = new WindowActionEvent(windowB);
+ newEvent.setMode(wae.getMode());
+ newEvent.setWindowState(WindowState.MAXIMIZED);
+ newEvent.setParameters(wae.getParameters());
+ }
+ }
+
+ //
+ if (newEvent != null)
+ {
+ // If we have a new event redirect to it
+ return newEvent;
+ }
+ else
+ {
+ // Otherwise bubble up
+ return context.dispatch();
+ }
+ }
+ }
+}
Property changes on: trunk/core-samples/src/main/org/jboss/portal/core/portlet/test/event/PortletB.java
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/core-samples/src/main/org/jboss/portal/core/portlet/test/event/WindowConstraintEventListener.java
===================================================================
--- trunk/core-samples/src/main/org/jboss/portal/core/portlet/test/event/WindowConstraintEventListener.java (rev 0)
+++ trunk/core-samples/src/main/org/jboss/portal/core/portlet/test/event/WindowConstraintEventListener.java 2007-01-22 20:55:54 UTC (rev 6069)
@@ -0,0 +1,254 @@
+/******************************************************************************
+ * 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.test.event;
+
+import org.jboss.portal.api.node.event.PortalNodeEventListener;
+import org.jboss.portal.api.node.event.PortalNodeEvent;
+import org.jboss.portal.api.node.event.PortalNodeEventContext;
+import org.jboss.portal.api.node.event.PageRenderEvent;
+import org.jboss.portal.api.node.event.WindowNavigationEvent;
+import org.jboss.portal.api.node.PortalNode;
+import org.jboss.portal.theme.ThemeConstants;
+import org.jboss.portal.spi.NavigationalStateContext;
+import org.jboss.portal.WindowState;
+
+import java.util.Map;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.SortedMap;
+import java.util.TreeMap;
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class WindowConstraintEventListener implements PortalNodeEventListener
+{
+
+ public PortalNodeEvent onEvent(PortalNodeEventContext context, PortalNodeEvent event)
+ {
+ if (event instanceof PageRenderEvent)
+ {
+ PortalNode targetPage = event.getNode();
+ WindowManipulator manipulator = new WindowManipulator(context.getNavigationalStateContext(), targetPage);
+
+ // Filter window state for normal and minimized
+ for (Iterator i = manipulator.getRegionNames().iterator();i.hasNext();)
+ {
+ boolean foundNormal = false;
+ PortalNode firstWindow = null;
+ String regionName = (String)i.next();
+ for (Iterator j = manipulator.getWindows(regionName).iterator();j.hasNext();)
+ {
+ PortalNode window = (PortalNode)j.next();
+
+ // Keep a ref on first window which can be used later
+ if (firstWindow == null)
+ {
+ firstWindow = window;
+ }
+
+ //
+ WindowState ws = manipulator.getWindowState(window);
+ if (WindowState.NORMAL.equals(ws))
+ {
+ if (foundNormal)
+ {
+ manipulator.setWindowState(window, WindowState.MINIMIZED);
+ }
+ else
+ {
+ foundNormal = true;
+ }
+ }
+ else if (WindowState.MINIMIZED.equals(ws))
+ {
+ //
+ }
+ else
+ {
+ manipulator.setWindowState(window, WindowState.MINIMIZED);
+ }
+ }
+
+ //
+ if (foundNormal == false && firstWindow != null)
+ {
+ manipulator.setWindowState(firstWindow, WindowState.NORMAL);
+ }
+ }
+ }
+ else if (event instanceof WindowNavigationEvent)
+ {
+ WindowNavigationEvent wne = (WindowNavigationEvent)event;
+ PortalNode targetWindow = event.getNode();
+ WindowManipulator manipulator = new WindowManipulator(context.getNavigationalStateContext(), targetWindow.getParent());
+
+ //
+ WindowState ws = wne.getWindowState();
+
+ //
+ if (WindowState.NORMAL.equals(ws))
+ {
+ String regionName = manipulator.getRegionName(targetWindow);
+ if (regionName != null)
+ {
+ for (Iterator i = manipulator.getWindows(regionName).iterator();i.hasNext();)
+ {
+ PortalNode currentWindow = (PortalNode)i.next();
+ if (currentWindow.equals(targetWindow))
+ {
+ // Do nothing
+ }
+ else
+ {
+ manipulator.setWindowState(currentWindow, WindowState.MINIMIZED);
+ }
+ }
+ }
+ }
+ else if (WindowState.MINIMIZED.equals(ws))
+ {
+ String regionName = manipulator.getRegionName(targetWindow);
+ if (regionName != null)
+ {
+ // Find the window following the minimized one
+ PortalNode nextWindow = null;
+ for (Iterator i = manipulator.getWindows(regionName).iterator();i.hasNext();)
+ {
+ PortalNode currentWindow = (PortalNode)i.next();
+
+ // Keep a ref on the first window for later use
+ if (nextWindow == null)
+ {
+ nextWindow = currentWindow;
+ }
+
+ //
+ if (currentWindow.equals(targetWindow))
+ {
+ // Try to get the next window otherwise it means it's the last window
+ // and we'll use the window we saved at the first iteration
+ if (i.hasNext())
+ {
+ nextWindow = (PortalNode)i.next();
+ }
+
+ //
+ break;
+ }
+ }
+
+ // Normalize the next window
+ if (nextWindow != null)
+ {
+ manipulator.setWindowState(nextWindow, WindowState.NORMAL);
+ }
+ }
+ }
+ }
+ return context.dispatch();
+ }
+
+ public class WindowManipulator
+ {
+
+ /** . */
+ private Map regionMap;
+
+ /** . */
+ private NavigationalStateContext nsContext;
+
+ public WindowManipulator(NavigationalStateContext nsContext, PortalNode parent)
+ {
+ this.nsContext = nsContext;
+
+ // Build appropriate structure
+ regionMap = new HashMap();
+ for (Iterator i = parent.getChildren().iterator();i.hasNext();)
+ {
+ try
+ {
+ PortalNode object = (PortalNode)i.next();
+ if (object.getType() == PortalNode.TYPE_WINDOW)
+ {
+ String region = (String)object.getProperties().get(ThemeConstants.PORTAL_PROP_REGION);
+ Integer order = new Integer((String)object.getProperties().get(ThemeConstants.PORTAL_PROP_ORDER));
+
+ //
+ SortedMap windowMap = (SortedMap)regionMap.get(region);
+ if (windowMap == null)
+ {
+ windowMap = new TreeMap();
+ regionMap.put(region, windowMap);
+ }
+ windowMap.put(order, object);
+ }
+ }
+ catch (NumberFormatException ignore)
+ {
+ }
+ }
+ }
+
+ public String getRegionName(PortalNode window)
+ {
+ for (Iterator i = regionMap.entrySet().iterator();i.hasNext();)
+ {
+ Map.Entry entry = (Map.Entry)i.next();
+ SortedMap windows = (SortedMap)entry.getValue();
+ for (Iterator j = windows.values().iterator();j.hasNext();)
+ {
+ PortalNode window2 = (PortalNode)j.next();
+ if (window.equals(window2))
+ {
+ return (String)entry.getKey();
+ }
+ }
+ }
+ return null;
+ }
+
+ public Set getRegionNames()
+ {
+ return regionMap.keySet();
+ }
+
+ public Collection getWindows(String regionName)
+ {
+ return ((Map)regionMap.get(regionName)).values();
+ }
+
+ public WindowState getWindowState(PortalNode window)
+ {
+ return nsContext.getWindowState(window);
+ }
+
+ public void setWindowState(PortalNode window, WindowState windowState)
+ {
+ nsContext.setWindowState(window, windowState);
+ }
+ }
+}
Added: trunk/core-samples/src/resources/portal-samples-sar/META-INF/jboss-service.xml
===================================================================
--- trunk/core-samples/src/resources/portal-samples-sar/META-INF/jboss-service.xml (rev 0)
+++ trunk/core-samples/src/resources/portal-samples-sar/META-INF/jboss-service.xml 2007-01-22 20:55:54 UTC (rev 6069)
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ 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>
+
+ <!-- A sample listener -->
+ <mbean
+ code="org.jboss.portal.core.event.PortalEventListenerServiceImpl"
+ name="portal:service=ListenerService,type=test_listener"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <depends
+ optional-attribute-name="Registry"
+ proxy-type="attribute">portal:service=ListenerRegistry</depends>
+ <attribute name="RegistryId">test_listener</attribute>
+ <attribute name="ListenerClassName">org.jboss.portal.core.portlet.test.event.PortletB$Listener</attribute>
+ </mbean>
+ <mbean
+ code="org.jboss.portal.core.event.PortalEventListenerServiceImpl"
+ name="portal:service=ListenerService,type=window_listener"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <depends
+ optional-attribute-name="Registry"
+ proxy-type="attribute">portal:service=ListenerRegistry</depends>
+ <attribute name="RegistryId">window_event_listener</attribute>
+ <attribute name="ListenerClassName">org.jboss.portal.core.portlet.test.event.WindowConstraintEventListener</attribute>
+ </mbean>
+
+</server>
Added: trunk/core-samples/src/resources/portal-samples-war/WEB-INF/classes/NewsResource.properties
===================================================================
--- trunk/core-samples/src/resources/portal-samples-war/WEB-INF/classes/NewsResource.properties (rev 0)
+++ trunk/core-samples/src/resources/portal-samples-war/WEB-INF/classes/NewsResource.properties 2007-01-22 20:55:54 UTC (rev 6069)
@@ -0,0 +1,25 @@
+################################################################################
+# 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. #
+################################################################################
+
+javax.portlet.preference.description.RssXml=RSS feed URL
+javax.portlet.preference.description.expires=Expiration time
Property changes on: trunk/core-samples/src/resources/portal-samples-war/WEB-INF/classes/NewsResource.properties
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/core-samples/src/resources/portal-samples-war/WEB-INF/classes/NewsResource_fr.properties
===================================================================
--- trunk/core-samples/src/resources/portal-samples-war/WEB-INF/classes/NewsResource_fr.properties (rev 0)
+++ trunk/core-samples/src/resources/portal-samples-war/WEB-INF/classes/NewsResource_fr.properties 2007-01-22 20:55:54 UTC (rev 6069)
@@ -0,0 +1,25 @@
+################################################################################
+# 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. #
+################################################################################
+
+javax.portlet.preference.description.RssXml=URL du flux RSS
+javax.portlet.preference.description.expires=Temps d'expiration
Property changes on: trunk/core-samples/src/resources/portal-samples-war/WEB-INF/classes/NewsResource_fr.properties
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/core-samples/src/resources/portal-samples-war/WEB-INF/default-object.xml
===================================================================
--- trunk/core-samples/src/resources/portal-samples-war/WEB-INF/default-object.xml (rev 0)
+++ trunk/core-samples/src/resources/portal-samples-war/WEB-INF/default-object.xml 2007-01-22 20:55:54 UTC (rev 6069)
@@ -0,0 +1,273 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ 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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<deployments>
+ <deployment>
+ <parent-ref>default</parent-ref>
+ <if-exists>keep</if-exists>
+ <page>
+ <page-name>Test</page-name>
+ <properties>
+ <property>
+ <name>theme.ajax.object_disabled</name>
+ <value>true</value>
+ </property>
+ <property>
+ <name>order</name>
+ <value>3</value>
+ </property>
+ </properties>
+ <window>
+ <window-name>TestPortletWindow</window-name>
+ <instance-ref>TestPortletInstance</instance-ref>
+ <region>center</region>
+ <height>0</height>
+ </window>
+ <window>
+ <window-name>CatalogPortletWindow</window-name>
+ <instance-ref>CatalogPortletInstance</instance-ref>
+ <region>left</region>
+ <height>0</height>
+ </window>
+ <page>
+ <page-name>event test</page-name>
+ <listener>event_listener</listener>
+ <window>
+ <window-name>CatalogPortletWindow</window-name>
+ <instance-ref>CatalogPortletInstance</instance-ref>
+ <region>left</region>
+ <height>0</height>
+ </window>
+ <window>
+ <window-name>PortletAWindow</window-name>
+ <instance-ref>PortletAInstance</instance-ref>
+ <region>center</region>
+ <height>0</height>
+ </window>
+ <window>
+ <window-name>PortletBWindow</window-name>
+ <instance-ref>PortletBInstance</instance-ref>
+ <region>center</region>
+ <height>1</height>
+ </window>
+ </page>
+ <page>
+ <page-name>page event test</page-name>
+ <listener>window_event_listener</listener>
+ <window>
+ <window-name>CatalogPortletWindow1</window-name>
+ <instance-ref>CatalogPortletInstance</instance-ref>
+ <region>left</region>
+ <height>0</height>
+ </window>
+ <window>
+ <window-name>CatalogPortletWindow2</window-name>
+ <instance-ref>CatalogPortletInstance</instance-ref>
+ <region>left</region>
+ <height>1</height>
+ </window>
+ <window>
+ <window-name>CatalogPortletWindow3</window-name>
+ <instance-ref>CatalogPortletInstance</instance-ref>
+ <region>left</region>
+ <height>2</height>
+ </window>
+ <window>
+ <window-name>CatalogPortletWindow4</window-name>
+ <instance-ref>CatalogPortletInstance</instance-ref>
+ <region>center</region>
+ <height>0</height>
+ </window>
+ <window>
+ <window-name>CatalogPortletWindow5</window-name>
+ <instance-ref>CatalogPortletInstance</instance-ref>
+ <region>center</region>
+ <height>1</height>
+ </window>
+ <window>
+ <window-name>CatalogPortletWindow6</window-name>
+ <instance-ref>CatalogPortletInstance</instance-ref>
+ <region>center</region>
+ <height>2</height>
+ </window>
+ </page>
+ <page>
+ <page-name>secure test</page-name>
+ <window>
+ <window-name>CatalogPortletWindow</window-name>
+ <instance-ref>CatalogPortletInstance</instance-ref>
+ <region>left</region>
+ <height>0</height>
+ </window>
+ <window>
+ <window-name>SecuredTestPortletWindow</window-name>
+ <instance-ref>SecuredTestPortletInstance</instance-ref>
+ <region>center</region>
+ <height>0</height>
+ </window>
+ </page>
+ <page>
+ <page-name>exception test</page-name>
+ <window>
+ <window-name>CatalogPortletWindow</window-name>
+ <instance-ref>CatalogPortletInstance</instance-ref>
+ <region>left</region>
+ <height>0</height>
+ </window>
+ <window>
+ <window-name>ExceptionPortletWindow</window-name>
+ <instance-ref>ExceptionPortletInstance</instance-ref>
+ <region>center</region>
+ <height>0</height>
+ </window>
+ </page>
+ <page>
+ <page-name>cache test</page-name>
+ <window>
+ <window-name>CatalogPortletWindow</window-name>
+ <instance-ref>CatalogPortletInstance</instance-ref>
+ <region>left</region>
+ <height>0</height>
+ </window>
+ <window>
+ <window-name>CachedCounterPortletWindow</window-name>
+ <instance-ref>CachedCounterPortletInstance</instance-ref>
+ <region>center</region>
+ <height>0</height>
+ </window>
+ <window>
+ <window-name>CounterPortletWindow</window-name>
+ <instance-ref>CounterPortletInstance</instance-ref>
+ <region>center</region>
+ <height>1</height>
+ </window>
+ </page>
+ <page>
+ <page-name>session test</page-name>
+ <window>
+ <window-name>CatalogPortletWindow</window-name>
+ <instance-ref>CatalogPortletInstance</instance-ref>
+ <region>left</region>
+ <height>0</height>
+ </window>
+ <window>
+ <window-name>PortletSessionPortletWindow</window-name>
+ <instance-ref>PortletSessionPortletInstance</instance-ref>
+ <region>center</region>
+ <height>0</height>
+ </window>
+ </page>
+ <page>
+ <page-name>missing portlet</page-name>
+ <window>
+ <window-name>CatalogPortletWindow</window-name>
+ <instance-ref>CatalogPortletInstance</instance-ref>
+ <region>left</region>
+ <height>0</height>
+ </window>
+ <window>
+ <window-name>MissingPortletWindow</window-name>
+ <instance-ref>MissingPortletInstance</instance-ref>
+ <region>center</region>
+ <height>0</height>
+ </window>
+ </page>
+ <page>
+ <page-name>URL portlet</page-name>
+ <window>
+ <window-name>CatalogPortletWindow</window-name>
+ <instance-ref>CatalogPortletInstance</instance-ref>
+ <region>left</region>
+ <height>0</height>
+ </window>
+ <window>
+ <window-name>URLPortletWindow</window-name>
+ <instance-ref>URLPortletInstance</instance-ref>
+ <region>center</region>
+ <height>0</height>
+ </window>
+ </page>
+ <page>
+ <page-name>missing instance</page-name>
+ <window>
+ <window-name>CatalogPortletWindow</window-name>
+ <instance-ref>CatalogPortletInstance</instance-ref>
+ <region>left</region>
+ <height>0</height>
+ </window>
+ <window>
+ <window-name>MissingInstanceWindow</window-name>
+ <instance-ref>MissingInstance</instance-ref>
+ <region>center</region>
+ <height>0</height>
+ </window>
+ </page>
+ <page>
+ <page-name>charset test</page-name>
+ <window>
+ <window-name>CatalogPortletWindow</window-name>
+ <instance-ref>CatalogPortletInstance</instance-ref>
+ <region>left</region>
+ <height>0</height>
+ </window>
+ <window>
+ <window-name>CharsetPortletWindow</window-name>
+ <instance-ref>CharsetPortletInstance</instance-ref>
+ <region>center</region>
+ <height>0</height>
+ </window>
+ </page>
+ <page>
+ <page-name>encoding test</page-name>
+ <window>
+ <window-name>CatalogPortletWindow</window-name>
+ <instance-ref>CatalogPortletInstance</instance-ref>
+ <region>left</region>
+ <height>0</height>
+ </window>
+ <window>
+ <window-name>EncodingPortletWindow</window-name>
+ <instance-ref>EncodingPortletInstance</instance-ref>
+ <region>center</region>
+ <height>0</height>
+ </window>
+ </page>
+ <page>
+ <page-name>header test</page-name>
+ <window>
+ <window-name>CatalogPortletWindow</window-name>
+ <instance-ref>CatalogPortletInstance</instance-ref>
+ <region>left</region>
+ <height>0</height>
+ </window>
+ <window>
+ <window-name>HeaderContentPortletWindow</window-name>
+ <instance-ref>HeaderContentPortletInstance</instance-ref>
+ <region>center</region>
+ <height>0</height>
+ </window>
+ </page>
+ </page>
+ </deployment>
+</deployments>
Property changes on: trunk/core-samples/src/resources/portal-samples-war/WEB-INF/default-object.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/core-samples/src/resources/portal-samples-war/WEB-INF/jboss-app.xml
===================================================================
--- trunk/core-samples/src/resources/portal-samples-war/WEB-INF/jboss-app.xml (rev 0)
+++ trunk/core-samples/src/resources/portal-samples-war/WEB-INF/jboss-app.xml 2007-01-22 20:55:54 UTC (rev 6069)
@@ -0,0 +1,26 @@
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ 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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<jboss-app>
+ <app-name>samples</app-name>
+</jboss-app>
\ No newline at end of file
Property changes on: trunk/core-samples/src/resources/portal-samples-war/WEB-INF/jboss-app.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/core-samples/src/resources/portal-samples-war/WEB-INF/jboss-portlet.xml
===================================================================
--- trunk/core-samples/src/resources/portal-samples-war/WEB-INF/jboss-portlet.xml (rev 0)
+++ trunk/core-samples/src/resources/portal-samples-war/WEB-INF/jboss-portlet.xml 2007-01-22 20:55:54 UTC (rev 6069)
@@ -0,0 +1,146 @@
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ 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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<portlet-app>
+ <remotable>true</remotable>
+ <portlet>
+ <portlet-name>PortletSessionPortlet</portlet-name>
+ <session-config>
+ <distributed>true</distributed>
+ </session-config>
+ </portlet>
+ <portlet>
+ <portlet-name>HeaderContentPortlet</portlet-name>
+ <remotable>false</remotable>
+ <header-content>
+ <link rel="stylesheet" type="text/css" href="/portlet-styles/HeaderContent.css" title="" media="screen"/>
+ <script type="text/javascript" src="/portlet-styles/HeaderContent.js"/>
+ <meta name="description" content="test"/>
+ </header-content>
+ </portlet>
+
+ <!--All portlets we want to expose in WSRP Producer must be mentioned here-->
+ <portlet>
+ <portlet-name>CounterPortlet</portlet-name>
+ </portlet>
+ <portlet>
+ <portlet-name>CachedCounterPortlet</portlet-name>
+ </portlet>
+ <portlet>
+ <portlet-name>ExceptionPortlet</portlet-name>
+ </portlet>
+ <portlet>
+ <portlet-name>PortletB</portlet-name>
+ </portlet>
+ <portlet>
+ <portlet-name>CharsetPortlet</portlet-name>
+ </portlet>
+ <portlet>
+ <portlet-name>EncodingPortlet</portlet-name>
+ </portlet>
+ <portlet>
+ <portlet-name>SecuredTestPortlet</portlet-name>
+ </portlet>
+ <portlet>
+ <portlet-name>ContentRewritePortlet</portlet-name>
+ </portlet>
+ <portlet>
+ <portlet-name>HintPortlet</portlet-name>
+ </portlet>
+ <portlet>
+ <portlet-name>WsrpSelectorTestPortlet</portlet-name>
+ </portlet>
+ <portlet>
+ <portlet-name>ThemeSelectorPortlet</portlet-name>
+ </portlet>
+ <portlet>
+ <portlet-name>WeatherPortlet</portlet-name>
+ </portlet>
+ <portlet>
+ <portlet-name>NewsPortlet</portlet-name>
+ </portlet>
+ <portlet>
+ <portlet-name>JSPPortlet</portlet-name>
+ </portlet>
+ <portlet>
+ <portlet-name>TestPortlet</portlet-name>
+ </portlet>
+ <portlet>
+ <portlet-name>URLPortlet</portlet-name>
+ </portlet>
+ <portlet>
+ <portlet-name>BasicPortlet</portlet-name>
+ </portlet>
+
+ <!-- Service injected in the portlet context. -->
+ <service>
+ <service-name>WebAppRegistry</service-name>
+ <service-class>org.jboss.portal.portlet.container.PortletApplicationRegistry</service-class>
+ <service-ref>:service=WebAppRegistry</service-ref>
+ </service>
+ <service>
+ <service-name>PortalObjectContainer</service-name>
+ <service-class>org.jboss.portal.core.model.portal.PortalObjectContainer</service-class>
+ <service-ref>:container=PortalObject</service-ref>
+ </service>
+ <service>
+ <service-name>InstanceContainer</service-name>
+ <service-class>org.jboss.portal.core.model.instance.InstanceContainer</service-class>
+ <service-ref>:container=Instance</service-ref>
+ </service>
+ <service>
+ <service-name>ThemeService</service-name>
+ <service-class>org.jboss.portal.theme.ThemeService</service-class>
+ <service-ref>:service=ThemeService</service-ref>
+ </service>
+ <service>
+ <service-name>LayoutService</service-name>
+ <service-class>org.jboss.portal.theme.LayoutService</service-class>
+ <service-ref>:service=LayoutService</service-ref>
+ </service>
+ <service>
+ <service-name>UserModule</service-name>
+ <service-class>org.jboss.portal.identity.UserModule</service-class>
+ <service-ref>:service=Module,type=User</service-ref>
+ </service>
+ <service>
+ <service-name>RoleModule</service-name>
+ <service-class>org.jboss.portal.identity.RoleModule</service-class>
+ <service-ref>:service=Module,type=Role</service-ref>
+ </service>
+ <service>
+ <service-name>UserProfileModule</service-name>
+ <service-class>org.jboss.portal.identity.UserProfileModule</service-class>
+ <service-ref>:service=Module,type=UserProfile</service-ref>
+ </service>
+ <service>
+ <service-name>MembershipModule</service-name>
+ <service-class>org.jboss.portal.identity.MembershipModule</service-class>
+ <service-ref>:service=Module,type=Membership</service-ref>
+ </service>
+ <service>
+ <service-name>MailModule</service-name>
+ <service-class>org.jboss.portal.core.modules.MailModule</service-class>
+ <service-ref>:service=Module,type=Mail</service-ref>
+ </service>
+</portlet-app>
Property changes on: trunk/core-samples/src/resources/portal-samples-war/WEB-INF/jboss-portlet.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/core-samples/src/resources/portal-samples-war/WEB-INF/jsp/info/view.jsp
===================================================================
--- trunk/core-samples/src/resources/portal-samples-war/WEB-INF/jsp/info/view.jsp (rev 0)
+++ trunk/core-samples/src/resources/portal-samples-war/WEB-INF/jsp/info/view.jsp 2007-01-22 20:55:54 UTC (rev 6069)
@@ -0,0 +1,63 @@
+<%@ page import="org.jboss.portal.server.PortalConstants" %>
+<%--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+~ 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. ~
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~--%>
+
+<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %>
+<%@ page isELIgnored="false" %>
+
+<portlet:defineObjects/>
+
+<table border="0" cellspacing="2" cellpadding="2">
+ <tr>
+ <td align="center"><a href="http://portal.demo.jboss.com" target="_blank"><img
+ src="<%= renderRequest.getContextPath() %>/images/dodemo.gif" border="0"
+ alt="Try the latest release of JBoss Portal, live and online."></a>
+ <a href="http://labs.jboss.com/portal/jbossportal/download/index.html" target="_blank"><img
+ src="<%= renderRequest.getContextPath() %>/images/getcode.gif" border="0"
+ alt="Download JBoss Portal and have it up and running in minutes."></a>
+ <a href="http://www.portletswap.com" target="_blank"><img
+ src="<%= renderRequest.getContextPath() %>/images/accessorize.gif" border="0"
+ alt="Download portlets and layouts for your new JBoss Portal installation."></a></td>
+ </tr>
+ <tr>
+ <td></td>
+ </tr>
+ <tr>
+ <td class="portlet-section-alternate">
+ <font class="portlet-font">This is a basic installation of <b><%= PortalConstants.VERSION %></b>. You may
+ log in at any time, using the <i>Login</i> link at the top-right of this page, with the following
+ credentials:</font>
+ </td>
+ </tr>
+ <tr>
+ <td class="portlet-section-alternate" align="center">
+ <b>user/user</b> or <b>admin/admin</b>
+ </td>
+ </tr>
+ <tr>
+ <td align="center">
+ If you are in need of guidance with regards to navigating, configuring, or operating the portal, please view
+ our <a href="http://labs.jboss.com/portal/jbossportal/docs/index.html" target="_blank">online documentation</a>.
+ </td>
+ </tr>
+</table>
Property changes on: trunk/core-samples/src/resources/portal-samples-war/WEB-INF/jsp/info/view.jsp
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/core-samples/src/resources/portal-samples-war/WEB-INF/jsp/news/edit.jsp
===================================================================
--- trunk/core-samples/src/resources/portal-samples-war/WEB-INF/jsp/news/edit.jsp (rev 0)
+++ trunk/core-samples/src/resources/portal-samples-war/WEB-INF/jsp/news/edit.jsp 2007-01-22 20:55:54 UTC (rev 6069)
@@ -0,0 +1,40 @@
+<%--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ 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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~--%>
+
+<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %>
+<%@ page isELIgnored="false" %>
+
+<portlet:defineObjects/>
+
+<div align="center">
+ <br/>
+ <font class="portlet-font">Change News Feed URL:</font>
+
+ <form method="post" action="
+<portlet:actionURL></portlet:actionURL>">
+ <font class="portlet-font">URL:</font><br/>
+ <input class="portlet-form-input-field" type="text" value="" size="12" name="newurl">
+ <br/>
+ <input class="portlet-form-input-field" type="submit" name="submit" value="submit">
+ </form>
+</div>
\ No newline at end of file
Property changes on: trunk/core-samples/src/resources/portal-samples-war/WEB-INF/jsp/news/edit.jsp
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/core-samples/src/resources/portal-samples-war/WEB-INF/jsp/theme/wsrpSelectorTest.jsp
===================================================================
--- trunk/core-samples/src/resources/portal-samples-war/WEB-INF/jsp/theme/wsrpSelectorTest.jsp (rev 0)
+++ trunk/core-samples/src/resources/portal-samples-war/WEB-INF/jsp/theme/wsrpSelectorTest.jsp 2007-01-22 20:55:54 UTC (rev 6069)
@@ -0,0 +1,142 @@
+<%--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ 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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~--%>
+
+<!-- this is static markup to test themes for wsrp css selector support -->
+<div id="wsrp_section_selectors">
+ <table border="0" width="100%" cellpadding="2">
+ <tr>
+ <td class="portlet-section-header">portlet-section-header</td>
+ </tr>
+ <tr>
+ <td class="portlet-section-subheader">portlet-section-subheader</td>
+ </tr>
+ <tr>
+ <td class="portlet-section-body">portlet-section-body</td>
+ </tr>
+ <tr>
+ <td class="portlet-section-text">portlet-section-text</td>
+ </tr>
+ <tr>
+ <td class="portlet-section-alternate">portlet-section-alternate</td>
+ </tr>
+ <tr>
+ <td class="portlet-section-selected">portlet-section-selected</td>
+ </tr>
+ <tr>
+ <td class="portlet-section-footer">portlet-section-footer</td>
+ </tr>
+ </table>
+</div>
+<br><span class="portlet-section-body">portlet-horizontal-seperator:</span><br>
+<hr class="portlet-horizontal-separator">
+<br>
+
+<div id="wsrp_table_selectors">
+ <table border="1" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="portlet-table-header">portlet-table-header</td>
+ </tr>
+ <tr>
+ <td class="portlet-table-subheader">portlet-table-subheader</td>
+ </tr>
+ <tr>
+ <td class="portlet-table-alternate">portlet-table-alternate</td>
+ </tr>
+ <tr>
+ <td class="portlet-table-selected">portlet-table-selected</td>
+ </tr>
+ <tr>
+ <td class="portlet-table-body">portlet-table-body</td>
+ </tr>
+ <tr>
+ <td class="portlet-table-text">portlet-table-text</td>
+ </tr>
+ <tr>
+ <td class="portlet-table-footer">portlet-table-footer</td>
+ </tr>
+ </table>
+</div>
+<br>
+
+<div id="wsrp_form_selectors">
+ <form action="">
+ <fieldset>
+ <legend>A Sample Form:</legend>
+ <table border="0" width="100%" cellpadding="2">
+ <tr>
+ <td class="portlet-form-label" colspan="2">portlet-form-label</td>
+ </tr>
+ <tr>
+ <td class="portlet-form-field-label" width="140px"><label class="portlet-form-field-label"
+ for="text-field">
+ portlet-form-field-label:</label></td>
+ <td align="left"><input type="text" id="text-field" class="portlet-form-input-field"
+ value="portlet-form-input-field" size="50"/></td>
+ </tr>
+ <tr>
+ <td class="portlet-form-field-label" width="140px"><label class="portlet-form-field-label"
+ for="select-control">
+ portlet-form-field-label:</label></td>
+ <td>
+ <select id="select-control" class="portlet-form-field">
+ <option>portlet-form-field</option>
+ <option>
+ Option 2
+ </option>
+ </select>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2"><input type="button" class="portlet-form-button" value="portlet-form-button"/></td>
+ </tr>
+ <tr>
+ <td colspan="2"></td>
+ </tr>
+ </table>
+ </fieldset>
+ </form>
+</div>
+<br>
+
+<div id="wsrp_message_selectors">
+ <table border="0" width="100%" cellpadding="2">
+ <tr>
+ <td class="portlet-msg-status">portlet-msg-status</td>
+ </tr>
+ <tr>
+ <td class="portlet-msg-info">portlet-msg-info</td>
+ </tr>
+ <tr>
+ <td class="portlet-msg-error">portlet-msg-error</td>
+ </tr>
+ <tr>
+ <td class="portlet-msg-alert">portlet-msg-alert</td>
+ </tr>
+ <tr>
+ <td class="portlet-font-dim">portlet-font-dim</td>
+ </tr>
+ <tr>
+ <td class="portlet-font">portlet-font</td>
+ </tr>
+ </table>
+</div>
Property changes on: trunk/core-samples/src/resources/portal-samples-war/WEB-INF/jsp/theme/wsrpSelectorTest.jsp
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/core-samples/src/resources/portal-samples-war/WEB-INF/jsp/weather/edit.jsp
===================================================================
--- trunk/core-samples/src/resources/portal-samples-war/WEB-INF/jsp/weather/edit.jsp (rev 0)
+++ trunk/core-samples/src/resources/portal-samples-war/WEB-INF/jsp/weather/edit.jsp 2007-01-22 20:55:54 UTC (rev 6069)
@@ -0,0 +1,40 @@
+<%--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ 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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~--%>
+
+<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %>
+<%@ page isELIgnored="false" %>
+
+<portlet:defineObjects/>
+
+<div align="center">
+ <br/>
+ <font class="portlet-font">Change Weather Location:</font>
+
+ <form method="post" action="
+<portlet:actionURL></portlet:actionURL>">
+ <font class="portlet-font">Zip Code:</font><br/>
+ <input class="portlet-form-input-field" type="text" value="" size="12" name="newzip">
+ <br/>
+ <input class="portlet-form-input-field" type="submit" name="submit" value="submit">
+ </form>
+</div>
\ No newline at end of file
Property changes on: trunk/core-samples/src/resources/portal-samples-war/WEB-INF/jsp/weather/edit.jsp
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/core-samples/src/resources/portal-samples-war/WEB-INF/portlet-instances.xml
===================================================================
--- trunk/core-samples/src/resources/portal-samples-war/WEB-INF/portlet-instances.xml (rev 0)
+++ trunk/core-samples/src/resources/portal-samples-war/WEB-INF/portlet-instances.xml 2007-01-22 20:55:54 UTC (rev 6069)
@@ -0,0 +1,139 @@
+<?xml version="1.0" standalone="yes"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ 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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<deployments>
+ <deployment>
+ <instance>
+ <instance-id>HeaderContentPortletInstance</instance-id>
+ <portlet-ref>HeaderContentPortlet</portlet-ref>
+ </instance>
+ </deployment>
+ <deployment>
+ <instance>
+ <instance-id>WeatherPortletInstance</instance-id>
+ <portlet-ref>WeatherPortlet</portlet-ref>
+ </instance>
+ </deployment>
+ <deployment>
+ <instance>
+ <instance-id>NewsPortletInstance</instance-id>
+ <portlet-ref>NewsPortlet</portlet-ref>
+ </instance>
+ </deployment>
+ <deployment>
+ <instance>
+ <instance-id>JSPPortletInstance</instance-id>
+ <portlet-ref>JSPPortlet</portlet-ref>
+ </instance>
+ </deployment>
+ <deployment>
+ <instance>
+ <instance-id>URLPortletInstance</instance-id>
+ <portlet-ref>URLPortlet</portlet-ref>
+ </instance>
+ </deployment>
+ <deployment>
+ <if-exists>overwrite</if-exists>
+ <instance>
+ <instance-id>NewsPortletInstance2</instance-id>
+ <portlet-ref>NewsPortlet</portlet-ref>
+ <preferences>
+ <preference>
+ <name>expires</name>
+ <value>180</value>
+ </preference>
+ <preference>
+ <name>RssXml</name>
+ <value>http://finance.yahoo.com/rss/headline?s=rhat</value>
+ </preference>
+ </preferences>
+ </instance>
+ </deployment>
+ <deployment>
+ <instance>
+ <instance-id>TestPortletInstance</instance-id>
+ <portlet-ref>TestPortlet</portlet-ref>
+ </instance>
+ </deployment>
+ <deployment>
+ <instance>
+ <instance-id>PortletAInstance</instance-id>
+ <portlet-ref>PortletA</portlet-ref>
+ </instance>
+ </deployment>
+ <deployment>
+ <instance>
+ <instance-id>PortletBInstance</instance-id>
+ <portlet-ref>PortletB</portlet-ref>
+ </instance>
+ </deployment>
+ <deployment>
+ <instance>
+ <instance-id>SecuredTestPortletInstance</instance-id>
+ <portlet-ref>SecuredTestPortlet</portlet-ref>
+ </instance>
+ </deployment>
+ <deployment>
+ <instance>
+ <instance-id>CharsetPortletInstance</instance-id>
+ <portlet-ref>CharsetPortlet</portlet-ref>
+ </instance>
+ </deployment>
+ <deployment>
+ <instance>
+ <instance-id>CounterPortletInstance</instance-id>
+ <portlet-ref>CounterPortlet</portlet-ref>
+ </instance>
+ </deployment>
+ <deployment>
+ <instance>
+ <instance-id>CachedCounterPortletInstance</instance-id>
+ <portlet-ref>CachedCounterPortlet</portlet-ref>
+ </instance>
+ </deployment>
+ <deployment>
+ <instance>
+ <instance-id>ExceptionPortletInstance</instance-id>
+ <portlet-ref>ExceptionPortlet</portlet-ref>
+ </instance>
+ </deployment>
+ <deployment>
+ <instance>
+ <instance-id>PortletSessionPortletInstance</instance-id>
+ <portlet-ref>PortletSessionPortlet</portlet-ref>
+ </instance>
+ </deployment>
+ <deployment>
+ <instance>
+ <instance-id>CharsetPortletInstance</instance-id>
+ <portlet-ref>CharsetPortlet</portlet-ref>
+ </instance>
+ </deployment>
+ <deployment>
+ <instance>
+ <instance-id>EncodingPortletInstance</instance-id>
+ <portlet-ref>EncodingPortlet</portlet-ref>
+ </instance>
+ </deployment>
+</deployments>
\ No newline at end of file
Property changes on: trunk/core-samples/src/resources/portal-samples-war/WEB-INF/portlet-instances.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/core-samples/src/resources/portal-samples-war/WEB-INF/portlet.xml
===================================================================
--- trunk/core-samples/src/resources/portal-samples-war/WEB-INF/portlet.xml (rev 0)
+++ trunk/core-samples/src/resources/portal-samples-war/WEB-INF/portlet.xml 2007-01-22 20:55:54 UTC (rev 6069)
@@ -0,0 +1,360 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ 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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<portlet-app
+ xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
+ version="1.0">
+ <portlet>
+ <description>Portlet to test modification of head content.</description>
+ <portlet-name>HeaderContentPortlet</portlet-name>
+ <display-name>Header Content Portlet</display-name>
+
+ <portlet-class>org.jboss.portal.core.portlet.plugins.HeaderContentPortlet</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title>Header Content portlet</title>
+ </portlet-info>
+ </portlet>
+ <portlet>
+ <description>This is a test portlet</description>
+ <description xml:lang="fr">C'est une portlet de test</description>
+ <portlet-name>TestPortlet</portlet-name>
+ <display-name>Test Portlet</display-name>
+ <display-name xml:lang="fr">Portlet Test</display-name>
+ <portlet-class>org.jboss.portal.core.portlet.test.TestPortlet</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>VIEW</portlet-mode>
+ <portlet-mode>EDIT</portlet-mode>
+ </supports>
+ <portlet-info>
+ <title>Test portlet</title>
+ </portlet-info>
+ <portlet-preferences>
+ <preference>
+ <name>read-write foo</name>
+ <value>bar</value>
+ </preference>
+ <preference>
+ <name>read-only foo</name>
+ <value>bar</value>
+ <read-only>true</read-only>
+ </preference>
+ <preference>
+ <name>read-write foo[]</name>
+ <value>bar0</value>
+ <value>bar1</value>
+ </preference>
+ <preference>
+ <name>html chars</name>
+ <value><![CDATA[<&>"]]></value>
+ </preference>
+ </portlet-preferences>
+ <security-role-ref>
+ <role-name>Admin</role-name>
+ </security-role-ref>
+ <security-role-ref>
+ <role-name>User</role-name>
+ </security-role-ref>
+ <security-role-ref>
+ <role-name>Authenticated</role-name>
+ </security-role-ref>
+ </portlet>
+ <portlet>
+ <description>Portlet counting and displaying number of it's action/render calls - demonstrating session
+ behaviour</description>
+ <portlet-name>CounterPortlet</portlet-name>
+ <display-name>Counter Portlet</display-name>
+
+ <portlet-class>org.jboss.portal.core.portlet.test.CounterPortlet</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title>Counter portlet</title>
+ </portlet-info>
+ </portlet>
+ <portlet>
+ <description>Counter Portlet with cache support</description>
+ <portlet-name>CachedCounterPortlet</portlet-name>
+ <display-name>Cached Counter Portlet</display-name>
+
+ <portlet-class>org.jboss.portal.core.portlet.test.CounterPortlet</portlet-class>
+ <expiration-cache>60</expiration-cache>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title>Cached Counter portlet</title>
+ </portlet-info>
+ </portlet>
+ <portlet>
+ <description>Portlet for testing behaviour on exceptions</description>
+ <portlet-name>ExceptionPortlet</portlet-name>
+ <display-name>Exception Portlet</display-name>
+
+ <portlet-class>org.jboss.portal.core.portlet.test.ExceptionPortlet</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title>Exception portlet</title>
+ </portlet-info>
+ </portlet>
+ <portlet>
+ <description>Portlet using portlet session - demo purposes</description>
+ <portlet-name>PortletSessionPortlet</portlet-name>
+ <display-name>Porltet Session Portlet</display-name>
+
+ <portlet-class>org.jboss.portal.core.portlet.test.PortletSessionPortlet</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title>Portlet session portlet</title>
+ </portlet-info>
+ </portlet>
+ <portlet>
+ <description>Portlet for demonstrating IPC</description>
+ <portlet-name>PortletA</portlet-name>
+ <display-name>Portlet A</display-name>
+
+ <portlet-class>org.jboss.portal.core.portlet.test.event.PortletA</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>VIEW</portlet-mode>
+ </supports>
+ <portlet-info>
+ <title>Test Event A</title>
+ </portlet-info>
+ </portlet>
+ <portlet>
+ <description>Portlet for demonstrating IPC</description>
+ <portlet-name>PortletB</portlet-name>
+ <display-name>Portlet B</display-name>
+
+ <portlet-class>org.jboss.portal.core.portlet.test.event.PortletB</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>VIEW</portlet-mode>
+ </supports>
+ <portlet-info>
+ <title>Test Event B</title>
+ </portlet-info>
+ </portlet>
+ <portlet>
+ <description>Portlet for testing charset</description>
+ <portlet-name>CharsetPortlet</portlet-name>
+ <display-name>Charset Portlet</display-name>
+
+ <portlet-class>org.jboss.portal.core.portlet.test.CharsetPortlet</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>VIEW</portlet-mode>
+ </supports>
+ <portlet-info>
+ <title>Test charset</title>
+ </portlet-info>
+ </portlet>
+ <portlet>
+ <description>Portlet for testing encoding</description>
+ <portlet-name>EncodingPortlet</portlet-name>
+ <display-name>Encoding Portlet</display-name>
+
+ <portlet-class>org.jboss.portal.core.portlet.test.EncodingPortlet</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>VIEW</portlet-mode>
+ </supports>
+ <portlet-info>
+ <title>Test charset</title>
+ </portlet-info>
+ </portlet>
+ <portlet>
+ <description>Secured Test Portlet</description>
+ <portlet-name>SecuredTestPortlet</portlet-name>
+ <display-name>Secured Test Portlet</display-name>
+
+ <portlet-class>org.jboss.portal.core.portlet.test.TestPortlet</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>VIEW</portlet-mode>
+ <portlet-mode>HELP</portlet-mode>
+ <portlet-mode>EDIT</portlet-mode>
+ </supports>
+ <portlet-info>
+ <title>Secured test portlet</title>
+ </portlet-info>
+ </portlet>
+ <portlet>
+ <description>Portlet providing weather forecast</description>
+ <portlet-name>WeatherPortlet</portlet-name>
+ <display-name>Weather Portlet</display-name>
+
+ <portlet-class>org.jboss.samples.portlet.weather.WeatherPortlet</portlet-class>
+ <init-param>
+ <name>default_zipcode</name>
+ <value>33145</value>
+ </init-param>
+ <init-param>
+ <name>RSS_XSL</name>
+ <value>/WEB-INF/xsl/weather/Rss.xsl</value>
+ </init-param>
+ <init-param>
+ <name>base_url</name>
+ <value>http://xml.weather.yahoo.com/forecastrss?p=</value>
+ </init-param>
+ <expiration-cache>180</expiration-cache>
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>VIEW</portlet-mode>
+ <portlet-mode>EDIT</portlet-mode>
+ </supports>
+ <portlet-info>
+ <title>Weather Portlet</title>
+ </portlet-info>
+ <portlet-preferences>
+ <preference>
+ <name>expires</name>
+ <value>180</value>
+ </preference>
+ <preference>
+ <name>RssXml</name>
+ <value>http://xml.weather.yahoo.com/forecastrss?p=33145</value>
+ <read-only>false</read-only>
+ </preference>
+ </portlet-preferences>
+ </portlet>
+ <portlet>
+ <description>Portlet aggregating news from different feeds</description>
+ <portlet-name>NewsPortlet</portlet-name>
+ <display-name>News Portlet</display-name>
+ <portlet-class>org.jboss.samples.portlet.news.NewsPortlet</portlet-class>
+ <init-param>
+ <name>RSS1_XSL</name>
+ <value>/WEB-INF/Rss1.xsl</value>
+ </init-param>
+ <init-param>
+ <name>RSS2_XSL</name>
+ <value>/WEB-INF/Rss2.xsl</value>
+ </init-param>
+ <init-param>
+ <name>base_url</name>
+ <value>http://jboss.org/jbossBlog/blog/?flavor=rss2</value>
+ </init-param>
+ <expiration-cache>180</expiration-cache>
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>VIEW</portlet-mode>
+ <portlet-mode>EDIT</portlet-mode>
+ </supports>
+ <supported-locale>en</supported-locale>
+ <supported-locale>fr</supported-locale>
+ <resource-bundle>NewsResource</resource-bundle>
+ <portlet-info>
+ <title>News Feeds</title>
+ </portlet-info>
+ <portlet-preferences>
+ <preference>
+ <name>expires</name>
+ <value>180</value>
+ </preference>
+ <preference>
+ <name>RssXml</name>
+ <value>http://jboss.org/jbossBlog/blog/?flavor=rss2</value>
+ <read-only>false</read-only>
+ </preference>
+ </portlet-preferences>
+ </portlet>
+ <portlet>
+ <description>Simple JSP portlet</description>
+ <portlet-name>JSPPortlet</portlet-name>
+ <display-name>JSP Portlet</display-name>
+ <portlet-class>org.jboss.samples.portlet.jsp.JSPPortlet</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>VIEW</portlet-mode>
+ </supports>
+ <portlet-info>
+ <title>Greetings!</title>
+ </portlet-info>
+ </portlet>
+ <portlet>
+ <description>URL Portlet</description>
+ <portlet-name>URLPortlet</portlet-name>
+ <display-name>URL Portlet</display-name>
+ <portlet-class>org.jboss.portal.core.portlet.test.URLPortlet</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>VIEW</portlet-mode>
+ </supports>
+ <portlet-info>
+ <title>URL Portlet</title>
+ </portlet-info>
+ </portlet>
+ <portlet>
+ <portlet-name>BasicPortlet</portlet-name>
+ <portlet-class>org.jboss.portal.core.portlet.test.BasicPortlet</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>VIEW</portlet-mode>
+ </supports>
+ <portlet-info>
+ <title>Basic Portlet</title>
+ </portlet-info>
+ </portlet>
+ <user-attribute>
+ <name>user.name.nickName</name>
+ </user-attribute>
+ <user-attribute>
+ <name>user.business-info.online.email</name>
+ </user-attribute>
+ <user-attribute>
+ <name>user.name.given</name>
+ </user-attribute>
+ <user-attribute>
+ <name>user.name.family</name>
+ </user-attribute>
+ <user-attribute>
+ <name>portal.user.locale</name>
+ </user-attribute>
+ <user-attribute>
+ <name>portal.user.signature</name>
+ </user-attribute>
+ <user-attribute>
+ <name>portal.user.last-login-date</name>
+ </user-attribute>
+ <security-constraint>
+ <portlet-collection>
+ <portlet-name>SecuredTestPortlet</portlet-name>
+ </portlet-collection>
+ <user-data-constraint>
+ <transport-guarantee>CONFIDENTIAL</transport-guarantee>
+ </user-data-constraint>
+ </security-constraint>
+</portlet-app>
Property changes on: trunk/core-samples/src/resources/portal-samples-war/WEB-INF/portlet.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/core-samples/src/resources/portal-samples-war/WEB-INF/web.xml
===================================================================
--- trunk/core-samples/src/resources/portal-samples-war/WEB-INF/web.xml (rev 0)
+++ trunk/core-samples/src/resources/portal-samples-war/WEB-INF/web.xml 2007-01-22 20:55:54 UTC (rev 6069)
@@ -0,0 +1,32 @@
+<?xml version="1.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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<!DOCTYPE web-app PUBLIC
+ "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+ "http://java.sun.com/dtd/web-app_2_3.dtd">
+<web-app>
+ <listener>
+ <listener-class> org.jboss.portal.portlet.session.SessionListener </listener-class>
+ </listener>
+</web-app>
Property changes on: trunk/core-samples/src/resources/portal-samples-war/WEB-INF/web.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/core-samples/src/resources/portal-samples-war/WEB-INF/xsl/news/Rss1.xsl
===================================================================
--- trunk/core-samples/src/resources/portal-samples-war/WEB-INF/xsl/news/Rss1.xsl (rev 0)
+++ trunk/core-samples/src/resources/portal-samples-war/WEB-INF/xsl/news/Rss1.xsl 2007-01-22 20:55:54 UTC (rev 6069)
@@ -0,0 +1,54 @@
+<?xml version="1.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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<xsl:stylesheet
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ version="1.0">
+
+ <xsl:output method="html"/>
+
+ <xsl:template match="/">
+ <TABLE WIDTH="100%" BORDER="0" CELLPADDING="2" CELLSPACING="0">
+ <xsl:apply-templates/>
+ </TABLE>
+ </xsl:template>
+
+ <xsl:template match="item">
+ <TR>
+ <TD>
+ -
+ <A TARGET="_popup" STYLE="text-decoration: none;">
+ <xsl:attribute name="HREF">
+ <xsl:value-of select="link"/>
+ </xsl:attribute>
+ <xsl:value-of select="title"/>
+ </A>
+ </TD>
+ </TR>
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <xsl:template match="text()"/>
+</xsl:stylesheet>
\ No newline at end of file
Property changes on: trunk/core-samples/src/resources/portal-samples-war/WEB-INF/xsl/news/Rss1.xsl
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/core-samples/src/resources/portal-samples-war/WEB-INF/xsl/news/Rss2.xsl
===================================================================
--- trunk/core-samples/src/resources/portal-samples-war/WEB-INF/xsl/news/Rss2.xsl (rev 0)
+++ trunk/core-samples/src/resources/portal-samples-war/WEB-INF/xsl/news/Rss2.xsl 2007-01-22 20:55:54 UTC (rev 6069)
@@ -0,0 +1,54 @@
+<?xml version="1.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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+ <xsl:output method="xml" omit-xml-declaration="yes" indent="yes"/>
+ <xsl:variable name="link-path">
+ <xsl:value-of select="rss/channel/link"/>
+ </xsl:variable>
+ <xsl:template match="/">
+ <div align="center">
+ <a href="{$link-path}" target="_blank">
+ <xsl:value-of select="rss/channel/title"/>
+ </a>
+ </div>
+ <ul>
+ <xsl:for-each select="rss/channel/item">
+ <xsl:variable name="this-link">
+ <xsl:value-of select="link"/>
+ </xsl:variable>
+ <li>
+ <a href="{$this-link}" target="_blank">
+ <xsl:value-of select="title"/>
+ </a>
+ </li>
+ <!-- <xsl:value-of select="description" disable-output-escaping="yes"/>
+ <br/>-->
+ </xsl:for-each>
+ </ul>
+ <br/>
+ <br/>
+ <xsl:value-of select="rss/channel/copyright"/>
+ </xsl:template>
+</xsl:stylesheet>
Property changes on: trunk/core-samples/src/resources/portal-samples-war/WEB-INF/xsl/news/Rss2.xsl
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/core-samples/src/resources/portal-samples-war/WEB-INF/xsl/weather/Rss.xsl
===================================================================
--- trunk/core-samples/src/resources/portal-samples-war/WEB-INF/xsl/weather/Rss.xsl (rev 0)
+++ trunk/core-samples/src/resources/portal-samples-war/WEB-INF/xsl/weather/Rss.xsl 2007-01-22 20:55:54 UTC (rev 6069)
@@ -0,0 +1,100 @@
+<?xml version="1.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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+ <xsl:output method="xml" omit-xml-declaration="yes" indent="yes"/>
+ <xsl:variable name="image-path">http://us.i1.yimg.com/us.yimg.com/i/us/we/52/</xsl:variable>
+ <xsl:variable name="link-path">
+ <xsl:value-of select="rss/channel/link"/>
+ </xsl:variable>
+ <xsl:template match="/">
+ <br/>
+ <div align="center">
+ <font>
+ <b>
+ <xsl:for-each select="rss/channel/location">
+ <xsl:value-of select="@city"/>, <xsl:value-of select="@region"/>, <xsl:value-of
+ select="@country"/>
+ </xsl:for-each>
+ </b>
+ </font>
+ <br/>
+ <br/>
+ <table width="130" border="0">
+ <tr>
+ <xsl:for-each select="rss/channel/item/condition">
+ <td>
+ <table border="0" height="130">
+ <tr>
+ <td class="portlet-section-header" align="center">Currently</td>
+ </tr>
+ <tr>
+ <td class="portlet-section-alternate" align="center" valign="top">
+ <img src="{$image-path}/{(a)code}.gif"/>
+ </td>
+ </tr>
+ <tr>
+ <td class="portlet-section-alternate" align="center" valign="top">
+ <xsl:value-of select="@text"/>
+ </td>
+ </tr>
+ <tr>
+ <td class="portlet-section-alternate" align="center" valign="top">
+ <xsl:value-of select="@temp"/>F</td>
+ </tr>
+ </table>
+ </td>
+ </xsl:for-each>
+ <xsl:for-each select="rss/channel/item/forecast">
+ <td>
+ <table border="0" height="130">
+ <tr>
+ <td class="portlet-section-header" align="center" valign="top">
+ <xsl:value-of select="@day"/>
+ </td>
+ </tr>
+ <tr>
+ <td class="portlet-section-alternate" align="center" valign="top">
+ <img src="{$image-path}/{(a)code}.gif"/>
+ </td>
+ </tr>
+ <tr>
+ <td class="portlet-section-alternate" align="center" valign="top">
+ <xsl:value-of select="@text"/>
+ </td>
+ </tr>
+ <tr>
+ <td class="portlet-section-alternate" align="center" valign="top">
+ <xsl:value-of select="@low"/>F/<xsl:value-of select="@high"/>F</td>
+ </tr>
+ </table>
+ </td>
+ </xsl:for-each>
+ </tr>
+ </table>
+ <br/>
+ <a href="{$link-path}" target="_blank">Complete Forecast</a>
+ </div>
+ </xsl:template>
+</xsl:stylesheet>
Property changes on: trunk/core-samples/src/resources/portal-samples-war/WEB-INF/xsl/weather/Rss.xsl
___________________________________________________________________
Name: svn:executable
+ *
Modified: trunk/identity/src/main/org/jboss/portal/identity/db/HibernateUserModuleImpl.java
===================================================================
--- trunk/identity/src/main/org/jboss/portal/identity/db/HibernateUserModuleImpl.java 2007-01-22 20:08:21 UTC (rev 6068)
+++ trunk/identity/src/main/org/jboss/portal/identity/db/HibernateUserModuleImpl.java 2007-01-22 20:55:54 UTC (rev 6069)
@@ -24,7 +24,6 @@
import org.jboss.portal.identity.User;
import org.jboss.portal.identity.IdentityException;
import org.jboss.portal.identity.NoSuchUserException;
-import org.jboss.portal.identity.db.HibernateUserImpl;
import org.jboss.portal.common.util.Tools;
import org.jboss.portal.identity.service.UserModuleService;
import org.hibernate.SessionFactory;
@@ -37,6 +36,8 @@
import java.util.Set;
import java.util.Iterator;
+import EDU.oswego.cs.dl.util.concurrent.ConcurrentReaderHashMap;
+
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet </a>
* @version $Revision: 5448 $
@@ -46,46 +47,41 @@
{
/** . */
- private static final org.jboss.logging.Logger log = org.jboss.logging.Logger.getLogger(HibernateUserModuleImpl.class);
- /** . */
- protected SessionFactory sessionFactory;
+ private static final org.jboss.logging.Logger log = org.jboss.logging.Logger.getLogger(HibernateUserModuleImpl.class);
- /** . */
- protected String sessionFactoryJNDIName;
+ /** . */
+ protected SessionFactory sessionFactory;
- protected void startService() throws Exception
- {
- //
- sessionFactory = (SessionFactory)new InitialContext().lookup(sessionFactoryJNDIName);
+ /** . */
+ protected String sessionFactoryJNDIName;
- super.startService();
- }
+ protected void startService() throws Exception
+ {
+ //
+ sessionFactory = (SessionFactory)new InitialContext().lookup(sessionFactoryJNDIName);
- protected void stopService() throws Exception
- {
+ super.startService();
+ }
- //
- sessionFactory = null;
+ protected void stopService() throws Exception
+ {
- super.stopService();
- }
+ //
+ sessionFactory = null;
-// public SessionFactory getSessionFactory()
-// {
-// return sessionFactory;
-// }
+ super.stopService();
+ }
- public String getSessionFactoryJNDIName()
- {
- return sessionFactoryJNDIName;
- }
+ public String getSessionFactoryJNDIName()
+ {
+ return sessionFactoryJNDIName;
+ }
- public void setSessionFactoryJNDIName(String sessionFactoryJNDIName)
- {
- this.sessionFactoryJNDIName = sessionFactoryJNDIName;
- }
+ public void setSessionFactoryJNDIName(String sessionFactoryJNDIName)
+ {
+ this.sessionFactoryJNDIName = sessionFactoryJNDIName;
+ }
-
public User findUserByUserName(String userName) throws IdentityException
{
if (userName != null)
17 years, 4 months
JBoss Portal SVN: r6068 - in trunk: core-cms/src/resources/portal-cms-war/WEB-INF/classes and 2 other directories.
by portal-commits@lists.jboss.org
Author: roy.russo(a)jboss.com
Date: 2007-01-22 15:08:21 -0500 (Mon, 22 Jan 2007)
New Revision: 6068
Added:
trunk/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/pending_items.jsp
Modified:
trunk/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminPortlet.java
trunk/core-cms/src/resources/portal-cms-war/WEB-INF/classes/Resource.properties
trunk/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/main.jsp
trunk/workflow/src/main/org/jboss/portal/workflow/cms/ApprovePublish.java
trunk/workflow/src/main/org/jboss/portal/workflow/cms/ApprovePublishImpl.java
Log:
JBPORTAL-1153 - ui for workflows added. modified jbpm accessor methods to retrieve list of all pending items.
Modified: trunk/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminPortlet.java
===================================================================
--- trunk/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminPortlet.java 2007-01-22 19:39:41 UTC (rev 6067)
+++ trunk/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminPortlet.java 2007-01-22 20:08:21 UTC (rev 6068)
@@ -511,6 +511,29 @@
javax.portlet.PortletRequestDispatcher prd = getPortletContext().getRequestDispatcher(CMSAdminConstants.CMS_JSP_PATH + "/securenode.jsp");
prd.include(rReq, rRes);
}
+ else if (CMSAdminConstants.OP_VIEWPENDING.equals(op))
+ {
+ String sPath = rReq.getParameter("path");
+
+ if (this.getApprovePublish() != null)
+ {
+ try
+ {
+ Collection pendingQueue = this.getApprovePublish().getAllPendingInQueue();
+ rReq.setAttribute("pendingQueue", pendingQueue);
+ }
+ catch (WorkflowException we)
+ {
+ rReq.setAttribute("pendingQueue", null);
+ }
+ }
+
+ rRes.setContentType("text/html");
+ rReq.setAttribute("currpath", sPath);
+
+ javax.portlet.PortletRequestDispatcher prd = getPortletContext().getRequestDispatcher(CMSAdminConstants.CMS_JSP_PATH + "/pending_items.jsp");
+ prd.include(rReq, rRes);
+ }
}
public void processAction(final JBossActionRequest aReq, final JBossActionResponse aRes) throws PortletException
Modified: trunk/core-cms/src/resources/portal-cms-war/WEB-INF/classes/Resource.properties
===================================================================
--- trunk/core-cms/src/resources/portal-cms-war/WEB-INF/classes/Resource.properties 2007-01-22 19:39:41 UTC (rev 6067)
+++ trunk/core-cms/src/resources/portal-cms-war/WEB-INF/classes/Resource.properties 2007-01-22 20:08:21 UTC (rev 6068)
@@ -87,4 +87,5 @@
CMS_APPROVE=Approve
CMS_DENY=Deny
CMS_APPROVAL=Pending Items
+CMS_PATH=Location
\ No newline at end of file
Modified: trunk/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/main.jsp
===================================================================
--- trunk/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/main.jsp 2007-01-22 19:39:41 UTC (rev 6067)
+++ trunk/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/main.jsp 2007-01-22 20:08:21 UTC (rev 6068)
@@ -94,6 +94,10 @@
<portlet:param name="path" value="<%= sCurrPath %>"/>
<portlet:param name="returnOp" value="<%= CMSAdminConstants.OP_MAIN %>"/>
</portlet:renderURL>">${n:i18n("CMS_SECURE")}</a></li>
+ <li><a href="<portlet:renderURL>
+ <portlet:param name="op" value="<%= CMSAdminConstants.OP_VIEWPENDING %>"/>
+ <portlet:param name="path" value="<%= sCurrPath %>"/>
+ </portlet:renderURL>">${n:i18n("CMS_APPROVAL")}</a></li>
<%
if (!"/".equals(sCurrPath))
{
@@ -150,7 +154,7 @@
<portlet:param name="op" value="<%= CMSAdminConstants.OP_MAIN %>"/>
<portlet:param name="path" value="<%= folder.getBasePath() %>"/>
</portlet:renderURL>"><%=
- folder.getBasePath().substring(folder.getBasePath().lastIndexOf("/") + 1, folder.getBasePath().length()) %>
+ folder.getBasePath().substring(folder.getBasePath().lastIndexOf("/") + 1, folder.getBasePath().length()) %>
</a>
</td>
<td>
@@ -211,7 +215,7 @@
<portlet:param name="path"
value="<%= file.getBasePath() %>"/>
</portlet:renderURL>"><%=
- file.getBasePath().substring(file.getBasePath().lastIndexOf("/") + 1, file.getBasePath().length()) %>
+ file.getBasePath().substring(file.getBasePath().lastIndexOf("/") + 1, file.getBasePath().length()) %>
</a>
</td>
<td>
Added: trunk/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/pending_items.jsp
===================================================================
--- trunk/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/pending_items.jsp (rev 0)
+++ trunk/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/pending_items.jsp 2007-01-22 20:08:21 UTC (rev 6068)
@@ -0,0 +1,129 @@
+<%@ page language="java" extends="org.jboss.portal.core.servlet.jsp.PortalJsp" %>
+<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %>
+<%@ taglib uri="/WEB-INF/portal-lib.tld" prefix="n" %>
+<%@ page isELIgnored="false" %>
+
+<%@ page import="org.jboss.portal.core.cms.ui.admin.CMSAdminConstants,
+ java.util.Collection" %>
+<%@ page import="java.util.Iterator" %>
+<%@ page import="java.util.StringTokenizer" %>
+
+<portlet:defineObjects/>
+
+<%
+ String sCurrPath = (String)request.getAttribute("currpath");
+ Collection pendingQueue = (Collection)request.getAttribute("pendingQueue");
+
+ String rowClass = "portlet-section-body";
+%>
+
+<br>
+
+${n:i18n("CMS_MAIN_USE")}
+
+<hr/>
+
+<!-- Currently browsing -->
+Browsing: <a href="<portlet:renderURL>
+<portlet:param name="op" value="<%= CMSAdminConstants.OP_MAIN %>"/>
+<portlet:param name="path" value="/"/>
+ </portlet:renderURL>">Home</a>
+<%
+ StringTokenizer parser = new StringTokenizer(sCurrPath, "/");
+ String sPathBuilder = "";
+ while (parser.hasMoreTokens())
+ {
+ String sPathChunk = parser.nextToken();
+ sPathBuilder += "/" + sPathChunk;
+ if (parser.hasMoreTokens())
+ {
+%>
+> <a href="
+<portlet:renderURL>
+ <portlet:param name="op" value="<%= CMSAdminConstants.OP_MAIN %>"/>
+ <portlet:param name="path" value="<%= sPathBuilder %>"/>
+</portlet:renderURL>
+"><%= sPathChunk %>
+</a>
+<%
+}
+else
+{
+%>
+> <%= sPathChunk %>
+<%
+ }
+ }
+%>
+
+<br/><br/>
+
+<div align="center"><font class="portlet-font-dim"><b>Pending Approval Queue</b></font></div>
+<br/>
+<table width="100%" border="0" cellspacing="0" cellpadding="0">
+ <tr>
+ <td class="portlet-table-text"><b>${n:i18n("CMS_PATH")}</b></td>
+ <td class="portlet-table-text"><b>${n:i18n("CMS_TYPE")}</b></td>
+ <td class="portlet-table-text"><b>${n:i18n("CMS_CREATED")}</b></td>
+ <td class="portlet-table-text"><b>${n:i18n("CMS_CREATED_BY")}</b></td>
+ <td class="portlet-table-text"><b>${n:i18n("CMS_ACTION")}</b></td>
+ </tr>
+ <%int i = 0;%>
+ <%
+ for (Iterator itr = pendingQueue.iterator(); itr.hasNext();)
+ {
+ %>
+ <%
+ // TODO: need accessor for approvalpid in Content, for param in links below.
+ // TODO: need security access to get current manager as param for links below.
+ org.jboss.portal.workflow.cms.Content cour = (org.jboss.portal.workflow.cms.Content)itr.next();
+
+ String linkPath = cour.getPath().substring(0, cour.getPath().lastIndexOf("/"));
+
+ if (i % 2 == 0)
+ {
+ rowClass = "portlet-section-body";
+ }
+ else
+ {
+ rowClass = "portlet-section-alternate";
+ }
+ i++;
+ %>
+ <tr class="<%= rowClass %>">
+ <!-- Path -->
+ <td><a href="<portlet:renderURL>
+ <portlet:param name="op" value="<%= CMSAdminConstants.OP_VIEWFILE %>"/>
+ <portlet:param name="path"
+ value="<%= linkPath %>"/>
+ </portlet:renderURL>"><%= linkPath %>
+ </a>
+ </td>
+ <!-- Mime Type -->
+ <td><%= cour.getMimeType() %>
+ </td>
+ <!-- Creation Date -->
+ <td>
+ <%= cour.getCreationDateStr() %>
+ </td>
+ <!-- User who requested approval -->
+ <td><%= cour.getUserName() %>
+ </td>
+ <td>
+ <a href="<portlet:actionURL>
+ <portlet:param name="op" value="<%= CMSAdminConstants.OP_APPROVE %>"/>
+ <portlet:param name="pid" value="TODO"/>
+ <portlet:param name="manager" value="TODO"/>
+ <portlet:param name="path" value="<%= cour.getPath() %>"/>
+ </portlet:actionURL>">${n:i18n("CMS_APPROVE")}</a>
+
+ <a href="<portlet:actionURL>
+ <portlet:param name="op" value="<%= CMSAdminConstants.OP_DENY %>"/>
+ <portlet:param name="pid" value="TODO"/>
+ <portlet:param name="manager" value="TODO"/>
+ <portlet:param name="path" value="<%= cour.getPath() %>"/>
+ </portlet:actionURL>">${n:i18n("CMS_DENY")}</a>
+ </td>
+ </tr>
+ <%}%>
+</table>
\ No newline at end of file
Modified: trunk/workflow/src/main/org/jboss/portal/workflow/cms/ApprovePublish.java
===================================================================
--- trunk/workflow/src/main/org/jboss/portal/workflow/cms/ApprovePublish.java 2007-01-22 19:39:41 UTC (rev 6067)
+++ trunk/workflow/src/main/org/jboss/portal/workflow/cms/ApprovePublish.java 2007-01-22 20:08:21 UTC (rev 6068)
@@ -22,10 +22,10 @@
******************************************************************************/
package org.jboss.portal.workflow.cms;
+import org.jboss.portal.workflow.WorkflowException;
+
import java.util.Collection;
-import org.jboss.portal.workflow.WorkflowException;
-
/**
* Created on : Dec 19, 2006
*
@@ -60,4 +60,12 @@
* @throws WorkflowException
*/
public Collection getPendingQueue(String filePath) throws WorkflowException;
+
+ /**
+ * Retrieves a queue of unapproved content for everything in the CMS.
+ *
+ * @return
+ * @throws WorkflowException
+ */
+ public Collection getAllPendingInQueue() throws WorkflowException;
}
Modified: trunk/workflow/src/main/org/jboss/portal/workflow/cms/ApprovePublishImpl.java
===================================================================
--- trunk/workflow/src/main/org/jboss/portal/workflow/cms/ApprovePublishImpl.java 2007-01-22 19:39:41 UTC (rev 6067)
+++ trunk/workflow/src/main/org/jboss/portal/workflow/cms/ApprovePublishImpl.java 2007-01-22 20:08:21 UTC (rev 6068)
@@ -22,35 +22,30 @@
******************************************************************************/
package org.jboss.portal.workflow.cms;
-import java.io.ByteArrayInputStream;
-import java.io.InputStream;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.ArrayList;
-import java.util.StringTokenizer;
-import java.util.List;
-
-import javax.xml.parsers.DocumentBuilderFactory;
-
import org.apache.log4j.Logger;
-
-import org.jboss.portal.workflow.service.WorkflowService;
-import org.jboss.portal.workflow.WorkflowException;
-
-import org.jboss.portal.jems.as.system.AbstractJBossService;
import org.jboss.portal.common.util.JNDI;
import org.jboss.portal.common.util.Tools;
-
+import org.jboss.portal.jems.as.system.AbstractJBossService;
+import org.jboss.portal.workflow.WorkflowException;
+import org.jboss.portal.workflow.service.WorkflowService;
import org.jbpm.JbpmContext;
+import org.jbpm.db.GraphSession;
import org.jbpm.graph.def.ProcessDefinition;
import org.jbpm.graph.exe.ProcessInstance;
import org.jbpm.graph.exe.Token;
import org.jbpm.taskmgmt.exe.TaskInstance;
-import org.jbpm.db.GraphSession;
-
import org.w3c.dom.Document;
import org.w3c.dom.Element;
+import javax.xml.parsers.DocumentBuilderFactory;
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+import java.util.StringTokenizer;
+
/**
* Created on : Dec 19, 2006
*
@@ -168,132 +163,100 @@
}
}
- /**
- * @return
- */
+ /** @return */
public WorkflowService getWorkflowService()
{
return this.workflowService;
}
- /**
- * @param workflowService
- */
+ /** @param workflowService */
public void setWorkflowService(WorkflowService workflowService)
{
this.workflowService = workflowService;
}
- /**
- * @return
- */
+ /** @return */
public String getProcess()
{
return this.process;
}
- /**
- * @param process
- */
+ /** @param process */
public void setProcess(String process)
{
this.process = process;
}
- /**
- * @return the managerRoles
- */
+ /** @return the managerRoles */
public String getManagerEmails()
{
return managerEmails;
}
- /**
- * @param managerEmails the manager emails to set
- */
+ /** @param managerEmails the manager emails to set */
public void setManagerEmails(String managerEmails)
{
this.managerEmails = managerEmails;
}
- /**
- * @return the overwrite
- */
+ /** @return the overwrite */
public boolean isOverwrite()
{
return overwrite;
}
- /**
- * @param overwrite the overwrite to set
- */
+ /** @param overwrite the overwrite to set */
public void setOverwrite(boolean overwrite)
{
this.overwrite = overwrite;
}
- /**
- * @return
- */
+ /** @return */
public String getJNDIName()
{
return this.jndiName;
}
- /**
- * @param jndiName
- */
+ /** @param jndiName */
public void setJNDIName(String jndiName)
{
this.jndiName = jndiName;
}
- /**
- * @return the body
- */
+ /** @return the body */
public String getBody()
{
return body;
}
- /**
- * @param body the body to set
- */
+ /** @param body the body to set */
public void setBody(String body)
{
this.body = body;
}
- /**
- * @return the from
- */
+ /** @return the from */
public String getFrom()
{
return from;
}
- /**
- * @param from the from to set
- */
+ /** @param from the from to set */
public void setFrom(String from)
{
this.from = from;
}
- /**
- * @return the subject
- */
+ /** @return the subject */
public String getSubject()
{
return subject;
}
- /**
- * @param subject the subject to set
- */
+ /** @param subject the subject to set */
public void setSubject(String subject)
{
this.subject = subject;
@@ -481,4 +444,49 @@
}
return pendingQueue;
}
+
+ /**
+ * Retrieves a queue of unapproved content for everything in the CMS.
+ *
+ * @return
+ * @throws WorkflowException
+ */
+ public Collection getAllPendingInQueue() throws WorkflowException
+ {
+ Collection pendingQueue = new ArrayList();
+ JbpmContext jbpmContext = null;
+ try
+ {
+ jbpmContext = this.workflowService.getJbpmConfiguration().createJbpmContext();
+
+ GraphSession graphSession = jbpmContext.getGraphSession();
+ ProcessDefinition processDef = graphSession.findLatestProcessDefinition(this.processName);
+ List processInstances = graphSession.findProcessInstances(processDef.getId());
+
+ if (processInstances != null)
+ {
+ for (int i = 0; i < processInstances.size(); i++)
+ {
+ ProcessInstance cour = (ProcessInstance)processInstances.get(i);
+ //iterate through a list of currently pending approval tasks
+ if (!cour.hasEnded())
+ {
+ Content content = (Content)cour.getContextInstance().getVariable("content");
+
+ //apply proper criteria to extract pending content only for the specified file
+ if (content != null)
+ {
+ pendingQueue.add(content);
+ }
+ }
+ }
+ }
+ }
+ finally
+ {
+ Tools.safeClose(jbpmContext);
+ }
+ return pendingQueue;
+ }
+
}
17 years, 4 months
JBoss Portal SVN: r6067 - in trunk: api/src/main/org/jboss/portal/api/node and 7 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-01-22 14:39:41 -0500 (Mon, 22 Jan 2007)
New Revision: 6067
Added:
trunk/api/src/main/org/jboss/portal/api/node/event/PageEvent.java
trunk/api/src/main/org/jboss/portal/api/node/event/PageRenderEvent.java
trunk/api/src/main/org/jboss/portal/spi/
trunk/api/src/main/org/jboss/portal/spi/NavigationalStateContext.java
trunk/core/src/main/org/jboss/portal/core/portlet/test/event/WindowConstraintEventListener.java
Removed:
trunk/core/src/main/org/jboss/portal/core/WindowInterceptor.java
Modified:
trunk/api/src/main/org/jboss/portal/api/node/PortalNode.java
trunk/api/src/main/org/jboss/portal/api/node/event/PortalNodeEventContext.java
trunk/api/src/main/org/jboss/portal/api/node/event/WindowEvent.java
trunk/api/src/main/org/jboss/portal/api/node/event/WindowRenderEvent.java
trunk/core/src/main/org/jboss/portal/core/aspects/controller/node/EventBroadcasterInterceptor.java
trunk/core/src/main/org/jboss/portal/core/aspects/controller/node/PortalNodeInterceptor.java
trunk/core/src/main/org/jboss/portal/core/aspects/controller/node/PortalObjectNode.java
trunk/core/src/resources/portal-core-sar/META-INF/jboss-service.xml
trunk/core/src/resources/portal-samples-war/WEB-INF/default-object.xml
Log:
JBPORTAL-1213 : PageRenderEvent which signals when a portal page is rendered
Modified: trunk/api/src/main/org/jboss/portal/api/node/PortalNode.java
===================================================================
--- trunk/api/src/main/org/jboss/portal/api/node/PortalNode.java 2007-01-22 16:24:53 UTC (rev 6066)
+++ trunk/api/src/main/org/jboss/portal/api/node/PortalNode.java 2007-01-22 19:39:41 UTC (rev 6067)
@@ -52,6 +52,13 @@
int getType();
/**
+ * The node id which identifies the node in the context of its root.
+ *
+ * @return the node id
+ */
+// String getId();
+
+ /**
* Return the root node of this node.
*
* @return the root node
@@ -66,7 +73,7 @@
PortalNode getParent();
/**
- * Return the node name relative to its parent.
+ * Return the node name which identifies the node in the context to its parent.
*
* @return the node name
*/
Added: trunk/api/src/main/org/jboss/portal/api/node/event/PageEvent.java
===================================================================
--- trunk/api/src/main/org/jboss/portal/api/node/event/PageEvent.java (rev 0)
+++ trunk/api/src/main/org/jboss/portal/api/node/event/PageEvent.java 2007-01-22 19:39:41 UTC (rev 6067)
@@ -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.api.node.event;
+
+import org.jboss.portal.api.node.PortalNode;
+
+/**
+ * Base class for page events.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public abstract class PageEvent extends PortalNodeEvent
+{
+ protected PageEvent(PortalNode node)
+ {
+ super(node);
+ }
+}
Added: trunk/api/src/main/org/jboss/portal/api/node/event/PageRenderEvent.java
===================================================================
--- trunk/api/src/main/org/jboss/portal/api/node/event/PageRenderEvent.java (rev 0)
+++ trunk/api/src/main/org/jboss/portal/api/node/event/PageRenderEvent.java 2007-01-22 19:39:41 UTC (rev 6067)
@@ -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.api.node.event;
+
+import org.jboss.portal.api.node.PortalNode;
+
+/**
+ * This event is fired whenever a page is rendered.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class PageRenderEvent extends PageEvent
+{
+ public PageRenderEvent(PortalNode node)
+ {
+ super(node);
+ }
+}
Modified: trunk/api/src/main/org/jboss/portal/api/node/event/PortalNodeEventContext.java
===================================================================
--- trunk/api/src/main/org/jboss/portal/api/node/event/PortalNodeEventContext.java 2007-01-22 16:24:53 UTC (rev 6066)
+++ trunk/api/src/main/org/jboss/portal/api/node/event/PortalNodeEventContext.java 2007-01-22 19:39:41 UTC (rev 6067)
@@ -23,6 +23,7 @@
package org.jboss.portal.api.node.event;
import org.jboss.portal.api.node.PortalNode;
+import org.jboss.portal.spi.NavigationalStateContext;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -43,4 +44,11 @@
* @return the current node.
*/
PortalNode getNode();
+
+ /**
+ * Returns the navigational state context.
+ *
+ * @return the navigational state context
+ */
+ NavigationalStateContext getNavigationalStateContext();
}
Modified: trunk/api/src/main/org/jboss/portal/api/node/event/WindowEvent.java
===================================================================
--- trunk/api/src/main/org/jboss/portal/api/node/event/WindowEvent.java 2007-01-22 16:24:53 UTC (rev 6066)
+++ trunk/api/src/main/org/jboss/portal/api/node/event/WindowEvent.java 2007-01-22 19:39:41 UTC (rev 6067)
@@ -27,7 +27,7 @@
import org.jboss.portal.api.node.PortalNode;
/** @author <a href="mailto:julien@jboss.org">Julien Viet</a> */
-public class WindowEvent extends PortalNodeEvent
+public abstract class WindowEvent extends PortalNodeEvent
{
/** . */
Modified: trunk/api/src/main/org/jboss/portal/api/node/event/WindowRenderEvent.java
===================================================================
--- trunk/api/src/main/org/jboss/portal/api/node/event/WindowRenderEvent.java 2007-01-22 16:24:53 UTC (rev 6066)
+++ trunk/api/src/main/org/jboss/portal/api/node/event/WindowRenderEvent.java 2007-01-22 19:39:41 UTC (rev 6067)
@@ -30,7 +30,7 @@
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision$
*/
-public class WindowRenderEvent extends WindowEvent
+public class WindowRenderEvent extends WindowNavigationEvent
{
/** . */
Added: trunk/api/src/main/org/jboss/portal/spi/NavigationalStateContext.java
===================================================================
--- trunk/api/src/main/org/jboss/portal/spi/NavigationalStateContext.java (rev 0)
+++ trunk/api/src/main/org/jboss/portal/spi/NavigationalStateContext.java 2007-01-22 19:39:41 UTC (rev 6067)
@@ -0,0 +1,72 @@
+/******************************************************************************
+ * 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.spi;
+
+import org.jboss.portal.WindowState;
+import org.jboss.portal.Mode;
+import org.jboss.portal.api.node.PortalNode;
+
+/**
+ * Provide access to the navigational state.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public interface NavigationalStateContext
+{
+ /**
+ * Returns the window state of a window or null if it is not found.
+ *
+ * @param window the window from which the window state is returned
+ * @return the window state
+ * @throws IllegalArgumentException
+ */
+ WindowState getWindowState(PortalNode window) throws IllegalArgumentException;
+
+ /**
+ * Updates the window state of a window.
+ *
+ * @param window the window to update
+ * @param windowState the new window state value
+ * @throws IllegalArgumentException
+ */
+ void setWindowState(PortalNode window, WindowState windowState) throws IllegalArgumentException;
+
+ /**
+ * Returns the mode of a window or null if it is not found.
+ *
+ * @param window the window from which the mode is returned
+ * @return the mode
+ * @throws IllegalArgumentException
+ */
+ Mode getMode(PortalNode window) throws IllegalArgumentException;
+
+ /**
+ * Updates the mode of a window.
+ *
+ * @param window the window to update
+ * @param mode the new mode value
+ * @throws IllegalArgumentException
+ */
+ void setMode(PortalNode window, Mode mode) throws IllegalArgumentException;
+}
Deleted: trunk/core/src/main/org/jboss/portal/core/WindowInterceptor.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/WindowInterceptor.java 2007-01-22 16:24:53 UTC (rev 6066)
+++ trunk/core/src/main/org/jboss/portal/core/WindowInterceptor.java 2007-01-22 19:39:41 UTC (rev 6067)
@@ -1,183 +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.core;
-
-import org.jboss.portal.core.controller.ControllerInterceptor;
-import org.jboss.portal.core.controller.ControllerCommand;
-import org.jboss.portal.core.model.portal.command.RenderPageCommand;
-import org.jboss.portal.core.model.portal.command.InvokePortletWindowRenderCommand;
-import org.jboss.portal.core.model.portal.Window;
-import org.jboss.portal.core.model.portal.Page;
-import org.jboss.portal.core.model.portal.PortalObject;
-import org.jboss.portal.common.invocation.InvocationException;
-import org.jboss.portal.theme.navigation.WindowNavigationalState;
-import org.jboss.portal.WindowState;
-
-import java.util.Iterator;
-import java.util.Collection;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public class WindowInterceptor extends ControllerInterceptor
-{
- public Object invoke(ControllerCommand cmd) throws Exception, InvocationException
- {
- if (cmd instanceof InvokePortletWindowRenderCommand)
- {
- // Update state
- cmd.invokeNext();
-
- //
- InvokePortletWindowRenderCommand ipwrc = (InvokePortletWindowRenderCommand)cmd;
- Window targetWindow = ipwrc.getWindow();
- Collection windows = targetWindow.getParent().getChildren(PortalObject.TYPE_WINDOW);
- WindowManipulator manipulator = new WindowManipulator(cmd.getContext().getAttributeResolver(ControllerCommand.NAVIGATIONAL_STATE_SCOPE), windows);
- WindowState ws = ipwrc.getWindowState();
-
- //
- if (WindowState.NORMAL.equals(ws))
- {
- String regionName = manipulator.getRegionName(targetWindow);
- if (regionName != null)
- {
- for (Iterator i = manipulator.getWindows(regionName).iterator();i.hasNext();)
- {
- Window currentWindow = (Window)i.next();
- if (currentWindow.getId().equals(targetWindow.getId()))
- {
- // Do nothing
- }
- else
- {
- WindowNavigationalState wns = manipulator.getNavigationalState(currentWindow);
- wns.setWindowState(WindowState.MINIMIZED);
- }
- }
- }
- }
- else if (WindowState.MINIMIZED.equals(ws))
- {
- String regionName = manipulator.getRegionName(targetWindow);
- if (regionName != null)
- {
- // Find the window following the minimized one
- Window nextWindow = null;
- for (Iterator i = manipulator.getWindows(regionName).iterator();i.hasNext();)
- {
- Window currentWindow = (Window)i.next();
-
- // Keep a ref on the first window for later use
- if (nextWindow == null)
- {
- nextWindow = currentWindow;
- }
-
- //
- if (currentWindow.getId().equals(targetWindow.getId()))
- {
- // Try to get the next window otherwise it means it's the last window
- // and we'll use the window we saved at the first iteration
- if (i.hasNext())
- {
- nextWindow = (Window)i.next();
- }
-
- //
- break;
- }
- }
-
- // Normalize the next window
- if (nextWindow != null)
- {
- WindowNavigationalState wns = manipulator.getNavigationalState(nextWindow);
- wns.setWindowState(WindowState.NORMAL);
- }
- }
- }
- }
- if (cmd instanceof RenderPageCommand)
- {
- RenderPageCommand rpc = (RenderPageCommand)cmd;
- WindowManipulator manipulator = new WindowManipulator(cmd.getContext().getAttributeResolver(ControllerCommand.NAVIGATIONAL_STATE_SCOPE), rpc.getWindows());
-
- // Filter window state for normal and minimized
- for (Iterator i = manipulator.getRegionNames().iterator();i.hasNext();)
- {
- boolean foundNormal = false;
- Window firstWindow = null;
- String regionName = (String)i.next();
- for (Iterator j = manipulator.getWindows(regionName).iterator();j.hasNext();)
- {
- Window window = (Window)j.next();
-
- // Keep a ref on first window which can be used later
- if (firstWindow == null)
- {
- firstWindow = window;
- }
-
- //
- WindowNavigationalState wns = manipulator.getNavigationalState(window);
- WindowState ws = wns.getWindowState();
- if (WindowState.NORMAL.equals(ws))
- {
- if (foundNormal)
- {
- wns.setWindowState(WindowState.MINIMIZED);
- }
- else
- {
- foundNormal = true;
- }
- }
- else if (WindowState.MINIMIZED.equals(ws))
- {
- //
- }
- else
- {
- ws = WindowState.MINIMIZED;
- wns.setWindowState(ws);
- }
- }
-
- //
- if (foundNormal == false && firstWindow != null)
- {
- WindowNavigationalState wns = manipulator.getNavigationalState(firstWindow);
- wns.setWindowState(WindowState.NORMAL);
- }
- }
-
- //
- return cmd.invokeNext();
- }
- else
- {
- return cmd.invokeNext();
- }
- }
-}
Modified: trunk/core/src/main/org/jboss/portal/core/aspects/controller/node/EventBroadcasterInterceptor.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/aspects/controller/node/EventBroadcasterInterceptor.java 2007-01-22 16:24:53 UTC (rev 6066)
+++ trunk/core/src/main/org/jboss/portal/core/aspects/controller/node/EventBroadcasterInterceptor.java 2007-01-22 19:39:41 UTC (rev 6067)
@@ -25,13 +25,17 @@
import org.apache.log4j.Logger;
import org.jboss.portal.Mode;
import org.jboss.portal.WindowState;
+import org.jboss.portal.theme.navigation.WindowNavigationalState;
+import org.jboss.portal.spi.NavigationalStateContext;
import org.jboss.portal.api.node.PortalNode;
import org.jboss.portal.api.node.event.PortalNodeEvent;
import org.jboss.portal.api.node.event.WindowActionEvent;
import org.jboss.portal.api.node.event.WindowEvent;
import org.jboss.portal.api.node.event.WindowNavigationEvent;
import org.jboss.portal.api.node.event.WindowRenderEvent;
+import org.jboss.portal.api.node.event.PageRenderEvent;
import org.jboss.portal.common.invocation.InvocationException;
+import org.jboss.portal.common.invocation.AttributeResolver;
import org.jboss.portal.common.util.LazyMap;
import org.jboss.portal.core.controller.CommandRedirectionException;
import org.jboss.portal.core.controller.ControllerCommand;
@@ -39,6 +43,7 @@
import org.jboss.portal.core.model.portal.command.InvokePortletWindowActionCommand;
import org.jboss.portal.core.model.portal.command.InvokePortletWindowRenderCommand;
import org.jboss.portal.core.model.portal.command.WindowCommand;
+import org.jboss.portal.core.model.portal.command.RenderPageCommand;
import org.jboss.portal.core.model.portal.PortalObjectId;
import org.jboss.portal.core.event.PortalEventListenerRegistry;
import org.jboss.portal.portlet.PortletParameters;
@@ -57,7 +62,6 @@
/** . */
private PortalEventListenerRegistry listenerRegistry;
-
public PortalEventListenerRegistry getListenerRegistry()
{
return listenerRegistry;
@@ -79,7 +83,8 @@
{
try
{
- nextEvent = node.fireEvent(listenerRegistry, event);
+ NavigationalStateContextImpl nsContext = new NavigationalStateContextImpl(cmd.getContext().getAttributeResolver(ControllerCommand.NAVIGATIONAL_STATE_SCOPE));
+ nextEvent = node.fireEvent(listenerRegistry, event, nsContext);
}
catch (Exception e)
{
@@ -263,6 +268,10 @@
}
}
}
+ else if (cmd instanceof RenderPageCommand)
+ {
+ return new PageRenderEvent(node);
+ }
return null;
}
@@ -318,4 +327,99 @@
return params;
}
}
+
+ private static class NavigationalStateContextImpl implements NavigationalStateContext
+ {
+
+ /** . */
+ private AttributeResolver navigationalStateResolver;
+
+ public NavigationalStateContextImpl(AttributeResolver navigationalStateResolver)
+ {
+ this.navigationalStateResolver = navigationalStateResolver;
+ }
+
+ private WindowNavigationalState getWNS(PortalNode window, boolean create)
+ {
+ PortalObjectNode pon = (PortalObjectNode)window;
+ String key = pon.getObjectId().toString() + "_window";
+ WindowNavigationalState wns = (WindowNavigationalState)navigationalStateResolver.getAttribute(key);
+ if (wns == null && create)
+ {
+ wns = new WindowNavigationalState();
+ navigationalStateResolver.setAttribute(key, wns);
+ }
+ return wns;
+ }
+
+ public WindowState getWindowState(PortalNode window) throws IllegalArgumentException
+ {
+ if (window == null)
+ {
+ throw new IllegalArgumentException("No null window can be provided");
+ }
+
+ //
+ WindowNavigationalState wns = getWNS(window, false);
+ if (wns != null)
+ {
+ return wns.getWindowState();
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ public void setWindowState(PortalNode window, WindowState windowState) throws IllegalArgumentException
+ {
+ if (window == null)
+ {
+ throw new IllegalArgumentException("No null window can be provided");
+ }
+ if (windowState == null)
+ {
+ throw new IllegalArgumentException();
+ }
+
+ //
+ WindowNavigationalState wns = getWNS(window, true);
+ wns.setWindowState(windowState);
+ }
+
+ public Mode getMode(PortalNode window) throws IllegalArgumentException
+ {
+ if (window == null)
+ {
+ throw new IllegalArgumentException("No null window can be provided");
+ }
+
+ //
+ WindowNavigationalState wns = getWNS(window, false);
+ if (wns != null)
+ {
+ return wns.getMode();
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ public void setMode(PortalNode window, Mode mode) throws IllegalArgumentException
+ {
+ if (window == null)
+ {
+ throw new IllegalArgumentException("No null window can be provided");
+ }
+ if (mode == null)
+ {
+ throw new IllegalArgumentException();
+ }
+
+ //
+ WindowNavigationalState wns = getWNS(window, true);
+ wns.setMode(mode);
+ }
+ }
}
\ No newline at end of file
Modified: trunk/core/src/main/org/jboss/portal/core/aspects/controller/node/PortalNodeInterceptor.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/aspects/controller/node/PortalNodeInterceptor.java 2007-01-22 16:24:53 UTC (rev 6066)
+++ trunk/core/src/main/org/jboss/portal/core/aspects/controller/node/PortalNodeInterceptor.java 2007-01-22 19:39:41 UTC (rev 6067)
@@ -37,8 +37,6 @@
public class PortalNodeInterceptor extends ControllerInterceptor
{
-// private static Logger log = Logger.getLogger(PortalNodeInterceptor.class);
-
public Object invoke(ControllerCommand cmd) throws Exception, InvocationException
{
// Get the next node
Modified: trunk/core/src/main/org/jboss/portal/core/aspects/controller/node/PortalObjectNode.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/aspects/controller/node/PortalObjectNode.java 2007-01-22 16:24:53 UTC (rev 6066)
+++ trunk/core/src/main/org/jboss/portal/core/aspects/controller/node/PortalObjectNode.java 2007-01-22 19:39:41 UTC (rev 6067)
@@ -30,6 +30,7 @@
import org.jboss.portal.core.event.PortalEventListenerRegistry;
import org.jboss.portal.core.model.portal.PortalObject;
import org.jboss.portal.core.model.portal.PortalObjectId;
+import org.jboss.portal.spi.NavigationalStateContext;
import java.util.Collection;
import java.util.Collections;
@@ -188,9 +189,9 @@
return object.getId();
}
- public PortalNodeEvent fireEvent(PortalEventListenerRegistry registry, PortalNodeEvent event)
+ public PortalNodeEvent fireEvent(PortalEventListenerRegistry registry, PortalNodeEvent event, NavigationalStateContext nsContext)
{
- Bubbler bubbler = new Bubbler(registry, this, event);
+ Bubbler bubbler = new Bubbler(registry, this, event, nsContext);
return bubbler.dispatch();
}
@@ -223,13 +224,26 @@
/** . */
private PortalObjectNode node;
- public Bubbler(PortalEventListenerRegistry registry, PortalObjectNode node, PortalNodeEvent event)
+ /** . */
+ private NavigationalStateContext nsContext;
+
+ public Bubbler(
+ PortalEventListenerRegistry registry,
+ PortalObjectNode node,
+ PortalNodeEvent event,
+ NavigationalStateContext nsContext)
{
this.registry = registry;
this.node = node;
this.event = event;
+ this.nsContext = nsContext;
}
+ public NavigationalStateContext getNavigationalStateContext()
+ {
+ return nsContext;
+ }
+
public PortalNodeEvent dispatch()
{
PortalNodeEventListener listener = null;
Added: trunk/core/src/main/org/jboss/portal/core/portlet/test/event/WindowConstraintEventListener.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/portlet/test/event/WindowConstraintEventListener.java (rev 0)
+++ trunk/core/src/main/org/jboss/portal/core/portlet/test/event/WindowConstraintEventListener.java 2007-01-22 19:39:41 UTC (rev 6067)
@@ -0,0 +1,254 @@
+/******************************************************************************
+ * 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.test.event;
+
+import org.jboss.portal.api.node.event.PortalNodeEventListener;
+import org.jboss.portal.api.node.event.PortalNodeEvent;
+import org.jboss.portal.api.node.event.PortalNodeEventContext;
+import org.jboss.portal.api.node.event.PageRenderEvent;
+import org.jboss.portal.api.node.event.WindowNavigationEvent;
+import org.jboss.portal.api.node.PortalNode;
+import org.jboss.portal.theme.ThemeConstants;
+import org.jboss.portal.spi.NavigationalStateContext;
+import org.jboss.portal.WindowState;
+
+import java.util.Map;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.SortedMap;
+import java.util.TreeMap;
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class WindowConstraintEventListener implements PortalNodeEventListener
+{
+
+ public PortalNodeEvent onEvent(PortalNodeEventContext context, PortalNodeEvent event)
+ {
+ if (event instanceof PageRenderEvent)
+ {
+ PortalNode targetPage = event.getNode();
+ WindowManipulator manipulator = new WindowManipulator(context.getNavigationalStateContext(), targetPage);
+
+ // Filter window state for normal and minimized
+ for (Iterator i = manipulator.getRegionNames().iterator();i.hasNext();)
+ {
+ boolean foundNormal = false;
+ PortalNode firstWindow = null;
+ String regionName = (String)i.next();
+ for (Iterator j = manipulator.getWindows(regionName).iterator();j.hasNext();)
+ {
+ PortalNode window = (PortalNode)j.next();
+
+ // Keep a ref on first window which can be used later
+ if (firstWindow == null)
+ {
+ firstWindow = window;
+ }
+
+ //
+ WindowState ws = manipulator.getWindowState(window);
+ if (WindowState.NORMAL.equals(ws))
+ {
+ if (foundNormal)
+ {
+ manipulator.setWindowState(window, WindowState.MINIMIZED);
+ }
+ else
+ {
+ foundNormal = true;
+ }
+ }
+ else if (WindowState.MINIMIZED.equals(ws))
+ {
+ //
+ }
+ else
+ {
+ manipulator.setWindowState(window, WindowState.MINIMIZED);
+ }
+ }
+
+ //
+ if (foundNormal == false && firstWindow != null)
+ {
+ manipulator.setWindowState(firstWindow, WindowState.NORMAL);
+ }
+ }
+ }
+ else if (event instanceof WindowNavigationEvent)
+ {
+ WindowNavigationEvent wne = (WindowNavigationEvent)event;
+ PortalNode targetWindow = event.getNode();
+ WindowManipulator manipulator = new WindowManipulator(context.getNavigationalStateContext(), targetWindow.getParent());
+
+ //
+ WindowState ws = wne.getWindowState();
+
+ //
+ if (WindowState.NORMAL.equals(ws))
+ {
+ String regionName = manipulator.getRegionName(targetWindow);
+ if (regionName != null)
+ {
+ for (Iterator i = manipulator.getWindows(regionName).iterator();i.hasNext();)
+ {
+ PortalNode currentWindow = (PortalNode)i.next();
+ if (currentWindow.equals(targetWindow))
+ {
+ // Do nothing
+ }
+ else
+ {
+ manipulator.setWindowState(currentWindow, WindowState.MINIMIZED);
+ }
+ }
+ }
+ }
+ else if (WindowState.MINIMIZED.equals(ws))
+ {
+ String regionName = manipulator.getRegionName(targetWindow);
+ if (regionName != null)
+ {
+ // Find the window following the minimized one
+ PortalNode nextWindow = null;
+ for (Iterator i = manipulator.getWindows(regionName).iterator();i.hasNext();)
+ {
+ PortalNode currentWindow = (PortalNode)i.next();
+
+ // Keep a ref on the first window for later use
+ if (nextWindow == null)
+ {
+ nextWindow = currentWindow;
+ }
+
+ //
+ if (currentWindow.equals(targetWindow))
+ {
+ // Try to get the next window otherwise it means it's the last window
+ // and we'll use the window we saved at the first iteration
+ if (i.hasNext())
+ {
+ nextWindow = (PortalNode)i.next();
+ }
+
+ //
+ break;
+ }
+ }
+
+ // Normalize the next window
+ if (nextWindow != null)
+ {
+ manipulator.setWindowState(nextWindow, WindowState.NORMAL);
+ }
+ }
+ }
+ }
+ return context.dispatch();
+ }
+
+ public class WindowManipulator
+ {
+
+ /** . */
+ private Map regionMap;
+
+ /** . */
+ private NavigationalStateContext nsContext;
+
+ public WindowManipulator(NavigationalStateContext nsContext, PortalNode parent)
+ {
+ this.nsContext = nsContext;
+
+ // Build appropriate structure
+ regionMap = new HashMap();
+ for (Iterator i = parent.getChildren().iterator();i.hasNext();)
+ {
+ try
+ {
+ PortalNode object = (PortalNode)i.next();
+ if (object.getType() == PortalNode.TYPE_WINDOW)
+ {
+ String region = (String)object.getProperties().get(ThemeConstants.PORTAL_PROP_REGION);
+ Integer order = new Integer((String)object.getProperties().get(ThemeConstants.PORTAL_PROP_ORDER));
+
+ //
+ SortedMap windowMap = (SortedMap)regionMap.get(region);
+ if (windowMap == null)
+ {
+ windowMap = new TreeMap();
+ regionMap.put(region, windowMap);
+ }
+ windowMap.put(order, object);
+ }
+ }
+ catch (NumberFormatException ignore)
+ {
+ }
+ }
+ }
+
+ public String getRegionName(PortalNode window)
+ {
+ for (Iterator i = regionMap.entrySet().iterator();i.hasNext();)
+ {
+ Map.Entry entry = (Map.Entry)i.next();
+ SortedMap windows = (SortedMap)entry.getValue();
+ for (Iterator j = windows.values().iterator();j.hasNext();)
+ {
+ PortalNode window2 = (PortalNode)j.next();
+ if (window.equals(window2))
+ {
+ return (String)entry.getKey();
+ }
+ }
+ }
+ return null;
+ }
+
+ public Set getRegionNames()
+ {
+ return regionMap.keySet();
+ }
+
+ public Collection getWindows(String regionName)
+ {
+ return ((Map)regionMap.get(regionName)).values();
+ }
+
+ public WindowState getWindowState(PortalNode window)
+ {
+ return nsContext.getWindowState(window);
+ }
+
+ public void setWindowState(PortalNode window, WindowState windowState)
+ {
+ nsContext.setWindowState(window, windowState);
+ }
+ }
+}
Modified: trunk/core/src/resources/portal-core-sar/META-INF/jboss-service.xml
===================================================================
--- trunk/core/src/resources/portal-core-sar/META-INF/jboss-service.xml 2007-01-22 16:24:53 UTC (rev 6066)
+++ trunk/core/src/resources/portal-core-sar/META-INF/jboss-service.xml 2007-01-22 19:39:41 UTC (rev 6067)
@@ -493,6 +493,18 @@
<attribute name="RegistryId">test_listener</attribute>
<attribute name="ListenerClassName">org.jboss.portal.core.portlet.test.event.PortletB$Listener</attribute>
</mbean>
+ <mbean
+ code="org.jboss.portal.core.event.PortalEventListenerServiceImpl"
+ name="portal:service=ListenerService,type=window_listener"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <depends
+ optional-attribute-name="Registry"
+ proxy-type="attribute">portal:service=ListenerRegistry</depends>
+ <attribute name="RegistryId">window_event_listener</attribute>
+ <attribute name="ListenerClassName">org.jboss.portal.core.portlet.test.event.WindowConstraintEventListener</attribute>
+ </mbean>
<!-- The different containers -->
<mbean
Modified: trunk/core/src/resources/portal-samples-war/WEB-INF/default-object.xml
===================================================================
--- trunk/core/src/resources/portal-samples-war/WEB-INF/default-object.xml 2007-01-22 16:24:53 UTC (rev 6066)
+++ trunk/core/src/resources/portal-samples-war/WEB-INF/default-object.xml 2007-01-22 19:39:41 UTC (rev 6067)
@@ -28,7 +28,6 @@
<if-exists>keep</if-exists>
<page>
<page-name>Test</page-name>
- <listener>test_listener</listener>
<properties>
<property>
<name>theme.ajax.object_disabled</name>
@@ -53,6 +52,7 @@
</window>
<page>
<page-name>event test</page-name>
+ <listener>event_listener</listener>
<window>
<window-name>CatalogPortletWindow</window-name>
<instance-ref>CatalogPortletInstance</instance-ref>
@@ -73,6 +73,46 @@
</window>
</page>
<page>
+ <page-name>page event test</page-name>
+ <listener>window_event_listener</listener>
+ <window>
+ <window-name>CatalogPortletWindow1</window-name>
+ <instance-ref>CatalogPortletInstance</instance-ref>
+ <region>left</region>
+ <height>0</height>
+ </window>
+ <window>
+ <window-name>CatalogPortletWindow2</window-name>
+ <instance-ref>CatalogPortletInstance</instance-ref>
+ <region>left</region>
+ <height>1</height>
+ </window>
+ <window>
+ <window-name>CatalogPortletWindow3</window-name>
+ <instance-ref>CatalogPortletInstance</instance-ref>
+ <region>left</region>
+ <height>2</height>
+ </window>
+ <window>
+ <window-name>CatalogPortletWindow4</window-name>
+ <instance-ref>CatalogPortletInstance</instance-ref>
+ <region>center</region>
+ <height>0</height>
+ </window>
+ <window>
+ <window-name>CatalogPortletWindow5</window-name>
+ <instance-ref>CatalogPortletInstance</instance-ref>
+ <region>center</region>
+ <height>1</height>
+ </window>
+ <window>
+ <window-name>CatalogPortletWindow6</window-name>
+ <instance-ref>CatalogPortletInstance</instance-ref>
+ <region>center</region>
+ <height>2</height>
+ </window>
+ </page>
+ <page>
<page-name>secure test</page-name>
<window>
<window-name>CatalogPortletWindow</window-name>
17 years, 4 months
JBoss Portal SVN: r6066 - trunk/core-cms/src/main/org/jboss/portal/core/cms/ui/admin.
by portal-commits@lists.jboss.org
Author: roy.russo(a)jboss.com
Date: 2007-01-22 11:24:53 -0500 (Mon, 22 Jan 2007)
New Revision: 6066
Modified:
trunk/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminPortlet.java
Log:
fixed workflow service not found bug due to dependency.
Modified: trunk/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminPortlet.java
===================================================================
--- trunk/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminPortlet.java 2007-01-22 16:18:18 UTC (rev 6065)
+++ trunk/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminPortlet.java 2007-01-22 16:24:53 UTC (rev 6066)
@@ -40,8 +40,8 @@
import org.jboss.portal.cms.security.PermissionManager;
import org.jboss.portal.cms.util.FileUtil;
import org.jboss.portal.cms.util.NodeUtil;
+import org.jboss.portal.core.cms.command.StreamContentCommand;
import org.jboss.portal.core.controller.ControllerContext;
-import org.jboss.portal.core.cms.command.StreamContentCommand;
import org.jboss.portal.identity.AnnonymousRole;
import org.jboss.portal.identity.IdentityException;
import org.jboss.portal.identity.MembershipModule;
@@ -245,11 +245,11 @@
}
//get the unapproved content for this file
- if (this.approvePublish != null)
+ if (this.getApprovePublish() != null)
{
try
{
- Collection pendingQueue = this.approvePublish.getPendingQueue(sPath);
+ Collection pendingQueue = this.getApprovePublish().getPendingQueue(sPath);
rReq.setAttribute("pendingQueue", pendingQueue);
}
catch (WorkflowException we)
@@ -1052,7 +1052,7 @@
try
{
- this.approvePublish.processManagerResponse(Long.parseLong(sPID), sManager, true);
+ this.getApprovePublish().processManagerResponse(Long.parseLong(sPID), sManager, true);
}
catch (Exception e)
{
@@ -1068,7 +1068,7 @@
try
{
- this.approvePublish.processManagerResponse(Long.parseLong(sPID), sManager, false);
+ this.getApprovePublish().processManagerResponse(Long.parseLong(sPID), sManager, false);
}
catch (Exception e)
{
@@ -1334,11 +1334,25 @@
try
{
InitialContext context = new InitialContext();
- this.approvePublish = (ApprovePublish)context.lookup("java:portal/ApprovePublishWorkflow");
+ this.setApprovePublish((ApprovePublish)context.lookup("java:portal/ApprovePublishWorkflow"));
}
catch (Exception e)
{
- this.approvePublish = null;
+ this.setApprovePublish(null);
}
}
+
+ public ApprovePublish getApprovePublish()
+ {
+ if (this.approvePublish == null)
+ {
+ this.initializeApprovePublishWorkflow();
+ }
+ return approvePublish;
+ }
+
+ public void setApprovePublish(ApprovePublish approvePublish)
+ {
+ this.approvePublish = approvePublish;
+ }
}
\ No newline at end of file
17 years, 4 months
JBoss Portal SVN: r6065 - in trunk/core/src/main/org/jboss/portal: test/core/model and 2 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-01-22 11:18:18 -0500 (Mon, 22 Jan 2007)
New Revision: 6065
Added:
trunk/core/src/main/org/jboss/portal/test/core/model/content/
trunk/core/src/main/org/jboss/portal/test/core/model/content/NullContent.java
trunk/core/src/main/org/jboss/portal/test/core/model/content/NullContentHandler.java
Modified:
trunk/core/src/main/org/jboss/portal/core/impl/model/portal/AbstractPortalObjectContainer.java
trunk/core/src/main/org/jboss/portal/core/impl/model/portal/WindowImpl.java
trunk/core/src/main/org/jboss/portal/test/core/model/portal/PortalObjectContainerTestCase.java
Log:
fix portal object test case in core
Modified: trunk/core/src/main/org/jboss/portal/core/impl/model/portal/AbstractPortalObjectContainer.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/impl/model/portal/AbstractPortalObjectContainer.java 2007-01-22 15:12:07 UTC (rev 6064)
+++ trunk/core/src/main/org/jboss/portal/core/impl/model/portal/AbstractPortalObjectContainer.java 2007-01-22 16:18:18 UTC (rev 6065)
@@ -63,6 +63,11 @@
/** . */
private CopyOnWriteRegistry contentHandlerRegistry;
+ protected AbstractPortalObjectContainer()
+ {
+ contentHandlerRegistry = new CopyOnWriteRegistry();
+ }
+
public InstanceContainer getInstanceContainer()
{
return instanceContainer;
@@ -71,7 +76,6 @@
public void setInstanceContainer(InstanceContainer instanceContainer)
{
this.instanceContainer = instanceContainer;
- this.contentHandlerRegistry = new CopyOnWriteRegistry();
}
public void registerHandler(ContentType contentType, ContentHandler handler) throws IllegalArgumentException
@@ -212,6 +216,11 @@
return AbstractPortalObjectContainer.this;
}
+ public ContentType getDefaultContentType()
+ {
+ return ContentType.PORTLET;
+ }
+
/**
*/
public void destroyChild(ObjectNode node)
Modified: trunk/core/src/main/org/jboss/portal/core/impl/model/portal/WindowImpl.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/impl/model/portal/WindowImpl.java 2007-01-22 15:12:07 UTC (rev 6064)
+++ trunk/core/src/main/org/jboss/portal/core/impl/model/portal/WindowImpl.java 2007-01-22 16:18:18 UTC (rev 6065)
@@ -118,8 +118,8 @@
String value = getDeclaredProperty(PORTAL_PROP_WINDOW_CONTENT_TYPE);
if (value == null)
{
- // For legacy content we chose to treat no value as portlet
- contentType = ContentType.PORTLET;
+ // If nothing is provided then we use the default content type
+ contentType = context.getDefaultContentType();
}
else
{
Added: trunk/core/src/main/org/jboss/portal/test/core/model/content/NullContent.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/test/core/model/content/NullContent.java (rev 0)
+++ trunk/core/src/main/org/jboss/portal/test/core/model/content/NullContent.java 2007-01-22 16:18:18 UTC (rev 6065)
@@ -0,0 +1,64 @@
+/******************************************************************************
+ * 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.core.model.content;
+
+import org.jboss.portal.core.model.content.Content;
+import org.jboss.portal.core.model.content.spi.ContentState;
+import org.jboss.portal.common.util.LocalizedString;
+
+import java.util.Locale;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class NullContent implements Content
+{
+
+ /** . */
+ private String contextId;
+
+ /** . */
+ private ContentState state;
+
+ public NullContent(String contextId, ContentState state)
+ {
+ this.contextId = contextId;
+ this.state = state;
+ }
+
+ public String getContextId()
+ {
+ return contextId;
+ }
+
+ public ContentState getState()
+ {
+ return state;
+ }
+
+ public LocalizedString getDisplayName()
+ {
+ return new LocalizedString("Null content", Locale.ENGLISH);
+ }
+}
Added: trunk/core/src/main/org/jboss/portal/test/core/model/content/NullContentHandler.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/test/core/model/content/NullContentHandler.java (rev 0)
+++ trunk/core/src/main/org/jboss/portal/test/core/model/content/NullContentHandler.java 2007-01-22 16:18:18 UTC (rev 6065)
@@ -0,0 +1,55 @@
+/******************************************************************************
+ * 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.core.model.content;
+
+import org.jboss.portal.core.model.content.spi.ContentState;
+import org.jboss.portal.core.model.content.Content;
+import org.jboss.portal.core.model.content.metadata.ContentMetaData;
+import org.jboss.portal.core.impl.model.content.AbstractContentHandler;
+import org.jboss.portal.common.NotYetImplemented;
+import org.w3c.dom.Element;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class NullContentHandler extends AbstractContentHandler
+{
+ public Content newContent(String contextId, ContentState state)
+ {
+ return new NullContent(contextId, state);
+ }
+
+ public void createContent(String contextId, ContentState state)
+ {
+ }
+
+ public void destroyContent(String contextId, ContentState state)
+ {
+ }
+
+ public ContentMetaData newMetaData(Element windowElement)
+ {
+ throw new NotYetImplemented();
+ }
+}
Modified: trunk/core/src/main/org/jboss/portal/test/core/model/portal/PortalObjectContainerTestCase.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/test/core/model/portal/PortalObjectContainerTestCase.java 2007-01-22 15:12:07 UTC (rev 6064)
+++ trunk/core/src/main/org/jboss/portal/test/core/model/portal/PortalObjectContainerTestCase.java 2007-01-22 16:18:18 UTC (rev 6065)
@@ -31,10 +31,12 @@
import org.jboss.portal.core.model.portal.Window;
import org.jboss.portal.core.model.portal.PortalObjectId;
import org.jboss.portal.core.model.content.ContentType;
-import org.jboss.portal.core.impl.model.content.portlet.PortletContent;
+import org.jboss.portal.core.model.content.spi.ContentState;
import org.jboss.portal.security.impl.JBossAuthorizationDomainRegistryImpl;
import org.jboss.portal.security.impl.jacc.JACCPortalAuthorizationManagerFactory;
import org.jboss.portal.test.core.PortalBaseTestCase;
+import org.jboss.portal.test.core.model.content.NullContentHandler;
+import org.jboss.portal.test.core.model.content.NullContent;
import org.jboss.portal.test.framework.embedded.DataSourceSupport;
import org.jboss.portal.common.test.TestParametrization;
import org.jboss.portal.common.test.junit.JUnitAdapter;
@@ -77,6 +79,7 @@
JBossAuthorizationDomainRegistryImpl registry;
JACCPortalAuthorizationManagerFactory factory;
+ NullContentHandler handler;
public void setUp() throws Exception
{
@@ -96,22 +99,33 @@
container.setPortalAuthorizationManagerFactory(factory);
//
+ handler = new NullContentHandler();
+ handler.setContentType(ContentType.PORTLET.toString());
+ handler.setRegistry(container);
+
+ //
registry.start();
factory.start();
+ container.start();
+ handler.start();
}
protected void tearDown() throws Exception
{
super.tearDown();
+ handler.destroy();
+ container.destroy();
+ factory.destroy();
+ registry.destroy();
container = null;
+ registry = null;
+ handler = null;
+ factory = null;
}
/** todo same with a transaction wrapping the start method */
public void testRootNodeCreation() throws Exception
{
- container.start();
-
- //
hibernate.openSession();
assertTrue(hibernate.commitTransaction());
@@ -120,16 +134,10 @@
PortalObject root = container.getRootObject();
assertNotNull(root);
assertTrue(hibernate.commitTransaction());
-
- //
- container.stop();
}
public void testCRUD() throws Exception
{
- container.start();
-
- //
hibernate.openSession();
assertTrue(hibernate.commitTransaction());
@@ -220,16 +228,10 @@
portal = ctx.getPortal("default");
assertNull(portal);
assertTrue(hibernate.commitTransaction());
-
- //
- container.stop();
}
public void testRecreate() throws Exception
{
- container.start();
-
- //
PortalObjectId defaultId = new PortalObjectId(new String[]{"default"});
//
@@ -251,16 +253,10 @@
assertNotNull(object);
assertTrue(hibernate.commitTransaction());
-
- //
- container.stop();
}
public void testCopy() throws Exception
{
- container.start();
-
- //
PortalObjectId defaultId = new PortalObjectId(new String[]{"portal"});
//
@@ -274,8 +270,11 @@
page.setDeclaredProperty("pagename", "pagevalue");
Window window = page.createWindow("window", ContentType.PORTLET);
window.setDeclaredProperty("windowname", "windowvalue");
- PortletContent content = (PortletContent)window.getContent();
- content.setInstanceRef("instance");
+ NullContent content = (NullContent)window.getContent();
+ assertNotNull(content);
+ ContentState contentState = content.getState();
+ assertNotNull(contentState);
+ contentState.setProperty("abc", "def");
assertTrue(hibernate.commitTransaction());
//
@@ -295,13 +294,12 @@
assertNotNull(window);
assertEquals("windowvalue", window.getDeclaredProperty("windowname"));
assertEquals(ContentType.PORTLET, window.getContentType());
- content = (PortletContent)window.getContent();
+ content = (NullContent)window.getContent();
assertNotNull(content);
- assertEquals("instance", content.getInstanceRef());
+ contentState = content.getState();
+ assertNotNull(contentState);
+ assertEquals("def", contentState.getProperty("abc"));
assertTrue(hibernate.commitTransaction());
-
- //
- container.stop();
}
// private void constructPortalObjects() throws Exception
17 years, 4 months