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;