From f1e7639e6cc90dce115d3c6e492698e30b79a0f2 Mon Sep 17 00:00:00 2001 From: Jocelyn Fiat Date: Sat, 26 May 2012 00:04:01 +0300 Subject: [PATCH 01/11] Update examples/tutorial/step_1.wiki --- examples/tutorial/step_1.wiki | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/examples/tutorial/step_1.wiki b/examples/tutorial/step_1.wiki index 929b79fb..b21e12b0 100644 --- a/examples/tutorial/step_1.wiki +++ b/examples/tutorial/step_1.wiki @@ -1,4 +1,5 @@ -[[README.wiki|Back to tutorial index]] +Back to the [[README.wiki|index]] +or go to [[step_2.wiki|step 2]] = Tutorial Step 1 = * '''Goal''': learn how to get and install the Eiffel Web Framework @@ -18,5 +19,7 @@ For now, there is nothing specific to do. (Note: if you want to use the "http_client" library, you will need to do a few extra steps to eventually compile Eiffel Curl.) ----- -Back to the [[README.wiki|index]] | Go to [[step_2.wiki|step 2]] +Back to the [[README.wiki|index]] +or go to [[step_2.wiki|step 2]] + + From 4bd8a24478e5f93ddfe8c939a8a1ecc5fd1a9bf4 Mon Sep 17 00:00:00 2001 From: Jocelyn Fiat Date: Sat, 26 May 2012 00:05:06 +0300 Subject: [PATCH 02/11] Update examples/tutorial/step_2.wiki --- examples/tutorial/step_2.wiki | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/examples/tutorial/step_2.wiki b/examples/tutorial/step_2.wiki index ac597913..a19cc015 100644 --- a/examples/tutorial/step_2.wiki +++ b/examples/tutorial/step_2.wiki @@ -1,4 +1,5 @@ -[[README.wiki|Back to tutorial index]] +Back to the [[step_1.wiki|step 1]] +or go to [[step_3.wiki|step 3]] = Tutorial Step 2 = * '''Goal''': Build a simple Hello World application @@ -19,4 +20,7 @@ ** target "hello_custom" which uses almost the same code, but in addition, you can use the ewf.ini file to precise the port number (9999 for this example) ---- -Previous [[step_1|step 1]] | Go to [[step_3.wiki|step 3]] + +Back to the [[step_1.wiki|step 1]] +or go to [[step_3.wiki|step 3]] + From 2a781b908169a8d944ffa90e4de7cad3e242db3e Mon Sep 17 00:00:00 2001 From: Jocelyn Fiat Date: Sat, 26 May 2012 00:06:05 +0300 Subject: [PATCH 03/11] Update examples/tutorial/step_3.wiki --- examples/tutorial/step_3.wiki | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/examples/tutorial/step_3.wiki b/examples/tutorial/step_3.wiki index 12fee144..54df1a21 100644 --- a/examples/tutorial/step_3.wiki +++ b/examples/tutorial/step_3.wiki @@ -1,4 +1,7 @@ -[[README.wiki|Back to tutorial index]] +Back to the [[step_2.wiki|step 2]] +or go to [[step_4.wiki|step 4]] + +---- = Tutorial Step 3 = * '''Goal''': Build Hello $user application using form parameter as input @@ -11,5 +14,8 @@ * you will learn how to use the req: WSF_REQUEST argument ---- -Previous [[step_2|step 2]] | Go to [[step_4.wiki|step 4]] + +Back to the [[step_2.wiki|step 2]] +or go to [[step_4.wiki|step 4]] + From b37a2bd17f5b8149cb69158f2eb65076aebbc78c Mon Sep 17 00:00:00 2001 From: Jocelyn Fiat Date: Sat, 26 May 2012 00:07:09 +0300 Subject: [PATCH 04/11] Update examples/tutorial/step_4.wiki --- examples/tutorial/step_4.wiki | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/examples/tutorial/step_4.wiki b/examples/tutorial/step_4.wiki index f49c9e7d..b5227729 100644 --- a/examples/tutorial/step_4.wiki +++ b/examples/tutorial/step_4.wiki @@ -1,2 +1,13 @@ +Back to the [[step_3.wiki|step 3]] +or go to the [[README.wiki|index]] + +---- + = Tutorial Step 4 = + +---- + +Back to the [[step_3.wiki|step 3]] +or go to the [[README.wiki|index]] + From 4324b83cba196abaf04662cab9aca2ea8bda120a Mon Sep 17 00:00:00 2001 From: Jocelyn Fiat Date: Sat, 26 May 2012 00:08:28 +0300 Subject: [PATCH 05/11] fixed github wikitext usage --- examples/tutorial/README.wiki | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/examples/tutorial/README.wiki b/examples/tutorial/README.wiki index afc57639..72976e1a 100644 --- a/examples/tutorial/README.wiki +++ b/examples/tutorial/README.wiki @@ -1,21 +1,24 @@ = Eiffel Web Framework = == Why would you use the Eiffel Web Framework ? == + To enjoy the advantage of the Eiffel technology (language, DbC, methods, tools) To write once and run on any web server, on any platforms thanks to the notion of connector. == What is a connector? == + A connector is the layer between the underlying httpd server, and your application based on EWF. Currently, 3 connectors are available within EWF (but others are available outside). -­ CGI: the common CGI application (apache, iis, ...) -- FastCGI: on any server supporting libfcgi handling (apache, iis, ...) -- Nino: using the standalone Eiffel Web Nino server, you can run anywhere easily, and debug simply with EiffelStudio's debugger +*­ CGI: the common CGI application (apache, iis, ...) +* FastCGI: on any server supporting libfcgi handling (apache, iis, ...) +* Nino: using the standalone Eiffel Web Nino server, you can run anywhere easily, and debug simply with EiffelStudio's debugger Supporting a new connector is fairly simple, it just has to support the simple EWSGI specification which is really small. Then EWF will bring the power on top of it. So you can build your application and be sure you will be able to run it ... anywhere thanks to the conceіpt of connectors. == EWSGI specification == + EWF relies on a small core specification, named EWSGI (Eiffel Web Servєr Gateway Interface). It is very limited on purpose to allow building new connector very easily. @@ -23,7 +26,8 @@ For now, you just need to know EWF is compliant with EWSGI specification. = Tutorial = -Now let's discover the Eiffel Web Framework with this tutorial. +Now let's discover the Eiffel Web Framework with this tutorial: + # [[step_1.wiki|Step #1]]: You will learn first, how to get and install EWF. # [[step_2.wiki|Step #2]]: build a simple Hello World application # [[step_3.wiki|Step #3]]: use the parameter to build dynamic service From dafd8335d233a06ed1f7762429837e23ede95846 Mon Sep 17 00:00:00 2001 From: Jocelyn Fiat Date: Sat, 26 May 2012 00:10:20 +0300 Subject: [PATCH 06/11] Update examples/tutorial/step_1.wiki --- examples/tutorial/step_1.wiki | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/tutorial/step_1.wiki b/examples/tutorial/step_1.wiki index b21e12b0..9ffe1723 100644 --- a/examples/tutorial/step_1.wiki +++ b/examples/tutorial/step_1.wiki @@ -12,7 +12,7 @@ or go to [[step_2.wiki|step 2]] === From the source === * '''Requirement''': install [http://www.git-scm.org/ git] on your machine - git clone --recursive https://github.com/EiffelWebFramework/EWF.git ewf + $ git clone --recursive https://github.com/EiffelWebFramework/EWF.git ewf == Install EWF == For now, there is nothing specific to do. From 37a68dc778ac69bd11f7bb70534cf1f42a07976c Mon Sep 17 00:00:00 2001 From: Jocelyn Fiat Date: Sat, 26 May 2012 00:13:46 +0300 Subject: [PATCH 07/11] Update examples/tutorial/step_3.wiki --- examples/tutorial/step_3.wiki | 37 +++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/examples/tutorial/step_3.wiki b/examples/tutorial/step_3.wiki index 54df1a21..d45abfe4 100644 --- a/examples/tutorial/step_3.wiki +++ b/examples/tutorial/step_3.wiki @@ -12,6 +12,43 @@ or go to [[step_4.wiki|step 4]] == "hello" project == * Let's start from the "hello_custom" project * you will learn how to use the req: WSF_REQUEST argument +* See the hello project from [[step_3]] folder + +* The code looks like + + response (req: WSF_REQUEST): WSF_HTML_PAGE_RESPONSE + -- Computed response message. + do + --| It is now returning a WSF_HTML_PAGE_RESPONSE + --| Since it is easier for building html page + create Result.make + Result.set_title ("EWF tutorial / Hello World!") + --| Check if the request contains a parameter named "user" + --| this could be a query, or a form parameter + if attached req.string_item ("user") as f_user then + --| If yes, say hello world #name + Result.set_body ("Hello " + f_user.string + "!") + --| We should html encode this name + --| but to keep the example simple, we don't do that for now. + else + --| Otherwise, ask for name + Result.set_body ("[ +
+

