Return-Path: Delivered-To: apmail-xml-cocoon-cvs-archive@xml.apache.org Received: (qmail 55653 invoked by uid 500); 15 Jun 2003 19:44:59 -0000 Mailing-List: contact cocoon-cvs-help@xml.apache.org; run by ezmlm Precedence: bulk Reply-To: cocoon-dev@xml.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list cocoon-cvs@xml.apache.org Received: (qmail 55642 invoked by uid 500); 15 Jun 2003 19:44:59 -0000 Delivered-To: apmail-cocoon-2.1-cvs@apache.org Received: (qmail 55639 invoked from network); 15 Jun 2003 19:44:59 -0000 Received: from icarus.apache.org (208.185.179.13) by daedalus.apache.org with SMTP; 15 Jun 2003 19:44:59 -0000 Received: (qmail 41958 invoked by uid 1260); 15 Jun 2003 19:44:58 -0000 Date: 15 Jun 2003 19:44:58 -0000 Message-ID: <20030615194458.41957.qmail@icarus.apache.org> From: cziegeler@apache.org To: cocoon-2.1-cvs@apache.org Subject: cvs commit: cocoon-2.1/src/blocks/portal/conf portal.xconf X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N cziegeler 2003/06/15 12:44:58 Modified: src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/impl FrameAspect.java src/blocks/portal/conf portal.xconf Log: Finishing simplified configuration Revision Changes Path 1.6 +47 -3 cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/FrameAspect.java Index: FrameAspect.java =================================================================== RCS file: /home/cvs/cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/FrameAspect.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- FrameAspect.java 23 May 2003 14:20:09 -0000 1.5 +++ FrameAspect.java 15 Jun 2003 19:44:58 -0000 1.6 @@ -50,7 +50,13 @@ */ package org.apache.cocoon.portal.layout.renderer.aspect.impl; +import java.util.Collections; +import java.util.Iterator; + +import org.apache.avalon.framework.parameters.ParameterException; +import org.apache.avalon.framework.parameters.Parameters; import org.apache.cocoon.portal.PortalService; +import org.apache.cocoon.portal.aspect.impl.DefaultAspectDescription; import org.apache.cocoon.portal.layout.Layout; import org.apache.cocoon.portal.layout.impl.FrameLayout; import org.apache.cocoon.portal.layout.renderer.aspect.RendererAspectContext; @@ -67,17 +73,55 @@ public class FrameAspect extends AbstractCIncludeAspect { public void toSAX(RendererAspectContext context, Layout layout, PortalService service, ContentHandler handler) - throws SAXException { + throws SAXException { + PreparedConfiguration config = (PreparedConfiguration)context.getAspectConfiguration(); if (!(layout instanceof FrameLayout)) { throw new SAXException("Wrong layout type, FrameLayout expected: " + layout.getClass().getName()); } - String source = (String)layout.getAspectData("frame"); + String source = (String)layout.getAspectData(config.aspectName); if (source == null) { source = ((FrameLayout) layout).getSource(); } this.createCInclude(source, handler); + } + + protected class PreparedConfiguration { + public String aspectName; + public String store; + + public void takeValues(PreparedConfiguration from) { + this.aspectName = from.aspectName; + this.store = from.store; + } + } + + /* (non-Javadoc) + * @see org.apache.cocoon.portal.layout.renderer.aspect.RendererAspect#prepareConfiguration(org.apache.avalon.framework.parameters.Parameters) + */ + public Object prepareConfiguration(Parameters configuration) + throws ParameterException { + PreparedConfiguration pc = new PreparedConfiguration(); + pc.aspectName = configuration.getParameter("aspect-name", "frame"); + pc.store = configuration.getParameter("store"); + return pc; + } + + /** + * Return the aspects required for this renderer + * @return An iterator for the aspect descriptions or null. + */ + public Iterator getAspectDescriptions(Object configuration) { + PreparedConfiguration pc = (PreparedConfiguration)configuration; + + DefaultAspectDescription desc = new DefaultAspectDescription(); + desc.setName(pc.aspectName); + desc.setClassName("java.lang.String"); + desc.setPersistence(pc.store); + desc.setAutoCreate(false); + + return Collections.singletonList(desc).iterator(); } } 1.18 +3 -6 cocoon-2.1/src/blocks/portal/conf/portal.xconf Index: portal.xconf =================================================================== RCS file: /home/cvs/cocoon-2.1/src/blocks/portal/conf/portal.xconf,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- portal.xconf 14 Jun 2003 17:55:44 -0000 1.17 +++ portal.xconf 15 Jun 2003 19:44:58 -0000 1.18 @@ -110,11 +110,11 @@ - + + + - - @@ -160,9 +160,6 @@ - - -