[AWS] embedding resorces into an AWS

Pascal Obry p.obry@wanadoo.fr
Sat, 31 Jan 2004 12:24:59 +0100


Xabier,

 > we are working on the implementation of an electronic dictionary as a
 > browser-based application to be distributed on CD in a first version. We
 > are
 > using for that AWS because (1) it is based on Ada, (2) it offers a very
 > convenient way to separate server-side and client-side scripting (that is
 > good since we are planning for a future on-line version of the dictionary
 > too), and (3) it gives us a very convenient way also for the distribution
 > of
 > the product on CD. A prototype is already built and it works
 > satisfactorily.

That's a really nice AWS application!

 > We would like to distribute it as a single executable with all the
 > resources
 > embedded in it. Is it feasible and/or reasonable?

Well it depends. What are the size of the resources ? It is definitly ok to
have some megabytes of resources but a CD is 600 Mb!

 > The resources are XML documents for the dictionary entries and indexes,
 > XSLT
 > scripts that are processed at the server, and then HTML pages, images, CSS
 > stylesheets, JavaScript function files and so on.

All this is fine.

 > And, second question: although the resource tree has been built with
 > awsres and embedded into the excutable, the prototype doesn't work fine if
 > the actual resource files are not present in the directory, because, in
 > fact, the programs have not been coded with this in mind. Is this correct
 > or we are totally wrong? 

No it is correct, there is not need to code with the fact that resources are
embedded or not. The program should work the same. If really the resources
must be on the directory for your server to work it is a bug, please report
with a small reproducer.

 > Which is the correct way to do it?

As said, it is not needed to worry about the way resources are handled. It is
always possible to embed resources at the last moment when the server is fully
tested.

 > Does it mean that the Ada code must be different depending on whether you
 > want to embed the resources into the executable or not?

No. Of course this means that you must use the AWS.Resources.File
interface. This routine does know about resources and will check them before
looking at the file system. You can't use Ada.Text_IO with resources.

 > Is there any way to get an XML tree (or an internal file) from a
 > Strem_Element_Array, for example?

Not clear to me what you want to do here.

 > Sorry for so many questions, but we are a bit confused. Thanks in advance.

No problem.

Pascal.

-- 

--|------------------------------------------------------
--| Pascal Obry                           Team-Ada Member
--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE
--|------------------------------------------------------
--|         http://perso.wanadoo.fr/pascal.obry
--| "The best way to travel is by means of imagination"
--|
--| gpg --keyserver wwwkeys.pgp.net --recv-key C1082595