Re: Troubles testing Turbine 2.2 b2 for l10n

2001-11-19 Thread Jason van Zyl

On 11/19/01 1:01 PM, "Santiago Gala" <[EMAIL PROTECTED]> wrote:

> En lun, 2001-11-19 a 17:37, Jason van Zyl escribió:
>> Send me this patch as an attachment and I will apply it right now if
> it will
>> let jetspeed use Turbine from CVS. We can deal with the Extended properties
>> class and the general turbine 3 issue later. You guys needs this now so I
>> will apply it.
>>  
> 
> Here it is. I will check if we have some remaining issue wrt turbine,
> and report.

Patch is applied.

> Thanks.
> 

-- 

jvz.

Jason van Zyl

http://tambora.zenplex.org
http://jakarta.apache.org/turbine
http://jakarta.apache.org/velocity
http://jakarta.apache.org/alexandria
http://jakarta.apache.org/commons



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Troubles testing Turbine 2.2 b2 for l10n

2001-11-19 Thread Santiago Gala

En lun, 2001-11-19 a 17:37, Jason van Zyl escribió:
> Send me this patch as an attachment and I will apply it right now if
it will
> let jetspeed use Turbine from CVS. We can deal with the Extended properties
> class and the general turbine 3 issue later. You guys needs this now so I
> will apply it.
>  

Here it is. I will check if we have some remaining issue wrt turbine,
and report.

Thanks.


Index: src/java/org/apache/turbine/services/resources/TurbineResourceService.java
===
RCS file: 
/home/cvs/jakarta-turbine-2/src/java/org/apache/turbine/services/resources/TurbineResourceService.java,v
retrieving revision 1.4
diff -u -r1.4 TurbineResourceService.java
--- src/java/org/apache/turbine/services/resources/TurbineResourceService.java  
2001/09/25 02:18:17 1.4
+++ src/java/org/apache/turbine/services/resources/TurbineResourceService.java  
+2001/11/19 17:43:35
@@ -228,6 +228,9 @@
 return null;
 }
 
+//Get the full ResourceService (we could be in a subset instance)
+ResourceService top = TurbineResources.getService();
+
 int begin = -1;
 int end = -1;
 int prec = 0-END_TOKEN.length();
@@ -240,9 +243,9 @@
 {
 result.append(base.substring(prec+END_TOKEN.length(),begin));
 variable = base.substring(begin+START_TOKEN.length(),end);
-if (configuration.get(variable)!=null) 
+if (top.getString(variable)!=null) 
 {
-result.append(configuration.get(variable));
+result.append(top.getString(variable));
 }
 prec=end;
 }



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 


Re: Troubles testing Turbine 2.2 b2 for l10n

2001-11-19 Thread Jason van Zyl

On 11/19/01 11:21 AM, "Santiago Gala" <[EMAIL PROTECTED]> wrote:

> En dom, 2001-11-18 a 18:45, Ignacio J. Ortega escribió:
>> I think i have more or less a explanation of the problem..
>> 
>> When the resource service is asked to give a resources subset, the
>> "System" resources (applicationRoot, webappRoot and others but basically
>> this 2 ) are hidden and the interpolate method get null when trying to
>> use the configuration passed as source for that variables.. no idea
>> about possible fixes .. in the way it's done right now the only
>> workaroud i see is to not use the same subsetted configuration when
>> trying to find the interpolation variable.., maybe to store this vars
>> inside the object (  VariableResources flavour ) in another HAshTable,
>> or pass around the complete config..
>> 
> 
> Yes, the problem is this one. I posted it to the turbine-list (or maybe
> it was to Jason only) in September.
> 
> I have two^H^H^Hthree possible solutions:
> 
> 1- The simple one, only works for turbine-2: apply this patch:
> 
> Index:
> src/java/org/apache/turbine/services/resources/TurbineResourceService.java
> ===
> RCS file:
> /home/cvs/jakarta-turbine-2/src/java/org/apache/turbine/services/resources/Tur
> bineResourceService.java,v
> retrieving revision 1.4
> diff -u -r1.4 TurbineResourceService.java
> ---
> src/java/org/apache/turbine/services/resources/TurbineResourceService.java
200
> 1/09/25 02:18:171.4
> +++
> src/java/org/apache/turbine/services/resources/TurbineResourceService.java
200
> 1/11/19 15:54:01
> @@ -228,6 +228,9 @@
>return null;
>} 
>
> +//Get the full ResourceService (we could be in a subset
> instance)
> +ResourceService top = TurbineResources.getService();
> +
>int begin = -1;
>int end = -1;
>int prec = 0-END_TOKEN.length();
> @@ -240,9 +243,9 @@
>{
>   
> result.append(base.substring(prec+END_TOKEN.length(),begin));
>variable = base.substring(begin+START_TOKEN.length(),end);
> -if (configuration.get(variable)!=null)
> +if (top.getString(variable)!=null)
>{
> -result.append(configuration.get(variable));
> +result.append(top.getString(variable));
>}
>prec=end;
>}