Hello, what is your name?

+ + +
+ ]" + ) + end + --| note: + --| 1) Source of the parameter, we could have used + --| req.query_parameter ("user") to search only in the query string + --| req.form_parameter ("user") to search only in the form parameters + --| 2) response type + --| it could also have used WSF_PAGE_REPONSE, and build the html in the code + --| + end ---- From 3982c46ac439fda2e31f769852f1bda6ee2fe5a8 Mon Sep 17 00:00:00 2001 From: Jocelyn Fiat Date: Sat, 26 May 2012 00:14:32 +0300 Subject: [PATCH 08/11] Update examples/tutorial/step_3.wiki --- examples/tutorial/step_3.wiki | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/tutorial/step_3.wiki b/examples/tutorial/step_3.wiki index d45abfe4..973d398d 100644 --- a/examples/tutorial/step_3.wiki +++ b/examples/tutorial/step_3.wiki @@ -25,9 +25,9 @@ or go to [[step_4.wiki|step 4]] Result.set_title ("EWF tutorial / Hello World!") --| Check if the request contains a parameter named "user" --| this could be a query, or a form parameter - if attached req.string_item ("user") as f_user then + if attached req.string_item ("user") as l_user then --| If yes, say hello world #name - Result.set_body ("Hello " + f_user.string + "!") + Result.set_body ("Hello " + l_user + "!") --| We should html encode this name --| but to keep the example simple, we don't do that for now. else @@ -41,8 +41,8 @@ or go to [[step_4.wiki|step 4]] ]" ) end - --| note: - --| 1) Source of the parameter, we could have used + --| note: + --| 1) Source of the parameter, we could have used --| req.query_parameter ("user") to search only in the query string --| req.form_parameter ("user") to search only in the form parameters --| 2) response type From 8283979a1e387769c0617944ea1368193fe1cfc4 Mon Sep 17 00:00:00 2001 From: Jocelyn Fiat Date: Sat, 26 May 2012 00:17:27 +0300 Subject: [PATCH 09/11] cosmetic --- examples/tutorial/step_3.wiki | 62 +++++++++++++++++------------------ 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/examples/tutorial/step_3.wiki b/examples/tutorial/step_3.wiki index 973d398d..5b15a01f 100644 --- a/examples/tutorial/step_3.wiki +++ b/examples/tutorial/step_3.wiki @@ -16,39 +16,39 @@ or go to [[step_4.wiki|step 4]] * The code looks like - response (req: WSF_REQUEST): WSF_HTML_PAGE_RESPONSE - -- Computed response message. - do - --| It is now returning a WSF_HTML_PAGE_RESPONSE - --| Since it is easier for building html page - create Result.make - Result.set_title ("EWF tutorial / Hello World!") - --| Check if the request contains a parameter named "user" - --| this could be a query, or a form parameter - if attached req.string_item ("user") as l_user then - --| If yes, say hello world #name - Result.set_body ("Hello " + l_user + "!") - --| We should html encode this name - --| but to keep the example simple, we don't do that for now. - else - --| Otherwise, ask for name - Result.set_body ("[ -
-

