[AWS] AWS Digest, Vol 56, Issue 4

Adrian Hoe 贺文耀 mailbox at adrianhoe.com
Thu Jan 21 14:53:43 CET 2010


Hi,

I have had a quick hack to support multiple css files etc in AWS.

I use AWS.Status.URI for the job.

Sorry for taking up the bandwidth. Thanks.


On Jan 21, 2010, at 7:00 PM, aws-request at lists.adacore.com wrote:

> Send AWS mailing list submissions to
> 	aws at lists.adacore.com
>
> To subscribe or unsubscribe via the World Wide Web, visit
> 	/no-more-mailman.html
> or, via email, send a message with subject or body 'help' to
> 	aws-request at lists.adacore.com
>
> You can reach the person managing the list at
> 	aws-owner at lists.adacore.com
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of AWS digest..."
>
>
> Today's Topics:
>
>   1. Re: AWS Digest, Vol 55, Issue 4 (Adrian Hoe ???)
>   2. Re: AWS Digest, Vol 55, Issue 4 (Adrian Hoe ???)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Thu, 21 Jan 2010 09:03:17 +0800
> From: Adrian Hoe ??? 	<mailbox at adrianhoe.com>
> Subject: Re: [AWS] AWS Digest, Vol 55, Issue 4
> To: aws at lists.adacore.com
> Message-ID: <433AD04B-2B5D-4CA5-A030-E1104AAD63CD at adrianhoe.com>
> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes
>
>
> On Dec 10, 2009, at 3:59 PM, aws-request at lists.adacore.com wrote:
>
>> Message: 6
>> Date: Wed, 9 Dec 2009 19:29:08 +0200
>> From: Tero Koskinen <tero.koskinen at iki.fi>
>> Subject: Re: [AWS] CSS style sheet
>> To: aws at lists.adacore.com
>> Message-ID: <20091209192908.3d9e2d22.tero.koskinen at iki.fi>
>> Content-Type: text/plain; charset=UTF-8
>>
>> Hi,
>>
>> On Wed, 09 Dec 2009 16:06:11 +0100 Pascal Obry wrote:
>>
>>> Le 09/12/2009 15:58, Adrian Hoe ??? a ?crit :
>>>> The page is displayed plain without any formating as defined in
>>>> css. I
>>>
>>> As Emmanuel as replied, you are probably missing a callback on your
>>> AWS
>>> server to serve this CSS.
>> [snip]
>>> So you need to provide some code for this.
>>>
>>>  return Response.File (...);
>>
>> For simple purposes (=one single CSS file), I usually use following
>> callback:
>> http://hg.stronglytyped.org/weblog/src/tip/src/view.adb#cl-254
>>
>>   function CSS (Request : in AWS.Status.Data) return
>> AWS.Response.Data
>>   is
>>   begin
>>      return AWS.Response.File (AWS.MIME.Text_CSS, Diary_CSS);
>>   end CSS;
>>
>> Where Diary_CSS is a string pointing to the stylesheet.
>>   Diary_CSS : constant String := "www/diary.css";
>>
>>
>>> Pascal.
>>
>> --  
>> Tero Koskinen <tero.koskinen at iki.fi>
>
>
>
> Thanks for your examples. A great repository with lots of examples. :P
>
> Looks like I have only three choices (after some fiddling):
>
> 1.) Hard code the css into the html template (not recommended).
>
> 2.) Put many different css files into an external server and hard code
> the url (not quite recommended).
>
> 3.) Put everything into one single css file and use a callback to
> respond to the requests.
>
> Is (3) the only way?
>
> Why can't AWS support multiple css requests? (Not to question the
> design but am curious why).
>
> What about script (javascript)?
> --
> "If you missed the rising sun and the morning dew, don't miss the
> beautiful sunset." -- Adrian Hoe inspired by Michal Nowak, June 15  
> 2004
> http://adrianhoe.com
> http://adrianhoe.net
>
>
>
>
> ------------------------------
>
> Message: 2
> Date: Thu, 21 Jan 2010 13:13:30 +0800
> From: Adrian Hoe ??? 	<mailbox at adrianhoe.com>
> Subject: Re: [AWS] AWS Digest, Vol 55, Issue 4
> To: aws at lists.adacore.com
> Message-ID: <830DD728-4538-4543-A2DE-C77105C60912 at adrianhoe.com>
> Content-Type: text/plain; charset=UTF-8; format=flowed; delsp=yes
>
> One more question:
>
> I have
>
> 	#header-logo {
> 		background: transparent url(images/logo1.png) no-repeat scroll
> center center;
> 		float: left;
> 		margin: 5px 15px 5px 20px;
> 	}
>
> 	#footer-logo {
> 		background: transparent url(images/logo2.png) no-repeat scroll
> center center;
> 		float: left;
> 		margin: 5px 15px 5px 20px;
>  	}
>
>
> in the style.css to load logo1.png and logo2.png. For a single css, I
> can use method as in Tero's example. How can I tell AWS where to look
> for the image files (*.png, *.gif, *.jpg, etc)? (return a path instead
> of a file). Let say my images are located at www/images and my css is
> in www/static.
>
> Thanks.
>
>
>
>
> On Jan 21, 2010, at 9:03 AM, Adrian Hoe ??? wrote:
>
>>
>> On Dec 10, 2009, at 3:59 PM, aws-request at lists.adacore.com wrote:
>>
>>> Message: 6
>>> Date: Wed, 9 Dec 2009 19:29:08 +0200
>>> From: Tero Koskinen <tero.koskinen at iki.fi>
>>> Subject: Re: [AWS] CSS style sheet
>>> To: aws at lists.adacore.com
>>> Message-ID: <20091209192908.3d9e2d22.tero.koskinen at iki.fi>
>>> Content-Type: text/plain; charset=UTF-8
>>>
>>> Hi,
>>>
>>> On Wed, 09 Dec 2009 16:06:11 +0100 Pascal Obry wrote:
>>>
>>>> Le 09/12/2009 15:58, Adrian Hoe ??? a ?crit :
>>>>> The page is displayed plain without any formating as defined in
>>>>> css. I
>>>>
>>>> As Emmanuel as replied, you are probably missing a callback on
>>>> your AWS
>>>> server to serve this CSS.
>>> [snip]
>>>> So you need to provide some code for this.
>>>>
>>>> return Response.File (...);
>>>
>>> For simple purposes (=one single CSS file), I usually use following
>>> callback:
>>> http://hg.stronglytyped.org/weblog/src/tip/src/view.adb#cl-254
>>>
>>>  function CSS (Request : in AWS.Status.Data) return
>>> AWS.Response.Data
>>>  is
>>>  begin
>>>     return AWS.Response.File (AWS.MIME.Text_CSS, Diary_CSS);
>>>  end CSS;
>>>
>>> Where Diary_CSS is a string pointing to the stylesheet.
>>>  Diary_CSS : constant String := "www/diary.css";
>>>
>>>
>>>> Pascal.
>>>
>>> -- 
>>> Tero Koskinen <tero.koskinen at iki.fi>
>>
>>
>>
>> Thanks for your examples. A great repository with lots of  
>> examples. :P
>>
>> Looks like I have only three choices (after some fiddling):
>>
>> 1.) Hard code the css into the html template (not recommended).
>>
>> 2.) Put many different css files into an external server and hard
>> code the url (not quite recommended).
>>
>> 3.) Put everything into one single css file and use a callback to
>> respond to the requests.
>>
>> Is (3) the only way?
>>
>> Why can't AWS support multiple css requests? (Not to question the
>> design but am curious why).
>>
>> What about script (javascript)?
>> --
>> "If you missed the rising sun and the morning dew, don't miss the
>> beautiful sunset." -- Adrian Hoe inspired by Michal Nowak, June 15
>> 2004
>> http://adrianhoe.com
>> http://adrianhoe.net
>>
>>
>
> --
> "If you missed the rising sun and the morning dew, don't miss the
> beautiful sunset." -- Adrian Hoe inspired by Michal Nowak, June 15  
> 2004
> http://adrianhoe.com
> http://adrianhoe.net
>
>
>
>
> ------------------------------
>
> _______________________________________________
> AWS mailing list
> AWS at lists.adacore.com
> /no-more-mailman.html
>
>
> End of AWS Digest, Vol 56, Issue 4
> **********************************
>

--
"If you missed the rising sun and the morning dew, don't miss the  
beautiful sunset." -- Adrian Hoe inspired by Michal Nowak, June 15 2004
http://adrianhoe.com
http://adrianhoe.net




More information about the AWS mailing list