Santiago,

Send me this patch as an attachment and I will apply it right now if it will
let jetspeed use Turbine from CVS. We can deal with the Extended properties
class and the general turbine 3 issue later. You guys needs this now so I
will apply it.
 
> This patch is good for Turbine-2. It basically says: "interpolate always
> in the *root* resources". It is not good for commons/turbine-3 because
> it introduces a turbine dependency.
> 
> 2- Make that a ExtendedProperties (turbine-3/commons) has an instance
> var called, say, parent. When subset is used, the parent is stored
> there. Then, interpolate would use something like (it is really more
> complex, keep on reading):
> 
> if( null != parent )
> {
>  parent.get(...)
> } else {
>  this.get(...)
> }
> The semantics could be made parent-first (i.e.the parent chain is looked
> first, until a result is found *or* parent is null), or child-first
> (i.e., if the variable gets a value in the children, this value is
> returned, else parent is tried until parent is null).
> 
> The results can be *very* different. For instance ${rooDir} would pick
> the high level one in parent-first, but it would pick
> services.network.rootDir=xxx in child first, if we are asking for a
> "services.network" subset.
> 
> 3- Remove the "subset()" method, i.e. don't offer this feature to the
> users of the class, and keep interpolation. This could be a reasonable
> possibility. We could stop using this feature, and rewrite the offending
> services.
> 
> The first patch is a reasonable workaround for turbine-2, but it is not
> acceptable for turbine-3/commons. It is the one I sent Jason.
> 
> I hope I have summarized correctly the issues here.
> 
> I could implement and test the second alternative for turbine-3/commons,
> but nobody really asked. I am interested that this class work, we are
> using it a lot.
> 
> 
> 
> 
> --
> To unsubscribe, e-mail:   
> For additional commands, e-mail: 

-- 

jvz.

Jason van Zyl

http://tambora.zenplex.org
http://jakarta.apache.org/turbine
http://jakarta.apache.org/velocity
http://jakarta.apache.org/alexandria
http://jakarta.apache.org/commons



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Troubles testing Turbine 2.2 b2 for l10n

2001-11-19 Thread Santiago Gala

En dom, 2001-11-18 a 18:45, Ignacio J. Ortega escribió:
> I think i have more or less a explanation of the problem..
> 
> When the resource service is asked to give a resources subset, the
> "System" resources (applicationRoot, webappRoot and others but basically
> this 2 ) are hidden and the interpolate method get null when trying to
> use the configuration passed as source for that variables.. no idea
> about possible fixes .. in the way it's done right now the only
> workaroud i see is to not use the same subsetted configuration when
> trying to find the interpolation variable.., maybe to store this vars
> inside the object (  VariableResources flavour ) in another HAshTable,
> or pass around the complete config.. 
> 

Yes, the problem is this one. I posted it to the turbine-list (or maybe
it was to Jason only) in September.

I have two^H^H^Hthree possible solutions:

1- The simple one, only works for turbine-2: apply this patch:

Index:
src/java/org/apache/turbine/services/resources/TurbineResourceService.java
===
RCS file:
/home/cvs/jakarta-turbine-2/src/java/org/apache/turbine/services/resources/TurbineResourceService.java,v
retrieving revision 1.4
diff -u -r1.4 TurbineResourceService.java
---
src/java/org/apache/turbine/services/resources/TurbineResourceService.java  
2001/09/25 02:18:17 1.4
+++
src/java/org/apache/turbine/services/resources/TurbineResourceService.java  
2001/11/19 15:54:01
@@ -228,6 +228,9 @@
 return null;
 }
 
