You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by Daniel Rall <dl...@finemaltcoding.com> on 2002/03/19 04:34:02 UTC
Re: [PATCH 2.2] TurbineVelocityService, UploadItem
Thanks for the patch. Turbine's services have actually been decoupled
from the Turbine core and are now available separately, in the
jarkarta-turbine-fulcrum CVS module. The coupled versions of the
services have been deprecated, and will no longer be maintained.
Bartek Walter <Ba...@man.poznan.pl> writes:
> These are two minor patches for Turbine 2.2:
>
> - in o.a.t.services.velocity.TurbineVelocityService.java: creation of
> VelocityContext beside RunData caused charset to be set to 8859_1 by
> default; now it is taken from TurbineResources; I found it useful for
> creating velocity-based emails from scheduled jobs.
>
> - in o.a.t.util.upload.FileItem.java: when saving a large file to target
> directory File.renameTo() was used; it failed if the temporary storage
> directory was on different volume that the target directory; now after
> the failure a raw copy is attempted.
>
> Can anyone check it in, please (if you consider it useful...;-)
>
> Regards,
> Bartek
>
> Index: TurbineVelocityService.java
> ===================================================================
> RCS file:
> /home/cvspublic/jakarta-turbine-2/src/java/org/apache/turbine/services/velocity/TurbineVelocityService.java,v
> retrieving revision 1.5
> diff -r1.5 TurbineVelocityService.java
> 89a90,91
> > import org.apache.turbine.services.resources.TurbineResources;
>>
> 414c416,417
> < charset = DEFAULT_CHAR_SET;
> ---
> > charset = TurbineResources.getString("locale.default.charset",DEFAULT_CHAR_SET);
>> // charset = DEFAULT_CHAR_SET;
> 419c422,423
> < charset = DEFAULT_CHAR_SET;
> ---
> > charset = TurbineResources.getString("locale.default.charset", DEFAULT_CHAR_SET);
>> // charset = DEFAULT_CHAR_SET;
> 441c445,446
> < encoding = null;
> ---
> > encoding = TurbineResources.getString("services.VelocityService.output.encoding", null);
>> // encoding = null;
>
> Index: FileItem.java
> ===================================================================
> RCS file:
> /home/cvspublic/jakarta-turbine-2/src/java/org/apache/turbine/util/upload/FileItem.java,v
> retrieving revision 1.3
> diff -r1.3 FileItem.java
> 430a431
> > File destFile = new File(file);
> 433,434c434,441
> < throw new Exception(
> < "Cannot write uploaded file to disk!");
> ---
> > FileWriter writer = null;
>> try {
>> writer = new FileWriter(file);
>> writer.write(getString());
>> } finally {
>> if (writer != null)
>> writer.close();
>> }
>
>
>
> --
> To unsubscribe, e-mail: <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: [PATCH 2.2] TurbineVelocityService, UploadItem
Posted by Daniel Rall <dl...@finemaltcoding.com>.
James Taylor <jt...@4lane.com> writes:
>> Sorry, I work on T2.1 and forgot about T2.2.
>> Should I resubmit these patches packaged for fulcrum?
>
> Absolutely, if the problems still exist in fulcrum's services. I am
> nearly certain that at least the second problem still exists, although
> it is in DefaultFileItem rather than FileItem. Regarding the first
> problem: the template engine services have changed a bit in fulcrum, so
> it may be fixed or it may require more digging.
What James said. Note that I took a look at the first patch and
didn't see a place to hang the code in the decoupled services package
(jakarta-turbine-fulcrum). If you would verify it would be much
appreciated.
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: [PATCH 2.2] TurbineVelocityService, UploadItem
Posted by James Taylor <jt...@4lane.com>.
> Sorry, I work on T2.1 and forgot about T2.2.
> Should I resubmit these patches packaged for fulcrum?
Absolutely, if the problems still exist in fulcrum's services. I am
nearly certain that at least the second problem still exists, although
it is in DefaultFileItem rather than FileItem. Regarding the first
problem: the template engine services have changed a bit in fulcrum, so
it may be fixed or it may require more digging.
-- jt
>
> Bartek
>
> >
> > Bartek Walter <Ba...@man.poznan.pl> writes:
> >
> > > These are two minor patches for Turbine 2.2:
> > >
> > > - in o.a.t.services.velocity.TurbineVelocityService.java: creation of
> > > VelocityContext beside RunData caused charset to be set to 8859_1 by
> > > default; now it is taken from TurbineResources; I found it useful for
> > > creating velocity-based emails from scheduled jobs.
> > >
> > > - in o.a.t.util.upload.FileItem.java: when saving a large file to target
> > > directory File.renameTo() was used; it failed if the temporary storage
> > > directory was on different volume that the target directory; now after
> > > the failure a raw copy is attempted.
> > >
> > > Can anyone check it in, please (if you consider it useful...;-)
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: [PATCH 2.2] TurbineVelocityService, UploadItem
Posted by Bartek Walter <Ba...@man.poznan.pl>.
On Mon, 18 Mar 2002, Daniel Rall wrote:
> Thanks for the patch. Turbine's services have actually been decoupled
> from the Turbine core and are now available separately, in the
> jarkarta-turbine-fulcrum CVS module. The coupled versions of the
> services have been deprecated, and will no longer be maintained.
Sorry, I work on T2.1 and forgot about T2.2.
Should I resubmit these patches packaged for fulcrum?
Bartek
>
> Bartek Walter <Ba...@man.poznan.pl> writes:
>
> > These are two minor patches for Turbine 2.2:
> >
> > - in o.a.t.services.velocity.TurbineVelocityService.java: creation of
> > VelocityContext beside RunData caused charset to be set to 8859_1 by
> > default; now it is taken from TurbineResources; I found it useful for
> > creating velocity-based emails from scheduled jobs.
> >
> > - in o.a.t.util.upload.FileItem.java: when saving a large file to target
> > directory File.renameTo() was used; it failed if the temporary storage
> > directory was on different volume that the target directory; now after
> > the failure a raw copy is attempted.
> >
> > Can anyone check it in, please (if you consider it useful...;-)
> >
> > Regards,
> > Bartek
> >
> > Index: TurbineVelocityService.java
> > ===================================================================
> > RCS file:
> > /home/cvspublic/jakarta-turbine-2/src/java/org/apache/turbine/services/velocity/TurbineVelocityService.java,v
> > retrieving revision 1.5
> > diff -r1.5 TurbineVelocityService.java
> > 89a90,91
> > > import org.apache.turbine.services.resources.TurbineResources;
> >>
> > 414c416,417
> > < charset = DEFAULT_CHAR_SET;
> > ---
> > > charset = TurbineResources.getString("locale.default.charset",DEFAULT_CHAR_SET);
> >> // charset = DEFAULT_CHAR_SET;
> > 419c422,423
> > < charset = DEFAULT_CHAR_SET;
> > ---
> > > charset = TurbineResources.getString("locale.default.charset", DEFAULT_CHAR_SET);
> >> // charset = DEFAULT_CHAR_SET;
> > 441c445,446
> > < encoding = null;
> > ---
> > > encoding = TurbineResources.getString("services.VelocityService.output.encoding", null);
> >> // encoding = null;
> >
> > Index: FileItem.java
> > ===================================================================
> > RCS file:
> > /home/cvspublic/jakarta-turbine-2/src/java/org/apache/turbine/util/upload/FileItem.java,v
> > retrieving revision 1.3
> > diff -r1.3 FileItem.java
> > 430a431
> > > File destFile = new File(file);
> > 433,434c434,441
> > < throw new Exception(
> > < "Cannot write uploaded file to disk!");
> > ---
> > > FileWriter writer = null;
> >> try {
> >> writer = new FileWriter(file);
> >> writer.write(getString());
> >> } finally {
> >> if (writer != null)
> >> writer.close();
> >> }
> >
> >
> >
> > --
> > To unsubscribe, e-mail: <ma...@jakarta.apache.org>
> > For additional commands, e-mail: <ma...@jakarta.apache.org>
>
> --
> To unsubscribe, e-mail: <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
>
---------------
Bartek Walter
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>