cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Myers <phan...@stserv.hcf.jhu.edu>
Subject Re: [PATCH] for cocoon20
Date Mon, 03 Dec 2001 00:45:53 GMT
Giacamo,

Here's the first of three patches i'm sending tonight-- this will make AbstractComplementaryConfigurable
action work in the cocoon20 branch.

I'm going to send another patch in this thread for HEAD.  The patch for AbstractComplementaryConfigurable
action should be and maybe will be identical to the cocoon20 one.  HEAD has another action
that needs to be patched... i'll send that one too. either i missed it before or you applied
the cocoon20 set of patches to both head and the branch.  no matter.
Anyway, the head patch will make it compile again.

The last will be in its own thread-- an addition to one of the actions.
Tim

On Sun, Dec 02, 2001 at 08:47:51PM +0100, giacomo wrote:
> On Fri, 30 Nov 2001, Tim Myers wrote:
> 
> > Apperently passing the environment isn't sufficient.  This time i'm setting up base
using getContext().
> 
> Oops, I should read ahead first. Could you send a patch to fixed it
> based on the current code?
> 
> Giacomo
> 
> >
> > I'm only submitting patches for cocoon20 this time.  The only file that is different
from the last set is AbstractComplementaryConfigurableAction.java.
> >
> > I'll rework the head patches if anyone is interested.  It's really quite trivial
though.
> >
> > I wanted to provide this functionality deeper (in URLFactoryImpl or SourceHandlerImpl)
but I don't want to break any functionality elsewhere in cocoon.  It's funny: file is dealt
with as an exception to trap unix/dos inconsistencies but it's done in the code rather than
with a FileURLFactory.
> >
> >
> > Tim
> >
> > On Thu, Nov 29, 2001 at 10:08:02PM -0500, Tim Myers wrote:
> > > Here is a patchset for the acting directory of the cocoon_20_branch and HEAD.
> > > These make the "file:" url  behave as expected for bringing in configuration
files that live in a subsitemap.
> > >
> > > It makes the configuration files much more useful.
> > >
> > > Tim
> >
> > Content-Description: patches for HEAD
> > > ? acting.diff
> > > Index: AbstractComplementaryConfigurableAction.java
> > > ===================================================================
> > > RCS file: /home/cvspublic/xml-cocoon2/src/org/apache/cocoon/acting/AbstractComplementaryConfigurableAction.java,v
> > > retrieving revision 1.12
> > > diff -u -r1.12 AbstractComplementaryConfigurableAction.java
> > > --- AbstractComplementaryConfigurableAction.java	2001/10/11 07:28:15	1.12
> > > +++ AbstractComplementaryConfigurableAction.java	2001/11/30 02:43:24
> > > @@ -14,6 +14,8 @@
> > >  import org.apache.cocoon.Constants;
> > >  import org.apache.cocoon.components.source.SourceHandler;
> > >  import org.apache.cocoon.environment.Source;
> > > +import org.apache.cocoon.environment.SourceResolver;
> > > +import org.apache.cocoon.environment.Environment;
> > >
> > >  import java.util.HashMap;
> > >  import java.util.Map;
> > > @@ -43,7 +45,7 @@
> > >  	boolean reloadable = Constants.DESCRIPTOR_RELOADABLE_DEFAULT;
> > >  	if (this.settings.containsKey("reloadable"))
> > >  	    reloadable = Boolean.getBoolean((String) this.settings.get("reloadable"));
> > > -	return this.getConfiguration(descriptor, reloadable);
> > > +	return this.getConfiguration(descriptor, null, reloadable);
> > >      }
> > >
> > >      /**
> > > @@ -52,7 +54,7 @@
> > >       * this approach, we can limit the number of config files.
> > >       * Also note that the configuration file does not have to be a file.
> > >       */
> > > -    protected Configuration getConfiguration(String descriptor, boolean reloadable)
throws ConfigurationException {
> > > +    protected Configuration getConfiguration(String descriptor, SourceResolver
resolver, boolean reloadable) throws ConfigurationException {
> > >          ConfigurationHelper conf = null;
> > >
> > >          if (descriptor == null) {
> > > @@ -68,7 +70,7 @@
> > >
> > >                  try {
> > >                      sourceHandler = (SourceHandler) this.manager.lookup(SourceHandler.ROLE);
> > > -                    resource = sourceHandler.getSource(null, descriptor);
> > > +                    resource = sourceHandler.getSource((Environment)resolver,
descriptor);
> > >
> > >                      if (conf == null || conf.lastModified < resource.getLastModified())
{
> > >                          getLogger().debug("(Re)Loading " + descriptor);
> > > Index: DatabaseAddAction.java
> > > ===================================================================
> > > RCS file: /home/cvspublic/xml-cocoon2/src/org/apache/cocoon/acting/DatabaseAddAction.java,v
> > > retrieving revision 1.14
> > > diff -u -r1.14 DatabaseAddAction.java
> > > --- DatabaseAddAction.java	2001/10/25 18:00:11	1.14
> > > +++ DatabaseAddAction.java	2001/11/30 02:43:24
> > > @@ -56,7 +56,7 @@
> > >  	// read local parameter settings
> > >          try {
> > >              Configuration conf =
> > > -		this.getConfiguration(param.getParameter("descriptor", (String) this.settings.get("descriptor")),
> > > +		this.getConfiguration(param.getParameter("descriptor", (String) this.settings.get("descriptor")),
resolver,
> > >  				      param.getParameterAsBoolean("reloadable",reloadable));
> > >
> > >              datasource = this.getDataSource(conf);
> > > Index: DatabaseAuthenticatorAction.java
> > > ===================================================================
> > > RCS file: /home/cvspublic/xml-cocoon2/src/org/apache/cocoon/acting/DatabaseAuthenticatorAction.java,v
> > > retrieving revision 1.16
> > > diff -u -r1.16 DatabaseAuthenticatorAction.java
> > > --- DatabaseAuthenticatorAction.java	2001/10/25 19:32:58	1.16
> > > +++ DatabaseAuthenticatorAction.java	2001/11/30 02:43:24
> > > @@ -79,6 +79,7 @@
> > >          try {
> > >              Configuration conf = this.getConfiguration (
> > >                      parameters.getParameter ("descriptor", (String) this.settings.get("descriptor")),
> > > +            resolver,
> > >              parameters.getParameterAsBoolean("reloadable",reloadable));
> > >              boolean cs = true;
> > >              String create_session = parameters.getParameter ("create-session",
> > > Index: DatabaseDeleteAction.java
> > > ===================================================================
> > > RCS file: /home/cvspublic/xml-cocoon2/src/org/apache/cocoon/acting/DatabaseDeleteAction.java,v
> > > retrieving revision 1.11
> > > diff -u -r1.11 DatabaseDeleteAction.java
> > > --- DatabaseDeleteAction.java	2001/10/11 07:28:15	1.11
> > > +++ DatabaseDeleteAction.java	2001/11/30 02:43:24
> > > @@ -54,7 +54,7 @@
> > >  	// read local parameter settings
> > >          try {
> > >              Configuration conf =
> > > -		this.getConfiguration(param.getParameter("descriptor", (String) this.settings.get("descriptor")),
> > > +		this.getConfiguration(param.getParameter("descriptor", (String) this.settings.get("descriptor")),
resolver,
> > >  				      param.getParameterAsBoolean("reloadable",reloadable));
> > >
> > >              String query = this.getDeleteQuery(conf);
> > > Index: DatabaseSelectAction.java
> > > ===================================================================
> > > RCS file: /home/cvspublic/xml-cocoon2/src/org/apache/cocoon/acting/DatabaseSelectAction.java,v
> > > retrieving revision 1.5
> > > diff -u -r1.5 DatabaseSelectAction.java
> > > --- DatabaseSelectAction.java	2001/10/11 07:28:15	1.5
> > > +++ DatabaseSelectAction.java	2001/11/30 02:43:24
> > > @@ -56,6 +56,7 @@
> > >          try {
> > >              Configuration conf =
> > >                  this.getConfiguration(param.getParameter("descriptor", (String)
this.settings.get("descriptor")),
> > > +                                      resolver,
> > >                                        param.getParameterAsBoolean("reloadable",reloadable));
> > >
> > >              Request request = (Request) objectModel.get(Constants.REQUEST_OBJECT);
> > > Index: DatabaseUpdateAction.java
> > > ===================================================================
> > > RCS file: /home/cvspublic/xml-cocoon2/src/org/apache/cocoon/acting/DatabaseUpdateAction.java,v
> > > retrieving revision 1.12
> > > diff -u -r1.12 DatabaseUpdateAction.java
> > > --- DatabaseUpdateAction.java	2001/10/11 07:28:15	1.12
> > > +++ DatabaseUpdateAction.java	2001/11/30 02:43:24
> > > @@ -51,7 +51,7 @@
> > >  	// read local parameter settings
> > >          try {
> > >              Configuration conf =
> > > -		this.getConfiguration(param.getParameter("descriptor", (String) this.settings.get("descriptor")),
> > > +		this.getConfiguration(param.getParameter("descriptor", (String) this.settings.get("descriptor")),
resolver,
> > >  				      param.getParameterAsBoolean("reloadable",reloadable));
> > >
> > >              String query = this.getUpdateQuery(conf);
> > > Index: FormValidatorAction.java
> > > ===================================================================
> > > RCS file: /home/cvspublic/xml-cocoon2/src/org/apache/cocoon/acting/FormValidatorAction.java,v
> > > retrieving revision 1.12
> > > diff -u -r1.12 FormValidatorAction.java
> > > --- FormValidatorAction.java	2001/10/11 07:28:15	1.12
> > > +++ FormValidatorAction.java	2001/11/30 02:43:24
> > > @@ -81,7 +81,7 @@
> > >  	// read local settings
> > >          try {
> > >              Configuration conf = this.getConfiguration (
> > > -                    parameters.getParameter ("descriptor", (String) this.settings.get("descriptor")),
> > > +                    parameters.getParameter ("descriptor", (String) this.settings.get("descriptor")),
resolver,
> > >  		    parameters.getParameterAsBoolean("reloadable", reloadable));
> > >              String valstr = parameters.getParameter ("validate", (String)
settings.get("validate",""));
> > >              String valsetstr = parameters.getParameter ("validate-set", (String)
settings.get("validate-set",""));
> > > Index: SessionValidatorAction.java
> > > ===================================================================
> > > RCS file: /home/cvspublic/xml-cocoon2/src/org/apache/cocoon/acting/SessionValidatorAction.java,v
> > > retrieving revision 1.12
> > > diff -u -r1.12 SessionValidatorAction.java
> > > --- SessionValidatorAction.java	2001/10/11 07:28:16	1.12
> > > +++ SessionValidatorAction.java	2001/11/30 02:43:25
> > > @@ -83,7 +83,7 @@
> > >
> > >          try {
> > >              Configuration conf = this.getConfiguration (
> > > -                    parameters.getParameter ("descriptor", (String) this.settings.get("descriptor")),
> > > +                    parameters.getParameter ("descriptor", (String) this.settings.get("descriptor")),
resolver,
> > >              parameters.getParameterAsBoolean("reloadable",reloadable));
> > >
> > >              String valsetstr = parameters.getParameter ( "validate-set", (String)
settings.get("validate-set") );
> >
> > Content-Description: for cocoon_20_branch
> > > ? acting.diff
> > > Index: AbstractComplementaryConfigurableAction.java
> > > ===================================================================
> > > RCS file: /home/cvspublic/xml-cocoon2/src/org/apache/cocoon/acting/AbstractComplementaryConfigurableAction.java,v
> > > retrieving revision 1.3.2.9
> > > diff -u -r1.3.2.9 AbstractComplementaryConfigurableAction.java
> > > --- AbstractComplementaryConfigurableAction.java	2001/10/11 08:52:03	1.3.2.9
> > > +++ AbstractComplementaryConfigurableAction.java	2001/11/30 02:12:39
> > > @@ -14,6 +14,8 @@
> > >  import org.apache.cocoon.Constants;
> > >  import org.apache.cocoon.components.source.SourceHandler;
> > >  import org.apache.cocoon.environment.Source;
> > > +import org.apache.cocoon.environment.SourceResolver;
> > > +import org.apache.cocoon.environment.Environment;
> > >
> > >  import java.util.HashMap;
> > >  import java.util.Map;
> > > @@ -43,7 +45,7 @@
> > >  	boolean reloadable = Constants.DESCRIPTOR_RELOADABLE_DEFAULT;
> > >  	if (this.settings.containsKey("reloadable"))
> > >  	    reloadable = Boolean.getBoolean((String) this.settings.get("reloadable"));
> > > -	return this.getConfiguration(descriptor, reloadable);
> > > +	return this.getConfiguration(descriptor, null, reloadable);
> > >      }
> > >
> > >      /**
> > > @@ -52,7 +54,7 @@
> > >       * this approach, we can limit the number of config files.
> > >       * Also note that the configuration file does not have to be a file.
> > >       */
> > > -    protected Configuration getConfiguration(String descriptor, boolean reloadable)
throws ConfigurationException {
> > > +    protected Configuration getConfiguration(String descriptor, SourceResolver
resolver, boolean reloadable) throws ConfigurationException {
> > >          ConfigurationHelper conf = null;
> > >
> > >          if (descriptor == null) {
> > > @@ -68,7 +70,7 @@
> > >
> > >                  try {
> > >                      sourceHandler = (SourceHandler) this.manager.lookup(SourceHandler.ROLE);
> > > -                    resource = sourceHandler.getSource(null, descriptor);
> > > +                    resource = sourceHandler.getSource((Environment)resolver,
descriptor);
> > >
> > >                      if (conf == null || conf.lastModified < resource.getLastModified())
{
> > >                          getLogger().debug("(Re)Loading " + descriptor);
> > > Index: DatabaseAddAction.java
> > > ===================================================================
> > > RCS file: /home/cvspublic/xml-cocoon2/src/org/apache/cocoon/acting/DatabaseAddAction.java,v
> > > retrieving revision 1.6.2.9
> > > diff -u -r1.6.2.9 DatabaseAddAction.java
> > > --- DatabaseAddAction.java	2001/10/25 18:00:34	1.6.2.9
> > > +++ DatabaseAddAction.java	2001/11/30 02:12:39
> > > @@ -56,7 +56,7 @@
> > >  	// read local parameter settings
> > >          try {
> > >              Configuration conf =
> > > -		this.getConfiguration(param.getParameter("descriptor", (String) this.settings.get("descriptor")),
> > > +		this.getConfiguration(param.getParameter("descriptor", (String) this.settings.get("descriptor")),
resolver,
> > >  				      param.getParameterAsBoolean("reloadable",reloadable));
> > >
> > >              datasource = this.getDataSource(conf);
> > > Index: DatabaseAuthenticatorAction.java
> > > ===================================================================
> > > RCS file: /home/cvspublic/xml-cocoon2/src/org/apache/cocoon/acting/DatabaseAuthenticatorAction.java,v
> > > retrieving revision 1.3.2.12
> > > diff -u -r1.3.2.12 DatabaseAuthenticatorAction.java
> > > --- DatabaseAuthenticatorAction.java	2001/10/25 19:31:24	1.3.2.12
> > > +++ DatabaseAuthenticatorAction.java	2001/11/30 02:12:39
> > > @@ -78,7 +78,7 @@
> > >          // read local settings
> > >          try {
> > >              Configuration conf = this.getConfiguration (
> > > -                    parameters.getParameter ("descriptor", (String) this.settings.get("descriptor")),
> > > +                    parameters.getParameter ("descriptor", (String) this.settings.get("descriptor")),
resolver,
> > >                      parameters.getParameterAsBoolean("reloadable",reloadable));
> > >              boolean cs = true;
> > >              String create_session = parameters.getParameter ("create-session",
> > > Index: DatabaseDeleteAction.java
> > > ===================================================================
> > > RCS file: /home/cvspublic/xml-cocoon2/src/org/apache/cocoon/acting/DatabaseDeleteAction.java,v
> > > retrieving revision 1.3.2.9
> > > diff -u -r1.3.2.9 DatabaseDeleteAction.java
> > > --- DatabaseDeleteAction.java	2001/10/11 08:52:03	1.3.2.9
> > > +++ DatabaseDeleteAction.java	2001/11/30 02:12:39
> > > @@ -54,7 +54,7 @@
> > >  	// read local parameter settings
> > >          try {
> > >              Configuration conf =
> > > -		this.getConfiguration(param.getParameter("descriptor", (String) this.settings.get("descriptor")),
> > > +		this.getConfiguration(param.getParameter("descriptor", (String) this.settings.get("descriptor")),
resolver,
> > >  				      param.getParameterAsBoolean("reloadable",reloadable));
> > >
> > >              String query = this.getDeleteQuery(conf);
> > > Index: DatabaseUpdateAction.java
> > > ===================================================================
> > > RCS file: /home/cvspublic/xml-cocoon2/src/org/apache/cocoon/acting/DatabaseUpdateAction.java,v
> > > retrieving revision 1.3.2.10
> > > diff -u -r1.3.2.10 DatabaseUpdateAction.java
> > > --- DatabaseUpdateAction.java	2001/10/11 08:52:03	1.3.2.10
> > > +++ DatabaseUpdateAction.java	2001/11/30 02:12:39
> > > @@ -51,7 +51,7 @@
> > >  	// read local parameter settings
> > >          try {
> > >              Configuration conf =
> > > -		this.getConfiguration(param.getParameter("descriptor", (String) this.settings.get("descriptor")),
> > > +		this.getConfiguration(param.getParameter("descriptor", (String) this.settings.get("descriptor")),
resolver,
> > >  				      param.getParameterAsBoolean("reloadable",reloadable));
> > >
> > >              String query = this.getUpdateQuery(conf);
> > > Index: FormValidatorAction.java
> > > ===================================================================
> > > RCS file: /home/cvspublic/xml-cocoon2/src/org/apache/cocoon/acting/FormValidatorAction.java,v
> > > retrieving revision 1.4.2.8
> > > diff -u -r1.4.2.8 FormValidatorAction.java
> > > --- FormValidatorAction.java	2001/10/11 08:52:03	1.4.2.8
> > > +++ FormValidatorAction.java	2001/11/30 02:12:39
> > > @@ -81,7 +81,7 @@
> > >  	// read local settings
> > >          try {
> > >              Configuration conf = this.getConfiguration (
> > > -                    parameters.getParameter ("descriptor", (String) this.settings.get("descriptor")),
> > > +                    parameters.getParameter ("descriptor", (String) this.settings.get("descriptor")),
resolver,
> > >  		    parameters.getParameterAsBoolean("reloadable", reloadable));
> > >              String valstr = parameters.getParameter ("validate", (String)
settings.get("validate",""));
> > >              String valsetstr = parameters.getParameter ("validate-set", (String)
settings.get("validate-set",""));
> > > Index: SessionValidatorAction.java
> > > ===================================================================
> > > RCS file: /home/cvspublic/xml-cocoon2/src/org/apache/cocoon/acting/SessionValidatorAction.java,v
> > > retrieving revision 1.3.2.9
> > > diff -u -r1.3.2.9 SessionValidatorAction.java
> > > --- SessionValidatorAction.java	2001/10/11 08:52:03	1.3.2.9
> > > +++ SessionValidatorAction.java	2001/11/30 02:12:39
> > > @@ -83,7 +83,7 @@
> > >
> > >          try {
> > >              Configuration conf = this.getConfiguration (
> > > -                    parameters.getParameter ("descriptor", (String) this.settings.get("descriptor")),
> > > +                    parameters.getParameter ("descriptor", (String) this.settings.get("descriptor")),
resolver,
> > >              parameters.getParameterAsBoolean("reloadable",reloadable));
> > >
> > >              String valsetstr = parameters.getParameter ( "validate-set", (String)
settings.get("validate-set") );
> > >
> >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> > > For additional commands, email: cocoon-dev-help@xml.apache.org
> >
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email: cocoon-dev-help@xml.apache.org

Mime
View raw message