+//Get the full ResourceService (we could be in a subset
instance)
+ResourceService top = TurbineResources.getService();
+
 int begin = -1;
 int end = -1;
 int prec = 0-END_TOKEN.length();
@@ -240,9 +243,9 @@
 {

result.append(base.substring(prec+END_TOKEN.length(),begin));
 variable = base.substring(begin+START_TOKEN.length(),end);
-if (configuration.get(variable)!=null) 
+if (top.getString(variable)!=null) 
 {
-result.append(configuration.get(variable));
+result.append(top.getString(variable));
 }
 prec=end;
 }

This patch is good for Turbine-2. It basically says: "interpolate always
in the *root* resources". It is not good for commons/turbine-3 because
it introduces a turbine dependency.

2- Make that a ExtendedProperties (turbine-3/commons) has an instance
var called, say, parent. When subset is used, the parent is stored
there. Then, interpolate would use something like (it is really more
complex, keep on reading):

if( null != parent ) 
{
   parent.get(...)
} else {
   this.get(...)
}
The semantics could be made parent-first (i.e.the parent chain is looked
first, until a result is found *or* parent is null), or child-first
(i.e., if the variable gets a value in the children, this value is
returned, else parent is tried until parent is null).

The results can be *very* different. For instance ${rooDir} would pick
the high level one in parent-first, but it would pick
services.network.rootDir=xxx in child first, if we are asking for a
"services.network" subset.

3- Remove the "subset()" method, i.e. don't offer this feature to the
users of the class, and keep interpolation. This could be a reasonable
possibility. We could stop using this feature, and rewrite the offending
services.

The first patch is a reasonable workaround for turbine-2, but it is not
acceptable for turbine-3/commons. It is the one I sent Jason.

I hope I have summarized correctly the issues here.

I could implement and test the second alternative for turbine-3/commons,
but nobody really asked. I am interested that this class work, we are
using it a lot.




--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Troubles testing Turbine 2.2 b2 for l10n

2001-11-18 Thread Ignacio J. Ortega

I think i have more or less a explanation of the problem..

When the resource service is asked to give a resources subset, the
"System" resources (applicationRoot, webappRoot and others but basically
this 2 ) are hidden and the interpolate method get null when trying to
use the configuration passed as source for that variables.. no idea
about possible fixes .. in the way it's done right now the only
workaroud i see is to not use the same subsetted configuration when
trying to find the interpolation variable.., maybe to store this vars
inside the object (  VariableResources flavour ) in another HAshTable,
or pass around the complete config.. 

Saludos ,
Ignacio J. Ortega


> -Mensaje original-
> De: Jason van Zyl [mailto:[EMAIL PROTECTED]]
> Enviado el: domingo 18 de noviembre de 2001 3:52
> Para: Jetspeed Developers List
> Asunto: Re: Troubles testing Turbine 2.2 b2 for l10n
> 
> 
> On 11/17/01 9:17 PM, "Ignacio J. Ortega" <[EMAIL PROTECTED]> wrote:
> 
> > A brief explanation on how this works, and where is broken 
> will be good
> > ;)
> 
> Yes, that would be good. I forgot about the patch. My usual mode of
> operation is to look at a patch and if upon a cursory glance 
> it doesn't look
> right to me it falls by the way side. My fault as I should have looked
> harder at it.
> 
> I probably didn't understand how the variable resources was 
> being used in
> Jetspeed. If you describe again what the problem is I will 
> try to fix it.
> 
> Is this the only problem with the CVS 2.x code? I'm also interested in
> getting Jetspeed working with the latest code, I just always 
> get bogged
> down. Again my apologies.
>  
> > Saludos ,
> > Ignacio J. Ortega
> > 
> > 
> >> -Mensaje original-
> >> De: Santiago Gala [mailto:[EMAIL PROTECTED]]
> >> Enviado el: domingo 18 de noviembre de 2001 2:44
> >> Para: Jetspeed Developers List
> >> Asunto: Re: Troubles testing Turbine 2.2 b2 for l10n
> >> 
> >> 
> >> Ignacio J. Ortega wrote:
> >> 
> >>> Hola a todos:
> >>> 
> >>> As seems usual here i'm having troubles trying to got run
> >> working with
> >>> Latest turbine from CVS and jetspeed, as it seems the 
> l10n tool is on
> >>> turbine from more recent date than the actual turbine in lib
> >> dir.., but
> >>> it seems that VAriableResources are not working that is i.e the
> >>> CastorRegistryService does not find the registry.xml 
> file, because it
> >>> use a $(webapp.dir) in the path for the xml file.. anyone
> >> can helpme a
> >>> bit and try to get this working?
> >>> 
> >> I'll send you the patch tomorrow. I don't have it here right now.
> >> 
> >> VariableResources has a problem. I have it patched in my 
> local copy.
> >>  Jason also has the patch for this stuff.
> >> 
> >> 
> >> 
> >> 
> >> --
> >> To unsubscribe, e-mail:
> > <mailto:[EMAIL PROTECTED]>
> > For additional commands, e-mail:
> > <mailto:[EMAIL PROTECTED]>
> > 
> > 
> > --
> > To unsubscribe, e-mail:   
<mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>