Hello, what is your name?

- - -
- ]" - ) - end + response (req: WSF_REQUEST): WSF_HTML_PAGE_RESPONSE + -- Computed response message. + do + --| It is now returning a WSF_HTML_PAGE_RESPONSE + --| Since it is easier for building html page + create Result.make + Result.set_title ("EWF tutorial / Hello World!") + --| Check if the request contains a parameter named "user" + --| this could be a query, or a form parameter + if attached req.string_item ("user") as l_user then + --| If yes, say hello world #name + Result.set_body ("Hello " + l_user + "!") + --| We should html encode this name + --| but to keep the example simple, we don't do that for now. + else + --| Otherwise, ask for name + Result.set_body ("[ +
+

Hello, what is your name?

+ + +
+ ]" + ) + end --| note: --| 1) Source of the parameter, we could have used - --| req.query_parameter ("user") to search only in the query string - --| req.form_parameter ("user") to search only in the form parameters - --| 2) response type - --| it could also have used WSF_PAGE_REPONSE, and build the html in the code - --| - end + --| req.query_parameter ("user") to search only in the query string + --| req.form_parameter ("user") to search only in the form parameters + --| 2) response type + --| it could also have used WSF_PAGE_REPONSE, and build the html in the code + --| + end ---- From 5504175d007ca34ba572c50ea516cb2b11330757 Mon Sep 17 00:00:00 2001 From: Jocelyn Fiat Date: Sat, 26 May 2012 00:19:14 +0300 Subject: [PATCH 10/11] added eiffel code --- examples/tutorial/step_2.wiki | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/examples/tutorial/step_2.wiki b/examples/tutorial/step_2.wiki index a19cc015..77dc4ae7 100644 --- a/examples/tutorial/step_2.wiki +++ b/examples/tutorial/step_2.wiki @@ -1,11 +1,13 @@ Back to the [[step_1.wiki|step 1]] or go to [[step_3.wiki|step 3]] +---- + = Tutorial Step 2 = * '''Goal''': Build a simple Hello World application * '''Requirements''': ** know how to compile with Eiffel (EiffelStudio). -** [[step_1.wiki|Previous step]] completed +** [[step_1.wiki|Previous step]] completed == "hello" project == @@ -19,6 +21,28 @@ or go to [[step_3.wiki|step 3]] ** target "hello" provides a very simple implementation (But by default, it is using port 80 with Eiffel Web Nino, which might already be busy by other application) ** target "hello_custom" which uses almost the same code, but in addition, you can use the ewf.ini file to precise the port number (9999 for this example) +* Eiffel code + class + HELLO_APPLICATION + + inherit + WSF_DEFAULT_RESPONSE_SERVICE + + create + make_and_launch + + feature {NONE} -- Initialization + + response (req: WSF_REQUEST): WSF_PAGE_RESPONSE + -- Computed response message. + do + create Result.make + Result.put_string ("Hello World") + end + + end + + ---- Back to the [[step_1.wiki|step 1]] From fd73af2cf8a1e5ead981eee76801762da54c80a6 Mon Sep 17 00:00:00 2001 From: Jocelyn Fiat Date: Sat, 26 May 2012 00:21:31 +0300 Subject: [PATCH 11/11] Update examples/tutorial/step_3.wiki --- examples/tutorial/step_3.wiki | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/tutorial/step_3.wiki b/examples/tutorial/step_3.wiki index 5b15a01f..5ed8dd00 100644 --- a/examples/tutorial/step_3.wiki +++ b/examples/tutorial/step_3.wiki @@ -7,14 +7,14 @@ or go to [[step_4.wiki|step 4]] * '''Goal''': Build Hello $user application using form parameter as input * '''Requirements''': ** know how to compile with Eiffel (EiffelStudio). -** [[step_2.wiki|Previous step]] completed +** [[step_2.wiki|Previous step ]] completed == "hello" project == * Let's start from the "hello_custom" project * you will learn how to use the req: WSF_REQUEST argument -* See the hello project from [[step_3]] folder +* See the hello project from [[step_3|step #3]] folder -* The code looks like +* You can find code in [[step_3]] folder : response (req: WSF_REQUEST): WSF_HTML_PAGE_RESPONSE -- Computed response message.