JBoss Portal SVN: r13156 - branches/Enterprise_Portal_Platform_4_3/build.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2009-04-06 04:44:56 -0400 (Mon, 06 Apr 2009)
New Revision: 13156
Modified:
branches/Enterprise_Portal_Platform_4_3/build/build-thirdparty.xml
Log:
Update libs
Modified: branches/Enterprise_Portal_Platform_4_3/build/build-thirdparty.xml
===================================================================
--- branches/Enterprise_Portal_Platform_4_3/build/build-thirdparty.xml 2009-04-06 07:19:42 UTC (rev 13155)
+++ branches/Enterprise_Portal_Platform_4_3/build/build-thirdparty.xml 2009-04-06 08:44:56 UTC (rev 13156)
@@ -44,7 +44,7 @@
<componentref name="jboss-portal/modules/common" version="1.2.3"/>
<componentref name="jboss-portal/modules/web" version="1.2.3"/>
<componentref name="jboss-portal/modules/test" version="1.0.4"/>
- <componentref name="jboss-portal/modules/portlet" version="2.0.5"/>
+ <componentref name="jboss-portal/modules/portlet" version="trunk-SNAPSHOT"/>
<componentref name="jboss-portal/modules/identity" version="1.0.7"/>
<componentref name="jboss-portal/modules/cms" version="1.2.4"/>
<componentref name="antlr" version="2.7.6-brew"/>
@@ -71,7 +71,7 @@
<componentref name="ehcache" version="1.2.2"/>
<componentref name="el" version="1.0"/>
<componentref name="facelets" version="1.1.15-B1"/>
- <componentref name="jboss/portlet-bridge" version="1.0.0.B6"/>
+ <componentref name="jboss/portlet-bridge" version="1.0.0.CR1"/>
<componentref name="hibernate" version="3.2.4.SP1_CP07-brew"/>
<componentref name="httpunit" version="1.6"/>
<componentref name="hsqldb" version="1.8.0.8.patch01-brew"/>
15 years, 2 months
JBoss Portal SVN: r13155 - branches/Enterprise_Portal_Platform_4_3/core-samples/src/resources/portal-users-samples-war/WEB-INF/classes.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2009-04-06 03:19:42 -0400 (Mon, 06 Apr 2009)
New Revision: 13155
Modified:
branches/Enterprise_Portal_Platform_4_3/core-samples/src/resources/portal-users-samples-war/WEB-INF/classes/Resource_de.properties
Log:
JBEPP-56: German translation fixes
Modified: branches/Enterprise_Portal_Platform_4_3/core-samples/src/resources/portal-users-samples-war/WEB-INF/classes/Resource_de.properties
===================================================================
--- branches/Enterprise_Portal_Platform_4_3/core-samples/src/resources/portal-users-samples-war/WEB-INF/classes/Resource_de.properties 2009-04-06 07:19:04 UTC (rev 13154)
+++ branches/Enterprise_Portal_Platform_4_3/core-samples/src/resources/portal-users-samples-war/WEB-INF/classes/Resource_de.properties 2009-04-06 07:19:42 UTC (rev 13155)
@@ -24,7 +24,7 @@
javax.portlet.keywords=beispiel,test
NO_USER_ONLINE=Keine Benutzer online
-ONE_USER_ONLINE=Sie sind der einizge Benutzer online
+ONE_USER_ONLINE=Sie sind der einzige Benutzer online
USERS_ONLINE_0=Es sind <b>
USERS_ONLINE_1=</b> Benutzer online
USERS_ARE_0=<b>
15 years, 2 months
JBoss Portal SVN: r13154 - branches/Enterprise_Portal_Platform_4_3/core-cms/src/resources/portal-cms-war/WEB-INF/classes.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2009-04-06 03:19:04 -0400 (Mon, 06 Apr 2009)
New Revision: 13154
Modified:
branches/Enterprise_Portal_Platform_4_3/core-cms/src/resources/portal-cms-war/WEB-INF/classes/Resource_de.properties
Log:
JBEPP-56: German translation fixes
Modified: branches/Enterprise_Portal_Platform_4_3/core-cms/src/resources/portal-cms-war/WEB-INF/classes/Resource_de.properties
===================================================================
--- branches/Enterprise_Portal_Platform_4_3/core-cms/src/resources/portal-cms-war/WEB-INF/classes/Resource_de.properties 2009-04-06 07:09:58 UTC (rev 13153)
+++ branches/Enterprise_Portal_Platform_4_3/core-cms/src/resources/portal-cms-war/WEB-INF/classes/Resource_de.properties 2009-04-06 07:19:04 UTC (rev 13154)
@@ -25,10 +25,10 @@
TITLE_HEAD=CMS-Administrator
TITLE_BROWSE=Verzeichnis-Browser
TITLE_FILEBROWSE=Datei-Browser
-TITLE_DELETECONFIRM=L\u00f6schen best\u00e4tigen
-TITLE_CREATECOLLCONFIRM=Verzeichniserstellung best\u00e4tigen
-TITLE_COPYCONFIRM=Kopieren von Ressource best\u00e4tigen
-TITLE_MOVECONFIRM=Verschieben von Ressource best\u00e4tigen
+TITLE_DELETECONFIRM=L\u00F6schen best\u00E4tigen
+TITLE_CREATECOLLCONFIRM=Verzeichniserstellung best\u00E4tigen
+TITLE_COPYCONFIRM=Kopieren von Ressource best\u00E4tigen
+TITLE_MOVECONFIRM=Verschieben von Ressource best\u00E4tigen
TITLE_VIEWFILE=Dateieigenschaften anzeigen
TITLE_EDIT=Datei bearbeiten
TITLE_CREATE=Datei erstellen
@@ -37,7 +37,7 @@
CMS_SEARCH=Suche
CMS_SEARCHNORESULT=Keine Ergebnisse
-CMS_MENU=Aktions-Men\u00fc
+CMS_MENU=Aktions-Men\u00FC
CMS_ACTION=Aktion
CMS_NAME=Name
CMS_TYPE=Typ
@@ -47,7 +47,7 @@
CMS_VIEW=Anzeigen
CMS_COPY=Kopieren
CMS_MOVE=Verschieben
-CMS_DELETE=L\u00f6schen
+CMS_DELETE=L\u00F6schen
CMS_FOLDER=Verzeichnis
CMS_FILE=Datei
CMS_CREATE=Erstellen
@@ -59,7 +59,7 @@
CMS_CREATEFILE=Datei erstellen
CMS_UPLOADARCHIVE=Archiv hochladen
CMS_UPLOADARCHIVE_ASYNC=Asynchron vorgehen
-CMS_BACKTOBROWSER=Zur\u00fcck zum Verzeichnis-Browser
+CMS_BACKTOBROWSER=Zur\u00FCck zum Verzeichnis-Browser
CMS_TRANSFER=Importieren/Exportieren
CMS_EXPORTARCHIVE=Verzeichnis exportieren
CMS_SECURE=Sichern
@@ -70,20 +70,20 @@
CMS_TITLE=Titel
CMS_LANGUAGE=Sprache
-CMS_DELETEPATH=L\u00f6schen best\u00e4tigen von
-CMS_DELETEWARN1=WARNUNG! Sie k\u00f6nnen diese \u00c4nderung nicht r\u00fcckg\u00e4ngig machen\!
-CMS_DELETEWARN2=Sind Sie sicher, dass Sie diese Ressource l\u00f6schen m\u00f6chten\?
+CMS_DELETEPATH=L\u00F6schen best\u00E4tigen von
+CMS_DELETEWARN1=WARNUNG\! Sie k\u00F6nnen diese \u00C4nderung nicht r\u00FCckg\u00E4ngig machen\!
+CMS_DELETEWARN2=Sind Sie sicher, dass Sie diese Ressource l\u00F6schen m\u00F6chten?
CMS_DESTINATION=Ziel
CMS_SOURCE=Quelle
CMS_EDITING=Datei wird bearbeitet
-CMS_LIVE=\"Live\" stellen
+CMS_LIVE="Live" stellen
CMS_VERSION=Version
CMS_WYSIWYG=WYSIWYG-Editor
CMS_LIVEVERSION=Live-Version
-CMS_SIZE=Gr\u00f6\u00dfe
+CMS_SIZE=Gr\u00F6\u00DFe
CMS_CONTENT_DIR=Inhaltsverzeichnis
CMS_CONTENT_DIR_USE=Verwenden Sie den Verzeichnisbaum, um durch die Portal-Verzeichnisstruktur zu navigieren.
@@ -99,10 +99,10 @@
CMS_EMPTY_FOLDER=Dieses Verzeichnis ist leer.
CMS_ERROR_UPLOADARCHIVE_ASYNC=Beim Verarbeiten Ihres Archivs ist ein Fehler aufgetreten. Bitte aktivieren Sie die Option 'Asynchron vorgehen' und versuchen Sie es erneut.
-CMS_MSG_UPLOADARCHIVE_ASYNC=Ihr Archiv wurde zur Verarbeitung akzeptiert. Sobald die Verarbeitung abgeschlossen ist, wird die Ressource wird in Ihrem Verzeichnis gelistet werden.
+CMS_MSG_UPLOADARCHIVE_ASYNC=Ihr Archiv wurde zur Verarbeitung akzeptiert. Sobald die Verarbeitung abgeschlossen ist, wird die Ressource in Ihrem Verzeichnis gelistet werden.
CMS_REQUIRED=Erforderlich
-CMS_LINK_TO_RESOURCES=Verweise auf Ressourcen innerhalb dieses Portals sollten absolut sein. Beispiel: Ein Verweis auf ein Bild mit dem Pfad default/images/back.gif sollte genau wie hier aufgef\u00fchrt eingegeben werden. Stellen Sie dem Ressourcenpfad kein Slash (/) voran. Sie k\u00f6nnen den Verweis \u00fcberpr\u00fcfen, indem Sie auf den Vorschau-Button im Editor klicken.
+CMS_LINK_TO_RESOURCES=Verweise auf Ressourcen innerhalb dieses Portals sollten relativ sein. Beispiel\: Ein Verweis auf ein Bild mit dem Pfad default/images/back.gif sollte genau wie hier aufgef\\u00fchrt eingegeben werden. Stellen Sie dem Ressourcenpfad kein Slash (/) voran. Sie k\\u00f6nnen den Verweis \\u00fcberpr\\u00fcfen, indem Sie auf den Vorschau-Button im Editor klicken.
CMS_ERROR_PROCESSING=Fehler beim Verarbeiten der Export-Anfrage
CMS_YOUR_EXPORT_0=Ihr Export von
@@ -114,11 +114,11 @@
CMS_ERROR=Fehler
CMS_PENDING_APPROVAL_QUEUE=Zur Publikation freigegebene Artikel
CMS_CONFIGURE_RESTRICTION=Sicherheitseinstellungen des Knotens konfigurieren
-CMS_SELECT_ACTION=W\u00e4hlen Sie eine Aktion...
+CMS_SELECT_ACTION=W\u00E4hlen Sie eine Aktion...
CMS_BROWSING=Suche
-CMS_CONTENT_NOT_FOUND=F\u00fcr die ausgew\u00e4hlte Datei konnte kein Inhalt gefunden werden
-CMS_INTRODUCTION=Einf\u00fchrung
-CMS_HELP=Das CMS-Portlet zeigt Inhalte des Dateisystems innerhalb (bzw. im Falle von bin\u00e4rem Inhalt au\u00dferhalb) eines Portlet-Fensters an.
+CMS_CONTENT_NOT_FOUND=F\u00FCr die ausgew\u00E4hlte Datei konnte kein Inhalt gefunden werden
+CMS_INTRODUCTION=Einf\u00FChrung
+CMS_HELP=Das CMS-Portlet zeigt Inhalte des Dateisystems innerhalb (bzw. im Falle von bin\u00E4rem Inhalt au\u00DFerhalb) eines Portlet-Fensters an.
CMS_TO_MODIFY=Um das Verhalten dieses Portlets zu modifizieren,
CMS_CLICK_HERE=bitte hier klicken
@@ -130,4 +130,4 @@
CMS_MISSING_DOCUMENT=404 - Seite nicht gefunden
CMS_MISSING_DOCUMENT_DESCRIPTION=Das von ihnen angeforderte Dokument ist nicht verf�gbar
-CMS_DATE_PATTERN=dd/MM/yy HH:mm
\ No newline at end of file
+CMS_DATE_PATTERN=dd/MM/yy HH\:mm
\ No newline at end of file
15 years, 2 months
JBoss Portal SVN: r13153 - in branches/JBoss_Portal_Branch_2_7: core-samples/src/resources/portal-users-samples-war/WEB-INF/classes and 1 other directory.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2009-04-06 03:09:58 -0400 (Mon, 06 Apr 2009)
New Revision: 13153
Modified:
branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/classes/Resource_de.properties
branches/JBoss_Portal_Branch_2_7/core-samples/src/resources/portal-users-samples-war/WEB-INF/classes/Resource_de.properties
Log:
JBPORTAL-2362: Improve german language-resource-files in portal-cms.war, portal-admin.war and portal-users-samples.war
Modified: branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/classes/Resource_de.properties
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/classes/Resource_de.properties 2009-04-06 06:38:32 UTC (rev 13152)
+++ branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/classes/Resource_de.properties 2009-04-06 07:09:58 UTC (rev 13153)
@@ -25,10 +25,10 @@
TITLE_HEAD=CMS-Administrator
TITLE_BROWSE=Verzeichnis-Browser
TITLE_FILEBROWSE=Datei-Browser
-TITLE_DELETECONFIRM=L\u00f6schen best\u00e4tigen
-TITLE_CREATECOLLCONFIRM=Verzeichniserstellung best\u00e4tigen
-TITLE_COPYCONFIRM=Kopieren von Ressource best\u00e4tigen
-TITLE_MOVECONFIRM=Verschieben von Ressource best\u00e4tigen
+TITLE_DELETECONFIRM=L\u00F6schen best\u00E4tigen
+TITLE_CREATECOLLCONFIRM=Verzeichniserstellung best\u00E4tigen
+TITLE_COPYCONFIRM=Kopieren von Ressource best\u00E4tigen
+TITLE_MOVECONFIRM=Verschieben von Ressource best\u00E4tigen
TITLE_VIEWFILE=Dateieigenschaften anzeigen
TITLE_EDIT=Datei bearbeiten
TITLE_CREATE=Datei erstellen
@@ -37,7 +37,7 @@
CMS_SEARCH=Suche
CMS_SEARCHNORESULT=Keine Ergebnisse
-CMS_MENU=Aktions-Men\u00fc
+CMS_MENU=Aktions-Men\u00FC
CMS_ACTION=Aktion
CMS_NAME=Name
CMS_TYPE=Typ
@@ -47,7 +47,7 @@
CMS_VIEW=Anzeigen
CMS_COPY=Kopieren
CMS_MOVE=Verschieben
-CMS_DELETE=L\u00f6schen
+CMS_DELETE=L\u00F6schen
CMS_FOLDER=Verzeichnis
CMS_FILE=Datei
CMS_CREATE=Erstellen
@@ -59,7 +59,7 @@
CMS_CREATEFILE=Datei erstellen
CMS_UPLOADARCHIVE=Archiv hochladen
CMS_UPLOADARCHIVE_ASYNC=Asynchron vorgehen
-CMS_BACKTOBROWSER=Zur\u00fcck zum Verzeichnis-Browser
+CMS_BACKTOBROWSER=Zur\u00FCck zum Verzeichnis-Browser
CMS_TRANSFER=Importieren/Exportieren
CMS_EXPORTARCHIVE=Verzeichnis exportieren
CMS_SECURE=Sichern
@@ -70,20 +70,20 @@
CMS_TITLE=Titel
CMS_LANGUAGE=Sprache
-CMS_DELETEPATH=L\u00f6schen best\u00e4tigen von
-CMS_DELETEWARN1=WARNUNG! Sie k\u00f6nnen diese \u00c4nderung nicht r\u00fcckg\u00e4ngig machen\!
-CMS_DELETEWARN2=Sind Sie sicher, dass Sie diese Ressource l\u00f6schen m\u00f6chten\?
+CMS_DELETEPATH=L\u00F6schen best\u00E4tigen von
+CMS_DELETEWARN1=WARNUNG\! Sie k\u00F6nnen diese \u00C4nderung nicht r\u00FCckg\u00E4ngig machen\!
+CMS_DELETEWARN2=Sind Sie sicher, dass Sie diese Ressource l\u00F6schen m\u00F6chten?
CMS_DESTINATION=Ziel
CMS_SOURCE=Quelle
CMS_EDITING=Datei wird bearbeitet
-CMS_LIVE=\"Live\" stellen
+CMS_LIVE="Live" stellen
CMS_VERSION=Version
CMS_WYSIWYG=WYSIWYG-Editor
CMS_LIVEVERSION=Live-Version
-CMS_SIZE=Gr\u00f6\u00dfe
+CMS_SIZE=Gr\u00F6\u00DFe
CMS_CONTENT_DIR=Inhaltsverzeichnis
CMS_CONTENT_DIR_USE=Verwenden Sie den Verzeichnisbaum, um durch die Portal-Verzeichnisstruktur zu navigieren.
@@ -99,10 +99,10 @@
CMS_EMPTY_FOLDER=Dieses Verzeichnis ist leer.
CMS_ERROR_UPLOADARCHIVE_ASYNC=Beim Verarbeiten Ihres Archivs ist ein Fehler aufgetreten. Bitte aktivieren Sie die Option 'Asynchron vorgehen' und versuchen Sie es erneut.
-CMS_MSG_UPLOADARCHIVE_ASYNC=Ihr Archiv wurde zur Verarbeitung akzeptiert. Sobald die Verarbeitung abgeschlossen ist, wird die Ressource wird in Ihrem Verzeichnis gelistet werden.
+CMS_MSG_UPLOADARCHIVE_ASYNC=Ihr Archiv wurde zur Verarbeitung akzeptiert. Sobald die Verarbeitung abgeschlossen ist, wird die Ressource in Ihrem Verzeichnis gelistet werden.
CMS_REQUIRED=Erforderlich
-CMS_LINK_TO_RESOURCES=Verweise auf Ressourcen innerhalb dieses Portals sollten absolut sein. Beispiel: Ein Verweis auf ein Bild mit dem Pfad default/images/back.gif sollte genau wie hier aufgef\u00fchrt eingegeben werden. Stellen Sie dem Ressourcenpfad kein Slash (/) voran. Sie k\u00f6nnen den Verweis \u00fcberpr\u00fcfen, indem Sie auf den Vorschau-Button im Editor klicken.
+CMS_LINK_TO_RESOURCES=Verweise auf Ressourcen innerhalb dieses Portals sollten relativ sein. Beispiel\: Ein Verweis auf ein Bild mit dem Pfad default/images/back.gif sollte genau wie hier aufgef\\u00fchrt eingegeben werden. Stellen Sie dem Ressourcenpfad kein Slash (/) voran. Sie k\\u00f6nnen den Verweis \\u00fcberpr\\u00fcfen, indem Sie auf den Vorschau-Button im Editor klicken.
CMS_ERROR_PROCESSING=Fehler beim Verarbeiten der Export-Anfrage
CMS_YOUR_EXPORT_0=Ihr Export von
@@ -114,11 +114,11 @@
CMS_ERROR=Fehler
CMS_PENDING_APPROVAL_QUEUE=Zur Publikation freigegebene Artikel
CMS_CONFIGURE_RESTRICTION=Sicherheitseinstellungen des Knotens konfigurieren
-CMS_SELECT_ACTION=W\u00e4hlen Sie eine Aktion...
+CMS_SELECT_ACTION=W\u00E4hlen Sie eine Aktion...
CMS_BROWSING=Suche
-CMS_CONTENT_NOT_FOUND=F\u00fcr die ausgew\u00e4hlte Datei konnte kein Inhalt gefunden werden
-CMS_INTRODUCTION=Einf\u00fchrung
-CMS_HELP=Das CMS-Portlet zeigt Inhalte des Dateisystems innerhalb (bzw. im Falle von bin\u00e4rem Inhalt au\u00dferhalb) eines Portlet-Fensters an.
+CMS_CONTENT_NOT_FOUND=F\u00FCr die ausgew\u00E4hlte Datei konnte kein Inhalt gefunden werden
+CMS_INTRODUCTION=Einf\u00FChrung
+CMS_HELP=Das CMS-Portlet zeigt Inhalte des Dateisystems innerhalb (bzw. im Falle von bin\u00E4rem Inhalt au\u00DFerhalb) eines Portlet-Fensters an.
CMS_TO_MODIFY=Um das Verhalten dieses Portlets zu modifizieren,
CMS_CLICK_HERE=bitte hier klicken
@@ -130,4 +130,4 @@
CMS_MISSING_DOCUMENT=404 - Seite nicht gefunden
CMS_MISSING_DOCUMENT_DESCRIPTION=Das von ihnen angeforderte Dokument ist nicht verf�gbar
-CMS_DATE_PATTERN=dd/MM/yy HH:mm
\ No newline at end of file
+CMS_DATE_PATTERN=dd/MM/yy HH\:mm
\ No newline at end of file
Modified: branches/JBoss_Portal_Branch_2_7/core-samples/src/resources/portal-users-samples-war/WEB-INF/classes/Resource_de.properties
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-samples/src/resources/portal-users-samples-war/WEB-INF/classes/Resource_de.properties 2009-04-06 06:38:32 UTC (rev 13152)
+++ branches/JBoss_Portal_Branch_2_7/core-samples/src/resources/portal-users-samples-war/WEB-INF/classes/Resource_de.properties 2009-04-06 07:09:58 UTC (rev 13153)
@@ -24,7 +24,7 @@
javax.portlet.keywords=beispiel,test
NO_USER_ONLINE=Keine Benutzer online
-ONE_USER_ONLINE=Sie sind der einizge Benutzer online
+ONE_USER_ONLINE=Sie sind der einzige Benutzer online
USERS_ONLINE_0=Es sind <b>
USERS_ONLINE_1=</b> Benutzer online
USERS_ARE_0=<b>
15 years, 2 months
JBoss Portal SVN: r13152 - in branches/Enterprise_Portal_Platform_4_3/core/src: resources/portal-core-sar/META-INF and 1 other directory.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2009-04-06 02:38:32 -0400 (Mon, 06 Apr 2009)
New Revision: 13152
Added:
branches/Enterprise_Portal_Platform_4_3/core/src/main/org/jboss/portal/core/aspects/portlet/HttpHeaderInterceptor.java
Modified:
branches/Enterprise_Portal_Platform_4_3/core/src/resources/portal-core-sar/META-INF/jboss-service.xml
Log:
JBEPP-54: Using PortletResponse.addProperty() does not set the cookie and transport headers in the response
Copied: branches/Enterprise_Portal_Platform_4_3/core/src/main/org/jboss/portal/core/aspects/portlet/HttpHeaderInterceptor.java (from rev 13108, branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/aspects/portlet/HttpHeaderInterceptor.java)
===================================================================
--- branches/Enterprise_Portal_Platform_4_3/core/src/main/org/jboss/portal/core/aspects/portlet/HttpHeaderInterceptor.java (rev 0)
+++ branches/Enterprise_Portal_Platform_4_3/core/src/main/org/jboss/portal/core/aspects/portlet/HttpHeaderInterceptor.java 2009-04-06 06:38:32 UTC (rev 13152)
@@ -0,0 +1,117 @@
+/******************************************************************************
+ * 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.aspects.portlet;
+
+import java.util.List;
+
+import org.jboss.portal.common.util.MultiValuedPropertyMap;
+import org.jboss.portal.core.metadata.portlet.MarkupElement;
+import org.jboss.portal.core.portlet.info.MarkupHeaderInfo;
+import org.jboss.portal.portlet.PortletInvokerException;
+import org.jboss.portal.portlet.impl.spi.AbstractServerContext;
+import org.jboss.portal.portlet.info.PortletInfo;
+import org.jboss.portal.portlet.invocation.PortletInvocation;
+import org.jboss.portal.portlet.invocation.response.FragmentResponse;
+import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
+import org.jboss.portal.portlet.invocation.response.ResponseProperties;
+import org.jboss.portal.portlet.invocation.response.UpdateNavigationalStateResponse;
+import org.w3c.dom.Element;
+
+import javax.portlet.MimeResponse;
+import javax.servlet.http.Cookie;
+
+/**
+ * @author <a href="mailto:mholzner@novell.com">Martin Holzner</a>
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision: 11068 $
+ */
+public class HttpHeaderInterceptor extends CorePortletInterceptor
+{
+
+ private String defaultCookiePath = null;
+
+ /**
+ * Cookie path to set when none has been defined
+ */
+ public String getDefaultCookiePath()
+ {
+ return defaultCookiePath;
+ }
+
+ public void setDefaultCookiePath(String defaultCookiePath)
+ {
+ this.defaultCookiePath = defaultCookiePath;
+ }
+
+ public PortletInvocationResponse invoke(PortletInvocation invocation) throws IllegalArgumentException,
+ PortletInvokerException
+ {
+
+ PortletInvocationResponse response = super.invoke(invocation);
+
+ if (response instanceof UpdateNavigationalStateResponse)
+ {
+ UpdateNavigationalStateResponse unsr = (UpdateNavigationalStateResponse) response;
+ if (unsr.getProperties() != null)
+ {
+ for (Cookie cookie : unsr.getProperties().getCookies())
+ {
+ addCookie(invocation, cookie);
+ }
+ for (String key: unsr.getProperties().getTransportHeaders().keySet())
+ {
+ String value = unsr.getProperties().getTransportHeaders().getValue(key);
+ ((AbstractServerContext) invocation.getServerContext()).getResponse().addHeader(key, value);
+ }
+ }
+ }
+ else if (response instanceof FragmentResponse)
+ {
+ FragmentResponse fr = (FragmentResponse) response;
+ if (fr.getProperties() != null)
+ {
+ for (Cookie cookie : fr.getProperties().getCookies())
+ {
+ addCookie(invocation, cookie);
+ }
+ for (String key: fr.getProperties().getTransportHeaders().keySet())
+ {
+ String value = fr.getProperties().getTransportHeaders().getValue(key);
+ ((AbstractServerContext) invocation.getServerContext()).getResponse().addHeader(key, value);
+ }
+ }
+ }
+ //
+ return response;
+ }
+
+ private void addCookie(PortletInvocation invocation, Cookie cookie)
+ {
+ if ((cookie.getPath() == null || "".equals(cookie.getPath().trim())) && defaultCookiePath != null)
+ {
+ cookie.setPath(defaultCookiePath);
+ }
+ ((AbstractServerContext) invocation.getServerContext()).getResponse().addCookie(cookie);
+ }
+}
Modified: branches/Enterprise_Portal_Platform_4_3/core/src/resources/portal-core-sar/META-INF/jboss-service.xml
===================================================================
--- branches/Enterprise_Portal_Platform_4_3/core/src/resources/portal-core-sar/META-INF/jboss-service.xml 2009-04-05 14:58:26 UTC (rev 13151)
+++ branches/Enterprise_Portal_Platform_4_3/core/src/resources/portal-core-sar/META-INF/jboss-service.xml 2009-04-06 06:38:32 UTC (rev 13152)
@@ -345,6 +345,12 @@
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
<xmbean/>
</mbean>
+ <mbean code="org.jboss.portal.core.aspects.portlet.HttpHeaderInterceptor"
+ name="portal:service=Interceptor,type=Portlet,name=HttpHeader" xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <attribute name="DefaultCookiePath">/</attribute>
+ </mbean>
<mbean code="org.jboss.portal.core.aspects.portlet.HeaderInterceptor"
name="portal:service=Interceptor,type=Portlet,name=Header" xmbean-dd=""
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
@@ -380,6 +386,7 @@
<depends-list optional-attribute-name="InterceptorNames">
<depends-list-element>portal:service=Interceptor,type=Portlet,name=Valve</depends-list-element>
<depends-list-element>portal:service=Interceptor,type=Portlet,name=SecureTransport</depends-list-element>
+ <depends-list-element>portal:service=Interceptor,type=Portlet,name=HttpHeader</depends-list-element>
<depends-list-element>portal:service=Interceptor,type=Portlet,name=ContextDispatcher</depends-list-element>
<depends-list-element>portal:service=Interceptor,type=Portlet,name=ContextTracker</depends-list-element>
<depends-list-element>portal:service=Interceptor,type=Portlet,name=PortletSessionSynchronization</depends-list-element>
15 years, 2 months
JBoss Portal SVN: r13151 - in modules/authorization/trunk: common-api/src/main/java/org/jboss/security/authz/xacml and 10 other directories.
by portal-commits@lists.jboss.org
Author: sohil.shah(a)jboss.com
Date: 2009-04-05 10:58:26 -0400 (Sun, 05 Apr 2009)
New Revision: 13151
Added:
modules/authorization/trunk/core-components-api/src/main/java/org/jboss/security/authz/components/action/http/Delete.java
modules/authorization/trunk/core-components-api/src/main/java/org/jboss/security/authz/components/action/http/Head.java
modules/authorization/trunk/core-components-api/src/main/java/org/jboss/security/authz/components/action/http/Options.java
modules/authorization/trunk/core-components-api/src/main/java/org/jboss/security/authz/components/action/http/Put.java
modules/authorization/trunk/core-components-api/src/main/java/org/jboss/security/authz/components/action/http/Trace.java
modules/authorization/trunk/http-profile/src/test/resources/httpprofile-testsuite.war/private/executives/testwithparams.html
Modified:
modules/authorization/trunk/common-api/src/main/java/org/jboss/security/authz/model/AttributeExpression.java
modules/authorization/trunk/common-api/src/main/java/org/jboss/security/authz/xacml/AttributeDesignatorUtil.java
modules/authorization/trunk/core-components-api/src/main/java/org/jboss/security/authz/components/resource/HttpResource.java
modules/authorization/trunk/core-components-api/src/test/java/org/jboss/security/authz/test/MockPolicy.java
modules/authorization/trunk/http-profile/src/main/java/org/jboss/security/authz/http/configuration/HttpPolicyConfig.java
modules/authorization/trunk/http-profile/src/main/java/org/jboss/security/authz/http/enforcement/SecurityFilter.java
modules/authorization/trunk/http-profile/src/test/java/org/jboss/security/authz/http/container/TestSecurityFilterDeployment.java
modules/authorization/trunk/http-profile/src/test/resources/http-policy.xml
modules/authorization/trunk/http-profile/src/test/resources/httpprofile-testsuite.war/WEB-INF/http-policy.xml
modules/authorization/trunk/policy-server/src/main/java/org/jboss/security/authz/policy/server/plugin/HierarchialPolicy.java
Log:
http security profile integration via a servlet filter
Modified: modules/authorization/trunk/common-api/src/main/java/org/jboss/security/authz/model/AttributeExpression.java
===================================================================
--- modules/authorization/trunk/common-api/src/main/java/org/jboss/security/authz/model/AttributeExpression.java 2009-04-03 20:33:51 UTC (rev 13150)
+++ modules/authorization/trunk/common-api/src/main/java/org/jboss/security/authz/model/AttributeExpression.java 2009-04-05 14:58:26 UTC (rev 13151)
@@ -32,6 +32,7 @@
{
private String functionId = null;
private Attribute attribute = null;
+ private boolean designatorMustBePresent = true; //mustbepresent by default
public AttributeExpression()
{
@@ -72,5 +73,23 @@
public void setFunctionId(String functionId)
{
this.functionId = functionId;
- }
+ }
+
+ /**
+ *
+ * @return
+ */
+ public boolean designatorMustBePresent()
+ {
+ return designatorMustBePresent;
+ }
+
+ /**
+ *
+ * @param designatorMustBePresent
+ */
+ public void setDesignatorMustBePresent(boolean designatorMustBePresent)
+ {
+ this.designatorMustBePresent = designatorMustBePresent;
+ }
}
Modified: modules/authorization/trunk/common-api/src/main/java/org/jboss/security/authz/xacml/AttributeDesignatorUtil.java
===================================================================
--- modules/authorization/trunk/common-api/src/main/java/org/jboss/security/authz/xacml/AttributeDesignatorUtil.java 2009-04-03 20:33:51 UTC (rev 13150)
+++ modules/authorization/trunk/common-api/src/main/java/org/jboss/security/authz/xacml/AttributeDesignatorUtil.java 2009-04-05 14:58:26 UTC (rev 13151)
@@ -43,7 +43,7 @@
* @param attribute
* @return
*/
- public static AttributeDesignatorType getAttributeDesignator(Attribute attribute)
+ public static AttributeDesignatorType getAttributeDesignator(Attribute attribute, boolean mustBePresent)
{
AttributeDesignatorType attributeDesignator = null;
@@ -57,11 +57,11 @@
)
{
attributeDesignator = PolicyAttributeFactory.createSubjectAttributeDesignatorType(attribute.getUri(),
- attribute.getDatatType(), null, true, null);
+ attribute.getDatatType(), null, mustBePresent, null);
}
else
{
- attributeDesignator = PolicyAttributeFactory.createAttributeDesignatorType(attribute.getUri(), attribute.getDatatType(), null, true);
+ attributeDesignator = PolicyAttributeFactory.createAttributeDesignatorType(attribute.getUri(), attribute.getDatatType(), null, mustBePresent);
}
return attributeDesignator;
@@ -72,12 +72,12 @@
* @param attribute
* @return
*/
- public static JAXBElement<? extends AttributeDesignatorType> getAttributeDesignatorXml(Attribute attribute)
+ public static JAXBElement<? extends AttributeDesignatorType> getAttributeDesignatorXml(Attribute attribute, boolean mustBePresent)
{
JAXBElement<? extends AttributeDesignatorType> xmlRep = null;
ObjectFactory objectFactory = new ObjectFactory();
- AttributeDesignatorType attributeDesignator = AttributeDesignatorUtil.getAttributeDesignator(attribute);
+ AttributeDesignatorType attributeDesignator = AttributeDesignatorUtil.getAttributeDesignator(attribute, mustBePresent);
if(attributeDesignator instanceof SubjectAttributeDesignatorType)
{
Added: modules/authorization/trunk/core-components-api/src/main/java/org/jboss/security/authz/components/action/http/Delete.java
===================================================================
--- modules/authorization/trunk/core-components-api/src/main/java/org/jboss/security/authz/components/action/http/Delete.java (rev 0)
+++ modules/authorization/trunk/core-components-api/src/main/java/org/jboss/security/authz/components/action/http/Delete.java 2009-04-05 14:58:26 UTC (rev 13151)
@@ -0,0 +1,37 @@
+/*
+* 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.security.authz.components.action.http;
+
+import org.jboss.security.authz.components.action.Operation;
+
+/**
+ * Get represents a "GET" action that can be performed on a Http Servlet
+ *
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ */
+public class Delete extends Operation
+{
+ public Delete()
+ {
+ this.name = "delete";
+ }
+}
Added: modules/authorization/trunk/core-components-api/src/main/java/org/jboss/security/authz/components/action/http/Head.java
===================================================================
--- modules/authorization/trunk/core-components-api/src/main/java/org/jboss/security/authz/components/action/http/Head.java (rev 0)
+++ modules/authorization/trunk/core-components-api/src/main/java/org/jboss/security/authz/components/action/http/Head.java 2009-04-05 14:58:26 UTC (rev 13151)
@@ -0,0 +1,37 @@
+/*
+* 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.security.authz.components.action.http;
+
+import org.jboss.security.authz.components.action.Operation;
+
+/**
+ * Get represents a "GET" action that can be performed on a Http Servlet
+ *
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ */
+public class Head extends Operation
+{
+ public Head()
+ {
+ this.name = "head";
+ }
+}
Added: modules/authorization/trunk/core-components-api/src/main/java/org/jboss/security/authz/components/action/http/Options.java
===================================================================
--- modules/authorization/trunk/core-components-api/src/main/java/org/jboss/security/authz/components/action/http/Options.java (rev 0)
+++ modules/authorization/trunk/core-components-api/src/main/java/org/jboss/security/authz/components/action/http/Options.java 2009-04-05 14:58:26 UTC (rev 13151)
@@ -0,0 +1,37 @@
+/*
+* 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.security.authz.components.action.http;
+
+import org.jboss.security.authz.components.action.Operation;
+
+/**
+ * Get represents a "GET" action that can be performed on a Http Servlet
+ *
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ */
+public class Options extends Operation
+{
+ public Options()
+ {
+ this.name = "options";
+ }
+}
Added: modules/authorization/trunk/core-components-api/src/main/java/org/jboss/security/authz/components/action/http/Put.java
===================================================================
--- modules/authorization/trunk/core-components-api/src/main/java/org/jboss/security/authz/components/action/http/Put.java (rev 0)
+++ modules/authorization/trunk/core-components-api/src/main/java/org/jboss/security/authz/components/action/http/Put.java 2009-04-05 14:58:26 UTC (rev 13151)
@@ -0,0 +1,37 @@
+/*
+* 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.security.authz.components.action.http;
+
+import org.jboss.security.authz.components.action.Operation;
+
+/**
+ * Get represents a "GET" action that can be performed on a Http Servlet
+ *
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ */
+public class Put extends Operation
+{
+ public Put()
+ {
+ this.name = "put";
+ }
+}
Added: modules/authorization/trunk/core-components-api/src/main/java/org/jboss/security/authz/components/action/http/Trace.java
===================================================================
--- modules/authorization/trunk/core-components-api/src/main/java/org/jboss/security/authz/components/action/http/Trace.java (rev 0)
+++ modules/authorization/trunk/core-components-api/src/main/java/org/jboss/security/authz/components/action/http/Trace.java 2009-04-05 14:58:26 UTC (rev 13151)
@@ -0,0 +1,37 @@
+/*
+* 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.security.authz.components.action.http;
+
+import org.jboss.security.authz.components.action.Operation;
+
+/**
+ * Get represents a "GET" action that can be performed on a Http Servlet
+ *
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ */
+public class Trace extends Operation
+{
+ public Trace()
+ {
+ this.name = "trace";
+ }
+}
Modified: modules/authorization/trunk/core-components-api/src/main/java/org/jboss/security/authz/components/resource/HttpResource.java
===================================================================
--- modules/authorization/trunk/core-components-api/src/main/java/org/jboss/security/authz/components/resource/HttpResource.java 2009-04-03 20:33:51 UTC (rev 13150)
+++ modules/authorization/trunk/core-components-api/src/main/java/org/jboss/security/authz/components/resource/HttpResource.java 2009-04-05 14:58:26 UTC (rev 13151)
@@ -113,7 +113,8 @@
{
String value = this.parameters.get(name);
- AttributeExpression paramExpression = ExpressionBuilder.getInstance().createCustomResourceExpression(name, value);
+ AttributeExpression paramExpression = ExpressionBuilder.getInstance().createCustomResourceExpression(name, value);
+ paramExpression.setDesignatorMustBePresent(false);
metadata.getTarget().addResourceMatch(paramExpression);
}
}
Modified: modules/authorization/trunk/core-components-api/src/test/java/org/jboss/security/authz/test/MockPolicy.java
===================================================================
--- modules/authorization/trunk/core-components-api/src/test/java/org/jboss/security/authz/test/MockPolicy.java 2009-04-03 20:33:51 UTC (rev 13150)
+++ modules/authorization/trunk/core-components-api/src/test/java/org/jboss/security/authz/test/MockPolicy.java 2009-04-05 14:58:26 UTC (rev 13151)
@@ -110,7 +110,7 @@
ResourceMatchType rmt = new ResourceMatchType();
rmt.setMatchId(resourceMatch.getFunctionId());
- rmt.setResourceAttributeDesignator(AttributeDesignatorUtil.getAttributeDesignator(resourceMatch.getAttribute()));
+ rmt.setResourceAttributeDesignator(AttributeDesignatorUtil.getAttributeDesignator(resourceMatch.getAttribute(), true));
rmt.setAttributeValue(PolicyAttributeFactory
.createStringAttributeType(resourceMatch.getAttribute().getValue()));
@@ -194,7 +194,7 @@
ActionMatchType amct = new ActionMatchType();
amct.setMatchId(action.getFunctionId());
amct.setAttributeValue(PolicyAttributeFactory.createStringAttributeType(action.getAttribute().getValue()));
- amct.setActionAttributeDesignator(AttributeDesignatorUtil.getAttributeDesignator(action.getAttribute()));
+ amct.setActionAttributeDesignator(AttributeDesignatorUtil.getAttributeDesignator(action.getAttribute(), true));
actionType.getActionMatch().add(amct);
actions.getAction().add(actionType);
}
@@ -212,7 +212,7 @@
SubjectMatchType match = new SubjectMatchType();
match.setMatchId(subject.getFunctionId());
match.setAttributeValue(PolicyAttributeFactory.createStringAttributeType(subject.getAttribute().getValue()));
- match.setSubjectAttributeDesignator((SubjectAttributeDesignatorType)AttributeDesignatorUtil.getAttributeDesignator(subject.getAttribute()));
+ match.setSubjectAttributeDesignator((SubjectAttributeDesignatorType)AttributeDesignatorUtil.getAttributeDesignator(subject.getAttribute(), true));
subjectType.getSubjectMatch().add(match);
subjects.getSubject().add(subjectType);
}
@@ -243,7 +243,7 @@
apply.getExpression().add(jaxbAttrValue);
//Place within the Context where this Value should exist during an Authorization Request
- apply.getExpression().add(AttributeDesignatorUtil.getAttributeDesignatorXml(attributeExpression.getAttribute()));
+ apply.getExpression().add(AttributeDesignatorUtil.getAttributeDesignatorXml(attributeExpression.getAttribute(), true));
condition.setExpression(objectFactory.createApply(apply));
Modified: modules/authorization/trunk/http-profile/src/main/java/org/jboss/security/authz/http/configuration/HttpPolicyConfig.java
===================================================================
--- modules/authorization/trunk/http-profile/src/main/java/org/jboss/security/authz/http/configuration/HttpPolicyConfig.java 2009-04-03 20:33:51 UTC (rev 13150)
+++ modules/authorization/trunk/http-profile/src/main/java/org/jboss/security/authz/http/configuration/HttpPolicyConfig.java 2009-04-05 14:58:26 UTC (rev 13151)
@@ -39,13 +39,20 @@
import org.w3c.dom.NodeList;
import org.jboss.security.authz.components.resource.HttpResource;
-import org.jboss.security.authz.components.action.http.Get;
-import org.jboss.security.authz.components.action.http.Post;
import org.jboss.security.authz.model.Policy;
import org.jboss.security.authz.tools.GeneralTool;
import org.jboss.security.authz.policy.server.plugin.HierarchialPolicy;
import org.jboss.security.authz.policy.server.spi.PolicyConfig;
+import org.jboss.security.authz.components.action.http.Get;
+import org.jboss.security.authz.components.action.http.Post;
+import org.jboss.security.authz.components.action.http.Delete;
+import org.jboss.security.authz.components.action.http.Head;
+import org.jboss.security.authz.components.action.http.Options;
+import org.jboss.security.authz.components.action.http.Put;
+import org.jboss.security.authz.components.action.http.Trace;
+
+
/**
* @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
*
@@ -166,6 +173,27 @@
{
methodResource.setHttpMethod(new Post());
}
+ else if(httpMethod.equalsIgnoreCase("put"))
+ {
+ methodResource.setHttpMethod(new Put());
+ }
+ else if(httpMethod.equalsIgnoreCase("delete"))
+ {
+ methodResource.setHttpMethod(new Delete());
+ }
+ else if(httpMethod.equalsIgnoreCase("head"))
+ {
+ methodResource.setHttpMethod(new Head());
+ }
+ else if(httpMethod.equalsIgnoreCase("options"))
+ {
+ methodResource.setHttpMethod(new Options());
+ }
+ else if(httpMethod.equalsIgnoreCase("trace"))
+ {
+ methodResource.setHttpMethod(new Trace());
+ }
+
webResources.add(methodResource);
}
}
Modified: modules/authorization/trunk/http-profile/src/main/java/org/jboss/security/authz/http/enforcement/SecurityFilter.java
===================================================================
--- modules/authorization/trunk/http-profile/src/main/java/org/jboss/security/authz/http/enforcement/SecurityFilter.java 2009-04-03 20:33:51 UTC (rev 13150)
+++ modules/authorization/trunk/http-profile/src/main/java/org/jboss/security/authz/http/enforcement/SecurityFilter.java 2009-04-05 14:58:26 UTC (rev 13151)
@@ -55,9 +55,15 @@
import org.jboss.security.authz.enforcement.Request;
import org.jboss.security.authz.enforcement.Response;
-import org.jboss.security.authz.components.action.Read;
import org.jboss.security.authz.components.resource.HttpResource;
import org.jboss.security.authz.components.subject.Roles;
+import org.jboss.security.authz.components.action.http.Get;
+import org.jboss.security.authz.components.action.http.Post;
+import org.jboss.security.authz.components.action.http.Delete;
+import org.jboss.security.authz.components.action.http.Head;
+import org.jboss.security.authz.components.action.http.Options;
+import org.jboss.security.authz.components.action.http.Put;
+import org.jboss.security.authz.components.action.http.Trace;
/**
@@ -148,14 +154,17 @@
//Process the authorization response and allow or deny further processing
if(!authzResponse.isAccessGranted())
{
- if(authzResponse.isIndeterminate() ||
- (authzResponse.isNotApplicable() && this.isPolicyMatchMandatory)
- )
+ if(authzResponse.isNotApplicable() && this.isPolicyMatchMandatory)
{
//Send back an access denied status
httpResponse.sendError(HttpServletResponse.SC_FORBIDDEN);
return;
}
+ else if(authzResponse.isIndeterminate())
+ {
+ httpResponse.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+ return;
+ }
}
chain.doFilter(request, response);
@@ -179,12 +188,7 @@
String uri = requestURI.substring(contextPath.length());
contextResource.setUri(new URI(uri));
- //Setup Role context
- //TODO: replace mock code with actual loading of Roles information of the authenticated user via the new Identity API
- Roles roles = new Roles();
- roles.addName("Admin");
- authzRequest.addSubject(roles.getSubject());
-
+
//Setup Parameter context
Enumeration parameters = httpRequest.getParameterNames();
while(parameters.hasMoreElements())
@@ -193,15 +197,46 @@
String value = httpRequest.getParameter(name);
contextResource.addParameter(name, value);
}
-
-
+
//Setup Resource context
authzRequest.addResource(contextResource.getResource());
//Setup Action context
- //TODO: add support for all the Http methods here and not just GET
- authzRequest.setAction(new Read().getAction());
+ if(httpRequest.getMethod().equalsIgnoreCase("get"))
+ {
+ authzRequest.setAction(new Get().getAction());
+ }
+ else if(httpRequest.getMethod().equalsIgnoreCase("post"))
+ {
+ authzRequest.setAction(new Post().getAction());
+ }
+ else if(httpRequest.getMethod().equalsIgnoreCase("put"))
+ {
+ authzRequest.setAction(new Put().getAction());
+ }
+ else if(httpRequest.getMethod().equalsIgnoreCase("delete"))
+ {
+ authzRequest.setAction(new Delete().getAction());
+ }
+ else if(httpRequest.getMethod().equalsIgnoreCase("head"))
+ {
+ authzRequest.setAction(new Head().getAction());
+ }
+ else if(httpRequest.getMethod().equalsIgnoreCase("options"))
+ {
+ authzRequest.setAction(new Options().getAction());
+ }
+ else if(httpRequest.getMethod().equalsIgnoreCase("trace"))
+ {
+ authzRequest.setAction(new Trace().getAction());
+ }
+ //Setup Role context
+ //TODO: replace mock code with actual loading of Roles information of the authenticated user via the new Identity API
+ Roles roles = new Roles();
+ roles.addName("Admin");
+ authzRequest.addSubject(roles.getSubject());
+
return authzRequest;
}
Modified: modules/authorization/trunk/http-profile/src/test/java/org/jboss/security/authz/http/container/TestSecurityFilterDeployment.java
===================================================================
--- modules/authorization/trunk/http-profile/src/test/java/org/jboss/security/authz/http/container/TestSecurityFilterDeployment.java 2009-04-03 20:33:51 UTC (rev 13150)
+++ modules/authorization/trunk/http-profile/src/test/java/org/jboss/security/authz/http/container/TestSecurityFilterDeployment.java 2009-04-05 14:58:26 UTC (rev 13151)
@@ -29,6 +29,7 @@
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.HttpStatus;
import org.apache.commons.httpclient.methods.GetMethod;
+import org.apache.commons.httpclient.NameValuePair;
/**
* @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
@@ -50,7 +51,7 @@
}
//------------------------------------------------------------------------------------------------------------------------------------------------------
- public void test() throws Exception
+ public void testAnonymousIndex() throws Exception
{
HttpClient client = new HttpClient();
String url = "http://localhost:8080/httpprofile-testsuite/index.html";
@@ -66,7 +67,40 @@
assertEquals("Request Failed!!", status, HttpStatus.SC_OK);
assertTrue("Proper content must be present!!", response.contains("<h1>Http Profile Container TestSuite</h1>"));
+ }
+
+ public void testAnonymousExecutiveWithParameters() throws Exception
+ {
+ HttpClient client = new HttpClient();
+ String url = "http://localhost:8080/httpprofile-testsuite/private/executives/testwithpa...";
+ GetMethod method = new GetMethod(url);
+ method.setQueryString(new NameValuePair[]{new NameValuePair("id", "1234")});
- Thread.currentThread().sleep(20000);
- }
+ int status = client.executeMethod(method);
+ String response = method.getResponseBodyAsString();
+
+ log.info("-----------------------------------------------------------");
+ log.info("Status="+status);
+ log.info(response);
+ log.info("-----------------------------------------------------------");
+
+ assertEquals("Request Should Have Been Denied!!", status, HttpStatus.SC_FORBIDDEN);
+ }
+
+ public void testAnonymousExecutiveIndex() throws Exception
+ {
+ HttpClient client = new HttpClient();
+ String url = "http://localhost:8080/httpprofile-testsuite/private/executives/index.html";
+ GetMethod method = new GetMethod(url);
+
+ int status = client.executeMethod(method);
+ String response = method.getResponseBodyAsString();
+
+ log.info("-----------------------------------------------------------");
+ log.info("Status="+status);
+ log.info(response);
+ log.info("-----------------------------------------------------------");
+
+ assertEquals("Request Should Have Been Denied!!", status, HttpStatus.SC_FORBIDDEN);
+ }
}
Modified: modules/authorization/trunk/http-profile/src/test/resources/http-policy.xml
===================================================================
--- modules/authorization/trunk/http-profile/src/test/resources/http-policy.xml 2009-04-03 20:33:51 UTC (rev 13150)
+++ modules/authorization/trunk/http-profile/src/test/resources/http-policy.xml 2009-04-05 14:58:26 UTC (rev 13151)
@@ -47,7 +47,7 @@
</ip-range>
</ip-address>
-->
- <!-- constraints based on data and/or time -->
+ <!-- constraints based on date and/or time -->
</auth-constraint>
</security-constraint>
Modified: modules/authorization/trunk/http-profile/src/test/resources/httpprofile-testsuite.war/WEB-INF/http-policy.xml
===================================================================
--- modules/authorization/trunk/http-profile/src/test/resources/httpprofile-testsuite.war/WEB-INF/http-policy.xml 2009-04-03 20:33:51 UTC (rev 13150)
+++ modules/authorization/trunk/http-profile/src/test/resources/httpprofile-testsuite.war/WEB-INF/http-policy.xml 2009-04-05 14:58:26 UTC (rev 13151)
@@ -12,31 +12,28 @@
The protection can be increased depending on the application by changing this to "true". In which case only Http Requests that have a matching "Security Policy" will
be considered for "Access Control". All others will be "Denied" access.
-->
- <policy-match-mandatory>true</policy-match-mandatory>
+ <policy-match-mandatory>false</policy-match-mandatory>
</enforcement-config>
<security-constraint>
<web-resource-collection>
<web-resource>
- <web-resource-name>Executive Files</web-resource-name>
+ <web-resource-name>Testing for Resources with Parameters</web-resource-name>
<url-pattern>/private/executives/*</url-pattern>
<parameters>
<parameter name="id">1234</parameter>
</parameters>
+ <http-method>GET</http-method>
+ <http-method>POST</http-method>
<http-method>DELETE</http-method>
<http-method>PUT</http-method>
<http-method>HEAD</http-method>
<http-method>OPTIONS</http-method>
- <http-method>TRACE</http-method>
- <http-method>GET</http-method>
- <http-method>POST</http-method>
+ <http-method>TRACE</http-method>
</web-resource>
<web-resource>
- <web-resource-name>Board/Investor Files</web-resource-name>
- <url-pattern>/private/board/*</url-pattern>
- <parameters>
- <parameter name="id">5678</parameter>
- </parameters>
+ <web-resource-name>Concrete Resource without parameters</web-resource-name>
+ <url-pattern>/private/executives/index.html</url-pattern>
</web-resource>
</web-resource-collection>
<auth-constraint>
@@ -44,29 +41,7 @@
<roles allow="true">
<role-name>Admin</role-name>
<role-name>Executive</role-name>
- </roles>
- <roles allow="false">
- <role-name>Manager</role-name>
- <role-name>Developer</role-name>
- </roles>
-
- <!-- constants based on ip address of the connecting machine -->
- <!--
- Still need to implement this functionality
- <ip-address allow="true">
- <ip-range>
- <address-from></address-from>
- <address-to></address-to>
- </ip-range>
- </ip-address>
- <ip-address allow="false">
- <ip-range>
- <address-from></address-from>
- <address-to></address-to>
- </ip-range>
- </ip-address>
- -->
- <!-- constraints based on data and/or time -->
+ </roles>
</auth-constraint>
</security-constraint>
</web-security>
\ No newline at end of file
Added: modules/authorization/trunk/http-profile/src/test/resources/httpprofile-testsuite.war/private/executives/testwithparams.html
===================================================================
--- modules/authorization/trunk/http-profile/src/test/resources/httpprofile-testsuite.war/private/executives/testwithparams.html (rev 0)
+++ modules/authorization/trunk/http-profile/src/test/resources/httpprofile-testsuite.war/private/executives/testwithparams.html 2009-04-05 14:58:26 UTC (rev 13151)
@@ -0,0 +1,8 @@
+<html>
+ <head>
+ <title>Http Profile Container TestSuite</title>
+ </head>
+ <body>
+ <h1>Test With Parameter Matching......</h1>
+ </body>
+</html>
\ No newline at end of file
Modified: modules/authorization/trunk/policy-server/src/main/java/org/jboss/security/authz/policy/server/plugin/HierarchialPolicy.java
===================================================================
--- modules/authorization/trunk/policy-server/src/main/java/org/jboss/security/authz/policy/server/plugin/HierarchialPolicy.java 2009-04-03 20:33:51 UTC (rev 13150)
+++ modules/authorization/trunk/policy-server/src/main/java/org/jboss/security/authz/policy/server/plugin/HierarchialPolicy.java 2009-04-05 14:58:26 UTC (rev 13151)
@@ -114,8 +114,11 @@
{
ResourceMatchType rmt = new ResourceMatchType();
- rmt.setMatchId(resourceMatch.getFunctionId());
- rmt.setResourceAttributeDesignator(AttributeDesignatorUtil.getAttributeDesignator(resourceMatch.getAttribute()));
+ rmt.setMatchId(resourceMatch.getFunctionId());
+
+ rmt.setResourceAttributeDesignator(AttributeDesignatorUtil.getAttributeDesignator(resourceMatch.getAttribute(), resourceMatch.
+ designatorMustBePresent()));
+
rmt.setAttributeValue(PolicyAttributeFactory
.createStringAttributeType(resourceMatch.getAttribute().getValue()));
@@ -211,7 +214,7 @@
ActionMatchType amct = new ActionMatchType();
amct.setMatchId(action.getFunctionId());
amct.setAttributeValue(PolicyAttributeFactory.createStringAttributeType(action.getAttribute().getValue()));
- amct.setActionAttributeDesignator(AttributeDesignatorUtil.getAttributeDesignator(action.getAttribute()));
+ amct.setActionAttributeDesignator(AttributeDesignatorUtil.getAttributeDesignator(action.getAttribute(), true));
actionType.getActionMatch().add(amct);
actions.getAction().add(actionType);
}
@@ -229,7 +232,7 @@
SubjectMatchType match = new SubjectMatchType();
match.setMatchId(subject.getFunctionId());
match.setAttributeValue(PolicyAttributeFactory.createStringAttributeType(subject.getAttribute().getValue()));
- match.setSubjectAttributeDesignator((SubjectAttributeDesignatorType)AttributeDesignatorUtil.getAttributeDesignator(subject.getAttribute()));
+ match.setSubjectAttributeDesignator((SubjectAttributeDesignatorType)AttributeDesignatorUtil.getAttributeDesignator(subject.getAttribute(), true));
subjectType.getSubjectMatch().add(match);
subjects.getSubject().add(subjectType);
}
@@ -260,7 +263,7 @@
apply.getExpression().add(jaxbAttrValue);
//Place within the Context where this Value should exist during an Authorization Request
- apply.getExpression().add(AttributeDesignatorUtil.getAttributeDesignatorXml(attributeExpression.getAttribute()));
+ apply.getExpression().add(AttributeDesignatorUtil.getAttributeDesignatorXml(attributeExpression.getAttribute(), true));
condition.setExpression(objectFactory.createApply(apply));
15 years, 2 months
JBoss Portal SVN: r13150 - branches/JBoss_Portal_Branch_2_7/build.
by portal-commits@lists.jboss.org
Author: prabhat.jha(a)jboss.com
Date: 2009-04-03 16:33:51 -0400 (Fri, 03 Apr 2009)
New Revision: 13150
Modified:
branches/JBoss_Portal_Branch_2_7/build/build-thirdparty.xml
Log:
upgrading bridge to 1.0.0.CR1
Modified: branches/JBoss_Portal_Branch_2_7/build/build-thirdparty.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_7/build/build-thirdparty.xml 2009-04-03 19:35:17 UTC (rev 13149)
+++ branches/JBoss_Portal_Branch_2_7/build/build-thirdparty.xml 2009-04-03 20:33:51 UTC (rev 13150)
@@ -94,7 +94,7 @@
<componentref name="ehcache" version="1.2.2"/>
<componentref name="el" version="1.0"/>
<componentref name="facelets" version="1.1.15-B1"/>
- <componentref name="jboss/portlet-bridge" version="1.0.0.B6"/>
+ <componentref name="jboss/portlet-bridge" version="1.0.0.CR1"/>
<componentref name="hibernate" version="3.2.4.SP1_CP06-brew"/>
<componentref name="httpunit" version="1.6"/>
<componentref name="hsqldb" version="1.8.0.8.patch01-brew"/>
15 years, 3 months
JBoss Portal SVN: r13149 - in branches/JBoss_Portal_Branch_2_7: wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer and 1 other directory.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2009-04-03 15:35:17 -0400 (Fri, 03 Apr 2009)
New Revision: 13149
Modified:
branches/JBoss_Portal_Branch_2_7/core-wsrp/build.xml
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/MarkupTestCase.java
Log:
- Adapted test cases to change in behavior with & encoding. Note that & should still be encoded as & when going through the WS stack (which is not the case for the tests).
Modified: branches/JBoss_Portal_Branch_2_7/core-wsrp/build.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-wsrp/build.xml 2009-04-03 14:21:49 UTC (rev 13148)
+++ branches/JBoss_Portal_Branch_2_7/core-wsrp/build.xml 2009-04-03 19:35:17 UTC (rev 13149)
@@ -1,24 +1,24 @@
<?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 ~
+ ~ Copyright 2009, 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. ~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
@@ -152,10 +152,10 @@
<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"/>
+ <taskdef
+ name="explode"
+ classname="org.jboss.portal.common.ant.Explode"
+ classpathref="explode.task.classpath"/>
</target>
<!--+====================================================================+-->
@@ -209,11 +209,9 @@
<fileset dir="${jboss/portlet.bridge.lib}" includes="portletbridge-impl.jar"/>
<fileset dir="${build.lib}" includes="portal-wsrp-admin-lib.jar"/>
<fileset dir="${jboss.portal-faces.root}/lib" includes="portal-faces-lib.jar"/>
- <!--<fileset dir="${el.el.lib}" includes="el-api.jar,el-ri.jar"/>-->
<fileset dir="${apache.lang.lib}" includes="commons-lang.jar"/>
<fileset dir="${apache.beanutils.lib}" includes="commons-beanutils.jar"/>
<fileset dir="${apache.digester.lib}" includes="commons-digester.jar"/>
- <!--<fileset dir="${commons.el.lib}" includes="commons-el.jar"/>-->
</copy>
<copy todir="${build.wsrp-admin.war}/WEB-INF/lib">
@@ -225,9 +223,9 @@
<fileset dir="${build.resources}/portal-wsrp-admin-war" includes="**/*"/>
</copy>
- <copy todir="${build.resources}/portal-wsrp-admin.war">
- <fileset dir="${source.bin}/portal-wsrp-admin-war" includes="**/*"/>
- </copy>
+ <copy todir="${build.resources}/portal-wsrp-admin.war">
+ <fileset dir="${source.bin}/portal-wsrp-admin-war" includes="**/*"/>
+ </copy>
<jar jarfile="${build.lib}/portal-wsrp-admin.war">
<fileset dir="${build.resources}/portal-wsrp-admin.war" includes="**/*"/>
@@ -240,7 +238,7 @@
dir="${build.resources}/portal-wsrp-admin-sar"
tofile="${build.lib}/portal-wsrp-admin.sar"/-->
- </target>
+ </target>
<!-- ================================================================== -->
<!-- Cleaning -->
@@ -291,9 +289,9 @@
<target name="package-other-test" description="Generates the other test artifacts" depends="compile">
<mkdir dir="${build.lib.test}"/>
<jar jarfile="${build.lib.test}/test-other-lib.jar">
- <fileset dir="${build.classes}/">
- <include name="org/jboss/portal/test/wsrp/other/*.class"/>
- </fileset>
+ <fileset dir="${build.classes}/">
+ <include name="org/jboss/portal/test/wsrp/other/*.class"/>
+ </fileset>
</jar>
</target>
Modified: branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/MarkupTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/MarkupTestCase.java 2009-04-03 14:21:49 UTC (rev 13148)
+++ branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/MarkupTestCase.java 2009-04-03 19:35:17 UTC (rev 13149)
@@ -1,6 +1,6 @@
/******************************************************************************
* JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * Copyright 2009, 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. *
@@ -61,7 +61,7 @@
private static final String DEFAULT_MARKUP_PORTLET_WAR = "test-markup-portlet.war";
public MarkupTestCase()
- throws Exception
+ throws Exception
{
super("MarkupTestCase", DEFAULT_MARKUP_PORTLET_WAR);
}
@@ -115,9 +115,9 @@
MarkupResponse response = markupService.getMarkup(getMarkup);
- checkMarkupResponse(response, "<form method='post' action='wsrp_rewrite?wsrp-urlType=blockingAction&wsrp" +
- "-interactionState=JBPNS_/wsrp_rewrite' id='wsrp_rewrite_portfolioManager'><table><tr><td>Stock symbol</t" +
- "d><td><input name='symbol'/></td></tr><tr><td><input type='submit' value='Submit'></td></tr></table></form>");
+ checkMarkupResponse(response, "<form method='post' action='wsrp_rewrite?wsrp-urlType=blockingAction&wsrp" +
+ "-interactionState=JBPNS_/wsrp_rewrite' id='wsrp_rewrite_portfolioManager'><table><tr><td>Stock symbol</t" +
+ "d><td><input name='symbol'/></td></tr><tr><td><input type='submit' value='Submit'></td></tr></table></form>");
}
public void testGetMarkupRenderParameters() throws Exception
@@ -155,7 +155,7 @@
// let's see now if we can increment the counter
PerformBlockingInteraction performBlockingInteraction =
- WSRPTypeFactory.createDefaultPerformBlockingInteraction(getHandleForCurrentlyDeployedArchive());
+ WSRPTypeFactory.createDefaultPerformBlockingInteraction(getHandleForCurrentlyDeployedArchive());
InteractionParams interactionParams = performBlockingInteraction.getInteractionParams();
interactionParams.setInteractionState(incrementAction.getInteractionState().getStringValue());
markupService.performBlockingInteraction(performBlockingInteraction);
@@ -223,7 +223,7 @@
public void testPerformBlockingInteractionRedirect() throws Exception
{
PerformBlockingInteraction performBlockingInteraction =
- WSRPTypeFactory.createDefaultPerformBlockingInteraction(getDefaultHandle());
+ WSRPTypeFactory.createDefaultPerformBlockingInteraction(getDefaultHandle());
InteractionParams interactionParams = performBlockingInteraction.getInteractionParams();
NamedString[] formParams = {new NamedString("symbol", "HELP")}; // crappy way but this is a test! ;)
interactionParams.setFormParameters(formParams);
@@ -436,8 +436,8 @@
GetMarkup getMarkup = createMarkupRequestForCurrentlyDeployedPortlet();
MarkupResponse response = markupService.getMarkup(getMarkup);
- checkMarkupResponse(response, "wsrp_rewrite?wsrp-urlType=blockingAction&wsrp-interactionState=JBPNS_/wsrp_rewrite\n" +
- "wsrp_rewrite?wsrp-urlType=render&wsrp-navigationalState=JBPNS_/wsrp_rewrite");
+ checkMarkupResponse(response, "wsrp_rewrite?wsrp-urlType=blockingAction&wsrp-interactionState=JBPNS_/wsrp_rewrite\n" +
+ "wsrp_rewrite?wsrp-urlType=render&wsrp-navigationalState=JBPNS_/wsrp_rewrite");
}
finally
{
@@ -474,7 +474,7 @@
try
{
PerformBlockingInteraction action =
- WSRPTypeFactory.createDefaultPerformBlockingInteraction(getHandleForCurrentlyDeployedArchive());
+ WSRPTypeFactory.createDefaultPerformBlockingInteraction(getHandleForCurrentlyDeployedArchive());
action.getInteractionParams().setFormParameters(new NamedString[]{new NamedString("multi", "value1")});
BlockingInteractionResponse actionResponse = markupService.performBlockingInteraction(action);
GetMarkup markupRequest = createMarkupRequestForCurrentlyDeployedPortlet();
@@ -483,7 +483,7 @@
checkMarkupResponse(response, "multi: value1");
action.getInteractionParams().setFormParameters(new NamedString[]{
- new NamedString("multi", "value1"), new NamedString("multi", "value2")});
+ new NamedString("multi", "value1"), new NamedString("multi", "value2")});
actionResponse = markupService.performBlockingInteraction(action);
markupRequest = createMarkupRequestForCurrentlyDeployedPortlet();
markupRequest.getMarkupParams().setNavigationalState(actionResponse.getUpdateResponse().getNavigationalState());
@@ -685,7 +685,7 @@
private String checkPBIAndGetNavigationalState(String symbol) throws Exception
{
PerformBlockingInteraction performBlockingInteraction =
- WSRPTypeFactory.createDefaultPerformBlockingInteraction(getDefaultHandle());
+ WSRPTypeFactory.createDefaultPerformBlockingInteraction(getDefaultHandle());
InteractionParams interactionParams = performBlockingInteraction.getInteractionParams();
NamedString[] formParams = {new NamedString("symbol", symbol)};
interactionParams.setFormParameters(formParams);
@@ -722,7 +722,7 @@
ExtendedAssert.assertNotNull(markupContext);
String markupString = markupContext.getMarkupString();
ExtendedAssert.assertString1ContainsString2(markupString, "count = " + count);
- ExtendedAssert.assertString1ContainsString2(markupString, "<a href='wsrp_rewrite?wsrp-urlType=render&wsrp-navigationalState=JBPNS_/wsrp_rewrite'>render</a>");
+ ExtendedAssert.assertString1ContainsString2(markupString, "<a href='wsrp_rewrite?wsrp-urlType=render&wsrp-navigationalState=JBPNS_/wsrp_rewrite'>render</a>");
// checking session
checkSessionForCurrentlyDeployedPortlet(response);
15 years, 3 months
JBoss Portal SVN: r13148 - branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium.
by portal-commits@lists.jboss.org
Author: vrockai
Date: 2009-04-03 10:21:49 -0400 (Fri, 03 Apr 2009)
New Revision: 13148
Modified:
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/DashboardTestCase.java
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/IdentityAdminTestCase.java
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/PortalSamplesTestCase.java
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/UserLoginTestCase.java
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/WSRPTestCase.java
Log:
[selenium] - test descriptions in javadoc
Modified: branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/DashboardTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/DashboardTestCase.java 2009-04-02 23:22:35 UTC (rev 13147)
+++ branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/DashboardTestCase.java 2009-04-03 14:21:49 UTC (rev 13148)
@@ -12,6 +12,8 @@
public class DashboardTestCase extends JBossPortalSeleniumTestCase {
+ private static final String MSG_POWER = "Powered by JBoss Enterprise Portal Platform";
+
public String casePfx = "dash.";
private final String LNK_POR_WEA_EDIT = getProp(casePfx + "lnk.por.wea.edit", "//body/div[2]/div/div/div[2]/div/div/div/div/div/div/table/tbody/tr/td[2]/div/div/div[2]/span/a");
@@ -61,7 +63,7 @@
@Test(enabled = true)
public void testCreatePage() {
selenium.click(LNK_DASHBOARD);
-
+ selenium.setSpeed("5000");
// selenium.waitForPageToLoad(PAGE_LOAD);
wait(5000);
@@ -75,10 +77,11 @@
selenium.click(LNK_DASHBOARD);
selenium.waitForPageToLoad(PAGE_LOAD);
+ waitFor(AJAX_LOAD);
Assert.assertTrue(selenium.isElementPresent("link=" + pageName));
selenium.click("link=" + pageName);
selenium.waitForPageToLoad(PAGE_LOAD);
- Assert.assertTrue(selenium.isTextPresent("Powered by JBoss Portal"));
+ Assert.assertTrue(selenium.isTextPresent(MSG_POWER));
}
@Test(enabled = true, dependsOnMethods = { "testCreatePage" })
@@ -100,10 +103,11 @@
selenium.click(LNK_DASHBOARD);
selenium.waitForPageToLoad(PAGE_LOAD);
+ waitFor(AJAX_LOAD);
Assert.assertTrue(selenium.isElementPresent("link=" + pageName));
selenium.click("link=" + pageName);
selenium.waitForPageToLoad(PAGE_LOAD);
- Assert.assertTrue(selenium.isTextPresent("Powered by JBoss Portal"));
+ Assert.assertTrue(selenium.isTextPresent(MSG_POWER));
// then rename it
selenium.click(LNK_CONFIGURE_DASHBOARD);
@@ -334,7 +338,7 @@
selenium.click("link=" + pageName);
selenium.waitForPageToLoad(PAGE_LOAD);
- Assert.assertTrue(selenium.isTextPresent("Powered by JBoss Portal"));
+ Assert.assertTrue(selenium.isTextPresent(MSG_POWER));
// add weather portlet
selenium.open("/portal/");
Modified: branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/IdentityAdminTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/IdentityAdminTestCase.java 2009-04-02 23:22:35 UTC (rev 13147)
+++ branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/IdentityAdminTestCase.java 2009-04-03 14:21:49 UTC (rev 13148)
@@ -14,7 +14,7 @@
@Test(groups = { "admin_ui" }, enabled = true)
public class IdentityAdminTestCase extends JBossPortalSeleniumTestCase {
-
+ /** prefix for locator properties */
public String casePfx = "iden.man.";
private final String INP_USER_SEARCH_PREV = getProp(casePfx + "inp.user.search.prev", "//input[contains(@id,'search-user-form1:prev-page')]");
@@ -118,6 +118,12 @@
* }
*/
+ /**
+ * Test create user is responsible for user creation.
+ * It creates a user named "tempUser" with password "TempPassword" and e-mail "tempUser(a)redhat.com".
+ * Then it tries to look up the user with search function.
+ * At the end, it deletes the temp user.
+ */
@Test(enabled = true, description = "Creation of new user.")
public void testCreateUser() {
createUser("tempUser", "tempPassword", "tempUser(a)redhat.com");
@@ -125,6 +131,13 @@
deleteUser("tempUser", "tempUser(a)redhat.com");
}
+ /**
+ * Test create existing user is respnosible for testing already created user creation.
+ * It creates a user named "tempUser" with password "TempPassword" and e-mail "tempUser(a)redhat.com".
+ * Then it tries to look up the user with search function.
+ * After success it tries to create the same user again and asserts that it is not possible.
+ * At the end, it deletes the temp user.
+ */
@Test(enabled = true, dependsOnMethods = { "testCreateUser" }, description = "Creation of already existing user.")
public void testCreateExistingUser() {
createUser("tempUser", "tempPassword", "tempUser(a)redhat.com");
@@ -133,6 +146,11 @@
deleteUser("tempUser", "tempUser(a)redhat.com");
}
+ /**
+ * Test create role is responsible for user creation.
+ * It creates a role named "tempRole" with display name "tempRoleDisplay".
+ * At the end, it deletes the temp user.
+ */
@Test(enabled = true, description = "Creation of new role.")
public void testCreateRole() {
String role = "tempRole";
@@ -140,12 +158,25 @@
deleteRole(role);
}
+ /**
+ * Test delete user is responsible for deleting a user.
+ * At first it creates user "deleteMe" with password "deleterPass" and e-mail "disableMe(a)redhat.com"
+ * At the end it deletes the user.
+ */
@Test(enabled = true, description = "Creating and deteling a user.")
public void testDeleteUser() {
createUser("deleteMe", "deleterPass", "disableMe(a)redhat.com");
deleteUser("deleteMe", "disableMe(a)redhat.com");
}
+ /**
+ * Test disable user is responsible for disabling a user.
+ * At first it creates user "disableMe" with password "disablePass" and e-mail "disableMe(a)redhat.com"
+ * After that, it logs out and try to login as disableMe/disablePass.
+ * After success it logs out again, and login as admin.
+ * It disables the disableMe user and tries to login as disableMe/disablePass again asserting that login is not possible ( message about disabled account has to appear ).
+ *
+ */
@Test(enabled = true, description = "Creating and disabling a user.")
public void testDisableUser() {
final String userName = "disableMe";
@@ -194,6 +225,13 @@
deleteUser(userName, userMail);
}
+ /**
+ * Test enable user is responsible for enabling a user.
+ * At first it creates user "enableMe" with password "enableMe" and e-mail "enableMe(a)redhat.com"
+ * Then it disables the user, asserts the user is really disabled and at the end it enables the user.
+ * Only the appereance (or non-appereance ) of the "Enable" button for the user is used for assertions.
+ */
+ //TODO better chcecking of the user status should be reconsidered (logging in)
@Test(enabled = true, dependsOnMethods = { "testDisableUser" }, description = "Enabling disabled user.")
public void testEnableUser() {
final String userName = "enableMe";
@@ -224,6 +262,13 @@
deleteUser(userName, userMail);
}
+ /**
+ * Test edit user is responsible for user editing.
+ * At first it creates user "editMe" with password "editPass" and e-mail "editMe(a)redhat.com".
+ * Then it searches for the user and click on edit link. The e-mail of user is changed to "editMe2(a)redhat.com".
+ * The user is searched again and assert for his e-mail is made at the end.
+ * The user is deleted at the end of this test.
+ */
@Test(enabled = true, description = "Editing a user.")
public void testEditUser() {
final String userName = "editMe";
@@ -251,26 +296,7 @@
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.type(INP_EDIT_USER_EMAIL, "editMe2(a)redhat.com");
- /*
- * selenium.select("profile-form:timezone",
- * "label=(GMT -12:00 hours) Eniwetok, Kwajalein");
- * selenium.select("profile-form:theme", "label=portal.industrial");
- * selenium.select("profile-form:locale", "label=Albanian");
- * selenium.type("profile-form:givenname", "Edit");
- * selenium.type("profile-form:lastname", "Meme");
- * selenium.type("profile-form:location", "Editoland");
- * selenium.type("profile-form:skype", "editor");
- * selenium.type("profile-form:icq", "112113114");
- * selenium.type("profile-form:aim", "83838495");
- * selenium.type("profile-form:msnm", "u8u8i9o0");
- * selenium.type("profile-form:yim", "99384875");
- * selenium.type("profile-form:xmmp", "10309128");
- * selenium.type("profile-form:homepage", "http://www.edit.com");
- * selenium.type("profile-form:occupation", "editor");
- * selenium.type("profile-form:interests", "editing");
- * selenium.type("profile-form:signature", "----\n\ni like to edit");
- * selenium.type("profile-form:extra", "me edit good");
- */
+
selenium.click(SUB_EDIT_PROF);
selenium.waitForPageToLoad(PAGE_LOAD);
Assert.assertTrue(selenium.isTextPresent("editMe2(a)redhat.com"), "Edited e-mail adress not visible.");
@@ -279,6 +305,12 @@
}
+ /**
+ * Test edit user change password is responsible for testing the change of password for a user.
+ * At first it creates user "changePass" with password "changePassPass" and e-mail "changePass(a)redhat.com".
+ * Then the password change orm is filled, but canceled. The next step is submitting the password change to new value "changePass2".
+ * At the end the test tries to login with the new password and then it deletes the "changePass" user.
+ */
@Test(enabled = true, description = "Editing a user - changing of password.")
public void testEditUserChangePassword() {
final String userName = "changePass";
@@ -338,6 +370,14 @@
deleteUser(userName, userMail);
}
+ /**
+ * Test role members is responsible for role assignment.
+ * At first it creates user "newRoleMember" with password "newRoleMember" and e-mail "newRoleMem(a)redhatqa.com".
+ * Then it creates role with name "membersRole" and display name "membersRoleDisplay".
+ * At next step it assignes the role to the user.
+ * It click for the "members" button for the "membersRole" and tries to find "newRoleMember".
+ * At the end it deletes the "newRoleMember" user and "membersRole" role.
+ */
@Test(enabled = true, description = "Managing members of role.")
public void testRoleMembers() {
final String roleName = "membersRole";
@@ -377,6 +417,11 @@
deleteUser(userName, userMail);
}
+ /**
+ * Test role edit is responsible for testing of role editing.
+ * At first it creates role with name "editRole" and display name "editRoleDisplay".
+ * At the end it change the display name to "editedRoleDisplay" and delete the role.
+ */
@Test(enabled = true, description = "Creation of new role.")
public void testRoleEdit() {
final String roleName = "editRole";
@@ -429,6 +474,10 @@
deleteRole(roleName);
}
+ /**
+ * @deprecated
+ * Test many users creates 25 users. The test is disabled.
+ */
@Test(enabled = false)
public void testManyUsers() {
for (int i = 0; i < 25; i++) {
@@ -436,6 +485,12 @@
}
}
+ /**
+ * Test search user count is responsible for the search functions for users..
+ * The test creates 95 users named man0us - man94us.
+ * Then it tests the paginator of the search functions. It sets count of results to 10,50 and 100,
+ * traverse through paginator and check, whether the amount of returned results is correct.
+ */
@Test(enabled = true, description = "Altering the number of rows in user search")
public void testSearchUserCount() {
Modified: branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/PortalSamplesTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/PortalSamplesTestCase.java 2009-04-02 23:22:35 UTC (rev 13147)
+++ branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/PortalSamplesTestCase.java 2009-04-03 14:21:49 UTC (rev 13148)
@@ -5,107 +5,117 @@
import org.testng.annotations.Test;
import static org.testng.Assert.*;
-
@Test(groups = { "test_samples" }, enabled = true)
public class PortalSamplesTestCase extends JBossPortalSeleniumTestCase {
-
+
public static long AJAX_TIMEOUT = 4500;
-
+
public static String casePfx = "samples.";
-
- private final String SES_LNK_INVALIDATE = getProp(casePfx+"ses.lnk.invalidate","link=invalidate");
- private final String RES_DIV_RTEXT = getProp(casePfx+"res.div.rtext","repeat-text");
- private final String RES_DIV_PTEXT = getProp(casePfx+"res.div.ptext","product-text");
- private final String RES_LNK_P3 = getProp(casePfx+"res.lnk.p3","link=Product3");
- private final String RES_LNK_P2 = getProp(casePfx+"res.lnk.p2","link=Product2");
- private final String RES_LNK_P1 = getProp(casePfx+"res.lnk.p1","link=Product1");
- private final String RES_INP = getProp(casePfx+"res.inp","repeat");
- private final String RES_LNK = getProp(casePfx+"res.lnk","link=serveResource Demo");
- private final String WIN_DIV_CON = getProp(casePfx+"win.div.con","//div[@id='regionB']/div/table/tbody/tr[2]/td[2]/div");
- private final String WIN_LNK = getProp(casePfx+"win.lnk","link=Window id test");
- private final String SES_TAB_PSCOPE = getProp(casePfx+"ses.tab.pscope","//html/body/div[2]/div/div/div[2]/div[2]/div/table/tbody/tr[2]/td[2]/div/table");
- private final String SES_TAB_ASCOPE = getProp(casePfx+"ses.tab.ascope","//html/body/div[2]/div/div/div[2]/div[2]/div/table/tbody/tr[2]/td[2]/div/table[2]");
- private final String SES_SUB_ASCOPE = getProp(casePfx+"ses.sub.ascope","application");
- private final String SES_SUB_PSCOPE = getProp(casePfx+"ses.sub.pscope","portlet");
- private final String SES_INP_VAL = getProp(casePfx+"ses.inp.val","value");
- private final String SES_INP_NAM = getProp(casePfx+"ses.inp.nam","name");
- private final String SES_LNK = getProp(casePfx+"ses.lnk","link=Session test");
- private final String PUB_1_LNK_FOO_REM = getProp(casePfx+"pub.1.lnk.foo.rem","link=Remove");
- private final String PUB_3_LNK_BAR_REM = getProp(casePfx+"pub.3.lnk.bar.rem","//div[@id='regionB']/div[2]/table/tbody/tr[2]/td[2]/div/form/table/tbody/tr[2]/td[2]/a");
- private final String PUB_3_LNK_JUU_REM = getProp(casePfx+"pub.3.lnk.juu.rem","//div[@id='regionB']/div[2]/table/tbody/tr[2]/td[2]/div/form/table/tbody/tr[1]/td[2]/a");
- private final String PUB_SUB_2 = getProp(casePfx+"pub.sub.2","//div[@id='regionB']/div[1]/table/tbody/tr[2]/td[2]/div/form/table/tbody/tr[3]/td/input");
- private final String PUB_SUB_1 = getProp(casePfx+"pub.sub.1","//input[@value='Update']");
- private final String PUB_DIV_3_BAR = getProp(casePfx+"pub.div.3.bar","//div[@id='regionB']/div[2]/table/tbody/tr[2]/td[2]/div/form/table/tbody/tr[2]/td[2]/input");
- private final String PUB_DIV_3_JUU = getProp(casePfx+"pub.div.3.juu","//div[@id='regionB']/div[2]/table/tbody/tr[2]/td[2]/div/form/table/tbody/tr[1]/td[2]/input");
- private final String PUB_DIV_2_JUU = getProp(casePfx+"pub.div.2.juu","juu");
- private final String PUB_DIV_2_FOO = getProp(casePfx+"pub.div.2.foo","//div[@id='regionB']/div[1]/table/tbody/tr[2]/td[2]/div/form/table/tbody/tr[1]/td[2]/input");
- private final String PUB_DIV_1_BAR = getProp(casePfx+"pub.div.1.bar","bar");
- private final String PUB_DIV_1_FOO = getProp(casePfx+"pub.div.1.foo","foo");
- private final String PUB_LNK = getProp(casePfx+"pub.lnk","link=Public parameters test");
- private final String PEVT_DIV_P3_MAX = getProp(casePfx+"pevt.div.p3.max","//div[@id='regionB']/div[3]/table/tbody/tr[1]/td[2]/div[2]/span[1]/a");
- private final String PEVT_DIV_P2_MAX = getProp(casePfx+"pevt.div.p2.max","//div[@id='regionB']/div[2]/table/tbody/tr[1]/td[2]/div[2]/span[1]/a");
- private final String PEVT_DIV_L3_MAX = getProp(casePfx+"pevt.div.l3.max","//div[@id='regionA']/div[3]/table/tbody/tr[1]/td[2]/div[2]/span[1]/a");
- private final String PEVT_DIV_L2_MAX = getProp(casePfx+"pevt.div.l2.max","//div[@id='regionA']/div[2]/table/tbody/tr[1]/td[2]/div[2]/span[1]/a");
- private final String PEVT_DIV_P3 = getProp(casePfx+"pevt.div.p3","//div[@id='regionB']/div[3]/table/tbody/tr[2]/td[2]/div/");
- private final String PEVT_DIV_P2 = getProp(casePfx+"pevt.div.p2","//div[@id='regionB']/div[2]/table/tbody/tr[2]/td[2]/div/");
- private final String PEVT_DIV_P1 = getProp(casePfx+"pevt.div.p1","//div[@id='regionB']/div[1]/table/tbody/tr[2]/td[2]/div/");
- private final String PEVT_DIV_L3 = getProp(casePfx+"pevt.div.l3","//div[@id='regionA']/div[3]/table/tbody/tr[2]/td[2]/div/");
- private final String PEVT_DIV_L2 = getProp(casePfx+"pevt.div.l2","//div[@id='regionA']/div[2]/table/tbody/tr[2]/td[2]/div/");
- private final String PEVT_DIV_L1 = getProp(casePfx+"pevt.div.l1","//div[@id='regionA']/div[1]/table/tbody/tr[2]/td[2]/div/");
- private final String PEVT_LNK = getProp(casePfx+"pevt.lnk","link=Page event test");
- private final String MOD_DIV_CON = getProp(casePfx+"mod.div.con","//div[@id='regionB']/div/table/tbody/tr[2]/td[2]/div");
- private final String MOD_LNK = getProp(casePfx+"mod.lnk","link=Mode test");
- private final String MPOR_DIV_CON = getProp(casePfx+"mpor.div.con","content-container");
- private final String MPOR_LNK = getProp(casePfx+"mpor.lnk","link=Missing portlet");
- private final String MINS_DIV_CON = getProp(casePfx+"mins.div.con","content-container");
- private final String MINS_LNK = getProp(casePfx+"mins.lnk","link=Missing instance");
- private final String JS_LNK_SUBMIT = getProp(casePfx+"js.lnk.submit","link=submit");
- private final String JS_OPT_3 = getProp(casePfx+"js.opt.3","//form[contains(@id,'_the_form')]/select/option[3]");
- private final String JS_OPT_2 = getProp(casePfx+"js.opt.2","//form[contains(@id,'_the_form')]/select/option[2]");
- private final String JS_OPT_1 = getProp(casePfx+"js.opt.1","//form[@id='jbpnsFormAutoSubmitPortletWindowsnpbj_the_form']/select/option[1]");
- private final String JS_LAB_C = getProp(casePfx+"js.lab.c","label=C");
- private final String JS_LAB_B = getProp(casePfx+"js.lab.b","label=B");
- private final String JS_LAB_A = getProp(casePfx+"js.lab.a","label=A");
- private final String JS_SEL_LETTER = getProp(casePfx+"js.sel.letter","//select[@onclick=\"document.getElementById('jbpnsFormAutoSubmitPortletWindowsnpbj_the_form').submit()\"]");
- private final String JS_LNK = getProp(casePfx+"js.lnk","link=Javascript test");
- private final String HEAD_INP_CONTENT = getProp(casePfx+"head.inp.content","Introducing-HeaderContentInput");
- private final String HEAD_DIV_CONTENT = getProp(casePfx+"head.div.content","Introducing-HeaderContent");
- private final String HEAD_LNK = getProp(casePfx+"head.lnk","link=Header test");
- private final String FS_LNK = getProp(casePfx+"fs.lnk","link=File system content");
- private final String EXC_LNK_PORTLET = getProp(casePfx+"exc.lnk.portlet","link=render PortletException");
- private final String EXC_LNK = getProp(casePfx+"exc.lnk","link=Exception test");
- private final String EVT_SUB_COLOR = getProp(casePfx+"evt.sub.color","//input[@type='submit']");
- private final String EVT_DIV_BLACK = getProp(casePfx+"evt.div.black","//div[@id='regionB']/div[2]/table/tbody/tr[2]/td[2]/div/div[contains(@style,'black')]");
- private final String EVT_DIV_RED = getProp(casePfx+"evt.div.red","//div[@id='regionB']/div[2]/table/tbody/tr[2]/td[2]/div/div[contains(@style,'red')]");
- private final String EVT_DIV_BLUE = getProp(casePfx+"evt.div.blue","//div[@id='regionB']/div[2]/table/tbody/tr[2]/td[2]/div/div[contains(@style,'blue')]");
- private final String EVT_SEL_LAB_BLACK = getProp(casePfx+"evt.sel.lab.black","label=black");
- private final String EVT_SEL_LAB_RED = getProp(casePfx+"evt.sel.lab.red","label=red");
- private final String EVT_SEL_LAB_BLUE = getProp(casePfx+"evt.sel.lab.blue","label=blue");
- private final String EVT_SEL_COL = getProp(casePfx+"evt.sel.col","color");
- private final String EVT_LNK = getProp(casePfx+"evt.lnk","link=Event test");
- private final String ENC_LNK = getProp(casePfx+"enc.lnk","link=Encoding test");
- private final String ENC_INP_REN = getProp(casePfx+"enc.inp.ren","text");
- private final String ENC_SUB_ACT = getProp(casePfx+"enc.sub.act","//input[@value='Submit to action phase']");
- private final String ENC_INP_ACT = getProp(casePfx+"enc.inp.act","//div[@id='regionB']/div/table/tbody/tr[2]/td[2]/div/div[1]/form[2]/input[1]");
- private final String ENC_TEXTAREA2 = getProp(casePfx+"enc.textarea2","//div[@id='regionB']/div/table/tbody/tr[2]/td[2]/div/div[5]/textarea");
- private final String ENC_TEXTAREA1 = getProp(casePfx+"enc.textarea1","//textarea[@name='text']");
- private final String CHAR_ALL_SUB_CHECK = getProp(casePfx+"char.all.sub.check","//html/body/div[2]/div/div/div[2]/div[2]/div/table/tbody/tr[2]/td[2]/div/div[8]/form/input[3]");
- private final String CHAR_INP_TEXT_SUB_CHECK = getProp(casePfx+"char.inp.text.sub.check","//div[@id='regionB']/div/table/tbody/tr[2]/td[2]/div/div[8]/form/input[3]");
- private final String CHAR_LNK_TEXTAREA_CHECK = getProp(casePfx+"char.lnk.textarea.check","//input[@value='check']");
- private final String CHAR_INP_TEXT = getProp(casePfx+"char.inp.text","//input[@name='text']");
- private final String CHAR_TEXTAREA = getProp(casePfx+"char.textarea","text");
- private final String CHAR_SUB_CHANGE = getProp(casePfx+"char.sub.change","//input[@value='change']");
- private final String CHAR_INP_TO = getProp(casePfx+"char.inp.to","to");
- private final String CHAR_INP_FROM = getProp(casePfx+"char.inp.from","from");
- private final String CHAR_LNK = getProp(casePfx+"char.lnk","link=Charset test");
- private final String CACHE_LNK = getProp(casePfx+"cache.lnk","link=Cache test");
- private final String CACHE_LNK_2REN = getProp(casePfx+"cache.lnk.2ren","//div[@id='regionB']/div[2]/table/tbody/tr[2]/td[2]/div/div[5]/a");
- private final String CACHE_LNK_2ACT = getProp(casePfx+"cache.lnk.2act","//div[@id='regionB']/div[2]/table/tbody/tr[2]/td[2]/div/div[4]/a");
- private final String CACHE_LNK_1REN = getProp(casePfx+"cache.lnk.1ren","link=render");
- private final String CACHE_LNK_1ACT = getProp(casePfx+"cache.lnk.1act","link=action");
- private final String CACHE_2RENDER = getProp(casePfx+"cache.2render","//div[@id='regionB']/div[2]/table/tbody/tr[2]/td[2]/div/div[2]/div");
- private final String CACHE_1RENDER = getProp(casePfx+"cache.1render","//div[@id='regionB']/div[1]/table/tbody/tr[2]/td[2]/div/div[2]/div");
+ private final String SES_LNK_INVALIDATE = getProp(casePfx + "ses.lnk.invalidate", "link=invalidate");
+ private final String RES_DIV_RTEXT = getProp(casePfx + "res.div.rtext", "repeat-text");
+ private final String RES_DIV_PTEXT = getProp(casePfx + "res.div.ptext", "product-text");
+ private final String RES_LNK_P3 = getProp(casePfx + "res.lnk.p3", "link=Product3");
+ private final String RES_LNK_P2 = getProp(casePfx + "res.lnk.p2", "link=Product2");
+ private final String RES_LNK_P1 = getProp(casePfx + "res.lnk.p1", "link=Product1");
+ private final String RES_INP = getProp(casePfx + "res.inp", "repeat");
+ private final String RES_LNK = getProp(casePfx + "res.lnk", "link=serveResource Demo");
+ private final String WIN_DIV_CON = getProp(casePfx + "win.div.con", "//div[@id='regionB']/div/table/tbody/tr[2]/td[2]/div");
+ private final String WIN_LNK = getProp(casePfx + "win.lnk", "link=Window id test");
+ private final String SES_TAB_PSCOPE = getProp(casePfx + "ses.tab.pscope", "//html/body/div[2]/div/div/div[2]/div[2]/div/table/tbody/tr[2]/td[2]/div/table");
+ private final String SES_TAB_ASCOPE = getProp(casePfx + "ses.tab.ascope",
+ "//html/body/div[2]/div/div/div[2]/div[2]/div/table/tbody/tr[2]/td[2]/div/table[2]");
+ private final String SES_SUB_ASCOPE = getProp(casePfx + "ses.sub.ascope", "application");
+ private final String SES_SUB_PSCOPE = getProp(casePfx + "ses.sub.pscope", "portlet");
+ private final String SES_INP_VAL = getProp(casePfx + "ses.inp.val", "value");
+ private final String SES_INP_NAM = getProp(casePfx + "ses.inp.nam", "name");
+ private final String SES_LNK = getProp(casePfx + "ses.lnk", "link=Session test");
+ private final String PUB_1_LNK_FOO_REM = getProp(casePfx + "pub.1.lnk.foo.rem", "link=Remove");
+ private final String PUB_3_LNK_BAR_REM = getProp(casePfx + "pub.3.lnk.bar.rem",
+ "//div[@id='regionB']/div[2]/table/tbody/tr[2]/td[2]/div/form/table/tbody/tr[2]/td[2]/a");
+ private final String PUB_3_LNK_JUU_REM = getProp(casePfx + "pub.3.lnk.juu.rem",
+ "//div[@id='regionB']/div[2]/table/tbody/tr[2]/td[2]/div/form/table/tbody/tr[1]/td[2]/a");
+ private final String PUB_SUB_2 = getProp(casePfx + "pub.sub.2", "//div[@id='regionB']/div[1]/table/tbody/tr[2]/td[2]/div/form/table/tbody/tr[3]/td/input");
+ private final String PUB_SUB_1 = getProp(casePfx + "pub.sub.1", "//input[@value='Update']");
+ private final String PUB_DIV_3_BAR = getProp(casePfx + "pub.div.3.bar",
+ "//div[@id='regionB']/div[2]/table/tbody/tr[2]/td[2]/div/form/table/tbody/tr[2]/td[2]/input");
+ private final String PUB_DIV_3_JUU = getProp(casePfx + "pub.div.3.juu",
+ "//div[@id='regionB']/div[2]/table/tbody/tr[2]/td[2]/div/form/table/tbody/tr[1]/td[2]/input");
+ private final String PUB_DIV_2_JUU = getProp(casePfx + "pub.div.2.juu", "juu");
+ private final String PUB_DIV_2_FOO = getProp(casePfx + "pub.div.2.foo",
+ "//div[@id='regionB']/div[1]/table/tbody/tr[2]/td[2]/div/form/table/tbody/tr[1]/td[2]/input");
+ private final String PUB_DIV_1_BAR = getProp(casePfx + "pub.div.1.bar", "bar");
+ private final String PUB_DIV_1_FOO = getProp(casePfx + "pub.div.1.foo", "foo");
+ private final String PUB_LNK = getProp(casePfx + "pub.lnk", "link=Public parameters test");
+ private final String PEVT_DIV_P3_MAX = getProp(casePfx + "pevt.div.p3.max", "//div[@id='regionB']/div[3]/table/tbody/tr[1]/td[2]/div[2]/span[1]/a");
+ private final String PEVT_DIV_P2_MAX = getProp(casePfx + "pevt.div.p2.max", "//div[@id='regionB']/div[2]/table/tbody/tr[1]/td[2]/div[2]/span[1]/a");
+ private final String PEVT_DIV_L3_MAX = getProp(casePfx + "pevt.div.l3.max", "//div[@id='regionA']/div[3]/table/tbody/tr[1]/td[2]/div[2]/span[1]/a");
+ private final String PEVT_DIV_L2_MAX = getProp(casePfx + "pevt.div.l2.max", "//div[@id='regionA']/div[2]/table/tbody/tr[1]/td[2]/div[2]/span[1]/a");
+ private final String PEVT_DIV_P3 = getProp(casePfx + "pevt.div.p3", "//div[@id='regionB']/div[3]/table/tbody/tr[2]/td[2]/div/");
+ private final String PEVT_DIV_P2 = getProp(casePfx + "pevt.div.p2", "//div[@id='regionB']/div[2]/table/tbody/tr[2]/td[2]/div/");
+ private final String PEVT_DIV_P1 = getProp(casePfx + "pevt.div.p1", "//div[@id='regionB']/div[1]/table/tbody/tr[2]/td[2]/div/");
+ private final String PEVT_DIV_L3 = getProp(casePfx + "pevt.div.l3", "//div[@id='regionA']/div[3]/table/tbody/tr[2]/td[2]/div/");
+ private final String PEVT_DIV_L2 = getProp(casePfx + "pevt.div.l2", "//div[@id='regionA']/div[2]/table/tbody/tr[2]/td[2]/div/");
+ private final String PEVT_DIV_L1 = getProp(casePfx + "pevt.div.l1", "//div[@id='regionA']/div[1]/table/tbody/tr[2]/td[2]/div/");
+ private final String PEVT_LNK = getProp(casePfx + "pevt.lnk", "link=Page event test");
+ private final String MOD_DIV_CON = getProp(casePfx + "mod.div.con", "//div[@id='regionB']/div/table/tbody/tr[2]/td[2]/div");
+ private final String MOD_LNK = getProp(casePfx + "mod.lnk", "link=Mode test");
+ private final String MPOR_DIV_CON = getProp(casePfx + "mpor.div.con", "content-container");
+ private final String MPOR_LNK = getProp(casePfx + "mpor.lnk", "link=Missing portlet");
+ private final String MINS_DIV_CON = getProp(casePfx + "mins.div.con", "content-container");
+ private final String MINS_LNK = getProp(casePfx + "mins.lnk", "link=Missing instance");
+ private final String JS_LNK_SUBMIT = getProp(casePfx + "js.lnk.submit", "link=submit");
+ private final String JS_OPT_3 = getProp(casePfx + "js.opt.3", "//form[contains(@id,'_the_form')]/select/option[3]");
+ private final String JS_OPT_2 = getProp(casePfx + "js.opt.2", "//form[contains(@id,'_the_form')]/select/option[2]");
+ private final String JS_OPT_1 = getProp(casePfx + "js.opt.1", "//form[@id='jbpnsFormAutoSubmitPortletWindowsnpbj_the_form']/select/option[1]");
+ private final String JS_LAB_C = getProp(casePfx + "js.lab.c", "label=C");
+ private final String JS_LAB_B = getProp(casePfx + "js.lab.b", "label=B");
+ private final String JS_LAB_A = getProp(casePfx + "js.lab.a", "label=A");
+ private final String JS_SEL_LETTER = getProp(casePfx + "js.sel.letter",
+ "//select[@onclick=\"document.getElementById('jbpnsFormAutoSubmitPortletWindowsnpbj_the_form').submit()\"]");
+ private final String JS_LNK = getProp(casePfx + "js.lnk", "link=Javascript test");
+ private final String HEAD_INP_CONTENT = getProp(casePfx + "head.inp.content", "Introducing-HeaderContentInput");
+ private final String HEAD_DIV_CONTENT = getProp(casePfx + "head.div.content", "Introducing-HeaderContent");
+ private final String HEAD_LNK = getProp(casePfx + "head.lnk", "link=Header test");
+ private final String FS_LNK = getProp(casePfx + "fs.lnk", "link=File system content");
+ private final String EXC_LNK_PORTLET = getProp(casePfx + "exc.lnk.portlet", "link=render PortletException");
+ private final String EXC_LNK = getProp(casePfx + "exc.lnk", "link=Exception test");
+ private final String EVT_SUB_COLOR = getProp(casePfx + "evt.sub.color", "//input[@type='submit']");
+ private final String EVT_DIV_BLACK = getProp(casePfx + "evt.div.black",
+ "//div[@id='regionB']/div[2]/table/tbody/tr[2]/td[2]/div/div[contains(@style,'black')]");
+ private final String EVT_DIV_RED = getProp(casePfx + "evt.div.red", "//div[@id='regionB']/div[2]/table/tbody/tr[2]/td[2]/div/div[contains(@style,'red')]");
+ private final String EVT_DIV_BLUE = getProp(casePfx + "evt.div.blue",
+ "//div[@id='regionB']/div[2]/table/tbody/tr[2]/td[2]/div/div[contains(@style,'blue')]");
+ private final String EVT_SEL_LAB_BLACK = getProp(casePfx + "evt.sel.lab.black", "label=black");
+ private final String EVT_SEL_LAB_RED = getProp(casePfx + "evt.sel.lab.red", "label=red");
+ private final String EVT_SEL_LAB_BLUE = getProp(casePfx + "evt.sel.lab.blue", "label=blue");
+ private final String EVT_SEL_COL = getProp(casePfx + "evt.sel.col", "color");
+ private final String EVT_LNK = getProp(casePfx + "evt.lnk", "link=Event test");
+ private final String ENC_LNK = getProp(casePfx + "enc.lnk", "link=Encoding test");
+ private final String ENC_INP_REN = getProp(casePfx + "enc.inp.ren", "text");
+ private final String ENC_SUB_ACT = getProp(casePfx + "enc.sub.act", "//input[@value='Submit to action phase']");
+ private final String ENC_INP_ACT = getProp(casePfx + "enc.inp.act", "//div[@id='regionB']/div/table/tbody/tr[2]/td[2]/div/div[1]/form[2]/input[1]");
+ private final String ENC_TEXTAREA2 = getProp(casePfx + "enc.textarea2", "//div[@id='regionB']/div/table/tbody/tr[2]/td[2]/div/div[5]/textarea");
+ private final String ENC_TEXTAREA1 = getProp(casePfx + "enc.textarea1", "//textarea[@name='text']");
+ private final String CHAR_ALL_SUB_CHECK = getProp(casePfx + "char.all.sub.check",
+ "//html/body/div[2]/div/div/div[2]/div[2]/div/table/tbody/tr[2]/td[2]/div/div[8]/form/input[3]");
+ private final String CHAR_INP_TEXT_SUB_CHECK = getProp(casePfx + "char.inp.text.sub.check",
+ "//div[@id='regionB']/div/table/tbody/tr[2]/td[2]/div/div[8]/form/input[3]");
+ private final String CHAR_LNK_TEXTAREA_CHECK = getProp(casePfx + "char.lnk.textarea.check", "//input[@value='check']");
+ private final String CHAR_INP_TEXT = getProp(casePfx + "char.inp.text", "//input[@name='text']");
+ private final String CHAR_TEXTAREA = getProp(casePfx + "char.textarea", "text");
+ private final String CHAR_SUB_CHANGE = getProp(casePfx + "char.sub.change", "//input[@value='change']");
+ private final String CHAR_INP_TO = getProp(casePfx + "char.inp.to", "to");
+ private final String CHAR_INP_FROM = getProp(casePfx + "char.inp.from", "from");
+ private final String CHAR_LNK = getProp(casePfx + "char.lnk", "link=Charset test");
+ private final String CACHE_LNK = getProp(casePfx + "cache.lnk", "link=Cache test");
+ private final String CACHE_LNK_2REN = getProp(casePfx + "cache.lnk.2ren", "//div[@id='regionB']/div[2]/table/tbody/tr[2]/td[2]/div/div[5]/a");
+ private final String CACHE_LNK_2ACT = getProp(casePfx + "cache.lnk.2act", "//div[@id='regionB']/div[2]/table/tbody/tr[2]/td[2]/div/div[4]/a");
+ private final String CACHE_LNK_1REN = getProp(casePfx + "cache.lnk.1ren", "link=render");
+ private final String CACHE_LNK_1ACT = getProp(casePfx + "cache.lnk.1act", "link=action");
+ private final String CACHE_2RENDER = getProp(casePfx + "cache.2render", "//div[@id='regionB']/div[2]/table/tbody/tr[2]/td[2]/div/div[2]/div");
+ private final String CACHE_1RENDER = getProp(casePfx + "cache.1render", "//div[@id='regionB']/div[1]/table/tbody/tr[2]/td[2]/div/div[2]/div");
+
@BeforeMethod(groups = { "log" })
public void loginBeforeTest() {
selenium.open("/portal/portal/default/default");
@@ -116,34 +126,35 @@
public void logoutAfterTest() {
}
+
@Test(enabled = true)
public void cacheTest() {
selenium.click(CACHE_LNK);
selenium.waitForPageToLoad(PAGE_LOAD);
assertEquals("0", selenium.getText(CACHE_1RENDER));
assertEquals("0", selenium.getText(CACHE_2RENDER));
-
+
selenium.click(CACHE_LNK_1ACT);
selenium.waitForPageToLoad(PAGE_LOAD);
assertEquals("1", selenium.getText(CACHE_1RENDER));
assertEquals("1", selenium.getText(CACHE_2RENDER));
-
+
selenium.click(CACHE_LNK_1REN);
selenium.waitForPageToLoad(PAGE_LOAD);
assertEquals("1", selenium.getText(CACHE_1RENDER));
assertEquals("2", selenium.getText(CACHE_2RENDER));
-
+
selenium.click(CACHE_LNK_2ACT);
selenium.waitForPageToLoad(PAGE_LOAD);
assertEquals("1", selenium.getText(CACHE_1RENDER));
assertEquals("3", selenium.getText(CACHE_2RENDER));
-
+
selenium.click(CACHE_LNK_2REN);
selenium.waitForPageToLoad(PAGE_LOAD);
assertEquals("1", selenium.getText(CACHE_1RENDER));
- assertEquals("4", selenium.getText(CACHE_2RENDER));
+ assertEquals("4", selenium.getText(CACHE_2RENDER));
}
-
+
@Test(enabled = true)
public void charsetTest() {
selenium.click(CHAR_LNK);
@@ -171,9 +182,9 @@
selenium.type(CHAR_INP_TEXT, "789:;<=>?@f");
selenium.click(CHAR_ALL_SUB_CHECK);
selenium.waitForPageToLoad(PAGE_LOAD);
- assertTrue(selenium.isTextPresent("Test result: The input matched the expected result"));
+ assertTrue(selenium.isTextPresent("Test result: The input matched the expected result"));
}
-
+
@Test(enabled = true)
public void encodingTest() {
selenium.click(ENC_LNK);
@@ -189,9 +200,9 @@
selenium.click("//input[@value='Submit to render phase']");
selenium.waitForPageToLoad(PAGE_LOAD);
assertEquals("", selenium.getValue(ENC_TEXTAREA1));
- assertEquals("action", selenium.getValue(ENC_TEXTAREA2));
+ assertEquals("action", selenium.getValue(ENC_TEXTAREA2));
}
-
+
@Test(enabled = true)
public void eventTest() {
selenium.click(EVT_LNK);
@@ -209,32 +220,32 @@
selenium.waitForPageToLoad(PAGE_LOAD);
assertTrue(selenium.isElementPresent(EVT_DIV_BLACK));
}
-
+
@Test(enabled = true)
public void exceptionTest() {
selenium.click(EXC_LNK);
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click(EXC_LNK_PORTLET);
selenium.waitForPageToLoad(PAGE_LOAD);
- assertTrue(selenium.isTextPresent("javax.portlet.PortletException"));
+ assertTrue(selenium.isTextPresent("javax.portlet.PortletException"));
}
-
+
@Test(enabled = true)
public void fileSystemContentTest() {
selenium.click(FS_LNK);
selenium.waitForPageToLoad(PAGE_LOAD);
- assertTrue(selenium.isTextPresent("Bar content"));
+ assertTrue(selenium.isTextPresent("Bar content"));
}
-
+
@Test(enabled = true)
public void headerTest() {
selenium.click(HEAD_LNK);
selenium.waitForPageToLoad(PAGE_LOAD);
- assertTrue(selenium.isElementPresent(HEAD_DIV_CONTENT));
+ assertTrue(selenium.isElementPresent(HEAD_DIV_CONTENT));
selenium.click(HEAD_INP_CONTENT);
assertEquals("hello from the injected java script!", selenium.getAlert());
}
-
+
@Test(enabled = true)
public void javascriptTest() {
selenium.click(JS_LNK);
@@ -243,100 +254,100 @@
waitFor(AJAX_TIMEOUT);
selenium.click(JS_OPT_1);
selenium.waitForPageToLoad(PAGE_LOAD);
-
+
assertFalse(selenium.isSomethingSelected(JS_SEL_LETTER));
-
+
selenium.addSelection(JS_SEL_LETTER, JS_LAB_B);
waitFor(AJAX_TIMEOUT);
selenium.click(JS_OPT_2);
selenium.waitForPageToLoad(PAGE_LOAD);
-
+
assertFalse(selenium.isSomethingSelected(JS_SEL_LETTER));
-
+
selenium.addSelection(JS_SEL_LETTER, JS_LAB_C);
waitFor(AJAX_TIMEOUT);
selenium.click(JS_OPT_3);
selenium.waitForPageToLoad(PAGE_LOAD);
-
+
assertFalse(selenium.isSomethingSelected(JS_SEL_LETTER));
-
+
selenium.click(JS_LNK_SUBMIT);
selenium.waitForPageToLoad(PAGE_LOAD);
-
+
assertFalse(selenium.isSomethingSelected(JS_SEL_LETTER));
}
-
+
@Test(enabled = true)
public void missingInstanceTest() {
selenium.click(MINS_LNK);
selenium.waitForPageToLoad(PAGE_LOAD);
- assertEquals("", selenium.getText(MINS_DIV_CON));
+ assertEquals("", selenium.getText(MINS_DIV_CON));
}
-
+
@Test(enabled = true)
public void missingPortletTest() {
selenium.click(MPOR_LNK);
selenium.waitForPageToLoad(PAGE_LOAD);
- assertEquals("", selenium.getText(MPOR_DIV_CON));
+ assertEquals("", selenium.getText(MPOR_DIV_CON));
}
-
+
@Test(enabled = true)
public void modeTest() {
selenium.click(MOD_LNK);
selenium.waitForPageToLoad(PAGE_LOAD);
assertEquals("View", selenium.getText(MOD_DIV_CON));
}
-
+
@Test(enabled = true)
public void pageEventTest() {
final String portletText = "This is a simple showcase of Portal Node Event Listener. For this portal page it ensures that in every column, only one portlet window is in NORMAL state. Try to change the window state of other portlets and see what happens. To learn more, read InterPortlet Communication (IPC) chapter in JBoss Portal Reference Guide.";
final String emptyText = "";
-
+
selenium.click(PEVT_LNK);
selenium.waitForPageToLoad(PAGE_LOAD);
-
+
// Left column
-
+
assertEquals(portletText, selenium.getText(PEVT_DIV_L1));
assertEquals(emptyText, selenium.getText(PEVT_DIV_L2));
assertEquals(emptyText, selenium.getText(PEVT_DIV_L3));
-
+
selenium.click(PEVT_DIV_L2_MAX);
selenium.waitForPageToLoad(PAGE_LOAD);
-
+
assertEquals(emptyText, selenium.getText(PEVT_DIV_L1));
assertEquals(portletText, selenium.getText(PEVT_DIV_L2));
assertEquals(emptyText, selenium.getText(PEVT_DIV_L3));
-
+
selenium.click(PEVT_DIV_L3_MAX);
selenium.waitForPageToLoad(PAGE_LOAD);
-
+
assertEquals(emptyText, selenium.getText(PEVT_DIV_L1));
assertEquals(emptyText, selenium.getText(PEVT_DIV_L2));
assertEquals(portletText, selenium.getText(PEVT_DIV_L3));
-
+
// Right column
-
+
assertEquals(portletText, selenium.getText(PEVT_DIV_P1));
assertEquals(emptyText, selenium.getText(PEVT_DIV_P2));
assertEquals(emptyText, selenium.getText(PEVT_DIV_P3));
-
+
selenium.click(PEVT_DIV_P2_MAX);
selenium.waitForPageToLoad(PAGE_LOAD);
-
+
assertEquals(emptyText, selenium.getText(PEVT_DIV_P1));
assertEquals(portletText, selenium.getText(PEVT_DIV_P2));
assertEquals(emptyText, selenium.getText(PEVT_DIV_P3));
-
+
selenium.click(PEVT_DIV_P3_MAX);
selenium.waitForPageToLoad(PAGE_LOAD);
-
+
assertEquals(emptyText, selenium.getText(PEVT_DIV_P1));
assertEquals(emptyText, selenium.getText(PEVT_DIV_P2));
assertEquals(portletText, selenium.getText(PEVT_DIV_P3));
-
+
}
-
+
@Test(enabled = true)
public void publicParametersTest() {
selenium.click(PUB_LNK);
@@ -399,13 +410,12 @@
assertEquals("", selenium.getValue(PUB_DIV_3_JUU));
assertEquals("", selenium.getValue(PUB_DIV_3_BAR));
}
-
+
@Test(enabled = false)
public void secureTest() {
-
-
+
}
-
+
@Test(enabled = true)
public void sessionTest() {
selenium.click(SES_LNK);
@@ -414,54 +424,61 @@
selenium.type(SES_INP_VAL, "scopeval1");
selenium.click(SES_SUB_PSCOPE);
selenium.waitForPageToLoad(PAGE_LOAD);
-
+
int r = findTableRow(SES_TAB_PSCOPE, "scope1", 0);
- assertTrue(r>0);
+ assertTrue(r > 0);
assertEquals(findTableRow(SES_TAB_PSCOPE, "scopeval1", 1), r);
-
- //assertEquals("scope1", selenium.getText("//div[@id='regionB']/div/table/tbody/tr[2]/td[2]/div/table[1]/tbody/tr[2]/td[1]"));
- //assertEquals("scopeval1", selenium.getText("//div[@id='regionB']/div/table/tbody/tr[2]/td[2]/div/table[1]/tbody/tr[2]/td[2]"));
+
+ // assertEquals("scope1", selenium.getText(
+ // "//div[@id='regionB']/div/table/tbody/tr[2]/td[2]/div/table[1]/tbody/tr[2]/td[1]"
+ // ));
+ // assertEquals("scopeval1", selenium.getText(
+ // "//div[@id='regionB']/div/table/tbody/tr[2]/td[2]/div/table[1]/tbody/tr[2]/td[2]"
+ // ));
selenium.type(SES_INP_NAM, "app1");
selenium.type(SES_INP_VAL, "appval1");
selenium.click(SES_SUB_ASCOPE);
selenium.waitForPageToLoad(PAGE_LOAD);
-
+
r = findTableRow(SES_TAB_ASCOPE, "app1", 0);
- assertTrue(r>0);
+ assertTrue(r > 0);
assertEquals(findTableRow(SES_TAB_ASCOPE, "appval1", 1), r);
-
- //assertEquals("app1", selenium.getText("//div[@id='regionB']/div/table/tbody/tr[2]/td[2]/div/table[2]/tbody/tr[2]/td[1]"));
- //assertEquals("appval1", selenium.getText("//div[@id='regionB']/div/table/tbody/tr[2]/td[2]/div/table[2]/tbody/tr[2]/td[2]"));
-
+
+ // assertEquals("app1", selenium.getText(
+ // "//div[@id='regionB']/div/table/tbody/tr[2]/td[2]/div/table[2]/tbody/tr[2]/td[1]"
+ // ));
+ // assertEquals("appval1", selenium.getText(
+ // "//div[@id='regionB']/div/table/tbody/tr[2]/td[2]/div/table[2]/tbody/tr[2]/td[2]"
+ // ));
+
selenium.click(SES_LNK_INVALIDATE);
selenium.waitForPageToLoad(PAGE_LOAD);
-
+
assertFalse(selenium.isTextPresent("Session id"));
}
-
+
@Test(enabled = false)
public void urlPortletTest() {
-
-
+
}
-
+
@Test(enabled = true)
public void windowIdTest() {
selenium.click(WIN_LNK);
selenium.waitForPageToLoad(PAGE_LOAD);
- assertEquals("Window ID is equals to /default/Test/Window id test/WindowIDPortletWindow", selenium.getText(WIN_DIV_CON));
+ assertEquals("Window ID is equals to /default/Test/Window id test/WindowIDPortletWindow", selenium.getText(WIN_DIV_CON));
}
-
+
@Test(enabled = true)
public void serveResourceDemoTest() {
-
+
selenium.click(RES_LNK);
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.type(RES_INP, "valtest");
selenium.typeKeys(RES_INP, " ");
-
+
waitFor(AJAX_TIMEOUT);
-
+
assertEquals("valtest", selenium.getText(RES_DIV_RTEXT));
selenium.click(RES_LNK_P1);
waitFor(AJAX_TIMEOUT);
@@ -472,9 +489,7 @@
selenium.click(RES_LNK_P3);
waitFor(AJAX_TIMEOUT);
assertEquals("Product ID: 3\n SANTA CRUZ ALLSTAR\n$256.00", selenium.getText(RES_DIV_PTEXT));
-
+
}
-
-
-
+
}
Modified: branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/UserLoginTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/UserLoginTestCase.java 2009-04-02 23:22:35 UTC (rev 13147)
+++ branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/UserLoginTestCase.java 2009-04-03 14:21:49 UTC (rev 13148)
@@ -6,12 +6,15 @@
/**
+ * Testcase responsible for testing of login form.
+ *
* @author <a href="mailto:vrockai@redhat.com">Viliam Rockai</a>
*/
@Test(groups = { "login" }, enabled = true)
public class UserLoginTestCase extends JBossPortalSeleniumTestCase {
+ /** prefix for locator properties */
public final String casePfx = "user.login.";
private final String ADR_PORTAL = getProp(casePfx+"adr.portal","/portal");
@@ -25,7 +28,7 @@
private final String LNK_LOGIN = getProp(casePfx+"lnk.login","link=Login");
@AfterClass(enabled = true)
- public void logoutIfNeeded()
+ private void logoutIfNeeded()
{
selenium.open(ADR_PORTAL);
selenium.waitForPageToLoad(PAGE_LOAD);
@@ -36,8 +39,14 @@
}
}
+
+ /**
+ * Test default user login.
+ *
+ * Login as user/user and check if the message with login information appears.
+ */
@Test(enabled = true, description = "login as default user 'user' with password 'user'.")
- public void testDefaultUserLogin() throws Exception {
+ public void testDefaultUserLogin() {
final String loginName = "user";
final String loginPass = "user";
@@ -73,8 +82,13 @@
Assert.assertFalse(selenium.isTextPresent("Logged in as:"), "\"Logged in as:\" message with no user logged in is missing.");
}
+ /**
+ * Test admin login.
+ *
+ * Login as admin/admin and check if the message with login information appears.
+ */
@Test(enabled = true, description = "login as admin user 'admin' with password 'admin'.")
- public void testAdminLogin() throws Exception {
+ public void testAdminLogin() {
final String loginName = "admin";
final String loginPass = "admin";
@@ -108,8 +122,13 @@
Assert.assertFalse(selenium.isTextPresent("Logged in as:"), "\"Logged in as:\" message with no user logged in is missing.");
}
+ /**
+ * Test user login cancel.
+ *
+ * Fill the login form with user/user, but press cancel instead of login.
+ */
@Test(enabled = true, description = "canceling of the login form.")
- public void testUserLoginCancel() throws Exception {
+ public void testUserLoginCancel() {
final String loginName = "saki";
final String loginPass = "paki";
@@ -141,8 +160,13 @@
Assert.assertFalse(selenium.isTextPresent("Logged in as:"), "\"Logged in as:\" message with no user logged in is missing.");
}
+ /**
+ * Test false name login.
+ *
+ * Try to login with us2er/user and check that you are not logged in.
+ */
@Test(enabled = true, description = "login as 'us2er' which does not exist.")
- public void testFalseNameLogin() throws Exception {
+ public void testFalseNameLogin() {
final String loginName = "us2er";
final String loginPass = "user";
@@ -169,8 +193,14 @@
Assert.assertTrue(selenium.isTextPresent("The user doesn't exist or the password is incorrect "), "\"Logged in as\" message missing.");
}
+
+ /**
+ * Test false password login.
+ *
+ * Try to login with user/us2er and check that you are not logged in.
+ */
@Test(enabled = true, description = "login as 'user' with wrong password 'us2er'.")
- public void testFalsePasswordLogin() throws Exception {
+ public void testFalsePasswordLogin() {
final String loginName = "user";
final String loginPass = "us2er";
Modified: branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/WSRPTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/WSRPTestCase.java 2009-04-02 23:22:35 UTC (rev 13147)
+++ branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/WSRPTestCase.java 2009-04-03 14:21:49 UTC (rev 13148)
@@ -6,12 +6,16 @@
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
+
/**
+ * The Class WSRPTestCase is reponsible for testing the WSRP GUI of JBoss Portal.
+ *
* @author <a href="mailto:vrockai@redhat.com">Viliam Rockai</a>
*/
@Test(groups = { "cms_wsrp" }, enabled = true, description = "WSRP test case.")
public class WSRPTestCase extends JBossPortalSeleniumTestCase {
+ /** prefix for locator properties */
public static String casePfx = "test.wsrp.";
private final String INP_CONSUMER_NAME = getProp(casePfx+"inp.consumer.name","//input[contains(@id,'edit-cons-form:id')]");
@@ -44,16 +48,38 @@
private final String WSRP_CONSUMER_TABLE = getProp(casePfx+"link.wsrp.consumer.table","//table[contains(@id,':consumer-list-form:consumersList')]");
@BeforeMethod(groups = { "log" })
- public void loginBeforeTest() {
+ private void loginBeforeTest() {
logoutIfPossible();
login("admin", "admin");
}
@AfterMethod(groups = { "log" })
- public void logoutAfterTest() {
+ private void logoutAfterTest() {
//logout();
}
+ /**
+ * Test create bea consume is responsible for creating BEA consumer named <b>BEA</b>. Navigate to WSRP gui and create consumer with these parameters:
+ * <br/>
+ * <table>
+ * <tr>
+ * <td><b>Producer id:</b></td><td>BEA</td>
+ * </tr>
+ * <tr>
+ * <td><b>Cache expiration:</b></td><td>600</td>
+ * </tr>
+ * <tr>
+ * <td><b>Endpoint configuration:</b></td><td>http://wsrp.bea.com:7001/producer/producer?WSDL (using WSDL)</td>
+ * </tr>
+ * <tr>
+ * <td><b>Registration information:</b></td><td><code>{urn:bea:wlp:prop:reg:registration}consumerRole</code> : public</td>
+ * </tr>
+ * </table>
+ * <br/>
+ * After clicking refresh&save button, the test checks for text message about successful refresh.
+ * Then it check whether the BEA consumer is appearing in the main consumers table.
+ */
+ //TODO checking for the resulting consumer in table should be using selenium extension
@Test(enabled = true, description = "Creating a standard BEA consumer.")
public void testCreateBeaConsumer() {
selenium.open("/portal/");
@@ -85,6 +111,11 @@
Assert.assertTrue(selenium.isTextPresent("BEA"));
}
+ /**
+ * Test bea consumer register is reponsible for registering previously deregistered consumer <b>BEAreg</b>.
+ * It finds the <b>BEAreg</b> consumer in the main consumer table and clicks on its register icon.
+ * After that, it checks whether the register icon changed its text to "deregister"
+ */
@Test(enabled = true, dependsOnMethods = { "testCreateBeaConsumer", "testBeaConsumerDeregister" }, description = "Standard BEA consumer registering.")
public void testBeaConsumerRegister() {
@@ -109,6 +140,11 @@
Assert.assertEquals(selenium.getText(MessageFormat.format(LINK_T_CONS_DER,r)), "Deregister");
}
+ /**
+ * Test bea consumer deregister is responsible for deleting previously created BEA consumer.
+ * It creates BEA consumer with name BEA and values similiar to that from {@link=testCreateBeaConsumer}.
+ * Then it clicks on deregister link for the consumer and checks whether deregister link has changed into register link.
+ */
@Test(enabled = true, dependsOnMethods = { "testCreateBeaConsumer" }, description = "Standard BEA consumer deregistering.")
public void testBeaConsumerDeregister() {
@@ -132,6 +168,11 @@
Assert.assertEquals(selenium.getText(MessageFormat.format(LINK_T_CONS_DER,r)), "Register");
}
+ /**
+ * Test bea consumer activate is responsible for activating previously deactivated consumer.
+ * It works with consumer named <b>BEAact</b> and checks whether the consumer has message showing it's inactive and refresh is needed.
+ * Then it click on activate link and check that the message has disappeared.
+ */
@Test(enabled = true, dependsOnMethods = { "testCreateBeaConsumer", "testBeaConsumerDeactivate" }, description = "Standard BEA consumer activating.")
public void testBeaConsumerActivate() {
selenium.open("/portal/");
@@ -153,6 +194,12 @@
}
+ /**
+ * Test bea consumer deactivate is responsible for deactivating a bea consumer.
+ * Firstly it creates bea consumer named <b>BEAact</b> with parameters similiar to that from {@link=testCreateBeaConsumer}.
+ * Then it asserts that message signalling the consumer non-active state is missing.
+ * After clicking on deactivation link it assert, that the message signalling non-active state of consumer has appeared.
+ */
@Test(enabled = true, dependsOnMethods = { "testCreateBeaConsumer" }, description = "Standard BEA consumer deactivating.")
public void testBeaConsumerDeactivate() {
@@ -177,11 +224,21 @@
}
+ /**
+ * Test bea consumer configure. Test is disabled - deleting of the method should be considered.
+ */
+ //TODO deleting of the method should be considered.
@Test(enabled = false, dependsOnMethods = { "testCreateBeaConsumer" }, description = "Standard BEA consumer configuring.")
public void testBeaConsumerConfigure() {
}
+
+ /**
+ * Test bea consumer delete is responsible for deleting a bea consumer.
+ * Firstly it creates bea consumer named <b>BEAdel</b> with parameters similiar to that from {@link=testCreateBeaConsumer}.
+ * It click on the delete icon for the consumer and then it asserts the consumer has disappeared from the table.
+ */
@Test(enabled = true, dependsOnMethods = { "testCreateBeaConsumer" }, description = "Standard BEA consumer deleting.")
public void testBeaConsumerDelete() {
@@ -211,6 +268,22 @@
Assert.assertFalse(selenium.isTextPresent("BEAdel"));
}
+ /**
+ * Test configure producer is used for basic configuring of WSRP producer.
+ * If fills up the registration properties with these values:
+ * <table>
+ * <tr>
+ * <td><b>Name</b></td><td>testProp</td>
+ * <td><b>Label</b></td><td>testProp label</td>
+ * <td><b>Hint</b></td><td>tetsPropHint</td>
+ * </tr>
+ * </table>
+ *
+ * It saves the properties and checks they were saved.
+ * <br/>
+ * Missing: It doesn't test the function of cancel button and checkboxes in producer configuration.
+ */
+ //TODO the function of cancel button and checkboxes in producer configuration.
@Test(enabled = true, description = "Basic configuring of WSRP producer.")
public void testConfigureProducer() {
selenium.open("/portal/");
@@ -241,6 +314,12 @@
}
+ /**
+ * Test configure consumer is responsible for configuring bea consumer.
+ * Firstly it creates bea consumer named <b>renameMe</b> with parameters similiar to that from {@link=testCreateBeaConsumer}.
+ * Then it clicks on configure button for the consumer and rename it to <b>renameNewMe</b>.
+ * At the end it asserts that the previous name is missing in the consumers table and the new name has appeared.
+ */
@Test(enabled = true, description = "Renaming a consumer through the configure button.")
public void testConfigureConsumer() {
final String name = "renameMe";
15 years, 3 months
JBoss Portal SVN: r13147 - in branches/JBoss_Portal_Branch_2_7_AS5/theme: src/main/org/jboss/portal/test/theme/tmp and 5 other directories.
by portal-commits@lists.jboss.org
Author: mwringe
Date: 2009-04-02 19:22:35 -0400 (Thu, 02 Apr 2009)
New Revision: 13147
Added:
branches/JBoss_Portal_Branch_2_7_AS5/theme/src/main/org/jboss/portal/theme/deployment/jboss/LayoutDeploymentImpl.java
branches/JBoss_Portal_Branch_2_7_AS5/theme/src/main/org/jboss/portal/theme/deployment/jboss/RenderSetDeploymentImpl.java
branches/JBoss_Portal_Branch_2_7_AS5/theme/src/main/org/jboss/portal/theme/deployment/jboss/ThemeDeploymentImpl.java
Removed:
branches/JBoss_Portal_Branch_2_7_AS5/theme/src/main/org/jboss/portal/test/theme/tmp/metadata/TestPortalLayoutMetaData.java
branches/JBoss_Portal_Branch_2_7_AS5/theme/src/main/org/jboss/portal/test/theme/tmp/metadata/TestPortalThemeMetaData.java
branches/JBoss_Portal_Branch_2_7_AS5/theme/src/main/org/jboss/portal/test/theme/tmp/metadata/TestRenderSetMetaData.java
branches/JBoss_Portal_Branch_2_7_AS5/theme/src/main/org/jboss/portal/theme/RuntimeContext.java
branches/JBoss_Portal_Branch_2_7_AS5/theme/src/main/org/jboss/portal/theme/deployment/jboss/LayoutDeployment.java
branches/JBoss_Portal_Branch_2_7_AS5/theme/src/main/org/jboss/portal/theme/deployment/jboss/LayoutDeploymentFactory.java
branches/JBoss_Portal_Branch_2_7_AS5/theme/src/main/org/jboss/portal/theme/deployment/jboss/LayoutFeaturesDeployment.java
branches/JBoss_Portal_Branch_2_7_AS5/theme/src/main/org/jboss/portal/theme/deployment/jboss/LayoutFeaturesDeploymentFactory.java
branches/JBoss_Portal_Branch_2_7_AS5/theme/src/main/org/jboss/portal/theme/deployment/jboss/PortalLayoutMetaDataFactory.java
branches/JBoss_Portal_Branch_2_7_AS5/theme/src/main/org/jboss/portal/theme/deployment/jboss/PortalThemeMetaDataFactory.java
branches/JBoss_Portal_Branch_2_7_AS5/theme/src/main/org/jboss/portal/theme/deployment/jboss/RenderSetMetaDataFactory.java
branches/JBoss_Portal_Branch_2_7_AS5/theme/src/main/org/jboss/portal/theme/deployment/jboss/ThemeDeployment.java
branches/JBoss_Portal_Branch_2_7_AS5/theme/src/main/org/jboss/portal/theme/deployment/jboss/ThemeDeploymentFactory.java
branches/JBoss_Portal_Branch_2_7_AS5/theme/src/main/org/jboss/portal/theme/metadata/
Modified:
branches/JBoss_Portal_Branch_2_7_AS5/theme/.classpath
branches/JBoss_Portal_Branch_2_7_AS5/theme/build.xml
branches/JBoss_Portal_Branch_2_7_AS5/theme/src/main/org/jboss/portal/test/theme/tmp/TestHelper.java
branches/JBoss_Portal_Branch_2_7_AS5/theme/src/main/org/jboss/portal/test/theme/tmp/TestLayoutServiceImpl.java
branches/JBoss_Portal_Branch_2_7_AS5/theme/src/main/org/jboss/portal/test/theme/tmp/TestThemeServiceImpl.java
branches/JBoss_Portal_Branch_2_7_AS5/theme/src/main/org/jboss/portal/test/theme/tmp/render/TestRenderedMarkup.java
branches/JBoss_Portal_Branch_2_7_AS5/theme/src/main/org/jboss/portal/theme/LayoutInfo.java
branches/JBoss_Portal_Branch_2_7_AS5/theme/src/main/org/jboss/portal/theme/LayoutService.java
branches/JBoss_Portal_Branch_2_7_AS5/theme/src/main/org/jboss/portal/theme/PortalRenderSet.java
branches/JBoss_Portal_Branch_2_7_AS5/theme/src/main/org/jboss/portal/theme/ThemeInfo.java
branches/JBoss_Portal_Branch_2_7_AS5/theme/src/main/org/jboss/portal/theme/ThemeService.java
branches/JBoss_Portal_Branch_2_7_AS5/theme/src/main/org/jboss/portal/theme/impl/LayoutServiceImpl.java
branches/JBoss_Portal_Branch_2_7_AS5/theme/src/main/org/jboss/portal/theme/impl/ThemeServiceImpl.java
Log:
Remove some of the old deployer classes.
Add theme deployment support.
Modified: branches/JBoss_Portal_Branch_2_7_AS5/theme/.classpath
===================================================================
--- branches/JBoss_Portal_Branch_2_7_AS5/theme/.classpath 2009-04-02 23:22:29 UTC (rev 13146)
+++ branches/JBoss_Portal_Branch_2_7_AS5/theme/.classpath 2009-04-02 23:22:35 UTC (rev 13147)
@@ -5,12 +5,10 @@
<classpathentry kind="lib" path="/thirdparty/sun-servlet/lib/jsp-api.jar"/>
<classpathentry kind="lib" path="/thirdparty/oswego-concurrent/lib/concurrent.jar"/>
<classpathentry kind="lib" path="/thirdparty/apache-log4j/lib/log4j.jar"/>
- <classpathentry kind="lib" path="/thirdparty/jbossas/core-libs/lib/jboss-common.jar"/>
<classpathentry kind="lib" path="/thirdparty/jbossas/core-libs/lib/jboss-jmx.jar"/>
<classpathentry kind="lib" path="/thirdparty/jbossas/core-libs/lib/jboss-system.jar"/>
<classpathentry kind="lib" path="/thirdparty/junit/lib/junit.jar"/>
<classpathentry kind="lib" path="/thirdparty/sun-jaf/lib/activation.jar"/>
- <classpathentry kind="lib" path="/thirdparty/jbossas/core-libs/lib/jboss-xml-binding.jar"/>
<classpathentry combineaccessrules="false" kind="src" path="/server"/>
<classpathentry combineaccessrules="false" kind="src" path="/jems"/>
<classpathentry combineaccessrules="false" kind="src" path="/api"/>
@@ -20,5 +18,15 @@
<classpathentry kind="lib" path="/thirdparty/jboss-portal/modules/test/lib/portal-test-lib.jar"/>
<classpathentry kind="lib" path="/thirdparty/sun-servlet/lib/servlet-api.jar"/>
<classpathentry kind="lib" path="/thirdparty/apache-xerces/lib/xercesImpl.jar"/>
+ <classpathentry kind="lib" path="/thirdparty/jboss/common-logging-spi/lib/jboss-logging-spi.jar"/>
+ <classpathentry kind="lib" path="/thirdparty/jboss-portal/modules/metadata/lib/portal-metadata-lib.jar"/>
+ <classpathentry kind="lib" path="/thirdparty/jboss-portal/modules/metadata/lib/portal-metadata-theme-lib.jar"/>
+ <classpathentry kind="lib" path="/thirdparty/jboss-portal/modules/deployer/lib/portal-deployer-lib.jar"/>
+ <classpathentry kind="lib" path="/thirdparty/jbossas/core-libs/lib/jboss-system-jmx.jar"/>
+ <classpathentry kind="lib" path="/thirdparty/jbossas/core-libs/lib/jboss-j2se.jar"/>
+ <classpathentry kind="lib" path="/thirdparty/jboss/jbossxb/lib/jboss-xml-binding.jar"/>
+ <classpathentry kind="lib" path="/thirdparty/jboss-portal/modules/deployer/lib/portal-deployer-theme-lib.jar"/>
+ <classpathentry kind="lib" path="/thirdparty/jboss/jboss-deployers/lib/jboss-deployers-core-spi.jar"/>
+ <classpathentry kind="lib" path="/thirdparty/jboss/microcontainer/lib/jboss-kernel.jar"/>
<classpathentry kind="output" path="output/classes"/>
</classpath>
Modified: branches/JBoss_Portal_Branch_2_7_AS5/theme/build.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_7_AS5/theme/build.xml 2009-04-02 23:22:29 UTC (rev 13146)
+++ branches/JBoss_Portal_Branch_2_7_AS5/theme/build.xml 2009-04-02 23:22:35 UTC (rev 13147)
@@ -93,11 +93,16 @@
<echo message="${sun.servlet.lib}"/>
<path id="library.classpath">
<path refid="jboss.portal/modules/common.classpath"/>
+ <path refid="jboss.portal/modules/deployer.classpath"/>
<path refid="jboss.portal/modules/web.classpath"/>
<path refid="jboss.portal/modules/portlet.classpath"/>
<path refid="jboss.portal/modules/test.classpath"/>
+ <path refid="jboss.portal/modules/metadata.classpath"/>
+ <path refid="jboss.microcontainer.classpath"/>
<path refid="oswego.concurrent.classpath"/>
<path refid="jboss.jbossxb.classpath"/>
+ <path refid="jboss/jboss.deployers.classpath"/>
+ <path refid="jboss/common.logging.spi.classpath"/>
<path refid="jbossas/core.libs.classpath"/>
<path refid="apache.ant.classpath"/>
<path refid="apache.log4j.classpath"/>
@@ -109,6 +114,7 @@
<path refid="jetty.jetty.classpath"/>
<path refid="sun.servlet.classpath"/>
<path refid="sun.jaf.classpath"/>
+ <path refid="sun.jaxb.classpath"/>
</path>
<!-- Configure modules -->
@@ -238,7 +244,7 @@
<fileset dir="${jboss.portal-server.root}/lib" includes="portal-server-lib.jar"/>
<fileset dir="${jboss.portal-jems.root}/lib" includes="portal-jems-lib.jar"/>
<fileset dir="${jboss.portal/modules/web.lib}" includes="portal-web-lib.jar"/>
- <fileset dir="${jboss.portlet-api.root}/lib" includes="portal-api-lib.jar"/>
+ <fileset dir="${jboss.portal-api.root}/lib" includes="portal-api-lib.jar"/>
<fileset dir="${jboss.portal-theme.root}/lib" includes="portal-theme-lib.jar"/>
<fileset dir="${jboss.portal/modules/test.lib}" includes="portal-test-lib.jar"/>
<fileset dir="${jboss.portal-test.root}/lib/../.." includes="selenium-java-client-driver-backport.jar"/>
@@ -255,7 +261,7 @@
</jar>
</target>
- <target name="tests" depends="init">
+<!-- <target name="tests" depends="init"> -->
<!--
<property name="build.testlog" value="${module.output}/log"/>
<execute-tests>
@@ -297,9 +303,9 @@
2. Point your browser to: http://localhost:8080/theme-test/jsunit/testRunner.html?testPage=http://l...
3. Tests should execute and forward to a (currently) 4040: http://localhost:8080/jsunit/acceptor
-->
- </target>
+<!-- </target> -->
- <target name="test" depends="init">
+ <target name="tests" depends="init">
<property name="build.testlog" value="${module.output}/log"/>
<execute-tests>
<x-sysproperty>
@@ -312,6 +318,7 @@
<x-test>
<!--<test todir="${test.reports}" name="org.jboss.portal.test.theme.ThemeTestRunner"/>-->
<test todir="${test.reports}" name="org.jboss.portal.test.theme.DynaMergeBehaviorTestCase"/>
+ <test todir="${test.reports}" name="org.jboss.portal.test.theme.tmp.render.TestRenderedMarkup"/>
</x-test>
<x-classpath>
<path refid="jboss/jbossretro.rt.classpath"/>
@@ -332,12 +339,15 @@
<path refid="sun.servlet.classpath"/>
<path refid="sun.jaf.classpath"/>
<path refid="jboss.portal/modules/common.classpath"/>
+ <path refid="jboss.portal/modules/deployer.classpath"/>
+ <path refid="jboss.portal/modules/metadata.classpath"/>
<path refid="jboss.portal-server.classpath"/>
<path refid="jboss.portal-jems.classpath"/>
<pathelement location="${jboss.portal/modules/test.lib}/portal-test-jboss-lib.jar"/>
+ <pathelement location="/home/mwringe/.m2/repository/org/jboss/jboss-reflect/2.0.2.GA/jboss-reflect-2.0.2.GA.jar"/>
<path refid="jboss.portal/modules/test.classpath"/>
<path refid="jboss.portal-theme.classpath"/>
- <path refid="jboss.portlet-api.classpath"/>
+ <path refid="jboss.portal-api.classpath"/>
<pathelement location="${build.resources}/test"/>
<pathelement location="${build.resources}/hibernate"/>
<pathelement location="${jboss.portal/modules/test.resources}"/>
Modified: branches/JBoss_Portal_Branch_2_7_AS5/theme/src/main/org/jboss/portal/test/theme/tmp/TestHelper.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7_AS5/theme/src/main/org/jboss/portal/test/theme/tmp/TestHelper.java 2009-04-02 23:22:29 UTC (rev 13146)
+++ branches/JBoss_Portal_Branch_2_7_AS5/theme/src/main/org/jboss/portal/test/theme/tmp/TestHelper.java 2009-04-02 23:22:35 UTC (rev 13147)
@@ -23,23 +23,27 @@
package org.jboss.portal.test.theme.tmp;
import org.jboss.portal.common.invocation.AttributeResolver;
+import org.jboss.portal.deployer.portal.PortalUnmarshallerFactory;
+import org.jboss.portal.deployer.portal.RuntimeContext;
import org.jboss.portal.server.ServerRequest;
import org.jboss.portal.theme.LayoutService;
import org.jboss.portal.theme.PageService;
-import org.jboss.portal.theme.RuntimeContext;
import org.jboss.portal.theme.ThemeService;
-import org.jboss.portal.theme.deployment.jboss.PortalLayoutMetaDataFactory;
-import org.jboss.portal.theme.deployment.jboss.RenderSetMetaDataFactory;
import org.jboss.portal.theme.impl.LayoutServiceImpl;
import org.jboss.portal.theme.impl.PageServiceImpl;
import org.jboss.portal.theme.impl.ThemeServiceImpl;
-import org.jboss.portal.theme.metadata.PortalLayoutMetaData;
-import org.jboss.portal.theme.metadata.RenderSetMetaData;
+import org.jboss.portal.metadata.layout.PortalLayoutMetaData;
+import org.jboss.portal.metadata.layout.PortalLayoutsMetaData;
+import org.jboss.portal.metadata.renderset.PortalRenderSetsMetaData;
+import org.jboss.portal.metadata.renderset.RenderSetMetaData;
+import org.jboss.portal.metadata.theme.PortalThemesMetaData;
import org.jboss.portal.theme.page.PageResult;
import org.jboss.portal.theme.page.WindowContext;
import org.jboss.portal.theme.page.WindowResult;
import org.jboss.system.ServiceMBeanSupport;
+import org.jboss.xb.binding.JBossXBException;
import org.jboss.xb.binding.UnmarshallerFactory;
+import org.jboss.xb.binding.sunday.unmarshalling.DefaultSchemaResolver;
import org.xml.sax.SAXException;
import javax.servlet.RequestDispatcher;
@@ -128,13 +132,13 @@
public static RenderSetMetaData createRenderSetMD() throws Exception
{
- List renderSets = (List)UnmarshallerFactory.newInstance().newUnmarshaller().unmarshal(createRenderSetDescriptor(), new RenderSetMetaDataFactory(), null);
- return (RenderSetMetaData)renderSets.get(0);
+ PortalRenderSetsMetaData renderSets = getRenderSetsMetaData(createRenderSetDescriptor());
+ return (RenderSetMetaData)renderSets.getRenderSets().get(0);
}
public static List createRenderSetMDList() throws Exception
{
- return (List)UnmarshallerFactory.newInstance().newUnmarshaller().unmarshal(createRenderSetDescriptor(), new RenderSetMetaDataFactory(), null);
+ return getRenderSetsMetaData(createRenderSetDescriptor()).getRenderSets();
}
private static Reader createRenderSetDescriptor()
@@ -179,8 +183,8 @@
testString.append("</regions>");
testString.append("</layout>");
testString.append("</layouts>");
- List layoutMDList = (List)UnmarshallerFactory.newInstance().newUnmarshaller().unmarshal(new StringReader(testString.toString()), new PortalLayoutMetaDataFactory(), null);
- return (PortalLayoutMetaData)layoutMDList.get(0);
+ PortalLayoutsMetaData layoutsMD = getLayoutsMetaData(new StringReader(testString.toString()));
+ return layoutsMD.getLayouts().get(0);
}
public static PageResult createPageResult(AttributeResolver navCtx, String pageName,
@@ -796,5 +800,45 @@
return null; //To change body of created methods use File | Settings | File Templates.
}
}
-
+
+ public static PortalLayoutsMetaData getLayoutsMetaData(InputStream stream) throws JBossXBException
+ {
+ DefaultSchemaResolver resolver = new DefaultSchemaResolver();
+ resolver.addClassBindingForLocation("layouts", PortalLayoutsMetaData.class);
+ return (PortalLayoutsMetaData) PortalUnmarshallerFactory.getInstance()
+ .getUnmarshaller().unmarshal(stream, resolver);
+ }
+
+ public static PortalLayoutsMetaData getLayoutsMetaData(Reader reader) throws JBossXBException
+ {
+ DefaultSchemaResolver resolver = new DefaultSchemaResolver();
+ resolver.addClassBindingForLocation("layouts", PortalLayoutsMetaData.class);
+ return (PortalLayoutsMetaData) PortalUnmarshallerFactory.getInstance()
+ .getUnmarshaller().unmarshal(reader, resolver);
+ }
+
+ public static PortalRenderSetsMetaData getRenderSetsMetaData(Reader reader) throws JBossXBException
+ {
+ DefaultSchemaResolver resolver = new DefaultSchemaResolver();
+ resolver.addClassBindingForLocation("portal-renderSets", PortalRenderSetsMetaData.class);
+ return (PortalRenderSetsMetaData) PortalUnmarshallerFactory.getInstance()
+ .getUnmarshaller().unmarshal(reader, resolver);
+ }
+
+ public static PortalRenderSetsMetaData getRenderSetsMetaData(InputStream stream) throws JBossXBException
+ {
+ DefaultSchemaResolver resolver = new DefaultSchemaResolver();
+ resolver.addClassBindingForLocation("portal-renderSets", PortalRenderSetsMetaData.class);
+ return (PortalRenderSetsMetaData) PortalUnmarshallerFactory.getInstance()
+ .getUnmarshaller().unmarshal(stream, resolver);
+ }
+
+ public static PortalThemesMetaData getThemesMetaData(InputStream stream) throws JBossXBException
+ {
+ DefaultSchemaResolver resolver = new DefaultSchemaResolver();
+ resolver.addClassBindingForLocation("themes", PortalThemesMetaData.class);
+ return (PortalThemesMetaData) PortalUnmarshallerFactory.getInstance()
+ .getUnmarshaller().unmarshal(stream, resolver);
+ }
+
}
Modified: branches/JBoss_Portal_Branch_2_7_AS5/theme/src/main/org/jboss/portal/test/theme/tmp/TestLayoutServiceImpl.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7_AS5/theme/src/main/org/jboss/portal/test/theme/tmp/TestLayoutServiceImpl.java 2009-04-02 23:22:29 UTC (rev 13146)
+++ branches/JBoss_Portal_Branch_2_7_AS5/theme/src/main/org/jboss/portal/test/theme/tmp/TestLayoutServiceImpl.java 2009-04-02 23:22:35 UTC (rev 13147)
@@ -27,13 +27,13 @@
import org.jboss.portal.common.net.media.MediaType;
import org.jboss.portal.common.util.CLResourceLoader;
import org.jboss.portal.common.util.LoaderResource;
+import org.jboss.portal.deployer.portal.RuntimeContext;
+import org.jboss.portal.metadata.layout.PortalLayoutMetaData;
+import org.jboss.portal.metadata.renderset.RenderSetMetaData;
import org.jboss.portal.theme.LayoutException;
import org.jboss.portal.theme.PortalLayout;
import org.jboss.portal.theme.PortalRenderSet;
-import org.jboss.portal.theme.RuntimeContext;
import org.jboss.portal.theme.ServerRegistrationID;
-import org.jboss.portal.theme.deployment.jboss.PortalLayoutMetaDataFactory;
-import org.jboss.portal.theme.deployment.jboss.RenderSetMetaDataFactory;
import org.jboss.portal.theme.impl.LayoutServiceImpl;
import org.jboss.portal.theme.impl.render.div.DivDecorationRenderer;
import org.jboss.portal.theme.impl.render.div.DivPortletRenderer;
@@ -47,8 +47,6 @@
import org.jboss.portal.theme.impl.render.empty.EmptyPortletRenderer;
import org.jboss.portal.theme.impl.render.empty.EmptyRegionRenderer;
import org.jboss.portal.theme.impl.render.empty.EmptyWindowRenderer;
-import org.jboss.portal.theme.metadata.PortalLayoutMetaData;
-import org.jboss.portal.theme.metadata.RenderSetMetaData;
import org.jboss.xb.binding.Unmarshaller;
import org.jboss.xb.binding.UnmarshallerFactory;
@@ -80,7 +78,7 @@
assertNotNull("Layout xml could not be loaded", res);
Unmarshaller unmarshaller = null;
unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
- portalLayouts = (List)unmarshaller.unmarshal(res.asInputStream(), new PortalLayoutMetaDataFactory(), null);
+ portalLayouts = TestHelper.getLayoutsMetaData(res.asInputStream()).getLayouts();
for (Iterator i = portalLayouts.iterator(); i.hasNext();)
{
@@ -90,7 +88,7 @@
res = new CLResourceLoader().getResource("xml/portal-renderSet.xml");
unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
- renderSets = (List)unmarshaller.unmarshal(res.asInputStream(), new RenderSetMetaDataFactory(), null);
+ renderSets = TestHelper.getRenderSetsMetaData(res.asInputStream()).getRenderSets();
for (Iterator i = renderSets.iterator(); i.hasNext();)
{
RenderSetMetaData renderSetMD = (RenderSetMetaData)i.next();
Modified: branches/JBoss_Portal_Branch_2_7_AS5/theme/src/main/org/jboss/portal/test/theme/tmp/TestThemeServiceImpl.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7_AS5/theme/src/main/org/jboss/portal/test/theme/tmp/TestThemeServiceImpl.java 2009-04-02 23:22:29 UTC (rev 13146)
+++ branches/JBoss_Portal_Branch_2_7_AS5/theme/src/main/org/jboss/portal/test/theme/tmp/TestThemeServiceImpl.java 2009-04-02 23:22:35 UTC (rev 13147)
@@ -25,13 +25,12 @@
import junit.framework.TestCase;
import org.jboss.portal.common.util.CLResourceLoader;
import org.jboss.portal.common.util.LoaderResource;
+import org.jboss.portal.deployer.portal.RuntimeContext;
+import org.jboss.portal.metadata.theme.PortalThemeMetaData;
import org.jboss.portal.theme.PortalTheme;
-import org.jboss.portal.theme.RuntimeContext;
import org.jboss.portal.theme.ThemeException;
import org.jboss.portal.theme.ThemeService;
-import org.jboss.portal.theme.deployment.jboss.PortalThemeMetaDataFactory;
import org.jboss.portal.theme.impl.ThemeServiceImpl;
-import org.jboss.portal.theme.metadata.PortalThemeMetaData;
import org.jboss.xb.binding.Unmarshaller;
import org.jboss.xb.binding.UnmarshallerFactory;
import org.xml.sax.SAXException;
@@ -60,7 +59,7 @@
LoaderResource res = new CLResourceLoader().getResource("xml/portal-themes.xml");
Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
- themes = (List)unmarshaller.unmarshal(res.asInputStream(), new PortalThemeMetaDataFactory(), null);
+ TestHelper.getThemesMetaData(res.asInputStream()).getThemes();
for (Iterator i = themes.iterator(); i.hasNext();)
{
PortalThemeMetaData themeMD = (PortalThemeMetaData)i.next();
Deleted: branches/JBoss_Portal_Branch_2_7_AS5/theme/src/main/org/jboss/portal/test/theme/tmp/metadata/TestPortalLayoutMetaData.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7_AS5/theme/src/main/org/jboss/portal/test/theme/tmp/metadata/TestPortalLayoutMetaData.java 2009-04-02 23:22:29 UTC (rev 13146)
+++ branches/JBoss_Portal_Branch_2_7_AS5/theme/src/main/org/jboss/portal/test/theme/tmp/metadata/TestPortalLayoutMetaData.java 2009-04-02 23:22:35 UTC (rev 13147)
@@ -1,179 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.test.theme.tmp.metadata;
-
-import junit.framework.TestCase;
-import org.jboss.portal.theme.deployment.jboss.PortalLayoutMetaDataFactory;
-import org.jboss.portal.theme.metadata.PortalLayoutMetaData;
-import org.jboss.xb.binding.JBossXBException;
-import org.jboss.xb.binding.UnmarshallerFactory;
-
-import java.io.StringReader;
-import java.util.List;
-
-/**
- * Test all aspects of the portal layout meta data.
- *
- * @author <a href="mailto:mholzner@novell.com">Martin Holzner</a>
- * @version $Revision$
- */
-public class TestPortalLayoutMetaData extends TestCase
-{
- public void testBuildLayoutMetaDataList() throws Exception
- {
- try
- {
- // create a descriptor for the tests
- StringBuffer testString = new StringBuffer();
- testString.append("<layouts>");
- testString.append("<layout>");
- testString.append("<name>nodesk</name>");
- testString.append("<uri>/nodesk/index.jsp</uri>");
- testString.append("<regions>");
- testString.append("<region name=\"left\"/>");
- testString.append("<region name=\"center\"/>");
- testString.append("</regions>");
- testString.append("</layout>");
- testString.append("<layout>");
- testString.append("<name>generic</name>");
- testString.append("<uri>/layouts/generic/index.jsp</uri>");
- testString.append("<uri state=\"maximized\">/layouts/generic/maximized.jsp</uri>");
- testString.append("<regions>");
- testString.append("<region name=\"left\"/>");
- testString.append("<region name=\"center\"/>");
- testString.append("<region name=\"navigation\"/>");
- testString.append("</regions>");
- testString.append("</layout>");
- testString.append("</layouts>");
-
- List layoutMDList = (List)UnmarshallerFactory.newInstance().newUnmarshaller().unmarshal(new StringReader(testString.toString()), new PortalLayoutMetaDataFactory(), null);
- assertNotNull(layoutMDList);
- assertTrue(layoutMDList.size() == 2);
-
- PortalLayoutMetaData layoutMD = (PortalLayoutMetaData)layoutMDList.get(0);
- assertEquals("nodesk", layoutMD.getName());
- assertEquals("/nodesk/index.jsp", layoutMD.getURI());
- assertNotNull(layoutMD.getLayoutURIStateMap());
- assertEquals(0, layoutMD.getLayoutURIStateMap().size());
- assertNotNull(layoutMD.getClassName());
- assertNotNull(layoutMD.getRegionNames());
- assertEquals(2, layoutMD.getRegionNames().size());
- assertTrue(layoutMD.getRegionNames().contains("left"));
- assertTrue(layoutMD.getRegionNames().contains("center"));
-
- layoutMD = (PortalLayoutMetaData)layoutMDList.get(1);
- assertEquals("generic", layoutMD.getName());
- assertEquals("/layouts/generic/index.jsp", layoutMD.getURI());
- assertNotNull(layoutMD.getLayoutURIStateMap());
- assertEquals(1, layoutMD.getLayoutURIStateMap().size());
- assertNotNull(layoutMD.getClassName());
- assertNotNull(layoutMD.getRegionNames());
- assertEquals(3, layoutMD.getRegionNames().size());
- assertTrue(layoutMD.getRegionNames().contains("left"));
- assertTrue(layoutMD.getRegionNames().contains("center"));
- assertTrue(layoutMD.getRegionNames().contains("navigation"));
- }
- catch (IllegalArgumentException e)
- {
- // the layout meta needs the portal web app to be not null and have an id
- assertTrue("expected exception did occur", true);
- }
- }
-
- public void testLayoutMetaDataNoName() throws Exception
- {
- StringBuffer testString = new StringBuffer();
- testString.append("<layouts>");
-
- // no name
- testString.append("<layout>");
-// testString.append("<name>nodesk</name>");
- testString.append("<uri>/nodesk/index.jsp</uri>");
- testString.append("<regions>");
- testString.append("<region name=\"left\"/>");
- testString.append("<region name=\"center\"/>");
- testString.append("</regions>");
- testString.append("</layout>");
-
- testString.append("</layouts>");
-
- List layoutMDList = (List)UnmarshallerFactory.newInstance().newUnmarshaller().unmarshal(new StringReader(testString.toString()), new PortalLayoutMetaDataFactory(), null);
- PortalLayoutMetaData layoutMD = (PortalLayoutMetaData)layoutMDList.get(0);
- assertTrue(layoutMD.getName() == null);
- }
-
- public void testLayoutMetaDataNoURI() throws JBossXBException
- {
- StringBuffer testString = new StringBuffer();
- testString.append("<layouts>");
-
- // no uri
- testString.append("<layout>");
- testString.append("<name>nodesk</name>");
- testString.append("</layout>");
-// testString.append("<uri>/nodesk/index.jsp</uri>");
- testString.append("</layouts>");
-
- List layoutMDList = (List)UnmarshallerFactory.newInstance().newUnmarshaller().unmarshal(new StringReader(testString.toString()), new PortalLayoutMetaDataFactory(), null);
- PortalLayoutMetaData layoutMD = (PortalLayoutMetaData)layoutMDList.get(0);
- assertTrue(layoutMD.getURI() == null);
- }
-
- public void testLayoutMetaDataNoRegions() throws Exception
- {
- StringBuffer testString = new StringBuffer();
- testString.append("<layouts>");
- // no regions
- testString.append("<layout>");
- testString.append("<name>nodesk</name>");
- testString.append("<uri>/nodesk/index.jsp</uri>");
- testString.append("</layout>");
- testString.append("</layouts>");
- List layoutMDList = (List)UnmarshallerFactory.newInstance().newUnmarshaller().unmarshal(new StringReader(testString.toString()), new PortalLayoutMetaDataFactory(), null);
- assertNotNull(layoutMDList);
- PortalLayoutMetaData layoutMD = (PortalLayoutMetaData)layoutMDList.get(0);
- assertNotNull(layoutMD.getRegionNames());
- assertTrue(layoutMD.getRegionNames().size() == 0);
- }
-
- // What in the world does this do?
-/*
- public void testLayoutMetaData4() throws Exception
- {
- StringBuffer testString = new StringBuffer();
- testString.append("<layouts>");
- // fragment assembler class specified
- testString.append("<layout>");
- testString.append("<name>nodesk</name>");
- testString.append("<uri>/nodesk/index.jsp</uri>");
- testString.append("<fragment-assembler-implementation>TestFragmentAssembler</fragment-assembler-implementation>");
- testString.append("</layout>");
- testString.append("</layouts>");
- List layoutMDList = (List)UnmarshallerFactory.newInstance().newUnmarshaller().unmarshal(new StringReader(testString.toString()), new PortalLayoutMetaDataFactory(), null);
- assertNotNull(layoutMDList);
- PortalLayoutMetaData layoutMD = (PortalLayoutMetaData)layoutMDList.get(0);
- assertNotNull(layoutMD.getClassName());
- assertEquals("org.jboss.portal.theme.impl.JSPLayout", layoutMD.getClassName());
- }
-*/
-}
\ No newline at end of file
Deleted: branches/JBoss_Portal_Branch_2_7_AS5/theme/src/main/org/jboss/portal/test/theme/tmp/metadata/TestPortalThemeMetaData.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7_AS5/theme/src/main/org/jboss/portal/test/theme/tmp/metadata/TestPortalThemeMetaData.java 2009-04-02 23:22:29 UTC (rev 13146)
+++ branches/JBoss_Portal_Branch_2_7_AS5/theme/src/main/org/jboss/portal/test/theme/tmp/metadata/TestPortalThemeMetaData.java 2009-04-02 23:22:35 UTC (rev 13147)
@@ -1,156 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.test.theme.tmp.metadata;
-
-import junit.framework.TestCase;
-import org.jboss.portal.theme.deployment.jboss.PortalThemeMetaDataFactory;
-import org.jboss.portal.theme.metadata.PortalThemeMetaData;
-import org.jboss.portal.theme.metadata.ThemeLinkMetaData;
-import org.jboss.portal.theme.metadata.ThemeScriptMetaData;
-import org.jboss.xb.binding.JBossXBException;
-import org.jboss.xb.binding.UnmarshallerFactory;
-
-import java.io.StringReader;
-import java.util.List;
-
-/**
- * Testcase for the portal theme meta data parsing from the descriptor
- * <p/>
- * example descriptor:
- * <p/>
- * <themes> <theme> <name>industrial</name> <link rel="stylesheet" id="main_css" href="/themes/industrial/portal_style.css"
- * type="text/css" /> <link rel="shortcut icon" href="/themes/industrial/images/favicon.ico" /> </theme> <theme>
- * <name>Nphalanx</name> <link rel="stylesheet" id="main_css" href="/themes/phalanx/portal_style.css" type="text/css" />
- * <link rel="shortcut icon" href="/themes/phalanx/images/favicon.ico" /> </theme> <theme> <name>mission-critical</name>
- * <link rel="stylesheet" id="main_css" href="/themes/mission-critical/portal_style.css" type="text/css" /> <link
- * rel="shortcut icon" href="/themes/mission-critical/images/favicon.ico" /> </theme> <theme> <name>Maple</name> <link
- * rel="stylesheet" id="main_css" href="/themes/maple/portal_style.css" type="text/css"/> <link rel="shortcut icon"
- * href="/themes/maple/images/favicon.ico"/> </theme> </themes> *
- *
- * @author <a href="mailto:mholzner@novell.com">Martin Holzner</a>
- * @version $Revision$
- */
-public class TestPortalThemeMetaData extends TestCase
-{
-
- public void testBuildThemeMetaDataList() throws JBossXBException
- {
- try
- {
- // create a descriptor for the tests
- StringBuffer testString = new StringBuffer();
- testString.append("<themes>");
-
- testString.append("<theme>");
- testString.append("<name>industrial</name>");
- testString.append("<link rel=\"stylesheet\" id=\"main_css\" href=\"/themes/industrial/portal_style.css\" type=\"text/css\" />");
- testString.append("<link rel=\"shortcut icon\" href=\"/themes/industrial/images/favicon.ico\" />");
- testString.append("</theme>");
-
- testString.append("<theme>");
- testString.append("<name>mission-critical</name>");
- testString.append("<link rel=\"stylesheet\" id=\"main_css\" href=\"/themes/mission-critical/portal_style.css\" type=\"text/css\" />");
- testString.append("<link rel=\"shortcut icon\" href=\"/themes/mission-critical/images/favicon.ico\" />");
- testString.append("<script id=\"scriptWithBody\" type=\"text/javascript\">some script content here...</script>");
- testString.append("<script src=\"srcURL\" id=\"scriptWithNoBody\" type=\"text/javascript\"/>");
- testString.append("</theme>");
-
- testString.append("</themes>");
-
- List themes = (List)UnmarshallerFactory.newInstance().newUnmarshaller().unmarshal(new StringReader(testString.toString()), new PortalThemeMetaDataFactory(), null);
-
- assertTrue(themes.size() == 2);
-
- PortalThemeMetaData meta = (PortalThemeMetaData)themes.get(0);
- assertEquals("industrial", meta.getName());
- assertTrue(meta.getLinks().size() == 2);
- assertTrue(meta.getScripts().size() == 0);
-
- List links = meta.getLinks();
- ThemeLinkMetaData link = (ThemeLinkMetaData)links.get(0);
- assertEquals("/themes/industrial/portal_style.css", link.getHref());
- assertEquals("text/css", link.getType());
-
- // second link
- link = (ThemeLinkMetaData)links.get(1);
- assertEquals("/themes/industrial/images/favicon.ico", link.getHref());
- assertEquals("shortcut icon", link.getRel());
-
- // test the second theme
- meta = (PortalThemeMetaData)themes.get(1);
- assertEquals("mission-critical", meta.getName());
- assertTrue(meta.getLinks().size() == 2);
- assertTrue(meta.getScripts().size() == 2);
-
- ThemeScriptMetaData script = (ThemeScriptMetaData)meta.getScripts().get(0);
- assertTrue(script.getSrc() == null);
- assertEquals("scriptWithBody", script.getId());
- assertEquals("text/javascript", script.getType());
-
- script = (ThemeScriptMetaData)meta.getScripts().get(1);
- assertEquals("srcURL", script.getSrc());
- assertEquals("scriptWithNoBody", script.getId());
- }
- catch (Exception e)
- {
- assertFalse("unexpected exception occured", true);
- }
- }
-
- public void testThemeMetaDataNoName() throws JBossXBException
- {
- StringBuffer testString = new StringBuffer();
- testString.append("<themes>");
-
- // no name defined
- testString.append("<theme>");
-// testString.append("<name>industrial</name>");
- testString.append("<link rel=\"stylesheet\" id=\"main_css\" href=\"/themes/industrial/portal_style.css\" type=\"text/css\" />");
- testString.append("<link rel=\"shortcut icon\" href=\"/themes/industrial/images/favicon.ico\" />");
- testString.append("</theme>");
-
- testString.append("</themes>");
-
- List themes = (List)UnmarshallerFactory.newInstance().newUnmarshaller().unmarshal(new StringReader(testString.toString()), new PortalThemeMetaDataFactory(), null);
- PortalThemeMetaData meta = (PortalThemeMetaData)themes.get(0);
- assertTrue(meta.getName() == null);
- }
-
- public void testThemeMetaDataNoLinks() throws JBossXBException
- {
- StringBuffer testString = new StringBuffer();
- testString.append("<themes>");
-
- // no link, no script defined
- testString.append("<theme>");
- testString.append("<name>industrial</name>");
- testString.append("</theme>");
-
- testString.append("</themes>");
-
- List themes = (List)UnmarshallerFactory.newInstance().newUnmarshaller().unmarshal(new StringReader(testString.toString()), new PortalThemeMetaDataFactory(), null);
- PortalThemeMetaData meta = (PortalThemeMetaData)themes.get(0);
- assertTrue(meta.getLinks().size() == 0);
- assertTrue(meta.getScripts().size() == 0);
- }
-}
Deleted: branches/JBoss_Portal_Branch_2_7_AS5/theme/src/main/org/jboss/portal/test/theme/tmp/metadata/TestRenderSetMetaData.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7_AS5/theme/src/main/org/jboss/portal/test/theme/tmp/metadata/TestRenderSetMetaData.java 2009-04-02 23:22:29 UTC (rev 13146)
+++ branches/JBoss_Portal_Branch_2_7_AS5/theme/src/main/org/jboss/portal/test/theme/tmp/metadata/TestRenderSetMetaData.java 2009-04-02 23:22:35 UTC (rev 13147)
@@ -1,196 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.test.theme.tmp.metadata;
-
-import junit.framework.TestCase;
-
-import org.jboss.portal.common.net.media.MediaType;
-import org.jboss.portal.common.net.media.SubtypeDef;
-import org.jboss.portal.common.net.media.TypeDef;
-import org.jboss.portal.theme.deployment.jboss.RenderSetMetaDataFactory;
-import org.jboss.portal.theme.metadata.RenderSetMetaData;
-import org.jboss.portal.theme.metadata.RendererSetMetaData;
-import org.jboss.xb.binding.JBossXBException;
-import org.jboss.xb.binding.UnmarshallerFactory;
-import org.xml.sax.SAXException;
-
-import javax.xml.parsers.ParserConfigurationException;
-import java.io.IOException;
-import java.io.StringReader;
-import java.util.List;
-
-/**
- * Test cases for the render set meta data <p/> <p/> exmaple of a render set descriptor: <p/> <portal-renderSet>
- * <renderSet name="divRenderer"> <set content-type="text/html"> <region-renderer>org.jboss.portal.theme.impl.render.div.DivRegionRenderer</region-renderer>
- * <window-renderer>org.jboss.portal.theme.impl.render.div.DivWindowRenderer</window-renderer>
- * <portlet-renderer>org.jboss.portal.theme.impl.render.div.DivPortletRenderer</portlet-renderer>
- * <decoration-renderer>org.jboss.portal.theme.impl.render.div.DivDecorationRenderer</decoration-renderer> </set>
- * </renderSet> <renderSet name="emptyRenderer"> <set content-type="text/html"> <region-renderer>org.jboss.portal.theme.impl.render.empty.EmptyRegionRenderer</region-renderer>
- * <window-renderer>org.jboss.portal.theme.impl.render.empty.EmptyWindowRenderer</window-renderer>
- * <portlet-renderer>org.jboss.portal.theme.impl.render.empty.EmptyPortletRenderer</portlet-renderer>
- * <decoration-renderer>org.jboss.portal.theme.impl.render.empty.EmptyDecorationRenderer</decoration-renderer> </set>
- * </renderSet> </portal-renderSet> <p/> </p>
- *
- * @author <a href="mailto:mholzner@novell.com">Martin Holzner</a>
- * @version $Revision$
- */
-public class TestRenderSetMetaData extends TestCase
-{
-
- public void testBuildRenderSetMD() throws IOException, ParserConfigurationException, SAXException
- {
- try
- {
- StringBuffer testString = new StringBuffer();
- testString.append("<portal-renderSet>");
-
- testString.append("<renderSet name=\"divRenderer\">");
-
- testString.append("<set content-type=\"text/html\">");
- testString.append("<region-renderer>DivRegionRenderer</region-renderer>");
- testString.append("<window-renderer>DivWindowRenderer</window-renderer>");
- testString.append("<portlet-renderer>DivPortletRenderer</portlet-renderer>");
- testString.append("<decoration-renderer>DivDecorationRenderer</decoration-renderer>");
- testString.append("</set>");
-
- testString.append("</renderSet>");
-
-
- testString.append("<renderSet name=\"emptyRenderer\">");
-
- testString.append("<set content-type=\"text/html\">");
- testString.append("<region-renderer>EmptyRegionRendererHTML</region-renderer>");
- testString.append("<window-renderer>EmptyWindowRendererHTML</window-renderer>");
- testString.append("<portlet-renderer>EmptyPortletRendererHTML</portlet-renderer>");
- testString.append("<decoration-renderer>EmptyDecorationRendererHTML</decoration-renderer>");
- testString.append("</set>");
-
- testString.append("<set content-type=\"application/xhtml+xml\">");
- testString.append("<region-renderer>EmptyRegionRendererXHTML</region-renderer>");
- testString.append("<window-renderer>EmptyWindowRendererXHTML</window-renderer>");
- testString.append("<portlet-renderer>EmptyPortletRendererXHTML</portlet-renderer>");
- testString.append("<decoration-renderer>EmptyDecorationRendererXHTML</decoration-renderer>");
- testString.append("</set>");
-
- testString.append("</renderSet>");
-
- testString.append("</portal-renderSet>");
-
- List setList = (List)UnmarshallerFactory.newInstance().newUnmarshaller().unmarshal(new StringReader(testString.toString()), new RenderSetMetaDataFactory(), null);
- assertNotNull(setList);
- assertTrue(setList.size() == 2);
-
- RenderSetMetaData renderSetMD = (RenderSetMetaData)setList.get(0);
- assertEquals("divRenderer", renderSetMD.getName());
- assertNotNull(renderSetMD.getRendererSet());
- assertTrue(renderSetMD.getRendererSet().size() == 1);
- RendererSetMetaData rendererSetMD = (RendererSetMetaData)renderSetMD.getRendererSet().get(0);
- assertEquals(MediaType.TEXT_HTML, rendererSetMD.getMediaType());
- assertEquals("DivPortletRenderer", rendererSetMD.getPortletRenderer());
-
- renderSetMD = (RenderSetMetaData)setList.get(1);
- assertEquals("emptyRenderer", renderSetMD.getName());
- assertNotNull(renderSetMD.getRendererSet());
- assertTrue(renderSetMD.getRendererSet().size() == 2);
-
- rendererSetMD = (RendererSetMetaData)renderSetMD.getRendererSet().get(0);
- assertEquals(MediaType.TEXT_HTML, rendererSetMD.getMediaType());
- assertEquals("EmptyPortletRendererHTML", rendererSetMD.getPortletRenderer());
-
- rendererSetMD = (RendererSetMetaData)renderSetMD.getRendererSet().get(1);
- assertEquals(MediaType.TEXT_HTML, rendererSetMD.getMediaType());
- assertEquals("EmptyDecorationRendererXHTML", rendererSetMD.getDecorationRenderer());
- }
- catch (Exception e)
- {
- assertFalse("unexpected exception occured" + e.getMessage(), true);
- }
- }
-
- public void testRenderSetMetaDataNoMime() throws JBossXBException
- {
- StringBuffer testString = new StringBuffer();
- // no content type attribute in the set
- testString.append("<portal-renderSet>");
- testString.append("<renderSet name=\"divRenderer\">");
- testString.append("<set>");
- testString.append("<region-renderer>DivRegionRenderer</region-renderer>");
- testString.append("<window-renderer>DivWindowRenderer</window-renderer>");
- testString.append("<portlet-renderer>DivPortletRenderer</portlet-renderer>");
- testString.append("<decoration-renderer>DivDecorationRenderer</decoration-renderer>");
- testString.append("</set>");
- testString.append("</renderSet>");
- testString.append("</portal-renderSet>");
- try
- {
- List setList = (List)UnmarshallerFactory.newInstance().newUnmarshaller().unmarshal(new StringReader(testString.toString()), new RenderSetMetaDataFactory(), null);
- RenderSetMetaData renderSetMD = (RenderSetMetaData)setList.get(0);
- RendererSetMetaData rendererSetMD = (RendererSetMetaData)renderSetMD.getRendererSet().get(0);
- assertFalse("expected exception did not occur", true);
- }
- catch (JBossXBException e)
- {
- // expected
- }
- }
-
- public void testRenderSetMetaDataNoWindowRenderer() throws JBossXBException
- {
- StringBuffer testString = new StringBuffer();
- // no window renderer defined in the set
- testString.append("<portal-renderSet>");
- testString.append("<renderSet name=\"divRenderer\">");
- testString.append("<set content-type=\"text/html\">");
- testString.append("<region-renderer>DivRegionRenderer</region-renderer>");
-// testString.append("<window-renderer>DivWindowRenderer</window-renderer>");
- testString.append("<portlet-renderer>DivPortletRenderer</portlet-renderer>");
- testString.append("<decoration-renderer>DivDecorationRenderer</decoration-renderer>");
- testString.append("</set>");
- testString.append("</renderSet>");
- testString.append("</portal-renderSet>");
-
- List setList = (List)UnmarshallerFactory.newInstance().newUnmarshaller().unmarshal(new StringReader(testString.toString()), new RenderSetMetaDataFactory(), null);
- RenderSetMetaData renderSetMD = (RenderSetMetaData)setList.get(0);
- RendererSetMetaData rendererSetMD = (RendererSetMetaData)renderSetMD.getRendererSet().get(0);
- assertTrue(rendererSetMD.getWindowRenderer() == null);
- }
-
- public void testRenderSetMetaDataEmpty() throws JBossXBException
- {
- StringBuffer testString = new StringBuffer();
- // empty render set descriptor
- testString.append("<portal-renderSet>");
- testString.append("</portal-renderSet>");
-
- List setList = (List)UnmarshallerFactory.newInstance().newUnmarshaller().unmarshal(new StringReader(testString.toString()), new RenderSetMetaDataFactory(), null);
- try
- {
- RenderSetMetaData renderSetMD = (RenderSetMetaData)setList.get(0);
- assertFalse("expected exception did not occur", true);
- }
- catch (IndexOutOfBoundsException ioe)
- {
- // expected
- }
- }
-}
Modified: branches/JBoss_Portal_Branch_2_7_AS5/theme/src/main/org/jboss/portal/test/theme/tmp/render/TestRenderedMarkup.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7_AS5/theme/src/main/org/jboss/portal/test/theme/tmp/render/TestRenderedMarkup.java 2009-04-02 23:22:29 UTC (rev 13146)
+++ branches/JBoss_Portal_Branch_2_7_AS5/theme/src/main/org/jboss/portal/test/theme/tmp/render/TestRenderedMarkup.java 2009-04-02 23:22:35 UTC (rev 13147)
@@ -27,24 +27,21 @@
import org.jboss.portal.common.util.CLResourceLoader;
import org.jboss.portal.common.util.LoaderResource;
import org.jboss.portal.common.util.MarkupInfo;
+import org.jboss.portal.deployer.portal.RuntimeContext;
+import org.jboss.portal.metadata.layout.PortalLayoutMetaData;
+import org.jboss.portal.metadata.renderset.RenderSetMetaData;
+import org.jboss.portal.metadata.theme.PortalThemeMetaData;
import org.jboss.portal.server.ServerRequest;
import org.jboss.portal.test.theme.tmp.TestHelper;
import org.jboss.portal.theme.LayoutService;
import org.jboss.portal.theme.PortalLayout;
import org.jboss.portal.theme.PortalRenderSet;
import org.jboss.portal.theme.PortalTheme;
-import org.jboss.portal.theme.RuntimeContext;
import org.jboss.portal.theme.ThemeConstants;
import org.jboss.portal.theme.ThemeService;
-import org.jboss.portal.theme.deployment.jboss.PortalLayoutMetaDataFactory;
-import org.jboss.portal.theme.deployment.jboss.PortalThemeMetaDataFactory;
-import org.jboss.portal.theme.deployment.jboss.RenderSetMetaDataFactory;
import org.jboss.portal.theme.impl.LayoutServiceImpl;
import org.jboss.portal.theme.impl.ThemeServiceImpl;
import org.jboss.portal.theme.impl.render.dynamic.DynaConstants;
-import org.jboss.portal.theme.metadata.PortalLayoutMetaData;
-import org.jboss.portal.theme.metadata.PortalThemeMetaData;
-import org.jboss.portal.theme.metadata.RenderSetMetaData;
import org.jboss.portal.theme.page.PageResult;
import org.jboss.portal.theme.page.WindowContext;
import org.jboss.portal.theme.page.WindowResult;
@@ -91,7 +88,7 @@
LoaderResource res = new CLResourceLoader().getResource("xml/portal-layouts.xml");
Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
- List portalLayouts = (List)unmarshaller.unmarshal(res.asInputStream(), new PortalLayoutMetaDataFactory(), null);
+ List portalLayouts = TestHelper.getLayoutsMetaData(res.asInputStream()).getLayouts();
for (Iterator i = portalLayouts.iterator(); i.hasNext();)
{
PortalLayoutMetaData layoutMD = (PortalLayoutMetaData)i.next();
@@ -101,7 +98,7 @@
res = new CLResourceLoader().getResource("xml/portal-renderSet.xml");
unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
- List renderSets = (List)unmarshaller.unmarshal(res.asInputStream(), new RenderSetMetaDataFactory(), null);
+ List renderSets = TestHelper.getRenderSetsMetaData(res.asInputStream()).getRenderSets();
for (Iterator i = renderSets.iterator(); i.hasNext();)
{
RenderSetMetaData renderSetMD = (RenderSetMetaData)i.next();
@@ -111,8 +108,7 @@
res = new CLResourceLoader().getResource("xml/portal-themes.xml");
unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
-
- List themes = (List)unmarshaller.unmarshal(res.asInputStream(), new PortalThemeMetaDataFactory(), null);
+ List themes = TestHelper.getThemesMetaData(res.asInputStream()).getThemes();
for (Iterator i = themes.iterator(); i.hasNext();)
{
PortalThemeMetaData themeMD = (PortalThemeMetaData)i.next();
Modified: branches/JBoss_Portal_Branch_2_7_AS5/theme/src/main/org/jboss/portal/theme/LayoutInfo.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7_AS5/theme/src/main/org/jboss/portal/theme/LayoutInfo.java 2009-04-02 23:22:29 UTC (rev 13146)
+++ branches/JBoss_Portal_Branch_2_7_AS5/theme/src/main/org/jboss/portal/theme/LayoutInfo.java 2009-04-02 23:22:35 UTC (rev 13147)
@@ -23,12 +23,15 @@
package org.jboss.portal.theme;
-import org.jboss.portal.theme.metadata.PortalLayoutMetaData;
-import org.jboss.portal.theme.metadata.StateURIMetaData;
+import org.jboss.portal.metadata.layout.PortalLayoutMetaData;
+import org.jboss.portal.metadata.layout.URIMetaData;
+import org.jboss.portal.deployer.portal.RuntimeContext;
import javax.servlet.ServletContext;
import java.util.Collections;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
/**
* Info about the layout.
@@ -43,7 +46,15 @@
private final RuntimeContext ctx;
/** . */
- private final PortalLayoutMetaData layoutMD;
+ //private final PortalLayoutMetaData layoutMD;
+
+ private final String name;
+
+ private final List<String> regions;
+
+ private String uri;
+
+ private Map<String, String> uriStateMap;
/** . */
private final ServerRegistrationID registrationId;
@@ -51,8 +62,22 @@
public LayoutInfo(RuntimeContext ctx, PortalLayoutMetaData layoutMD)
{
this.ctx = ctx;
- this.layoutMD = layoutMD;
+ this.name = layoutMD.getName();
+ this.regions = layoutMD.getRegions();
this.registrationId = ServerRegistrationID.createID(ServerRegistrationID.TYPE_LAYOUT, new String[]{ctx.getAppId(), layoutMD.getName()});
+
+ uriStateMap = new HashMap<String, String>();
+ for (URIMetaData uriMetaData : layoutMD.getUris())
+ {
+ if (uriMetaData.getState() == null)
+ {
+ this.uri = uriMetaData.getUri();
+ }
+ else
+ {
+ uriStateMap.put(uriMetaData.getState(), uriMetaData.getUri());
+ }
+ }
}
public ServerRegistrationID getRegistrationId()
@@ -77,7 +102,7 @@
*/
public String getName()
{
- return layoutMD.getName();
+ return name;
}
/**
@@ -101,7 +126,7 @@
*/
public String getURI()
{
- return layoutMD.getURI();
+ return uri;
}
/**
@@ -120,19 +145,21 @@
{
return getURI();
}
- if (!layoutMD.getLayoutURIStateMap().isEmpty())
+ else if (!uriStateMap.isEmpty())
{
- StateURIMetaData stateURI = (StateURIMetaData)layoutMD.getLayoutURIStateMap().get(state);
- if (stateURI != null)
+ if (uriStateMap.containsKey(state))
{
- return stateURI.getURI();
+ return uriStateMap.get(state);
}
else
{
return null;
}
}
- return null;
+ else
+ {
+ return null;
+ }
}
/**
@@ -148,7 +175,7 @@
/** @see PortalLayoutMetaData#getRegionNames */
public List getRegionNames()
{
- return Collections.unmodifiableList(layoutMD.getRegionNames());
+ return Collections.unmodifiableList(regions);
}
public String toString()
Modified: branches/JBoss_Portal_Branch_2_7_AS5/theme/src/main/org/jboss/portal/theme/LayoutService.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7_AS5/theme/src/main/org/jboss/portal/theme/LayoutService.java 2009-04-02 23:22:29 UTC (rev 13146)
+++ branches/JBoss_Portal_Branch_2_7_AS5/theme/src/main/org/jboss/portal/theme/LayoutService.java 2009-04-02 23:22:35 UTC (rev 13147)
@@ -22,8 +22,10 @@
******************************************************************************/
package org.jboss.portal.theme;
-import org.jboss.portal.theme.metadata.PortalLayoutMetaData;
-import org.jboss.portal.theme.metadata.RenderSetMetaData;
+import org.jboss.portal.metadata.layout.PortalLayoutMetaData;
+import org.jboss.portal.metadata.renderset.PortalRenderSetsMetaData;
+import org.jboss.portal.metadata.renderset.RenderSetMetaData;
+import org.jboss.portal.deployer.portal.RuntimeContext;
/**
* TODO: A description of this class.
Modified: branches/JBoss_Portal_Branch_2_7_AS5/theme/src/main/org/jboss/portal/theme/PortalRenderSet.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7_AS5/theme/src/main/org/jboss/portal/theme/PortalRenderSet.java 2009-04-02 23:22:29 UTC (rev 13146)
+++ branches/JBoss_Portal_Branch_2_7_AS5/theme/src/main/org/jboss/portal/theme/PortalRenderSet.java 2009-04-02 23:22:35 UTC (rev 13147)
@@ -23,16 +23,17 @@
package org.jboss.portal.theme;
import org.jboss.portal.common.net.media.MediaType;
+import org.jboss.portal.metadata.renderset.SetMetaData;
import org.jboss.portal.theme.impl.render.dynamic.DynaDecorationRenderer;
import org.jboss.portal.theme.impl.render.dynamic.DynaPortletRenderer;
import org.jboss.portal.theme.impl.render.dynamic.DynaRegionRenderer;
import org.jboss.portal.theme.impl.render.dynamic.DynaWindowRenderer;
-import org.jboss.portal.theme.metadata.RendererSetMetaData;
import org.jboss.portal.theme.render.ObjectRenderer;
import org.jboss.portal.theme.render.renderer.DecorationRenderer;
import org.jboss.portal.theme.render.renderer.PortletRenderer;
import org.jboss.portal.theme.render.renderer.RegionRenderer;
import org.jboss.portal.theme.render.renderer.WindowRenderer;
+import org.jboss.portal.deployer.portal.RuntimeContext;
/**
* The portal render set is a set of renderer implementations for the markup container of a page. <p>A render set
@@ -68,7 +69,7 @@
* @throws InstantiationException
* @throws ClassNotFoundException
*/
- public PortalRenderSet(String renderSetName, RuntimeContext runtimeContext, RendererSetMetaData rendererSetMD) throws IllegalAccessException, InstantiationException, ClassNotFoundException
+ public PortalRenderSet(String renderSetName, RuntimeContext runtimeContext, SetMetaData rendererSetMD) throws IllegalAccessException, InstantiationException, ClassNotFoundException
{
// there CAN be render sets without a name !
@@ -83,8 +84,8 @@
this.name = renderSetName;
this.appID = runtimeContext.getAppId();
this.registrationId = ServerRegistrationID.createID(ServerRegistrationID.TYPE_RENDERSET, new String[]{appID, name});
- this.mediaType = rendererSetMD.getMediaType();
- this.ajaxEnabled = rendererSetMD.isAjaxEnabled();
+ this.mediaType = MediaType.create(rendererSetMD.getContentType());
+ this.ajaxEnabled = rendererSetMD.getAjaxEnabled();
if (ajaxEnabled) // wrap the current renderer with the ajax delegator one.
{
Deleted: branches/JBoss_Portal_Branch_2_7_AS5/theme/src/main/org/jboss/portal/theme/RuntimeContext.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7_AS5/theme/src/main/org/jboss/portal/theme/RuntimeContext.java 2009-04-02 23:22:29 UTC (rev 13146)
+++ branches/JBoss_Portal_Branch_2_7_AS5/theme/src/main/org/jboss/portal/theme/RuntimeContext.java 2009-04-02 23:22:35 UTC (rev 13147)
@@ -1,82 +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.theme;
-
-import javax.servlet.ServletContext;
-
-/**
- * @author <a href="mailto:mholzner@novell.com">Martin Holzner</a>
- * @version $Revision$
- */
-public final class RuntimeContext
-{
- private final String pwaId;
- private final ServletContext servletContext;
- private final String contextPath;
- private final ClassLoader classLoader;
-
- public RuntimeContext(String pwaId, ServletContext context, String contextPath, ClassLoader loader)
- {
- if (pwaId == null)
- {
- throw new IllegalArgumentException("pwaId is null");
- }
- if (context == null)
- {
- throw new IllegalArgumentException("servletContext is null");
- }
- if (contextPath == null)
- {
- throw new IllegalArgumentException("contextPath is null");
- }
- if (loader == null)
- {
- throw new IllegalArgumentException("class loader is null");
- }
-
- this.pwaId = pwaId;
- this.servletContext = context;
- this.classLoader = loader;
- this.contextPath = contextPath;
- }
-
- public String getAppId()
- {
- return pwaId;
- }
-
- public ServletContext getServletContext()
- {
- return servletContext;
- }
-
- public String getContextPath()
- {
- return contextPath;
- }
-
- public ClassLoader getClassLoader()
- {
- return classLoader;
- }
-}
Modified: branches/JBoss_Portal_Branch_2_7_AS5/theme/src/main/org/jboss/portal/theme/ThemeInfo.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7_AS5/theme/src/main/org/jboss/portal/theme/ThemeInfo.java 2009-04-02 23:22:29 UTC (rev 13146)
+++ branches/JBoss_Portal_Branch_2_7_AS5/theme/src/main/org/jboss/portal/theme/ThemeInfo.java 2009-04-02 23:22:35 UTC (rev 13147)
@@ -23,13 +23,14 @@
package org.jboss.portal.theme;
-import org.jboss.portal.theme.metadata.PortalThemeMetaData;
-import org.jboss.portal.theme.metadata.ThemeLinkMetaData;
-import org.jboss.portal.theme.metadata.ThemeScriptMetaData;
-
import java.util.ArrayList;
import java.util.List;
+import org.jboss.portal.metadata.theme.PortalThemeMetaData;
+import org.jboss.portal.metadata.theme.ThemeLinkMetaData;
+import org.jboss.portal.metadata.theme.ThemeScriptMetaData;
+import org.jboss.portal.deployer.portal.RuntimeContext;
+
/**
* @author <a href="mailto:mholzner@novell.com">Martin Holzner</a>
* @author <a href="mailto:roy@jboss.org">Roy Russo</a>
Modified: branches/JBoss_Portal_Branch_2_7_AS5/theme/src/main/org/jboss/portal/theme/ThemeService.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7_AS5/theme/src/main/org/jboss/portal/theme/ThemeService.java 2009-04-02 23:22:29 UTC (rev 13146)
+++ branches/JBoss_Portal_Branch_2_7_AS5/theme/src/main/org/jboss/portal/theme/ThemeService.java 2009-04-02 23:22:35 UTC (rev 13147)
@@ -22,7 +22,8 @@
******************************************************************************/
package org.jboss.portal.theme;
-import org.jboss.portal.theme.metadata.PortalThemeMetaData;
+import org.jboss.portal.metadata.theme.PortalThemeMetaData;
+import org.jboss.portal.deployer.portal.RuntimeContext;
/**
* The ThemeService is the location where all the available themes are stored and retrieved. <p>The theme server works
Deleted: branches/JBoss_Portal_Branch_2_7_AS5/theme/src/main/org/jboss/portal/theme/deployment/jboss/LayoutDeployment.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7_AS5/theme/src/main/org/jboss/portal/theme/deployment/jboss/LayoutDeployment.java 2009-04-02 23:22:29 UTC (rev 13146)
+++ branches/JBoss_Portal_Branch_2_7_AS5/theme/src/main/org/jboss/portal/theme/deployment/jboss/LayoutDeployment.java 2009-04-02 23:22:35 UTC (rev 13147)
@@ -1,150 +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.theme.deployment.jboss;
-
-import org.jboss.deployment.DeploymentException;
-import org.jboss.logging.Logger;
-import org.jboss.portal.common.io.IOTools;
-import org.jboss.portal.server.deployment.PortalWebApp;
-import org.jboss.portal.server.deployment.jboss.Deployment;
-import org.jboss.portal.theme.LayoutException;
-import org.jboss.portal.theme.LayoutService;
-import org.jboss.portal.theme.RuntimeContext;
-import org.jboss.portal.theme.metadata.PortalLayoutMetaData;
-import org.jboss.xb.binding.Unmarshaller;
-import org.jboss.xb.binding.UnmarshallerFactory;
-
-import javax.management.MBeanServer;
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.util.Iterator;
-import java.util.List;
-
-/**
- * Deploy the layouts contained in a WebApplication. <p>A Web Application can define layouts to be offered to the
- * portal. Layouts are JSPs or Servlets, that take over the job of presenting the rendered content of a portal request
- * to the end device. Layouts need to be announced to the portal via the /WEB-INF/portal-layouts.xml descriptor (see
- * also portal-layouts.dtd)</p>
- *
- * @author <a href="mailto:mholzner@novell.com">Martin Holzner</a>
- * @version $Revision$
- */
-public class LayoutDeployment extends Deployment
-{
- private static Logger log = Logger.getLogger(LayoutDeployment.class);
- private final LayoutDeploymentFactory factory;
-
- public LayoutDeployment(URL url, PortalWebApp pwa,
- MBeanServer mbeanServer, LayoutDeploymentFactory layoutDeploymentFactory)
- {
- super(url, pwa, mbeanServer);
- this.factory = layoutDeploymentFactory;
- }
-
- /**
- * Create the resources from this portal web application.
- *
- * @throws DeploymentException if anything goes wrong
- */
- public void create() throws DeploymentException
- {
- log.debug("Create new layout(s), found in : " + pwa.getId());
-
- //
- InputStream in = null;
- try
- {
- in = IOTools.safeBufferedWrapper(url.openStream());
- LayoutService layoutService = factory.getLayoutService();
- RuntimeContext ctx = new RuntimeContext(pwa.getId(), pwa.getServletContext(), pwa.getContextPath(), pwa.getClassLoader());
- Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
- List portalLayouts = (List)unmarshaller.unmarshal(in, new PortalLayoutMetaDataFactory(), null);
- for (Iterator i = portalLayouts.iterator(); i.hasNext();)
- {
- PortalLayoutMetaData layoutMD = (PortalLayoutMetaData)i.next();
- layoutService.addLayout(ctx, layoutMD);
- }
- log.debug("Done creating new layout(s), found in : " + pwa.getId());
- }
- catch (Exception e)
- {
- throw new DeploymentException(e);
- }
- finally
- {
- IOTools.safeClose(in);
- }
-
- // Make sure that the portal-layout.tld is available in the local context
- File targetContextRoot = new File(pwa.getServletContext().getRealPath("/WEB-INF"));
- if (targetContextRoot.exists() && targetContextRoot.isDirectory())
- {
- InputStream source = null;
- try
- {
- source = IOTools.safeBufferedWrapper(Thread.currentThread().getContextClassLoader().getResourceAsStream("conf/theme/portal-layout.tld"));
- pwa.importFile("/WEB-INF/theme", "portal-layout.tld", source, false);
- }
- catch (IOException e)
- {
- throw new DeploymentException("Cannot import portal-layout.tld", e);
- }
- finally
- {
- IOTools.safeClose(source);
- }
- }
- else
- {
- log.warn("Cannot access the WEB-INF folder for the deployed application: " + pwa.getId());
- }
- }
-
- /**
- * Destroy (and remove) all the resources from this portal web application that are registered with the portal.
- *
- * @throws DeploymentException if anything goes wrong
- */
- public void destroy() throws DeploymentException
- {
- if (log.isDebugEnabled())
- {
- log.debug("destroying layout(s), found in : " + pwa.getId());
- }
- try
- {
- LayoutService server = factory.getLayoutService();
- server.removeLayouts(pwa.getId());
- }
- catch (LayoutException e)
- {
- throw new DeploymentException(e);
- }
- if (log.isDebugEnabled())
- {
- log.debug("done destroying layout(s), found in : " + pwa.getId());
- }
- }
-}
Deleted: branches/JBoss_Portal_Branch_2_7_AS5/theme/src/main/org/jboss/portal/theme/deployment/jboss/LayoutDeploymentFactory.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7_AS5/theme/src/main/org/jboss/portal/theme/deployment/jboss/LayoutDeploymentFactory.java 2009-04-02 23:22:29 UTC (rev 13146)
+++ branches/JBoss_Portal_Branch_2_7_AS5/theme/src/main/org/jboss/portal/theme/deployment/jboss/LayoutDeploymentFactory.java 2009-04-02 23:22:35 UTC (rev 13147)
@@ -1,70 +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.theme.deployment.jboss;
-
-import org.jboss.deployment.DeploymentException;
-import org.jboss.portal.server.deployment.PortalWebApp;
-import org.jboss.portal.server.deployment.jboss.AbstractDeploymentFactory;
-import org.jboss.portal.server.deployment.jboss.Deployment;
-import org.jboss.portal.theme.LayoutService;
-
-import javax.management.MBeanServer;
-import java.net.URL;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-/**
- * Create a layout deployer.
- *
- * @author <a href="mailto:mholzner@novell.com">Martin Holzner</a>
- * @version $Revision$
- */
-public class LayoutDeploymentFactory extends AbstractDeploymentFactory
-{
-
- protected static final Pattern URL_PATTERN = Pattern.compile(".*-layouts\\.xml");
-
- private LayoutService layoutService;
-
- public boolean acceptFile(URL url)
- {
- String urlAsFile = url.getFile();
- Matcher matcher = URL_PATTERN.matcher(urlAsFile);
- return matcher.matches();
- }
-
- public Deployment newInstance(URL url, PortalWebApp pwa, MBeanServer mbeanServer) throws DeploymentException
- {
- return new LayoutDeployment(url, pwa, mbeanServer, this);
- }
-
- public LayoutService getLayoutService()
- {
- return layoutService;
- }
-
- public void setLayoutService(LayoutService layoutService)
- {
- this.layoutService = layoutService;
- }
-}
Added: branches/JBoss_Portal_Branch_2_7_AS5/theme/src/main/org/jboss/portal/theme/deployment/jboss/LayoutDeploymentImpl.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7_AS5/theme/src/main/org/jboss/portal/theme/deployment/jboss/LayoutDeploymentImpl.java (rev 0)
+++ branches/JBoss_Portal_Branch_2_7_AS5/theme/src/main/org/jboss/portal/theme/deployment/jboss/LayoutDeploymentImpl.java 2009-04-02 23:22:35 UTC (rev 13147)
@@ -0,0 +1,75 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2009, 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.theme.deployment.jboss;
+
+import org.jboss.deployers.spi.DeploymentException;
+import org.jboss.logging.Logger;
+import org.jboss.portal.deployer.portal.RuntimeContext;
+import org.jboss.portal.deployer.theme.container.LayoutDeployment;
+import org.jboss.portal.metadata.layout.PortalLayoutMetaData;
+import org.jboss.portal.metadata.layout.PortalLayoutsMetaData;
+import org.jboss.portal.theme.LayoutException;
+import org.jboss.portal.theme.LayoutService;
+
+/**
+ * @author <a href="mailto:mwringe@redhat.com">Matt Wringe</a>
+ * @version $Revision$
+ */
+public class LayoutDeploymentImpl implements LayoutDeployment
+{
+ private static Logger log = Logger.getLogger(LayoutDeploymentImpl.class);
+
+ protected LayoutService layoutService;
+
+ public void setLayoutService (LayoutService layoutService)
+ {
+ this.layoutService = layoutService;
+ }
+
+ public void deployLayouts(RuntimeContext runtimeContext, PortalLayoutsMetaData portalLayoutsMetaData) throws DeploymentException
+ {
+ try
+ {
+ for (PortalLayoutMetaData layoutMetaData : portalLayoutsMetaData.getLayouts())
+ layoutService.addLayout(runtimeContext, layoutMetaData);
+ }
+ catch (LayoutException le)
+ {
+ throw new DeploymentException("Error trying to deploy layout from " + runtimeContext.getAppId(), le);
+ }
+ }
+
+ public void undeployLayouts(String appId)
+ {
+ try
+ {
+ layoutService.removeLayouts(appId);
+ }
+ catch (LayoutException le)
+ {
+ log.error("Error trying to undeploy themes from " + appId, le);
+ }
+ }
+
+}
+
Deleted: branches/JBoss_Portal_Branch_2_7_AS5/theme/src/main/org/jboss/portal/theme/deployment/jboss/LayoutFeaturesDeployment.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7_AS5/theme/src/main/org/jboss/portal/theme/deployment/jboss/LayoutFeaturesDeployment.java 2009-04-02 23:22:29 UTC (rev 13146)
+++ branches/JBoss_Portal_Branch_2_7_AS5/theme/src/main/org/jboss/portal/theme/deployment/jboss/LayoutFeaturesDeployment.java 2009-04-02 23:22:35 UTC (rev 13147)
@@ -1,160 +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.theme.deployment.jboss;
-
-import org.jboss.deployment.DeploymentException;
-import org.jboss.logging.Logger;
-import org.jboss.portal.common.io.IOTools;
-import org.jboss.portal.server.deployment.PortalWebApp;
-import org.jboss.portal.server.deployment.jboss.Deployment;
-import org.jboss.portal.theme.LayoutException;
-import org.jboss.portal.theme.LayoutService;
-import org.jboss.portal.theme.RuntimeContext;
-import org.jboss.portal.theme.metadata.RenderSetMetaData;
-import org.jboss.xb.binding.UnmarshallerFactory;
-
-import javax.management.MBeanServer;
-import java.io.InputStream;
-import java.net.URL;
-import java.util.List;
-
-/**
- * Deploy rendersets contained in a WebApplication. <p>A Web Application can define render sets in their respective
- * descriptors. Portal RenderSets are defined in a descriptor called portal-renderSet.xml in the WEB-INF/layout folder.
- * Additionally, rendersets can be defined as part of a layout descriptor (portal-layouts.xml). Those cases are handled
- * by the layout deployment.</p>
- *
- * @author <a href="mailto:mholzner@novell.com">Martin Holzner</a>
- * @version $Revision$
- */
-public class LayoutFeaturesDeployment extends Deployment
-{
-
- /** . */
- private static Logger log = Logger.getLogger(LayoutFeaturesDeployment.class);
-
- /** . */
- private final LayoutFeaturesDeploymentFactory factory;
-
- /** . */
- private boolean trace = false;
-
- public LayoutFeaturesDeployment(
- URL url,
- PortalWebApp pwa,
- MBeanServer mbeanServer,
- LayoutFeaturesDeploymentFactory factory)
- {
- super(url, pwa, mbeanServer);
- this.factory = factory;
- trace = log.isTraceEnabled();
- }
-
- /**
- * Create the resources from this portal web application.
- *
- * @throws org.jboss.deployment.DeploymentException
- * if anything goes wrong
- */
- public void create() throws DeploymentException
- {
- if (trace)
- {
- log.trace("create new renderset(s) found in : " + pwa.getId());
- }
-
- try
- {
- boolean isRenderSet = url.toString().endsWith("-renderSet.xml");
-
- // see if there are any named rendersets
-
- if (isRenderSet)
- {
- RuntimeContext ctx = new RuntimeContext(pwa.getId(), pwa.getServletContext(), pwa.getContextPath(), pwa.getClassLoader());
- LayoutService layoutService = factory.getLayoutService();
- InputStream stream = null;
- try
- {
- stream = IOTools.safeBufferedWrapper(url.openStream());
- if (isRenderSet)
- {
- List renderSets = (List)UnmarshallerFactory.newInstance().newUnmarshaller().unmarshal(stream, new RenderSetMetaDataFactory(), null);
- for (int i = 0; i < renderSets.size(); i++)
- {
- RenderSetMetaData renderSet = (RenderSetMetaData)renderSets.get(i);
- layoutService.addRenderSet(ctx, renderSet);
- }
- }
- }
- finally
- {
- IOTools.safeClose(stream);
- }
- }
- else
- {
- if (trace)
- {
- log.trace("can't handle deployment of url :" + url);
- }
- }
-
- if (trace)
- {
- log.trace("done creating new renderset(s) found in : " + pwa.getId());
- }
- }
- catch (Exception e)
- {
- throw new DeploymentException(e);
- }
- }
-
- /**
- * Destroy (and remove) all the resources from this portal web application that are registered with the portal.
- *
- * @throws org.jboss.deployment.DeploymentException
- * if anything goes wrong
- */
- public void destroy() throws DeploymentException
- {
- if (trace)
- {
- log.trace("destroying renderset(s) found in : " + pwa.getId());
- }
- try
- {
- LayoutService service = factory.getLayoutService();
- service.removeRenderSets(pwa.getId());
- }
- catch (LayoutException e)
- {
- throw new DeploymentException(e);
- }
- if (trace)
- {
- log.trace("done destroying renderset(s) found in : " + pwa.getId());
- }
- }
-}
Deleted: branches/JBoss_Portal_Branch_2_7_AS5/theme/src/main/org/jboss/portal/theme/deployment/jboss/LayoutFeaturesDeploymentFactory.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7_AS5/theme/src/main/org/jboss/portal/theme/deployment/jboss/LayoutFeaturesDeploymentFactory.java 2009-04-02 23:22:29 UTC (rev 13146)
+++ branches/JBoss_Portal_Branch_2_7_AS5/theme/src/main/org/jboss/portal/theme/deployment/jboss/LayoutFeaturesDeploymentFactory.java 2009-04-02 23:22:35 UTC (rev 13147)
@@ -1,73 +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.theme.deployment.jboss;
-
-import org.jboss.deployment.DeploymentException;
-import org.jboss.portal.server.deployment.PortalWebApp;
-import org.jboss.portal.server.deployment.jboss.AbstractDeploymentFactory;
-import org.jboss.portal.server.deployment.jboss.Deployment;
-import org.jboss.portal.theme.LayoutService;
-
-import javax.management.MBeanServer;
-import java.net.URL;
-import java.util.regex.Pattern;
-
-/**
- * Create a layout deployer.
- *
- * @author <a href="mailto:mholzner@novell.com">Martin Holzner</a>
- * @version $Revision$
- */
-public class LayoutFeaturesDeploymentFactory extends AbstractDeploymentFactory
-{
-
- protected static final Pattern URL_PATTERN = Pattern.compile(".*-renderSet\\.xml");
- protected static final Pattern URL_PATTERN2 = Pattern.compile(".*-strategies\\.xml");
- private LayoutService layoutService;
-
- public boolean acceptFile(URL url)
- {
- String urlAsFile = url.getFile();
- return URL_PATTERN.matcher(urlAsFile).matches() || URL_PATTERN2.matcher(urlAsFile).matches();
- }
-
- public boolean acceptDir(URL url)
- {
- return super.acceptDir(url) || url.getFile().endsWith("/layout/");
- }
-
- public Deployment newInstance(URL url, PortalWebApp pwa, MBeanServer mbeanServer) throws DeploymentException
- {
- return new LayoutFeaturesDeployment(url, pwa, mbeanServer, this);
- }
-
- public LayoutService getLayoutService()
- {
- return layoutService;
- }
-
- public void setLayoutService(LayoutService layoutService)
- {
- this.layoutService = layoutService;
- }
-}
Deleted: branches/JBoss_Portal_Branch_2_7_AS5/theme/src/main/org/jboss/portal/theme/deployment/jboss/PortalLayoutMetaDataFactory.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7_AS5/theme/src/main/org/jboss/portal/theme/deployment/jboss/PortalLayoutMetaDataFactory.java 2009-04-02 23:22:29 UTC (rev 13146)
+++ branches/JBoss_Portal_Branch_2_7_AS5/theme/src/main/org/jboss/portal/theme/deployment/jboss/PortalLayoutMetaDataFactory.java 2009-04-02 23:22:35 UTC (rev 13147)
@@ -1,120 +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.theme.deployment.jboss;
-
-import org.jboss.portal.theme.metadata.PortalLayoutMetaData;
-import org.jboss.portal.theme.metadata.StateURIMetaData;
-import org.jboss.xb.binding.ObjectModelFactory;
-import org.jboss.xb.binding.UnmarshallingContext;
-import org.xml.sax.Attributes;
-
-import java.util.ArrayList;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision$
- */
-public class PortalLayoutMetaDataFactory implements ObjectModelFactory
-{
-
- public Object newRoot(Object root, UnmarshallingContext nav, String nsURI, String localName, Attributes attrs)
- {
- return new ArrayList();
- }
-
- public Object completeRoot(Object root, UnmarshallingContext nav, String nsURI, String localName)
- {
- return root;
- }
-
- public Object newChild(ArrayList list, UnmarshallingContext nav, String nsURI, String localName, Attributes attrs)
- {
- if ("layout".equals(localName))
- {
- return new PortalLayoutMetaData();
- }
- return null;
- }
-
- public void addChild(ArrayList list, PortalLayoutMetaData portalLayout, UnmarshallingContext nav, String nsURI, String localName)
- {
- list.add(portalLayout);
- }
-
- public void setValue(PortalLayoutMetaData portalLayout, UnmarshallingContext nav, String nsURI, String localName, String value)
- {
- if ("name".equals(localName))
- {
- portalLayout.setName(value);
- }
- else if ("layout-implementation".equals(localName))
- {
- portalLayout.setClassName(value);
- }
- else if ("uri".equals(localName))
- {
- portalLayout.setURI(value);
- }
- else if ("region".equals(localName))
- {
- portalLayout.getRegionNames().add(value);
- }
- }
-
- public Object newChild(PortalLayoutMetaData portalLayout, UnmarshallingContext nav, String nsURI, String localName, Attributes attrs)
- {
- if ("uri".equals(localName))
- {
- String state = attrs.getValue("state");
- if (state != null)
- {
- StateURIMetaData stateURI = new StateURIMetaData();
- stateURI.setState(state);
- return stateURI;
- }
- }
- else if ("region".equals(localName))
- {
- return attrs.getValue("name");
- }
- return null;
- }
-
- public void setValue(StateURIMetaData stateURI, UnmarshallingContext nav, String nsURI, String localName, String value)
- {
- if ("uri".equals(localName))
- {
- stateURI.setURI(value);
- }
- }
-
- public void addChild(PortalLayoutMetaData portalLayout, StateURIMetaData stateURI, UnmarshallingContext nav, String nsURI, String localName)
- {
- portalLayout.getLayoutURIStateMap().put(stateURI.getState(), stateURI);
- }
-
- public void addChild(PortalLayoutMetaData portalLayout, String regionName, UnmarshallingContext nav, String nsURI, String localName)
- {
- portalLayout.getRegionNames().add(regionName);
- }
-}
Deleted: branches/JBoss_Portal_Branch_2_7_AS5/theme/src/main/org/jboss/portal/theme/deployment/jboss/PortalThemeMetaDataFactory.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7_AS5/theme/src/main/org/jboss/portal/theme/deployment/jboss/PortalThemeMetaDataFactory.java 2009-04-02 23:22:29 UTC (rev 13146)
+++ branches/JBoss_Portal_Branch_2_7_AS5/theme/src/main/org/jboss/portal/theme/deployment/jboss/PortalThemeMetaDataFactory.java 2009-04-02 23:22:35 UTC (rev 13147)
@@ -1,120 +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.theme.deployment.jboss;
-
-import org.jboss.portal.theme.metadata.PortalThemeMetaData;
-import org.jboss.portal.theme.metadata.ThemeLinkMetaData;
-import org.jboss.portal.theme.metadata.ThemeScriptMetaData;
-import org.jboss.xb.binding.ObjectModelFactory;
-import org.jboss.xb.binding.UnmarshallingContext;
-import org.xml.sax.Attributes;
-
-import java.util.ArrayList;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @author <a href="mailto:roy@jboss.org">Roy Russo</a>
- * @version $Revision$
- */
-public class PortalThemeMetaDataFactory implements ObjectModelFactory
-{
-
- public Object newRoot(Object root, UnmarshallingContext nav, String nsURI, String localName, Attributes attrs)
- {
- return new ArrayList();
- }
-
- public Object completeRoot(Object root, UnmarshallingContext nav, String nsURI, String localName)
- {
- return root;
- }
-
- public Object newChild(ArrayList list, UnmarshallingContext nav, String nsURI, String localName, Attributes attrs)
- {
- if ("theme".equals(localName))
- {
- return new PortalThemeMetaData();
- }
- return null;
- }
-
- public void addChild(ArrayList list, PortalThemeMetaData portalTheme, UnmarshallingContext nav, String nsURI, String localName)
- {
- list.add(portalTheme);
- }
-
- public void setValue(PortalThemeMetaData portalTheme, UnmarshallingContext nav, String nsURI, String localName, String value)
- {
- if ("name".equals(localName))
- {
- portalTheme.setName(value);
- }
- else if ("theme-implementation".equals(localName))
- {
- portalTheme.setClassName(value);
- }
- }
-
- public Object newChild(PortalThemeMetaData portalTheme, UnmarshallingContext nav, String nsURI, String localName, Attributes attrs)
- {
- if ("script".equals(localName))
- {
- ThemeScriptMetaData script = new ThemeScriptMetaData();
- script.setSrc(attrs.getValue("src"));
- script.setId(attrs.getValue("id"));
- script.setType(attrs.getValue("type"));
- script.setCharset(attrs.getValue("charset"));
- return script;
- }
- else if ("link".equals(localName))
- {
- ThemeLinkMetaData link = new ThemeLinkMetaData();
- link.setHref(attrs.getValue("href"));
- link.setId(attrs.getValue("id"));
- link.setType(attrs.getValue("type"));
- link.setTitle(attrs.getValue("title"));
- link.setMedia(attrs.getValue("media"));
- link.setRel(attrs.getValue("rel"));
- return link;
- }
- return null;
- }
-
- public void setValue(ThemeScriptMetaData script, UnmarshallingContext nav, String nsURI, String localName, String value)
- {
- if ("script".equals(localName))
- {
- script.setBodyContent(value);
- }
- }
-
- public void addChild(PortalThemeMetaData portalTheme, ThemeScriptMetaData script, UnmarshallingContext nav, String nsURI, String localName)
- {
- portalTheme.getScripts().add(script);
- }
-
- public void addChild(PortalThemeMetaData portalTheme, ThemeLinkMetaData link, UnmarshallingContext nav, String nsURI, String localName)
- {
- portalTheme.getLinks().add(link);
- }
-}
Added: branches/JBoss_Portal_Branch_2_7_AS5/theme/src/main/org/jboss/portal/theme/deployment/jboss/RenderSetDeploymentImpl.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7_AS5/theme/src/main/org/jboss/portal/theme/deployment/jboss/RenderSetDeploymentImpl.java (rev 0)
+++ branches/JBoss_Portal_Branch_2_7_AS5/theme/src/main/org/jboss/portal/theme/deployment/jboss/RenderSetDeploymentImpl.java 2009-04-02 23:22:35 UTC (rev 13147)
@@ -0,0 +1,75 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2009, 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.theme.deployment.jboss;
+
+import org.jboss.deployers.spi.DeploymentException;
+import org.jboss.logging.Logger;
+import org.jboss.portal.deployer.portal.RuntimeContext;
+import org.jboss.portal.deployer.theme.container.RenderSetDeployment;
+import org.jboss.portal.metadata.renderset.PortalRenderSetsMetaData;
+import org.jboss.portal.metadata.renderset.RenderSetMetaData;
+import org.jboss.portal.theme.LayoutException;
+import org.jboss.portal.theme.LayoutService;
+
+/**
+ * @author <a href="mailto:mwringe@redhat.com">Matt Wringe</a>
+ * @version $Revision$
+ */
+public class RenderSetDeploymentImpl implements RenderSetDeployment
+{
+ private static Logger log = Logger.getLogger(RenderSetDeploymentImpl.class);
+
+ protected LayoutService layoutService;
+
+ public void setLayoutService (LayoutService layoutService)
+ {
+ this.layoutService = layoutService;
+ }
+
+ public void deployRenderSets(RuntimeContext runtimeContext, PortalRenderSetsMetaData portalRenderSets) throws DeploymentException
+ {
+ try
+ {
+ for (RenderSetMetaData renderSetMetaData : portalRenderSets.getRenderSets())
+ layoutService.addRenderSet(runtimeContext, renderSetMetaData);
+ }
+ catch (LayoutException le)
+ {
+ throw new DeploymentException("Error trying to deploy layout from " + runtimeContext.getAppId(), le);
+ }
+ }
+
+ public void undeployRenderSets(String appId)
+ {
+ try
+ {
+ layoutService.removeLayouts(appId);
+ }
+ catch (LayoutException le)
+ {
+ log.error("Error trying to undeploy rendersets from " + appId, le);
+ }
+ }
+
+}
+
Deleted: branches/JBoss_Portal_Branch_2_7_AS5/theme/src/main/org/jboss/portal/theme/deployment/jboss/RenderSetMetaDataFactory.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7_AS5/theme/src/main/org/jboss/portal/theme/deployment/jboss/RenderSetMetaDataFactory.java 2009-04-02 23:22:29 UTC (rev 13146)
+++ branches/JBoss_Portal_Branch_2_7_AS5/theme/src/main/org/jboss/portal/theme/deployment/jboss/RenderSetMetaDataFactory.java 2009-04-02 23:22:35 UTC (rev 13147)
@@ -1,109 +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.theme.deployment.jboss;
-
-import org.jboss.portal.common.net.media.MediaType;
-import org.jboss.portal.theme.metadata.RenderSetMetaData;
-import org.jboss.portal.theme.metadata.RendererSetMetaData;
-import org.jboss.xb.binding.ObjectModelFactory;
-import org.jboss.xb.binding.UnmarshallingContext;
-import org.xml.sax.Attributes;
-
-import javax.activation.MimeTypeParseException;
-import java.util.ArrayList;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision$
- */
-public class RenderSetMetaDataFactory implements ObjectModelFactory
-{
-
- public Object newRoot(Object root, UnmarshallingContext nav, String nsURI, String localName, Attributes attrs)
- {
- return new ArrayList();
- }
-
- public Object completeRoot(Object root, UnmarshallingContext nav, String nsURI, String localName)
- {
- return root;
- }
-
- public Object newChild(ArrayList list, UnmarshallingContext nav, String nsURI, String localName, Attributes attrs)
- {
- if ("renderSet".equals(localName))
- {
- String name = attrs.getValue("name");
- RenderSetMetaData renderSet = new RenderSetMetaData();
- renderSet.setName(name);
- return renderSet;
- }
- return null;
- }
-
- public void addChild(ArrayList list, RenderSetMetaData renderSet, UnmarshallingContext nav, String nsURI, String localName)
- {
- list.add(renderSet);
- }
-
- public Object newChild(RenderSetMetaData renderSet, UnmarshallingContext nav, String nsURI, String localName, Attributes attrs) throws MimeTypeParseException
- {
- if ("set".equals(localName))
- {
- RendererSetMetaData rendererSet = new RendererSetMetaData();
- String contentType = attrs.getValue("content-type");
- rendererSet.setMediaType(MediaType.create(contentType));
- return rendererSet;
- }
- return null;
- }
-
- public void addChild(RenderSetMetaData renderSet, RendererSetMetaData rendererSet, UnmarshallingContext nav, String nsURI, String localName)
- {
- renderSet.getRendererSet().add(rendererSet);
- }
-
- public void setValue(RendererSetMetaData rendererSet, UnmarshallingContext nav, String nsURI, String localName, String value)
- {
- if ("region-renderer".equals(localName))
- {
- rendererSet.setRegionRenderer(value);
- }
- else if ("window-renderer".equals(localName))
- {
- rendererSet.setWindowRenderer(value);
- }
- else if ("portlet-renderer".equals(localName))
- {
- rendererSet.setPortletRenderer(value);
- }
- else if ("decoration-renderer".equals(localName))
- {
- rendererSet.setDecorationRenderer(value);
- }
- else if (localName.equals("ajax-enabled"))
- {
- rendererSet.setAjaxEnabled(value.equals("true"));
- }
- }
-}
Deleted: branches/JBoss_Portal_Branch_2_7_AS5/theme/src/main/org/jboss/portal/theme/deployment/jboss/ThemeDeployment.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7_AS5/theme/src/main/org/jboss/portal/theme/deployment/jboss/ThemeDeployment.java 2009-04-02 23:22:29 UTC (rev 13146)
+++ branches/JBoss_Portal_Branch_2_7_AS5/theme/src/main/org/jboss/portal/theme/deployment/jboss/ThemeDeployment.java 2009-04-02 23:22:35 UTC (rev 13147)
@@ -1,120 +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.theme.deployment.jboss;
-
-import org.jboss.deployment.DeploymentException;
-import org.jboss.logging.Logger;
-import org.jboss.portal.common.io.IOTools;
-import org.jboss.portal.server.deployment.PortalWebApp;
-import org.jboss.portal.server.deployment.jboss.Deployment;
-import org.jboss.portal.theme.RuntimeContext;
-import org.jboss.portal.theme.ThemeException;
-import org.jboss.portal.theme.metadata.PortalThemeMetaData;
-import org.jboss.xb.binding.UnmarshallerFactory;
-
-import javax.management.MBeanServer;
-import java.io.InputStream;
-import java.net.URL;
-import java.util.Iterator;
-import java.util.List;
-
-/**
- * Deploy the themes contained in a WebApplication. <p>This deployer scans the archive for /WEB-INF/portal-themes.xml.
- * This file contains the definition of one or more themes. A theme is one, or a set of, css file, and the resources
- * that go with it.</p>
- *
- * @author <a href="mailto:mholzner@novell.com">Martin Holzner</a>
- * @version $Revision$
- */
-public class ThemeDeployment extends Deployment
-{
- private final ThemeDeploymentFactory factory;
-
- private static Logger log = Logger.getLogger(ThemeDeployment.class);
-
- public ThemeDeployment(URL url, PortalWebApp pwa, MBeanServer mbeanServer, ThemeDeploymentFactory factory)
- {
- super(url, pwa, mbeanServer);
- this.factory = factory;
- }
-
- /**
- * Create all the theme resources that are container in this portal web application.
- *
- * @throws DeploymentException if anything goes wrong
- */
- public void create() throws DeploymentException
- {
- if (log.isDebugEnabled())
- {
- log.debug("create new theme(s), found in : " + pwa.getId());
- }
- InputStream themeStream = null;
- try
- {
- themeStream = IOTools.safeBufferedWrapper(url.openStream());
-
- RuntimeContext ctx = new RuntimeContext(pwa.getId(), pwa.getServletContext(), pwa.getContextPath(), pwa.getClassLoader());
- List portalThemes = (List)UnmarshallerFactory.newInstance().newUnmarshaller().unmarshal(themeStream, new PortalThemeMetaDataFactory(), null);
- for (Iterator i = portalThemes.iterator(); i.hasNext();)
- {
- PortalThemeMetaData themeMD = (PortalThemeMetaData)i.next();
- factory.getThemeService().addTheme(ctx, themeMD);
- }
- }
- catch (Exception e)
- {
- throw new DeploymentException(e);
- }
- finally
- {
- IOTools.safeClose(themeStream);
- }
- }
-
- /**
- * Destroy all the theme resources that are contained in this portal web application.
- *
- * @throws DeploymentException if anything goes wrong
- */
- public void destroy() throws DeploymentException
- {
- if (log.isDebugEnabled())
- {
- log.debug("destroying theme(s), found in : " + pwa.getId());
- }
- try
- {
- factory.getThemeService().removeThemes(pwa.getId());
- if (log.isDebugEnabled())
- {
- log.debug("done destroying theme(s), found in : " + pwa.getId());
- }
- }
- catch (ThemeException e)
- {
- throw new DeploymentException(e);
- }
- }
-
-}
\ No newline at end of file
Deleted: branches/JBoss_Portal_Branch_2_7_AS5/theme/src/main/org/jboss/portal/theme/deployment/jboss/ThemeDeploymentFactory.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7_AS5/theme/src/main/org/jboss/portal/theme/deployment/jboss/ThemeDeploymentFactory.java 2009-04-02 23:22:29 UTC (rev 13146)
+++ branches/JBoss_Portal_Branch_2_7_AS5/theme/src/main/org/jboss/portal/theme/deployment/jboss/ThemeDeploymentFactory.java 2009-04-02 23:22:35 UTC (rev 13147)
@@ -1,69 +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.theme.deployment.jboss;
-
-import org.jboss.deployment.DeploymentException;
-import org.jboss.portal.server.deployment.PortalWebApp;
-import org.jboss.portal.server.deployment.jboss.AbstractDeploymentFactory;
-import org.jboss.portal.server.deployment.jboss.Deployment;
-import org.jboss.portal.theme.ThemeService;
-
-import javax.management.MBeanServer;
-import java.net.URL;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-/**
- * Create a new Theme Deployer.
- *
- * @author <a href="mailto:mholzner@novell.com">Martin Holzner</a>
- * @version $Revision$
- */
-public class ThemeDeploymentFactory extends AbstractDeploymentFactory
-{
- protected static final Pattern URL_PATTERN = Pattern.compile(".*-themes\\.xml");
-
- private ThemeService themeService;
-
- public boolean acceptFile(URL url)
- {
- String urlAsFile = url.getFile();
- Matcher matcher = URL_PATTERN.matcher(urlAsFile);
- return matcher.matches();
- }
-
- public Deployment newInstance(URL url, PortalWebApp pwa, MBeanServer mbeanServer) throws DeploymentException
- {
- return new ThemeDeployment(url, pwa, mbeanServer, this);
- }
-
- public ThemeService getThemeService()
- {
- return themeService;
- }
-
- public void setThemeService(ThemeService themeService)
- {
- this.themeService = themeService;
- }
-}
Added: branches/JBoss_Portal_Branch_2_7_AS5/theme/src/main/org/jboss/portal/theme/deployment/jboss/ThemeDeploymentImpl.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7_AS5/theme/src/main/org/jboss/portal/theme/deployment/jboss/ThemeDeploymentImpl.java (rev 0)
+++ branches/JBoss_Portal_Branch_2_7_AS5/theme/src/main/org/jboss/portal/theme/deployment/jboss/ThemeDeploymentImpl.java 2009-04-02 23:22:35 UTC (rev 13147)
@@ -0,0 +1,79 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2009, 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.theme.deployment.jboss;
+
+import org.jboss.deployers.spi.DeploymentException;
+import org.jboss.logging.Logger;
+import org.jboss.portal.deployer.portal.RuntimeContext;
+import org.jboss.portal.deployer.theme.container.ThemeDeployment;
+import org.jboss.portal.metadata.theme.PortalThemeMetaData;
+import org.jboss.portal.metadata.theme.PortalThemesMetaData;
+import org.jboss.portal.theme.ThemeException;
+import org.jboss.portal.theme.ThemeService;
+
+/**
+ * @author <a href="mailto:mwringe@redhat.com">Matt Wringe</a>
+ * @version $Revision$
+ */
+public class ThemeDeploymentImpl implements ThemeDeployment
+{
+
+ private static Logger log = Logger.getLogger(ThemeDeploymentImpl.class);
+
+ protected ThemeService themeService;
+
+ public void setThemeService (ThemeService themeService)
+ {
+ this.themeService = themeService;
+ }
+
+ public void deployThemes (RuntimeContext runtimeContext, PortalThemesMetaData portalThemes) throws DeploymentException
+ {
+ try
+ {
+ log.debug("Trying to deploy theme from " + runtimeContext.getAppId());
+ for (PortalThemeMetaData portalTheme : portalThemes.getThemes())
+ {
+ themeService.addTheme(runtimeContext, portalTheme);
+ }
+ }
+ catch (ThemeException te)
+ {
+ throw new DeploymentException("Error trying to deploy theme from " + runtimeContext.getAppId(), te);
+ }
+ }
+
+ public void undeployThemes(String appId)
+ {
+ try
+ {
+ themeService.removeThemes(appId);
+ }
+ catch (ThemeException te)
+ {
+ log.error("Error trying to undeploy themes from " + appId, te);
+ }
+ }
+
+}
+
Modified: branches/JBoss_Portal_Branch_2_7_AS5/theme/src/main/org/jboss/portal/theme/impl/LayoutServiceImpl.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7_AS5/theme/src/main/org/jboss/portal/theme/impl/LayoutServiceImpl.java 2009-04-02 23:22:29 UTC (rev 13146)
+++ branches/JBoss_Portal_Branch_2_7_AS5/theme/src/main/org/jboss/portal/theme/impl/LayoutServiceImpl.java 2009-04-02 23:22:35 UTC (rev 13147)
@@ -31,11 +31,12 @@
import org.jboss.portal.theme.LayoutService;
import org.jboss.portal.theme.PortalLayout;
import org.jboss.portal.theme.PortalRenderSet;
-import org.jboss.portal.theme.RuntimeContext;
+import org.jboss.portal.deployer.portal.RuntimeContext;
import org.jboss.portal.theme.ServerRegistrationID;
-import org.jboss.portal.theme.metadata.PortalLayoutMetaData;
-import org.jboss.portal.theme.metadata.RenderSetMetaData;
-import org.jboss.portal.theme.metadata.RendererSetMetaData;
+import org.jboss.portal.metadata.layout.PortalLayoutMetaData;
+import org.jboss.portal.metadata.renderset.PortalRenderSetsMetaData;
+import org.jboss.portal.metadata.renderset.RenderSetMetaData;
+import org.jboss.portal.metadata.renderset.SetMetaData;
import org.jboss.system.Service;
import java.util.ArrayList;
@@ -358,14 +359,13 @@
}
}
- public void addRenderSet(RuntimeContext runtimeContext, RenderSetMetaData renderSetMD) throws LayoutException
+ public void addRenderSet(RuntimeContext runtimeContext, RenderSetMetaData renderSetsMD) throws LayoutException
{
try
{
- for (Iterator s = renderSetMD.getRendererSet().iterator(); s.hasNext();)
+ for (SetMetaData setMetaData : renderSetsMD.getSet())
{
- RendererSetMetaData rendererSetMD = (RendererSetMetaData)s.next();
- PortalRenderSet renderSet = new PortalRenderSet(renderSetMD.getName(), runtimeContext, rendererSetMD);
+ PortalRenderSet renderSet = new PortalRenderSet(renderSetsMD.getName(), runtimeContext, setMetaData);
log.debug("adding : " + renderSet.getRegistrationId());
Map sets = (Map)this.renderSets.get(renderSet.getRegistrationId());
if (sets == null)
Modified: branches/JBoss_Portal_Branch_2_7_AS5/theme/src/main/org/jboss/portal/theme/impl/ThemeServiceImpl.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7_AS5/theme/src/main/org/jboss/portal/theme/impl/ThemeServiceImpl.java 2009-04-02 23:22:29 UTC (rev 13146)
+++ branches/JBoss_Portal_Branch_2_7_AS5/theme/src/main/org/jboss/portal/theme/impl/ThemeServiceImpl.java 2009-04-02 23:22:35 UTC (rev 13147)
@@ -24,13 +24,13 @@
import org.jboss.logging.Logger;
import org.jboss.portal.jems.as.system.AbstractJBossService;
+import org.jboss.portal.metadata.theme.PortalThemeMetaData;
import org.jboss.portal.theme.PortalTheme;
-import org.jboss.portal.theme.RuntimeContext;
+import org.jboss.portal.deployer.portal.RuntimeContext;
import org.jboss.portal.theme.ServerRegistrationID;
import org.jboss.portal.theme.ThemeException;
import org.jboss.portal.theme.ThemeInfo;
import org.jboss.portal.theme.ThemeService;
-import org.jboss.portal.theme.metadata.PortalThemeMetaData;
import org.jboss.system.Service;
import java.util.ArrayList;
15 years, 3 months