-- 

jvz.

Jason van Zyl

http://tambora.zenplex.org
http://jakarta.apache.org/turbine
http://jakarta.apache.org/velocity
http://jakarta.apache.org/alexandria
http://jakarta.apache.org/commons



--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>




RE: Troubles testing Turbine 2.2 b2 for l10n

2001-11-17 Thread Ignacio J. Ortega

some references
<http://marc.theaimsgroup.com/?l=jetspeed-dev&w=2&r=1&s=VariableResource
s&q=b>

Saludos ,
Ignacio J. Ortega


> -Mensaje original-
> De: Jason van Zyl [mailto:[EMAIL PROTECTED]]
> Enviado el: domingo 18 de noviembre de 2001 3:52
> Para: Jetspeed Developers List
> Asunto: Re: Troubles testing Turbine 2.2 b2 for l10n
> 
> 
> On 11/17/01 9:17 PM, "Ignacio J. Ortega" <[EMAIL PROTECTED]> wrote:
> 
> > A brief explanation on how this works, and where is broken 
> will be good
> > ;)
> 
> Yes, that would be good. I forgot about the patch. My usual mode of
> operation is to look at a patch and if upon a cursory glance 
> it doesn't look
> right to me it falls by the way side. My fault as I should have looked
> harder at it.
> 
> I probably didn't understand how the variable resources was 
> being used in
> Jetspeed. If you describe again what the problem is I will 
> try to fix it.
> 
> Is this the only problem with the CVS 2.x code? I'm also interested in
> getting Jetspeed working with the latest code, I just always 
> get bogged
> down. Again my apologies.
>  
> > Saludos ,
> > Ignacio J. Ortega
> > 
> > 
> >> -----Mensaje original-
> >> De: Santiago Gala [mailto:[EMAIL PROTECTED]]
> >> Enviado el: domingo 18 de noviembre de 2001 2:44
> >> Para: Jetspeed Developers List
> >> Asunto: Re: Troubles testing Turbine 2.2 b2 for l10n
> >> 
> >> 
> >> Ignacio J. Ortega wrote:
> >> 
> >>> Hola a todos:
> >>> 
> >>> As seems usual here i'm having troubles trying to got run
> >> working with
> >>> Latest turbine from CVS and jetspeed, as it seems the 
> l10n tool is on
> >>> turbine from more recent date than the actual turbine in lib
> >> dir.., but
> >>> it seems that VAriableResources are not working that is i.e the
> >>> CastorRegistryService does not find the registry.xml 
> file, because it
> >>> use a $(webapp.dir) in the path for the xml file.. anyone
> >> can helpme a
> >>> bit and try to get this working?
> >>> 
> >> I'll send you the patch tomorrow. I don't have it here right now.
> >> 
> >> VariableResources has a problem. I have it patched in my 
> local copy.
> >>  Jason also has the patch for this stuff.
> >> 
> >> 
> >> 
> >> 
> >> --
> >> To unsubscribe, e-mail:
> > <mailto:[EMAIL PROTECTED]>
> > For additional commands, e-mail:
> > <mailto:[EMAIL PROTECTED]>
> > 
> > 
> > --
> > To unsubscribe, e-mail:   
<mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>

-- 

jvz.

Jason van Zyl

http://tambora.zenplex.org
http://jakarta.apache.org/turbine
http://jakarta.apache.org/velocity
http://jakarta.apache.org/alexandria
http://jakarta.apache.org/commons



--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>




Re: Troubles testing Turbine 2.2 b2 for l10n

2001-11-17 Thread Jason van Zyl

