cziegeler 2004/05/24 05:37:52
Modified: src/java/org/apache/cocoon/generation ServletGenerator.java
src/blocks/xmldb/java/org/apache/cocoon/generation
XMLDBCollectionGenerator.java XMLDBGenerator.java
src/blocks/xsp/java/org/apache/cocoon/acting
ServerPagesAction.java
src/blocks/xsp/java/org/apache/cocoon/components/language/markup/xsp
XSPGenerator.java
Added: src/deprecated/java/org/apache/cocoon/reading
ComposerReader.java
src/deprecated/java/org/apache/cocoon/generation
ComposerGenerator.java
src/deprecated/java/org/apache/cocoon/acting
ConfigurableComposerAction.java ComposerAction.java
Removed: src/java/org/apache/cocoon/reading ComposerReader.java
src/java/org/apache/cocoon/generation ComposerGenerator.java
src/java/org/apache/cocoon/acting ComposerAction.java
ConfigurableComposerAction.java
Log:
Move deprecated abstract classes into "deprecated" block
Revision Changes Path
1.1
cocoon-2.1/src/deprecated/java/org/apache/cocoon/reading/ComposerReader.java
Index: ComposerReader.java
===================================================================
/*
* Copyright 1999-2004 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.reading;
import org.apache.avalon.framework.component.ComponentException;
import org.apache.avalon.framework.component.ComponentManager;
import org.apache.avalon.framework.component.Composable;
/**
* The <code>ComposerReader</code> will allow any <code>Reader</code>
* that extends this to access SitemapComponents.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Marcus Crafter</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Giacomo Pati</a>
*
* @deprecated Use the ServiceableReader instead
* @version CVS $Id: ComposerReader.java,v 1.1 2004/05/24 12:37:52 cziegeler
Exp $
*/
public abstract class ComposerReader extends AbstractReader
implements Composable {
/** The component manager instance */
protected ComponentManager manager;
/**
* Set the current <code>ComponentManager</code> instance used by this
* <code>Composable</code>.
*/
public void compose(final ComponentManager manager) throws
ComponentException {
this.manager = manager;
}
}
1.1
cocoon-2.1/src/deprecated/java/org/apache/cocoon/generation/ComposerGenerator.java
Index: ComposerGenerator.java
===================================================================
/*
* Copyright 1999-2004 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.generation;
import org.apache.avalon.framework.activity.Disposable;
import org.apache.avalon.framework.component.ComponentException;
import org.apache.avalon.framework.component.ComponentManager;
import org.apache.avalon.framework.component.Composable;
/**
* A default implementation that can be used for writing own generators.
*
* @deprecated Use the [EMAIL PROTECTED] ServiceableGenerator} instead.
* @author <a href="mailto:[EMAIL PROTECTED]">Pierpaolo Fumagalli</a>
* (Apache Software Foundation)
* @version CVS $Id: ComposerGenerator.java,v 1.1 2004/05/24 12:37:52
cziegeler Exp $
*/
public abstract class ComposerGenerator extends AbstractGenerator
implements Composable, Disposable {
/** The component manager instance */
protected ComponentManager manager;
/**
* Set the current <code>ComponentManager</code> instance used by this
* <code>Composable</code>.
*/
public void compose(ComponentManager manager) throws ComponentException {
this.manager = manager;
}
/**
* Release all resources.
*/
public void dispose() {
this.manager = null;
}
}
1.4 +32 -4
cocoon-2.1/src/java/org/apache/cocoon/generation/ServletGenerator.java
Index: ServletGenerator.java
===================================================================
RCS file:
/home/cvs/cocoon-2.1/src/java/org/apache/cocoon/generation/ServletGenerator.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ServletGenerator.java 5 Mar 2004 13:02:55 -0000 1.3
+++ ServletGenerator.java 24 May 2004 12:37:52 -0000 1.4
@@ -15,6 +15,10 @@
*/
package org.apache.cocoon.generation;
+import org.apache.avalon.framework.activity.Disposable;
+import org.apache.avalon.framework.component.ComponentException;
+import org.apache.avalon.framework.component.ComponentManager;
+import org.apache.avalon.framework.component.Composable;
import org.apache.avalon.framework.parameters.Parameters;
import org.apache.cocoon.ProcessingException;
@@ -30,16 +34,40 @@
import java.util.Map;
/**
+ * @author CZiegeler
+ *
+ * To change the template for this generated type comment go to
+ * Window - Preferences - Java - Code Generation - Code and Comments
+ */
+/**
*
* @author <a href="mailto:[EMAIL PROTECTED]">Giacomo Pati</a>
* @version CVS $Id$
*/
-public abstract class ServletGenerator extends ComposerGenerator {
+public abstract class ServletGenerator extends AbstractGenerator
+implements Composable, Disposable {
protected Request request;
protected Response response;
protected Context context;
+ /** The component manager instance */
+ protected ComponentManager manager;
+
+ /* (non-Javadoc)
+ * @see
org.apache.avalon.framework.component.Composable#compose(org.apache.avalon.framework.component.ComponentManager)
+ */
+ public void compose(ComponentManager manager) throws ComponentException {
+ this.manager = manager;
+ }
+
+ public void dispose() {
+ this.manager = null;
+ }
+
+ /* (non-Javadoc)
+ * @see
org.apache.cocoon.sitemap.SitemapModelComponent#setup(org.apache.cocoon.environment.SourceResolver,
java.util.Map, java.lang.String,
org.apache.avalon.framework.parameters.Parameters)
+ */
public void setup(SourceResolver resolver, Map objectModel, String src,
Parameters par)
throws ProcessingException, SAXException, IOException {
@@ -49,8 +77,8 @@
this.context = ObjectModelHelper.getContext(objectModel);
}
- /**
- * Recycle the generator by removing references
+ /* (non-Javadoc)
+ * @see org.apache.avalon.excalibur.pool.Recyclable#recycle()
*/
public void recycle() {
super.recycle();
1.1
cocoon-2.1/src/deprecated/java/org/apache/cocoon/acting/ConfigurableComposerAction.java
Index: ConfigurableComposerAction.java
===================================================================
/*
* Copyright 1999-2004 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.acting;
import org.apache.avalon.framework.component.ComponentException;
import org.apache.avalon.framework.component.ComponentManager;
import org.apache.avalon.framework.component.Composable;
/**
* The <code>ComposerAction</code> will allow any <code>Action</code>
* that extends this to access SitemapComponents.
*
* Basically a copy of [EMAIL PROTECTED] ComposerAction} that inherits from
* [EMAIL PROTECTED] AbstractConfigurableAction}.
*
* @deprecated Use the ConfigurableServiceableAction instead
* @author <a href="mailto:[EMAIL PROTECTED]">Giacomo Pati</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Christian Haul</a>
* @version CVS $Id: ConfigurableComposerAction.java,v 1.1 2004/05/24
12:37:52 cziegeler Exp $
*/
public abstract class ConfigurableComposerAction extends
AbstractConfigurableAction implements Composable {
/** The component manager instance */
protected ComponentManager manager;
/**
* Set the current <code>ComponentManager</code> instance used by this
* <code>Composable</code>.
*/
public void compose(ComponentManager manager) throws ComponentException {
this.manager=manager;
}
}
1.1
cocoon-2.1/src/deprecated/java/org/apache/cocoon/acting/ComposerAction.java
Index: ComposerAction.java
===================================================================
/*
* Copyright 1999-2004 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.acting;
import org.apache.avalon.framework.component.ComponentException;
import org.apache.avalon.framework.component.ComponentManager;
import org.apache.avalon.framework.component.Composable;
/**
* The <code>ComposerAction</code> will allow any <code>Action</code>
* that extends this to access SitemapComponents.
*
* @deprecated Use the ServiceableAction instead
* @author <a href="mailto:[EMAIL PROTECTED]">Giacomo Pati</a>
* @version CVS $Id: ComposerAction.java,v 1.1 2004/05/24 12:37:52 cziegeler
Exp $
*/
public abstract class ComposerAction extends AbstractAction implements
Composable {
/** The component manager instance */
protected ComponentManager manager;
/**
* Set the current <code>ComponentManager</code> instance used by this
* <code>Composable</code>.
*/
public void compose(ComponentManager manager) throws ComponentException {
this.manager=manager;
}
}
1.5 +2 -8
cocoon-2.1/src/blocks/xmldb/java/org/apache/cocoon/generation/XMLDBCollectionGenerator.java
Index: XMLDBCollectionGenerator.java
===================================================================
RCS file:
/home/cvs/cocoon-2.1/src/blocks/xmldb/java/org/apache/cocoon/generation/XMLDBCollectionGenerator.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- XMLDBCollectionGenerator.java 5 Mar 2004 13:02:36 -0000 1.4
+++ XMLDBCollectionGenerator.java 24 May 2004 12:37:52 -0000 1.5
@@ -16,8 +16,6 @@
package org.apache.cocoon.generation;
import org.apache.avalon.framework.activity.Initializable;
-import org.apache.avalon.framework.component.ComponentException;
-import org.apache.avalon.framework.component.ComponentManager;
import org.apache.avalon.framework.configuration.Configurable;
import org.apache.avalon.framework.configuration.Configuration;
import org.apache.avalon.framework.configuration.ConfigurationException;
@@ -59,7 +57,7 @@
* @version CVS $Id$
* @deprecated Use the XML:DB pseudo protocol instead.
*/
-public class XMLDBCollectionGenerator extends ComposerGenerator
+public class XMLDBCollectionGenerator extends ServiceableGenerator
implements CacheableProcessingComponent, Configurable, Initializable
{
protected static final String URI =
@@ -78,10 +76,6 @@
protected Database database;
protected Collection collection;
protected final AttributesImpl attributes = new AttributesImpl();
-
- public void compose(ComponentManager manager) throws ComponentException {
- super.compose(manager);
- }
/**
* Recycle the component, keep only the configuration variables
1.5 +2 -8
cocoon-2.1/src/blocks/xmldb/java/org/apache/cocoon/generation/XMLDBGenerator.java
Index: XMLDBGenerator.java
===================================================================
RCS file:
/home/cvs/cocoon-2.1/src/blocks/xmldb/java/org/apache/cocoon/generation/XMLDBGenerator.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- XMLDBGenerator.java 5 Mar 2004 13:02:36 -0000 1.4
+++ XMLDBGenerator.java 24 May 2004 12:37:52 -0000 1.5
@@ -16,8 +16,6 @@
package org.apache.cocoon.generation;
import org.apache.avalon.framework.activity.Initializable;
-import org.apache.avalon.framework.component.ComponentException;
-import org.apache.avalon.framework.component.ComponentManager;
import org.apache.avalon.framework.configuration.Configurable;
import org.apache.avalon.framework.configuration.Configuration;
import org.apache.avalon.framework.configuration.ConfigurationException;
@@ -59,7 +57,7 @@
* @version CVS $Id$
* @deprecated Use the XML:DB pseudo protocol instead.
*/
-public class XMLDBGenerator extends ComposerGenerator
+public class XMLDBGenerator extends ServiceableGenerator
implements CacheableProcessingComponent, Configurable,Initializable {
protected String driver;
@@ -69,10 +67,6 @@
protected Database database;
protected Collection collection;
protected XMLResource xmlResource;
-
- public void compose(ComponentManager manager) throws ComponentException {
- super.compose(manager);
- }
/**
* Recycle the component, keep only the configuration variables
1.2 +34 -5
cocoon-2.1/src/blocks/xsp/java/org/apache/cocoon/acting/ServerPagesAction.java
Index: ServerPagesAction.java
===================================================================
RCS file:
/home/cvs/cocoon-2.1/src/blocks/xsp/java/org/apache/cocoon/acting/ServerPagesAction.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ServerPagesAction.java 10 Mar 2004 12:58:04 -0000 1.1
+++ ServerPagesAction.java 24 May 2004 12:37:52 -0000 1.2
@@ -19,6 +19,10 @@
import java.util.Map;
import org.apache.avalon.framework.activity.Disposable;
+import org.apache.avalon.framework.component.ComponentException;
+import org.apache.avalon.framework.component.ComponentManager;
+import org.apache.avalon.framework.component.Composable;
+import org.apache.avalon.framework.configuration.Configurable;
import org.apache.avalon.framework.configuration.Configuration;
import org.apache.avalon.framework.configuration.ConfigurationException;
import org.apache.avalon.framework.parameters.Parameters;
@@ -36,6 +40,12 @@
import org.apache.cocoon.xml.AbstractXMLConsumer;
/**
+ * @author CZiegeler
+ *
+ * To change the template for this generated type comment go to
+ * Window - Preferences - Java - Code Generation - Code and Comments
+ */
+/**
* Allows actions to be written in XSP. This allows to use XSP to produce
* XML fragments that are later reused in generators.<br/>
*
@@ -72,17 +82,30 @@
* @version CVS $Id$
*/
public class ServerPagesAction
- extends ConfigurableComposerAction
- implements Disposable, ThreadSafe {
+ extends AbstractAction
+ implements Disposable, ThreadSafe, Configurable, Composable {
public static final String REDIRECTOR_OBJECT = "xsp-action:redirector";
public static final String ACTION_RESULT_OBJECT = "xsp-action:result";
public static final String ACTION_SUCCESS_OBJECT = "xsp-action:success";
- ComponentHandler generatorHandler;
+ private ComponentHandler generatorHandler;
+ /** The component manager instance */
+ private ComponentManager manager;
+
+ /* (non-Javadoc)
+ * @see
org.apache.avalon.framework.component.Composable#compose(org.apache.avalon.framework.component.ComponentManager)
+ */
+ public void compose(ComponentManager manager) throws ComponentException {
+ this.manager=manager;
+ }
+
+ /* (non-Javadoc)
+ * @see
org.apache.avalon.framework.configuration.Configurable#configure(org.apache.avalon.framework.configuration.Configuration)
+ */
public void configure(Configuration conf)
- throws ConfigurationException {
+ throws ConfigurationException {
try {
this.generatorHandler = ComponentHandler.getComponentHandler(
ServerPagesGenerator.class,
@@ -103,6 +126,9 @@
}
}
+ /* (non-Javadoc)
+ * @see org.apache.avalon.framework.activity.Disposable#dispose()
+ */
public void dispose() {
if (this.generatorHandler != null) {
this.generatorHandler.dispose();
@@ -110,6 +136,9 @@
}
}
+ /* (non-Javadoc)
+ * @see
org.apache.cocoon.acting.Action#act(org.apache.cocoon.environment.Redirector,
org.apache.cocoon.environment.SourceResolver, java.util.Map, java.lang.String,
org.apache.avalon.framework.parameters.Parameters)
+ */
public Map act(Redirector redirector, SourceResolver resolver, Map
objectModel,
String source, Parameters parameters)
throws Exception {
1.2 +2 -13
cocoon-2.1/src/blocks/xsp/java/org/apache/cocoon/components/language/markup/xsp/XSPGenerator.java
Index: XSPGenerator.java
===================================================================
RCS file:
/home/cvs/cocoon-2.1/src/blocks/xsp/java/org/apache/cocoon/components/language/markup/xsp/XSPGenerator.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- XSPGenerator.java 10 Mar 2004 12:58:05 -0000 1.1
+++ XSPGenerator.java 24 May 2004 12:37:52 -0000 1.2
@@ -16,8 +16,6 @@
package org.apache.cocoon.components.language.markup.xsp;
import org.apache.avalon.excalibur.pool.Recyclable;
-import org.apache.avalon.framework.component.ComponentException;
-import org.apache.avalon.framework.component.ComponentManager;
import org.apache.avalon.framework.context.Context;
import org.apache.avalon.framework.context.ContextException;
import org.apache.avalon.framework.context.Contextualizable;
@@ -39,16 +37,6 @@
this.avalonContext = context;
}
- /**
- * Set the current <code>ComponentManager</code> instance used by this
- * <code>Generator</code> and initialize relevant instance variables.
- *
- * @param manager The global component manager
- */
- public void compose(ComponentManager manager) throws ComponentException {
- super.compose(manager);
- }
-
// XSP Helper methods accessible from the page
/**
@@ -78,4 +66,5 @@
public void xspExpr(Object v) throws SAXException {
XSPObjectHelper.xspExpr(this.contentHandler, v);
}
+
}