[Seaside] TFFiler: creates file containers to store external files in Monticello

AxiNat tibabenfortlapalanca at gmail.com
Wed Feb 9 13:09:42 UTC 2011


Hi Tony,

My case is that I have to call a gnu-smalltalk interpreter from Pharo, and I
need to specify which image is the interpreter to run, so at one point I
need the image local file path, see the following line:

(...) 'gst -I ', (STFGSTImages fullRestorePathFor: 'myGSTImage.im')

I know you can do that without using TFFiler, but as that's the package that
restores my files into the file system I thought it'd be nice if it could
also tell you where did it store them in case you need to access them from
outside Pharo, as in my case.

I haven't tried it yet, but this afternoon I'll give you some feedback.
Thanks a lot again!

Bernat.

2011/2/9 Tony Fleig <tony.fleig at gmail.com>

> Hi Bernat,
>
> Ok. I have checked in a new version of TFFiler to
> http://www.squeaksource.com/TFFiler.html with the following comment:
>
> Added methods #fullRestorePathFor:, #fullRestorePathFor:In:, and
> #targetDirectoryPath to the generated file container class. Added
> comments in generated methods. Minor refactoring.
>
> I hope it does what you need.
>
> There are three new methods in the file container classes that are
> created by TFFiler:
>
> #targetDirectoryPath
>    answers the path relative to the default directory into which
> files will be placed by #restoreDirectory.
>
> #fullRestorePathFor: aRestorePath
>    answers the default full file system path that will be used to
> restore the file identified by the aRestorePath.
>
> #fullRestorePathFor: aRestorePath In: aDirectoryPath
>    answers the full file system path that will be used to restore the
> file identified by aRestorePath when the file is restored to
> aDirectoryPath.
>
> I'm curious as to what makes these methods useful to you.
>
> Regards,
> TF
>
> Blog: http://www.tonyfleig.com/smallthoughts
>
> On Wed, Feb 9, 2011 at 12:37 AM, AxiNat <tibabenfortlapalanca at gmail.com>
> wrote:
> > Hi Tony,
> > Exactly, I meant the full system path of a file that's stored in a
> container
> > class, something like:
> >
> > localFilePathFor: aFileName
> > ^  (FileDirectory default / relativePathToFile / aFileName) pathName
> >
> > I'm using TFFiler in my app and it works very well, thanks again!
> > Cheers,
> > Bernat.
> > 2011/2/8 Tony Fleig <tony.fleig at gmail.com>
> >>
> >> Hi Bernat,
> >>
> >> You mean the full system path of a file that is stored in a container
> >> class? That is, the location to which the file would be restored by
> >> #restoreDirectory?
> >>
> >> Or do you mean the full system path of an arbitrary file in the file
> >> system?
> >>
> >> TF
> >>
> >> On Mon, Feb 7, 2011 at 4:44 AM, AxiNat <tibabenfortlapalanca at gmail.com>
> >> wrote:
> >> > I'd like to suggest a feature, some method like:
> >> > TFFiler class >> fullPathOf: aFileName
> >> > That returns the full system path for a given file.
> >> > Cheers,
> >> > Bernat.
> >> > 2011/2/7 AxiNat <tibabenfortlapalanca at gmail.com>
> >> >>
> >> >> Tony, great work!
> >> >> I'll be using this one in production too :)
> >> >> Bernat Romagosa.
> >> >> 2011/2/4 Sven Van Caekenberghe <sven at beta9.be>
> >> >>>
> >> >>> Great idea Tony, this is indeed quite useful.
> >> >>>
> >> >>> Thanks (again) for sharing this and for doing all the documentation
> >> >>> work!
> >> >>>
> >> >>> Sven
> >> >>>
> >> >>> On 04 Feb 2011, at 19:17, Tony Fleig wrote:
> >> >>>
> >> >>> > I've published a tool I'm using called TFFiler.
> >> >>> >
> >> >>> > My problem was that I had a number of external files that were
> >> >>> > required for my Seaside web application. These were CSS,
> Javascript,
> >> >>> > and image files that had to be placed in a specific directory tree
> >> >>> > structure. When I moved my web app to another system, I always had
> >> >>> > to
> >> >>> > remember to reconstruct the external directory tree. Over time,
> the
> >> >>> > directory tree got larger and more complex.
> >> >>> >
> >> >>> > For deployment, I wanted the files to be served by Apache and not
> >> >>> > the
> >> >>> > Seaside ExternalFileLibrary. (ExternalFileLibrary was the most
> >> >>> > convenient approach during development.) This meant the directory
> >> >>> > tree
> >> >>> > should be moved to a location other than the Pharo Resources
> >> >>> > directory, which was the most convenient location during
> >> >>> > development.
> >> >>> >
> >> >>> > The current version of Monticello does not provide a way to save
> >> >>> > external files with a project. TFFiler addresses this shortcoming.
> >> >>> > Now
> >> >>> > when I load my project from Monticello the necessary external
> files
> >> >>> > are deployed automatically.
> >> >>> >
> >> >>> > Maybe someone else will find this useful as well.
> >> >>> >
> >> >>> > http://www.tonyfleig.com/smallthoughts/blog/tffiler
> >> >>> > http://www.squeaksource.com/TFFiler
> >> >>> >
> >> >>> > Regards,
> >> >>> > TF
> >> >>> > _______________________________________________
> >> >>> > seaside mailing list
> >> >>> > seaside at lists.squeakfoundation.org
> >> >>> >
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
> >> >>>
> >> >>> _______________________________________________
> >> >>> seaside mailing list
> >> >>> seaside at lists.squeakfoundation.org
> >> >>> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
> >> >>
> >> >
> >> >
> >> > _______________________________________________
> >> > seaside mailing list
> >> > seaside at lists.squeakfoundation.org
> >> > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
> >> >
> >> >
> >> _______________________________________________
> >> seaside mailing list
> >> seaside at lists.squeakfoundation.org
> >> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
> >
> >
> > _______________________________________________
> > seaside mailing list
> > seaside at lists.squeakfoundation.org
> > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
> >
> >
> _______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/seaside/attachments/20110209/277dbfb0/attachment.htm


More information about the seaside mailing list