On 11/17/01 9:17 PM, "Ignacio J. Ortega" <[EMAIL PROTECTED]> wrote:

> A brief explanation on how this works, and where is broken will be good
> ;)

Yes, that would be good. I forgot about the patch. My usual mode of
operation is to look at a patch and if upon a cursory glance it doesn't look
right to me it falls by the way side. My fault as I should have looked
harder at it.

I probably didn't understand how the variable resources was being used in
Jetspeed. If you describe again what the problem is I will try to fix it.

Is this the only problem with the CVS 2.x code? I'm also interested in
getting Jetspeed working with the latest code, I just always get bogged
down. Again my apologies.
 
> Saludos ,
> Ignacio J. Ortega
> 
> 
>> -Mensaje original-
>> De: Santiago Gala [mailto:[EMAIL PROTECTED]]
>> Enviado el: domingo 18 de noviembre de 2001 2:44
>> Para: Jetspeed Developers List
>> Asunto: Re: Troubles testing Turbine 2.2 b2 for l10n
>> 
>> 
>> Ignacio J. Ortega wrote:
>> 
>>> Hola a todos:
>>> 
>>> As seems usual here i'm having troubles trying to got run
>> working with
>>> Latest turbine from CVS and jetspeed, as it seems the l10n tool is on
>>> turbine from more recent date than the actual turbine in lib
>> dir.., but
>>> it seems that VAriableResources are not working that is i.e the
>>> CastorRegistryService does not find the registry.xml file, because it
>>> use a $(webapp.dir) in the path for the xml file.. anyone
>> can helpme a
>>> bit and try to get this working?
>>> 
>> I'll send you the patch tomorrow. I don't have it here right now.
>> 
>> VariableResources has a problem. I have it patched in my local copy.
>>  Jason also has the patch for this stuff.
>> 
>> 
>> 
>> 
>> --
>> To unsubscribe, e-mail:
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
> 
> 
> --
> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

-- 

jvz.

Jason van Zyl

http://tambora.zenplex.org
http://jakarta.apache.org/turbine
http://jakarta.apache.org/velocity
http://jakarta.apache.org/alexandria
http://jakarta.apache.org/commons



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>




RE: Troubles testing Turbine 2.2 b2 for l10n

2001-11-17 Thread Ignacio J. Ortega

A brief explanation on how this works, and where is broken will be good
;)

Saludos ,
Ignacio J. Ortega


> -Mensaje original-
> De: Santiago Gala [mailto:[EMAIL PROTECTED]]
> Enviado el: domingo 18 de noviembre de 2001 2:44
> Para: Jetspeed Developers List
> Asunto: Re: Troubles testing Turbine 2.2 b2 for l10n
> 
> 
> Ignacio J. Ortega wrote:
> 
> >Hola a todos:
> >
> >As seems usual here i'm having troubles trying to got run 
> working with
> >Latest turbine from CVS and jetspeed, as it seems the l10n tool is on
> >turbine from more recent date than the actual turbine in lib 
> dir.., but
> >it seems that VAriableResources are not working that is i.e the
> >CastorRegistryService does not find the registry.xml file, because it
> >use a $(webapp.dir) in the path for the xml file.. anyone 
> can helpme a
> >bit and try to get this working? 
> >
> I'll send you the patch tomorrow. I don't have it here right now.
> 
> VariableResources has a problem. I have it patched in my local copy. 
>  Jason also has the patch for this stuff.
> 
> 
> 
> 
> --
> To unsubscribe, e-mail:   
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>




Re: Troubles testing Turbine 2.2 b2 for l10n

2001-11-17 Thread Santiago Gala

Ignacio J. Ortega wrote:

>Hola a todos:
>
>As seems usual here i'm having troubles trying to got run working with
>Latest turbine from CVS and jetspeed, as it seems the l10n tool is on
>turbine from more recent date than the actual turbine in lib dir.., but
>it seems that VAriableResources are not working that is i.e the
>CastorRegistryService does not find the registry.xml file, because it
>use a $(webapp.dir) in the path for the xml file.. anyone can helpme a
>bit and try to get this working? 
>
I'll send you the patch tomorrow. I don't have it here right now.

VariableResources has a problem. I have it patched in my local copy. 
 Jason also has the patch for this stuff.




--
To unsubscribe, e-mail:   
For additional commands, e-mail: