You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by cz...@apache.org on 2003/08/20 14:05:35 UTC
cvs commit: cocoon-2.1/src/blocks/portal/samples sitemap.xmap
cziegeler 2003/08/20 05:05:35
Modified: src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/impl
WindowAspect.java CompositeContentAspect.java
TabContentAspect.java
src/blocks/portal/conf portal.samplesxconf
src/blocks/portal/samples sitemap.xmap
Log:
Fixing parameter handling
Revision Changes Path
1.6 +10 -3 cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/WindowAspect.java
Index: WindowAspect.java
===================================================================
RCS file: /home/cvs/cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/WindowAspect.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- WindowAspect.java 19 Aug 2003 14:09:34 -0000 1.5
+++ WindowAspect.java 20 Aug 2003 12:05:35 -0000 1.6
@@ -81,19 +81,25 @@
final PreparedConfiguration config = (PreparedConfiguration)context.getAspectConfiguration();
final CopletInstanceData copletInstanceData = ((CopletLayout)layout).getCopletInstanceData();
- XMLUtils.startElement(contenthandler, config.tagName);
+ if ( config.rootTag ) {
+ XMLUtils.startElement(contenthandler, config.tagName);
+ }
XMLUtils.createElement(contenthandler, "title", copletInstanceData.getCopletData().getTitle());
context.invokeNext( layout, service, contenthandler );
- XMLUtils.endElement(contenthandler, config.tagName);
+ if ( config.rootTag ) {
+ XMLUtils.endElement(contenthandler, config.tagName);
+ }
}
protected class PreparedConfiguration {
public String tagName;
+ public boolean rootTag;
public void takeValues(PreparedConfiguration from) {
this.tagName = from.tagName;
+ this.rootTag = from.rootTag;
}
}
@@ -104,6 +110,7 @@
throws ParameterException {
PreparedConfiguration pc = new PreparedConfiguration();
pc.tagName = configuration.getParameter("tag-name", "window");
+ pc.rootTag = configuration.getParameterAsBoolean("root-tag", true);
return pc;
}
1.5 +10 -3 cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/CompositeContentAspect.java
Index: CompositeContentAspect.java
===================================================================
RCS file: /home/cvs/cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/CompositeContentAspect.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- CompositeContentAspect.java 19 Aug 2003 14:09:34 -0000 1.4
+++ CompositeContentAspect.java 20 Aug 2003 12:05:35 -0000 1.5
@@ -85,9 +85,13 @@
throws SAXException {
PreparedConfiguration config = (PreparedConfiguration)context.getAspectConfiguration();
- XMLUtils.startElement(handler, config.tagName);
+ if ( config.rootTag ) {
+ XMLUtils.startElement(handler, config.tagName);
+ }
super.toSAX(context, layout, service, handler);
- XMLUtils.endElement(handler, config.tagName);
+ if ( config.rootTag ) {
+ XMLUtils.endElement(handler, config.tagName);
+ }
}
@@ -120,9 +124,11 @@
protected class PreparedConfiguration {
public String tagName;
+ public boolean rootTag;
public void takeValues(PreparedConfiguration from) {
this.tagName = from.tagName;
+ this.rootTag = from.rootTag;
}
}
@@ -133,6 +139,7 @@
throws ParameterException {
PreparedConfiguration pc = new PreparedConfiguration();
pc.tagName = configuration.getParameter("tag-name", "composite");
+ pc.rootTag = configuration.getParameterAsBoolean("root-tag", true);
return pc;
}
1.11 +7 -3 cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/TabContentAspect.java
Index: TabContentAspect.java
===================================================================
RCS file: /home/cvs/cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/TabContentAspect.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- TabContentAspect.java 19 Aug 2003 14:09:34 -0000 1.10
+++ TabContentAspect.java 20 Aug 2003 12:05:35 -0000 1.11
@@ -88,7 +88,9 @@
if (layout instanceof CompositeLayout) {
TabPreparedConfiguration config = (TabPreparedConfiguration)context.getAspectConfiguration();
- XMLUtils.startElement(handler, config.tagName);
+ if ( config.rootTag ) {
+ XMLUtils.startElement(handler, config.tagName);
+ }
AttributesImpl attributes = new AttributesImpl();
CompositeLayout tabLayout = (CompositeLayout) layout;
@@ -118,7 +120,9 @@
XMLUtils.endElement(handler, "named-item");
}
- XMLUtils.endElement(handler, config.tagName);
+ if ( config.rootTag ) {
+ XMLUtils.endElement(handler, config.tagName);
+ }
} else {
throw new SAXException("Wrong layout type, TabLayout expected: " + layout.getClass().getName());
}
1.4 +16 -4 cocoon-2.1/src/blocks/portal/conf/portal.samplesxconf
Index: portal.samplesxconf
===================================================================
RCS file: /home/cvs/cocoon-2.1/src/blocks/portal/conf/portal.samplesxconf,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- portal.samplesxconf 19 Aug 2003 09:18:17 -0000 1.3
+++ portal.samplesxconf 20 Aug 2003 12:05:35 -0000 1.4
@@ -12,9 +12,12 @@
<aspect type="xslt">
<parameter name="style" value="{global:skin}styles/column.xsl"/>
</aspect>
- <aspect type="composite-content">
+ <aspect type="parameter">
<parameter name="tag-name" value="column-layout"/>
</aspect>
+ <aspect type="composite-content">
+ <parameter name="root-tag" value="false"/>
+ </aspect>
</aspects>
</renderer>
<renderer name="row" class="org.apache.cocoon.portal.layout.renderer.impl.AspectRenderer" logger="portal" >
@@ -22,9 +25,12 @@
<aspect type="xslt">
<parameter name="style" value="{global:skin}styles/row.xsl"/>
</aspect>
- <aspect type="composite-content">
+ <aspect type="parameter">
<parameter name="tag-name" value="row-layout"/>
</aspect>
+ <aspect type="composite-content">
+ <parameter name="root-tag" value="false"/>
+ </aspect>
</aspects>
</renderer>
<renderer name="tab" class="org.apache.cocoon.portal.layout.renderer.impl.AspectRenderer" logger="portal" >
@@ -32,8 +38,11 @@
<aspect type="xslt">
<parameter name="style" value="{global:skin}styles/tab.xsl"/>
</aspect>
- <aspect type="tab-content">
+ <aspect type="parameter">
<parameter name="tag-name" value="tab-layout"/>
+ </aspect>
+ <aspect type="tab-content">
+ <parameter name="root-tag" value="false"/>
<parameter name="store" value="session"/>
</aspect>
</aspects>
@@ -43,8 +52,11 @@
<aspect type="xslt">
<parameter name="style" value="{global:skin}styles/window.xsl"/>
</aspect>
- <aspect type="window">
+ <aspect type="parameter">
<parameter name="tag-name" value="window"/>
+ </aspect>
+ <aspect type="window">
+ <parameter name="root-tag" value="false"/>
</aspect>
<aspect type="coplet-removing"/>
<aspect type="coplet-full-screen"/>
1.13 +12 -0 cocoon-2.1/src/blocks/portal/samples/sitemap.xmap
Index: sitemap.xmap
===================================================================
RCS file: /home/cvs/cocoon-2.1/src/blocks/portal/samples/sitemap.xmap,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- sitemap.xmap 11 Jul 2003 14:17:02 -0000 1.12
+++ sitemap.xmap 20 Aug 2003 12:05:35 -0000 1.13
@@ -109,6 +109,18 @@
</map:act>
</map:match>
+ <map:match pattern="portalxml">
+ <map:act type="auth-protect">
+ <map:parameter name="handler" value="portalhandler"/>
+ <map:parameter name="application" value="portal"/>
+
+ <map:generate type="portal" label="content">
+ <map:parameter name="portal-name" value="portal" />
+ </map:generate>
+ <map:serialize type="xml"/>
+ </map:act>
+ </map:match>
+
<!-- authentication stuff -->
<map:match pattern="login">