Author: julien(a)jboss.com
Date: 2007-03-20 12:39:07 -0400 (Tue, 20 Mar 2007)
New Revision: 6780
Removed:
trunk/core/src/main/org/jboss/portal/test/core/theme/strategy/
trunk/core/src/resources/portal-core-war/WEB-INF/layout/portal-strategies.xml
trunk/theme/src/main/org/jboss/portal/test/theme/metadata/TestLayoutStrategySetMetaData.java
trunk/theme/src/main/org/jboss/portal/theme/deployment/jboss/LayoutStategyMetaDataFactory.java
trunk/theme/src/main/org/jboss/portal/theme/impl/strategy/
trunk/theme/src/main/org/jboss/portal/theme/metadata/LayoutStrategyMetaData.java
trunk/theme/src/main/org/jboss/portal/theme/strategy/
Modified:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/PortalAction.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/ThemePropertyAction.java
trunk/core/src/main/org/jboss/portal/core/controller/classic/ClassicController.java
trunk/core/src/main/org/jboss/portal/core/model/instance/command/InvokePortletInstanceRenderCommand.java
trunk/theme/build.xml
trunk/theme/src/main/org/jboss/portal/theme/LayoutConstants.java
trunk/theme/src/main/org/jboss/portal/theme/LayoutService.java
trunk/theme/src/main/org/jboss/portal/theme/LayoutServiceInfo.java
trunk/theme/src/main/org/jboss/portal/theme/ServerRegistrationID.java
trunk/theme/src/main/org/jboss/portal/theme/ThemeConstants.java
trunk/theme/src/main/org/jboss/portal/theme/deployment/jboss/LayoutFeaturesDeployment.java
trunk/theme/src/main/org/jboss/portal/theme/impl/LayoutServiceImpl.java
trunk/theme/src/main/org/jboss/portal/theme/page/WindowContext.java
trunk/theme/src/main/org/jboss/portal/theme/render/PortalRenderSet.java
Log:
- removed strategy code that was not used anymore
- fix prb when seing dashboard due to the new response handler stuff
Modified:
trunk/core/src/main/org/jboss/portal/core/controller/classic/ClassicController.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/core/controller/classic/ClassicController.java 2007-03-20
16:01:43 UTC (rev 6779)
+++
trunk/core/src/main/org/jboss/portal/core/controller/classic/ClassicController.java 2007-03-20
16:39:07 UTC (rev 6780)
@@ -110,7 +110,7 @@
}
else
{
- executeCommand(ctx, forward.getCommand());
+ handleCommand(ctx, forward.getCommand());
}
}
else
Modified:
trunk/core/src/main/org/jboss/portal/core/model/instance/command/InvokePortletInstanceRenderCommand.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/core/model/instance/command/InvokePortletInstanceRenderCommand.java 2007-03-20
16:01:43 UTC (rev 6779)
+++
trunk/core/src/main/org/jboss/portal/core/model/instance/command/InvokePortletInstanceRenderCommand.java 2007-03-20
16:39:07 UTC (rev 6780)
@@ -99,7 +99,6 @@
Map portalProperties = new HashMap();
portalProperties.put("theme.renderSetId", "divRenderer");
portalProperties.put("theme.id", "renaissance");
- portalProperties.put("layout.strategyId",
"maximizedRegion");
PageResult result = new PageResult("BILTO", pageProperties,
portalProperties);
//
Deleted: trunk/core/src/resources/portal-core-war/WEB-INF/layout/portal-strategies.xml
===================================================================
---
trunk/core/src/resources/portal-core-war/WEB-INF/layout/portal-strategies.xml 2007-03-20
16:01:43 UTC (rev 6779)
+++
trunk/core/src/resources/portal-core-war/WEB-INF/layout/portal-strategies.xml 2007-03-20
16:39:07 UTC (rev 6780)
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ~ JBoss, a division of Red Hat ~
- ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
- ~ contributors as indicated by the @authors tag. See the ~
- ~ copyright.txt in the distribution for a full listing of ~
- ~ individual contributors. ~
- ~ ~
- ~ This is free software; you can redistribute it and/or modify it ~
- ~ under the terms of the GNU Lesser General Public License as ~
- ~ published by the Free Software Foundation; either version 2.1 of ~
- ~ the License, or (at your option) any later version. ~
- ~ ~
- ~ This software is distributed in the hope that it will be useful, ~
- ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
- ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
- ~ Lesser General Public License for more details. ~
- ~ ~
- ~ You should have received a copy of the GNU Lesser General Public ~
- ~ License along with this software; if not, write to the Free ~
- ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
- ~ 02110-1301 USA, or see the FSF site:
http://www.fsf.org. ~
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
-
-<portal-strategies>
- <set name="maximizedRegion">
- <strategy content-type="text/html">
-
<implementation>org.jboss.portal.theme.impl.strategy.MaximizingStrategyImpl</implementation>
- </strategy>
- </set>
-</portal-strategies>
Modified:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/PortalAction.java
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/PortalAction.java 2007-03-20
16:01:43 UTC (rev 6779)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/PortalAction.java 2007-03-20
16:39:07 UTC (rev 6780)
@@ -152,7 +152,6 @@
portal.setDeclaredProperty(ThemeConstants.PORTAL_PROP_LAYOUT,
"generic");
portal.setDeclaredProperty(ThemeConstants.PORTAL_PROP_THEME,
"Nphalanx");
portal.setDeclaredProperty(ThemeConstants.PORTAL_PROP_RENDERSET,
"divRenderer");
- portal.setDeclaredProperty(ThemeConstants.PORTAL_PROP_STRATEGY,
"maximizedRegion");
//
portal.getSupportedWindowStates().add(WindowState.MAXIMIZED);
Modified:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/ThemePropertyAction.java
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/ThemePropertyAction.java 2007-03-20
16:01:43 UTC (rev 6779)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/ThemePropertyAction.java 2007-03-20
16:39:07 UTC (rev 6780)
@@ -145,7 +145,6 @@
portalObject.setDeclaredProperty(ThemeConstants.PORTAL_PROP_LAYOUT,
this.layoutName);
portalObject.setDeclaredProperty(ThemeConstants.PORTAL_PROP_THEME,
this.themeName);
portalObject.setDeclaredProperty(ThemeConstants.PORTAL_PROP_RENDERSET,
this.renderSetName);
- portalObject.setDeclaredProperty(ThemeConstants.PORTAL_PROP_STRATEGY,
this.windowRendererName);
break;
case PortalObject.TYPE_WINDOW:
portalObject.setDeclaredProperty(ThemeConstants.PORTAL_PROP_WINDOW_RENDERER,
this.windowRendererName);
Modified: trunk/theme/build.xml
===================================================================
--- trunk/theme/build.xml 2007-03-20 16:01:43 UTC (rev 6779)
+++ trunk/theme/build.xml 2007-03-20 16:39:07 UTC (rev 6780)
@@ -265,7 +265,6 @@
<test todir="${test.reports}"
name="org.jboss.portal.test.theme.TestThemeServiceImpl"/>
<!-- theme metadata tests -->
- <test todir="${test.reports}"
name="org.jboss.portal.test.theme.metadata.TestLayoutStrategySetMetaData"/>
<test todir="${test.reports}"
name="org.jboss.portal.test.theme.metadata.TestPortalLayoutMetaData"/>
<test todir="${test.reports}"
name="org.jboss.portal.test.theme.metadata.TestPortalThemeMetaData"/>
<test todir="${test.reports}"
name="org.jboss.portal.test.theme.metadata.TestRenderSetMetaData"/>
Deleted:
trunk/theme/src/main/org/jboss/portal/test/theme/metadata/TestLayoutStrategySetMetaData.java
===================================================================
---
trunk/theme/src/main/org/jboss/portal/test/theme/metadata/TestLayoutStrategySetMetaData.java 2007-03-20
16:01:43 UTC (rev 6779)
+++
trunk/theme/src/main/org/jboss/portal/test/theme/metadata/TestLayoutStrategySetMetaData.java 2007-03-20
16:39:07 UTC (rev 6780)
@@ -1,168 +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.metadata;
-
-import junit.framework.TestCase;
-import org.jboss.portal.common.util.MediaType;
-import org.jboss.portal.theme.deployment.jboss.LayoutStategyMetaDataFactory;
-import org.jboss.portal.theme.metadata.LayoutStrategyMetaData;
-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 Layout Strategy (Set) MetaData
- *
- * @author <a href="mailto:mholzner@novell.com">Martin Holzner</a>
- * @version $Revision$
- */
-public class TestLayoutStrategySetMetaData extends TestCase
-{
- public void testBuildLayoutStrategyMetaData() throws IOException,
ParserConfigurationException, SAXException
- {
- try
- {
- StringBuffer testString = new StringBuffer();
- testString.append("<portal-strategies>");
-
- // first set
- testString.append("<set name=\"StrategyOne\">");
- // for html
- testString.append("<strategy
content-type=\"text/html\">");
-
testString.append("<implementation>StrategyOneHTML</implementation>");
- testString.append("</strategy>");
- testString.append("</set>");
-
- // first set
- testString.append("<set name=\"StrategyTwo\">");
- // for html
- testString.append("<strategy
content-type=\"text/html\">");
-
testString.append("<implementation>StrategyTwoHTML</implementation>");
- testString.append("</strategy>");
- // for xml
- testString.append("<strategy
content-type=\"application/xhtml+xml\">");
-
testString.append("<implementation>StrategyTwoXML</implementation>");
- testString.append("</strategy>");
- testString.append("</set>");
-
- testString.append("</portal-strategies>");
-
- List strategies =
(List)UnmarshallerFactory.newInstance().newUnmarshaller().unmarshal(new
StringReader(testString.toString()), new LayoutStategyMetaDataFactory(), null);
- assertNotNull(strategies);
- assertTrue(strategies.size() == 3);
-
- LayoutStrategyMetaData strategyMD = (LayoutStrategyMetaData)strategies.get(0);
- assertEquals("StrategyOne", strategyMD.getName());
- assertEquals(MediaType.HTML, strategyMD.getMimeType());
- assertEquals("StrategyOneHTML", strategyMD.getClassName());
-
- strategyMD = (LayoutStrategyMetaData)strategies.get(1);
- assertEquals(MediaType.HTML, strategyMD.getMimeType());
- strategyMD = (LayoutStrategyMetaData)strategies.get(2);
- assertEquals(MediaType.XHTML, strategyMD.getMimeType());
- }
- catch (Exception e)
- {
- assertFalse("Unexpected Layout Exception: " + e.getMessage(), true);
- }
- }
-
- public void testLayoutStrategyMetaDataNoName() throws JBossXBException
- {
- StringBuffer testString = new StringBuffer();
- testString.append("<portal-strategies>");
-
- // no name
- testString.append("<set>");
- // for html
- testString.append("<strategy
content-type=\"text/html\">");
-
testString.append("<implementation>StrategyTwoHTML</implementation>");
- testString.append("</strategy>");
- // for xml
- testString.append("<strategy
content-type=\"application/xhtml+xml\">");
-
testString.append("<implementation>StrategyTwoXML</implementation>");
- testString.append("</strategy>");
- testString.append("</set>");
-
- testString.append("</portal-strategies>");
-
- List strategies =
(List)UnmarshallerFactory.newInstance().newUnmarshaller().unmarshal(new
StringReader(testString.toString()), new LayoutStategyMetaDataFactory(), null);
- LayoutStrategyMetaData strategyMD = (LayoutStrategyMetaData)strategies.get(0);
- assertNull(strategyMD.getName());
- }
-
- public void testLayoutStrategyMetaDataNoMime() throws JBossXBException
- {
- StringBuffer testString = new StringBuffer();
- testString.append("<portal-strategies>");
-
- // no content type
- testString.append("<set name=\"StrategyOne\">");
- testString.append("<strategy>");
-
testString.append("<implementation>StrategyTwoHTML</implementation>");
- testString.append("</strategy>");
- testString.append("</set>");
-
- testString.append("</portal-strategies>");
-
- try
- {
- List strategies =
(List)UnmarshallerFactory.newInstance().newUnmarshaller().unmarshal(new
StringReader(testString.toString()), new LayoutStategyMetaDataFactory(), null);
- LayoutStrategyMetaData strategyMD = (LayoutStrategyMetaData)strategies.get(0);
- assertFalse("expected exception did not occur", true);
- }
- catch (JBossXBException e)
- {
- // expected
- }
- }
-
-
- public void testLayoutStrategyMetaDataEmpty() throws JBossXBException
- {
- StringBuffer testString = new StringBuffer();
- testString.append("<portal-strategies>");
-
- // no strategy definition
- testString.append("<set>");
- testString.append("</set>");
-
- testString.append("</portal-strategies>");
-
- List strategies =
(List)UnmarshallerFactory.newInstance().newUnmarshaller().unmarshal(new
StringReader(testString.toString()), new LayoutStategyMetaDataFactory(), null);
- try
- {
- LayoutStrategyMetaData strategyMD = (LayoutStrategyMetaData)strategies.get(0);
- assertFalse("expected exception did not occur", true);
- }
- catch (IndexOutOfBoundsException ioe)
- {
- // expected
- }
- }
-}
Modified: trunk/theme/src/main/org/jboss/portal/theme/LayoutConstants.java
===================================================================
--- trunk/theme/src/main/org/jboss/portal/theme/LayoutConstants.java 2007-03-20 16:01:43
UTC (rev 6779)
+++ trunk/theme/src/main/org/jboss/portal/theme/LayoutConstants.java 2007-03-20 16:39:07
UTC (rev 6780)
@@ -44,7 +44,6 @@
public static final String PARAM_LAYOUT_URI = "layoutURI";
public static final String PARAM_LAYOUT_STATE = "layoutState";
public static final String ATTR_RENDERSET = "_renderSet";
- public static final String ATTR_STRATEGY = "_strategy";
public static final String ATTR_PORTLET_WINDOW_NAME = "windowName";
public static final String ATTR_LAYOUTSERVER = "LAYOUTSERVER";
public static final String ATTR_INFO = "_info";
Modified: trunk/theme/src/main/org/jboss/portal/theme/LayoutService.java
===================================================================
--- trunk/theme/src/main/org/jboss/portal/theme/LayoutService.java 2007-03-20 16:01:43 UTC
(rev 6779)
+++ trunk/theme/src/main/org/jboss/portal/theme/LayoutService.java 2007-03-20 16:39:07 UTC
(rev 6780)
@@ -22,7 +22,6 @@
******************************************************************************/
package org.jboss.portal.theme;
-import org.jboss.portal.theme.metadata.LayoutStrategyMetaData;
import org.jboss.portal.theme.metadata.PortalLayoutMetaData;
import org.jboss.portal.theme.metadata.RenderSetMetaData;
@@ -56,17 +55,6 @@
*/
void removeLayouts(String appID) throws LayoutException;
- /** Register a a portal layout strategy with this service */
- void addStrategy(RuntimeContext runtimeContext, LayoutStrategyMetaData strategyMD)
throws LayoutException;
-
- /**
- * Remove all strategies that are hosted in the provided application.
- *
- * @param appID the name of the application that hosts the strategie(s) to be removed
- * @throws LayoutException
- */
- void removeStrategies(String appID) throws LayoutException;
-
/** Register a renderSet with this service */
void addRenderSet(RuntimeContext runtimeContext, RenderSetMetaData renderSet) throws
LayoutException;
Modified: trunk/theme/src/main/org/jboss/portal/theme/LayoutServiceInfo.java
===================================================================
--- trunk/theme/src/main/org/jboss/portal/theme/LayoutServiceInfo.java 2007-03-20 16:01:43
UTC (rev 6779)
+++ trunk/theme/src/main/org/jboss/portal/theme/LayoutServiceInfo.java 2007-03-20 16:39:07
UTC (rev 6780)
@@ -26,7 +26,6 @@
import org.jboss.portal.common.util.MediaType;
import org.jboss.portal.common.util.ContentInfo;
import org.jboss.portal.theme.render.PortalRenderSet;
-import org.jboss.portal.theme.strategy.LayoutStrategy;
import org.jboss.portal.theme.page.PageResult;
import java.util.Collection;
@@ -60,26 +59,6 @@
PortalLayout getLayout(String name, boolean defaultOnNull);
/**
- * Get the layout strategy that matches the provided name and media type
- *
- * @param strategyName the name of the strategy to get
- * @param mediaType the media type (content-type) to get the strategy for
- * @return the layout strategy that matches the provided name and mediatype, or null
if no such strategy is
- * registered
- */
- LayoutStrategy getStrategy(String strategyName, MediaType mediaType);
-
- /**
- * Retrieves the strategy for this Layout.
- *
- * @param id the registration id of the strategy to retrieve.
- * @param mediaType the media type that must be supported by the strategy to be
retrieved
- * @return the registered strategy identified by the specified id and media type,
<code>null</code> otherwise.
- * @since 2.4
- */
- LayoutStrategy getStrategy(ServerRegistrationID id, MediaType mediaType);
-
- /**
* Get the render set for the provided layout.
*
* @param renderSetName the name of the renderSet to find
@@ -106,13 +85,6 @@
Collection getLayouts();
/**
- * Get a Set of all available portal layout strategies
- *
- * @return the set of the ServerRegistrationID for registred layout strategies
- */
- Collection getStrategies();
-
- /**
* Retrieves the set of the ServerRegistrationID for registred render set
*
* @return the set of the ServerRegistrationID for registred render set
Modified: trunk/theme/src/main/org/jboss/portal/theme/ServerRegistrationID.java
===================================================================
--- trunk/theme/src/main/org/jboss/portal/theme/ServerRegistrationID.java 2007-03-20
16:01:43 UTC (rev 6779)
+++ trunk/theme/src/main/org/jboss/portal/theme/ServerRegistrationID.java 2007-03-20
16:39:07 UTC (rev 6780)
@@ -77,9 +77,6 @@
/** Type for a registered Portal Layout. */
public static final Type TYPE_LAYOUT = new Type("layout");
- /** Type for a registered Portal Layout Strategy. */
- public static final Type TYPE_STRATEGY = new Type("strategy");
-
/** Type for a registered Portal RenderSet. */
public static final Type TYPE_RENDERSET = new Type("renderSet");
Modified: trunk/theme/src/main/org/jboss/portal/theme/ThemeConstants.java
===================================================================
--- trunk/theme/src/main/org/jboss/portal/theme/ThemeConstants.java 2007-03-20 16:01:43
UTC (rev 6779)
+++ trunk/theme/src/main/org/jboss/portal/theme/ThemeConstants.java 2007-03-20 16:39:07
UTC (rev 6780)
@@ -49,9 +49,6 @@
public static final String PORTAL_PROP_LAYOUT = "layout.id";
- /** Key name to access the selected layout strategy for the portal or page (via the
portal or page properties) */
- public static final String PORTAL_PROP_STRATEGY = "layout.strategyId";
-
/** Key name to access the selected theme for the portal or page (via the portal or
page properties) */
public static final String PORTAL_PROP_THEME = "theme.id";
Modified:
trunk/theme/src/main/org/jboss/portal/theme/deployment/jboss/LayoutFeaturesDeployment.java
===================================================================
---
trunk/theme/src/main/org/jboss/portal/theme/deployment/jboss/LayoutFeaturesDeployment.java 2007-03-20
16:01:43 UTC (rev 6779)
+++
trunk/theme/src/main/org/jboss/portal/theme/deployment/jboss/LayoutFeaturesDeployment.java 2007-03-20
16:39:07 UTC (rev 6780)
@@ -30,7 +30,6 @@
import org.jboss.portal.theme.LayoutException;
import org.jboss.portal.theme.LayoutService;
import org.jboss.portal.theme.RuntimeContext;
-import org.jboss.portal.theme.metadata.LayoutStrategyMetaData;
import org.jboss.portal.theme.metadata.RenderSetMetaData;
import org.jboss.xb.binding.UnmarshallerFactory;
@@ -40,10 +39,9 @@
import java.util.List;
/**
- * Deploy layout strategies and rendersets contained in a WebApplication. <p>A Web
Application can define layout
- * strategies and render sets in their respective descriptors. Portal RenderSets are
defined in a descriptor called
- * portal-renderSet.xml in the WEB-INF/layout folder. Layout strategies are defined in a
descriptor called
- * portal-strategies.xml in the same folder. Additionally, rendersets and layout
strategies can be defined as part of a
+ * 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>
@@ -82,17 +80,16 @@
{
if (trace)
{
- log.trace("create new renderset(s) and strategie(s) found in : " +
pwa.getId());
+ log.trace("create new renderset(s) found in : " + pwa.getId());
}
try
{
boolean isRenderSet = url.toString().endsWith("-renderSet.xml");
- boolean isStrategy = url.toString().endsWith("-strategies.xml");
// see if there are any named rendersets
- if (isRenderSet || isStrategy)
+ if (isRenderSet)
{
RuntimeContext ctx = new RuntimeContext(pwa.getId(), pwa.getServletContext(),
pwa.getContextPath(), pwa.getClassLoader());
LayoutService layoutService = factory.getLayoutService();
@@ -109,15 +106,6 @@
layoutService.addRenderSet(ctx, renderSet);
}
}
- else
- {
- List strategies =
(List)UnmarshallerFactory.newInstance().newUnmarshaller().unmarshal(stream, new
LayoutStategyMetaDataFactory(), null);
- for (int i = 0; i < strategies.size(); i++)
- {
- LayoutStrategyMetaData strategy =
(LayoutStrategyMetaData)strategies.get(i);
- layoutService.addStrategy(ctx, strategy);
- }
- }
}
finally
{
@@ -134,7 +122,7 @@
if (trace)
{
- log.trace("done creating new renderset(s) and strategie(s) found in :
" + pwa.getId());
+ log.trace("done creating new renderset(s) found in : " +
pwa.getId());
}
}
catch (Exception e)
@@ -153,13 +141,12 @@
{
if (trace)
{
- log.trace("destroying renderset(s) and layout strategies, found in :
" + pwa.getId());
+ log.trace("destroying renderset(s) found in : " + pwa.getId());
}
try
{
LayoutService service = factory.getLayoutService();
service.removeRenderSets(pwa.getId());
- service.removeStrategies(pwa.getId());
}
catch (LayoutException e)
{
@@ -167,7 +154,7 @@
}
if (trace)
{
- log.trace("done destroying renderset(s) and layout strategies, found in :
" + pwa.getId());
+ log.trace("done destroying renderset(s) found in : " + pwa.getId());
}
}
}
Deleted:
trunk/theme/src/main/org/jboss/portal/theme/deployment/jboss/LayoutStategyMetaDataFactory.java
===================================================================
---
trunk/theme/src/main/org/jboss/portal/theme/deployment/jboss/LayoutStategyMetaDataFactory.java 2007-03-20
16:01:43 UTC (rev 6779)
+++
trunk/theme/src/main/org/jboss/portal/theme/deployment/jboss/LayoutStategyMetaDataFactory.java 2007-03-20
16:39:07 UTC (rev 6780)
@@ -1,84 +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.util.MediaType;
-import org.jboss.portal.theme.metadata.LayoutStrategyMetaData;
-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 LayoutStategyMetaDataFactory implements ObjectModelFactory
-{
-
- private String name;
-
- 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) throws MimeTypeParseException
- {
- if ("set".equals(localName))
- {
- name = attrs.getValue("name");
- }
- else if ("strategy".equals(localName))
- {
- LayoutStrategyMetaData strategy = new LayoutStrategyMetaData();
- String contentType = attrs.getValue("content-type");
- strategy.setName(name);
- strategy.setMimeType(MediaType.parseMimeType(contentType));
- return strategy;
- }
- return null;
- }
-
- public void addChild(ArrayList list, LayoutStrategyMetaData strategy,
UnmarshallingContext nav, String nsURI, String localName)
- {
- list.add(strategy);
- }
-
- public void setValue(LayoutStrategyMetaData strategy, UnmarshallingContext nav, String
nsURI, String localName, String value)
- {
- if ("implementation".equals(localName))
- {
- strategy.setClassName(value);
- }
- }
-
-
-}
Modified: trunk/theme/src/main/org/jboss/portal/theme/impl/LayoutServiceImpl.java
===================================================================
--- trunk/theme/src/main/org/jboss/portal/theme/impl/LayoutServiceImpl.java 2007-03-20
16:01:43 UTC (rev 6779)
+++ trunk/theme/src/main/org/jboss/portal/theme/impl/LayoutServiceImpl.java 2007-03-20
16:39:07 UTC (rev 6780)
@@ -34,12 +34,10 @@
import org.jboss.portal.theme.ServerRegistrationID;
import org.jboss.portal.theme.ThemeConstants;
import org.jboss.portal.theme.page.PageResult;
-import org.jboss.portal.theme.metadata.LayoutStrategyMetaData;
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.theme.render.PortalRenderSet;
-import org.jboss.portal.theme.strategy.LayoutStrategy;
import org.jboss.system.Service;
import java.util.ArrayList;
@@ -52,16 +50,15 @@
/**
* Implementaion of the layout server. <p>The layout server is a registry of all
available layouts. The server also
- * allows access to all available render sets and layout strategies. Render sets and
layout strategies can be
+ * allows access to all available render sets. Render sets can be
* independent (named), or children of a layout. Accordingly, the layout server provides
accessor methods to get
- * strategies and render set by name, or by layout. Render sets and layout strategies
can, and must, be defined for a
+ * render set by name, or by layout. Render sets can, and must, be defined for a
* specific media type (mime type).</p>
*
* @author <a href="mailto:mholzner@novell.com">Martin
Holzner</a>.
* @version <tt>$Revision$</tt>
* @see org.jboss.portal.theme.PortalLayout
* @see org.jboss.portal.theme.render.PortalRenderSet
- * @see org.jboss.portal.theme.strategy.LayoutStrategy
* @see MediaType
*/
public class LayoutServiceImpl extends AbstractJBossService implements LayoutService,
Service
@@ -73,12 +70,6 @@
private Map layoutNames;
// map of appID + "." + layout name to layout id
private Map exactLayoutNames;
- // map of strategy registration id to map of strategies (keyed by content type)
- private Map strategies;
- // map of strategy name to layout strategy
- private Map strategyNames;
- // map of appID + "." + strategy name to layout strategy
- private Map exactStrategyNames;
// map of renderSet registration id to list of rendersets
private Map renderSets;
// map of render set name to render set
@@ -102,9 +93,6 @@
layouts = Collections.synchronizedMap(new HashMap());
layoutNames = Collections.synchronizedMap(new HashMap());
exactLayoutNames = Collections.synchronizedMap(new HashMap());
- strategies = Collections.synchronizedMap(new HashMap());
- strategyNames = Collections.synchronizedMap(new HashMap());
- exactStrategyNames = Collections.synchronizedMap(new HashMap());
renderSets = Collections.synchronizedMap(new HashMap());
renderSetNames = Collections.synchronizedMap(new HashMap());
exactRenderSetNames = Collections.synchronizedMap(new HashMap());
@@ -117,8 +105,6 @@
layouts.clear();
layoutNames.clear();
exactLayoutNames.clear();
- strategyNames.clear();
- exactStrategyNames.clear();
renderSetNames.clear();
exactRenderSetNames.clear();
}
@@ -329,84 +315,6 @@
}
}
- public void addStrategy(RuntimeContext runtimeContext, LayoutStrategyMetaData
strategyMD) throws LayoutException
- {
- try
- {
- ClassLoader loader = runtimeContext.getClassLoader();
- LayoutStrategy strategy =
(LayoutStrategy)loader.loadClass(strategyMD.getClassName()).newInstance();
- strategy.init(runtimeContext, strategyMD);
-
- log.debug("adding strategy for: " + strategy.getRegistrationId());
- Map strategySet = (Map)strategies.get(strategy.getRegistrationId());
- if (strategySet == null)
- {
- strategySet = new HashMap();
- strategies.put(strategy.getRegistrationId(), strategySet);
- }
- strategySet.put(strategy.getMediaType(), strategy);
-
- exactStrategyNames.put(strategy.getAppId() + "." + strategy.getName(),
strategy.getRegistrationId());
- strategyNames.put(strategy.getName(), strategy.getRegistrationId());
- }
- catch (Exception e)
- {
- throw new LayoutException(e);
- }
- }
-
- /** @see LayoutService#getStrategy(String,org.jboss.portal.common.util.MediaType) */
- public LayoutStrategy getStrategy(String strategyName, MediaType mediaType)
- {
- ServerRegistrationID id;
-
- id = (ServerRegistrationID)exactStrategyNames.get(strategyName);
- if (id == null)
- {
- id = (ServerRegistrationID)strategyNames.get(strategyName);
- }
-
- return getStrategy(id, mediaType);
- }
-
- public LayoutStrategy getStrategy(ServerRegistrationID id, MediaType mediaType)
- {
- if (id != null)
- {
- Map strategySet = (Map)strategies.get(id);
- return (LayoutStrategy)strategySet.get(mediaType);
- }
- return null;
- }
-
- /** @see LayoutService#removeStrategies(String) */
- public void removeStrategies(String appId) throws LayoutException
- {
- log.debug("removing named strategies for : " + appId);
- List strategiesToDelete = new ArrayList();
- for (Iterator i = strategies.keySet().iterator(); i.hasNext();)
- {
- ServerRegistrationID strategyId = (ServerRegistrationID)i.next();
- if (appId.equals(strategyId.getName(0)))
- {
- strategiesToDelete.add(strategyId);
- }
- }
-
- for (Iterator i = strategiesToDelete.iterator(); i.hasNext();)
- {
- ServerRegistrationID strategyId = (ServerRegistrationID)i.next();
- strategies.remove(strategyId);
- String key = strategyId.getName(0) + "." + strategyId.getName(1);
- log.debug("removing strategy: " + key);
- exactStrategyNames.remove(key);
- if (strategyId.equals(strategyNames.get(strategyId.getName(1))))
- {
- strategyNames.remove(strategyId.getName(1));
- }
- }
- }
-
public void addRenderSet(RuntimeContext runtimeContext, RenderSetMetaData renderSetMD)
throws LayoutException
{
try
@@ -493,12 +401,6 @@
return Collections.unmodifiableCollection(layouts.values());
}
- /** @see org.jboss.portal.theme.LayoutService#getStrategies() */
- public Collection getStrategies()
- {
- return Collections.unmodifiableCollection((strategyNames.values()));
- }
-
/** @see org.jboss.portal.theme.LayoutService#getRenderSets() */
public Collection getRenderSets()
{
Deleted: trunk/theme/src/main/org/jboss/portal/theme/metadata/LayoutStrategyMetaData.java
===================================================================
---
trunk/theme/src/main/org/jboss/portal/theme/metadata/LayoutStrategyMetaData.java 2007-03-20
16:01:43 UTC (rev 6779)
+++
trunk/theme/src/main/org/jboss/portal/theme/metadata/LayoutStrategyMetaData.java 2007-03-20
16:39:07 UTC (rev 6780)
@@ -1,68 +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.metadata;
-
-import org.jboss.portal.common.util.MediaType;
-
-/**
- * Meta data describing a single layout strategy as provided in the portal-layouts.xml
descriptor.
- *
- * @author <a href="mailto:mholzner@novell.com">Martin Holzner</a>
- * @version $Revision$
- */
-public final class LayoutStrategyMetaData
-{
- private String className;
- private MediaType mimeType;
- private String name;
-
- public String getClassName()
- {
- return className;
- }
-
- public void setClassName(String className)
- {
- this.className = className;
- }
-
- public MediaType getMimeType()
- {
- return mimeType;
- }
-
- public void setMimeType(MediaType mimeType)
- {
- this.mimeType = mimeType;
- }
-
- public String getName()
- {
- return name;
- }
-
- public void setName(String name)
- {
- this.name = name;
- }
-}
Modified: trunk/theme/src/main/org/jboss/portal/theme/page/WindowContext.java
===================================================================
--- trunk/theme/src/main/org/jboss/portal/theme/page/WindowContext.java 2007-03-20
16:01:43 UTC (rev 6779)
+++ trunk/theme/src/main/org/jboss/portal/theme/page/WindowContext.java 2007-03-20
16:39:07 UTC (rev 6780)
@@ -25,7 +25,7 @@
import java.io.Serializable;
/**
- * A WindowContext represents a portlet window on a page in the scope of one request.
<p>It allows the layout strategy
+ * A WindowContext represents a portlet window on a page in the scope of one request.
<p>It allows the layout gy
* for instance, to change the position of the window on the page (region, order) without
persising the change. The
* change will only be valid for the term of the current request.</p> <p>This
context implements the
* <code>Comparable</code> interface to allow natural sorting of the windows
in one region, based on their order.</p>
Modified: trunk/theme/src/main/org/jboss/portal/theme/render/PortalRenderSet.java
===================================================================
--- trunk/theme/src/main/org/jboss/portal/theme/render/PortalRenderSet.java 2007-03-20
16:01:43 UTC (rev 6779)
+++ trunk/theme/src/main/org/jboss/portal/theme/render/PortalRenderSet.java 2007-03-20
16:39:07 UTC (rev 6780)
@@ -79,7 +79,7 @@
}
this.name = renderSetName;
this.appID = runtimeContext.getAppId();
- this.registrationId =
ServerRegistrationID.createID(ServerRegistrationID.TYPE_STRATEGY, new String[]{appID,
name});
+ this.registrationId =
ServerRegistrationID.createID(ServerRegistrationID.TYPE_RENDERSET, new String[]{appID,
name});
this.contentType = rendererSetMD.getContentType();
this.ajaxEnabled = rendererSetMD.isAjaxEnabled();