Author: cziegeler Date: Mon Jan 24 06:18:52 2005 New Revision: 126285 URL: http://svn.apache.org/viewcvs?view=rev&rev=126285 Log: Improved layout Added: cocoon/trunk/src/blocks/portal/samples/skins/basic/styles/borderless-window.xsl (contents, props changed) cocoon/trunk/src/blocks/portal/samples/skins/common/styles/borderless-window.xsl (contents, props changed) cocoon/trunk/src/core/java/org/apache/cocoon/core/container/handler/NewPoolableComponentHandler.java (contents, props changed) Modified: cocoon/trunk/src/blocks/portal/samples/coplets/login/login.xml cocoon/trunk/src/blocks/portal/samples/profiles/copletinstancedata/portal-user-anonymous.xml cocoon/trunk/src/blocks/portal/samples/profiles/layout/portal-user-anonymous.xml cocoon/trunk/src/blocks/portal/samples/resources/login.xml cocoon/trunk/src/blocks/portal/samples/skins/common/images/customize.gif cocoon/trunk/src/blocks/portal/samples/skins/common/images/delete.gif cocoon/trunk/src/blocks/portal/samples/skins/common/images/maximize.gif cocoon/trunk/src/blocks/portal/samples/skins/common/images/minimize.gif cocoon/trunk/src/blocks/portal/samples/skins/common/images/show.gif cocoon/trunk/src/blocks/portal/samples/skins/common/styles/login-html.xsl cocoon/trunk/src/blocks/portal/samples/skins/common/styles/portal-page.xsl cocoon/trunk/src/blocks/portal/samples/skins/common/styles/window.xsl
Modified: cocoon/trunk/src/blocks/portal/samples/coplets/login/login.xml Url: http://svn.apache.org/viewcvs/cocoon/trunk/src/blocks/portal/samples/coplets/login/login.xml?view=diff&rev=126285&p1=cocoon/trunk/src/blocks/portal/samples/coplets/login/login.xml&r1=126284&p2=cocoon/trunk/src/blocks/portal/samples/coplets/login/login.xml&r2=126285 ============================================================================== --- cocoon/trunk/src/blocks/portal/samples/coplets/login/login.xml (original) +++ cocoon/trunk/src/blocks/portal/samples/coplets/login/login.xml Mon Jan 24 06:18:52 2005 @@ -1,6 +1,6 @@ <?xml version="1.0"?> <!-- - Copyright 1999-2004 The Apache Software Foundation + Copyright 1999-2005 The Apache Software Foundation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -15,15 +15,16 @@ limitations under the License. --> -<!-- $Id: login.xml,v 1.2 2004/03/06 02:25:58 antonio Exp $ +<!-- $Id$ Description: The login form for the portal --> <content> + <h3>Personalized Area</h3> <form> <url>auth</url> <field name="name" type="text" length="24" description="User"/> - <field name="password" type="password" length="10" description="Password"/> + <field name="password" type="password" length="24" description="Password"/> </form> </content> Modified: cocoon/trunk/src/blocks/portal/samples/profiles/copletinstancedata/portal-user-anonymous.xml Url: http://svn.apache.org/viewcvs/cocoon/trunk/src/blocks/portal/samples/profiles/copletinstancedata/portal-user-anonymous.xml?view=diff&rev=126285&p1=cocoon/trunk/src/blocks/portal/samples/profiles/copletinstancedata/portal-user-anonymous.xml&r1=126284&p2=cocoon/trunk/src/blocks/portal/samples/profiles/copletinstancedata/portal-user-anonymous.xml&r2=126285 ============================================================================== --- cocoon/trunk/src/blocks/portal/samples/profiles/copletinstancedata/portal-user-anonymous.xml (original) +++ cocoon/trunk/src/blocks/portal/samples/profiles/copletinstancedata/portal-user-anonymous.xml Mon Jan 24 06:18:52 2005 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <!-- - Copyright 1999-2004 The Apache Software Foundation + Copyright 1999-2005 The Apache Software Foundation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. --> -<!-- SVN $Id:$ --> +<!-- SVN $Id$ --> <coplets> <coplet-instance-data id="Portal-Intro-1" name="standard"> <coplet-data>Portal-Intro</coplet-data> @@ -28,10 +28,6 @@ <coplet-instance-data id="Portal-Bottom-1" name="standard"> <coplet-data>Portal-Bottom</coplet-data> </coplet-instance-data> - <coplet-instance-data id="Portal-Demo-1" name="standard"> - <coplet-data>Portal-Demo</coplet-data> - </coplet-instance-data> - <coplet-instance-data id="Login-1" name="standard"> <coplet-data>Login</coplet-data> </coplet-instance-data> Modified: cocoon/trunk/src/blocks/portal/samples/profiles/layout/portal-user-anonymous.xml Url: http://svn.apache.org/viewcvs/cocoon/trunk/src/blocks/portal/samples/profiles/layout/portal-user-anonymous.xml?view=diff&rev=126285&p1=cocoon/trunk/src/blocks/portal/samples/profiles/layout/portal-user-anonymous.xml&r1=126284&p2=cocoon/trunk/src/blocks/portal/samples/profiles/layout/portal-user-anonymous.xml&r2=126285 ============================================================================== --- cocoon/trunk/src/blocks/portal/samples/profiles/layout/portal-user-anonymous.xml (original) +++ cocoon/trunk/src/blocks/portal/samples/profiles/layout/portal-user-anonymous.xml Mon Jan 24 06:18:52 2005 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <!-- - Copyright 1999-2004 The Apache Software Foundation + Copyright 1999-2005 The Apache Software Foundation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,13 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. --> -<!-- SVN $Id:$ --> +<!-- SVN $Id$ --> <composite-layout name="row"> <item> <composite-layout name="column"> <item> <parameter name="width" value="60%"/> - <coplet-layout name="coplet"> + <coplet-layout name="coplet" layout-renderer-name="borderless-window"> <coplet-instance-data>Portal-Intro-1</coplet-instance-data> </coplet-layout> </item> @@ -37,13 +37,13 @@ <composite-layout name="column"> <item> <parameter name="width" value="25%"/> - <coplet-layout name="coplet"> + <coplet-layout name="coplet" layout-renderer-name="borderless-window"> <coplet-instance-data>Portal-Left-1</coplet-instance-data> </coplet-layout> </item> <item> <parameter name="width" value="75%"/> - <coplet-layout name="coplet"> + <coplet-layout name="coplet" layout-renderer-name="borderless-window"> <coplet-instance-data>Portal-Right-1</coplet-instance-data> </coplet-layout> </item> @@ -51,7 +51,7 @@ </item> <item> <parameter name="height" value="500"/> - <coplet-layout name="coplet"> + <coplet-layout name="coplet" layout-renderer-name="borderless-window"> <coplet-instance-data>Portal-Bottom-1</coplet-instance-data> </coplet-layout> </item> Modified: cocoon/trunk/src/blocks/portal/samples/resources/login.xml Url: http://svn.apache.org/viewcvs/cocoon/trunk/src/blocks/portal/samples/resources/login.xml?view=diff&rev=126285&p1=cocoon/trunk/src/blocks/portal/samples/resources/login.xml&r1=126284&p2=cocoon/trunk/src/blocks/portal/samples/resources/login.xml&r2=126285 ============================================================================== --- cocoon/trunk/src/blocks/portal/samples/resources/login.xml (original) +++ cocoon/trunk/src/blocks/portal/samples/resources/login.xml Mon Jan 24 06:18:52 2005 @@ -1,6 +1,6 @@ <?xml version="1.0"?> <!-- - Copyright 1999-2004 The Apache Software Foundation + Copyright 1999-2005 The Apache Software Foundation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -15,7 +15,7 @@ limitations under the License. --> -<!-- $Id: login.xml,v 1.3 2004/03/06 02:26:05 antonio Exp $ +<!-- $Id$ Description: The login form for the portal --> @@ -24,6 +24,6 @@ <form> <url>auth</url> <field name="name" type="text" length="24" description="User"/> - <field name="password" type="password" length="10" description="Password"/> + <field name="password" type="password" length="24" description="Password"/> </form> </content> Added: cocoon/trunk/src/blocks/portal/samples/skins/basic/styles/borderless-window.xsl Url: http://svn.apache.org/viewcvs/cocoon/trunk/src/blocks/portal/samples/skins/basic/styles/borderless-window.xsl?view=auto&rev=126285 ============================================================================== --- (empty file) +++ cocoon/trunk/src/blocks/portal/samples/skins/basic/styles/borderless-window.xsl Mon Jan 24 06:18:52 2005 @@ -0,0 +1,128 @@ +<?xml version="1.0"?> +<!-- + Copyright 1999-2005 The Apache Software Foundation + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<!-- SVN $Id$ --> +<xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> + +<xsl:template match="window"> + +<xsl:variable name="bgColor"> + <xsl:choose> + <xsl:when test="@bgColor"> + <xsl:value-of select="@bgColor" /> + </xsl:when> + <xsl:otherwise> + <xsl:text>#CCCCCC</xsl:text> + </xsl:otherwise> + </xsl:choose> +</xsl:variable> + +<table border="0" cellSpacing="0" cellpadding="0" width="100%"> + <tr vAlign="top"> + <td bgColor="{$bgColor}" valign="middle"> + <font> + <xsl:attribute name="color">#ffffff</xsl:attribute> + <xsl:attribute name="face">Arial</xsl:attribute> + <xsl:attribute name="size">2</xsl:attribute> + <xsl:choose> + <xsl:when test="@title"> + <b><xsl:value-of select="@title"/></b> + </xsl:when> + <xsl:otherwise> + <b><xsl:value-of select="title"/></b> + </xsl:otherwise> + </xsl:choose> + </font> + </td> + <td align="right" bgColor="{$bgColor}"> + <xsl:if test="basket-add-link"> + <a href="{basket-add-link}"> + <img src="images/basket.gif" border="0" alt="Add Link"/> + </a> + </xsl:if> + <xsl:if test="basket-add-content"> + <a href="{basket-add-content}"> + <img src="images/basket.gif" border="0" alt="Add Content"/> + </a> + </xsl:if> + <xsl:if test="edit-uri"> + <a href="{edit-uri}"> + <img src="images/edit.gif" border="0" alt="Edit"/> + </a> + </xsl:if> + <xsl:if test="help-uri"> + <a href="{help-uri}"> + <img src="images/help.gif" border="0" alt="Help"/> + </a> + </xsl:if> + <xsl:if test="view-uri"> + <a href="{view-uri}"> + <img src="images/view.gif" border="0" alt="View"/> + </a> + </xsl:if> + <xsl:if test="fullscreen-uri and not(maximize-uri)"> + <a href="{fullscreen-uri}"> + <img src="images/customize.gif" border="0" alt="Full Screen"/> + </a> + </xsl:if> + <xsl:if test="maxpage-uri"> + <a href="{maxpage-uri}"> + <img src="images/show.gif" border="0" alt="Max Page"/> + </a> + </xsl:if> + <xsl:if test="minpage-uri"> + <a href="{minpage-uri}"> + <img src="images/show.gif" border="0" alt="Min Page"/> + </a> + </xsl:if> + <xsl:if test="maximize-uri"> + <a href="{maximize-uri}"> + <img src="images/maximize.gif" border="0" alt="Maximize"/> + </a> + </xsl:if> + <xsl:if test="minimize-uri"> + <a href="{minimize-uri}"> + <img src="images/minimize.gif" border="0" alt="Minimize"/> + </a> + </xsl:if> + <xsl:if test="remove-uri"> + <a href="{remove-uri}"> + <img src="images/delete.gif" border="0" alt="Delete"/> + </a> + </xsl:if> + </td> + </tr> + <tr> + <td colSpan="2"> + <xsl:apply-templates select="content"/> + </td> + </tr> +</table> +</xsl:template> + +<xsl:template match="content"> + <xsl:apply-templates/> +</xsl:template> + +<!-- Copy all and apply templates --> +<xsl:template match="@*|node()"> + <xsl:copy> + <xsl:apply-templates select="@*|node()" /> + </xsl:copy> +</xsl:template> + +</xsl:stylesheet> Modified: cocoon/trunk/src/blocks/portal/samples/skins/common/images/customize.gif Url: http://svn.apache.org/viewcvs/cocoon/trunk/src/blocks/portal/samples/skins/common/images/customize.gif?view=diff&rev=126285&p1=cocoon/trunk/src/blocks/portal/samples/skins/common/images/customize.gif&r1=126284&p2=cocoon/trunk/src/blocks/portal/samples/skins/common/images/customize.gif&r2=126285 ============================================================================== Binary files. No diff available. Modified: cocoon/trunk/src/blocks/portal/samples/skins/common/images/delete.gif Url: http://svn.apache.org/viewcvs/cocoon/trunk/src/blocks/portal/samples/skins/common/images/delete.gif?view=diff&rev=126285&p1=cocoon/trunk/src/blocks/portal/samples/skins/common/images/delete.gif&r1=126284&p2=cocoon/trunk/src/blocks/portal/samples/skins/common/images/delete.gif&r2=126285 ============================================================================== Binary files. No diff available. Modified: cocoon/trunk/src/blocks/portal/samples/skins/common/images/maximize.gif Url: http://svn.apache.org/viewcvs/cocoon/trunk/src/blocks/portal/samples/skins/common/images/maximize.gif?view=diff&rev=126285&p1=cocoon/trunk/src/blocks/portal/samples/skins/common/images/maximize.gif&r1=126284&p2=cocoon/trunk/src/blocks/portal/samples/skins/common/images/maximize.gif&r2=126285 ============================================================================== Binary files. No diff available. Modified: cocoon/trunk/src/blocks/portal/samples/skins/common/images/minimize.gif Url: http://svn.apache.org/viewcvs/cocoon/trunk/src/blocks/portal/samples/skins/common/images/minimize.gif?view=diff&rev=126285&p1=cocoon/trunk/src/blocks/portal/samples/skins/common/images/minimize.gif&r1=126284&p2=cocoon/trunk/src/blocks/portal/samples/skins/common/images/minimize.gif&r2=126285 ============================================================================== Binary files. No diff available. Modified: cocoon/trunk/src/blocks/portal/samples/skins/common/images/show.gif Url: http://svn.apache.org/viewcvs/cocoon/trunk/src/blocks/portal/samples/skins/common/images/show.gif?view=diff&rev=126285&p1=cocoon/trunk/src/blocks/portal/samples/skins/common/images/show.gif&r1=126284&p2=cocoon/trunk/src/blocks/portal/samples/skins/common/images/show.gif&r2=126285 ============================================================================== Binary files. No diff available. Added: cocoon/trunk/src/blocks/portal/samples/skins/common/styles/borderless-window.xsl Url: http://svn.apache.org/viewcvs/cocoon/trunk/src/blocks/portal/samples/skins/common/styles/borderless-window.xsl?view=auto&rev=126285 ============================================================================== --- (empty file) +++ cocoon/trunk/src/blocks/portal/samples/skins/common/styles/borderless-window.xsl Mon Jan 24 06:18:52 2005 @@ -0,0 +1,158 @@ +<?xml version="1.0"?> +<!-- + Copyright 1999-2005 The Apache Software Foundation + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<!-- SVN $Id$ --> +<xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> + +<xsl:template match="window"> + +<xsl:variable name="bgColor"> + <xsl:choose> + <xsl:when test="@bgColor"> + <xsl:value-of select="@bgColor" /> + </xsl:when> + <xsl:otherwise> + <xsl:text>#294563</xsl:text> + </xsl:otherwise> + </xsl:choose> +</xsl:variable> + + <table cellSpacing="0" cellpadding="0" width="100%" border="0"><tbody> + <tr vAlign="top" height="20"> + <td width="5" style="background-color:#294563;" valign="top"> + <img src="images/window-top-left.gif" border="0" width="5" height="5" alt="top-left"/> + </td> + <td bgColor="{$bgColor}" align="left" valign="middle"> + <font color="#ffffff" face="Arial" size="2"><b> + <xsl:choose> + <xsl:when test="@title"> + <xsl:value-of select="@title"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="title"/> + </xsl:otherwise> + </xsl:choose> + </b></font> + </td> + <td align="right" valign="middle" bgColor="{$bgColor}"> + <table cellSpacing="0" cellpadding="0" border="0"><tbody><tr> + <xsl:if test="basket-add-link"> + <td width="15"> + <a href="{basket-add-link}"> + <img src="images/basket.gif" border="0" alt="Add Link"/> + </a> + </td> + </xsl:if> + <xsl:if test="basket-add-content"> + <td width="15"> + <a href="{basket-add-content}"> + <img src="images/basket.gif" border="0" alt="Add Content"/> + </a> + </td> + </xsl:if> + <xsl:if test="edit-uri"> + <td width="15"> + <a href="{edit-uri}"> + <img src="images/edit.gif" border="0" alt="Edit"/> + </a> + </td> + </xsl:if> + <xsl:if test="help-uri"> + <td width="15"> + <a href="{help-uri}"> + <img src="images/help.gif" border="0" alt="Help"/> + </a> + </td> + </xsl:if> + <xsl:if test="view-uri"> + <td width="15"> + <a href="{view-uri}"> + <img src="images/view.gif" border="0" alt="View"/> + </a> + </td> + </xsl:if> + <xsl:if test="fullscreen-uri and not(maximize-uri)"> + <td width="15"> + <a href="{fullscreen-uri}"> + <img src="images/customize.gif" border="0" alt="Full Screen"/> + </a> + </td> + </xsl:if> + <xsl:if test="maxpage-uri"> + <td width="15"> + <a href="{maxpage-uri}"> + <img src="images/show.gif" border="0" alt="Max Page"/> + </a> + </td> + </xsl:if> + <xsl:if test="minpage-uri"> + <td width="15"> + <a href="{minpage-uri}"> + <img src="images/show.gif" border="0" alt="Min Page"/> + </a> + </td> + </xsl:if> + <xsl:if test="maximize-uri"> + <td width="15"> + <a href="{maximize-uri}"> + <img src="images/maximize.gif" border="0" alt="Maximize"/> + </a> + </td> + </xsl:if> + <xsl:if test="minimize-uri"> + <td width="15"> + <a href="{minimize-uri}"> + <img src="images/minimize.gif" border="0" alt="Minimize"/> + </a> + </td> + </xsl:if> + <xsl:if test="remove-uri"> + <td width="15"> + <a href="{remove-uri}"> + <img src="images/delete.gif" border="0" alt="Delete"/> + </a> + </td> + </xsl:if> + </tr></tbody></table> + </td> + <td width="5" style="background-color:#294563;" valign="top"> + <img src="images/window-top-right.gif" border="0" width="5" height="5" alt="top-right"/> + </td> + <td width="1"/> + </tr> + <tr> + <td width="5"></td> + <td colSpan="2"> + <xsl:apply-templates select="content"/> + </td> + <td width="6" colSpan="2"></td> + </tr> + </tbody></table> +</xsl:template> + +<xsl:template match="content"> + <xsl:apply-templates/> +</xsl:template> + +<!-- Copy all and apply templates --> +<xsl:template match="@*|node()"> + <xsl:copy> + <xsl:apply-templates select="@*|node()" /> + </xsl:copy> +</xsl:template> + +</xsl:stylesheet> Modified: cocoon/trunk/src/blocks/portal/samples/skins/common/styles/login-html.xsl Url: http://svn.apache.org/viewcvs/cocoon/trunk/src/blocks/portal/samples/skins/common/styles/login-html.xsl?view=diff&rev=126285&p1=cocoon/trunk/src/blocks/portal/samples/skins/common/styles/login-html.xsl&r1=126284&p2=cocoon/trunk/src/blocks/portal/samples/skins/common/styles/login-html.xsl&r2=126285 ============================================================================== --- cocoon/trunk/src/blocks/portal/samples/skins/common/styles/login-html.xsl (original) +++ cocoon/trunk/src/blocks/portal/samples/skins/common/styles/login-html.xsl Mon Jan 24 06:18:52 2005 @@ -1,6 +1,6 @@ <?xml version="1.0"?> <!-- - Copyright 1999-2004 The Apache Software Foundation + Copyright 1999-2005 The Apache Software Foundation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -15,7 +15,7 @@ limitations under the License. --> -<!--+ $Id: login-html.xsl,v 1.5 2004/03/06 02:25:56 antonio Exp $ +<!--+ $Id$ | | Description: Login page to HTML | @@ -77,10 +77,10 @@ <xsl:template match="field"> <tr> - <td> + <td align="left"> <xsl:value-of select="@description"/>: </td> - <td> + <td align="left"> <input> <xsl:attribute name="name"><xsl:value-of select="@name"/></xsl:attribute> <xsl:attribute name="type"><xsl:value-of select="@type"/></xsl:attribute> Modified: cocoon/trunk/src/blocks/portal/samples/skins/common/styles/portal-page.xsl Url: http://svn.apache.org/viewcvs/cocoon/trunk/src/blocks/portal/samples/skins/common/styles/portal-page.xsl?view=diff&rev=126285&p1=cocoon/trunk/src/blocks/portal/samples/skins/common/styles/portal-page.xsl&r1=126284&p2=cocoon/trunk/src/blocks/portal/samples/skins/common/styles/portal-page.xsl&r2=126285 ============================================================================== --- cocoon/trunk/src/blocks/portal/samples/skins/common/styles/portal-page.xsl (original) +++ cocoon/trunk/src/blocks/portal/samples/skins/common/styles/portal-page.xsl Mon Jan 24 06:18:52 2005 @@ -1,6 +1,6 @@ <?xml version="1.0"?> <!-- - Copyright 1999-2004 The Apache Software Foundation + Copyright 1999-2005 The Apache Software Foundation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,83 +14,74 @@ See the License for the specific language governing permissions and limitations under the License. --> -<!-- SVN $Id:$ --> +<!-- SVN $Id$ --> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:param name="user"/> + <xsl:template match="/"> -<html> - <head> - <link type="text/css" rel="stylesheet" href="css/page.css"/> - </head> - <body> - <table bgColor="#ffffff" border="0" cellPadding="0" cellSpacing="0" width="100%"><tbody> - <!-- header row --> - <tr> - <td colspan="2"> - <table border="0" cellPadding="0" cellSpacing="0" width="100%"> - <tbody> - <tr> - <td colspan="2" noWrap="" height="1%" bgcolor="#294563"> - <img height="5" src="images/space.gif" width="100%"/> - </td> - </tr> - <tr> - <td colspan="2" bgcolor="#294563" height="98%" align="center" valign="middle" width="100%"> - <img src="images/portal-logo.gif" width="250" height="90" /> - </td> - </tr> - <tr valign="bottom"> - <td height="99%" bgcolor="#294563" width="99%" align="right"> - <xsl:if test="$user!='anonymous'"> - <a href="logout"><img src="images/logout-door.gif" width="18" height="22" border="0"/></a> - </xsl:if> - <img height="5" src="images/space.gif" width="5"/> - </td> - <td height="99%" bgcolor="#294563" width="1%" align="right"> - <xsl:if test="$user!='anonymous'"> - <a href="logout" style="color:#CFDCED;font-size:75%;">Logout</a>  - </xsl:if> - <img height="5" src="images/space.gif" width="5"/> - </td> - </tr> - </tbody> - </table> - </td> - </tr> - <!-- end header row --> - <!-- content/tab row --> - <tr> - <td> - <xsl:apply-templates/> - </td> - </tr> - <!-- end content/tab row --> - <!-- footer row --> - <tr> - <td colspan="2"> - <table border="0" cellPadding="0" cellSpacing="0" width="100%"> - <tbody> - <tr> - <td colspan="2" noWrap="" height="10" bgcolor="#CFDCED"> - <img height="1" src="images/space.gif" width="1"/> - </td> - </tr> - <tr> - <td colspan="2" noWrap="" height="30" bgcolor="#294563"> - <img height="1" src="images/space.gif" width="1"/> - </td> - </tr> - </tbody> - </table> - </td> - </tr> - <!-- end of footer row --> - </tbody> - </table> - </body> -</html> + <html> + <head> + <link type="text/css" rel="stylesheet" href="css/page.css"/> + </head> + <body> + <table bgColor="#ffffff" border="0" cellPadding="0" cellSpacing="0" width="100%"><tbody> + <!-- header row --> + <tr> + <td colspan="2"> + <table border="0" cellPadding="0" cellSpacing="0" width="100%"><tbody> + <tr> + <td colspan="2" noWrap="" height="1%" bgcolor="#294563"> + <img height="5" src="images/space.gif" width="100%"/> + </td> + </tr> + <tr> + <td colspan="2" bgcolor="#294563" height="98%" align="center" valign="middle" width="100%"> + <img src="images/portal-logo.gif" width="250" height="90" /> + </td> + </tr> + <tr valign="bottom"> + <td height="99%" bgcolor="#294563" width="99%" align="right"> + <xsl:if test="$user!='anonymous'"> + <a href="logout"><img src="images/logout-door.gif" width="18" height="22" border="0"/></a> + </xsl:if> + <img height="5" src="images/space.gif" width="5"/> + </td> + <td height="99%" bgcolor="#294563" width="1%" align="right"> + <xsl:if test="$user!='anonymous'"> + <a href="logout" style="color:#CFDCED;font-size:75%;">Logout</a>  + </xsl:if> + <img height="5" src="images/space.gif" width="5"/> + </td> + </tr> + </tbody></table> + </td> + </tr> + <!-- end header row --> + <!-- content/tab row --> + <tr> + <td> + <xsl:apply-templates/> + </td> + </tr> + <!-- end content/tab row --> + <!-- footer row --> + <tr> + <td colspan="2"> + <table border="0" cellPadding="0" cellSpacing="0" width="100%"><tbody> + <tr> + <td colspan="2" noWrap="" height="30" bgcolor="#294563"> + <img height="1" src="images/space.gif" width="1"/> + </td> + </tr> + </tbody></table> + </td> + </tr> + <!-- end of footer row --> + </tbody></table> + </body> + </html> </xsl:template> Modified: cocoon/trunk/src/blocks/portal/samples/skins/common/styles/window.xsl Url: http://svn.apache.org/viewcvs/cocoon/trunk/src/blocks/portal/samples/skins/common/styles/window.xsl?view=diff&rev=126285&p1=cocoon/trunk/src/blocks/portal/samples/skins/common/styles/window.xsl&r1=126284&p2=cocoon/trunk/src/blocks/portal/samples/skins/common/styles/window.xsl&r2=126285 ============================================================================== --- cocoon/trunk/src/blocks/portal/samples/skins/common/styles/window.xsl (original) +++ cocoon/trunk/src/blocks/portal/samples/skins/common/styles/window.xsl Mon Jan 24 06:18:52 2005 @@ -1,6 +1,6 @@ <?xml version="1.0"?> <!-- - Copyright 1999-2004 The Apache Software Foundation + Copyright 1999-2005 The Apache Software Foundation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. --> -<!-- SVN $Id:$ --> +<!-- SVN $Id$ --> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> @@ -31,96 +31,122 @@ </xsl:choose> </xsl:variable> -<table cellSpacing="0" cellpadding="0" width="100%"> - <tr vAlign="top"> - <td width="5" style="background-color:#294563;" valign="top"><img src="images/window-top-left.gif" border="0" width="5" height="5" alt="top-left"/></td> - <td bgColor="{$bgColor}" valign="middle"> - <font> - <xsl:attribute name="color">#ffffff</xsl:attribute> - <xsl:attribute name="face">Arial</xsl:attribute> - <xsl:attribute name="size">2</xsl:attribute> - <xsl:choose> - <xsl:when test="@title"> - <b><xsl:value-of select="@title"/></b> - </xsl:when> - <xsl:otherwise> - <b><xsl:value-of select="title"/></b> - </xsl:otherwise> - </xsl:choose> - </font> - </td> - <td align="right" bgColor="{$bgColor}"> + <table cellSpacing="0" cellpadding="0" width="100%" border="0"><tbody> + <tr vAlign="top" height="20"> + <td width="5" style="background-color:#294563;" valign="top"> + <img src="images/window-top-left.gif" border="0" width="5" height="5" alt="top-left"/> + </td> + <td bgColor="{$bgColor}" align="left" valign="middle"> + <font color="#ffffff" face="Arial" size="2"><b> + <xsl:choose> + <xsl:when test="@title"> + <xsl:value-of select="@title"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="title"/> + </xsl:otherwise> + </xsl:choose> + </b></font> + </td> + <td align="right" valign="middle" bgColor="{$bgColor}"> + <table cellSpacing="0" cellpadding="0" border="0"><tbody><tr> <xsl:if test="basket-add-link"> + <td width="15"> <a href="{basket-add-link}"> <img src="images/basket.gif" border="0" alt="Add Link"/> </a> + </td> </xsl:if> <xsl:if test="basket-add-content"> + <td width="15"> <a href="{basket-add-content}"> <img src="images/basket.gif" border="0" alt="Add Content"/> </a> + </td> </xsl:if> <xsl:if test="edit-uri"> + <td width="15"> <a href="{edit-uri}"> <img src="images/edit.gif" border="0" alt="Edit"/> </a> + </td> </xsl:if> <xsl:if test="help-uri"> + <td width="15"> <a href="{help-uri}"> <img src="images/help.gif" border="0" alt="Help"/> </a> + </td> </xsl:if> <xsl:if test="view-uri"> + <td width="15"> <a href="{view-uri}"> <img src="images/view.gif" border="0" alt="View"/> </a> + </td> </xsl:if> <xsl:if test="fullscreen-uri and not(maximize-uri)"> + <td width="15"> <a href="{fullscreen-uri}"> <img src="images/customize.gif" border="0" alt="Full Screen"/> </a> + </td> </xsl:if> <xsl:if test="maxpage-uri"> + <td width="15"> <a href="{maxpage-uri}"> <img src="images/show.gif" border="0" alt="Max Page"/> </a> + </td> </xsl:if> <xsl:if test="minpage-uri"> + <td width="15"> <a href="{minpage-uri}"> <img src="images/show.gif" border="0" alt="Min Page"/> </a> + </td> </xsl:if> <xsl:if test="maximize-uri"> + <td width="15"> <a href="{maximize-uri}"> <img src="images/maximize.gif" border="0" alt="Maximize"/> </a> + </td> </xsl:if> <xsl:if test="minimize-uri"> + <td width="15"> <a href="{minimize-uri}"> <img src="images/minimize.gif" border="0" alt="Minimize"/> </a> + </td> </xsl:if> <xsl:if test="remove-uri"> + <td width="15"> <a href="{remove-uri}"> <img src="images/delete.gif" border="0" alt="Delete"/> </a> + </td> </xsl:if> - </td> - <td width="5" style="background-color:#294563;" valign="top"><img src="images/window-top-right.gif" border="0" width="5" height="5" alt="top-right"/></td> - </tr> - <tr> + </tr></tbody></table> + </td> + <td width="5" style="background-color:#294563;" valign="top"> + <img src="images/window-top-right.gif" border="0" width="5" height="5" alt="top-right"/> + </td> + <td width="1"/> + </tr> + <tr> <td width="5" style="background-image:url(images/window-border-left.gif);"><img src="images/space.gif" border="0" width="5" height="5" alt="space"/></td> <td colSpan="2"> <xsl:apply-templates select="content"/> </td> - <td width="5" style="background-image:url(images/window-border-right.gif);"><img src="images/space.gif" border="0" width="5" height="5" alt="space"/></td> + <td width="6" colSpan="2" style="background-image:url(images/window-border-right.gif);"><img src="images/space.gif" border="0" width="5" height="5" alt="space"/></td> </tr> <tr> <td width="5"><img src="images/window-bottom-left.gif" border="0" width="5" height="5" alt="top-left"/></td> <td colspan="2" style="background-image:url(images/window-border-bottom.gif);"></td> <td width="5"><img src="images/window-bottom-right.gif" border="0" width="5" height="5" alt="top-left"/></td> </tr> -</table> + </tbody></table> </xsl:template> <xsl:template match="content"> Added: cocoon/trunk/src/core/java/org/apache/cocoon/core/container/handler/NewPoolableComponentHandler.java Url: http://svn.apache.org/viewcvs/cocoon/trunk/src/core/java/org/apache/cocoon/core/container/handler/NewPoolableComponentHandler.java?view=auto&rev=126285 ============================================================================== --- (empty file) +++ cocoon/trunk/src/core/java/org/apache/cocoon/core/container/handler/NewPoolableComponentHandler.java Mon Jan 24 06:18:52 2005 @@ -0,0 +1,313 @@ +/* + * Copyright 2002-2005 The Apache Software Foundation + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + * implied. + * + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.cocoon.core.container.handler; + +import java.lang.reflect.InvocationHandler; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.lang.reflect.Proxy; +import java.util.HashSet; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.Set; + +import org.apache.avalon.framework.configuration.Configuration; +import org.apache.avalon.framework.logger.Logger; +import org.apache.cocoon.components.ComponentInfo; +import org.apache.cocoon.core.container.ComponentFactory; + +/** + * The PoolableComponentHandler to make sure that poolable components are initialized + * destroyed and pooled correctly. + * <p> + * Components which implement Poolable may be configured to be pooled using the following + * example configuration. This example assumes that the user component class MyComp + * implements Poolable. + * <p> + * Configuration Example: + * <pre> + * <my-comp pool-max="8"/> + * </pre> + * <p> + * Roles Example: + * <pre> + * <role name="com.mypkg.MyComponent" + * shorthand="my-comp" + * default-class="com.mypkg.DefaultMyComponent"/> + * </pre> + * <p> + * Configuration Attributes: + * <ul> + * <li>The <code>pool-max</code> attribute is used to set the maximum number of components which + * will be pooled. (Defaults to "8") If additional instances are required, they're created, + * but not pooled.</li> + * </ul> + * + * @version CVS $Id$ + */ +public class NewPoolableComponentHandler +extends AbstractFactoryHandler { + + /** The default max size of the pool */ + public static final int DEFAULT_MAX_POOL_SIZE = 8; + + /** + * Object used to synchronize access to the get and put methods + */ + protected final Object semaphore = new Object(); + + /** + * The maximum size of the pool. + */ + private final int max; + + /** + * List of the Poolable instances which are available for use. + */ + private LinkedList ready; + + /** + * Store the size of the ready list to optimize operations which require this value. + */ + private int readySize; + + /** + * Total number of Poolable instances in the pool + */ + private int size; + + /** + * Create a PoolableComponentHandler which manages a pool of Components + * created by the specified factory object. + * + * @param factory The factory object which is responsible for creating the components + * managed by the ComponentHandler. + * @param config The configuration to use to configure the pool. + */ + public NewPoolableComponentHandler( final ComponentInfo info, + final Logger logger, + final ComponentFactory factory, + final Configuration config ) + throws Exception { + super(info, logger, factory); + + final int poolMax = config.getAttributeAsInteger( "pool-max", DEFAULT_MAX_POOL_SIZE ); + this.max = ( poolMax <= 0 ? Integer.MAX_VALUE : poolMax ); + + // Create the pool lists. + this.ready = new LinkedList(); + } + + /** + * Dispose of the ComponentHandler and any associated Pools and Factories. + */ + public void dispose() { + super.dispose(); + + // Any Poolables in the m_ready list need to be disposed of + synchronized( this.semaphore ) { + // Remove objects in the ready list. + for( Iterator iter = this.ready.iterator(); iter.hasNext(); ) { + Object poolable = iter.next(); + iter.remove(); + this.readySize--; + this.permanentlyRemovePoolable( poolable ); + } + + if( ( this.size > 0 ) && this.logger.isDebugEnabled() ) { + this.logger.debug( "There were " + this.size + + " outstanding objects when the pool was disposed." ); + } + } + } + + /** + * Permanently removes a poolable from the pool's active list and + * destroys it so that it will not ever be reused. + * <p> + * This method is only called by threads that have m_semaphore locked. + */ + protected void permanentlyRemovePoolable( Object poolable ) { + this.size--; + this.decommission( poolable ); + } + + /** + * Gets a Poolable from the pool. If there is room in the pool, a new Poolable will be + * created. Depending on the parameters to the constructor, the method may block or throw + * an exception if a Poolable is not available on the pool. + * + * @return Always returns a Poolable. Contract requires that put must always be called with + * the Poolable returned. + * @throws Exception An exception may be thrown as described above or if there is an exception + * thrown by the ObjectFactory's newInstance() method. + */ + protected Object doGet() throws Exception { + Object poolable; + synchronized( this.semaphore ) { + // Look for a Poolable at the end of the m_ready list + if( this.readySize > 0 ){ + // A poolable is ready and waiting in the pool + poolable = this.ready.removeLast(); + this.readySize--; + } else { + // Create a new poolable. May throw an exception if the poolable can not be + // instantiated. + poolable = this.factory.newInstance(); + this.size++; + + if( this.logger.isDebugEnabled() ) { + this.logger.debug( "Created a new " + poolable.getClass().getName() + + " from the object factory." ); + } + } + } + + this.factory.exitingPool(poolable); + + if( this.logger.isDebugEnabled() ) { + this.logger.debug( "Got a " + poolable.getClass().getName() + " from the pool." ); + } + + return createProxy(poolable); + } + + /** + * Returns a poolable to the pool + * + * @param poolable Poolable to return to the pool. + */ + protected void doPut( final Object poolable ) { + try { + this.factory.enteringPool(poolable); + } catch (Exception ignore) { + this.logger.warn("Exception during putting component back into the pool.", ignore); + } + + synchronized( this.semaphore ) { + if( this.size <= this.max ) { + if( this.disposed ) { + // The pool has already been disposed. + if( this.logger.isDebugEnabled() ) { + this.logger.debug( "Put called for a " + poolable.getClass().getName() + + " after the pool was disposed." ); + } + + this.permanentlyRemovePoolable( poolable ); + } else { + // There is room in the pool to keep this poolable. + if( this.logger.isDebugEnabled() ) { + this.logger.debug( "Put a " + poolable.getClass().getName() + + " back into the pool." ); + } + + this.ready.addLast( poolable ); + this.readySize++; + + } + } else { + // More Poolables were created than can be held in the pool, so remove. + if( this.logger.isDebugEnabled() ) { + this.logger.debug( "No room to put a " + poolable.getClass().getName() + + " back into the pool, so remove it." ); + } + + this.permanentlyRemovePoolable( poolable ); + } + } + } + + protected void doInitialize() { + // nothing to do here + } + + protected Object createProxy(Object component) { + Proxy.newProxyInstance(component.getClass().getClassLoader(), + this.guessWorkInterfaces(component.getClass()), + new ProxyHandler(component)); + return component; + } + + /** + * Get a list of interfaces to proxy by scanning through + * all interfaces a class implements and skipping invalid interfaces + * (as defined in [EMAIL PROTECTED] #INVALID_INTERFACES}). + * + * @param clazz the class + * @return the list of interfaces to proxy + */ + protected Class[] guessWorkInterfaces( final Class clazz ) { + final HashSet workInterfaces = new HashSet(); + + // Get *all* interfaces + this.guessWorkInterfaces( clazz, workInterfaces ); + + return (Class[]) workInterfaces.toArray( new Class[workInterfaces.size()] ); + } + + /** + * Get a list of interfaces to proxy by scanning through + * all interfaces a class implements. + * + * @param clazz the class + * @param workInterfaces the set of current work interfaces + */ + private void guessWorkInterfaces( final Class clazz, + final Set workInterfaces ) { + if ( null != clazz ) { + this.addInterfaces( clazz.getInterfaces(), workInterfaces ); + + this.guessWorkInterfaces( clazz.getSuperclass(), workInterfaces ); + } + } + + /** + * Get a list of interfaces to proxy by scanning through + * all interfaces a class implements. + * + * @param interfaces the array of interfaces + * @param workInterfaces the set of current work interfaces + */ + private void addInterfaces( final Class[] interfaces, + final Set workInterfaces ) { + for ( int i = 0; i < interfaces.length; i++ ) { + workInterfaces.add( interfaces[i] ); + this.addInterfaces(interfaces[i].getInterfaces(), workInterfaces); + } + } + + protected static final class ProxyHandler implements InvocationHandler { + + private final Object component; + + public ProxyHandler(Object component) { + this.component = component; + } + + /* (non-Javadoc) + * @see java.lang.reflect.InvocationHandler#invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[]) + */ + public Object invoke(Object proxy, Method method, Object[] args) + throws Throwable { + try { + return method.invoke(component, args); + } catch (InvocationTargetException ite) { + throw ite.getTargetException(); + } + } + } +}
