cziegeler 2003/07/04 10:51:53
Modified: src/blocks/woody/java/org/apache/cocoon/woody/transformation
WidgetReplacingPipe.java
WoodyTemplateTransformer.java
src/blocks/woody/java/org/apache/cocoon/woody/generation
WoodyGenerator.java
Log:
Make classes subclassable
Revision Changes Path
1.3 +12 -10
cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/transformation/WidgetReplacingPipe.java
Index: WidgetReplacingPipe.java
===================================================================
RCS file:
/home/cvs/cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/transformation/WidgetReplacingPipe.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- WidgetReplacingPipe.java 3 Jul 2003 09:03:20 -0000 1.2
+++ WidgetReplacingPipe.java 4 Jul 2003 17:51:53 -0000 1.3
@@ -91,28 +91,29 @@
* <p>Woody ships with an XSL that can style all the widgets that are provided by
the core Woody framework.
*/
public class WidgetReplacingPipe extends AbstractXMLPipe {
- private Widget contextWidget;
+
+ protected Widget contextWidget;
/** Indicates whether we're currently in a widget element. */
- private boolean inWidgetElement;
+ protected boolean inWidgetElement;
/** Compiler used to record the XML inside wi:widget elements. */
- private XMLByteStreamCompiler xmlCompiler = new XMLByteStreamCompiler();
+ protected XMLByteStreamCompiler xmlCompiler = new XMLByteStreamCompiler();
/** Counts the element nesting. */
- private int elementNestingCounter;
+ protected int elementNestingCounter;
/**
* Contains the value of the [EMAIL PROTECTED] #elementNestingCounter} on the
moment the transformer
* encountered a wi:widget element. Used to detect the corresponding endElement
call
* for the wi:widget element.
*/
- private int widgetElementNesting;
+ protected int widgetElementNesting;
/**
* If [EMAIL PROTECTED] #inWidgetElement} = true, then this contains the widget
currenlty being handled.
*/
- private Widget widget;
+ protected Widget widget;
/** Boolean indicating wether the current widget requires special
repeater-treatement. */
- private boolean repeaterWidget;
- private WoodyTemplateTransformer.InsertStylingContentHandler stylingHandler =
new WoodyTemplateTransformer.InsertStylingContentHandler();
+ protected boolean repeaterWidget;
+ protected WoodyTemplateTransformer.InsertStylingContentHandler stylingHandler =
new WoodyTemplateTransformer.InsertStylingContentHandler();
- private static final String STYLING_EL = "styling";
+ protected static final String STYLING_EL = "styling";
public void init(Widget contextWidget) {
this.contextWidget = contextWidget;
@@ -349,7 +350,8 @@
public void recycle() {
super.recycle();
- contextWidget = null;
+ this.contextWidget = null;
+ this.widget = null;
}
}
1.2 +13 -11
cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/transformation/WoodyTemplateTransformer.java
Index: WoodyTemplateTransformer.java
===================================================================
RCS file:
/home/cvs/cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/transformation/WoodyTemplateTransformer.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- WoodyTemplateTransformer.java 22 Apr 2003 12:04:21 -0000 1.1
+++ WoodyTemplateTransformer.java 4 Jul 2003 17:51:53 -0000 1.2
@@ -50,24 +50,26 @@
*/
package org.apache.cocoon.woody.transformation;
-import org.apache.cocoon.transformation.Transformer;
-import org.apache.cocoon.environment.SourceResolver;
-import org.apache.cocoon.environment.Request;
-import org.apache.cocoon.environment.ObjectModelHelper;
+import java.io.IOException;
+import java.util.Map;
+
+import org.apache.avalon.framework.parameters.ParameterException;
+import org.apache.avalon.framework.parameters.Parameters;
import org.apache.cocoon.ProcessingException;
+import org.apache.cocoon.environment.ObjectModelHelper;
+import org.apache.cocoon.environment.Request;
+import org.apache.cocoon.environment.SourceResolver;
+import org.apache.cocoon.transformation.Transformer;
import org.apache.cocoon.woody.formmodel.Form;
-import org.apache.avalon.framework.parameters.Parameters;
-import org.apache.avalon.framework.parameters.ParameterException;
-import org.apache.avalon.excalibur.pool.Poolable;
import org.xml.sax.SAXException;
-import java.util.Map;
-import java.io.IOException;
-
/**
* See description of [EMAIL PROTECTED] WidgetReplacingPipe}.
*/
-public class WoodyTemplateTransformer extends WidgetReplacingPipe implements
Transformer, Poolable {
+public class WoodyTemplateTransformer
+ extends WidgetReplacingPipe
+ implements Transformer {
+
public void setup(SourceResolver resolver, Map objectModel, String src,
Parameters parameters) throws ProcessingException,
SAXException, IOException {
1.2 +2 -1
cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/generation/WoodyGenerator.java
Index: WoodyGenerator.java
===================================================================
RCS file:
/home/cvs/cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/generation/WoodyGenerator.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- WoodyGenerator.java 22 Apr 2003 12:04:20 -0000 1.1
+++ WoodyGenerator.java 4 Jul 2003 17:51:53 -0000 1.2
@@ -77,7 +77,8 @@
* name should be provided to this generator as a sitemap parameter called
"attribute-name".
*/
public class WoodyGenerator extends AbstractGenerator {
- private Form form;
+
+ protected Form form;
public void setup(SourceResolver resolver, Map objectModel, String src,
Parameters par)
throws ProcessingException, SAXException, IOException {