From 15d12b86aa7063bcb2a97a57d3739eab3489211e Mon Sep 17 00:00:00 2001 From: oligot Date: Fri, 24 Aug 2012 02:54:47 -0700 Subject: [PATCH 01/38] Add support for Swagger --- Projects-new-suggestions.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Projects-new-suggestions.md b/Projects-new-suggestions.md index b7278fee..23e0a613 100644 --- a/Projects-new-suggestions.md +++ b/Projects-new-suggestions.md @@ -12,3 +12,9 @@ For any entry, please use this template ---- +## Add support for Swagger +* _Suggested by **Olivier**_ +* _Description_: Build a Swagger Eiffel implementation +* _References_: http://swagger.wordnik.com/ + +---- \ No newline at end of file From 6e767477721d714027234bc4fbadda6e1d235dae Mon Sep 17 00:00:00 2001 From: oligot Date: Fri, 14 Sep 2012 01:16:00 -0700 Subject: [PATCH 02/38] Created Web meeting 2012 09 18 (markdown) --- Web-meeting-2012-09-18.md | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 Web-meeting-2012-09-18.md diff --git a/Web-meeting-2012-09-18.md b/Web-meeting-2012-09-18.md new file mode 100644 index 00000000..19a0279b --- /dev/null +++ b/Web-meeting-2012-09-18.md @@ -0,0 +1,32 @@ +## Participants + +* Jocelyn Fiat +* Berend de Boer +* Olivier Ligot +* Javier Velilla +* Alexander Kogtenkov + +## Information + +### When ? +Tuesday 18th of september, ? time (see http://www.doodle.com/8v2sekiyebp4dpyh) + +### Where ? +Web meeting using webex + +Short url: ? + +Long url: ? + +## Agenda + +* Current status of EWF + * Current activities + * Remaining issues +* Future tasks +* Users feedback, suggestions and requests +* Next meeting + +## Materials + +## Minutes \ No newline at end of file From f820d25a9e7d5667ace29701a0cad74a89973f33 Mon Sep 17 00:00:00 2001 From: jocelyn Date: Mon, 17 Sep 2012 10:04:24 -0700 Subject: [PATCH 03/38] Updated Web meeting 2012 09 18 (markdown) --- Web-meeting-2012-09-18.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Web-meeting-2012-09-18.md b/Web-meeting-2012-09-18.md index 19a0279b..be000bac 100644 --- a/Web-meeting-2012-09-18.md +++ b/Web-meeting-2012-09-18.md @@ -9,13 +9,12 @@ ## Information ### When ? -Tuesday 18th of september, ? time (see http://www.doodle.com/8v2sekiyebp4dpyh) +Tuesday 18th of september, 19:00 - 20:00 UTC/GMT time (see http://www.doodle.com/8v2sekiyebp4dpyh) ### Where ? Web meeting using webex -Short url: ? - +Short url: visit this page before the meeting Long url: ? ## Agenda @@ -23,6 +22,8 @@ Long url: ? * Current status of EWF * Current activities * Remaining issues + * Focus on new design for the router system + * Demo for a CMS built with EWF (inspired by Drupal) * Future tasks * Users feedback, suggestions and requests * Next meeting From 2b82e7f07ffc1e6d2016961d15691e5d73abdf67 Mon Sep 17 00:00:00 2001 From: oligot Date: Mon, 17 Sep 2012 11:42:18 -0700 Subject: [PATCH 04/38] Updated Web meeting 2012 09 18 (markdown) --- Web-meeting-2012-09-18.md | 1 + 1 file changed, 1 insertion(+) diff --git a/Web-meeting-2012-09-18.md b/Web-meeting-2012-09-18.md index be000bac..eb4e39a7 100644 --- a/Web-meeting-2012-09-18.md +++ b/Web-meeting-2012-09-18.md @@ -25,6 +25,7 @@ Long url: ? * Focus on new design for the router system * Demo for a CMS built with EWF (inspired by Drupal) * Future tasks + * [graphviz-server](https://github.com/EiffelWebFramework/graphviz-server) * Users feedback, suggestions and requests * Next meeting From 2b00192e877ebf2adf4b22c0e012f1a6b8f9aa03 Mon Sep 17 00:00:00 2001 From: jocelyn Date: Tue, 18 Sep 2012 06:04:13 -0700 Subject: [PATCH 05/38] Updated Web meeting 2012 09 18 (markdown) --- Web-meeting-2012-09-18.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Web-meeting-2012-09-18.md b/Web-meeting-2012-09-18.md index eb4e39a7..bdcfd5c4 100644 --- a/Web-meeting-2012-09-18.md +++ b/Web-meeting-2012-09-18.md @@ -9,13 +9,14 @@ ## Information ### When ? -Tuesday 18th of september, 19:00 - 20:00 UTC/GMT time (see http://www.doodle.com/8v2sekiyebp4dpyh) +Tuesday 18th of september, 19:00 - 20:00 UTC/GMT time (see 3rd time in http://www.doodle.com/8v2sekiyebp4dpyh) ### Where ? Web meeting using webex -Short url: visit this page before the meeting -Long url: ? +Short url: http://goo.gl/wBz11 + +Long url: https://eiffel.webex.com/eiffel/j.php?ED=211265702&UID=0&PW=NZWNiMjBiZWIz&RT=MiMyMA%3D%3D ## Agenda From b1fcedf501be0a104f29647c4e3e3ed69d5ae000 Mon Sep 17 00:00:00 2001 From: jocelyn Date: Tue, 18 Sep 2012 06:06:12 -0700 Subject: [PATCH 06/38] Updated Web meeting 2012 09 18 (markdown) --- Web-meeting-2012-09-18.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Web-meeting-2012-09-18.md b/Web-meeting-2012-09-18.md index bdcfd5c4..9a56b6c1 100644 --- a/Web-meeting-2012-09-18.md +++ b/Web-meeting-2012-09-18.md @@ -14,9 +14,9 @@ Tuesday 18th of september, 19:00 - 20:00 UTC/GMT time (see 3rd time in http://ww ### Where ? Web meeting using webex -Short url: http://goo.gl/wBz11 - -Long url: https://eiffel.webex.com/eiffel/j.php?ED=211265702&UID=0&PW=NZWNiMjBiZWIz&RT=MiMyMA%3D%3D +* Short url: http://goo.gl/wBz11 +* Long url: https://eiffel.webex.com/eiffel/j.php?ED=211265702&UID=0&PW=NZWNiMjBiZWIz&RT=MiMyMA%3D%3D +* Related Google group topic: https://groups.google.com/d/topic/eiffel-web-framework/A7ADPAT3nj8/discussion ## Agenda From ad12d3e16d4be8b8743366c23e42d41d20eba58e Mon Sep 17 00:00:00 2001 From: jocelyn Date: Tue, 18 Sep 2012 06:24:31 -0700 Subject: [PATCH 07/38] Updated Web meeting 2012 09 18 (markdown) --- Web-meeting-2012-09-18.md | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/Web-meeting-2012-09-18.md b/Web-meeting-2012-09-18.md index 9a56b6c1..0b0cce23 100644 --- a/Web-meeting-2012-09-18.md +++ b/Web-meeting-2012-09-18.md @@ -9,7 +9,7 @@ ## Information ### When ? -Tuesday 18th of september, 19:00 - 20:00 UTC/GMT time (see 3rd time in http://www.doodle.com/8v2sekiyebp4dpyh) +* Tuesday 18th of september, 19:00 - 20:00 UTC/GMT time (see 3rd time in http://www.doodle.com/8v2sekiyebp4dpyh) ### Where ? Web meeting using webex @@ -21,13 +21,25 @@ Web meeting using webex ## Agenda * Current status of EWF + * Focus on new design for the router system, and take decision + * decide if this replace the previous system, + * or if this is provided as another solution (we would then have 2 routers system). + * It might be possible to implement the previous uri and uri-template router with the new design, and mark them obsolete, this would avoid breaking existing code, but if no-one ask for it, no need to spend time doing it. * Current activities + * Technology forecasting about REST, Hypermedia API, Collection/JSON, HAL, ... + * Building a CMS framework inspired by Drupal, and using EWF + * Libraries in-progress or draft: OAuth (consumer), Google API, Github API, Template engine, Wikitext parser, CMS (including sub libraries which will be part of EWF, such as session handling, mailer, ...) + * Documentation * Remaining issues - * Focus on new design for the router system + * Review design in relation to concurrency, and provide example demonstrating concurrency with EWF + * Review design to allow easier extension/customization of EWF, such as using its own MIME handlers. * Demo for a CMS built with EWF (inspired by Drupal) * Future tasks * [graphviz-server](https://github.com/EiffelWebFramework/graphviz-server) + * Improving Eiffel Web Nino: to support persistent connection, and better concurrency design. + * Provide friendly components to generate HTML (DHTML, HTML5, ...), (coders do not want to learn HTML and CSS) * Users feedback, suggestions and requests + * ... * Next meeting ## Materials From eea428831c4acc2cc17aa9e91a334961fecfd04e Mon Sep 17 00:00:00 2001 From: oligot Date: Tue, 18 Sep 2012 06:57:38 -0700 Subject: [PATCH 08/38] Updated Web meeting 2012 09 18 (markdown) --- Web-meeting-2012-09-18.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Web-meeting-2012-09-18.md b/Web-meeting-2012-09-18.md index 0b0cce23..d4ebe99f 100644 --- a/Web-meeting-2012-09-18.md +++ b/Web-meeting-2012-09-18.md @@ -4,7 +4,7 @@ * Berend de Boer * Olivier Ligot * Javier Velilla -* Alexander Kogtenkov +* Emmanuel Stapf ## Information From 9229b6609120bcf2d4e89b5e37472bc227263f06 Mon Sep 17 00:00:00 2001 From: jocelyn Date: Tue, 18 Sep 2012 13:27:01 -0700 Subject: [PATCH 09/38] Updated Web meeting 2012 09 18 (markdown) --- Web-meeting-2012-09-18.md | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/Web-meeting-2012-09-18.md b/Web-meeting-2012-09-18.md index d4ebe99f..65f538af 100644 --- a/Web-meeting-2012-09-18.md +++ b/Web-meeting-2012-09-18.md @@ -4,7 +4,6 @@ * Berend de Boer * Olivier Ligot * Javier Velilla -* Emmanuel Stapf ## Information @@ -37,11 +36,27 @@ Web meeting using webex * Future tasks * [graphviz-server](https://github.com/EiffelWebFramework/graphviz-server) * Improving Eiffel Web Nino: to support persistent connection, and better concurrency design. - * Provide friendly components to generate HTML (DHTML, HTML5, ...), (coders do not want to learn HTML and CSS) + * Provide friendly components to generate HTML (DHTML, HTML5, ...), (coders do not want to learn HTML and +CSS) * Users feedback, suggestions and requests * ... * Next meeting ## Materials -## Minutes \ No newline at end of file +## Minutes +* swagger: see if we could generate EWF code from a swagger specification +* Jocelyn will publish its attempt to build a CMS with EWF + * CMS demo: ... as announced ... some parts look very like drupal. +* Jocelyn will publish a few in-progress draft libraries +* Javier will focus on graphviz-server and hypermedia API +* Berend may send a short note on how he uses EWF (and generate code from description) +* Jocelyn will try to find time to complete the thread and SCOOP implementation of Eiffel Web Nino +* Olivier will have a closer look at swagger +* EWF will adopt the new WSF_ROUTER design as no-one expressed opposition. Olivier said converting his code is not a big task. Same for other users. +* The current state of EWF/WSF seems to be ok for users, we can focus on libraries on top of EWF/WSF +* We might need an HTML parser, if we want to support HTML as an hypermedia API (maybe we can require XHTML for now) +* No high priority to improve Eiffel Web Nino , for now it is mainly used during development. + +* It seems RESTful + Hypermedia API is the top priority for EWF. + From e48cee9b4abf129dcc3841c73185f663ded7ed2b Mon Sep 17 00:00:00 2001 From: jocelyn Date: Tue, 18 Sep 2012 23:39:45 -0700 Subject: [PATCH 10/38] Updated Projects (markdown) --- Projects.md | 1 + 1 file changed, 1 insertion(+) diff --git a/Projects.md b/Projects.md index ad4f235f..f4309027 100644 --- a/Projects.md +++ b/Projects.md @@ -96,6 +96,7 @@ If you are a student, don't hesitate to pick one, or even suggest a new project, * _Suggested by **Jocelyn**_ * _Supervisor_: * _Suitability_: TODO +* _Status_: started, and open for contribution, collaboration, please contact Jocelyn. * _Description_: Using EWF, Build a simple CMS (Content Management System) framework and then an example. It should provide common features such as: - user management (register, login, lost password -> send email) - page editing From c6dac0384b6e83b6a6c958ce795fd18d2a8af9f3 Mon Sep 17 00:00:00 2001 From: jocelyn Date: Tue, 18 Sep 2012 23:40:52 -0700 Subject: [PATCH 11/38] Updated Projects (markdown) --- Projects.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Projects.md b/Projects.md index f4309027..2aaa7a50 100644 --- a/Projects.md +++ b/Projects.md @@ -226,6 +226,13 @@ If you are a student, don't hesitate to pick one, or even suggest a new project, * This should reuse and improve the "http_client" provided by EWF. Eventually also write the EiffelNet implementation to be independant from cURL * **Requirement**: OAuth client eiffel component +## Build a ESI preprocessor, or proxy +* _Suggested by **Jocelyn**_ +* _Supervisor_: +* _Suitability_: TODO +* _Description_: TODO +* See: http://en.wikipedia.org/wiki/Edge_Side_Includes + ---- # Feel free to add new idea below this line ---- From e12e0b35eef4aa335023bc548b2db34765881fda Mon Sep 17 00:00:00 2001 From: jocelyn Date: Wed, 19 Sep 2012 00:22:50 -0700 Subject: [PATCH 12/38] Created Meetings (markdown) --- Meetings.md | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 Meetings.md diff --git a/Meetings.md b/Meetings.md new file mode 100644 index 00000000..54f5a5d0 --- /dev/null +++ b/Meetings.md @@ -0,0 +1,4 @@ +# Previous and future meetings + +* [Web-meeting-2012-09-18](Web-meeting-2012-09-18) +* For previous meetings, check the ["meeting" topics](https://groups.google.com/forum/?fromgroups=#!tags/eiffel-web-framework/meeting) on the [forum](http://groups.google.com/group/eiffel-web-framework) From e7a06ebc2e79fa10d56af11fef45d1f20261b312 Mon Sep 17 00:00:00 2001 From: jocelyn Date: Wed, 19 Sep 2012 00:23:40 -0700 Subject: [PATCH 13/38] Updated Home (markdown) --- Home.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Home.md b/Home.md index 5c47ab7b..962ade01 100644 --- a/Home.md +++ b/Home.md @@ -6,7 +6,7 @@ The official documentation/wiki is located at https://github.com/EiffelWebFramew ## Organization ## - Mailing list: please visit and subscribe to the mailing list page [[http://groups.google.com/group/eiffel-web-framework]] ![logo](http://groups.google.com/intl/en/images/logos/groups_logo_sm.gif) - Most of the topics are discussed on the mailing list (google group). -- For time to time we have web meeting, and less frequently physical meetings that occurs usually during other Eiffel related events. +- For time to time we have [web meetings](meetings), and less frequently [physical meetings](meetings) that occurs usually during other Eiffel related events. ## Documentation ## - to redo From e72ffab2ca5adadd8cdd1b138b6641bb11803bf7 Mon Sep 17 00:00:00 2001 From: jocelyn Date: Wed, 19 Sep 2012 00:24:53 -0700 Subject: [PATCH 14/38] Updated Home (markdown) --- Home.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Home.md b/Home.md index 962ade01..31bea4d9 100644 --- a/Home.md +++ b/Home.md @@ -6,7 +6,7 @@ The official documentation/wiki is located at https://github.com/EiffelWebFramew ## Organization ## - Mailing list: please visit and subscribe to the mailing list page [[http://groups.google.com/group/eiffel-web-framework]] ![logo](http://groups.google.com/intl/en/images/logos/groups_logo_sm.gif) - Most of the topics are discussed on the mailing list (google group). -- For time to time we have [web meetings](meetings), and less frequently [physical meetings](meetings) that occurs usually during other Eiffel related events. +- For time to time we have [[web meetings|meetings]], and less frequently [[physical meetings|meetings]] that occurs usually during other Eiffel related events. ## Documentation ## - to redo From 1dc6ff6df1fe295f89545f777a18c873104bdea6 Mon Sep 17 00:00:00 2001 From: jocelyn Date: Wed, 19 Sep 2012 00:25:16 -0700 Subject: [PATCH 15/38] Updated Meetings (markdown) --- Meetings.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Meetings.md b/Meetings.md index 54f5a5d0..a75a124f 100644 --- a/Meetings.md +++ b/Meetings.md @@ -1,4 +1,4 @@ # Previous and future meetings -* [Web-meeting-2012-09-18](Web-meeting-2012-09-18) +* [[Web-meeting: 2012-09-18|Web-meeting-2012-09-18]] * For previous meetings, check the ["meeting" topics](https://groups.google.com/forum/?fromgroups=#!tags/eiffel-web-framework/meeting) on the [forum](http://groups.google.com/group/eiffel-web-framework) From 92cbf48b49ba74788b6b07d873972cf6ec865f19 Mon Sep 17 00:00:00 2001 From: oligot Date: Mon, 8 Oct 2012 03:38:12 -0700 Subject: [PATCH 16/38] Updated Projects new suggestions (markdown) --- Projects-new-suggestions.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Projects-new-suggestions.md b/Projects-new-suggestions.md index 23e0a613..2d5535bd 100644 --- a/Projects-new-suggestions.md +++ b/Projects-new-suggestions.md @@ -17,4 +17,13 @@ For any entry, please use this template * _Description_: Build a Swagger Eiffel implementation * _References_: http://swagger.wordnik.com/ ----- \ No newline at end of file +---- + +## Add support for Apache logging +* _Suggested by **Olivier**_ +* _Description_: Be able to log using the Apache Common Log Format +* _References_: + - http://httpd.apache.org/docs/2.2/logs.html#common + - http://www.w3.org/Daemon/User/Config/Logging.html#common-logfile-format + +---- From c23bf7a05d0c41956f464b3454115b1ed0ad9d78 Mon Sep 17 00:00:00 2001 From: oligot Date: Thu, 22 Nov 2012 04:30:08 -0800 Subject: [PATCH 17/38] Created Useful links (markdown) --- Useful-links.md | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 Useful-links.md diff --git a/Useful-links.md b/Useful-links.md new file mode 100644 index 00000000..5389d44b --- /dev/null +++ b/Useful-links.md @@ -0,0 +1,4 @@ +## ETags + +* http://www.mnot.net/blog/2007/08/07/etags +* http://bitworking.org/news/150/REST-Tip-Deep-etags-give-you-more-benefits \ No newline at end of file From 2b92ba9e6267e70b4bf4edd15cfbdefbcb07003a Mon Sep 17 00:00:00 2001 From: oligot Date: Thu, 22 Nov 2012 11:28:17 -0800 Subject: [PATCH 18/38] Updated Useful links (markdown) --- Useful-links.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Useful-links.md b/Useful-links.md index 5389d44b..29c810b7 100644 --- a/Useful-links.md +++ b/Useful-links.md @@ -1,3 +1,13 @@ +## Eiffel + +* http://www.scoop.it/t/eiffel-resources +* http://www.scoop.it/t/eiffel + +## Hypermedia + +* http://www.scoop.it/t/hyper-media-apis +* http://www.scoop.it/t/hypermedia-api + ## ETags * http://www.mnot.net/blog/2007/08/07/etags From 0eff04c8472a66f3b7cf58bbd40a33bdcb70326f Mon Sep 17 00:00:00 2001 From: oligot Date: Sun, 3 Feb 2013 04:10:46 -0800 Subject: [PATCH 19/38] Add support for Apache logging: done --- Projects-new-suggestions.md | 9 --------- 1 file changed, 9 deletions(-) diff --git a/Projects-new-suggestions.md b/Projects-new-suggestions.md index 2d5535bd..6093b9c9 100644 --- a/Projects-new-suggestions.md +++ b/Projects-new-suggestions.md @@ -18,12 +18,3 @@ For any entry, please use this template * _References_: http://swagger.wordnik.com/ ---- - -## Add support for Apache logging -* _Suggested by **Olivier**_ -* _Description_: Be able to log using the Apache Common Log Format -* _References_: - - http://httpd.apache.org/docs/2.2/logs.html#common - - http://www.w3.org/Daemon/User/Config/Logging.html#common-logfile-format - ----- From 8040dd582695ab58a0c3f1012894495079753ac3 Mon Sep 17 00:00:00 2001 From: Jocelyn Fiat Date: Fri, 28 Jun 2013 11:06:35 +0200 Subject: [PATCH 20/38] Ensured that EWF compiles with 7.2 (note about ecf version 1-10-0 void_safety="all" <--> 1-11-0 void_safety="transitional" 1-10-0 void_safety="all" <--- 1-11-1 void_safety="all" ) --- draft/application/cms/cms-safe.ecf | 6 +++--- examples/restbucksCRUD/restbucks-safe.ecf | 4 ++-- library/network/http_client/http_client-safe.ecf | 4 ++-- library/security/openid/consumer/openid-safe.ecf | 4 ++-- library/server/wsf/connector/nino-safe.ecf | 4 ++-- library/server/wsf/default/nino-safe.ecf | 4 ++-- tests/all-safe.ecf | 7 +++---- 7 files changed, 16 insertions(+), 17 deletions(-) diff --git a/draft/application/cms/cms-safe.ecf b/draft/application/cms/cms-safe.ecf index 6766f70c..64b3c8de 100644 --- a/draft/application/cms/cms-safe.ecf +++ b/draft/application/cms/cms-safe.ecf @@ -1,5 +1,5 @@ - + @@ -7,7 +7,7 @@ /CVS$ /.svn$ - @@ -15,6 +15,7 @@ + @@ -23,7 +24,6 @@ - diff --git a/examples/restbucksCRUD/restbucks-safe.ecf b/examples/restbucksCRUD/restbucks-safe.ecf index 4c54445f..86dcda7f 100644 --- a/examples/restbucksCRUD/restbucks-safe.ecf +++ b/examples/restbucksCRUD/restbucks-safe.ecf @@ -1,5 +1,5 @@ - + @@ -7,7 +7,7 @@ /\.git$ /\.svn$ - diff --git a/library/network/http_client/http_client-safe.ecf b/library/network/http_client/http_client-safe.ecf index f1d90a8d..c9c641e3 100644 --- a/library/network/http_client/http_client-safe.ecf +++ b/library/network/http_client/http_client-safe.ecf @@ -1,5 +1,5 @@ - + @@ -7,7 +7,7 @@ /EIFGENs$ /.svn$ - diff --git a/library/security/openid/consumer/openid-safe.ecf b/library/security/openid/consumer/openid-safe.ecf index 70e590a7..059358e4 100644 --- a/library/security/openid/consumer/openid-safe.ecf +++ b/library/security/openid/consumer/openid-safe.ecf @@ -1,5 +1,5 @@ - + @@ -7,7 +7,7 @@ /EIFGENs$ /.svn$ - diff --git a/library/server/wsf/connector/nino-safe.ecf b/library/server/wsf/connector/nino-safe.ecf index 5b3c13ee..c7a77a3a 100644 --- a/library/server/wsf/connector/nino-safe.ecf +++ b/library/server/wsf/connector/nino-safe.ecf @@ -1,5 +1,5 @@ - + @@ -7,7 +7,7 @@ /\.git$ /\.svn$ - diff --git a/library/server/wsf/default/nino-safe.ecf b/library/server/wsf/default/nino-safe.ecf index 94ac1a05..1aafe224 100644 --- a/library/server/wsf/default/nino-safe.ecf +++ b/library/server/wsf/default/nino-safe.ecf @@ -1,5 +1,5 @@ - + @@ -7,7 +7,7 @@ /\.git$ /\.svn$ - diff --git a/tests/all-safe.ecf b/tests/all-safe.ecf index 06f538ee..2fcb5f33 100644 --- a/tests/all-safe.ecf +++ b/tests/all-safe.ecf @@ -1,5 +1,5 @@ - + Integration project including many lib @@ -8,7 +8,7 @@ /EIFGENs$ /.svn$ - @@ -26,7 +26,6 @@ - @@ -37,6 +36,7 @@ + @@ -57,7 +57,6 @@ - Compiling as Windows , on other platforms than Windows From dc25723a35ab70fa28a6e62a75074d0bcb6dd7e5 Mon Sep 17 00:00:00 2001 From: Jocelyn Fiat Date: Fri, 28 Jun 2013 11:32:12 +0200 Subject: [PATCH 21/38] Improved Unicode support. --- .../http_client/src/http_client_request_context.e | 10 +++++++--- .../src/spec/libcurl/libcurl_http_client_request.e | 6 +++--- .../src/spec/libcurl/libcurl_http_client_session.e | 4 ++-- .../notification_email/notification_external_mailer.e | 2 +- 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/library/network/http_client/src/http_client_request_context.e b/library/network/http_client/src/http_client_request_context.e index 3d1c69e4..78819831 100644 --- a/library/network/http_client/src/http_client_request_context.e +++ b/library/network/http_client/src/http_client_request_context.e @@ -69,7 +69,7 @@ feature -- Access -- Upload data --| Note: make sure to precise the Content-Type header - upload_filename: detachable READABLE_STRING_8 + upload_filename: detachable IMMUTABLE_STRING_32 -- Upload data read from `upload_filename' --| Note: make sure to precise the Content-Type header @@ -154,11 +154,15 @@ feature -- Element change upload_data := a_data end - set_upload_filename (a_fn: like upload_filename) + set_upload_filename (a_fn: detachable READABLE_STRING_GENERAL) require has_no_upload_filename: a_fn /= Void implies not has_upload_filename do - upload_filename := a_fn + if a_fn = Void then + upload_filename := Void + else + create upload_filename.make_from_string_general (a_fn) + end end set_write_agent (agt: like write_agent) diff --git a/library/network/http_client/src/spec/libcurl/libcurl_http_client_request.e b/library/network/http_client/src/spec/libcurl/libcurl_http_client_request.e index 87d3d4ee..083ca687 100644 --- a/library/network/http_client/src/spec/libcurl/libcurl_http_client_request.e +++ b/library/network/http_client/src/spec/libcurl/libcurl_http_client_request.e @@ -61,7 +61,7 @@ feature -- Execution retried: BOOLEAN l_form_data: detachable HASH_TABLE [READABLE_STRING_32, READABLE_STRING_32] l_upload_data: detachable READABLE_STRING_8 - l_upload_filename: detachable READABLE_STRING_8 + l_upload_filename: detachable READABLE_STRING_GENERAL l_headers: like headers do if not retried then @@ -172,7 +172,7 @@ feature -- Execution or request_method.is_case_insensitive_equal ("PUT") end - create l_upload_file.make (l_upload_filename) + create l_upload_file.make_with_name (l_upload_filename) if l_upload_file.exists and then l_upload_file.is_readable then curl_easy.setopt_integer (curl_handle, {CURL_OPT_CONSTANTS}.curlopt_upload, 1) @@ -388,7 +388,7 @@ feature {NONE} -- Implementation end note - copyright: "2011-2012, Jocelyn Fiat, Javier Velilla, Eiffel Software and others" + copyright: "2011-2013, Jocelyn Fiat, Javier Velilla, Eiffel Software and others" license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" source: "[ Eiffel Software diff --git a/library/network/http_client/src/spec/libcurl/libcurl_http_client_session.e b/library/network/http_client/src/spec/libcurl/libcurl_http_client_session.e index c7c6a210..d68eb98b 100644 --- a/library/network/http_client/src/spec/libcurl/libcurl_http_client_session.e +++ b/library/network/http_client/src/spec/libcurl/libcurl_http_client_session.e @@ -85,7 +85,7 @@ feature -- Basic operation f.close check ctx /= Void then ctx.set_upload_data (Void) - ctx.set_upload_filename (f.name) + ctx.set_upload_filename (f.path.name) end end Result := custom ("PUT", a_path, ctx) @@ -151,7 +151,7 @@ feature {LIBCURL_HTTP_CLIENT_REQUEST} -- Curl implementation ;note - copyright: "2011-2012, Jocelyn Fiat, Javier Velilla, Eiffel Software and others" + copyright: "2011-2013, Jocelyn Fiat, Javier Velilla, Eiffel Software and others" license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" source: "[ Eiffel Software diff --git a/library/runtime/process/notification_email/notification_external_mailer.e b/library/runtime/process/notification_email/notification_external_mailer.e index 1e88e856..41f106f1 100644 --- a/library/runtime/process/notification_email/notification_external_mailer.e +++ b/library/runtime/process/notification_email/notification_external_mailer.e @@ -113,7 +113,7 @@ feature -- Basic operation f.put_string (a_email.message) f.close create args.make (1) - args.force (f.name) + args.force (f.path.name) end end p := l_factory.process_launcher (executable_path.name, args, Void) From cb3f983b912589c739cffe38d21107fbde505248 Mon Sep 17 00:00:00 2001 From: Jocelyn Fiat Date: Fri, 28 Jun 2013 16:11:27 +0200 Subject: [PATCH 22/38] improve file system handler to ignore .* *.swp *~ or using FUNCTION to compute the ignore behavior --- .../wsf/router/wsf_file_system_handler.e | 116 ++++++++++++++++-- 1 file changed, 106 insertions(+), 10 deletions(-) diff --git a/library/server/wsf/router/wsf_file_system_handler.e b/library/server/wsf/router/wsf_file_system_handler.e index f494b5b4..a3a4b57e 100644 --- a/library/server/wsf/router/wsf_file_system_handler.e +++ b/library/server/wsf/router/wsf_file_system_handler.e @@ -91,8 +91,12 @@ feature -- Access index_disabled: BOOLEAN -- Index disabled? + index_ignores_function: detachable FUNCTION [ANY, TUPLE [PATH], BOOLEAN] + -- Function to evaluate if a path is ignored or not during autoindex. + -- If `index_ignores' is Void and `index_ignores_function' is Void, use default ignore rules. + directory_index: detachable ARRAY [READABLE_STRING_8] - -- File serve if a directory index is requested + -- File serve if a directory index is requested. not_found_handler: detachable PROCEDURE [ANY, TUPLE [uri: READABLE_STRING_8; req: WSF_REQUEST; res: WSF_RESPONSE]] @@ -137,6 +141,44 @@ feature -- Element change access_denied_handler := h end + set_default_index_ignores + -- Use default auto index ignores behavior. + do + index_ignores_function := Void + end + + set_index_ignores_function (fct: attached like index_ignores_function) + -- Use `fct' to compute auto index ignores behavior. + do + index_ignores_function := fct + end + +feature -- Status report + + ignoring_index_entry (p: PATH): BOOLEAN + -- Ignoring path `p' for auto index? + local + e: detachable PATH + n: READABLE_STRING_32 + do + if attached index_ignores_function as fct then + Result := fct.item ([p]) + else + -- default + e := p.entry + if e = Void then + e := p + end + if e.is_parent_symbol then + else + n := e.name + Result := n.starts_with ({STRING_32} ".") + or n.ends_with ({STRING_32} "~") + or n.ends_with ({STRING_32} ".swp") + end + end + end + feature -- Execution execute (a_start_path: READABLE_STRING_8; req: WSF_REQUEST; res: WSF_RESPONSE) @@ -189,6 +231,11 @@ feature -- Execution uri, s: STRING_8 d: DIRECTORY l_files: LIST [PATH] + p: PATH + n: READABLE_STRING_32 + httpdate: HTTP_DATE + pf: RAW_FILE + l_is_dir: BOOLEAN do create d.make_with_path (dn) d.open_read @@ -202,11 +249,16 @@ feature -- Execution s := "[ - Index for folder: $URI + Index of $URI + -

Index for $URI

-
    +

    Index of $URI

    + + + ]" s.replace_substring_all ("$URI", uri) @@ -216,15 +268,54 @@ feature -- Execution until l_files.after loop - s.append ("
  • ") - s.append (html_encoder.encoded_string (l_files.item.name)) - s.append ("
  • %N") + p := l_files.item + if ignoring_index_entry (p) then + + else + n := p.name + create pf.make_with_path (p) + if pf.is_directory then + l_is_dir := True + else + l_is_dir := False + end + + s.append ("") + s.append ("") + s.append ("") + s.append ("") + s.append ("") + end l_files.forth end s.append ("[ - + +
    NameLast modifiedSize

    ") + if l_is_dir then + s.append ("[dir]") + else + s.append (" ") + end + s.append ("") + if p.is_parent_symbol then + s.append ("[Parent Directory] ..") + else + s.append (html_encoder.encoded_string (n)) + end + if l_is_dir then + s.append ("/") + end + + s.append ("") + create httpdate.make_from_date_time (file_date (pf)) + httpdate.append_to_rfc1123_string (s) + s.append ("") + if not l_is_dir then + s.append_integer (file_size (pf)) + end + s.append ("

    ]" @@ -480,6 +571,11 @@ feature {NONE} -- Implementation feature {NONE} -- implementation: date time + file_size (f: FILE): INTEGER + do + Result := f.count + end + file_date (f: FILE): DATE_TIME do Result := timestamp_to_date (f.date) From c216b9670776ea457e7491dcebbfdf2789cc66d7 Mon Sep 17 00:00:00 2001 From: Jocelyn Fiat Date: Tue, 2 Jul 2013 12:21:54 +0200 Subject: [PATCH 23/38] Moved the cms component to https://github.com/EiffelWebFramework/cms This is now out of EWF repository. --- README.md | 4 - draft/application/cms/.gitignore | 1 - draft/application/cms/README.md | 4 +- draft/application/cms/cms-safe.ecf | 29 - draft/application/cms/cms.ecf | 31 - draft/application/cms/example/cms.ini | 8 - .../application/cms/example/cms_demo-safe.ecf | 23 - draft/application/cms/example/demo.rc | 6 - draft/application/cms/example/ewf.ini | 4 - .../cms/example/src/module/demo/demo_module.e | 82 -- .../module/demo/demo_widget_cms_execution.e | 97 --- .../module/shutdown/shutdown_cms_execution.e | 33 - .../src/module/shutdown/shutdown_module.e | 69 -- draft/application/cms/example/src/web_cms.e | 135 ---- draft/application/cms/src/cms_configuration.e | 311 -------- draft/application/cms/src/cms_custom_setup.e | 18 - draft/application/cms/src/cms_default_setup.e | 132 ---- draft/application/cms/src/cms_execution.e | 715 ------------------ .../cms/src/cms_html_page_response.e | 77 -- draft/application/cms/src/cms_service.e | 442 ----------- draft/application/cms/src/cms_session.e | 33 - draft/application/cms/src/cms_setup.e | 55 -- .../default_theme/default_cms_html_template.e | 81 -- .../default_theme/default_cms_page_template.e | 84 -- .../cms/src/default_theme/default_cms_theme.e | 85 --- draft/application/cms/src/form/cms_form.e | 43 -- .../cms/src/handler/any_cms_execution.e | 61 -- .../cms/src/handler/cms_file_system_handler.e | 17 - .../application/cms/src/handler/cms_handler.e | 64 -- .../cms/src/handler/home_cms_execution.e | 52 -- .../cms/src/handler/not_found_cms_execution.e | 34 - .../cms/src/handler/theme_cms_execution.e | 47 -- draft/application/cms/src/hooks/cms_hook.e | 10 - .../cms/src/hooks/cms_hook_auto_register.e | 33 - .../cms/src/hooks/cms_hook_block.e | 23 - .../cms/src/hooks/cms_hook_form_alter.e | 19 - .../cms/src/hooks/cms_hook_menu_alter.e | 19 - .../cms/src/kernel/api/cms_api_options.e | 26 - .../cms/src/kernel/api/cms_common_api.e | 102 --- .../cms/src/kernel/api/cms_url_api_options.e | 25 - .../cms/src/kernel/auth/cms_auth_engine.e | 16 - .../src/kernel/auth/cms_storage_auth_engine.e | 32 - .../cms/src/kernel/cms_html_page.e | 225 ------ .../cms/src/kernel/cms_session_controler.e | 139 ---- draft/application/cms/src/kernel/cms_user.e | 195 ----- .../cms/src/kernel/cms_user_profile.e | 51 -- .../cms/src/kernel/cms_user_role.e | 85 --- .../cms/src/kernel/content/cms_block.e | 32 - .../src/kernel/content/cms_content_block.e | 46 -- .../cms/src/kernel/content/cms_content_type.e | 60 -- .../cms/src/kernel/content/cms_menu_block.e | 45 -- .../cms/src/kernel/content/cms_node.e | 101 --- .../content/format/cms_filtered_html_format.e | 44 -- .../src/kernel/content/format/cms_format.e | 46 -- .../src/kernel/content/format/cms_formats.e | 54 -- .../content/format/cms_full_html_format.e | 35 - .../content/format/cms_plain_text_format.e | 49 -- .../content/format/filters/cms_filter.e | 35 - .../content/format/filters/cms_html_filter.e | 128 ---- .../format/filters/cms_html_to_text_filter.e | 34 - .../filters/cms_line_break_converter_filter.e | 34 - .../format/filters/cms_no_html_filter.e | 77 -- .../content/format/filters/cms_url_filter.e | 33 - .../cms/src/kernel/link/cms_external_link.e | 38 - .../cms/src/kernel/link/cms_link.e | 71 -- .../cms/src/kernel/link/cms_link_composite.e | 27 - .../cms/src/kernel/link/cms_local_link.e | 129 ---- .../cms/src/kernel/link/cms_menu.e | 73 -- .../cms/src/kernel/link/cms_menu_system.e | 88 --- .../cms/src/kernel/link/cms_pager.e | 17 - .../application/cms/src/kernel/log/cms_log.e | 152 ---- .../admin/admin_blocks_cms_execution.e | 57 -- .../src/modules/admin/admin_cms_execution.e | 46 -- .../modules/admin/admin_logs_cms_execution.e | 47 -- .../cms/src/modules/admin/admin_module.e | 112 --- .../admin/admin_modules_cms_execution.e | 57 -- .../admin/admin_user_roles_cms_execution.e | 211 ------ .../modules/admin/admin_users_cms_execution.e | 56 -- .../modules/admin/log_view_cms_execution.e | 39 - .../application/cms/src/modules/cms_module.e | 58 -- .../cms/src/modules/cms_module_link.e | 50 -- .../cms/src/modules/cms_permission.e | 36 - .../cms/src/modules/debug/debug_module.e | 128 ---- .../cms/src/modules/node/cms_page.e | 75 -- .../src/modules/node/cms_page_content_type.e | 176 ----- .../src/modules/node/node_add_cms_execution.e | 61 -- .../cms/src/modules/node/node_cms_execution.e | 141 ---- .../modules/node/node_edit_cms_execution.e | 166 ---- .../cms/src/modules/node/node_module.e | 127 ---- .../modules/node/node_view_cms_execution.e | 41 - .../src/modules/openid/openid_cms_execution.e | 149 ---- .../cms/src/modules/openid/openid_module.e | 141 ---- .../modules/user/user_account_cms_execution.e | 59 -- .../cms/src/modules/user/user_cms_execution.e | 206 ----- .../modules/user/user_edit_cms_execution.e | 215 ------ .../modules/user/user_logout_cms_execution.e | 39 - .../cms/src/modules/user/user_module.e | 152 ---- .../cms/src/modules/user/user_module_lib.e | 29 - .../user/user_new_password_cms_execution.e | 171 ----- .../user/user_register_cms_execution.e | 217 ------ .../user/user_reset_password_cms_execution.e | 86 --- .../cms/src/notification/cms_email.e | 18 - .../cms/src/notification/cms_storage_mailer.e | 38 - .../cms/src/storage/cms_sed_storage.e | 615 --------------- .../application/cms/src/storage/cms_storage.e | 186 ----- .../cms/src/theme/cms_html_template.e | 13 - .../cms/src/theme/cms_page_template.e | 12 - .../application/cms/src/theme/cms_template.e | 81 -- draft/application/cms/src/theme/cms_theme.e | 101 --- .../cms/www/themes/default/res/ewfcms.js | 91 --- .../cms/www/themes/default/res/favicon.ico | Bin 786 -> 0 bytes .../cms/www/themes/default/res/logo.png | Bin 3193 -> 0 bytes .../www/themes/default/res/menu-collapsed.png | Bin 108 -> 0 bytes .../www/themes/default/res/menu-expanded.png | Bin 106 -> 0 bytes .../cms/www/themes/default/res/style.css | 251 ------ .../cms/www/themes/test/res/favicon.ico | Bin 786 -> 0 bytes .../cms/www/themes/test/res/logo.png | Bin 3193 -> 0 bytes .../cms/www/themes/test/res/style.css | 192 ----- 118 files changed, 2 insertions(+), 10069 deletions(-) delete mode 100644 draft/application/cms/.gitignore delete mode 100644 draft/application/cms/cms-safe.ecf delete mode 100644 draft/application/cms/cms.ecf delete mode 100644 draft/application/cms/example/cms.ini delete mode 100644 draft/application/cms/example/cms_demo-safe.ecf delete mode 100644 draft/application/cms/example/demo.rc delete mode 100644 draft/application/cms/example/ewf.ini delete mode 100644 draft/application/cms/example/src/module/demo/demo_module.e delete mode 100644 draft/application/cms/example/src/module/demo/demo_widget_cms_execution.e delete mode 100644 draft/application/cms/example/src/module/shutdown/shutdown_cms_execution.e delete mode 100644 draft/application/cms/example/src/module/shutdown/shutdown_module.e delete mode 100644 draft/application/cms/example/src/web_cms.e delete mode 100644 draft/application/cms/src/cms_configuration.e delete mode 100644 draft/application/cms/src/cms_custom_setup.e delete mode 100644 draft/application/cms/src/cms_default_setup.e delete mode 100644 draft/application/cms/src/cms_execution.e delete mode 100644 draft/application/cms/src/cms_html_page_response.e delete mode 100644 draft/application/cms/src/cms_service.e delete mode 100644 draft/application/cms/src/cms_session.e delete mode 100644 draft/application/cms/src/cms_setup.e delete mode 100644 draft/application/cms/src/default_theme/default_cms_html_template.e delete mode 100644 draft/application/cms/src/default_theme/default_cms_page_template.e delete mode 100644 draft/application/cms/src/default_theme/default_cms_theme.e delete mode 100644 draft/application/cms/src/form/cms_form.e delete mode 100644 draft/application/cms/src/handler/any_cms_execution.e delete mode 100644 draft/application/cms/src/handler/cms_file_system_handler.e delete mode 100644 draft/application/cms/src/handler/cms_handler.e delete mode 100644 draft/application/cms/src/handler/home_cms_execution.e delete mode 100644 draft/application/cms/src/handler/not_found_cms_execution.e delete mode 100644 draft/application/cms/src/handler/theme_cms_execution.e delete mode 100644 draft/application/cms/src/hooks/cms_hook.e delete mode 100644 draft/application/cms/src/hooks/cms_hook_auto_register.e delete mode 100644 draft/application/cms/src/hooks/cms_hook_block.e delete mode 100644 draft/application/cms/src/hooks/cms_hook_form_alter.e delete mode 100644 draft/application/cms/src/hooks/cms_hook_menu_alter.e delete mode 100644 draft/application/cms/src/kernel/api/cms_api_options.e delete mode 100644 draft/application/cms/src/kernel/api/cms_common_api.e delete mode 100644 draft/application/cms/src/kernel/api/cms_url_api_options.e delete mode 100644 draft/application/cms/src/kernel/auth/cms_auth_engine.e delete mode 100644 draft/application/cms/src/kernel/auth/cms_storage_auth_engine.e delete mode 100644 draft/application/cms/src/kernel/cms_html_page.e delete mode 100644 draft/application/cms/src/kernel/cms_session_controler.e delete mode 100644 draft/application/cms/src/kernel/cms_user.e delete mode 100644 draft/application/cms/src/kernel/cms_user_profile.e delete mode 100644 draft/application/cms/src/kernel/cms_user_role.e delete mode 100644 draft/application/cms/src/kernel/content/cms_block.e delete mode 100644 draft/application/cms/src/kernel/content/cms_content_block.e delete mode 100644 draft/application/cms/src/kernel/content/cms_content_type.e delete mode 100644 draft/application/cms/src/kernel/content/cms_menu_block.e delete mode 100644 draft/application/cms/src/kernel/content/cms_node.e delete mode 100644 draft/application/cms/src/kernel/content/format/cms_filtered_html_format.e delete mode 100644 draft/application/cms/src/kernel/content/format/cms_format.e delete mode 100644 draft/application/cms/src/kernel/content/format/cms_formats.e delete mode 100644 draft/application/cms/src/kernel/content/format/cms_full_html_format.e delete mode 100644 draft/application/cms/src/kernel/content/format/cms_plain_text_format.e delete mode 100644 draft/application/cms/src/kernel/content/format/filters/cms_filter.e delete mode 100644 draft/application/cms/src/kernel/content/format/filters/cms_html_filter.e delete mode 100644 draft/application/cms/src/kernel/content/format/filters/cms_html_to_text_filter.e delete mode 100644 draft/application/cms/src/kernel/content/format/filters/cms_line_break_converter_filter.e delete mode 100644 draft/application/cms/src/kernel/content/format/filters/cms_no_html_filter.e delete mode 100644 draft/application/cms/src/kernel/content/format/filters/cms_url_filter.e delete mode 100644 draft/application/cms/src/kernel/link/cms_external_link.e delete mode 100644 draft/application/cms/src/kernel/link/cms_link.e delete mode 100644 draft/application/cms/src/kernel/link/cms_link_composite.e delete mode 100644 draft/application/cms/src/kernel/link/cms_local_link.e delete mode 100644 draft/application/cms/src/kernel/link/cms_menu.e delete mode 100644 draft/application/cms/src/kernel/link/cms_menu_system.e delete mode 100644 draft/application/cms/src/kernel/link/cms_pager.e delete mode 100644 draft/application/cms/src/kernel/log/cms_log.e delete mode 100644 draft/application/cms/src/modules/admin/admin_blocks_cms_execution.e delete mode 100644 draft/application/cms/src/modules/admin/admin_cms_execution.e delete mode 100644 draft/application/cms/src/modules/admin/admin_logs_cms_execution.e delete mode 100644 draft/application/cms/src/modules/admin/admin_module.e delete mode 100644 draft/application/cms/src/modules/admin/admin_modules_cms_execution.e delete mode 100644 draft/application/cms/src/modules/admin/admin_user_roles_cms_execution.e delete mode 100644 draft/application/cms/src/modules/admin/admin_users_cms_execution.e delete mode 100644 draft/application/cms/src/modules/admin/log_view_cms_execution.e delete mode 100644 draft/application/cms/src/modules/cms_module.e delete mode 100644 draft/application/cms/src/modules/cms_module_link.e delete mode 100644 draft/application/cms/src/modules/cms_permission.e delete mode 100644 draft/application/cms/src/modules/debug/debug_module.e delete mode 100644 draft/application/cms/src/modules/node/cms_page.e delete mode 100644 draft/application/cms/src/modules/node/cms_page_content_type.e delete mode 100644 draft/application/cms/src/modules/node/node_add_cms_execution.e delete mode 100644 draft/application/cms/src/modules/node/node_cms_execution.e delete mode 100644 draft/application/cms/src/modules/node/node_edit_cms_execution.e delete mode 100644 draft/application/cms/src/modules/node/node_module.e delete mode 100644 draft/application/cms/src/modules/node/node_view_cms_execution.e delete mode 100644 draft/application/cms/src/modules/openid/openid_cms_execution.e delete mode 100644 draft/application/cms/src/modules/openid/openid_module.e delete mode 100644 draft/application/cms/src/modules/user/user_account_cms_execution.e delete mode 100644 draft/application/cms/src/modules/user/user_cms_execution.e delete mode 100644 draft/application/cms/src/modules/user/user_edit_cms_execution.e delete mode 100644 draft/application/cms/src/modules/user/user_logout_cms_execution.e delete mode 100644 draft/application/cms/src/modules/user/user_module.e delete mode 100644 draft/application/cms/src/modules/user/user_module_lib.e delete mode 100644 draft/application/cms/src/modules/user/user_new_password_cms_execution.e delete mode 100644 draft/application/cms/src/modules/user/user_register_cms_execution.e delete mode 100644 draft/application/cms/src/modules/user/user_reset_password_cms_execution.e delete mode 100644 draft/application/cms/src/notification/cms_email.e delete mode 100644 draft/application/cms/src/notification/cms_storage_mailer.e delete mode 100644 draft/application/cms/src/storage/cms_sed_storage.e delete mode 100644 draft/application/cms/src/storage/cms_storage.e delete mode 100644 draft/application/cms/src/theme/cms_html_template.e delete mode 100644 draft/application/cms/src/theme/cms_page_template.e delete mode 100644 draft/application/cms/src/theme/cms_template.e delete mode 100644 draft/application/cms/src/theme/cms_theme.e delete mode 100644 draft/application/cms/www/themes/default/res/ewfcms.js delete mode 100644 draft/application/cms/www/themes/default/res/favicon.ico delete mode 100644 draft/application/cms/www/themes/default/res/logo.png delete mode 100644 draft/application/cms/www/themes/default/res/menu-collapsed.png delete mode 100644 draft/application/cms/www/themes/default/res/menu-expanded.png delete mode 100644 draft/application/cms/www/themes/default/res/style.css delete mode 100644 draft/application/cms/www/themes/test/res/favicon.ico delete mode 100644 draft/application/cms/www/themes/test/res/logo.png delete mode 100644 draft/application/cms/www/themes/test/res/style.css diff --git a/README.md b/README.md index 1456d778..e52fc08a 100644 --- a/README.md +++ b/README.md @@ -59,10 +59,6 @@ An alternative to the last 2 instructions is to use the script from tools folder ### text * __encoder__: Various simpler encoders: base64, url-encoder, xml entities, html entities [read more](library/text/encoder) -### crypto -* eel -* eapml - ### Others * error: very simple/basic library to handle error diff --git a/draft/application/cms/.gitignore b/draft/application/cms/.gitignore deleted file mode 100644 index f998b949..00000000 --- a/draft/application/cms/.gitignore +++ /dev/null @@ -1 +0,0 @@ -_storage_ diff --git a/draft/application/cms/README.md b/draft/application/cms/README.md index 79620c23..32472422 100644 --- a/draft/application/cms/README.md +++ b/draft/application/cms/README.md @@ -1,2 +1,2 @@ -Experimental a simple CMS using EWF. -Inspired by Drupal +The "cms" component moved. +Please visit https://github.com/EiffelWebFramework/cms to follow the project. diff --git a/draft/application/cms/cms-safe.ecf b/draft/application/cms/cms-safe.ecf deleted file mode 100644 index 64b3c8de..00000000 --- a/draft/application/cms/cms-safe.ecf +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - /EIFGENs$ - /CVS$ - /.svn$ - - - - - - - - - - - - - - - - - - - diff --git a/draft/application/cms/cms.ecf b/draft/application/cms/cms.ecf deleted file mode 100644 index 164e5649..00000000 --- a/draft/application/cms/cms.ecf +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - /EIFGENs$ - /CVS$ - /.svn$ - - - - - - - - - - - - - - - - - - - - - diff --git a/draft/application/cms/example/cms.ini b/draft/application/cms/example/cms.ini deleted file mode 100644 index 7de4d96e..00000000 --- a/draft/application/cms/example/cms.ini +++ /dev/null @@ -1,8 +0,0 @@ -site.name=EWF Web CMS -#site.base_url=/demo -site.email=your@email.com -root-dir=../www -var-dir=var -files-dir=files -themes-dir=${root-dir}/themes -#theme=test diff --git a/draft/application/cms/example/cms_demo-safe.ecf b/draft/application/cms/example/cms_demo-safe.ecf deleted file mode 100644 index 2696592f..00000000 --- a/draft/application/cms/example/cms_demo-safe.ecf +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - /.git$ - /EIFGENs$ - /.svn$ - - - - - - - - - - - - - - diff --git a/draft/application/cms/example/demo.rc b/draft/application/cms/example/demo.rc deleted file mode 100644 index b0ec159c..00000000 --- a/draft/application/cms/example/demo.rc +++ /dev/null @@ -1,6 +0,0 @@ -#include - -STRINGTABLE -BEGIN - 1 "This Program was made using EiffelStudio using Visual Studio C++" -END diff --git a/draft/application/cms/example/ewf.ini b/draft/application/cms/example/ewf.ini deleted file mode 100644 index 6a794d69..00000000 --- a/draft/application/cms/example/ewf.ini +++ /dev/null @@ -1,4 +0,0 @@ -# For nino connector, use port 9999 -port=9090 - -#verbose=true diff --git a/draft/application/cms/example/src/module/demo/demo_module.e b/draft/application/cms/example/src/module/demo/demo_module.e deleted file mode 100644 index 4576957a..00000000 --- a/draft/application/cms/example/src/module/demo/demo_module.e +++ /dev/null @@ -1,82 +0,0 @@ -note - description: "Summary description for {CMS_MODULE}." - author: "" - date: "$Date$" - revision: "$Revision$" - -class - DEMO_MODULE - -inherit - CMS_MODULE - redefine - links - end - - CMS_HOOK_MENU_ALTER - - CMS_HOOK_AUTO_REGISTER - -create - make - -feature {NONE} -- Initialization - - make - do - name := "demo" - version := "1.0" - description := "demo" - package := "misc" - end - -feature {CMS_SERVICE} -- Registration - - service: detachable CMS_SERVICE - - register (a_service: CMS_SERVICE) - do - service := a_service - a_service.map_uri_template ("/demo/widget{/args}", agent handle_widget_demo (a_service, ?, ?)) - a_service.map_uri_template ("/demo/date/{arg}", agent handle_date_time_demo (a_service, ?, ?)) - a_service.map_uri_template ("/demo/format/{arg}", agent handle_format_demo (a_service, ?, ?)) - end - - menu_alter (a_menu_system: CMS_MENU_SYSTEM; a_execution: CMS_EXECUTION) - local - lnk: CMS_LOCAL_LINK --- opts: CMS_API_OPTIONS - do - create lnk.make ("Demo::widget", "/demo/widget/") - a_menu_system.management_menu.extend (lnk) - end - -feature -- Hooks - - links: HASH_TABLE [CMS_MODULE_LINK, STRING] - -- Link indexed by path - local - lnk: CMS_MODULE_LINK - do - Result := Precursor - create lnk.make ("Date/time demo") --- lnk.set_callback (agent process_date_time_demo, <<"arg">>) --- Result["/demo/date/{arg}"] := lnk - end - - handle_date_time_demo (cms: CMS_SERVICE; req: WSF_REQUEST; res: WSF_RESPONSE) - do - (create {ANY_CMS_EXECUTION}.make_with_text (req, res, cms, "

    Demo::date/time

    ")).execute - end - - handle_format_demo (cms: CMS_SERVICE; req: WSF_REQUEST; res: WSF_RESPONSE) - do - (create {ANY_CMS_EXECUTION}.make_with_text (req, res, cms, "

    Demo::format

    ")).execute - end - - handle_widget_demo (cms: CMS_SERVICE; req: WSF_REQUEST; res: WSF_RESPONSE) - do - (create {DEMO_WIDGET_CMS_EXECUTION}.make (req, res, cms)).execute - end - -end diff --git a/draft/application/cms/example/src/module/demo/demo_widget_cms_execution.e b/draft/application/cms/example/src/module/demo/demo_widget_cms_execution.e deleted file mode 100644 index 58083ee5..00000000 --- a/draft/application/cms/example/src/module/demo/demo_widget_cms_execution.e +++ /dev/null @@ -1,97 +0,0 @@ -note - description : "Objects that ..." - author : "$Author$" - date : "$Date$" - revision : "$Revision$" - -class - DEMO_WIDGET_CMS_EXECUTION - -inherit - CMS_EXECUTION - -create - make - -feature -- Execution - - process - local - args: like arguments - l_table: like new_table - s: STRING - do - args := arguments - if args.is_empty then - set_title ("Widgets") - set_main_content ("...") - else - - end - l_table := new_table - - create s.make_empty - l_table.append_to_html (theme, s) - set_main_content (s) - end - - new_table: WSF_WIDGET_AGENT_TABLE [READABLE_STRING_8] - local - l_table: WSF_WIDGET_AGENT_TABLE [READABLE_STRING_8] - do - create l_table.make - l_table.add_css_style ("width: 85%%; border: solid 1px #999; padding: 2px;") - - l_table.set_column_count (3) - l_table.column (1).set_title ("First") - l_table.column (2).set_title ("Second") - l_table.column (3).set_title ("Third") - - l_table.column (1).add_css_style ("width: 20%%") - l_table.column (2).add_css_style ("width: 40px") - l_table.column (3).add_css_style ("width: 40px") - - l_table.set_data (<<"foo", "bar", "foobar">>) - l_table.set_foot_data (<<"abc", "def">>) - l_table.set_compute_item_function (agent (d: READABLE_STRING_8): WSF_WIDGET_TABLE_ROW - local - i: INTEGER - w: WSF_WIDGET_TABLE_ITEM - do - create Result.make (d.count) - if d.is_case_insensitive_equal ("bar") then - Result.add_css_style ("background-color: #ccf;") - end - across - d as c - loop - i := i + 1 - create w.make_with_text (c.item.out) - if i = 1 then - w.add_css_style ("background-color: #333; color: white; font-weight: bold;") - elseif i > 3 then - w.add_css_style ("color: red; border: solid 1px red; padding: 3px;") - end - Result.force (w) - end - end) - - Result := l_table - end - - arguments: ARRAY [READABLE_STRING_32] - -- Path parameters arguments related to {/vars} - do - if - attached {WSF_TABLE} request.path_parameter ("args") as lst and then - attached lst.as_array_of_string as arr - then - Result := arr - else - create Result.make_empty - end - - Result.rebase (1) - end - -end diff --git a/draft/application/cms/example/src/module/shutdown/shutdown_cms_execution.e b/draft/application/cms/example/src/module/shutdown/shutdown_cms_execution.e deleted file mode 100644 index 4c61e9c9..00000000 --- a/draft/application/cms/example/src/module/shutdown/shutdown_cms_execution.e +++ /dev/null @@ -1,33 +0,0 @@ -note - description: "Summary description for {SHUTDOWN_CMS_EXECUTION}." - date: "$Date$" - revision: "$Revision$" - -class - SHUTDOWN_CMS_EXECUTION - -inherit - CMS_EXECUTION - -create - make - -feature -- Execution - - process - local - b: STRING - do - create b.make_empty - set_title ("Shutting down the service ...") - if has_permission ("admin shutdown") then - if attached {WGI_NINO_CONNECTOR} request.wgi_connector as nino then - nino.server.shutdown_server - end - else - b.append ("Access denied") - end - set_main_content (b) - end - -end diff --git a/draft/application/cms/example/src/module/shutdown/shutdown_module.e b/draft/application/cms/example/src/module/shutdown/shutdown_module.e deleted file mode 100644 index 3c250f7b..00000000 --- a/draft/application/cms/example/src/module/shutdown/shutdown_module.e +++ /dev/null @@ -1,69 +0,0 @@ -note - description: "Summary description for {SHUTDOWN_MODULE}." - author: "" - date: "$Date$" - revision: "$Revision$" - -class - SHUTDOWN_MODULE - -inherit - CMS_MODULE - redefine - permissions - end - - CMS_HOOK_MENU_ALTER - -create - make - -feature {NONE} -- Initialization - - make - do - name := "shutdown" - version := "1.0" - description := "Shutdown the service if this is EWF Nino or FCGI" - package := "server" - end - -feature {CMS_SERVICE} -- Registration - - service: detachable CMS_SERVICE - - register (a_service: CMS_SERVICE) - do - a_service.map_uri ("/admin/shutdown/", agent handle_shutdown) - - a_service.add_menu_alter_hook (Current) - service := a_service - end - -feature -- Hooks - - permissions (a_service: CMS_SERVICE): LIST [CMS_PERMISSION] - do - Result := Precursor (a_service) - Result.extend ("shutdown") - end - - menu_alter (a_menu_system: CMS_MENU_SYSTEM; a_execution: CMS_EXECUTION) - local - lnk: CMS_LOCAL_LINK - do - create lnk.make ("Shutdown", "/admin/shutdown/") - lnk.set_permission_arguments (<<"shutdown">>) - a_menu_system.management_menu.extend (lnk) - end - - handle_shutdown (req: WSF_REQUEST; res: WSF_RESPONSE) - do - if attached service as l_service then - (create {SHUTDOWN_CMS_EXECUTION}.make (req, res, l_service)).execute ; - else - res.set_status_code ({HTTP_STATUS_CODE}.expectation_failed) - end - end - -end diff --git a/draft/application/cms/example/src/web_cms.e b/draft/application/cms/example/src/web_cms.e deleted file mode 100644 index 716da98f..00000000 --- a/draft/application/cms/example/src/web_cms.e +++ /dev/null @@ -1,135 +0,0 @@ -note - description: "[ - This class implements the Demo of WEB CMS service - - ]" - -class - WEB_CMS - -inherit - WSF_DEFAULT_SERVICE - redefine - initialize - end - -create - make_and_launch - -feature {NONE} -- Initialization - - initialize - local - args: ARGUMENTS_32 - cfg: detachable READABLE_STRING_32 - i,n: INTEGER - do - --| Arguments - create args - from - i := 1 - n := args.argument_count - until - i > n or cfg /= Void - loop - if attached args.argument (i) as s then - if s.same_string_general ("--config") or s.same_string_general ("-c") then - if i < n then - cfg := args.argument (i + 1) - end - end - end - i := i + 1 - end - if cfg = Void then - if file_exists ("cms.ini") then - cfg := {STRING_32} "cms.ini" - end - end - - --| EWF settings - service_options := create {WSF_SERVICE_LAUNCHER_OPTIONS_FROM_INI}.make_from_file ("ewf.ini") - Precursor - - --| CMS initialization - launch_cms (cms_setup (cfg)) - end - - cms_setup (a_cfg_fn: detachable READABLE_STRING_GENERAL): CMS_CUSTOM_SETUP - do - if a_cfg_fn /= Void then - create Result.make_from_file (a_cfg_fn) - else - create Result -- Default - end - setup_modules (Result) - setup_storage (Result) - end - - launch_cms (a_setup: CMS_SETUP) - local - cms: CMS_SERVICE - do - create cms.make (a_setup) - on_launched (cms) - cms_service := cms - end - -feature -- Execution - - cms_service: CMS_SERVICE - - execute (req: WSF_REQUEST; res: WSF_RESPONSE) - do - cms_service.execute (req, res) - end - -feature -- Access - - setup_modules (a_setup: CMS_SETUP) - local - m: CMS_MODULE - do - create {DEMO_MODULE} m.make - m.enable - a_setup.add_module (m) - - create {SHUTDOWN_MODULE} m.make - m.enable - a_setup.add_module (m) - - create {DEBUG_MODULE} m.make - m.enable - a_setup.add_module (m) - - create {OPENID_MODULE} m.make - m.enable - a_setup.add_module (m) - end - - setup_storage (a_setup: CMS_SETUP) - do - - end - -feature -- Event - - on_launched (cms: CMS_SERVICE) - local - e: CMS_EMAIL - do - create e.make (cms.site_email, cms.site_email, "[" + cms.site_name + "] launched...", "The site [" + cms.site_name + "] was launched at " + (create {DATE_TIME}.make_now_utc).out + " UTC.") - cms.mailer.safe_process_email (e) - end - -feature -- Helper - - file_exists (fn: READABLE_STRING_GENERAL): BOOLEAN - local - f: RAW_FILE - do - create f.make_with_name (fn) - Result := f.exists and then f.is_readable - end - -end diff --git a/draft/application/cms/src/cms_configuration.e b/draft/application/cms/src/cms_configuration.e deleted file mode 100644 index 937629e3..00000000 --- a/draft/application/cms/src/cms_configuration.e +++ /dev/null @@ -1,311 +0,0 @@ -note - description: "Summary description for {CMS_CONFIGURATION}." - author: "" - date: "$Date$" - revision: "$Revision$" - -class - CMS_CONFIGURATION - -inherit - ANY - - SHARED_EXECUTION_ENVIRONMENT - export - {NONE} all - end - -create - make, - make_from_file - -feature {NONE} -- Initialization - - make - do - create options.make_equal (10) - analyze - end - - make_from_file (a_filename: READABLE_STRING_GENERAL) - -- Initialize `Current'. - local - p: PATH - do - make - create p.make_from_string (a_filename) - configuration_location := p - import_from_path (p) - analyze - end - - analyze - do - get_root_location - get_var_location - get_themes_location - get_files_location - end - -feature -- Access - - configuration_location: detachable PATH - - option (a_name: READABLE_STRING_GENERAL): detachable ANY - do - Result := options.item (a_name) - end - - options: STRING_TABLE [STRING_32] - -feature -- Conversion - - append_to_string (s: STRING) - local - utf: UTF_CONVERTER - do - s.append ("Options:%N") - across - options as c - loop - s.append (c.key.to_string_8) - s.append_character ('=') - utf.string_32_into_utf_8_string_8 (c.item, s) - s.append_character ('%N') - end - - s.append ("Specific:%N") - s.append ("root_location=" + root_location.utf_8_name + "%N") - s.append ("var_location=" + var_location.utf_8_name + "%N") - s.append ("files_location=" + files_location.utf_8_name + "%N") - s.append ("themes_location=" + themes_location.utf_8_name + "%N") - end - -feature -- Element change - - set_option (a_name: READABLE_STRING_GENERAL; a_value: STRING_32) - do - options.force (a_value, a_name.as_string_8) - end - -feature -- Access - - var_location: PATH - - root_location: PATH - - files_location: PATH - - themes_location: PATH - - theme_name (dft: detachable like theme_name): READABLE_STRING_8 - do - if attached options.item ("theme") as s then - Result := s - elseif dft /= Void then - Result := dft - else - Result := "default" - end - end - - site_id: READABLE_STRING_8 - do - if attached options.item ("site.id") as s then - Result := s - else - Result := "_EWF_CMS_NO_ID_" - end - end - - site_name (dft: like site_name): READABLE_STRING_8 - do - if attached options.item ("site.name") as s then - Result := s - else - Result := dft - end - end - - site_url (dft: like site_url): READABLE_STRING_8 - do - if attached options.item ("site.url") as s then - Result := s - else - Result := dft - end - if Result /= Void then - if Result.is_empty then - -- ok - elseif not Result.ends_with ("/") then - Result := Result + "/" - end - end - end - - site_script_url (dft: like site_script_url): detachable READABLE_STRING_8 - do - if attached options.item ("site.script_url") as s then - Result := s - else - Result := dft - end - if Result /= Void then - if Result.is_empty then - elseif not Result.ends_with ("/") then - Result := Result + "/" - end - end - end - - site_email (dft: like site_email): READABLE_STRING_8 - do - if attached options.item ("site.email") as s then - Result := s - else - Result := dft - end - end - -feature -- Change - - get_var_location - local - utf: UTF_CONVERTER - do - if attached options.item ("var-dir") as s then - create var_location.make_from_string (utf.utf_8_string_8_to_escaped_string_32 (s)) - else - var_location := execution_environment.current_working_path - end - end - - get_root_location - local - utf: UTF_CONVERTER - do - if attached options.item ("root-dir") as s then - create root_location.make_from_string (utf.utf_8_string_8_to_escaped_string_32 (s)) - else - root_location := execution_environment.current_working_path - end - end - - get_files_location - local - utf: UTF_CONVERTER - do - if attached options.item ("files-dir") as s then - create files_location.make_from_string (utf.utf_8_string_8_to_escaped_string_32 (s)) - else - create files_location.make_from_string ("files") - end - end - - get_themes_location - local - utf: UTF_CONVERTER - do - if attached options.item ("themes-dir") as s then - create themes_location.make_from_string (utf.utf_8_string_8_to_escaped_string_32 (s)) - else - themes_location := root_location.extended ("themes") - end - end - -feature {NONE} -- Implementation - - import_from_file (fn: READABLE_STRING_GENERAL) - do - import_from_path (create {PATH}.make_from_string (fn)) - end - - import_from_path (a_filename: PATH) - -- Import ini file content - local - f: PLAIN_TEXT_FILE - l,v: STRING_8 - p: INTEGER - do - create f.make_with_path (a_filename) - if f.exists and f.is_readable then - f.open_read - from - f.read_line - until - f.exhausted - loop - l := f.last_string - l.left_adjust - if not l.is_empty then - if l[1] = '#' then - -- commented line - else - p := l.index_of ('=', 1) - if p > 1 then - v := l.substring (p + 1, l.count) - l.keep_head (p - 1) - v.left_adjust - v.right_adjust - l.right_adjust - - if l.is_case_insensitive_equal ("@include") then - import_from_file (resolved_string (v)) - else - set_option (l.as_lower, resolved_string (v)) - end - end - end - end - f.read_line - end - f.close - end - end - -feature {NONE} -- Environment - - resolved_string (s: READABLE_STRING_8): STRING_32 - -- Resolved `s' using `options' or else environment variables. - local - i,n,b,e: INTEGER - k: detachable READABLE_STRING_8 - do - from - i := 1 - n := s.count - create Result.make (s.count) - until - i > n - loop - if i + 1 < n and then s[i] = '$' and then s[i+1] = '{' then - b := i + 2 - e := s.index_of ('}', b) - 1 - if e > 0 then - k := s.substring (b, e) - if attached option (k) as v then - if attached {READABLE_STRING_32} v as s32 then - Result.append (s32) - else - Result.append (v.out) - end - i := e + 1 - elseif attached execution_environment.item (k) as v then - Result.append (v) - i := e + 1 - else - Result.extend (s[i]) - end - else - Result.extend (s[i]) - end - else - Result.extend (s[i]) - end - i := i + 1 - end - end - - - -end diff --git a/draft/application/cms/src/cms_custom_setup.e b/draft/application/cms/src/cms_custom_setup.e deleted file mode 100644 index bc37ed0f..00000000 --- a/draft/application/cms/src/cms_custom_setup.e +++ /dev/null @@ -1,18 +0,0 @@ -note - description: "Summary description for {CMS_CUSTOM_SETUP}." - author: "" - date: "$Date$" - revision: "$Revision$" - -class - CMS_CUSTOM_SETUP - -inherit - CMS_DEFAULT_SETUP - -create - default_create, - make, - make_from_file - -end diff --git a/draft/application/cms/src/cms_default_setup.e b/draft/application/cms/src/cms_default_setup.e deleted file mode 100644 index 96002a52..00000000 --- a/draft/application/cms/src/cms_default_setup.e +++ /dev/null @@ -1,132 +0,0 @@ -note - description: "Summary description for {CMS_DEFAULT_SETUP}." - author: "" - date: "$Date$" - revision: "$Revision$" - -class - CMS_DEFAULT_SETUP - -inherit - CMS_SETUP - redefine - default_create - end - -create - default_create, - make, - make_from_file - -feature {NONE} -- Initialization - - make (a_cfg: CMS_CONFIGURATION) - do - configuration := a_cfg - default_create - end - - make_from_file (fn: READABLE_STRING_GENERAL) - local - cfg: CMS_CONFIGURATION - do - create cfg.make_from_file (fn) - make (cfg) - end - - default_create - do - Precursor - build_modules - build_storage - build_session_manager - build_auth_engine - build_mailer - end - -feature -- Access - - modules: ARRAYED_LIST [CMS_MODULE] - - storage: CMS_STORAGE - -- CMS persistent layer - - session_manager: WSF_SESSION_MANAGER - -- CMS Session manager - - auth_engine: CMS_AUTH_ENGINE - -- CMS Authentication engine - - mailer: NOTIFICATION_MAILER - -feature {NONE} -- Initialization - - build_modules - local - m: CMS_MODULE - do - create modules.make (3) - - -- Core - create {USER_MODULE} m.make - m.enable - modules.extend (m) - - create {ADMIN_MODULE} m.make - m.enable - modules.extend (m) - - create {NODE_MODULE} m.make - m.enable - modules.extend (m) - end - - build_storage - local - dn: PATH - do - if attached configuration as cfg and then attached cfg.var_location as l_site_var_dir then - dn := l_site_var_dir - else - create dn.make_current - end - create {CMS_SED_STORAGE} storage.make (dn.extended ("_storage_").name) - end - - build_session_manager - local - dn: PATH - do - if attached configuration as cfg and then attached cfg.var_location as l_site_var_dir then - dn := l_site_var_dir - else - create dn.make_empty - end - dn := dn.extended ("_storage_").extended ("_sessions_") - create {WSF_FS_SESSION_MANAGER} session_manager.make_with_folder (dn.name) - end - - build_auth_engine - do - create {CMS_STORAGE_AUTH_ENGINE} auth_engine.make (storage) - end - - build_mailer - local - ch_mailer: NOTIFICATION_CHAIN_MAILER - st_mailer: CMS_STORAGE_MAILER - do - create st_mailer.make (storage) - create ch_mailer.make (st_mailer) - ch_mailer.set_next (create {NOTIFICATION_SENDMAIL_MAILER}) - mailer := ch_mailer - end - -feature -- Change - - add_module (m: CMS_MODULE) - do - modules.force (m) - end - -end diff --git a/draft/application/cms/src/cms_execution.e b/draft/application/cms/src/cms_execution.e deleted file mode 100644 index 06e1f8db..00000000 --- a/draft/application/cms/src/cms_execution.e +++ /dev/null @@ -1,715 +0,0 @@ -note - description: "[ - This is the execution of the cms handler request - It builds the content to get process to render the output - ]" - -deferred class - CMS_EXECUTION - -inherit - CMS_COMMON_API - -feature {NONE} -- Initialization - - make (req: WSF_REQUEST; res: WSF_RESPONSE; a_service: like service) - do - status_code := {HTTP_STATUS_CODE}.ok - service := a_service - request := req - response := res - create header.make - initialize - end - - initialize - do - is_front := service.is_front_page (request) - has_js := True -- by default it is true, check cookie to see if this is not supported. - if attached request.cookie ("has_js") as c_has_js then - has_js := c_has_js.same_string ("0") - end - get_theme - controller := service.session_controller (request) - create menu_system.make - create blocks.make (3) - - if attached {like message} session_item (pending_messages_session_item_name) as m then - message := m - end - remove_session_item (pending_messages_session_item_name) - end - -feature -- Access - - service: CMS_SERVICE - request: WSF_REQUEST - -feature {CMS_SESSION_CONTROLER} -- Access: restricted - - response: WSF_RESPONSE - - controller: CMS_SESSION_CONTROLER - - pending_messages_session_item_name: STRING = "cms.pending_messages" - -- Session item name to get the pending messages. - -feature -- Access: CMS - - site_name: STRING_32 - do - Result := service.site_name - end - - front_page_url: READABLE_STRING_8 - do - Result := url ("/", Void) - end - -feature -- Permission - - frozen has_permissions (lst: detachable ITERABLE [READABLE_STRING_8]): BOOLEAN - do - if lst = Void then - Result := True - else - Result := across lst as c all has_permission (c.item) end - end - end - - frozen has_permission (s: detachable READABLE_STRING_8): BOOLEAN - -- Anonymous or Current `user' has permission for `s' - --| `s' could be "create page", - local - u: detachable CMS_USER - do - if s = Void then - Result := True - else - if s.same_string ("authenticated") then - Result := authenticated - else - u := user - if u /= Void and then u.is_admin then - Result := True - else - Result := service.user_has_permission (u, s) - end - end - end - end - -feature -- Status - - is_front: BOOLEAN - - has_js: BOOLEAN - -- Client has javascript enabled? - -- FIXME: not yet implemented - - is_mobile: BOOLEAN - -- Is Client on mobile device? - -- FIXME: not yet implemented - -feature -- Theme - - theme: CMS_THEME - - get_theme - do - create {DEFAULT_CMS_THEME} theme.make (service) - end - -feature -- Access: User - - authenticated: BOOLEAN - do - Result := user /= Void - end - - user: detachable CMS_USER - do - if attached {CMS_USER} session_item ("user") as u then - Result := u - end - end - - last_user_access_date: detachable DATE_TIME - do - if attached {DATE_TIME} session_item ("last_access") as dt then - Result := dt - end - end - -feature -- Element change: user - - login (u: attached like user; req: WSF_REQUEST) - do - controller.start_session (req) - u.set_last_login_date_now - storage.save_user (u) - set_user (u) - init_last_user_access_date - log ("user", "user %"" + u.name + "%" signed in.", 0, user_local_link (u)) - end - - logout (req: WSF_REQUEST) - require - authenticated - do - if attached user as u then - log ("user", "user %"" + u.name + "%" signed out.", 0, user_local_link (u)) - end - set_user (Void) - controller.start_session (req) - end - -feature -- Logging - - log (a_category: READABLE_STRING_8; a_message: READABLE_STRING_8; a_level: INTEGER; a_link: detachable CMS_LINK) - local - l_log: CMS_LOG - do - create l_log.make (a_category, a_message, a_level, Void) - if a_link /= Void then - l_log.set_link (a_link) - end - l_log.set_info (request.http_user_agent) - service.storage.save_log (l_log) - end - -feature -- Menu - - menu_system: CMS_MENU_SYSTEM - - main_menu: CMS_MENU - do - Result := menu_system.main_menu - end - - management_menu: CMS_MENU - do - Result := menu_system.management_menu - end - - navigation_menu: CMS_MENU - do - Result := menu_system.navigation_menu - end - - user_menu: CMS_MENU - do - Result := menu_system.user_menu - end - - primary_tabs: CMS_MENU - do - Result := menu_system.primary_tabs - end - -feature -- Menu: change - - add_to_main_menu (lnk: CMS_LINK) - do - if attached {CMS_LOCAL_LINK} lnk as l_local then - l_local.get_is_active (request) - end - main_menu.extend (lnk) - end - - add_to_menu (lnk: CMS_LINK; m: CMS_MENU) - do - if attached {CMS_LOCAL_LINK} lnk as l_local then - l_local.get_is_active (request) - end - m.extend (lnk) - end - -feature -- Message - - add_message (a_msg: READABLE_STRING_8; a_category: detachable READABLE_STRING_8) - local - m: like message - do - m := message - if m = Void then - create m.make (a_msg.count + 9) - message := m - end - if a_category /= Void then - m.append ("
  • ") - else - m.append ("
  • ") - end - m.append (a_msg + "
  • ") - end - - add_notice_message (a_msg: READABLE_STRING_8) - do - add_message (a_msg, "notice") - end - - add_warning_message (a_msg: READABLE_STRING_8) - do - add_message (a_msg, "warning") - end - - add_error_message (a_msg: READABLE_STRING_8) - do - add_message (a_msg, "error") - end - - add_success_message (a_msg: READABLE_STRING_8) - do - add_message (a_msg, "success") - end - - report_form_errors (fd: WSF_FORM_DATA) - require - has_error: not fd.is_valid - do - if attached fd.errors as errs then - across - errs as err - loop - if attached err.item as e then - if attached e.field as l_field then - if attached e.message as e_msg then - add_error_message (e_msg) --"Field [" + l_field.name + "] is invalid. " + e_msg) - else - add_error_message ("Field [" + l_field.name + "] is invalid.") - end - elseif attached e.message as e_msg then - add_error_message (e_msg) - end - end - end - end - end - - message: detachable STRING_8 - -feature -- Blocks - - formats: CMS_FORMATS - once - create Result - end - - blocks: ARRAYED_LIST [TUPLE [block: CMS_BLOCK; name: READABLE_STRING_8; region: READABLE_STRING_8]] - - add_block (b: CMS_BLOCK; a_region: detachable READABLE_STRING_8) - do - if a_region /= Void then - blocks.extend ([b, b.name, a_region]) - elseif attached block_region (b) as l_region then - blocks.extend ([b, b.name, l_region]) - end - end - - block_region (b: CMS_BLOCK): detachable READABLE_STRING_8 - local - l_name: READABLE_STRING_8 - do - l_name := b.name - if l_name.starts_with ("footer") then - Result := "footer" - elseif l_name.starts_with ("management") then - Result := "first_sidebar" - elseif l_name.starts_with ("navigation") then - Result := "first_sidebar" - elseif l_name.starts_with ("user") then - Result := "first_sidebar" - else - Result := "first_sidebar" - end - -- FIXME: let the user choose ... - end - - get_blocks - local - b: CMS_CONTENT_BLOCK - s: STRING_8 - m: CMS_MENU - do - m := management_menu - if not m.is_empty then - add_block (create {CMS_MENU_BLOCK}.make (m), Void) - end - - m := navigation_menu - if not m.is_empty then - add_block (create {CMS_MENU_BLOCK}.make (m), Void) - end - - m := user_menu - if not m.is_empty then - add_block (create {CMS_MENU_BLOCK}.make (m), Void) - end - --- create s.make_empty --- s.append ("This site demonstrates a first implementation of CMS using EWF.%N") --- create b.make ("about", "About", s, formats.plain_text) --- add_block (b, "second_sidebar") - - create s.make_empty - s.append ("Made with EWF") - create b.make ("made_with", Void, s, formats.full_html) - add_block (b, "footer") - - service.hook_block_view (Current) - end - -feature -- Access - - status_code: INTEGER - - header: WSF_HEADER - - title: detachable READABLE_STRING_32 - -- HTML>head>title value - - page_title: detachable READABLE_STRING_32 - -- Page title - - additional_page_head_lines: detachable LIST [READABLE_STRING_8] - -- HTML>head>...extra lines - - main_content: detachable STRING_8 - - redirection: detachable READABLE_STRING_8 - -feature -- Generation - - prepare_menu_system (a_menu_system: CMS_MENU_SYSTEM) - do - across - a_menu_system as c - loop - prepare_links (c.item) - end - end - - prepare_links (a_menu: CMS_LINK_COMPOSITE) - local - to_remove: ARRAYED_LIST [CMS_LINK] - do - create to_remove.make (0) - across - a_menu as c - loop - if attached {CMS_LOCAL_LINK} c.item as lm then - if attached lm.permission_arguments as perms and then not has_permissions (perms) then - to_remove.force (lm) - else - -- if lm.permission_arguments is Void , this is permitted - lm.get_is_active (request) - if attached {CMS_LINK_COMPOSITE} lm as comp then - prepare_links (comp) - end - end - elseif attached {CMS_LINK_COMPOSITE} c.item as comp then - prepare_links (comp) - end - end - across - to_remove as c - loop - a_menu.remove (c.item) - end - end - - prepare (page: CMS_HTML_PAGE) - local - s: STRING_8 - do - if attached additional_page_head_lines as l_head_lines then - across - l_head_lines as hl - loop - page.head_lines.force (hl.item) - end - end - - add_to_main_menu (create {CMS_LOCAL_LINK}.make ("Home", "/")) - - service.call_menu_alter_hooks (menu_system, Current) - prepare_menu_system (menu_system) - - get_blocks - - if attached title as l_title then - page.set_title (l_title) - else - page.set_title ("CMS::" + request.path_info) - end - - page.add_to_header_region (top_header_region) - page.add_to_header_region (header_region) - if attached message as m and then not m.is_empty then - page.add_to_content_region ("
    " + m + "
    ") - end - page.add_to_content_region ("%N") - if attached page_title as l_page_title then - page.add_to_content_region ("

    "+ l_page_title +"

    %N") - end - if attached primary_tabs as tabs_menu and then not tabs_menu.is_empty then - page.add_to_content_region (theme.menu_html (tabs_menu, True)) - end - page.add_to_content_region (content_region) - - -- blocks - across - blocks as c - loop - if attached c.item as b_info then - create s.make_from_string ("
    ") - if attached b_info.block.title as l_title then - s.append ("
    " + html_encoded (l_title) + "
    ") - end - s.append ("
    ") - s.append (b_info.block.to_html (theme)) - s.append ("
    ") - s.append ("
    ") - page.add_to_region (s, b_info.region) - end - end - end - - logo_location: STRING - do - Result := url ("/theme/logo.png", Void) - end - - top_header_region: STRING_8 - do - Result := "
    " + html_encoded (site_name) + "
    " - Result.append ("
    ") - Result.append (theme.menu_html (main_menu, True)) - Result.append ("
    ") - end - - header_region: STRING_8 - do - Result := "" - end - - content_region: STRING_8 - do - if attached main_content as l_content then - Result := l_content - else - Result := "" - debug - Result := "No Content" - end - end - end - -feature -- Head customization - - add_additional_head_line (s: READABLE_STRING_8; a_allow_duplication: BOOLEAN) - local - lst: like additional_page_head_lines - do - lst := additional_page_head_lines - if lst = Void then - create {ARRAYED_LIST [like additional_page_head_lines.item]} lst.make (1) - additional_page_head_lines := lst - end - if a_allow_duplication or else across lst as c all not c.item.same_string (s) end then - lst.extend (s) - end - end - - add_style (a_href: STRING; a_media: detachable STRING) - local - s: STRING_8 - do - s := "") - add_additional_head_line (s, False) - end - - add_javascript_url (a_src: STRING) - local - s: STRING_8 - do - s := "" - add_additional_head_line (s, False) - end - - add_javascript_content (a_script: STRING) - local - s: STRING_8 - do - s := "" - add_additional_head_line (s, True) - end - -feature -- Element change - - set_title (t: like title) - do - title := t - set_page_title (t) - end - - set_page_title (t: like page_title) - do - page_title := t - end - - set_main_content (s: like main_content) - do - main_content := s - end - - set_redirection (a_url: like redirection) - do - if a_url /= Void and then a_url.same_string (request.path_info) and request.is_get_request_method then - redirection := Void - else - redirection := a_url - end - end - -feature -- Execution - - execute - do - begin - process - terminate - end - -feature {NONE} -- Execution - - begin - do - end - - process - deferred - end - - frozen terminate - local - cms_page: CMS_HTML_PAGE - page: CMS_HTML_PAGE_RESPONSE - do - create cms_page.make - prepare (cms_page) - - create page.make (theme.page_html (cms_page)) - if attached redirection as l_redirection then - if attached message as m then - set_session_item ("cms.pending_messages", m) - end - page.set_status_code ({HTTP_STATUS_CODE}.found) - page.header.put_location (l_redirection) - else - page.set_status_code (status_code) - end - - controller.session_commit (page, Current) - response.send (page) - on_terminated - end - - on_terminated - do - - end - -feature {NONE} -- Implementation - - set_user (u: like user) - do - set_session_item ("user", u) - end - - init_last_user_access_date - do - set_session_item ("last_access", (create {DATE_TIME}.make_now_utc)) - end - -feature -- Access: Session - - session_item (k: READABLE_STRING_GENERAL): detachable ANY - do - Result := controller.session.item (k) - end - - set_session_item (k: READABLE_STRING_GENERAL; v: detachable ANY) - do - controller.session.remember (v, k) - end - - remove_session_item (k: READABLE_STRING_GENERAL) - do - controller.session.forget (k) - end - -feature -- Storage - - storage: CMS_STORAGE - do - Result := service.storage - end - -feature -- Helper: output - - user_local_link (u: CMS_USER): CMS_LINK - do - create {CMS_LOCAL_LINK} Result.make (u.name, user_url (u)) - end - - node_local_link (n: CMS_NODE): CMS_LINK - do - create {CMS_LOCAL_LINK} Result.make (n.title, node_url (n)) - end - - truncated_string (s: READABLE_STRING_8; nb: INTEGER; a_ellipsis: detachable READABLE_STRING_8): STRING_8 - -- Truncated string `s' to `nb' character - require - a_ellipsis /= Void implies a_ellipsis.count < nb - local - f: CMS_NO_HTML_FILTER - do - if s.count <= nb then - Result := s.string - else - create f - create Result.make_from_string (s) - f.filter (Result) - if Result.count > nb then - if a_ellipsis /= Void and then not a_ellipsis.is_empty then - Result.keep_head (nb - a_ellipsis.count) - Result.append (a_ellipsis) - else - Result.keep_head (nb - 3) - Result.append ("...") - end - end - end - end - -feature -- Helper: request - - non_empty_string_path_parameter (a_name: READABLE_STRING_GENERAL): detachable STRING - do - if - attached {WSF_STRING} request.path_parameter (a_name) as p and then - not p.is_empty - then - Result := p.value - end - end - -invariant - -end diff --git a/draft/application/cms/src/cms_html_page_response.e b/draft/application/cms/src/cms_html_page_response.e deleted file mode 100644 index 97af15fb..00000000 --- a/draft/application/cms/src/cms_html_page_response.e +++ /dev/null @@ -1,77 +0,0 @@ -note - description: "Summary description for {CMS_HTML_PAGE_RESPONSE}." - author: "" - date: "$Date$" - revision: "$Revision$" - -class - CMS_HTML_PAGE_RESPONSE - -inherit - WSF_RESPONSE_MESSAGE - -create - make - -feature {NONE} -- Initialization - - make (a_html: like html) - do - html := a_html - status_code := {HTTP_STATUS_CODE}.ok - create header.make - header.put_content_type_text_html - end - -feature -- Status - - status_code: INTEGER - -feature -- Header - - header: HTTP_HEADER - -feature -- Html access - - html: STRING - -feature -- Element change - - set_status_code (c: like status_code) - do - status_code := c - end - -feature {WSF_RESPONSE} -- Output - - send_to (res: WSF_RESPONSE) - local - h: like header - s: STRING_8 - do - h := header - res.set_status_code (status_code) - s := html - - if not h.has_content_length then - h.put_content_length (s.count) - end - if not h.has_content_type then - h.put_content_type_text_html - end - res.put_header_text (h.string) - res.put_string (s) - end - -note - copyright: "2011-2012, Jocelyn Fiat, Javier Velilla, Eiffel Software and others" - license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" - source: "[ - Eiffel Software - 5949 Hollister Ave., Goleta, CA 93117 USA - Telephone 805-685-1006, Fax 805-685-6869 - Website http://www.eiffel.com - Customer support http://support.eiffel.com - ]" -end - diff --git a/draft/application/cms/src/cms_service.e b/draft/application/cms/src/cms_service.e deleted file mode 100644 index c0bab037..00000000 --- a/draft/application/cms/src/cms_service.e +++ /dev/null @@ -1,442 +0,0 @@ -note - description: "[ - This class implements the CMS service - - It could be used to implement the main EWF service, or - even for a specific handler. - ]" - -class - CMS_SERVICE - -inherit - WSF_SERVICE - -create - make - -feature {NONE} -- Initialization - - make (a_setup: CMS_SETUP) - local - cfg: detachable CMS_CONFIGURATION - do - cfg := a_setup.configuration - if cfg = Void then - create cfg.make - end - - configuration := cfg - base_url := a_setup.base_url - - site_id := cfg.site_id - site_url := cfg.site_url ("") - site_name := cfg.site_name ("EWF::CMS") - site_email := cfg.site_email ("webmaster") - site_dir := cfg.root_location - site_var_dir := cfg.var_location - files_location := cfg.files_location - themes_location := cfg.themes_location - theme_name := cfg.theme_name ("default") - - set_script_url (cfg.site_script_url (Void)) -- Temporary value - - compute_theme_resource_location - - create content_types.make (3) - - modules := a_setup.modules - storage := a_setup.storage - session_manager := a_setup.session_manager - auth_engine := a_setup.auth_engine - mailer := a_setup.mailer - - initialize_storage - initialize_auth_engine - initialize_session_manager - initialize_mailer - initialize_router - initialize_modules - end - - initialize_session_manager --- local --- dn: DIRECTORY_NAME - do --- create dn.make_from_string (site_var_dir) --- dn.extend ("_storage_") --- dn.extend ("_sessions_") --- create {WSF_FS_SESSION_MANAGER} session_manager.make_with_folder (dn.string) - end - - initialize_storage - do - if not storage.has_user then - initialize_users - end - end - - initialize_users - require - has_no_user: not storage.has_user - local - u: CMS_USER - ur: CMS_USER_ROLE - do - create u.make_new ("admin") - u.set_password ("istrator") - storage.save_user (u) - - create ur.make_with_id (1, "anonymous") - storage.save_user_role (ur) - create ur.make_with_id (2, "authenticated") - ur.add_permission ("create page") - ur.add_permission ("edit page") - storage.save_user_role (ur) - end - - initialize_mailer - local --- ch_mailer: CMS_CHAIN_MAILER --- st_mailer: CMS_STORAGE_MAILER - do --- create st_mailer.make (storage) --- create ch_mailer.make (st_mailer) --- ch_mailer.set_next (create {CMS_SENDMAIL_MAILER}) --- mailer := ch_mailer - end - - initialize_router - local --- h: CMS_HANDLER - file_hdl: CMS_FILE_SYSTEM_HANDLER - do - create router.make (10) - router.set_base_url (base_url) - - router.map (create {WSF_URI_MAPPING}.make ("/", create {CMS_HANDLER}.make (agent handle_home))) - router.map (create {WSF_URI_MAPPING}.make ("/favicon.ico", create {CMS_HANDLER}.make (agent handle_favicon))) - - create file_hdl.make_with_path (files_location) - file_hdl.disable_index - file_hdl.set_max_age (8*60*60) - router.map (create {WSF_STARTS_WITH_MAPPING}.make ("/files/", file_hdl)) - - create file_hdl.make_with_path (theme_resource_location) - file_hdl.set_max_age (8*60*60) - router.map (create {WSF_STARTS_WITH_MAPPING}.make ("/theme/", file_hdl)) - end - - initialize_modules - do - across - modules as m - loop - if m.item.is_enabled then - m.item.register (Current) - if attached {CMS_HOOK_AUTO_REGISTER} m.item as h_auto then - h_auto.hook_auto_register (Current) - end - end - end - end - - initialize_auth_engine - do --- create {CMS_STORAGE_AUTH_ENGINE} auth_engine.make (storage) - end - -feature -- Access - - configuration: CMS_CONFIGURATION - - auth_engine: CMS_AUTH_ENGINE - - modules: LIST [CMS_MODULE] - -feature -- Hook: menu_alter - - add_menu_alter_hook (h: like menu_alter_hooks.item) - local - lst: like menu_alter_hooks - do - lst := menu_alter_hooks - if lst = Void then - create lst.make (1) - menu_alter_hooks := lst - end - if not lst.has (h) then - lst.force (h) - end - end - - menu_alter_hooks: detachable ARRAYED_LIST [CMS_HOOK_MENU_ALTER] - - call_menu_alter_hooks (m: CMS_MENU_SYSTEM; a_execution: CMS_EXECUTION) - do - if attached menu_alter_hooks as lst then - across - lst as c - loop - c.item.menu_alter (m, a_execution) - end - end - end - -feature -- Hook: form_alter - - add_form_alter_hook (h: like form_alter_hooks.item) - local - lst: like form_alter_hooks - do - lst := form_alter_hooks - if lst = Void then - create lst.make (1) - form_alter_hooks := lst - end - if not lst.has (h) then - lst.force (h) - end - end - - form_alter_hooks: detachable ARRAYED_LIST [CMS_HOOK_FORM_ALTER] - - call_form_alter_hooks (f: CMS_FORM; a_form_data: detachable WSF_FORM_DATA; a_execution: CMS_EXECUTION) - do - if attached form_alter_hooks as lst then - across - lst as c - loop - c.item.form_alter (f, a_form_data, a_execution) - end - end - end - -feature -- Hook: block - - add_block_hook (h: like block_hooks.item) - local - lst: like block_hooks - do - lst := block_hooks - if lst = Void then - create lst.make (1) - block_hooks := lst - end - if not lst.has (h) then - lst.force (h) - end - end - - block_hooks: detachable ARRAYED_LIST [CMS_HOOK_BLOCK] - - hook_block_view (a_execution: CMS_EXECUTION) - do - if attached block_hooks as lst then - across - lst as c - loop - across - c.item.block_list as blst - loop - c.item.get_block_view (blst.item, a_execution) - end - end - end - end - -feature -- Router - - site_id: READABLE_STRING_8 - - site_name: READABLE_STRING_32 - - site_email: READABLE_STRING_8 - - site_url: READABLE_STRING_8 - - site_dir: PATH - - site_var_dir: PATH - - files_location: PATH - - themes_location: PATH - - compute_theme_resource_location - do - theme_resource_location := themes_location.extended (theme_name).extended ("res") - end - - theme_resource_location: PATH - - theme_name: READABLE_STRING_32 - - router: WSF_ROUTER - - map_uri_template (tpl: STRING; proc: PROCEDURE [ANY, TUPLE [req: WSF_REQUEST; res: WSF_RESPONSE]]) - do - router.map (create {WSF_URI_TEMPLATE_MAPPING}.make_from_template (tpl, create {CMS_HANDLER}.make (proc))) - end - - map_uri (a_uri: STRING; proc: PROCEDURE [ANY, TUPLE [req: WSF_REQUEST; res: WSF_RESPONSE]]) - do - router.map (create {WSF_URI_MAPPING}.make (a_uri, create {CMS_HANDLER}.make (proc))) - end - -feature -- URL related - - front_path: STRING - do - if attached base_url as l_base_url then - Result := l_base_url + "/" - else - Result := "/" - end - end - - urls_set: BOOLEAN - - initialize_urls (req: WSF_REQUEST) - local - u: like base_url - do - if not urls_set then - u := base_url - if u = Void then - u := "" - end - urls_set := True - if site_url.is_empty then - site_url := req.absolute_script_url (u) - end - set_script_url (req.script_url (u)) - end - end - - base_url: detachable READABLE_STRING_8 - -- Base url (related to the script path). - - script_url: detachable READABLE_STRING_8 - - set_script_url (a_url: like script_url) - local - s: STRING_8 - do - if a_url = Void then - script_url := Void - elseif not a_url.is_empty then - if a_url.ends_with ("/") then - create s.make_from_string (a_url) - else - create s.make (a_url.count + 1) - s.append (a_url) - s.append_character ('/') - end - script_url := s - end - ensure - attached script_url as l_url implies l_url.ends_with ("/") - end - -feature -- Report - - is_front_page (req: WSF_REQUEST): BOOLEAN - do - Result := req.path_info.same_string (front_path) - end - -feature {CMS_EXECUTION, CMS_MODULE} -- Security report - - user_has_permission (u: detachable CMS_USER; s: detachable READABLE_STRING_8): BOOLEAN - -- Anonymous or user `u' has permission for `s' ? - --| `s' could be "create page", - do - Result := storage.user_has_permission (u, s) - end - -feature -- Storage - - session_controller (req: WSF_REQUEST): CMS_SESSION_CONTROLER - -- New session controller for request `req' - do - create Result.make (req, session_manager, site_id) - end - - session_manager: WSF_SESSION_MANAGER - -- CMS Session manager - - storage: CMS_STORAGE - -feature -- Logging - - log (a_category: READABLE_STRING_8; a_message: READABLE_STRING_8; a_level: INTEGER; a_link: detachable CMS_LINK) - local - l_log: CMS_LOG - do - create l_log.make (a_category, a_message, a_level, Void) - if a_link /= Void then - l_log.set_link (a_link) - end - storage.save_log (l_log) - end - -feature -- Content type - - content_types: ARRAYED_LIST [CMS_CONTENT_TYPE] - -- Available content types - - add_content_type (a_type: CMS_CONTENT_TYPE) - do - content_types.force (a_type) - end - - content_type (a_name: READABLE_STRING_8): detachable CMS_CONTENT_TYPE - do - across - content_types as t - until - Result /= Void - loop - if t.item.name.same_string (a_name) then - Result := t.item - end - end - end - -feature -- Notification - - mailer: NOTIFICATION_MAILER - -feature -- Core Execution - - handle_favicon (req: WSF_REQUEST; res: WSF_RESPONSE) - local - fres: WSF_FILE_RESPONSE - do - create fres.make_with_path (theme_resource_location.extended ("favicon.ico")) - fres.set_expires_in_seconds (7 * 24 * 60 * 60) -- 7 jours - res.send (fres) - end - - handle_home (req: WSF_REQUEST; res: WSF_RESPONSE) - do - (create {HOME_CMS_EXECUTION}.make (req, res, Current)).execute - end - - execute (req: WSF_REQUEST; res: WSF_RESPONSE) - -- Default request handler if no other are relevant - local - e: CMS_EXECUTION - sess: WSF_ROUTER_SESSION - do - initialize_urls (req) - create sess - router.dispatch (req, res, sess) - if not sess.dispatched then - create {NOT_FOUND_CMS_EXECUTION} e.make (req, res, Current) - e.execute - end - end - -end diff --git a/draft/application/cms/src/cms_session.e b/draft/application/cms/src/cms_session.e deleted file mode 100644 index 926d6f35..00000000 --- a/draft/application/cms/src/cms_session.e +++ /dev/null @@ -1,33 +0,0 @@ -note - description: "Summary description for {WSF_SESSION}." - author: "" - date: "$Date$" - revision: "$Revision$" - -class - CMS_SESSION - -inherit - WSF_COOKIE_SESSION - -create - make, - make_new - -feature -- Access - - - -note - copyright: "Copyright (c) 1984-2012, Eiffel Software and others" - license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" - source: "[ - Eiffel Software - 5949 Hollister Ave., Goleta, CA 93117 USA - Telephone 805-685-1006, Fax 805-685-6869 - Website http://www.eiffel.com - Customer support http://support.eiffel.com - ]" - -end - diff --git a/draft/application/cms/src/cms_setup.e b/draft/application/cms/src/cms_setup.e deleted file mode 100644 index 2f2902ba..00000000 --- a/draft/application/cms/src/cms_setup.e +++ /dev/null @@ -1,55 +0,0 @@ -note - description: "Summary description for {CMS_SETUP}." - author: "" - date: "$Date$" - revision: "$Revision$" - -deferred class - CMS_SETUP - -feature -- Access - - configuration: detachable CMS_CONFIGURATION - - base_url: detachable READABLE_STRING_8 - - modules: LIST [CMS_MODULE] - deferred - end - - storage: CMS_STORAGE - -- CMS persistent layer - deferred - end - - session_manager: WSF_SESSION_MANAGER - -- CMS Session manager - deferred - end - - auth_engine: CMS_AUTH_ENGINE - -- CMS Authentication engine - deferred - end - - mailer: NOTIFICATION_MAILER - -- CMS email engine - deferred - end - -feature -- Change - - set_base_url (a_base_url: like base_url) - do - if a_base_url /= Void and then not a_base_url.is_empty then - base_url := a_base_url - else - base_url := Void - end - end - - add_module (m: CMS_MODULE) - deferred - end - -end diff --git a/draft/application/cms/src/default_theme/default_cms_html_template.e b/draft/application/cms/src/default_theme/default_cms_html_template.e deleted file mode 100644 index 89994bca..00000000 --- a/draft/application/cms/src/default_theme/default_cms_html_template.e +++ /dev/null @@ -1,81 +0,0 @@ -note - description: "Summary description for {CMS_HTML_TEMPLATE}." - author: "" - date: "$Date$" - revision: "$Revision$" - -class - DEFAULT_CMS_HTML_TEMPLATE - -inherit - CMS_HTML_TEMPLATE - -create - make - -feature {NONE} -- Initialization - - make (t: DEFAULT_CMS_THEME) - do - theme := t - create variables.make (0) - end - - variables: HASH_TABLE [detachable ANY, STRING] - -feature -- Access - - register (v: STRING_8; k: STRING_8) - do - variables.force (v, k) - end - - theme: DEFAULT_CMS_THEME - - prepare (page: CMS_HTML_PAGE) - do - variables.make (10) - if attached page.title as l_title then - variables.force (l_title, "title") - variables.force (l_title, "head_title") - else - variables.force ("", "title") - variables.force ("", "head_title") - end - - variables.force (page.language, "language") - variables.force (page.head_lines_to_string, "head_lines") - end - - to_html (page: CMS_HTML_PAGE): STRING - do - -- Process html generation - create Result.make_from_string (template) - apply_template_engine (Result) - end - -feature {NONE} -- Implementation - - template: STRING - once - Result := "[ - - - - $head - $head_title - $styles - $scripts - $head_lines - - - $page_top - $page - $page_bottom - - - ]" - end - - -end diff --git a/draft/application/cms/src/default_theme/default_cms_page_template.e b/draft/application/cms/src/default_theme/default_cms_page_template.e deleted file mode 100644 index e31dc329..00000000 --- a/draft/application/cms/src/default_theme/default_cms_page_template.e +++ /dev/null @@ -1,84 +0,0 @@ -note - description: "Summary description for {CMS_PAGE_TEMPLATE}." - author: "" - date: "$Date$" - revision: "$Revision$" - -class - DEFAULT_CMS_PAGE_TEMPLATE - -inherit - CMS_PAGE_TEMPLATE - -create - make - -feature {NONE} -- Initialization - - make (t: DEFAULT_CMS_THEME) - do - theme := t - create variables.make (0) - end - - variables: HASH_TABLE [detachable ANY, STRING] - -feature -- Access - - theme: DEFAULT_CMS_THEME - - prepare (page: CMS_HTML_PAGE) - do - variables.make (10) - - if attached page.title as l_title then - variables.force (l_title, "title") - else - variables.force ("", "title") - end - across - theme.regions as r - loop - variables.force (page.region (r.item), r.item) - end - end - - to_html (page: CMS_HTML_PAGE): STRING - do - -- Process html generation - create Result.make_from_string (template) - apply_template_engine (Result) - end - -feature -- Registration - - register (v: STRING_8; k: STRING_8) - do - variables.force (v, k) - end - -feature {NONE} -- Implementation - - template: STRING - once - Result := "[ -
    -
    - -
    -
    - -
    $content
    - -
    -
    - -
    -
    - ]" - end - - -end diff --git a/draft/application/cms/src/default_theme/default_cms_theme.e b/draft/application/cms/src/default_theme/default_cms_theme.e deleted file mode 100644 index 00a0334d..00000000 --- a/draft/application/cms/src/default_theme/default_cms_theme.e +++ /dev/null @@ -1,85 +0,0 @@ -note - description: "Summary description for {CMS_THEME}." - author: "" - date: "$Date$" - revision: "$Revision$" - -class - DEFAULT_CMS_THEME - -inherit - CMS_THEME - -create - make - -feature {NONE} -- Initialization - - make (a_service: like service) - do - service := a_service - end - - service: CMS_SERVICE - -feature -- Access - - name: STRING = "CMS" - - regions: ARRAY [STRING] - once - Result := <<"header", "content", "footer", "first_sidebar", "second_sidebar">> - end - - html_template: DEFAULT_CMS_HTML_TEMPLATE - local - tpl: like internal_html_template - do - tpl := internal_html_template - if tpl = Void then - create tpl.make (Current) - internal_html_template := tpl - end - Result := tpl - end - - page_template: DEFAULT_CMS_PAGE_TEMPLATE - local - tpl: like internal_page_template - do - tpl := internal_page_template - if tpl = Void then - create tpl.make (Current) - internal_page_template := tpl - end - Result := tpl - end - -feature -- Conversion - - prepare (page: CMS_HTML_PAGE) - do - page.add_style (url ("/theme/style.css", Void), Void) - end - - page_html (page: CMS_HTML_PAGE): STRING_8 - local - l_content: STRING_8 - do - prepare (page) - page_template.prepare (page) - l_content := page_template.to_html (page) - html_template.prepare (page) - html_template.register (l_content, "page") - Result := html_template.to_html (page) - end - -feature {NONE} -- Internal - - internal_page_template: detachable like page_template - - internal_html_template: detachable like html_template - -invariant - attached internal_page_template as inv_p implies inv_p.theme = Current -end diff --git a/draft/application/cms/src/form/cms_form.e b/draft/application/cms/src/form/cms_form.e deleted file mode 100644 index b0746d51..00000000 --- a/draft/application/cms/src/form/cms_form.e +++ /dev/null @@ -1,43 +0,0 @@ -note - description: "Summary description for {CMS_FORM}." - author: "" - date: "$Date$" - revision: "$Revision$" - -class - CMS_FORM - -inherit - WSF_FORM - rename - process as process_form - end - -create - make - -feature -- Basic operation - - prepare (a_execution: CMS_EXECUTION) - do - a_execution.service.call_form_alter_hooks (Current, Void, a_execution) - end - - process (a_execution: CMS_EXECUTION) - do - process_form (a_execution.request, agent on_prepared (a_execution, ?), agent on_processed (a_execution, ?)) - end - - on_prepared (a_execution: CMS_EXECUTION; fd: WSF_FORM_DATA) - do - a_execution.service.call_form_alter_hooks (Current, fd, a_execution) - end - - on_processed (a_execution: CMS_EXECUTION; fd: WSF_FORM_DATA) - do - if not fd.is_valid or fd.has_error then - a_execution.report_form_errors (fd) - end - end - -end diff --git a/draft/application/cms/src/handler/any_cms_execution.e b/draft/application/cms/src/handler/any_cms_execution.e deleted file mode 100644 index 882e5205..00000000 --- a/draft/application/cms/src/handler/any_cms_execution.e +++ /dev/null @@ -1,61 +0,0 @@ -note - description: "[ - This class implements the web service - - It inherits from WSF_DEFAULT_SERVICE to get default EWF connector ready - And from WSF_URI_TEMPLATE_ROUTED_SERVICE to use the router service - - `initialize' can be redefine to provide custom options if needed. - ]" - -class - ANY_CMS_EXECUTION - -inherit - CMS_EXECUTION - -create - make, - make_with_text - -feature {NONE} -- Initialization - - make_with_text (req: WSF_REQUEST; res: WSF_RESPONSE; h: like service; t: like text) - do - make (req, res, h) - text := t - end - - text: detachable STRING - -feature -- Execution - - process - -- Computed response message. - local - b: STRING_8 - s: STRING - do - if attached main_content as m then - -- ok - elseif attached text as t then - create b.make_empty - s := request.path_info - if attached service.script_url as l_script_url then - if s.starts_with (l_script_url) then - s.remove_head (l_script_url.count) - if s.starts_with ("/") then - s.remove_head (1) - end - end - end - set_title (s) - b.append (t) - set_main_content (b) - else - set_title ("...") - set_main_content ("") - end - end - -end diff --git a/draft/application/cms/src/handler/cms_file_system_handler.e b/draft/application/cms/src/handler/cms_file_system_handler.e deleted file mode 100644 index 6e36d089..00000000 --- a/draft/application/cms/src/handler/cms_file_system_handler.e +++ /dev/null @@ -1,17 +0,0 @@ -note - description: "Summary description for {CMS_FILE_SYSTEM_HANDLER}." - author: "" - date: "$Date$" - revision: "$Revision$" - -class - CMS_FILE_SYSTEM_HANDLER - -inherit - WSF_FILE_SYSTEM_HANDLER - -create - make, - make_with_path - -end diff --git a/draft/application/cms/src/handler/cms_handler.e b/draft/application/cms/src/handler/cms_handler.e deleted file mode 100644 index f678e879..00000000 --- a/draft/application/cms/src/handler/cms_handler.e +++ /dev/null @@ -1,64 +0,0 @@ -note - description: "Summary description for {CMS_HANDLER}." - author: "" - date: "$Date$" - revision: "$Revision$" - -class - CMS_HANDLER - -inherit - WSF_URI_HANDLER - rename - execute as execute_uri - undefine - new_mapping - end - - WSF_URI_TEMPLATE_HANDLER - rename - execute as execute_uri_template - end - - WSF_STARTS_WITH_HANDLER - rename - execute as execute_starts_with - undefine - new_mapping - end - -create - make - -feature {NONE} -- Initialization - - make (e: like action) - do - action := e - end - - action: PROCEDURE [ANY, TUPLE [req: WSF_REQUEST; res: WSF_RESPONSE]] - -feature -- Execution - - execute (req: WSF_REQUEST; res: WSF_RESPONSE) - do - action.call ([req, res]) - end - - execute_uri (req: WSF_REQUEST; res: WSF_RESPONSE) - do - execute (req, res) - end - - execute_uri_template (req: WSF_REQUEST; res: WSF_RESPONSE) - do - execute_uri (req, res) - end - - execute_starts_with (a_start_path: READABLE_STRING_8; req: WSF_REQUEST; res: WSF_RESPONSE) - do - execute_uri (req, res) - end - -end diff --git a/draft/application/cms/src/handler/home_cms_execution.e b/draft/application/cms/src/handler/home_cms_execution.e deleted file mode 100644 index fe79855e..00000000 --- a/draft/application/cms/src/handler/home_cms_execution.e +++ /dev/null @@ -1,52 +0,0 @@ -note - description: "[ - ]" - -class - HOME_CMS_EXECUTION - -inherit - CMS_EXECUTION - -create - make - -feature -- Execution - - process - -- Computed response message. - local --- l_url: READABLE_STRING_8 - b: STRING_8 - do - set_title ("Home") - set_page_title (Void) - create b.make_empty - if attached service.storage.recent_nodes (1, 10) as l_nodes then - across - l_nodes as c - loop - b.append ("
    ") - b.append (c.item.to_html (theme)) - b.append ("
    %N") - end - end - --- b.append ("
      %N") --- l_url := url ("/", Void) --- b.append ("
    • Home
    • %N") --- l_url := url ("/info/", Void) --- b.append ("
    • EWF Info
    • %N") - --- b.append ("
    %N") - - debug ("cms") - if attached controller.session as sess then - b.append ("
    Session#" + sess.uuid + "
    %N") - end - end - - set_main_content (b) - end - -end diff --git a/draft/application/cms/src/handler/not_found_cms_execution.e b/draft/application/cms/src/handler/not_found_cms_execution.e deleted file mode 100644 index 8756855c..00000000 --- a/draft/application/cms/src/handler/not_found_cms_execution.e +++ /dev/null @@ -1,34 +0,0 @@ -note - description: "[ - This class implements the web service - - It inherits from WSF_DEFAULT_SERVICE to get default EWF connector ready - And from WSF_URI_TEMPLATE_ROUTED_SERVICE to use the router service - - `initialize' can be redefine to provide custom options if needed. - ]" - -class - NOT_FOUND_CMS_EXECUTION - -inherit - CMS_EXECUTION - -create - make - -feature -- Execution - - process - -- Computed response message. - local - b: STRING_8 - do - status_code := {HTTP_STATUS_CODE}.not_found - create b.make_empty - set_title ("Page Not Found") - b.append ("The requested page could not be found.%N") - set_main_content (b) - end - -end diff --git a/draft/application/cms/src/handler/theme_cms_execution.e b/draft/application/cms/src/handler/theme_cms_execution.e deleted file mode 100644 index 32999ade..00000000 --- a/draft/application/cms/src/handler/theme_cms_execution.e +++ /dev/null @@ -1,47 +0,0 @@ -note - description: "[ - ]" - -class - THEME_CMS_EXECUTION - -inherit - CMS_EXECUTION - -create - make - -feature -- Execution - - process - -- Computed response message. - local --- l_url: READABLE_STRING_8 - b: STRING_8 - do - set_title ("Home") - create b.make_empty - - b.append ("

    Home

    %N") - if attached service.storage.recent_nodes (1, 10) as l_nodes then - across - l_nodes as c - loop - b.append ("
    ") - b.append (c.item.to_html (theme)) - b.append ("
    %N") - end - end - --- b.append ("
      %N") --- l_url := url ("/", Void) --- b.append ("
    • Home
    • %N") --- l_url := url ("/info/", Void) --- b.append ("
    • EWF Info
    • %N") - --- b.append ("
    %N") - - set_main_content (b) - end - -end diff --git a/draft/application/cms/src/hooks/cms_hook.e b/draft/application/cms/src/hooks/cms_hook.e deleted file mode 100644 index 9e6ae0e7..00000000 --- a/draft/application/cms/src/hooks/cms_hook.e +++ /dev/null @@ -1,10 +0,0 @@ -note - description: "Summary description for {CMS_HOOK}." - author: "" - date: "$Date$" - revision: "$Revision$" - -deferred class - CMS_HOOK - -end diff --git a/draft/application/cms/src/hooks/cms_hook_auto_register.e b/draft/application/cms/src/hooks/cms_hook_auto_register.e deleted file mode 100644 index 8bade763..00000000 --- a/draft/application/cms/src/hooks/cms_hook_auto_register.e +++ /dev/null @@ -1,33 +0,0 @@ -note - description: "[ - Summary description for {CMS_HOOK_AUTO_REGISTER}. - When inheriting from this class, the declared hooks are automatically - registered, otherwise, each descendant has to add it to the cms service - itself. - ]" - date: "$Date$" - revision: "$Revision$" - -deferred class - CMS_HOOK_AUTO_REGISTER - -inherit - CMS_HOOK - -feature -- Hook - - hook_auto_register (a_service: CMS_SERVICE) - do - if attached {CMS_HOOK_MENU_ALTER} Current as h_menu_alter then - a_service.add_menu_alter_hook (h_menu_alter) - end - if attached {CMS_HOOK_BLOCK} Current as h_block then - a_service.add_block_hook (h_block) - end - if attached {CMS_HOOK_FORM_ALTER} Current as h_block then - a_service.add_form_alter_hook (h_block) - end - - end - -end diff --git a/draft/application/cms/src/hooks/cms_hook_block.e b/draft/application/cms/src/hooks/cms_hook_block.e deleted file mode 100644 index 4f55b8b6..00000000 --- a/draft/application/cms/src/hooks/cms_hook_block.e +++ /dev/null @@ -1,23 +0,0 @@ -note - description: "Summary description for {CMS_HOOK_BLOCK}." - author: "" - date: "$Date$" - revision: "$Revision$" - -deferred class - CMS_HOOK_BLOCK - -inherit - CMS_HOOK - -feature -- Hook - - block_list: ITERABLE [like {CMS_BLOCK}.name] - deferred - end - - get_block_view (a_block_id: detachable READABLE_STRING_8; a_execution: CMS_EXECUTION) - deferred - end - -end diff --git a/draft/application/cms/src/hooks/cms_hook_form_alter.e b/draft/application/cms/src/hooks/cms_hook_form_alter.e deleted file mode 100644 index afc45305..00000000 --- a/draft/application/cms/src/hooks/cms_hook_form_alter.e +++ /dev/null @@ -1,19 +0,0 @@ -note - description: "Summary description for {CMS_HOOK_FORM_ALTER}." - author: "" - date: "$Date$" - revision: "$Revision$" - -deferred class - CMS_HOOK_FORM_ALTER - -inherit - CMS_HOOK - -feature -- Hook - - form_alter (a_form: CMS_FORM; a_form_data: detachable WSF_FORM_DATA; a_execution: CMS_EXECUTION) - deferred - end - -end diff --git a/draft/application/cms/src/hooks/cms_hook_menu_alter.e b/draft/application/cms/src/hooks/cms_hook_menu_alter.e deleted file mode 100644 index b3737ab7..00000000 --- a/draft/application/cms/src/hooks/cms_hook_menu_alter.e +++ /dev/null @@ -1,19 +0,0 @@ -note - description: "Summary description for {CMS_HOOK_MENU_ALTER}." - author: "" - date: "$Date$" - revision: "$Revision$" - -deferred class - CMS_HOOK_MENU_ALTER - -inherit - CMS_HOOK - -feature -- Hook - - menu_alter (a_menu_system: CMS_MENU_SYSTEM; a_execution: CMS_EXECUTION) - deferred - end - -end diff --git a/draft/application/cms/src/kernel/api/cms_api_options.e b/draft/application/cms/src/kernel/api/cms_api_options.e deleted file mode 100644 index 1fbfa52c..00000000 --- a/draft/application/cms/src/kernel/api/cms_api_options.e +++ /dev/null @@ -1,26 +0,0 @@ -note - description: "Summary description for {CMS_API_OPTIONS}." - author: "" - date: "$Date$" - revision: "$Revision$" - -class - CMS_API_OPTIONS - -inherit - WSF_API_OPTIONS - -create - make, - make_from_manifest - -convert - make_from_manifest ({ ARRAY [TUPLE [key: STRING; value: detachable ANY]], - ARRAY [TUPLE [STRING_8, ARRAY [TUPLE [STRING_8, STRING_32]]]], - ARRAY [TUPLE [STRING_8, ARRAY [TUPLE [STRING_8, STRING_8]]]] - }) - -feature {NONE} -- Initialization - - -end diff --git a/draft/application/cms/src/kernel/api/cms_common_api.e b/draft/application/cms/src/kernel/api/cms_common_api.e deleted file mode 100644 index c8a7fc0c..00000000 --- a/draft/application/cms/src/kernel/api/cms_common_api.e +++ /dev/null @@ -1,102 +0,0 @@ -note - description: "Summary description for {WSF_CMS_COMMON_API}." - author: "" - date: "$Date$" - revision: "$Revision$" - -deferred class - CMS_COMMON_API - -inherit - WSF_API_UTILITIES - -feature {NONE} -- Access - - service: CMS_SERVICE - deferred - end - - site_url: READABLE_STRING_8 - do - Result := service.site_url - end - - base_url: detachable READABLE_STRING_8 - -- Base url if any. - do - Result := service.script_url - end - -feature -- Access - - user_link (u: CMS_USER): like link - do - Result := link (u.name, "/user/" + u.id.out, Void) - end - - node_link (n: CMS_NODE): like link - do - Result := link (n.title, "/node/" + n.id.out, Void) - end - - user_url (u: CMS_USER): like url - do - Result := url ("/user/" + u.id.out, Void) - end - - node_url (n: CMS_NODE): like url - do - Result := url ("/node/" + n.id.out, Void) - end - -feature -- Helper - - is_empty (s: detachable READABLE_STRING_GENERAL): BOOLEAN - -- Is `s' is Void or empty ? - do - Result := s = Void or else s.is_empty - end - - unix_timestamp (dt: DATE_TIME): INTEGER_64 - do - Result := (create {HTTP_DATE_TIME_UTILITIES}).unix_time_stamp (dt) - end - - unix_timestamp_to_date_time (t: INTEGER_64): DATE_TIME - do - Result := (create {HTTP_DATE_TIME_UTILITIES}).unix_time_stamp_to_date_time (t) - end - - string_unix_timestamp_to_date_time (s: READABLE_STRING_8): DATE_TIME - do - if s.is_integer_64 then - Result := (create {HTTP_DATE_TIME_UTILITIES}).unix_time_stamp_to_date_time (s.to_integer_64) - else - Result := (create {HTTP_DATE_TIME_UTILITIES}).unix_time_stamp_to_date_time (0) - end - end - -feature {NONE} -- Implementation - - options_boolean (opts: HASH_TABLE [detachable ANY, STRING]; k: STRING; dft: BOOLEAN): BOOLEAN - do - if attached {BOOLEAN} opts.item (k) as h then - Result := h - else - Result := dft - end - end - - options_string (opts: HASH_TABLE [detachable ANY, STRING]; k: STRING): detachable STRING - do - if attached {STRING} opts.item (k) as s then - Result := s - end - end - --- html_encoder: HTML_ENCODER --- once ("thread") --- create Result --- end - -end diff --git a/draft/application/cms/src/kernel/api/cms_url_api_options.e b/draft/application/cms/src/kernel/api/cms_url_api_options.e deleted file mode 100644 index 5133d15a..00000000 --- a/draft/application/cms/src/kernel/api/cms_url_api_options.e +++ /dev/null @@ -1,25 +0,0 @@ -note - description: "Summary description for {CMS_URL_API_OPTIONS}." - author: "" - date: "$Date$" - revision: "$Revision$" - -class - CMS_URL_API_OPTIONS - -inherit - CMS_API_OPTIONS - -create - make, - make_absolute - -feature {NONE} -- Initialization - - make_absolute - do - make (1) - force (True, "absolute") - end - -end diff --git a/draft/application/cms/src/kernel/auth/cms_auth_engine.e b/draft/application/cms/src/kernel/auth/cms_auth_engine.e deleted file mode 100644 index 47561f30..00000000 --- a/draft/application/cms/src/kernel/auth/cms_auth_engine.e +++ /dev/null @@ -1,16 +0,0 @@ -note - description: "Summary description for {CMS_AUTH_ENGINE}." - author: "" - date: "$Date$" - revision: "$Revision$" - -deferred class - CMS_AUTH_ENGINE - -feature -- Status - - valid_credential (u,p: READABLE_STRING_32): BOOLEAN - deferred - end - -end diff --git a/draft/application/cms/src/kernel/auth/cms_storage_auth_engine.e b/draft/application/cms/src/kernel/auth/cms_storage_auth_engine.e deleted file mode 100644 index f213f56a..00000000 --- a/draft/application/cms/src/kernel/auth/cms_storage_auth_engine.e +++ /dev/null @@ -1,32 +0,0 @@ -note - description: "Summary description for {CMS_STORAGE_AUTH_ENGINE}." - author: "" - date: "$Date$" - revision: "$Revision$" - -class - CMS_STORAGE_AUTH_ENGINE - -inherit - CMS_AUTH_ENGINE - -create - make - -feature {NONE} -- Initialization - - make (a_storage: like storage) - do - storage := a_storage - end - - storage: CMS_STORAGE - -feature -- Status - - valid_credential (u,p: READABLE_STRING_32): BOOLEAN - do - Result := storage.is_valid_credential (u, p) - end - -end diff --git a/draft/application/cms/src/kernel/cms_html_page.e b/draft/application/cms/src/kernel/cms_html_page.e deleted file mode 100644 index 2ccc7405..00000000 --- a/draft/application/cms/src/kernel/cms_html_page.e +++ /dev/null @@ -1,225 +0,0 @@ -note - description: "Summary description for {CMS_HTML_PAGE}." - author: "" - date: "$Date$" - revision: "$Revision$" - -class - CMS_HTML_PAGE - -create - make - -feature {NONE} -- Initialization - - make - do - create regions.make (5) - language := "en" - - status_code := {HTTP_STATUS_CODE}.ok - create header.make - create {ARRAYED_LIST [STRING]} head_lines.make (5) - header.put_content_type_text_html - end - -feature -- Status - - status_code: INTEGER - -feature -- Header - - header: HTTP_HEADER - -feature -- Region - - regions: HASH_TABLE [STRING_8, STRING_8] - -- header - -- content - -- footer - -- could have sidebar first, sidebar second, ... - - region (n: STRING_8): STRING_8 - do - if attached regions.item (n) as r then - Result := r - else - Result := "" - debug - Result := "{{" + n + "}}" - end - end - end - - html_head: STRING_8 - local - t: like title - lines: like head_lines - do - t := title - lines := head_lines - if t /= Void or else lines.count > 0 then - create Result.make (50) - if t /= Void then - Result.append ("" + t + "%N") - end - Result.append_character ('%N') - across - lines as l - loop - Result.append (l.item) - Result.append_character ('%N') - end - else - create Result.make_empty - end - end - - header_region: STRING_8 - do - Result := region ("header") - end - - content_region: STRING_8 - do - Result := region ("content") - end - - footer_region: STRING_8 - do - Result := region ("content") - end - -feature -- Element change - - add_to_region (s: STRING; k: STRING) - local - r: detachable STRING - do - r := regions.item (k) - if r = Void then - create r.make_from_string (s) - set_region (r, k) - else - r.append (s) - end - end - - add_to_header_region (s: STRING) - do - add_to_region (s, "header") - end - - add_to_content_region (s: STRING) - do - add_to_region (s, "content") - end - - add_to_footer_region (s: STRING) - do - add_to_region (s, "footer") - end - - set_region (s: STRING; k: STRING) - do - regions.force (s, k) - end - --- set_header_region (s: STRING) --- do --- set_region (s, "header") --- end - --- set_content_region (s: STRING) --- do --- set_region (s, "content") --- end - --- set_footer_region (s: STRING) --- do --- set_region (s, "footer") --- end - -feature -- Access - - title: detachable STRING - - language: STRING - - head_lines: LIST [STRING] - - head_lines_to_string: STRING - do - create Result.make_empty - across - head_lines as h - loop - Result.append (h.item) - Result.append_character ('%N') - end - end - --- variables: HASH_TABLE [detachable ANY, STRING_8] - -feature -- Element change - - set_status_code (c: like status_code) - do - status_code := c - end - - set_language (s: like language) - do - language := s - end - - set_title (s: like title) - do - title := s - end - - add_meta_name_content (a_name: STRING; a_content: STRING) - local - s: STRING_8 - do - s := "" - head_lines.extend (s) - end - - add_meta_http_equiv (a_http_equiv: STRING; a_content: STRING) - local - s: STRING_8 - do - s := "" - head_lines.extend (s) - end - - add_style (a_href: STRING; a_media: detachable STRING) - local - s: STRING_8 - do - s := "") - head_lines.extend (s) - end - - add_javascript_url (a_src: STRING) - local - s: STRING_8 - do - s := "" - head_lines.extend (s) - end - - add_javascript_content (a_script: STRING) - local - s: STRING_8 - do - s := "" - head_lines.extend (s) - end - -end diff --git a/draft/application/cms/src/kernel/cms_session_controler.e b/draft/application/cms/src/kernel/cms_session_controler.e deleted file mode 100644 index 9f78ac6f..00000000 --- a/draft/application/cms/src/kernel/cms_session_controler.e +++ /dev/null @@ -1,139 +0,0 @@ -note - description: "[ - Summary description for CMS_SESSION_CONTROLER. - ]" - date: "$Date$" - revision: "$Revision$" - -class - CMS_SESSION_CONTROLER - -inherit - ANY - - WSF_SESSION_FACTORY [WSF_SESSION] - -create - make - -feature -- Initialization - - make (req: WSF_REQUEST; a_mngr: like session_manager; a_site_id: READABLE_STRING_8) - do - site_id := a_site_id - session_manager := a_mngr - initialize - create discarded_sessions.make - get_session (req) - end - - initialize - do - session_id_name := "_EWF_CMS_SESSID__" + site_id - end - -feature -- Session access - - site_id: READABLE_STRING_8 - -- Associated CMS site id. - - session: WSF_SESSION - - has_pending_session: BOOLEAN - - discarded_sessions: LINKED_LIST [like session] - -feature -- Session operation - - session_commit (page: CMS_HTML_PAGE_RESPONSE; e: CMS_EXECUTION) - do - if has_pending_session then - session.apply_to (page.header, e.request, e.request.script_url ("/")) - end - session.commit - end - - apply_sessions_to (h: HTTP_HEADER; req: WSF_REQUEST; a_path: detachable READABLE_STRING_8) - do - session.apply_to (h, req, a_path) - across - discarded_sessions as c - loop - c.item.apply_to (h, req, a_path) - end - end - - start_session (req: WSF_REQUEST) - -- Start a new session - local - s: like session - do - close_session (req) - s := new_session (req, False, session_manager) - req.set_execution_variable (session_request_variable_name, s) - session := s - if s.is_pending then - has_pending_session := True - end - ensure - session_attached: session /= Void - end - - get_session (req: WSF_REQUEST) - -- Get existing session, or start a new one - local - s: like session - do - if attached {like session} req.execution_variable (session_request_variable_name) as r_session then - session := r_session - else - s := new_session (req, True, session_manager) --- create {CMS_SESSION} s.make (req, "_EWF_CMS_SESSID") - if s.is_pending then - has_pending_session := True - end - session := s - req.set_execution_variable (session_request_variable_name, s) - end - if session.expired then - start_session (req) - end - end - - close_session (req: WSF_REQUEST) - -- Close `session' if any - do - if session.is_pending then - has_pending_session := has_pending_session or not discarded_sessions.is_empty - else - has_pending_session := True - discarded_sessions.extend (session) - end - session.destroy - end - -feature -- Session internal - - session_manager: WSF_SESSION_MANAGER - - new_session (req: WSF_REQUEST; a_reuse: BOOLEAN; m: WSF_SESSION_MANAGER): like session - local - s: CMS_SESSION - dt: DATE_TIME - do - if a_reuse then - create s.make (req, session_id_name, m) - else - create s.make_new (session_id_name, m) - create dt.make_now_utc - dt.day_add (31) - s.set_expiration (dt) - end - Result := s - end - - session_request_variable_name: STRING = "_EWF_CMS_SESSION_" - - session_id_name: READABLE_STRING_8 - -end diff --git a/draft/application/cms/src/kernel/cms_user.e b/draft/application/cms/src/kernel/cms_user.e deleted file mode 100644 index 1521bbd4..00000000 --- a/draft/application/cms/src/kernel/cms_user.e +++ /dev/null @@ -1,195 +0,0 @@ -note - description: "Summary description for {CMS_USER}." - author: "" - date: "$Date$" - revision: "$Revision$" - -class - CMS_USER - -inherit - DEBUG_OUTPUT - -create - make_new, - make - -feature {NONE} -- Initialization - - make (a_id: like id; n: like name; dt: like creation_date) - require - a_id > 0 - do - id := a_id - creation_date := dt - name := n - ensure - valid_password: password = Void - end - - make_new (n: like name) - do - name := n - create creation_date.make_now_utc - end - -feature -- Access - - is_admin: BOOLEAN - do - Result := id = 1 - end - - id: INTEGER - - name: STRING_8 - - password: detachable READABLE_STRING_32 - - email: detachable READABLE_STRING_8 - - profile: detachable CMS_USER_PROFILE - - creation_date: DATE_TIME - - last_login_date: detachable DATE_TIME - - data: detachable HASH_TABLE [detachable ANY, STRING] - - data_item (k: STRING): detachable ANY - do - if attached data as l_data then - Result := l_data.item (k) - end - end - -feature -- Permission - - roles: detachable LIST [INTEGER] - -- Associated roles - -- Note: does not include "authenticated" and "anonymous". - - has_role (r: CMS_USER_ROLE): BOOLEAN - do - Result := attached roles as lst and then lst.has (r.id) - end - - clear_roles - do - roles := Void - end - - add_role_by_id (r_id: INTEGER) - local - lst: like roles - do - lst := roles - if r_id <= 2 then -- Anonymous=1 and Authenticated=2 - lst := roles - if lst /= Void and then lst.is_empty then - clear_roles - end - else - if lst = Void then - create {ARRAYED_SET [INTEGER]} lst.make (1) - roles := lst - end - lst.force (r_id) - end - end - -feature -- Status report - - has_id: BOOLEAN - do - Result := id > 0 - end - - has_email: BOOLEAN - do - Result := attached email as e and then not e.is_empty - end - - debug_output: STRING - do - Result := name - end - - same_as (u: detachable CMS_USER): BOOLEAN - do - Result := u /= Void and then id = u.id - end - -feature -- Element change - - set_id (a_id: like id) - do - id := a_id - end - - set_password (p: like password) - do - password := p - end - - set_email (m: like email) - do - email := m - end - - set_profile (prof: like profile) - do - profile := prof - end - - set_data_item (k: READABLE_STRING_8; d: like data_item) - local - l_data: like data - do - l_data := data - if l_data = Void then - create l_data.make (1) - data := l_data - end - l_data.force (d, k) - end - - remove_data_item (k: READABLE_STRING_8) - do - if attached data as l_data then - l_data.remove (k) - end - end - - set_profile_item (k: READABLE_STRING_8; v: READABLE_STRING_8) - local - prof: like profile - do - prof := profile - if prof = Void then - create prof.make - profile := prof - end - prof.force (v, k) - end - - set_last_login_date (dt: like last_login_date) - do - last_login_date := dt - end - - set_last_login_date_now - do - set_last_login_date (create {DATE_TIME}.make_now_utc) - end - -feature {CMS_STORAGE} -- Security - - encoded_password: detachable READABLE_STRING_8 - - set_encoded_password (p: like encoded_password) - do - encoded_password := p - end - -end diff --git a/draft/application/cms/src/kernel/cms_user_profile.e b/draft/application/cms/src/kernel/cms_user_profile.e deleted file mode 100644 index 80d4b773..00000000 --- a/draft/application/cms/src/kernel/cms_user_profile.e +++ /dev/null @@ -1,51 +0,0 @@ -note - description: "Summary description for {CMS_USER_PROFILE}." - author: "" - date: "$Date$" - revision: "$Revision$" - -class - CMS_USER_PROFILE - -inherit - TABLE_ITERABLE [READABLE_STRING_8, READABLE_STRING_8] - -create - make - -feature {NONE} -- Initialization - - make - do - create items.make (0) - end - -feature -- Access - - item (k: READABLE_STRING_8): detachable READABLE_STRING_8 - do - Result := items.item (k.as_string_8) - end - -feature -- Change - - force (v: READABLE_STRING_8; k: READABLE_STRING_8) - do - items.force (v, k.as_string_8) - end - -feature -- Access - - new_cursor: TABLE_ITERATION_CURSOR [READABLE_STRING_8, READABLE_STRING_8] - -- Fresh cursor associated with current structure - do - Result := items.new_cursor - end - -feature {NONE} -- Implementation - - items: HASH_TABLE [READABLE_STRING_8, STRING_8] - -invariant - -end diff --git a/draft/application/cms/src/kernel/cms_user_role.e b/draft/application/cms/src/kernel/cms_user_role.e deleted file mode 100644 index 75587c72..00000000 --- a/draft/application/cms/src/kernel/cms_user_role.e +++ /dev/null @@ -1,85 +0,0 @@ -note - description: "Summary description for {CMS_USER_ROLE}." - author: "" - date: "$Date$" - revision: "$Revision$" - -class - CMS_USER_ROLE - -inherit - ANY - redefine - is_equal - end - -create - make, - make_with_id - -feature {NONE} -- Initialization - - make_with_id (a_id: like id; a_name: like name) - do - id := a_id - make (a_name) - end - - make (a_name: like name) - do - name := a_name - create {ARRAYED_LIST [READABLE_STRING_8]} permissions.make (0) - end - -feature -- Status report - - has_id: BOOLEAN - do - Result := id > 0 - end - - has_permission (p: READABLE_STRING_8): BOOLEAN - do - Result := across permissions as c some c.item.is_case_insensitive_equal (p) end - end - -feature -- Access - - id: INTEGER - - name: READABLE_STRING_8 - - permissions: LIST [READABLE_STRING_8] - -feature -- Comparison - - same_user_role (r: CMS_USER_ROLE): BOOLEAN - do - Result := r.id = id - end - - is_equal (other: like Current): BOOLEAN - -- Is `other' attached to an object considered - -- equal to current object? - do - Result := id = other.id - end - -feature -- Change - - set_id (a_id: like id) - do - id := a_id - end - - set_name (a_name: like name) - do - name := a_name - end - - add_permission (n: READABLE_STRING_8) - do - permissions.force (n) - end - -end diff --git a/draft/application/cms/src/kernel/content/cms_block.e b/draft/application/cms/src/kernel/content/cms_block.e deleted file mode 100644 index a96c3bc9..00000000 --- a/draft/application/cms/src/kernel/content/cms_block.e +++ /dev/null @@ -1,32 +0,0 @@ -note - description: "Summary description for {CMS_BLOCK}." - author: "" - date: "$Date$" - revision: "$Revision$" - -deferred class - CMS_BLOCK - -feature -- Access - - name: READABLE_STRING_8 - deferred - end - - title: detachable READABLE_STRING_32 - deferred - end - -feature -- status report - - is_enabled: BOOLEAN - -feature -- Conversion - - to_html (a_theme: CMS_THEME): STRING_8 - deferred - end - -invariant - -end diff --git a/draft/application/cms/src/kernel/content/cms_content_block.e b/draft/application/cms/src/kernel/content/cms_content_block.e deleted file mode 100644 index f3f65c28..00000000 --- a/draft/application/cms/src/kernel/content/cms_content_block.e +++ /dev/null @@ -1,46 +0,0 @@ -note - description: "Summary description for {CMS_CONTENT_BLOCK}." - author: "" - date: "$Date$" - revision: "$Revision$" - -class - CMS_CONTENT_BLOCK - -inherit - CMS_BLOCK - -create - make - -feature {NONE} -- Initialization - - make (a_name: like name; a_title: like title; a_body: like body; a_format: like format) - do - is_enabled := True - name := a_name - title := a_title - body := a_body - format := a_format - end - -feature -- Access - - name: READABLE_STRING_8 - - title: detachable READABLE_STRING_32 - - body: READABLE_STRING_8 - - format: CMS_FORMAT - -feature -- Conversion - - to_html (a_theme: CMS_THEME): STRING_8 - do - Result := format.to_html (body) - end - -invariant - -end diff --git a/draft/application/cms/src/kernel/content/cms_content_type.e b/draft/application/cms/src/kernel/content/cms_content_type.e deleted file mode 100644 index ebddfea9..00000000 --- a/draft/application/cms/src/kernel/content/cms_content_type.e +++ /dev/null @@ -1,60 +0,0 @@ -note - description: "Summary description for {CMS_CONTENT_TYPE}." - author: "" - date: "$Date$" - revision: "$Revision$" - -deferred class - CMS_CONTENT_TYPE - -feature -- Access - - name: READABLE_STRING_8 - -- Internal name - deferred - end - - title: READABLE_STRING_8 - deferred - end - - description: detachable READABLE_STRING_8 - -- Optional description - deferred - end - - available_formats: LIST [CMS_FORMAT] - deferred - end - -feature -- Factory - - fill_edit_form (f: CMS_FORM; a_node: detachable CMS_NODE) - -- Fill the edit form `f' - deferred - end - - change_node (a_execution: CMS_EXECUTION; a_form_data: WSF_FORM_DATA; a_node: like new_node) - -- Apply data from `a_form_data' to a_node - require - a_node.has_id - deferred - end - - new_node (a_execution: CMS_EXECUTION; a_form_data: WSF_FORM_DATA; a_node: detachable like new_node): CMS_NODE - -- New content created with `a_form_data' - deferred - ensure - a_node /= Void implies a_node = Result - end - -feature {NONE} -- Implementation: helper - - formats: CMS_FORMATS - once - create Result - end - -invariant - -end diff --git a/draft/application/cms/src/kernel/content/cms_menu_block.e b/draft/application/cms/src/kernel/content/cms_menu_block.e deleted file mode 100644 index 9d825726..00000000 --- a/draft/application/cms/src/kernel/content/cms_menu_block.e +++ /dev/null @@ -1,45 +0,0 @@ -note - description: "Summary description for {CMS_MENU_BLOCK}." - author: "" - date: "$Date$" - revision: "$Revision$" - -class - CMS_MENU_BLOCK - -inherit - CMS_BLOCK - -create - make - -feature {NONE} -- Initialization - - make (a_menu: like menu) - do - is_enabled := True - menu := a_menu - name := a_menu.name - title := a_menu.title - end - -feature -- Access - - menu: CMS_MENU - - name: READABLE_STRING_8 - - title: detachable READABLE_STRING_32 - - is_horizontal: BOOLEAN - -feature -- Conversion - - to_html (a_theme: CMS_THEME): STRING_8 - do - Result := a_theme.menu_html (menu, is_horizontal) - end - -invariant - -end diff --git a/draft/application/cms/src/kernel/content/cms_node.e b/draft/application/cms/src/kernel/content/cms_node.e deleted file mode 100644 index 545020b8..00000000 --- a/draft/application/cms/src/kernel/content/cms_node.e +++ /dev/null @@ -1,101 +0,0 @@ -note - description: "Summary description for {WSF_CMS_NODE}." - author: "" - date: "$Date$" - revision: "$Revision$" - -deferred class - CMS_NODE - -feature -- Access - - id: INTEGER - -- Unique identifier of Current. - - title: detachable READABLE_STRING_32 - -- Associated title (optional). - deferred - end - - body: detachable READABLE_STRING_8 - -- Body of Current. - deferred - end - - format: CMS_FORMAT - -- Format associated with `body' - deferred - end - - content_type_name: STRING - -- Associated content type name - deferred - end - -feature -- status report - - has_id: BOOLEAN - do - Result := id > 0 - end - -feature -- Access: status - - author: detachable CMS_USER - - creation_date: DATE_TIME - - modification_date: DATE_TIME - -feature -- Change - - set_id (a_id: like id) - require - not has_id - do - id := a_id - end - - set_author (u: like author) - do - author := u - end - -feature -- Conversion - - to_html (a_theme: CMS_THEME): STRING_8 - local - d: STRING - do - Result := "
    " - if attached title as l_title then - Result.append ("
    " + a_theme.node_link (Current) + "
    ") - end - create d.make_empty - if attached author as u then - d.append ("by " + a_theme.user_link (u) + " ") - end - if attached modification_date as dt then - d.append ("last modified: " + dt.year.out + "/" + dt.month.out + "/" + dt.day.out + "") - end - if not d.is_empty then - Result.append ("
    ") - Result.append (d) - Result.append ("
    ") - end - if attached body as b then - Result.append ("
    ") - Result.append (format.to_html (b)) - Result.append ("
    ") - end - Result.append ("
    ") - end - -feature {NONE} -- Implementation: helper - - formats: CMS_FORMATS - once - create Result - end - -end diff --git a/draft/application/cms/src/kernel/content/format/cms_filtered_html_format.e b/draft/application/cms/src/kernel/content/format/cms_filtered_html_format.e deleted file mode 100644 index 43febb3e..00000000 --- a/draft/application/cms/src/kernel/content/format/cms_filtered_html_format.e +++ /dev/null @@ -1,44 +0,0 @@ -note - description : "[ - Filtered html format - ]" - date : "$Date$" - revision : "$Revision$" - -class - CMS_FILTERED_HTML_FORMAT - -inherit - CMS_FORMAT - redefine - default_create - end - -feature {NONE} -- Initialization - - default_create - do - Precursor - create filters.make (3) - filters.force (create {CMS_URL_FILTER}) - filters.force (create {CMS_HTML_FILTER}) - filters.force (create {CMS_LINE_BREAK_CONVERTER_FILTER}) - --- help := "
    • Web page addresses and e-mail addresses turn into links automatically.
    • Allowed HTML tags: " --- across --- allowed_html_tags as c --- loop --- help.append ("<" + c.item + "> ") --- end --- help.append ("
    • Lines and paragraphs break automatically.
    ") - end - -feature -- Access - - name: STRING = "filtered_html" - - title: STRING_8 = "Filtered HTML" - - filters: ARRAYED_LIST [CMS_FILTER] - -end diff --git a/draft/application/cms/src/kernel/content/format/cms_format.e b/draft/application/cms/src/kernel/content/format/cms_format.e deleted file mode 100644 index fe9d8dd3..00000000 --- a/draft/application/cms/src/kernel/content/format/cms_format.e +++ /dev/null @@ -1,46 +0,0 @@ -note - description: "Summary description for {WSF_CMS_FORMAT}." - author: "" - date: "$Date$" - revision: "$Revision$" - -deferred class - CMS_FORMAT - -feature -- Access - - name: STRING - deferred - end - - title: READABLE_STRING_8 - deferred - end - - help: STRING - do - create Result.make (0) - across - filters as c - loop - if attached c.item.help as h and then not h.is_empty then - Result.append ("
  • " + h + "
  • ") - end - end - end - - filters: LIST [CMS_FILTER] - deferred - end - - to_html (a_text: READABLE_STRING_8): STRING_8 - do - create Result.make_from_string (a_text) - across - filters as c - loop - c.item.filter (Result) - end - end - -end diff --git a/draft/application/cms/src/kernel/content/format/cms_formats.e b/draft/application/cms/src/kernel/content/format/cms_formats.e deleted file mode 100644 index 5c82e097..00000000 --- a/draft/application/cms/src/kernel/content/format/cms_formats.e +++ /dev/null @@ -1,54 +0,0 @@ -note - description: "Summary description for {CMS_FORMATS}." - author: "" - date: "$Date$" - revision: "$Revision$" - -class - CMS_FORMATS - -feature -- Access - - format (a_name: like {CMS_FORMAT}.name): detachable CMS_FORMAT - do - across - all_formats as c - until - Result /= Void - loop - if c.item.name.same_string (a_name) then - Result := c.item - end - end - end - - all_formats: LIST [CMS_FORMAT] - once - create {ARRAYED_LIST [CMS_FORMAT]} Result.make (3) - Result.force (plain_text) - Result.force (full_html) - Result.force (filtered_html) - end - - default_format: CMS_FORMAT - do - Result := plain_text --FIXME - end - - plain_text: CMS_PLAIN_TEXT_FORMAT - once - create Result - end - - full_html: CMS_FULL_HTML_FORMAT - once - create Result - end - - filtered_html: CMS_FILTERED_HTML_FORMAT - once - create Result - end - - -end diff --git a/draft/application/cms/src/kernel/content/format/cms_full_html_format.e b/draft/application/cms/src/kernel/content/format/cms_full_html_format.e deleted file mode 100644 index c486e975..00000000 --- a/draft/application/cms/src/kernel/content/format/cms_full_html_format.e +++ /dev/null @@ -1,35 +0,0 @@ -note - description : "[ - Full html format - ]" - date : "$Date$" - revision : "$Revision$" - -class - CMS_FULL_HTML_FORMAT - -inherit - CMS_FORMAT - redefine - default_create - end - -feature {NONE} -- Initialization - - default_create - do - Precursor - create filters.make (2) - filters.force (create {CMS_URL_FILTER}) - filters.force (create {CMS_LINE_BREAK_CONVERTER_FILTER}) - end - -feature -- Access - - name: STRING = "full_html" - - title: STRING_8 = "Full HTML" - - filters: ARRAYED_LIST [CMS_FILTER] - -end diff --git a/draft/application/cms/src/kernel/content/format/cms_plain_text_format.e b/draft/application/cms/src/kernel/content/format/cms_plain_text_format.e deleted file mode 100644 index 76b05d4e..00000000 --- a/draft/application/cms/src/kernel/content/format/cms_plain_text_format.e +++ /dev/null @@ -1,49 +0,0 @@ -note - description : "[ - Plain Text format - ]" - date : "$Date$" - revision : "$Revision$" - -class - CMS_PLAIN_TEXT_FORMAT - -inherit - CMS_FORMAT - redefine - default_create, - help - end - -feature {NONE} -- Initialization - - default_create - do - Precursor - create filters.make (2) - filters.force (create {CMS_HTML_TO_TEXT_FILTER}) - filters.force (create {CMS_LINE_BREAK_CONVERTER_FILTER}) - end - - -feature -- Access - - name: STRING = "plain_text" - - title: STRING_8 = "Plain text" - - help: STRING - do - Result := "
  • No HTML tags allowed.
  • " - Result.append (Precursor) - end ---
      ---
    • No HTML tags allowed.
    • ---
    • Web page addresses and e-mail addresses turn into links automatically.
    • ---
    • Lines and paragraphs break automatically.
    • ---
    --- ]" - - filters: ARRAYED_LIST [CMS_FILTER] - -end diff --git a/draft/application/cms/src/kernel/content/format/filters/cms_filter.e b/draft/application/cms/src/kernel/content/format/filters/cms_filter.e deleted file mode 100644 index 1b49552a..00000000 --- a/draft/application/cms/src/kernel/content/format/filters/cms_filter.e +++ /dev/null @@ -1,35 +0,0 @@ -note - description: "Summary description for {CMS_FILTER}." - author: "" - date: "$Date$" - revision: "$Revision$" - -deferred class - CMS_FILTER - -feature -- Access - - name: READABLE_STRING_8 - deferred - end - - title: READABLE_STRING_8 - deferred - end - - description: READABLE_STRING_8 - deferred - end - - help: READABLE_STRING_8 - do - Result := description - end - -feature -- Conversion - - filter (s: STRING_8) - deferred - end - -end diff --git a/draft/application/cms/src/kernel/content/format/filters/cms_html_filter.e b/draft/application/cms/src/kernel/content/format/filters/cms_html_filter.e deleted file mode 100644 index 55c509e6..00000000 --- a/draft/application/cms/src/kernel/content/format/filters/cms_html_filter.e +++ /dev/null @@ -1,128 +0,0 @@ -note - description: "Summary description for {CMS_HTML_FILTER}." - author: "" - date: "$Date$" - revision: "$Revision$" - -class - CMS_HTML_FILTER - -inherit - CMS_FILTER - redefine - default_create - end - -feature {NONE} -- Initialization - - default_create - do - Precursor - allowed_html_tags := <<"a", "em", "strong", "cite", "blockquote", "code", "ul", "ol", "li", "dl">> - description := "Allowed HTML tags: " - across - allowed_html_tags as c - loop - description.append ("<" + c.item + "> ") - end - end - -feature -- Access - - name: STRING_8 = "html_filter" - - title: STRING_8 = "HTML filter" - - description: STRING_8 - - allowed_html_tags: ITERABLE [READABLE_STRING_8] - -feature -- Conversion - - filter (a_text: STRING_8) - local - l_new: STRING_8 - i: INTEGER - n: INTEGER - in_tag: BOOLEAN - p1, p2: INTEGER - do - create l_new.make (a_text.count) - from - p1 := 1 - i := a_text.index_of ('<', 1) - if i > 0 then - l_new.append (a_text.substring (1, i - 1)) - end - n := a_text.count - until - i = 0 or i > n - loop - if a_text[i] = '<' then - in_tag := True - p1 := i - p2 := a_text.index_of ('>', i + 1) - if p2 = 0 then - -- next '<' - i := a_text.index_of ('<', i + 1) - if i > 0 then - l_new.append (a_text.substring (p1, i - 1)) - end - else - if is_authorized (a_text.substring (p1, p2)) then - l_new.append (a_text.substring (p1, p2)) - i := a_text.index_of ('<', p2 + 1) - else - i := a_text.index_of ('<', p2 + 1) - end - if i = 0 then - p1 := p2 + 1 - else - l_new.append (a_text.substring (p2 + 1, i - 1)) - end - end - else - i := i + 1 - end - end - l_new.append (a_text.substring (p1, n)) - a_text.wipe_out - a_text.append (l_new) - end - - is_authorized (s: READABLE_STRING_8): BOOLEAN - -- Is `s' authorized? - --| `s' has either "<....>" or "<..../>" or "" - local - l_tagname: detachable STRING - i,n,p1: INTEGER - do --- create l_tagname.make_empty - from - i := 2 -- skip first '<' - n := s.count - until - i > n or l_tagname /= Void - loop - if p1 > 0 then - if s[i].is_space or s[i] = '/' or s[i] = '>' then - l_tagname := s.substring (p1, i - 1) - end - else - if s[i].is_space or s[i] = '/' then - else - p1 := i - end - end - i := i + 1 - end - if l_tagname /= Void then - l_tagname.to_lower - Result := across allowed_html_tags as c some c.item.same_string (l_tagname) end - else - Result := True - end - end - - -end diff --git a/draft/application/cms/src/kernel/content/format/filters/cms_html_to_text_filter.e b/draft/application/cms/src/kernel/content/format/filters/cms_html_to_text_filter.e deleted file mode 100644 index ebc81bcd..00000000 --- a/draft/application/cms/src/kernel/content/format/filters/cms_html_to_text_filter.e +++ /dev/null @@ -1,34 +0,0 @@ -note - description: "Summary description for {CMS_HTML_TO_TEXT_FILTER}." - author: "" - date: "$Date$" - revision: "$Revision$" - -class - CMS_HTML_TO_TEXT_FILTER - -inherit - CMS_FILTER - -feature -- Access - - name: STRING_8 = "html_to_text" - - title: STRING_8 = "HTML to text" - - description: STRING_8 = "Replaces HTML tags and entities with plain text formatting, moving links at the end. This filter is just for text messages and it isn't safe for rendering content on a web page." - -feature -- Conversion - - filter (a_text: STRING_8) - local - enc: HTML_ENCODER - s: STRING_8 - do - create enc - s := enc.encoded_string (a_text) - a_text.wipe_out - a_text.append (s) - end - -end diff --git a/draft/application/cms/src/kernel/content/format/filters/cms_line_break_converter_filter.e b/draft/application/cms/src/kernel/content/format/filters/cms_line_break_converter_filter.e deleted file mode 100644 index 995cd267..00000000 --- a/draft/application/cms/src/kernel/content/format/filters/cms_line_break_converter_filter.e +++ /dev/null @@ -1,34 +0,0 @@ -note - description: "Summary description for {CMS_HTML_FILTER}." - author: "" - date: "$Date$" - revision: "$Revision$" - -class - CMS_LINE_BREAK_CONVERTER_FILTER - -inherit - CMS_FILTER - redefine - help - end - -feature -- Access - - name: STRING_8 = "line_break_converter" - - title: STRING_8 = "Line break converter" - - help: STRING = "Lines and paragraphs break automatically" - - description: STRING_8 = "Converts line breaks into HTML (i.e. <br> and <p> tags)." - -feature -- Conversion - - filter (a_text: STRING_8) - do - a_text.replace_substring_all ("%N", "
    %N") - -- FIXME jfiat [2012/09/12] :also use

    ... - end - -end diff --git a/draft/application/cms/src/kernel/content/format/filters/cms_no_html_filter.e b/draft/application/cms/src/kernel/content/format/filters/cms_no_html_filter.e deleted file mode 100644 index 8092bce2..00000000 --- a/draft/application/cms/src/kernel/content/format/filters/cms_no_html_filter.e +++ /dev/null @@ -1,77 +0,0 @@ -note - description: "Summary description for {CMS_NO_HTML_FILTER}." - author: "" - date: "$Date$" - revision: "$Revision$" - -class - CMS_NO_HTML_FILTER - -inherit - CMS_FILTER - redefine - default_create - end - -feature {NONE} -- Initialization - - default_create - do - Precursor - end - -feature -- Access - - name: STRING_8 = "no_html_filter" - - title: STRING_8 = "No HTML filter" - - description: STRING_8 = "HTML tags removed! " - -feature -- Conversion - - filter (a_text: STRING_8) - local - l_new: STRING_8 - i: INTEGER - n: INTEGER - in_tag: BOOLEAN - p1, p2: INTEGER - do - create l_new.make (a_text.count) - from - p1 := 1 - i := a_text.index_of ('<', 1) - if i > 0 then - l_new.append (a_text.substring (1, i - 1)) - end - n := a_text.count - until - i = 0 or i > n - loop - if a_text[i] = '<' then - in_tag := True - p1 := i - p2 := a_text.index_of ('>', i + 1) - if p2 = 0 then - -- next '<' - i := a_text.index_of ('<', i + 1) - if i > 0 then - l_new.append (a_text.substring (p1, i - 1)) - end - else - i := a_text.index_of ('<', p2 + 1) - if i > 0 then - l_new.append (a_text.substring (p2 + 1, i - 1)) - end - end - else - i := i + 1 - end - end - l_new.append (a_text.substring (p1, n)) - a_text.wipe_out - a_text.append (l_new) - end - -end diff --git a/draft/application/cms/src/kernel/content/format/filters/cms_url_filter.e b/draft/application/cms/src/kernel/content/format/filters/cms_url_filter.e deleted file mode 100644 index a53be807..00000000 --- a/draft/application/cms/src/kernel/content/format/filters/cms_url_filter.e +++ /dev/null @@ -1,33 +0,0 @@ -note - description: "Summary description for {CMS_URL_FILTER}." - author: "" - date: "$Date$" - revision: "$Revision$" - -class - CMS_URL_FILTER - -inherit - CMS_FILTER - redefine - help - end - -feature -- Access - - name: STRING_8 = "url" - - title: STRING_8 = "URL filter" - - description: STRING_8 = "Turns web and e-mail addresses into clickable links." - - help: STRING = "Web page addresses and e-mail addresses turn into links automatically." - -feature -- Conversion - - filter (a_text: STRING_8) - do - --| FIXME jfiat [2012/09/12] : todo - end - -end diff --git a/draft/application/cms/src/kernel/link/cms_external_link.e b/draft/application/cms/src/kernel/link/cms_external_link.e deleted file mode 100644 index 74e3ccee..00000000 --- a/draft/application/cms/src/kernel/link/cms_external_link.e +++ /dev/null @@ -1,38 +0,0 @@ -note - description: "Summary description for {CMS_EXTERNAL_MENU}." - author: "" - date: "$Date$" - revision: "$Revision$" - -class - CMS_EXTERNAL_LINK - -inherit - CMS_LINK - -create - make - -feature {NONE} -- Initialization - - make (a_title: like title; a_location: like location) - do - title := a_title - location := a_location - end - -feature -- Status report - - is_active: BOOLEAN = False - - is_expanded: BOOLEAN = False - - is_expandable: BOOLEAN = False - - has_children: BOOLEAN = False - - children: detachable LIST [CMS_LINK] - do - end - -end diff --git a/draft/application/cms/src/kernel/link/cms_link.e b/draft/application/cms/src/kernel/link/cms_link.e deleted file mode 100644 index 66deadfe..00000000 --- a/draft/application/cms/src/kernel/link/cms_link.e +++ /dev/null @@ -1,71 +0,0 @@ -note - description: "Summary description for {CMS_MENU}." - author: "" - date: "$Date$" - revision: "$Revision$" - -deferred class - CMS_LINK - -inherit - REFACTORING_HELPER - - DEBUG_OUTPUT - - ITERABLE [CMS_LINK] - -feature -- Access - - title: READABLE_STRING_32 - - location: READABLE_STRING_8 - - options: detachable CMS_API_OPTIONS - -feature -- status report - - is_active: BOOLEAN - deferred - end - - is_expanded: BOOLEAN - deferred - end - - is_expandable: BOOLEAN - deferred - end - - has_children: BOOLEAN - deferred - end - -feature -- Query - - parent: detachable CMS_LINK - - children: detachable LIST [CMS_LINK] - deferred - end - -feature -- Access - - new_cursor: ITERATION_CURSOR [CMS_LINK] - -- Fresh cursor associated with current structure - do - if attached children as lst then - Result := lst.new_cursor - else - Result := (create {ARRAYED_LIST [CMS_LINK]}.make (0)).new_cursor - end - end - -feature -- Status report - - debug_output: STRING - -- String that should be displayed in debugger to represent `Current'. - do - Result := title.as_string_8 + " -> " + location - end - -end diff --git a/draft/application/cms/src/kernel/link/cms_link_composite.e b/draft/application/cms/src/kernel/link/cms_link_composite.e deleted file mode 100644 index 3a9c7dac..00000000 --- a/draft/application/cms/src/kernel/link/cms_link_composite.e +++ /dev/null @@ -1,27 +0,0 @@ -note - description: "Summary description for {CMS_LINK_COMPOSITE}." - author: "" - date: "$Date$" - revision: "$Revision$" - -deferred class - CMS_LINK_COMPOSITE - -inherit - ITERABLE [CMS_LINK] - -feature -- Access - - items: detachable LIST [CMS_LINK] - deferred - end - - extend (lnk: CMS_LINK) - deferred - end - - remove (lnk: CMS_LINK) - deferred - end - -end diff --git a/draft/application/cms/src/kernel/link/cms_local_link.e b/draft/application/cms/src/kernel/link/cms_local_link.e deleted file mode 100644 index e5652880..00000000 --- a/draft/application/cms/src/kernel/link/cms_local_link.e +++ /dev/null @@ -1,129 +0,0 @@ -note - description: "Summary description for {CMS_LOCAL_MENU}." - author: "" - date: "$Date$" - revision: "$Revision$" - -class - CMS_LOCAL_LINK - -inherit - CMS_LINK - - CMS_LINK_COMPOSITE - rename - items as children, - extend as add_link, - remove as remove_link - end - -create - make - -feature {NONE} -- Initialization - - make (a_title: detachable like title; a_location: like location) - do - if a_title /= Void then - title := a_title - else - title := a_location - end - location := a_location - end - -feature -- Status report - - is_active: BOOLEAN - - is_expanded: BOOLEAN - do - Result := is_expandable and then internal_is_expanded - end - - is_expandable: BOOLEAN - do - Result := internal_is_expandable or internal_is_expanded or has_children - end - - has_children: BOOLEAN - do - Result := attached children as l_children and then not l_children.is_empty - end - - permission_arguments: detachable ITERABLE [READABLE_STRING_8] - - children: detachable LIST [CMS_LINK] - - internal_is_expandable: BOOLEAN - - internal_is_expanded: BOOLEAN - -feature -- Element change - - add_link (lnk: CMS_LINK) - local - lst: like children - do - lst := children - if lst = Void then - create {ARRAYED_LIST [CMS_LINK]} lst.make (1) - children := lst - end - lst.force (lnk) - end - - remove_link (lnk: CMS_LINK) - local - lst: like children - do - lst := children - if lst /= Void then - lst.prune_all (lnk) - if lst.is_empty then - children := Void - end - end - end - - set_children (lst: like children) - do - children := lst - end - - set_expanded (b: like is_expanded) - do - internal_is_expanded := b - end - - set_expandable (b: like is_expandable) - do - internal_is_expandable := b - end - - get_is_active (req: WSF_REQUEST) - local - qs: STRING - do - create qs.make_from_string (req.path_info) - is_active := qs.same_string (location) - if not is_active then - if attached req.query_string as l_query_string and then not l_query_string.is_empty then - qs.append_character ('?') - qs.append (l_query_string) - end - is_active := qs.same_string (location) - end - end - - set_permission_arguments (args: like permission_arguments) - do - permission_arguments := args - end - - set_options (opts: like options) - do - options := opts - end - -end diff --git a/draft/application/cms/src/kernel/link/cms_menu.e b/draft/application/cms/src/kernel/link/cms_menu.e deleted file mode 100644 index e766027c..00000000 --- a/draft/application/cms/src/kernel/link/cms_menu.e +++ /dev/null @@ -1,73 +0,0 @@ -note - description: "Summary description for {CMS_MENU}." - author: "" - date: "$Date$" - revision: "$Revision$" - -class - CMS_MENU - -inherit - CMS_LINK_COMPOSITE - -create - make, - make_with_title - -feature {NONE} -- Initialization - - make (a_name: like name; n: INTEGER) - do - name := a_name - create items.make (n) - end - - make_with_title (a_name: like name; a_title: READABLE_STRING_32; n: INTEGER) - do - make (a_name, n) - set_title (a_title) - end - -feature -- Access - - name: READABLE_STRING_8 - - title: detachable READABLE_STRING_32 - - items: ARRAYED_LIST [CMS_LINK] - - extend (lnk: CMS_LINK) - do - items.extend (lnk) - end - - remove (lnk: CMS_LINK) - do - items.prune_all (lnk) - end - -feature -- status report - - is_empty: BOOLEAN - do - Result := items.is_empty - end - -feature -- Element change - - set_title (t: like title) - do - title := t - end - -feature -- Access - - new_cursor: ITERATION_CURSOR [CMS_LINK] - -- Fresh cursor associated with current structure - do - Result := items.new_cursor - end - -invariant - -end diff --git a/draft/application/cms/src/kernel/link/cms_menu_system.e b/draft/application/cms/src/kernel/link/cms_menu_system.e deleted file mode 100644 index 095c70a6..00000000 --- a/draft/application/cms/src/kernel/link/cms_menu_system.e +++ /dev/null @@ -1,88 +0,0 @@ -note - description: "Summary description for {CMS_MENU_SYSTEM}." - author: "" - date: "$Date$" - revision: "$Revision$" - -class - CMS_MENU_SYSTEM - -inherit - ITERABLE [CMS_MENU] - -create - make - -feature {NONE} -- Initialization - - make - do - create items.make (5) - force (create {CMS_MENU}.make ("main-menu", 3)) - force (create {CMS_MENU}.make_with_title ("management", "Management", 3)) - force (create {CMS_MENU}.make_with_title ("navigation", "Navigation", 3)) - force (create {CMS_MENU}.make_with_title ("user", "User", 3)) - end - -feature -- Access - - item (n: like {CMS_MENU}.name): CMS_MENU - local - m: detachable CMS_MENU - do - m := items.item (n) - if m = Void then - create m.make (n, 3) - force (m) - end - Result := m - end - - main_menu: CMS_MENU - do - Result := item ("main-menu") - end - - management_menu: CMS_MENU - do - Result := item ("management") - end - - navigation_menu: CMS_MENU - do - Result := item ("navigation") - end - - user_menu: CMS_MENU - do - Result := item ("user") - end - - primary_tabs: CMS_MENU - do - Result := item ("primary-tabs") - end - -feature -- Change - - force (m: CMS_MENU) - do - items.force (m, m.name) - end - -feature -- Access - - new_cursor: ITERATION_CURSOR [CMS_MENU] - -- Fresh cursor associated with current structure - do - Result := items.new_cursor - end - -feature {NONE} -- Implementation - - items: HASH_TABLE [CMS_MENU, like {CMS_MENU}.name] --- items: ARRAYED_LIST [CMS_MENU] - -invariant - -end diff --git a/draft/application/cms/src/kernel/link/cms_pager.e b/draft/application/cms/src/kernel/link/cms_pager.e deleted file mode 100644 index 7cafd9a0..00000000 --- a/draft/application/cms/src/kernel/link/cms_pager.e +++ /dev/null @@ -1,17 +0,0 @@ -note - description: "Summary description for {CMS_PAGER}." - author: "" - date: "$Date$" - revision: "$Revision$" - -class - CMS_PAGER - -inherit - WSF_WIDGET_PAGER - -create - make - - -end diff --git a/draft/application/cms/src/kernel/log/cms_log.e b/draft/application/cms/src/kernel/log/cms_log.e deleted file mode 100644 index d5b02f43..00000000 --- a/draft/application/cms/src/kernel/log/cms_log.e +++ /dev/null @@ -1,152 +0,0 @@ -note - description: "Summary description for {CMS_LOG}." - date: "$Date$" - revision: "$Revision$" - -class - CMS_LOG - -create - make - -feature {NONE} -- Initialization - - make (a_category: like category; a_message: like message; a_level: like level; a_date: detachable like date) - do - category := a_category - message := a_message - set_level (a_level) - if a_date = Void then - create date.make_now_utc - else - date := a_date - end - end - - make_with_id (a_id: like id; a_category: like category; a_message: like message; a_level: like level; a_date: detachable like date) - do - id := a_id - make (a_category, a_message, a_level, a_date) - end - -feature -- Access - - id: INTEGER - -- Unique identifier of Current. - - category: READABLE_STRING_8 - -- Associated title (optional). - - message: READABLE_STRING_8 - -- Log message - - level: INTEGER - -- Severity level - - level_name: STRING - do - Result := level_to_string (level) - end - - info: detachable READABLE_STRING_8 - - link: detachable CMS_LINK - - date: DATE_TIME - -feature -- status report - - has_id: BOOLEAN - do - Result := id > 0 - end - -feature -- Change - - set_id (a_id: like id) - require - not has_id - do - id := a_id - end - - set_level (a_level: like level) - do - if a_level = 0 then - level := level_notice - else - level := a_level - end - end - - set_link (lnk: like link) - do - link := lnk - end - - set_info (inf: like info) - do - info := inf - end - -feature -- Conversion - - to_html (a_theme: WSF_THEME): STRING_8 - do - Result := "

    " - Result.append ("
    ") - Result.append (message) - if attached info as l_info then - Result.append ("
    Information: ") - Result.append (l_info) - end - if attached link as lnk then - Result.append ("
    Associated link: ") - Result.append (a_theme.link (lnk.title, lnk.location, lnk.options)) - end - Result.append ("
    ") - Result.append ("
    ") - Result.append ("(date: " + date.year.out + "/" + date.month.out + "/" + date.day.out + ")") - Result.append ("
    ") - - Result.append ("
    ") - end - -feature -- Constants - - level_to_string (a_level: INTEGER): STRING - do - inspect a_level - when level_emergency then - Result := "emergency" - when level_alert then - Result := "alert" - when level_critical then - Result := "critical" - when level_error then - Result := "error" - when level_warning then - Result := "warning" - when level_notice then - Result := "notice" - when level_info then - Result := "info" - when level_debug then - Result := "debug" - else - Result := "level-" + a_level.out - end - end - - level_emergency: INTEGER = 1 - level_alert: INTEGER = 2 - level_critical: INTEGER = 3 - level_error: INTEGER = 4 - level_warning: INTEGER = 5 - level_notice: INTEGER = 6 - level_info: INTEGER = 7 - level_debug: INTEGER = 8 - - - -end diff --git a/draft/application/cms/src/modules/admin/admin_blocks_cms_execution.e b/draft/application/cms/src/modules/admin/admin_blocks_cms_execution.e deleted file mode 100644 index 27ccfdd7..00000000 --- a/draft/application/cms/src/modules/admin/admin_blocks_cms_execution.e +++ /dev/null @@ -1,57 +0,0 @@ -note - description: "Summary description for {ADMIN_BLOCKS_CMS_EXECUTION}." - author: "" - date: "$Date$" - revision: "$Revision$" - -class - ADMIN_BLOCKS_CMS_EXECUTION - -inherit - CMS_EXECUTION - -create - make - -feature -- Execution - - process - -- Computed response message. - local - b: STRING_8 - do - set_title ("Blocks") - -- check Permission !!! - create b.make_empty - if has_permission ("administrate blocks") then - b.append ("
      ") - across - blocks as c - loop - if attached c.item as b_info then - if b_info.block.is_enabled then - b.append ("
    • ") - else - b.append ("
    • ") - end - b.append ("" + b_info.name + " (region=" + b_info.region + ")") - if b_info.block.is_enabled then - b.append (" [disable]") - else - b.append (" [enable]") - end - if attached b_info.block.title as l_title then - b.append ("
      title=" + l_title + "
      ") - end - b.append ("
    • ") - end - end - b.append ("
    ") - else - b.append ("
    Access denied
    ") - end - - set_main_content (b) - end - -end diff --git a/draft/application/cms/src/modules/admin/admin_cms_execution.e b/draft/application/cms/src/modules/admin/admin_cms_execution.e deleted file mode 100644 index 30816c59..00000000 --- a/draft/application/cms/src/modules/admin/admin_cms_execution.e +++ /dev/null @@ -1,46 +0,0 @@ -note - description: "Summary description for {CMS_ADMIN_EXECUTION}." - author: "" - date: "$Date$" - revision: "$Revision$" - -class - ADMIN_CMS_EXECUTION - -inherit - CMS_EXECUTION - -create - make - -feature -- Execution - - process - -- Computed response message. - local - b: STRING_8 - do - set_title ("Administration") - -- check Permission !!! - create b.make_empty - if has_permission ("administrate modules") then - b.append ("
  • " + link ("Modules", "/admin/modules/", Void) + "
  • ") - end - if has_permission ("administrate blocks") then - b.append ("
  • " + link ("Blocks", "/admin/blocks/", Void) + "
  • ") - end - if has_permission ("administrate user-roles") then - b.append ("
  • " + link ("User roles", "/admin/roles/", Void) + "
  • ") - end - if has_permission ("administrate users") then - b.append ("
  • " + link ("Users", "/admin/users/", Void) + "
  • ") - end - if has_permission ("administrate logs") then - b.append ("
  • " + link ("Logs", "/admin/logs/", Void) + "
  • ") - end - - - set_main_content (b) - end - -end diff --git a/draft/application/cms/src/modules/admin/admin_logs_cms_execution.e b/draft/application/cms/src/modules/admin/admin_logs_cms_execution.e deleted file mode 100644 index 1df94bd2..00000000 --- a/draft/application/cms/src/modules/admin/admin_logs_cms_execution.e +++ /dev/null @@ -1,47 +0,0 @@ -note - description: "Summary description for {ADMIN_LOGS_CMS_EXECUTION}." - author: "" - date: "$Date$" - revision: "$Revision$" - -class - ADMIN_LOGS_CMS_EXECUTION - -inherit - CMS_EXECUTION - -create - make - -feature -- Execution - - process - -- Computed response message. - local - b: STRING_8 - do - set_title ("Logs") - -- check Permission !!! - create b.make_empty - if has_permission ("admin logs") then - b.append ("
      ") - across - storage.recent_logs (1, 25) as c - loop - if attached c.item as l_log then - b.append ("
    • ") - b.append (link ("[" + l_log.id.out + "]", "/admin/log/" + l_log.id.out, Void)) - b.append (" " + l_log.category + " (level=" + l_log.level_name + ")") - b.append (": " + truncated_string (l_log.message, 60, "...")) - b.append ("
    • ") - end - end - b.append ("
    ") - else - b.append ("
    Access denied
    ") - end - - set_main_content (b) - end - -end diff --git a/draft/application/cms/src/modules/admin/admin_module.e b/draft/application/cms/src/modules/admin/admin_module.e deleted file mode 100644 index 4eed1758..00000000 --- a/draft/application/cms/src/modules/admin/admin_module.e +++ /dev/null @@ -1,112 +0,0 @@ -note - description: "Summary description for {ADMIN_MODULE}." - author: "" - date: "$Date$" - revision: "$Revision$" - -class - ADMIN_MODULE - -inherit - CMS_MODULE - redefine - permissions - end - - CMS_HOOK_MENU_ALTER - -create - make - -feature {NONE} -- Initialization - - make - do - name := "admin" - version := "1.0" - description := "Set of service to administrate the site" - package := "core" - - enable - end - -feature {CMS_SERVICE} -- Registration - - service: detachable CMS_SERVICE - - register (a_service: CMS_SERVICE) - do - service := a_service - a_service.map_uri ("/admin/", agent handle_admin (a_service, ?, ?)) - a_service.map_uri ("/admin/users/", agent handle_admin_users (a_service, ?, ?)) - a_service.map_uri ("/admin/roles/", agent handle_admin_user_roles (a_service, ?, ?)) - a_service.map_uri ("/admin/blocks/", agent handle_admin_blocks (a_service, ?, ?)) - a_service.map_uri ("/admin/modules/", agent handle_admin_modules (a_service, ?, ?)) - a_service.map_uri ("/admin/logs/", agent handle_admin_logs (a_service, ?, ?)) - a_service.map_uri_template ("/admin/log/{log-id}", agent handle_admin_log_view (a_service, ?, ?)) - - a_service.add_menu_alter_hook (Current) - end - -feature -- Hooks - - menu_alter (a_menu_system: CMS_MENU_SYSTEM; a_execution: CMS_EXECUTION) - local - lnk: CMS_LOCAL_LINK - do - create lnk.make ("Administer", "/admin/") - lnk.set_permission_arguments (<<"administer">>) - a_menu_system.management_menu.extend (lnk) - end - - permissions (a_service: CMS_SERVICE): LIST [CMS_PERMISSION] - do - Result := Precursor (a_service) - Result.extend ("administer") - Result.extend ("administer users") - Result.extend ("administer user roles") - Result.extend ("administer content") - Result.extend ("administer logs") - Result.extend ("administer blocks") - Result.extend ("administer modules") - end - -feature -- Handler - - handle_admin (cms: CMS_SERVICE; req: WSF_REQUEST; res: WSF_RESPONSE) - do - (create {ADMIN_CMS_EXECUTION}.make (req, res, cms)).execute - end - - handle_admin_users (cms: CMS_SERVICE; req: WSF_REQUEST; res: WSF_RESPONSE) - do - (create {ADMIN_USERS_CMS_EXECUTION}.make (req, res, cms)).execute - end - - handle_admin_user_roles (cms: CMS_SERVICE; req: WSF_REQUEST; res: WSF_RESPONSE) - do - (create {ADMIN_USER_ROLES_CMS_EXECUTION}.make (req, res, cms)).execute - end - - handle_admin_blocks (cms: CMS_SERVICE; req: WSF_REQUEST; res: WSF_RESPONSE) - do - (create {ADMIN_BLOCKS_CMS_EXECUTION}.make (req, res, cms)).execute - end - - handle_admin_modules (cms: CMS_SERVICE; req: WSF_REQUEST; res: WSF_RESPONSE) - do - (create {ADMIN_MODULES_CMS_EXECUTION}.make (req, res, cms)).execute - end - - handle_admin_logs (cms: CMS_SERVICE; req: WSF_REQUEST; res: WSF_RESPONSE) - do - (create {ADMIN_LOGS_CMS_EXECUTION}.make (req, res, cms)).execute - end - - handle_admin_log_view (cms: CMS_SERVICE; req: WSF_REQUEST; res: WSF_RESPONSE) - do - (create {LOG_VIEW_CMS_EXECUTION}.make (req, res, cms)).execute - end - - -end diff --git a/draft/application/cms/src/modules/admin/admin_modules_cms_execution.e b/draft/application/cms/src/modules/admin/admin_modules_cms_execution.e deleted file mode 100644 index c674b553..00000000 --- a/draft/application/cms/src/modules/admin/admin_modules_cms_execution.e +++ /dev/null @@ -1,57 +0,0 @@ -note - description: "Summary description for {ADMIN_MODULES_CMS_EXECUTION}." - author: "" - date: "$Date$" - revision: "$Revision$" - -class - ADMIN_MODULES_CMS_EXECUTION - -inherit - CMS_EXECUTION - -create - make - -feature -- Execution - - process - -- Computed response message. - local - b: STRING_8 - do - set_title ("Modules") - -- check Permission !!! - create b.make_empty - if has_permission ("administrate modules") then - b.append ("
      ") - across - service.modules as m - loop - if attached m.item as mod then - if mod.is_enabled then - b.append ("
    • ") - else - b.append ("
    • ") - end - b.append ("" + mod.name + " (version:" + mod.version + ")") - b.append (" package=" + mod.package) - if mod.is_enabled then - b.append (" [disable]") - else - b.append (" [enable]") - end - b.append ("
      " + mod.description + "
      ") - - b.append ("
    • ") - end - end - b.append ("
    ") - else - b.append ("
    Access denied
    ") - end - - set_main_content (b) - end - -end diff --git a/draft/application/cms/src/modules/admin/admin_user_roles_cms_execution.e b/draft/application/cms/src/modules/admin/admin_user_roles_cms_execution.e deleted file mode 100644 index 5fe6fb6b..00000000 --- a/draft/application/cms/src/modules/admin/admin_user_roles_cms_execution.e +++ /dev/null @@ -1,211 +0,0 @@ -note - description: "Summary description for {ADMIN_USER_ROLES_CMS_EXECUTION}." - author: "" - date: "$Date$" - revision: "$Revision$" - -class - ADMIN_USER_ROLES_CMS_EXECUTION - -inherit - CMS_EXECUTION - -create - make - -feature -- Execution - - process - do - if request.is_post_request_method then - process_post - else - process_get - end - end - - process_get - -- Computed response message. - local - b: STRING_8 - f: CMS_FORM - l_roles: LIST [CMS_USER_ROLE] - do - set_title ("User roles") - -- check Permission !!! - create b.make_empty - if has_permission ("administrate user roles") then - l_roles := service.storage.user_roles - f := new_edit_form (url (request.path_info, Void), l_roles, True) - f.append_to_html (theme, b) - else - b.append ("
    Access denied
    ") - end - set_main_content (b) - end - - process_post - -- Computed response message. - local - b: STRING_8 - f: CMS_FORM - l_roles: LIST [CMS_USER_ROLE] - do - set_title ("User roles") - create b.make_empty - - debug ("cms") - across - request.form_parameters as c - loop - b.append ("
  • ") - b.append (html_encoded (c.item.name)) - b.append ("=") - b.append (html_encoded (c.item.string_representation)) - b.append ("
  • ") - end - end - - if has_permission ("administer user roles") then - l_roles := service.storage.user_roles - f := new_edit_form (url (request.path_info, Void), l_roles, False) - f.submit_actions.extend (agent edit_form_submit (?, l_roles)) - f.process (Current) - f.append_to_html (theme, b) - else - b.append ("
    Access denied
    ") - end - - set_main_content (b) - end - -feature -- Forms - - edit_form_submit (fd: WSF_FORM_DATA; a_roles: LIST [CMS_USER_ROLE]) - local - l_role: CMS_USER_ROLE - do - if fd.item_same_string ("op", "Apply") then - across - a_roles as r - loop - if attached fd.table_item (r.item.name) as perms then - r.item.permissions.wipe_out - across - perms as c - loop - if attached {WSF_STRING} c.item as s then - r.item.add_permission (s.value) - end - end - service.storage.save_user_role (r.item) - end - end - elseif fd.item_same_string ("op", "Add role") then - if attached fd.string_item ("new-role") as l_new_role then - create l_role.make (l_new_role) - service.storage.save_user_role (l_role) - set_redirection (url (request.path_info, Void)) - end - elseif fd.item_same_string ("op", "Add permission") then - if attached fd.string_item ("new-permission") as l_new_permission then - l_role := service.storage.authenticated_user_role - l_role.add_permission (l_new_permission) - service.storage.save_user_role (l_role) - set_redirection (url (request.path_info, Void)) - end - end - end - - new_edit_form (a_action: READABLE_STRING_8; a_roles: LIST [CMS_USER_ROLE]; a_use_data: BOOLEAN): CMS_FORM - local - perms: ARRAYED_SET [READABLE_STRING_8] - tb: WSF_WIDGET_AGENT_TABLE [READABLE_STRING_8] - i: INTEGER - tf: WSF_FORM_TEXT_INPUT - do - create perms.make (10) - perms.compare_objects - across - service.modules as m - loop - across - m.item.permissions (service) as p - loop - perms.extend (p.item.name) - end - end - across - a_roles as c - loop - across - c.item.permissions as p - loop - perms.extend (p.item) - end - end - - create tb.make - tb.set_column_count (1 + a_roles.count) - i := 1 - tb.column (i).set_title ("Permissions") - across - a_roles as r - loop - i := i + 1 - tb.column (i).set_title (r.item.name) - end - - tb.add_css_style ("border: solid 1px #999;") - tb.set_data (perms) - tb.set_compute_item_function (agent (p: READABLE_STRING_8; ia_roles: LIST [CMS_USER_ROLE]; ia_use_data: BOOLEAN): WSF_WIDGET_TABLE_ROW - local - it: WSF_WIDGET_TABLE_ITEM - cb: WSF_FORM_CHECKBOX_INPUT - do - create Result.make (1 + ia_roles.count) - create it.make_with_text (p) - Result.set_item (it, 1) - across - ia_roles as r - loop - create cb.make (r.item.name + "[" + p + "]") - cb.set_text_value (p) - - if ia_use_data then - if r.item.has_permission (p) then - cb.set_checked (True) - else - cb.set_checked (False) - end - end - create it.make_with_content (cb) - Result.add_item (it) - end - end(?, a_roles, a_use_data) - ) - - create Result.make (a_action, "edit-user-roles") - Result.set_method_post - Result.extend (tb.to_computed_table) - Result.extend (create {WSF_FORM_SUBMIT_INPUT}.make_with_text ("op", "Apply")) - - create tf.make ("new-role") - tf.add_css_class ("horizontal") - tf.set_size (24) - tf.set_label ("New user role") - Result.extend (tf) - Result.extend (create {WSF_FORM_SUBMIT_INPUT}.make_with_text ("op", "Add role")) - - create tf.make ("new-permission") - tf.add_css_class ("horizontal") - tf.set_size (24) - tf.set_label ("New permission") - Result.extend (tf) - Result.extend (create {WSF_FORM_SUBMIT_INPUT}.make_with_text ("op", "Add permission")) - - - - end - -end diff --git a/draft/application/cms/src/modules/admin/admin_users_cms_execution.e b/draft/application/cms/src/modules/admin/admin_users_cms_execution.e deleted file mode 100644 index e785bdbd..00000000 --- a/draft/application/cms/src/modules/admin/admin_users_cms_execution.e +++ /dev/null @@ -1,56 +0,0 @@ -note - description: "Summary description for {ADMIN_USERS_CMS_EXECUTION}." - author: "" - date: "$Date$" - revision: "$Revision$" - -class - ADMIN_USERS_CMS_EXECUTION - -inherit - CMS_EXECUTION - -create - make - -feature -- Execution - - process - -- Computed response message. - local - b: STRING_8 - do - set_title ("Users") - -- check Permission !!! - create b.make_empty - if has_permission ("administrate users") then - - b.append ("
      ") - across - service.storage.all_users as c - loop - if attached c.item as u then - b.append ("
    • ") - b.append ("" + user_link (u) + " (id=" + u.id.out + ")") - if attached u.email as l_email then - b.append (" ["+ l_email +"]") - end - if attached u.creation_date as dt then - b.append (" - created: " + dt.out) - end - if attached u.last_login_date as dt then - b.append (" - last signed: " + dt.out) - end - - b.append ("
    • ") - end - end - b.append ("
    ") - else - b.append ("
    Access denied
    ") - end - - set_main_content (b) - end - -end diff --git a/draft/application/cms/src/modules/admin/log_view_cms_execution.e b/draft/application/cms/src/modules/admin/log_view_cms_execution.e deleted file mode 100644 index a9fe8718..00000000 --- a/draft/application/cms/src/modules/admin/log_view_cms_execution.e +++ /dev/null @@ -1,39 +0,0 @@ -note - description: "Summary description for {LOG_VIEW_CMS_EXECUTION}." - author: "" - date: "$Date$" - revision: "$Revision$" - -class - LOG_VIEW_CMS_EXECUTION - -inherit - CMS_EXECUTION - -create - make - -feature -- Execution - - process - -- Computed response message. - local - b: STRING_8 - do - if attached {WSF_STRING} request.path_parameter ("log-id") as p_id and then p_id.is_integer then - create b.make_empty - - if attached storage.log (p_id.integer_value) as l_log then - set_title ("Log #" + l_log.id.out) - b.append (l_log.to_html (theme)) - else - set_title ("Log [" + p_id.value + "] does not exists!") - end - set_main_content (b) - else - set_redirection ("/admin/logs") - set_main_content ("not found") - end - end - -end diff --git a/draft/application/cms/src/modules/cms_module.e b/draft/application/cms/src/modules/cms_module.e deleted file mode 100644 index e188c9bf..00000000 --- a/draft/application/cms/src/modules/cms_module.e +++ /dev/null @@ -1,58 +0,0 @@ -note - description: "Summary description for {WSF_CMS_MODULE}." - author: "" - date: "$Date$" - revision: "$Revision$" - -deferred class - CMS_MODULE - -feature -- Access - - is_enabled: BOOLEAN - - name: STRING - - description: STRING - - package: STRING - - version: STRING - -feature {CMS_SERVICE} -- Registration - - register (a_service: CMS_SERVICE) - deferred - end - -feature -- Settings - - enable - do - is_enabled := True - end - - disable - do - is_enabled := False - end - -feature -- Hooks - - help_text (a_path: STRING): STRING - do - create Result.make_empty - end - - permissions (a_service: CMS_SERVICE): LIST [CMS_PERMISSION] - do - create {ARRAYED_SET [CMS_PERMISSION]} Result.make (0) - end - - links: HASH_TABLE [CMS_MODULE_LINK, STRING] - -- Link indexed by path - do - create Result.make (0) - end - -end diff --git a/draft/application/cms/src/modules/cms_module_link.e b/draft/application/cms/src/modules/cms_module_link.e deleted file mode 100644 index 490db5a7..00000000 --- a/draft/application/cms/src/modules/cms_module_link.e +++ /dev/null @@ -1,50 +0,0 @@ -note - description: "Summary description for {CMS_MODULE_LINK}." - author: "" - date: "$Date$" - revision: "$Revision$" - -class - CMS_MODULE_LINK - -create - make - -feature {NONE} -- Initialization - - make (a_title: like title) - do - title := a_title - end - -feature -- Access - - title: STRING_32 - - description: detachable STRING_32 - - callback: detachable PROCEDURE [ANY, TUPLE [cms: detachable CMS_EXECUTION; args: detachable ITERABLE [STRING]]] - callback_arguments: detachable ITERABLE [STRING] - - permission: detachable LIST [STRING] - - parent: detachable CMS_MODULE_LINK - -feature -- Element change - - set_callback (cb: like callback; args: like callback_arguments) - do - callback := cb - callback_arguments := args - end - -feature -- Execution - - execute - do - if attached callback as cb then - cb.call ([Void, callback_arguments]) - end - end - -end diff --git a/draft/application/cms/src/modules/cms_permission.e b/draft/application/cms/src/modules/cms_permission.e deleted file mode 100644 index c0e23cff..00000000 --- a/draft/application/cms/src/modules/cms_permission.e +++ /dev/null @@ -1,36 +0,0 @@ -note - description: "Summary description for {CMS_PERMISSION}." - author: "" - date: "$Date$" - revision: "$Revision$" - -class - CMS_PERMISSION - -create - make - -convert - make ({READABLE_STRING_8, STRING_8, IMMUTABLE_STRING_8}) - -feature {NONE} -- Initialization - - make (n: like name) - do - name := n - end - -feature -- Access - - name: READABLE_STRING_8 - - description: detachable READABLE_STRING_8 - -feature -- Change - - set_description (s: like description) - do - description := s - end - -end diff --git a/draft/application/cms/src/modules/debug/debug_module.e b/draft/application/cms/src/modules/debug/debug_module.e deleted file mode 100644 index 6444fc4c..00000000 --- a/draft/application/cms/src/modules/debug/debug_module.e +++ /dev/null @@ -1,128 +0,0 @@ -note - description: "Summary description for {DEBUG_MODULE}." - date: "$Date$" - revision: "$Revision$" - -class - DEBUG_MODULE - -inherit - CMS_MODULE - --- CMS_HOOK_BLOCK - - CMS_HOOK_AUTO_REGISTER - - SHARED_EXECUTION_ENVIRONMENT - export - {NONE} all - end - -create - make - -feature {NONE} -- Initialization - - make - do - name := "debug" - version := "1.0" - description := "Debug" - package := "cms" - end - -feature {CMS_SERVICE} -- Registration - - service: detachable CMS_SERVICE - - register (a_service: CMS_SERVICE) - do - service := a_service - a_service.map_uri_template ("/debug/", agent handle_debug (a_service, ?, ?)) - end - -feature -- Hooks - --- block_list: ITERABLE [like {CMS_BLOCK}.name] --- do --- Result := <<"debug-info">> --- end - --- get_block_view (a_block_id: detachable READABLE_STRING_8; a_execution: CMS_EXECUTION) --- local --- b: CMS_CONTENT_BLOCK --- do --- create b.make ("debug-info", "Debug", "... ", a_execution.formats.plain_text) --- a_execution.add_block (b, Void) --- end - -feature -- Handler - - handle_debug (cms: CMS_SERVICE; req: WSF_REQUEST; res: WSF_RESPONSE) - local - e: CMS_EXECUTION - s: STRING - do - if req.is_get_request_method then - create {ANY_CMS_EXECUTION} e.make (req, res, cms) - e.set_title ("DEBUG") - - create s.make_empty - append_info_to ("Name", cms.site_name, e, s) - append_info_to ("Url", cms.site_url, e, s) - - if attached cms.configuration as cfg and then attached cfg.configuration_location as l_loc then - s.append ("
    ") - append_info_to ("Configuration file", l_loc.name, e, s) - end - - s.append ("
    ") - - append_info_to ("Current dir", execution_environment.current_working_path.utf_8_name, e, s) - append_info_to ("Base url", cms.base_url, e, s) - append_info_to ("Script url", cms.script_url, e, s) - s.append ("
    ") - append_info_to ("Dir", cms.site_dir.utf_8_name, e, s) - append_info_to ("Var dir", cms.site_var_dir.utf_8_name, e, s) - s.append ("
    ") - append_info_to ("Theme", cms.theme_name, e, s) - append_info_to ("Theme location", cms.theme_resource_location.utf_8_name, e, s) - s.append ("
    ") - append_info_to ("Files location", cms.files_location.utf_8_name, e, s) - s.append ("
    ") - - append_info_to ("Url", e.url ("/", Void), e, s) - if attached e.user as u then - append_info_to ("User", u.name, e, s) - append_info_to ("User url", e.user_url (u), e, s) - - end - - e.set_main_content (s) - else - create {NOT_FOUND_CMS_EXECUTION} e.make (req, res, cms) - end - e.execute - end - - append_info_to (n: READABLE_STRING_8; v: detachable READABLE_STRING_GENERAL; e: CMS_EXECUTION; t: STRING) - do - t.append ("
  • ") - t.append ("" + n + ": ") - if v /= Void then - t.append (e.html_encoded (v)) - end - t.append ("
  • ") - end - -note - copyright: "Copyright (c) 1984-2013, Eiffel Software and others" - license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" - source: "[ - Eiffel Software - 5949 Hollister Ave., Goleta, CA 93117 USA - Telephone 805-685-1006, Fax 805-685-6869 - Website http://www.eiffel.com - Customer support http://support.eiffel.com - ]" -end diff --git a/draft/application/cms/src/modules/node/cms_page.e b/draft/application/cms/src/modules/node/cms_page.e deleted file mode 100644 index 79cb4033..00000000 --- a/draft/application/cms/src/modules/node/cms_page.e +++ /dev/null @@ -1,75 +0,0 @@ -note - description: "Summary description for {CMS_PAGE}." - author: "" - date: "$Date$" - revision: "$Revision$" - -class - CMS_PAGE - -inherit - CMS_NODE - -create - make_new, - make - -feature {NONE} -- Initialization - - make (a_id: like id; a_title: like title; dt: like creation_date) - require - a_id > 0 - do - set_id (a_id) - creation_date := dt - modification_date := dt - title := a_title - initialize - end - - make_new (a_title: like title) - do - title := a_title - create creation_date.make_now_utc - modification_date := creation_date - initialize - end - - initialize - do - format := formats.default_format - end - -feature -- Access - - title: detachable READABLE_STRING_32 - - body: detachable READABLE_STRING_8 - - format: CMS_FORMAT - - content_type_name: STRING = "page" - -feature -- Change - - set_title (a_title: like title) - -- Set `title' to `a_title' - do - title := a_title - end - - set_body (a_body: like body; a_format: like format) - -- Set `body' and associated `format' - do - body := a_body - format := a_format - end - -feature -- Conversion - --- to_html (a_theme: CMS_THEME): STRING_8 --- do --- Result := Precursor (a_theme) --- end - -end diff --git a/draft/application/cms/src/modules/node/cms_page_content_type.e b/draft/application/cms/src/modules/node/cms_page_content_type.e deleted file mode 100644 index 948d8e4d..00000000 --- a/draft/application/cms/src/modules/node/cms_page_content_type.e +++ /dev/null @@ -1,176 +0,0 @@ -note - description: "Summary description for {CMS_PAGE_CONTENT_TYPE}." - author: "" - date: "$Date$" - revision: "$Revision$" - -class - CMS_PAGE_CONTENT_TYPE - -inherit - CMS_CONTENT_TYPE - -create - make - -feature {NONE} -- Initialization - - make - do - create {ARRAYED_LIST [like available_formats.item]} available_formats.make (1) - available_formats.extend (formats.plain_text) - available_formats.extend (formats.filtered_html) - available_formats.extend (formats.full_html) - end - -feature -- Access - - name: STRING = "page" - - title: STRING = "basic page" - - description: detachable READABLE_STRING_8 - -- Optional description - do - Result := "Use basic pages for your static content, such as an 'About us' page." - end - - available_formats: LIST [CMS_FORMAT] - -feature -- Factory - - fill_edit_form (f: CMS_FORM; a_node: detachable CMS_NODE) - local - ti: WSF_FORM_TEXT_INPUT - fset: WSF_FORM_FIELD_SET - ta: WSF_FORM_TEXTAREA - tselect: WSF_FORM_SELECT - opt: WSF_FORM_SELECT_OPTION - do - create ti.make ("title") - ti.set_label ("Title") - ti.set_size (70) - if a_node /= Void then - ti.set_text_value (a_node.title) - end - ti.set_is_required (True) - f.extend (ti) - - f.extend_text ("
    ") - - create ta.make ("body") - ta.set_rows (10) - ta.set_cols (70) - if a_node /= Void then - ta.set_text_value (a_node.body) - end --- ta.set_label ("Body") - ta.set_description ("This is the main content") - ta.set_is_required (False) - - create fset.make - fset.set_legend ("Body") - fset.extend (ta) - - fset.extend_text ("
    ") - - create tselect.make ("format") - tselect.set_label ("Body's format") - tselect.set_is_required (True) - across - available_formats as c - loop - create opt.make (c.item.name, c.item.title) - if attached c.item.help as f_help then - opt.set_description ("
      " + f_help + "
    ") - end - tselect.add_option (opt) - end - if a_node /= Void then - tselect.set_text_by_value (a_node.format.name) - end - - fset.extend (tselect) - - f.extend (fset) - - end - - change_node (a_execution: CMS_EXECUTION; fd: WSF_FORM_DATA; a_node: like new_node) - local - b: detachable READABLE_STRING_8 - f: detachable CMS_FORMAT - do - if attached fd.integer_item ("id") as l_id and then l_id > 0 then - check a_node.id = l_id end - end - if attached fd.string_item ("title") as l_title then - a_node.set_title (l_title) - end - - if attached fd.string_item ("body") as l_body then - b := l_body - end - if attached fd.string_item ("format") as s_format and then attached formats.format (s_format) as f_format then - f := f_format - elseif a_node /= Void then - f := a_node.format - else - f := formats.default_format - end - if b /= Void then - a_node.set_body (b, f) - end - end - - new_node (a_execution: CMS_EXECUTION; fd: WSF_FORM_DATA; a_node: detachable like new_node): CMS_PAGE - -- - local - b: detachable READABLE_STRING_8 - f: detachable CMS_FORMAT - l_node: detachable like new_node - do - l_node := a_node - if attached fd.integer_item ("id") as l_id and then l_id > 0 then - if l_node /= Void then - check l_node.id = l_id end - else - if attached {like new_node} a_execution.service.storage.node (l_id) as n then - l_node := n - else - -- FIXME: Error - end - end - end - if attached fd.string_item ("title") as l_title then - if l_node = Void then - create l_node.make_new (l_title) - else - l_node.set_title (l_title) - end - else - if l_node = Void then - create l_node.make_new ("...") - end - end - l_node.set_author (a_execution.user) - - if attached fd.string_item ("body") as l_body then - b := l_body - end - if attached fd.string_item ("format") as s_format and then attached formats.format (s_format) as f_format then - f := f_format - elseif a_node /= Void then - f := a_node.format - else - f := formats.default_format - end - if b /= Void then - l_node.set_body (b, f) - end - Result := l_node - end - -invariant - -end diff --git a/draft/application/cms/src/modules/node/node_add_cms_execution.e b/draft/application/cms/src/modules/node/node_add_cms_execution.e deleted file mode 100644 index 6b3357e3..00000000 --- a/draft/application/cms/src/modules/node/node_add_cms_execution.e +++ /dev/null @@ -1,61 +0,0 @@ -note - description: "[ - ]" - -class - NODE_ADD_CMS_EXECUTION - -inherit - NODE_CMS_EXECUTION - -create - make - -feature -- Execution - - process - -- Computed response message. - local - b: STRING_8 - f: like edit_form - fd: detachable WSF_FORM_DATA - do - create b.make_empty - if attached non_empty_string_path_parameter ("type") as s_type then - if attached service.content_type (s_type) as l_type then - f := edit_form (Void, url (request.path_info, Void), "add-" + l_type.name, l_type) - set_title ("Create " + l_type.title) - if has_permission ("create " + l_type.name) then - if request.is_post_request_method then - f.validation_actions.extend (agent edit_form_validate (?, b)) - f.submit_actions.extend (agent edit_form_submit (?, Void, l_type, b)) - f.process (Current) - fd := f.last_data - end - f.append_to_html (theme, b) - else - set_title ("Access denied") - end - else - set_title ("Unknown content type [" + s_type + "]") - end - else - set_title ("Create new content ...") - b.append ("
      ") - across - service.content_types as c - loop - if has_permission ("create " + c.item.name) then - b.append ("
    • " + link (c.item.name, "/node/add/" + c.item.name, Void)) - if attached c.item.description as d then - b.append ("
      " + d + "
      ") - end - b.append ("
    • ") - end - end - b.append ("
    ") - end - set_main_content (b) - end - -end diff --git a/draft/application/cms/src/modules/node/node_cms_execution.e b/draft/application/cms/src/modules/node/node_cms_execution.e deleted file mode 100644 index 075649b9..00000000 --- a/draft/application/cms/src/modules/node/node_cms_execution.e +++ /dev/null @@ -1,141 +0,0 @@ -note - description: "Summary description for {NODE_CMS_EXECUTION}." - author: "" - date: "$Date$" - revision: "$Revision$" - -deferred class - NODE_CMS_EXECUTION - -inherit - CMS_EXECUTION - -feature -- Form - - edit_form_validate (fd: WSF_FORM_DATA; b: STRING) - local - l_preview: BOOLEAN - l_format: detachable CMS_FORMAT - do - l_preview := attached {WSF_STRING} fd.item ("op") as l_op and then l_op.same_string ("Preview") - if l_preview then - b.append ("Preview
    ") - if attached fd.string_item ("format") as s_format and then attached formats.format (s_format) as f_format then - l_format := f_format - end - if attached fd.string_item ("title") as l_title then - b.append ("Title:
    " + html_encoded (l_title) + "
    ") - end - if attached fd.string_item ("body") as l_body then - b.append ("Body:
    ") - if l_format /= Void then - b.append (l_format.to_html (l_body)) - else - b.append (html_encoded (l_body)) - end - b.append ("
    ") - end - b.append ("
    ") - end - end - - edit_form_submit (fd: WSF_FORM_DATA; a_node: detachable CMS_NODE; a_type: CMS_CONTENT_TYPE; b: STRING) - local - l_preview: BOOLEAN - l_node: detachable CMS_NODE - s: STRING - do - l_preview := attached {WSF_STRING} fd.item ("op") as l_op and then l_op.same_string ("Preview") - if not l_preview then - debug ("cms") - across - fd as c - loop - b.append ("
  • " + html_encoded (c.key) + "=") - if attached c.item as v then - b.append (html_encoded (v.string_representation)) - end - b.append ("
  • ") - end - end - if a_node /= Void then - l_node := a_node - a_type.change_node (Current, fd, a_node) - s := "modified" - else - l_node := a_type.new_node (Current, fd, Void) - s := "created" - end - service.storage.save_node (l_node) - if attached user as u then - service.log ("node", "User %"" + user_link (u) + "%" " + s + " node " + link (a_type.name +" #" + l_node.id.out, "/node/" + l_node.id.out , Void), 0, node_local_link (l_node)) - else - service.log ("node", "Anonymous " + s + " node " + a_type.name +" #" + l_node.id.out, 0, node_local_link (l_node)) - end - add_success_message ("Node #" + l_node.id.out + " saved.") - set_redirection (node_url (l_node)) - end - end - --- edit_form_submit (fd: WSF_FORM_DATA; a_type: CMS_CONTENT_TYPE; b: STRING) --- local --- l_preview: BOOLEAN --- do --- l_preview := attached {WSF_STRING} fd.item ("op") as l_op and then l_op.same_string ("Preview") --- if not l_preview then --- debug ("cms") --- across --- fd as c --- loop --- b.append ("
  • " + html_encoded (c.key) + "=") --- if attached c.item as v then --- b.append (html_encoded (v.string_representation)) --- end --- b.append ("
  • ") --- end --- end --- if attached a_type.new_node (Current, fd, Void) as l_node then --- service.storage.save_node (l_node) --- if attached user as u then --- service.log ("node", "User %"" + user_link (u) + "%" created node " + link (a_type.name +" #" + l_node.id.out, "/node/" + l_node.id.out , Void), 0, node_local_link (l_node)) --- else --- service.log ("node", "Anonymous created node "+ a_type.name +" #" + l_node.id.out, 0, node_local_link (l_node)) --- end --- add_success_message ("Node #" + l_node.id.out + " saved.") --- set_redirection (node_url (l_node)) --- end --- end --- end - - edit_form (a_node: detachable CMS_NODE; a_url: READABLE_STRING_8; a_name: STRING; a_type: CMS_CONTENT_TYPE): CMS_FORM - local - f: CMS_FORM - ts: WSF_FORM_SUBMIT_INPUT - th: WSF_FORM_HIDDEN_INPUT - do - create f.make (a_url, a_name) - - create th.make ("node-id") - if a_node /= Void then - th.set_text_value (a_node.id.out) - else - th.set_text_value ("0") - end - f.extend (th) - - a_type.fill_edit_form (f, a_node) - - f.extend_text ("
    ") - - create ts.make ("op") - ts.set_default_value ("Save") - f.extend (ts) - - create ts.make ("op") - ts.set_default_value ("Preview") - f.extend (ts) - - Result := f - end - -end diff --git a/draft/application/cms/src/modules/node/node_edit_cms_execution.e b/draft/application/cms/src/modules/node/node_edit_cms_execution.e deleted file mode 100644 index ebe46173..00000000 --- a/draft/application/cms/src/modules/node/node_edit_cms_execution.e +++ /dev/null @@ -1,166 +0,0 @@ -note - description: "[ - ]" - -class - NODE_EDIT_CMS_EXECUTION - -inherit - NODE_CMS_EXECUTION - -create - make - -feature -- Execution - - process - -- Computed response message. - local - b: STRING_8 - f: like edit_form - fd: detachable WSF_FORM_DATA - do - create b.make_empty - if - attached {WSF_STRING} request.path_parameter ("nid") as p_nid and then - p_nid.is_integer and then - attached service.storage.node (p_nid.integer_value) as l_node - then - if attached service.content_type (l_node.content_type_name) as l_type then - if has_permission ("edit " + l_type.name) then - f := edit_form (l_node, url (request.path_info, Void), "edit-" + l_type.name, l_type) - if request.is_post_request_method then - f.validation_actions.extend (agent edit_form_validate (?, b)) - f.submit_actions.extend (agent edit_form_submit (?, l_node, l_type, b)) - f.process (Current) - fd := f.last_data - end - - set_title ("Edit #" + l_node.id.out) - - add_to_menu (create {CMS_LOCAL_LINK}.make ("View", node_url (l_node)), primary_tabs) - add_to_menu (create {CMS_LOCAL_LINK}.make ("Edit", "/node/" + l_node.id.out + "/edit"), primary_tabs) - - f.append_to_html (theme, b) - else - b.append ("

    Access denied

    ") - end - else - set_title ("Unknown node") - end - else - set_title ("Create new content ...") - b.append ("
      ") - across - service.content_types as c - loop - if has_permission ("create " + c.item.name) then - b.append ("
    • " + link (c.item.name, "/node/add/" + c.item.name, Void)) - if attached c.item.description as d then - b.append ("
      " + d + "
      ") - end - b.append ("
    • ") - end - end - b.append ("
    ") - end - set_main_content (b) - end - --- edit_form_validate (fd: CMS_FORM_DATA; b: STRING) --- local --- l_preview: BOOLEAN --- l_format: detachable CMS_FORMAT --- do --- l_preview := attached {WSF_STRING} fd.item ("op") as l_op and then l_op.same_string ("Preview") --- if l_preview then --- b.append ("Preview
    ") --- if attached fd.string_item ("format") as s_format and then attached formats.format (s_format) as f_format then --- l_format := f_format --- end --- if attached fd.string_item ("title") as l_title then --- b.append ("Title:
    " + html_encoded (l_title) + "
    ") --- end --- if attached fd.string_item ("body") as l_body then --- b.append ("Body:
    ") --- if l_format /= Void then --- b.append (l_format.to_html (l_body)) --- else --- b.append (html_encoded (l_body)) --- end --- b.append ("
    ") --- end --- b.append ("
    ") --- end --- end - --- edit_form_submit (fd: CMS_FORM_DATA; a_node: detachable CMS_NODE; a_type: CMS_CONTENT_TYPE; b: STRING) --- local --- l_preview: BOOLEAN --- l_node: detachable CMS_NODE --- s: STRING --- do --- l_preview := attached {WSF_STRING} fd.item ("op") as l_op and then l_op.same_string ("Preview") --- if not l_preview then --- debug ("cms") --- across --- fd as c --- loop --- b.append ("
  • " + html_encoded (c.key) + "=") --- if attached c.item as v then --- b.append (html_encoded (v.string_representation)) --- end --- b.append ("
  • ") --- end --- end --- if a_node /= Void then --- l_node := a_node --- a_type.change_node (Current, fd, a_node) --- s := "modified" --- else --- l_node := a_type.new_node (Current, fd, Void) --- s := "created" --- end --- service.storage.save_node (l_node) --- if attached user as u then --- service.log ("node", "User %"" + user_link (u) + "%" " + s + " node " + link (a_type.name +" #" + l_node.id.out, "/node/" + l_node.id.out , Void), 0, node_local_link (l_node)) --- else --- service.log ("node", "Anonymous " + s + " node " + a_type.name +" #" + l_node.id.out, 0, node_local_link (l_node)) --- end --- add_success_message ("Node #" + l_node.id.out + " saved.") --- set_redirection (node_url (l_node)) --- end --- end - --- edit_form (a_node: detachable CMS_NODE; a_url: READABLE_STRING_8; a_name: STRING; a_type: CMS_CONTENT_TYPE): CMS_FORM --- local --- f: CMS_FORM --- ts: CMS_FORM_SUBMIT_INPUT --- th: CMS_FORM_HIDDEN_INPUT --- do --- create f.make (a_url, a_name) - --- create th.make ("node-id") --- if a_node /= Void then --- th.set_text_value (a_node.id.out) --- else --- th.set_text_value ("0") --- end --- f.extend (th) - --- a_type.fill_edit_form (f, a_node) - --- f.extend_text ("
    ") - --- create ts.make ("op") --- ts.set_default_value ("Save") --- f.extend (ts) - --- create ts.make ("op") --- ts.set_default_value ("Preview") --- f.extend (ts) - --- Result := f --- end - -end diff --git a/draft/application/cms/src/modules/node/node_module.e b/draft/application/cms/src/modules/node/node_module.e deleted file mode 100644 index 54155056..00000000 --- a/draft/application/cms/src/modules/node/node_module.e +++ /dev/null @@ -1,127 +0,0 @@ -note - description: "Summary description for {NODE_MODULE}." - author: "" - date: "$Date$" - revision: "$Revision$" - -class - NODE_MODULE - -inherit - CMS_MODULE - redefine - permissions - end - - CMS_HOOK_MENU_ALTER - - CMS_HOOK_BLOCK - -create - make - -feature {NONE} -- Initialization - - make - do - name := "node" - version := "1.0" - description := "Service to manage content based on 'node'" - package := "core" - - enable - end - -feature -- Access - - permissions (a_service: CMS_SERVICE): LIST [CMS_PERMISSION] - do - Result := Precursor (a_service) - across - a_service.content_types as c - loop - Result.extend ("create " + c.item.name) - Result.extend ("edit " + c.item.name) - Result.extend ("delete " + c.item.name) - end - end - -feature {CMS_SERVICE} -- Registration - - service: detachable CMS_SERVICE - - register (a_service: CMS_SERVICE) - local - h: CMS_HANDLER - do - service := a_service - a_service.map_uri ("/node/add", agent handle_node_add (a_service, ?, ?)) - a_service.map_uri_template ("/node/add/{type}", agent handle_node_add (a_service, ?, ?)) - - create {CMS_HANDLER} h.make (agent handle_node_view (a_service, ?, ?)) - a_service.router.map (create {WSF_URI_TEMPLATE_MAPPING}.make ("/node/{nid}", h)) - a_service.router.map (create {WSF_URI_TEMPLATE_MAPPING}.make ("/node/{nid}/view", h)) - - a_service.map_uri_template ("/node/{nid}/edit", agent handle_node_edit (a_service, ?, ?)) - - a_service.add_content_type (create {CMS_PAGE_CONTENT_TYPE}.make) - - a_service.add_menu_alter_hook (Current) - a_service.add_block_hook (Current) - - end - -feature -- Hooks - - block_list: ITERABLE [like {CMS_BLOCK}.name] - do - Result := <<"node-info">> - end - - get_block_view (a_block_id: detachable READABLE_STRING_8; a_execution: CMS_EXECUTION) --- local --- b: CMS_CONTENT_BLOCK - do --- if --- a_execution.is_front and then --- attached a_execution.user as u --- then --- create b.make ("node-info", "Node", "Node ...", a_execution.formats.plain_text) --- a_execution.add_block (b, Void) --- end - end - - menu_alter (a_menu_system: CMS_MENU_SYSTEM; a_execution: CMS_EXECUTION) - local - lnk: CMS_LOCAL_LINK - perms: detachable ARRAYED_LIST [READABLE_STRING_8] - do - if attached a_execution.service.content_types as lst then - create perms.make (lst.count) - across - lst as c - loop - perms.force ("create " + c.item.name) - end - end - create lnk.make ("Add content", "/node/add/") - lnk.set_permission_arguments (perms) - a_menu_system.navigation_menu.extend (lnk) - end - - handle_node_view (cms: CMS_SERVICE; req: WSF_REQUEST; res: WSF_RESPONSE) - do - (create {NODE_VIEW_CMS_EXECUTION}.make (req, res, cms)).execute - end - - handle_node_edit (cms: CMS_SERVICE; req: WSF_REQUEST; res: WSF_RESPONSE) - do - (create {NODE_EDIT_CMS_EXECUTION}.make (req, res, cms)).execute - end - - handle_node_add (cms: CMS_SERVICE; req: WSF_REQUEST; res: WSF_RESPONSE) - do - (create {NODE_ADD_CMS_EXECUTION}.make (req, res, cms)).execute - end - -end diff --git a/draft/application/cms/src/modules/node/node_view_cms_execution.e b/draft/application/cms/src/modules/node/node_view_cms_execution.e deleted file mode 100644 index 028c5480..00000000 --- a/draft/application/cms/src/modules/node/node_view_cms_execution.e +++ /dev/null @@ -1,41 +0,0 @@ -note - description: "[ - ]" - -class - NODE_VIEW_CMS_EXECUTION - -inherit - NODE_CMS_EXECUTION - -create - make - -feature -- Execution - - process - -- Computed response message. - local - b: STRING_8 - do - if attached {WSF_STRING} request.path_parameter ("nid") as p_nid and then p_nid.is_integer then - create b.make_empty - - if attached storage.node (p_nid.integer_value) as l_node then - set_title ("Node [" + l_node.id.out + "]") - add_to_menu (create {CMS_LOCAL_LINK}.make ("View", node_url (l_node)), primary_tabs) - add_to_menu (create {CMS_LOCAL_LINK}.make ("Edit", "/node/" + l_node.id.out + "/edit"), primary_tabs) - - b.append (l_node.to_html (theme)) - else - set_title ("Node [" + p_nid.value + "] does not exists!") - end - set_main_content (b) - else - set_title ("Node ...") - create b.make_empty - set_main_content (b) - end - end - -end diff --git a/draft/application/cms/src/modules/openid/openid_cms_execution.e b/draft/application/cms/src/modules/openid/openid_cms_execution.e deleted file mode 100644 index 53bbdbf9..00000000 --- a/draft/application/cms/src/modules/openid/openid_cms_execution.e +++ /dev/null @@ -1,149 +0,0 @@ -note - description: "Summary description for {OPENID_CMS_EXECUTION}." - date: "$Date$" - revision: "$Revision$" - -class - OPENID_CMS_EXECUTION - -inherit - CMS_EXECUTION - -create - make - -feature -- Execution - - process - local - b: STRING - f: CMS_FORM - tf: WSF_FORM_TEXT_INPUT - ts: WSF_FORM_SUBMIT_INPUT - o: OPENID_CONSUMER - v: OPENID_CONSUMER_VALIDATION - tb: HASH_TABLE [READABLE_STRING_8, STRING_8] - l_uid: INTEGER - do - create b.make_empty - set_title ("OpenID identities") - if attached request.string_item ("openid.mode") as l_openid_mode then - -- Callback - create o.make (request.absolute_script_url ("/openid/login")) - o.ask_email (True) - o.ask_nickname (False) --- o.ask_all_info (False) - - create v.make_from_items (o, request.items_as_string_items) - v.validate - if v.is_valid then - if attached v.identity as l_identity then - if attached user as u then - if attached service.storage.custom_value (l_identity, "openid") as obj then - l_uid := user_id_from_custom_value (obj) - if l_uid > 0 and then l_uid = u.id then - -- Authenticated - b.append ("OpenID already associated to user %""+ user_link (u) +"%"") - else - -- Wrong USER !!! - b.append ("OpenID already associated to another user !!!") - end - else - -- New OpenID association - create tb.make (1) - tb.force (l_identity, "openid_identity") - tb.force (u.id.out, "uid") - service.storage.set_custom_value (l_identity, tb, "openid") - - b.append ("OpenID %""+ l_identity +"%" is now associated with user %""+ user_link (u) +"%"") - end - else - if - attached service.storage.custom_value (l_identity, "openid") as obj and then - attached user_id_from_custom_value (obj) as obj_uid and then - obj_uid > 0 and then - attached service.storage.user_by_id (obj_uid.to_integer) as u - then - -- Authenticated - set_user (u) - b.append ("Authenticated as %""+ user_link (u) +"%"") - set_redirection (user_url (u)) - else - -- Register new account - b.append ("Register new account associated with Openid %"" + l_identity + "%"?") - across - v.attributes as c - loop - b.append ("
  • " + c.key + "=" + c.item + "
  • ") - end - set_session_item ("openid.identity", l_identity) - if attached v.email_attribute as att_email then - set_session_item ("openid.email", att_email) - end - if attached v.nickname_attribute as att_nickname then - set_session_item ("openid.nickname", att_nickname) - end - b.append ("Create new account from your OpenID ") - b.append (link ("Register new account", "/user/register", Void)) - set_redirection (url ("/user/register", Void)) - end - end - end - else - b.append ("User authentication failed!!") - end - elseif attached request.string_item ("openid") as p_openid then - b.append ("Check openID: " + p_openid) - create o.make (request.absolute_script_url ("/openid/login")) - o.ask_email (True) - o.ask_all_info (False) - if attached o.auth_url (p_openid) as l_url then - set_redirection (l_url) - else - b.append ("Failure") - end - else - if attached user as u then - if attached service.storage.custom_value_names_where ("uid", u.id.out, "openid") as lst then - across - lst as c - loop - b.append ("
  • OpenID: " + c.item + "
  • ") - end - else - b.append ("No OpenID associated with current account") - end - end - create f.make (url ("/openid/login", Void), "openid-login") - create tf.make ("openid") - tf.set_size (50) - tf.set_text_value ("") - tf.set_label ("OpenID identifier") - f.extend (tf) - create ts.make_with_text ("op", "Validate") - f.extend (ts) - f.prepare (Current) - f.append_to_html (theme, b) - end - set_main_content (b) - end - - user_id_from_custom_value (lst: TABLE_ITERABLE [READABLE_STRING_8, STRING_8]): INTEGER - local - l_uid: detachable READABLE_STRING_8 - do - across - lst as c - until - l_uid /= Void - loop - if c.key.same_string ("uid") then - l_uid := c.item - end - end - if l_uid /= Void and then l_uid.is_integer then - Result := l_uid.to_integer - end - end - -end diff --git a/draft/application/cms/src/modules/openid/openid_module.e b/draft/application/cms/src/modules/openid/openid_module.e deleted file mode 100644 index 2f3a073f..00000000 --- a/draft/application/cms/src/modules/openid/openid_module.e +++ /dev/null @@ -1,141 +0,0 @@ -note - description: "Summary description for {OPENID_MODULE}." - author: "" - date: "$Date$" - revision: "$Revision$" - -class - OPENID_MODULE - -inherit - CMS_MODULE - - CMS_HOOK_MENU_ALTER - - CMS_HOOK_FORM_ALTER - - CMS_HOOK_AUTO_REGISTER - -create - make - -feature {NONE} -- Initialization - - make - do - name := "openid" - version := "1.0" - description := "OpenID login support" - package := "server" - end - -feature {CMS_SERVICE} -- Registration - - service: detachable CMS_SERVICE - - register (a_service: CMS_SERVICE) - do - a_service.map_uri ("/openid/login", agent handle_login) - - a_service.add_menu_alter_hook (Current) - service := a_service - end - -feature -- Hooks - - menu_alter (a_menu_system: CMS_MENU_SYSTEM; a_execution: CMS_EXECUTION) - local - lnk: CMS_LOCAL_LINK - req: WSF_REQUEST - do - req := a_execution.request - if req.path_info.starts_with ("/user") then - if a_execution.authenticated then - create lnk.make ("Openid identities", "/openid/login") - else - create lnk.make ("Login with Openid", "/openid/login") - end - -- a_menu_system.management_menu.extend (lnk) - a_menu_system.primary_tabs.extend (lnk) - end - end - - form_alter (a_form: CMS_FORM; a_form_data: detachable WSF_FORM_DATA; a_execution: CMS_EXECUTION) - local - i: WSF_FORM_DIV - fh: WSF_FORM_HIDDEN_INPUT - do - if a_form.id.same_string ("openid-login") then - create i.make_with_text_and_css_id ( - "Login with " + a_execution.link ("OpenID", "/openid/login", Void) - + " , " + a_execution.link ("Google", "/openid/login?openid=https://www.google.com/accounts/o8/id", Void) - + " , " + a_execution.link ("Yahoo", "/openid/login?openid=https://me.yahoo.com/", Void) - , - "openid" - ) - a_form.extend (i) - elseif a_form.id.same_string ("user-login") then - create i.make_with_text_and_css_id ( - "Login with " + a_execution.link ("OpenID", "/openid/login", Void) - + " , " + a_execution.link ("Google", "/openid/login?openid=https://www.google.com/accounts/o8/id", Void) - + " , " + a_execution.link ("Yahoo", "/openid/login?openid=https://me.yahoo.com/", Void) - , - "openid" - ) - if attached a_form.items_by_type ({WSF_WIDGET_TEXT}) as lst and then not lst.is_empty then - a_form.insert_before (i, lst.last) - else - a_form.extend (i) - end - elseif a_form.id.same_string ("user-register") then - if attached {READABLE_STRING_GENERAL} a_execution.session_item ("openid.identity") as l_openid_identity then - create fh.make_with_text ("openid-identity", l_openid_identity.to_string_32) - a_execution.remove_session_item ("openid.identity") - a_form.extend (fh) - a_form.extend_text ("The new account will be associated with OpenID %""+ a_execution.html_encoded (l_openid_identity) +"%"") - if attached {READABLE_STRING_GENERAL} a_execution.session_item ("openid.nickname") as l_openid_nickname then - if attached a_form.fields_by_name ("username") as f_lst then - across - f_lst as c - loop - if attached {WSF_FORM_TEXT_INPUT} c.item as txt then - txt.set_text_value (l_openid_nickname.to_string_32) - end - end - end - a_execution.remove_session_item ("openid.nickname") - end - if attached {READABLE_STRING_GENERAL} a_execution.session_item ("openid.email") as l_openid_email then - if attached a_form.fields_by_name ("email") as f_lst then - across - f_lst as c - loop - if attached {WSF_FORM_TEXT_INPUT} c.item as txt then - txt.set_text_value (l_openid_email.to_string_32) - end - end - end - a_execution.remove_session_item ("openid.email") - end - a_form.submit_actions.extend (agent openid_user_register_submitted) - end - end - end - - openid_user_register_submitted (a_form_data: WSF_FORM_DATA) - do - - end - -feature -- Access - - handle_login (req: WSF_REQUEST; res: WSF_RESPONSE) - do - if attached service as l_service then - (create {OPENID_CMS_EXECUTION}.make (req, res, l_service)).execute - else - res.set_status_code ({HTTP_STATUS_CODE}.expectation_failed) - end - end - -end diff --git a/draft/application/cms/src/modules/user/user_account_cms_execution.e b/draft/application/cms/src/modules/user/user_account_cms_execution.e deleted file mode 100644 index 3dc2fadf..00000000 --- a/draft/application/cms/src/modules/user/user_account_cms_execution.e +++ /dev/null @@ -1,59 +0,0 @@ -note - description: "[ - ]" - -class - USER_ACCOUNT_CMS_EXECUTION - -inherit - CMS_EXECUTION - -create - make - -feature -- Execution - - process - -- Computed response message. - local - b: STRING_8 - vars: detachable ARRAY [READABLE_STRING_32] - n: INTEGER --- vars: detachable WSF_TABLE - do - if attached {WSF_TABLE} request.path_parameter ("vars") as tb then - vars := tb.as_array_of_string - end - if vars = Void or else vars.is_empty then - set_title ("Account") - create b.make_empty - b.append ("Account") - set_main_content (b) - else - n := vars.count - create b.make_empty - if n >= 1 then - if vars[1].same_string ("password") then - set_title ("Password") - if n >= 2 then - if vars[2].same_string ("reset") then - b.append ("Reset password") - else - b.append ("password ???") - end - end - elseif vars[1].same_string ("register") then - set_title ("Registration") - b.append ("Register new account") - else - b.append ("???") - end - else - set_title ("Account/") - b.append ("...") - end - set_main_content (b) - end - end - -end diff --git a/draft/application/cms/src/modules/user/user_cms_execution.e b/draft/application/cms/src/modules/user/user_cms_execution.e deleted file mode 100644 index 89e0762f..00000000 --- a/draft/application/cms/src/modules/user/user_cms_execution.e +++ /dev/null @@ -1,206 +0,0 @@ -note - description: "[ - ]" - -class - USER_CMS_EXECUTION - -inherit - CMS_EXECUTION - - USER_MODULE_LIB - -create - make - -feature -- Execution - - process - -- Computed response message. - local - b: STRING_8 - u: detachable CMS_USER - l_first: BOOLEAN - do - if attached {WSF_STRING} request.path_parameter ("uid") as p_uid then - if p_uid.is_integer then - u := service.storage.user_by_id (p_uid.integer_value) - else - u := service.storage.user_by_name (p_uid.value) - end - else - u := user - end - initialize_primary_tabs (u) - - if u /= Void then - if not u.same_as (user) and then not has_permission ("admin view users") then - set_main_content ("Access denied") - else - service.storage.fill_user_profile (u) - create b.make_empty - set_title ("User [" + u.name + "]") - b.append ("
      %N") - if attached u.email as l_email then - b.append ("
    • Email: "+ l_email +"
    • ") - end - if has_permission ("administer users") and attached u.roles as u_roles then - b.append ("
    • Roles:") - l_first := True - across - u_roles as r - loop - if l_first then - l_first := False - else - b.append (", ") - end - if attached service.storage.user_role_by_id (r.item) as ur then - b.append (ur.name) - else - b.append (r.item.out) - end - end - b.append ("
    • ") - end - b.append ("
    • Created: "+ u.creation_date.out +"
    • %N") - if attached u.last_login_date as dt then - b.append ("
    • Last signed: "+ dt.out +"
    • %N") - else - b.append ("
    • Never signed yet
    • %N") - end - if u = user and then attached last_user_access_date as dt then - b.append ("
    • Session date: "+ dt.out +"
    • %N") - end - - service.storage.fill_user_profile (u) - if attached u.profile as prof then - across - prof as p - loop - b.append ("
    • " + p.key + "=" + p.item +"
    • %N") - end - end - b.append ("
    ") - set_main_content (b) - end - else - process_login - end - end - - process_login - local - l_url: detachable READABLE_STRING_8 - b: STRING_8 - f: CMS_FORM - fd: detachable WSF_FORM_DATA - do - if - attached {WSF_STRING} request.item ("destination") as s_dest - then - l_url := request.script_url (s_dest.value) - end - if l_url = Void then - l_url := request.script_url ("/user") - end - f := login_form (url ("/user", Void), "user-login", l_url) - if request.is_request_method ("post") then - f.submit_actions.extend (agent on_form_submitted) - f.process (Current) - fd := f.last_data - else - f.prepare (Current) - end - - if authenticated then - if - fd /= Void and then fd.is_valid and then - attached {WSF_STRING} fd.integer_item ("form-destination") as s_dest - then - l_url := request.script_url (s_dest.value) - end - - set_redirection (l_url) - set_title ("Login") - create b.make_empty - set_main_content (b) - set_redirection (url ("/user", Void)) - else - set_title ("Login") - create b.make_empty - f.append_to_html (theme, b) - set_main_content (b) - end - end - - on_form_submitted (fd: WSF_FORM_DATA) - local - u: detachable CMS_USER - do - if attached {WSF_STRING} fd.item (form_username_or_email_name) as s_name and then not s_name.is_empty then - u := service.storage.user_by_name (s_name.value) - if u = Void then - u := service.storage.user_by_email (s_name.value) - end - end - if u = Void then - fd.report_error ("Sorry, unrecognized username/email or password. " + link ("Have you forgotten your password?", "/user/password", Void)) - else - if attached {WSF_STRING} fd.item (form_password_name) as s_passwd and then not s_passwd.is_empty then - if service.auth_engine.valid_credential (u.name, s_passwd.value) then - login (u, request) - else - fd.report_error ("Sorry, unrecognized username/email or password. " + link ("Have you forgotten your password?", "/user/password", Void)) - end - end - end - end - - login_form (a_action: READABLE_STRING_8; a_form_name: READABLE_STRING_8; a_destination: READABLE_STRING_8): CMS_FORM - local - th: WSF_FORM_HIDDEN_INPUT - ti: WSF_FORM_TEXT_INPUT - tp: WSF_FORM_PASSWORD_INPUT - ts: WSF_FORM_SUBMIT_INPUT - l_logo: WSF_FORM_RAW_TEXT - d: WSF_FORM_DIV - do - create Result.make (a_action, a_form_name) - - create th.make ("form-destination") - th.set_default_value (a_destination) - Result.extend (th) - - create l_logo.make ("[ - - ]" - ) - create ti.make (form_username_or_email_name) - ti.set_label ("Username or email") - ti.set_is_required (True) - - create tp.make (form_password_name) - tp.set_label ("Password") - tp.set_is_required (True) - tp.set_description (link ("Reset password", "/user/password", Void)) - - create ts.make ("op") - ts.set_default_value ("Log in") - - create d.make_with_item (ti) - d.add_css_class ("input") - d.extend (tp) - Result.extend (l_logo) - Result.extend (d) - Result.extend (ts) - - Result.extend_text ("
    Need an account?
    " + link ("Sign up now!", "/user/register", Void) + "
    ") - end - - form_username_or_email_name: STRING = "name" - form_password_name: STRING = "password" - -end diff --git a/draft/application/cms/src/modules/user/user_edit_cms_execution.e b/draft/application/cms/src/modules/user/user_edit_cms_execution.e deleted file mode 100644 index bc076fb6..00000000 --- a/draft/application/cms/src/modules/user/user_edit_cms_execution.e +++ /dev/null @@ -1,215 +0,0 @@ -note - description: "[ - ]" - -class - USER_EDIT_CMS_EXECUTION - -inherit - CMS_EXECUTION - - USER_MODULE_LIB - -create - make - -feature -- Execution - - process - -- Computed response message. - local - b: STRING_8 - f: CMS_FORM - fd: detachable WSF_FORM_DATA - u: detachable CMS_USER - l_is_editing_current_user: BOOLEAN - do - if attached {WSF_STRING} request.path_parameter ("uid") as p_uid and then p_uid.is_integer then - u := service.storage.user_by_id (p_uid.integer_value) - if has_permission ("view users") then - else - if u /= Void and then u.same_as (user) then - else - u := Void - end - end - else - u := user - end - if attached user as l_active_user then - l_is_editing_current_user := l_active_user.same_as (u) - end - create b.make_empty - initialize_primary_tabs (u) - if u = Void then - b.append ("Access denied") - set_redirection (url ("/user/register", Void)) - else - service.storage.fill_user_profile (u) - f := edit_form (u, url (request.path_info, Void), "user-edit") - - if request.is_post_request_method then - f.validation_actions.extend (agent edit_form_validate (?, u)) - f.submit_actions.extend (agent edit_form_submit (?, u, l_is_editing_current_user, b)) - f.process (Current) - fd := f.last_data - else - f.prepare (Current) - end - - f.append_to_html (theme, b) - - end - set_main_content (b) - end - - edit_form_validate (fd: WSF_FORM_DATA; u: CMS_USER) - local - fu: detachable CMS_USER - do - if attached {WSF_STRING} fd.item ("username") as s_username then - fu := service.storage.user_by_name (s_username.value) - if fu = Void then - fd.report_invalid_field ("username", "User does not exist!") - end - end - if attached {WSF_STRING} fd.item ("email") as s_email then - fu := service.storage.user_by_email (s_email.value) - if fu /= Void and then fu.id /= u.id then - fd.report_invalid_field ("email", "Email is already used by another user!") - end - end - end - - edit_form_submit (fd: WSF_FORM_DATA; u: CMS_USER; a_is_editing_current_user: BOOLEAN; b: STRING) - local - up: detachable CMS_USER_PROFILE - l_roles: like {CMS_USER}.roles - do - debug - across - fd as c - loop - b.append ("
  • " + html_encoded (c.key) + "=") - if attached c.item as v then - b.append (html_encoded (v.string_representation)) - end - b.append ("
  • ") - end - end - - if attached {WSF_STRING} fd.item ("password") as s_password and then not s_password.is_empty then - u.set_password (s_password.value) - end - if attached {WSF_STRING} fd.item ("email") as s_email then - u.set_email (s_email.value) - end - - if attached {WSF_STRING} fd.item ("note") as s_note then - up := u.profile - if up = Void then - create up.make - end - up.force (s_note.value, "note") - u.set_profile (up) - end - if has_permission ("administer users") then - l_roles := u.roles - u.clear_roles - if attached fd.table_item ("roles") as f_roles and then not f_roles.is_empty then - create {ARRAYED_LIST [INTEGER]} l_roles.make (f_roles.count) - across - f_roles as r - loop - if attached {WSF_STRING} r.item as s and then attached s.is_integer then - u.add_role_by_id (s.integer_value) - end - end - end - end - - service.storage.save_user (u) - if a_is_editing_current_user and u /= user then - set_user (u) - end - set_redirection (user_url (u)) - end - - edit_form (u: CMS_USER; a_url: READABLE_STRING_8; a_name: STRING): CMS_FORM - local - f: CMS_FORM - ti: WSF_FORM_TEXT_INPUT - tp: WSF_FORM_PASSWORD_INPUT - ta: WSF_FORM_TEXTAREA - ts: WSF_FORM_SUBMIT_INPUT - tset: WSF_FORM_FIELD_SET - cb: WSF_FORM_CHECKBOX_INPUT - do - create f.make (a_url, a_name) - - create ti.make ("username") - ti.set_label ("Username") - ti.set_default_value (u.name) - ti.set_is_required (False) - ti.set_is_readonly (True) - f.extend (ti) - - f.extend_text ("
    ") - - create tp.make ("password") - tp.set_label ("Password") - tp.set_is_required (False) - f.extend (tp) - - f.extend_text ("
    ") - - create ti.make ("email") - ti.set_label ("Valid email address") - if attached u.email as l_email then - ti.set_default_value (l_email) - end - ti.set_is_required (True) - f.extend (ti) - - f.extend_text ("
    ") - - create ta.make ("note") - ta.set_label ("Additional note about you") - ta.set_description ("You can use this input to tell us more about you") - if attached u.profile as p and then attached p.item ("note") as l_note then - ta.set_default_value (l_note) - end - ta.set_is_required (False) - f.extend (ta) - - if has_permission ("administer users") then - create tset.make - tset.set_legend ("User roles") - tset.set_collapsible (True) - f.extend (tset) - across - service.storage.user_roles as r - loop - if - r.item ~ service.storage.anonymous_user_role or - r.item ~ service.storage.authenticated_user_role - then - -- Skip - else - create cb.make_with_value ("roles[]", r.item.id.out) - cb.set_title (r.item.name) - cb.set_checked (u /= Void and then u.has_role (r.item)) - tset.extend (cb) - end - end - end - f.extend_text ("
    ") - - create ts.make ("op") - ts.set_default_value ("Save") - f.extend (ts) - - Result := f - end - -end diff --git a/draft/application/cms/src/modules/user/user_logout_cms_execution.e b/draft/application/cms/src/modules/user/user_logout_cms_execution.e deleted file mode 100644 index 8fa1221d..00000000 --- a/draft/application/cms/src/modules/user/user_logout_cms_execution.e +++ /dev/null @@ -1,39 +0,0 @@ -note - description: "[ - ]" - -class - USER_LOGOUT_CMS_EXECUTION - -inherit - CMS_EXECUTION - -create - make - -feature -- Execution - - process - -- Computed response message. - local --- l_url: READABLE_STRING_8 - b: STRING_8 - do - logout (request) - - if - attached {WSF_STRING} request.item ("destination") as s_dest - then - set_redirection (request.script_url (s_dest.value)) - else - set_redirection (request.script_url ("/")) - end - - set_title ("Logout") - create b.make_empty - set_main_content (b) --- l_url := request.script_url ("/info/") --- res.redirect_now_with_content (l_url, "Redirection to " + l_url, "text/html") - end - -end diff --git a/draft/application/cms/src/modules/user/user_module.e b/draft/application/cms/src/modules/user/user_module.e deleted file mode 100644 index 248c8e2b..00000000 --- a/draft/application/cms/src/modules/user/user_module.e +++ /dev/null @@ -1,152 +0,0 @@ -note - description: "Summary description for {USER_MODULE}." - author: "" - date: "$Date$" - revision: "$Revision$" - -class - USER_MODULE - -inherit - CMS_MODULE - redefine - permissions - end - - CMS_HOOK_MENU_ALTER - - CMS_HOOK_BLOCK - -create - make - -feature {NONE} -- Initialization - - make - do - name := "user" - version := "1.0" - description := "Users management" - package := "core" - - enable - end - -feature {CMS_SERVICE} -- Registration - - service: detachable CMS_SERVICE - - register (a_service: CMS_SERVICE) - local - h: CMS_HANDLER - do - service := a_service - - a_service.map_uri ("/user/logout", agent handle_logout (a_service, ?, ?)) - a_service.map_uri ("/user/register", agent handle_register (a_service, ?, ?)) - a_service.map_uri ("/user/password", agent handle_request_new_password (a_service, ?, ?)) - - create {CMS_HANDLER} h.make (agent handle_user (a_service, ?, ?)) - a_service.router.map (create {WSF_URI_TEMPLATE_MAPPING}.make ("/user/{uid}", h)) - a_service.router.map (create {WSF_URI_MAPPING}.make_trailing_slash_ignored ("/user", h)) - a_service.map_uri_template ("/user/{uid}/edit", agent handle_edit (a_service, ?, ?)) - a_service.map_uri_template ("/user/reset/{uid}/{last-signed}/{extra}", agent handle_reset_password (a_service, ?, ?)) - - a_service.add_menu_alter_hook (Current) - a_service.add_block_hook (Current) - end - -feature -- Hooks - - permissions (a_service: CMS_SERVICE): LIST [CMS_PERMISSION] - do - Result := Precursor (a_service) - Result.extend ("register account") - Result.extend ("change username") - end - - block_list: ITERABLE [like {CMS_BLOCK}.name] - do - Result := <<"user-info">> - end - - get_block_view (a_block_id: detachable READABLE_STRING_8; a_execution: CMS_EXECUTION) - local - b: CMS_CONTENT_BLOCK - do - if - a_execution.is_front and then - attached a_execution.user as u - then - create b.make ("user-info", "User", "Welcome " + a_execution.html_encoded (u.name), a_execution.formats.plain_text) - a_execution.add_block (b, Void) - end - end - - menu_alter (a_menu_system: CMS_MENU_SYSTEM; a_execution: CMS_EXECUTION) - local - lnk: CMS_LOCAL_LINK - opts: CMS_API_OPTIONS - do - if attached a_execution.user as u then - create lnk.make ("Logout", "/user/logout") - a_execution.add_to_main_menu (lnk) - else - create lnk.make ("Login", "/user") - create opts.make_from_manifest (<<["query", <<["destination", a_execution.request.path_info]>> ]>>) - lnk.set_options (opts) - a_execution.add_to_main_menu (lnk) - - create lnk.make ("Sign up", "/user/register") - lnk.set_options (opts) - a_execution.add_to_main_menu (lnk) - end - if a_execution.authenticated then - if attached a_execution.user as u then - create lnk.make ("My Account (" + u.name + ")", "/user") - else - create lnk.make ("My Account", "/user") - end - a_menu_system.user_menu.extend (lnk) - create lnk.make ("Logout", "/user/logout") - a_menu_system.user_menu.extend (lnk) - else - create lnk.make ("Login", "/user") - a_menu_system.user_menu.extend (lnk) - end - end - -feature -- Handlers - - handle_logout (cms: CMS_SERVICE; req: WSF_REQUEST; res: WSF_RESPONSE) - do - (create {USER_LOGOUT_CMS_EXECUTION}.make (req, res, cms)).execute - end - - handle_user (cms: CMS_SERVICE; req: WSF_REQUEST; res: WSF_RESPONSE) - do - (create {USER_CMS_EXECUTION}.make (req, res, cms)).execute - end - - handle_edit (cms: CMS_SERVICE; req: WSF_REQUEST; res: WSF_RESPONSE) - do - (create {USER_EDIT_CMS_EXECUTION}.make (req, res, cms)).execute - end - - handle_register (cms: CMS_SERVICE; req: WSF_REQUEST; res: WSF_RESPONSE) - do - (create {USER_REGISTER_CMS_EXECUTION}.make (req, res, cms)).execute - end - - handle_request_new_password (cms: CMS_SERVICE; req: WSF_REQUEST; res: WSF_RESPONSE) - do - (create {USER_NEW_PASSWORD_CMS_EXECUTION}.make (req, res, cms)).execute - end - - handle_reset_password (cms: CMS_SERVICE; req: WSF_REQUEST; res: WSF_RESPONSE) - do - (create {USER_RESET_PASSWORD_CMS_EXECUTION}.make (req, res, cms)).execute - end - - -end diff --git a/draft/application/cms/src/modules/user/user_module_lib.e b/draft/application/cms/src/modules/user/user_module_lib.e deleted file mode 100644 index e1da1d1d..00000000 --- a/draft/application/cms/src/modules/user/user_module_lib.e +++ /dev/null @@ -1,29 +0,0 @@ -note - description: "Summary description for {USER_MODULE_LIB}." - author: "" - date: "$Date$" - revision: "$Revision$" - -deferred class - USER_MODULE_LIB - -inherit - CMS_COMMON_API - - CMS_EXECUTION - -feature -- Initialization - - initialize_primary_tabs (u: detachable CMS_USER) - do - if u /= Void then - primary_tabs.extend (create {CMS_LOCAL_LINK}.make ("View", "/user/" + u.id.out)) - primary_tabs.extend (create {CMS_LOCAL_LINK}.make ("Edit", "/user/" + u.id.out + "/edit")) - else - primary_tabs.extend (create {CMS_LOCAL_LINK}.make ("Create new account", "/user/register")) - primary_tabs.extend (create {CMS_LOCAL_LINK}.make ("Log in", "/user")) - primary_tabs.extend (create {CMS_LOCAL_LINK}.make ("Request new password", "/user/password")) - end - end - -end diff --git a/draft/application/cms/src/modules/user/user_new_password_cms_execution.e b/draft/application/cms/src/modules/user/user_new_password_cms_execution.e deleted file mode 100644 index 70b60710..00000000 --- a/draft/application/cms/src/modules/user/user_new_password_cms_execution.e +++ /dev/null @@ -1,171 +0,0 @@ -note - description: "[ - ]" - -class - USER_NEW_PASSWORD_CMS_EXECUTION - -inherit - CMS_EXECUTION - - USER_MODULE_LIB - -create - make - -feature -- Execution - - process - -- Computed response message. - local - b: STRING_8 - f: CMS_FORM - u: detachable CMS_USER - fd: detachable WSF_FORM_DATA - do - set_title ("Request new password") - create b.make_empty - if not request.is_post_request_method and authenticated then - u := user - initialize_primary_tabs (u) - if u /= Void then - if attached u.email as l_email then - f := new_password_form (url (request.path_info, Void), "new-password") - b.append ("Password reset instructions will be mailed to " + l_email + ". You must " + link ("log out", "/user/logout", Void) + " to use the password reset link in the e-mail.") - f.append_to_html (theme, b) - else - b.append ("Your account does not have any email address set!") - set_redirection (url ("/user/"+ u.id.out +"/edit", Void)) - end - else - b.append ("Unexpected issue") - end - else - f := new_password_form (url (request.path_info, Void), "new-password") - if request.is_post_request_method then - f.validation_actions.extend (agent password_form_validate) - f.submit_actions.extend (agent password_form_submit (?, b)) - f.process (Current) - fd := f.last_data - else - initialize_primary_tabs (Void) - end - - f.append_to_html (theme, b) - end - set_main_content (b) - end - - password_form_validate (fd: WSF_FORM_DATA) - local - u: detachable CMS_USER - do - if attached {WSF_STRING} fd.item ("name") as s_name then - u := service.storage.user_by_name (s_name.value) - if u = Void then - u := service.storage.user_by_email (s_name.value) - if u = Void then - fd.report_invalid_field ("name", "Sorry, " + html_encoded (s_name.value)+ " is not recognized as a user name or an e-mail address.") - end - end - end - fd.add_cached_value ("user", u) - initialize_primary_tabs (u) - end - - password_form_submit (fd: WSF_FORM_DATA; b: STRING) - local - e: detachable CMS_EMAIL - l_uuid: UUID - do - debug - across - fd as c - loop - b.append ("
  • " + html_encoded (c.key) + "=") - if attached c.item as v then - b.append (html_encoded (v.string_representation)) - end - b.append ("
  • ") - end - end - if attached {CMS_USER} fd.cached_value ("user") as u then - if attached u.email as l_mail_address then - l_uuid := (create {UUID_GENERATOR}).generate_uuid - e := new_password_email (u, l_mail_address, l_uuid.out) - u.set_data_item ("new_password_extra", l_uuid.out) - service.storage.save_user (u) - service.mailer.safe_process_email (e) - add_success_message ("Further instructions have been sent to your e-mail address.") - set_redirection (url ("/user", Void)) - else - add_error_message ("No email is associated with the requested account. Please contact the webmaster for help.") - set_redirection (url ("/user", Void)) - end - else - add_error_message ("User not defined!") - end - end - - new_password_form (a_url: READABLE_STRING_8; a_name: STRING): CMS_FORM - require - attached user as l_auth_user implies l_auth_user.has_email - local - u: like user - f: CMS_FORM - ti: WSF_FORM_TEXT_INPUT - th: WSF_FORM_HIDDEN_INPUT - ts: WSF_FORM_SUBMIT_INPUT - err: BOOLEAN - do - create f.make (a_url, a_name) - u := user - if u = Void then - create ti.make ("name") - ti.set_label ("Username or e-mail address") - ti.set_is_required (True) - f.extend (ti) - elseif attached u.email as l_mail then - create th.make ("name") - th.set_default_value (l_mail) - th.set_is_required (True) - f.extend (th) - else - f.extend_text ("The associated account has no e-mail address.") - err := True - end - - if not err then - create ts.make ("op") - ts.set_default_value ("E-mail new password") - f.extend (ts) - end - - Result := f - end - - new_password_email (u: CMS_USER; a_mail_address: STRING; a_extra: READABLE_STRING_8): CMS_EMAIL - local - b: STRING - opts: CMS_URL_API_OPTIONS - dt: detachable DATE_TIME - do - create b.make_empty - create opts.make_absolute - - b.append ("A request to reset the password for your account has been made at " + service.site_name + ".%N") - b.append ("You may now log in by clicking this link or copying and pasting it to your browser:%N%N") - dt := u.last_login_date - if dt = Void then - dt := u.creation_date - end - b.append (url ("/user/reset/" + u.id.out + "/" + unix_timestamp (dt).out + "/" + a_extra, opts)) - b.append ("%N") - b.append ("%N") - b.append ("This link can only be used once to log in and will lead you to a page where you can set your password. It expires after one day and nothing will happen if it's not used.%N") - b.append ("%N%N-- The %"" + service.site_name + "%" team") - - create Result.make (service.site_email, a_mail_address, "Account details for " + u.name + " at " + service.site_name, b) - end - -end diff --git a/draft/application/cms/src/modules/user/user_register_cms_execution.e b/draft/application/cms/src/modules/user/user_register_cms_execution.e deleted file mode 100644 index 95369dc9..00000000 --- a/draft/application/cms/src/modules/user/user_register_cms_execution.e +++ /dev/null @@ -1,217 +0,0 @@ -note - description: "[ - ]" - -class - USER_REGISTER_CMS_EXECUTION - -inherit - CMS_EXECUTION - - USER_MODULE_LIB - -create - make - -feature -- Execution - - process - -- Computed response message. - local - b: STRING_8 - f: CMS_FORM - fd: detachable WSF_FORM_DATA - do - set_title ("Create new account") - create b.make_empty - if authenticated then - initialize_primary_tabs (user) - b.append ("You are already " + link ("signed in", "/user", Void) + ", please " + link ("signout", "/user/logout", Void) + " before trying to " + link ("register a new account", "/account/register", Void) + ".") - set_redirection (url ("/user", Void)) - else - f := registration_form (url (request.path_info, Void), "user-register") - - if request.is_post_request_method then - f.validation_actions.extend (agent registration_form_validate) - f.submit_actions.extend (agent registration_form_submitted (?, b)) - - f.process (Current) - fd := f.last_data - else - f.prepare (Current) - end - if fd /= Void and then fd.is_valid then - set_main_content (b) - else - initialize_primary_tabs (user) - f.append_to_html (theme, b) - end - end - set_main_content (b) - end - - registration_form_validate (fd: WSF_FORM_DATA) - local - u: detachable CMS_USER - do - if attached {WSF_STRING} fd.item ("username") as s_username then - u := service.storage.user_by_name (s_username.value) - if u /= Void then - fd.report_invalid_field ("username", "User already exists!") - end - end - if attached {WSF_STRING} fd.item ("email") as s_email then - u := service.storage.user_by_email (s_email.value) - if u /= Void then - fd.report_invalid_field ("email", "Email is already used!") - end - end - end - - registration_form_submitted (fd: WSF_FORM_DATA; buf: STRING) - local - b: STRING - u: detachable CMS_USER - up: detachable CMS_USER_PROFILE - e: detachable CMS_EMAIL - l_pass: detachable READABLE_STRING_32 - l_uuid: UUID - do - b := buf - across - fd as c - loop - b.append ("
  • " + html_encoded (c.key) + "=") - if attached c.item as v then - b.append (html_encoded (v.string_representation)) - end - b.append ("
  • ") - end - if attached {WSF_STRING} fd.item ("username") as s_username then - u := service.storage.user_by_name (s_username.value) - - create u.make_new (s_username.value) - if attached {WSF_STRING} fd.item ("password") as s_password then - u.set_password (s_password.value) - l_pass := u.password - end - if attached {WSF_STRING} fd.item ("email") as s_email then - u.set_email (s_email.value) - end - - if attached {WSF_STRING} fd.item ("note") as s_note then - create up.make - up.force (s_note.value, "note") - u.set_profile (up) - end - - l_uuid := (create {UUID_GENERATOR}).generate_uuid - u.set_data_item ("new_password_extra", l_uuid.out) - - service.storage.save_user (u) - if attached u.email as l_mail_address then - e := new_registration_email (l_mail_address, u, l_pass, l_uuid.out) - service.mailer.safe_process_email (e) - end - e := new_user_account_email (service.site_email, u) - service.mailer.safe_process_email (e) - - login (u, request) - set_redirection (url ("/user", Void)) - end - end - - registration_form (a_url: READABLE_STRING_8; a_name: STRING): CMS_FORM - local - f: CMS_FORM - ti: WSF_FORM_TEXT_INPUT - tp: WSF_FORM_PASSWORD_INPUT - ta: WSF_FORM_TEXTAREA - ts: WSF_FORM_SUBMIT_INPUT - do - create f.make (a_url, a_name) - - create ti.make ("username") - ti.set_label ("Username") - ti.set_is_required (True) - ti.set_validation_action (agent (fd: WSF_FORM_DATA) - do - if attached {WSF_STRING} fd.item ("username") as f_username and then f_username.value.count >= 5 then - else - fd.report_invalid_field ("username", "Username should contain at least 5 characters!") - end - end) - f.extend (ti) - - f.extend_text ("
    ") - - create tp.make ("password") - tp.set_label ("Password") - tp.set_is_required (True) - f.extend (tp) - - f.extend_text ("
    ") - - create ti.make ("email") - ti.set_label ("Valid email address") - ti.set_is_required (True) - f.extend (ti) - - f.extend_text ("
    ") - - create ta.make ("note") - ta.set_label ("Additional note about you") - ta.set_description ("You can use this input to tell us more about you") - ta.set_is_required (False) - f.extend (ta) - - f.extend_text ("
    ") - - create ts.make ("Register") - ts.set_default_value ("Register") - f.extend (ts) - - Result := f - end - - new_registration_email (a_mail_address: STRING; u: CMS_USER; a_password: detachable like {CMS_USER}.password; a_extra: READABLE_STRING_8): CMS_EMAIL - require - has_clear_password: u.password /= Void or else a_password /= Void - local - p: detachable like {CMS_USER}.password - b: STRING - opts: CMS_URL_API_OPTIONS - do - p := a_password - if p = Void then - p := u.password - end - - create b.make_from_string (u.name + "%N" + "Thank you for registering at " + service.site_name + ". ") - create opts.make_absolute --- if p /= Void then - b.append ("You may now log in to " + url ("/user", opts) + " using your username %""+ u.name +"%" and password%N") --- b.append ("%Nusername: " + u.name + "%Npassword: " + p + "%N%N") --- end - b.append ("You may also log in by clicking on this link or copying and pasting it in your browser:%N%N") - b.append (url ("/user/reset/" + u.id.out + "/" + unix_timestamp (u.creation_date).out + "/" + a_extra, opts)) --- b.append (url ("/user/reset/" + u.id.out + "/" + unix_timestamp (u.creation_date).out + "/", opts)) - b.append ("%N%NThis is a one-time login, so it can be used only once.%N%NAfter logging in, you will be redirected to " + url ("/user/" + u.id.out + "/edit", opts) + " so you can change your password.%N") - b.append ("%N%N-- The %"" + service.site_name + "%" team") - - create Result.make (service.site_email, a_mail_address, "Account details for " + u.name + " at " + service.site_name, b) - end - - new_user_account_email (a_mail_address: STRING; u: CMS_USER): CMS_EMAIL - local - b: STRING - opts: CMS_URL_API_OPTIONS - do - create b.make_from_string ("New user account %"" + u.name + "%" at " + service.site_name + ". ") - create opts.make_absolute - b.append ("See user account: " + user_url (u) + "%N") - b.append ("%N%N-- The %"" + service.site_name + "%" team") - create Result.make (service.site_email, a_mail_address, "New User Account %"" + u.name + "%" at " + service.site_name, b) - end - -end diff --git a/draft/application/cms/src/modules/user/user_reset_password_cms_execution.e b/draft/application/cms/src/modules/user/user_reset_password_cms_execution.e deleted file mode 100644 index dcf7042d..00000000 --- a/draft/application/cms/src/modules/user/user_reset_password_cms_execution.e +++ /dev/null @@ -1,86 +0,0 @@ -note - description: "[ - ]" - -class - USER_RESET_PASSWORD_CMS_EXECUTION - -inherit - CMS_EXECUTION - -create - make - -feature -- Execution - - process - -- Computed response message. - local - b: STRING_8 - u: detachable CMS_USER - err: BOOLEAN - t: INTEGER_64 - l_extra: detachable READABLE_STRING_8 - do - create b.make_empty - u := user - if u /= Void then - add_success_message ("You are logged in as " + u.name + ". " + link ("Change your password", "/user/" + u.id.out + "/edit", Void)) - set_redirection (front_page_url) - else - if attached {WSF_STRING} request.path_parameter ("uid") as p_uid and then p_uid.is_integer then - u := service.storage.user_by_id (p_uid.integer_value) - end - if u /= Void then - if attached non_empty_string_path_parameter ("last-signed") as p_last_signed then - if p_last_signed.is_integer_64 then - t := p_last_signed.to_integer_64 - else - err := True - end - if t > 0 then - if attached u.last_login_date as l_last then - if t /= unix_timestamp (l_last) then - err := True - end - else - if t /= unix_timestamp (u.creation_date) then - err := True - end - end - end - else - err := True - end - if attached non_empty_string_path_parameter ("extra") as s_extra then - l_extra := s_extra - if l_extra /= Void then - if attached {READABLE_STRING_8} u.data_item ("new_password_extra") as u_extra and then u_extra.same_string (l_extra) then - else - err := True - end - else - err := True - end - else - err := True - end - if not err then - login (u, request) - u.remove_data_item ("new_password_extra") - service.storage.save_user (u) - set_redirection (url ("/user/" + u.id.out + "/edit", Void)) - set_main_content (b) - end - else - err := True - end - if err then - add_warning_message ("The one-time login link you clicked is invalid.") - set_redirection (front_page_url) - end - end - set_main_content (b) - end - -end diff --git a/draft/application/cms/src/notification/cms_email.e b/draft/application/cms/src/notification/cms_email.e deleted file mode 100644 index 3826a4fc..00000000 --- a/draft/application/cms/src/notification/cms_email.e +++ /dev/null @@ -1,18 +0,0 @@ -note - description : "[ - Component representing an email - ]" - author : "$Author$" - date : "$Date$" - revision : "$Revision$" - -class - CMS_EMAIL - -inherit - NOTIFICATION_EMAIL - -create - make - -end diff --git a/draft/application/cms/src/notification/cms_storage_mailer.e b/draft/application/cms/src/notification/cms_storage_mailer.e deleted file mode 100644 index c5a4c2d7..00000000 --- a/draft/application/cms/src/notification/cms_storage_mailer.e +++ /dev/null @@ -1,38 +0,0 @@ -note - description: "Summary description for {CMS_CHAIN_MAILER}." - author: "" - date: "$Date$" - revision: "$Revision$" - -class - CMS_STORAGE_MAILER - -inherit - NOTIFICATION_MAILER - -create - make - -feature {NONE} -- Initialization - - make (a_storage: like storage) - do - storage := a_storage - end - -feature -- Access - - storage: CMS_STORAGE - -feature -- Status - - is_available: BOOLEAN = True - -feature -- Basic operation - - process_email (a_email: NOTIFICATION_EMAIL) - do - storage.save_email (a_email) - end - -end diff --git a/draft/application/cms/src/storage/cms_sed_storage.e b/draft/application/cms/src/storage/cms_sed_storage.e deleted file mode 100644 index 20e340fd..00000000 --- a/draft/application/cms/src/storage/cms_sed_storage.e +++ /dev/null @@ -1,615 +0,0 @@ -note - description : "[ - CMS Storage implemented using SED - ]" - date : "$Date$" - revision : "$Revision$" - -class - CMS_SED_STORAGE - -inherit - CMS_STORAGE - -create - make - -feature {NONE} -- Initialization - - make (dn: READABLE_STRING_GENERAL) - -- Initialize `Current'. - do - create directory_name.make_from_string (dn) - ensure_directory_exists (directory_name) - create sed - initialize - end - - directory_name: PATH - - sed: SED_STORABLE_FACILITIES - - sed_file_retrieved (f: FILE): detachable ANY - local - r: SED_MEDIUM_READER_WRITER - do - create r.make (f) - r.set_for_reading - Result := sed.retrieved (r, True) - end - - sed_file_store (obj: ANY; f: FILE) - local - w: SED_MEDIUM_READER_WRITER - do - create w.make (f) - w.set_for_writing - sed.store (obj, w) - end - - save_object_with_id (obj: ANY; a_id: INTEGER; a_type: STRING) - local - fn: PATH - f: RAW_FILE - do - fn := directory_name.extended (a_type) - ensure_directory_exists (fn) - fn := fn.extended (a_id.out) --- .appended_with_extension ("txt") - create f.make_with_path (fn) --- check not f.exists end - f.create_read_write - sed_file_store (obj, f) - f.close - end - - object_with_id (a_id: INTEGER; a_type: STRING): detachable ANY - local - fn: PATH - f: RAW_FILE - do - fn := directory_name.extended (a_type) - ensure_directory_exists (fn) - fn := fn.extended (a_id.out) --- .append_with_extension ("txt") - create f.make_with_path (fn) - if f.exists and f.is_readable then - f.open_read - Result := sed_file_retrieved (f) - f.close - end - end - -feature -- Access: user - - has_user: BOOLEAN - -- Has any user? - do - Result := users_count > 0 - end - - users_count: INTEGER - do - Result := last_sequence ("user") - end - - fill_user_profile (a_user: CMS_USER) - do - if a_user.profile = Void then - if attached user_profile (a_user) as p then - a_user.set_profile (p) - end - end - end - - all_users: LIST [CMS_USER] - local - res: ARRAYED_LIST [like all_users.item] - i, n: like last_sequence - do - n := last_sequence ("user") - create res.make (n) - from - i := 1 - until - i > n - loop - if attached user_by_id (i) as u then - res.force (u) - end - i := i + 1 - end - Result := res - end - - user_by_id (a_id: like {CMS_USER}.id): detachable CMS_USER - do - if attached {like user_by_id} object_with_id (a_id, "user") as u then - Result := u - end - end - - user_by_name (a_name: like {CMS_USER}.name): detachable CMS_USER - local - uid: INTEGER - do - if attached users_index as t then - uid := t.by_name.item (a_name) - if uid > 0 then - Result := user_by_id (uid) - end - end - end - - user_by_email (a_email: like {CMS_USER}.email): detachable CMS_USER - local - uid: INTEGER - do - if attached users_index as t then - uid := t.by_email.item (a_email) - if uid > 0 then - Result := user_by_id (uid) - end - end - end - - is_valid_credential (u, p: READABLE_STRING_32): BOOLEAN - do - if attached user_by_name (u) as l_user then - Result := attached l_user.encoded_password as l_pass and then l_pass.same_string (encoded_password (p)) - end - end - - encoded_password (a_raw_password: STRING_32): attached like {CMS_USER}.encoded_password - do - Result := a_raw_password.as_string_8 + "!123!" - end - -feature -- Change: user - - save_user (a_user: CMS_USER) - local - uid: INTEGER - prof: like {CMS_USER}.profile - l_has_new_name: BOOLEAN - l_has_new_email: BOOLEAN - l_stored_user: like user_by_id - do - if a_user.has_id then - uid := a_user.id - l_stored_user := user_by_id (uid) - if l_stored_user /= Void then - l_has_new_name := not l_stored_user.name.same_string (a_user.name) - l_has_new_email := not (l_stored_user.email ~ a_user.email) - end - else - l_has_new_name := True - l_has_new_email := True - uid := next_sequence ("user") - a_user.set_id (uid) - end - if attached a_user.password as p then - a_user.set_encoded_password (encoded_password (p)) - a_user.set_password (Void) - end - - prof := a_user.profile - a_user.set_profile (Void) - if prof /= Void then - save_user_profile (a_user, prof) - end - save_object_with_id (a_user, uid, "user") - if l_has_new_name or l_has_new_email then - if attached users_index as l_index then - l_index.by_name.force (uid, a_user.name) - l_index.by_email.force (uid, a_user.email) - store_users_index (l_index) - end - end - a_user.set_profile (prof) - end - -feature -- Access: user_role - - user_role_by_id (a_id: INTEGER): detachable CMS_USER_ROLE - do - if attached {like user_role_by_id} object_with_id (a_id, "user_roles") as ur then - Result := ur - end - end - - user_roles: LIST [CMS_USER_ROLE] - local - i: INTEGER - n: like last_sequence - do - n := last_sequence ("user_roles") - create {ARRAYED_LIST [CMS_USER_ROLE]} Result.make (n) - if n > 0 then - from - i := 1 - until - i > n - loop - if attached user_role_by_id (i) as ur then - Result.force (ur) - end - i := i + 1 - end - end - end - -feature -- Change: user_role - - save_user_role (a_role: CMS_USER_ROLE) - do - if not a_role.has_id then - a_role.set_id (next_sequence ("user_roles")) - end - save_object_with_id (a_role, a_role.id, "user_roles") - end - -feature -- Email - - save_email (a_email: NOTIFICATION_EMAIL) - local - dn: PATH - fn: PATH - f: RAW_FILE - ts: INTEGER_64 - i: INTEGER - do - dn := directory_name.extended ("emails") - ensure_directory_exists (dn) - ts := (create {HTTP_DATE_TIME_UTILITIES}).unix_time_stamp (a_email.date) - from - fn := dn.extended (ts.out).appended_with_extension ("txt") - create f.make_with_path (fn) - until - not f.exists - loop - i := i + 1 - fn := dn.extended (ts.out + "-" + i.out).appended_with_extension ("txt") - f.make_with_path (fn) - end - f.create_read_write - f.put_string (a_email.message) - f.close - end - -feature -- Log - - log (a_id: like {CMS_LOG}.id): detachable CMS_LOG - do - if attached {CMS_LOG} object_with_id (a_id, "log") as l then - Result := l - end - end - - recent_logs (a_lower: INTEGER; a_count: INTEGER): LIST [CMS_LOG] - local - n: Like last_sequence - i, p1, nb: INTEGER - do - n := last_sequence ("log") - p1 := n - a_lower + 1 - - if p1 > 0 then - create {ARRAYED_LIST [CMS_LOG]} Result.make (a_count) - from - i := p1 - until - i < 1 or nb = a_count - loop - if attached log (i) as obj then - Result.force (obj) - nb := nb + 1 - end - i := i - 1 - end - else - create {ARRAYED_LIST [CMS_LOG]} Result.make (0) - end - end - - - save_log (a_log: CMS_LOG) - do - if not a_log.has_id then - a_log.set_id (next_sequence ("log")) - end - save_object_with_id (a_log, a_log.id, "log") - end - -feature -- Node - - recent_nodes (a_lower: INTEGER; a_count: INTEGER): LIST [CMS_NODE] - local - n: Like last_sequence - i, p1, nb: INTEGER - do - n := last_sequence ("node") - p1 := n - a_lower + 1 - - if p1 > 0 then - create {ARRAYED_LIST [CMS_NODE]} Result.make (a_count) - from - i := p1 - until - i < 1 or nb = a_count - loop - if attached node (i) as l_node then - Result.force (l_node) - nb := nb + 1 - end - i := i - 1 - end - else - create {ARRAYED_LIST [CMS_NODE]} Result.make (0) - end - end - - node (a_id: INTEGER): detachable CMS_NODE - do - if attached {like node} object_with_id (a_id, "node") as obj then - Result := obj - end - end - - save_node (a_node: CMS_NODE) - local - nid: INTEGER - do - if a_node.has_id then - nid := a_node.id - else - nid := next_sequence ("node") - a_node.set_id (nid) - end - - save_object_with_id (a_node, nid, "node") - end - -feature {NONE} -- Implementation - - last_sequence (a_type: STRING): INTEGER - local - fn: PATH - f: RAW_FILE - do - fn := directory_name.extended (a_type).appended_with_extension ("last_id") - create f.make_with_path (fn) - if f.exists and then f.is_readable then - f.open_read - f.read_line - if f.last_string.is_integer then - Result := f.last_string.to_integer - else - check is_integer: False end - end - f.close - end - end - - next_sequence (a_type: STRING): INTEGER - local - fn: PATH - f: RAW_FILE - do - fn := directory_name.extended (a_type).appended_with_extension ("last_id") - create f.make_with_path (fn) - if f.exists and then f.is_readable then - f.open_read - f.read_line - if f.last_string.is_integer then - Result := f.last_string.to_integer - else - check is_integer: False end - end - f.close - end - Result := Result + 1 - f.open_write - f.put_string (Result.out) - f.put_new_line - f.close - end - - users_index: TUPLE [ - by_name: HASH_TABLE [like {CMS_USER}.id, like {CMS_USER}.name]; - by_email: HASH_TABLE [like {CMS_USER}.id, like {CMS_USER}.email] - ] - local - f: RAW_FILE - fn: PATH - res: detachable like users_index - retried: INTEGER - do - fn := directory_name.extended ("users.db") - create f.make_with_path (fn) - if retried = 0 then - if f.exists and then f.is_readable then - f.open_read - if attached {like users_index} sed_file_retrieved (f) as r then - res := r - end - f.close - else - end - end - if res = Void then - res := [ create {HASH_TABLE [like {CMS_USER}.id, like {CMS_USER}.name]}.make (1), - create {HASH_TABLE [like {CMS_USER}.id, like {CMS_USER}.email]}.make (1) ] - end - Result := res - rescue - retried := retried + 1 - retry - end - - store_users_index (a_users_index: like users_index) - local - f: RAW_FILE - fn: PATH - do - fn := directory_name.extended ("users.db") - create f.make_with_path (fn) - if not f.exists or else f.is_writable then - f.open_write - sed_file_store (a_users_index, f) - f.close - end - end - - user_profile (a_user: CMS_USER): detachable CMS_USER_PROFILE - do - if attached {like user_profile} object_with_id (a_user.id, "user_profile") as obj then - Result := obj - end - end - - save_user_profile (a_user: CMS_USER; a_prof: CMS_USER_PROFILE) - local - l_id: INTEGER - do - if a_user.has_id then - l_id := a_user.id - end - - save_object_with_id (a_prof, l_id, "user_profile") - end - -feature -- Misc - - custom_type (a_type: READABLE_STRING_8): STRING - do - Result := "custom__" + a_type - end - - custom_value_id (a_name: READABLE_STRING_8; a_type: READABLE_STRING_8): INTEGER - -- Storage `id' for custom value named `a_name' if any. - -- If no such data exists, return 0 - local - i, - l_id, l_last_id: INTEGER - t: STRING - do - t := custom_type (a_type) - l_last_id := last_sequence (t) - from - i := 1 - until - i > l_last_id or l_id > 0 - loop - if - attached {TUPLE [name: READABLE_STRING_8; value: attached like custom_value]} object_with_id (i, t) as obj and then - obj.name.same_string (a_name) - then - l_id := i - end - i := i + 1 - end - end - - set_custom_value (a_name: READABLE_STRING_8; a_value: attached like custom_value ; a_type: READABLE_STRING_8) - -- Save data `a_name:a_value' for type `a_type' - local - t: STRING - l_id: INTEGER - do - t := custom_type (a_type) - l_id := custom_value_id (a_name, a_type) - if l_id = 0 then - l_id := next_sequence (t) - end - save_object_with_id ([a_name, a_value], l_id, t) - end - - custom_value (a_name: READABLE_STRING_8; a_type: READABLE_STRING_8): detachable TABLE_ITERABLE [READABLE_STRING_8, STRING_8] - -- Data for name `a_name' and type `a_type'. - local - i, - l_id, l_last_id: INTEGER - t: STRING - do - t := custom_type (a_type) - l_last_id := last_sequence (t) - from - i := 1 - until - i > l_last_id or l_id > 0 - loop - if - attached {TUPLE [name: READABLE_STRING_8; value: attached like custom_value]} object_with_id (i, t) as obj and then - obj.name.same_string (a_name) - then - l_id := i - Result := obj.value - end - i := i + 1 - end - end - - custom_value_names_where (a_where_key, a_where_value: READABLE_STRING_8; a_type: READABLE_STRING_8): detachable LIST [READABLE_STRING_8] - -- Name where custom value has item `a_where_key' same as `a_where_value' for type `a_type'. - local - i, l_last_id: INTEGER - t: STRING - l_key_found: BOOLEAN - res: ARRAYED_LIST [READABLE_STRING_8] - do - create res.make (0) - t := custom_type (a_type) - l_last_id := last_sequence (t) - from - i := 1 - until - i > l_last_id - loop - if - attached {TUPLE [name: READABLE_STRING_8; value: attached like custom_value]} object_with_id (i, t) as d - then - l_key_found := False - across - d.value as c - until - l_key_found or Result /= Void - loop - if c.key.same_string (a_where_key) then - l_key_found := True - if c.item.same_string (a_where_value) then - res.force (d.name) - end - end - end - end - i := i + 1 - end - if not res.is_empty then - Result := res - end - end - -feature {NONE} -- Implementation - - ensure_directory_exists (dn: PATH) - local - d: DIRECTORY - do - d := tmp_dir - d.make_with_path (dn) - if not d.exists then - d.recursive_create_dir - end - end - -feature {NONE} -- Implementation - - tmp_dir: DIRECTORY - once - create Result.make_with_path (directory_name) - end - -invariant - -end diff --git a/draft/application/cms/src/storage/cms_storage.e b/draft/application/cms/src/storage/cms_storage.e deleted file mode 100644 index 4bf8818c..00000000 --- a/draft/application/cms/src/storage/cms_storage.e +++ /dev/null @@ -1,186 +0,0 @@ -note - description : "[ - CMS interface to storage - ]" - date : "$Date$" - revision : "$Revision$" - -deferred class - CMS_STORAGE - -feature {NONE} -- Initialization - - initialize - do - end - -feature -- Access: user - - has_user: BOOLEAN - -- Has any user? - deferred - end - - fill_user_profile (a_user: CMS_USER) - deferred - end - - all_users: LIST [CMS_USER] - deferred - end - - user_by_id (a_id: like {CMS_USER}.id): detachable CMS_USER - require - a_id > 0 - deferred - ensure - same_id: Result /= Void implies Result.id = a_id - no_password: Result /= Void implies Result.password = Void - end - - user_by_name (a_name: like {CMS_USER}.name): detachable CMS_USER - require - a_name /= Void and then not a_name.is_empty - deferred - ensure - no_password: Result /= Void implies Result.password = Void - end - - user_by_email (a_email: like {CMS_USER}.email): detachable CMS_USER - deferred - ensure - no_password: Result /= Void implies Result.password = Void - end - - is_valid_credential (u, p: READABLE_STRING_32): BOOLEAN - deferred - end - -feature -- Change: user - - save_user (a_user: CMS_USER) - deferred - ensure - a_user_password_is_encoded: a_user.password = Void - a_user.has_id - end - -feature -- Access: roles and permissions - - user_has_permission (u: detachable CMS_USER; s: detachable READABLE_STRING_8): BOOLEAN - -- Anonymous or user `u' has permission for `s' ? - --| `s' could be "create page", - do - if s = Void then - Result := True - elseif u = Void then - Result := user_role_has_permission (anonymous_user_role, s) - else - Result := user_role_has_permission (authenticated_user_role, s) - if not Result and attached u.roles as l_roles then - across - l_roles as r - until - Result - loop - if attached user_role_by_id (r.item) as ur then - Result := user_role_has_permission (ur, s) - end - end - end - end - end - - anonymous_user_role: CMS_USER_ROLE - do - if attached user_role_by_id (1) as l_anonymous then - Result := l_anonymous - else - create Result.make ("anonymous") - end - end - - authenticated_user_role: CMS_USER_ROLE - do - if attached user_role_by_id (2) as l_authenticated then - Result := l_authenticated - else - create Result.make ("authenticated") - end - end - - user_role_has_permission (a_role: CMS_USER_ROLE; s: READABLE_STRING_8): BOOLEAN - do - Result := a_role.has_permission (s) - end - - user_role_by_id (a_id: like {CMS_USER_ROLE}.id): detachable CMS_USER_ROLE - deferred - end - - user_roles: LIST [CMS_USER_ROLE] - deferred - end - -feature -- Change: roles and permissions - - save_user_role (a_user_role: CMS_USER_ROLE) - deferred - end - -feature -- Email - - save_email (a_email: NOTIFICATION_EMAIL) - deferred - end - -feature -- Log - - recent_logs (a_lower: INTEGER; a_count: INTEGER): LIST [CMS_LOG] - deferred - end - - log (a_id: like {CMS_LOG}.id): detachable CMS_LOG - require - a_id > 0 - deferred - end - - save_log (a_log: CMS_LOG) - deferred - end - -feature -- Node - - recent_nodes (a_lower: INTEGER; a_count: INTEGER): LIST [CMS_NODE] - deferred - end - - node (a_id: INTEGER): detachable CMS_NODE - require - a_id > 0 - deferred - end - - save_node (a_node: CMS_NODE) - deferred - end - -feature -- Misc - - set_custom_value (a_name: READABLE_STRING_8; a_value: attached like custom_value; a_type: READABLE_STRING_8) - -- Save data `a_name:a_value' for type `a_type' - deferred - end - - custom_value (a_name: READABLE_STRING_8; a_type: READABLE_STRING_8): detachable TABLE_ITERABLE [READABLE_STRING_8, STRING_8] - -- Data for name `a_name' and type `a_type'. - deferred - end - - custom_value_names_where (a_where_key, a_where_value: READABLE_STRING_8; a_type: READABLE_STRING_8): detachable LIST [READABLE_STRING_8] - -- Names where custom value has item `a_where_key' same as `a_where_value' for type `a_type'. - deferred - end - -end diff --git a/draft/application/cms/src/theme/cms_html_template.e b/draft/application/cms/src/theme/cms_html_template.e deleted file mode 100644 index 86a93f50..00000000 --- a/draft/application/cms/src/theme/cms_html_template.e +++ /dev/null @@ -1,13 +0,0 @@ -note - description: "Summary description for {WSF_CMS_HTML_TEMPLATE}." - author: "" - date: "$Date$" - revision: "$Revision$" - -deferred class - CMS_HTML_TEMPLATE - -inherit - CMS_TEMPLATE - -end diff --git a/draft/application/cms/src/theme/cms_page_template.e b/draft/application/cms/src/theme/cms_page_template.e deleted file mode 100644 index 74c36646..00000000 --- a/draft/application/cms/src/theme/cms_page_template.e +++ /dev/null @@ -1,12 +0,0 @@ -note - description: "Summary description for {CMS_PAGE_TEMPLATE}." - author: "" - date: "$Date$" - revision: "$Revision$" - -deferred class - CMS_PAGE_TEMPLATE - -inherit - CMS_TEMPLATE -end diff --git a/draft/application/cms/src/theme/cms_template.e b/draft/application/cms/src/theme/cms_template.e deleted file mode 100644 index 791844c9..00000000 --- a/draft/application/cms/src/theme/cms_template.e +++ /dev/null @@ -1,81 +0,0 @@ -note - description: "Summary description for {WSF_CMS_PAGE_TEMPLATE}." - author: "" - date: "$Date$" - revision: "$Revision$" - -deferred class - CMS_TEMPLATE - -feature -- Access - - theme: CMS_THEME - deferred - end - - variables: HASH_TABLE [detachable ANY, STRING] - deferred - end - - prepare (page: CMS_HTML_PAGE) - deferred - end - - to_html (page: CMS_HTML_PAGE): STRING - deferred - end - -feature {NONE} -- Implementation - - apply_template_engine (s: STRING_8) - local - p,n: INTEGER - k: STRING - sv: detachable STRING - do - from - n := s.count - p := 1 - until - p = 0 - loop - p := s.index_of ('$', p) - if p > 0 then - k := next_identifier (s, p + 1) - s.remove_substring (p, p + k.count) - sv := Void - if attached variables.item (k) as l_value then - - if attached {STRING_8} l_value as s8 then - sv := s8 - elseif attached {STRING_32} l_value as s32 then - sv := s32.as_string_8 -- FIXME: use html encoder - else - sv := l_value.out - end - s.insert_string (sv, p) - p := p + sv.count - else - debug - s.insert_string ("$" + k, p) - end - end - end - end - end - - next_identifier (s: STRING; a_index: INTEGER): STRING - local - i: INTEGER - do - from - i := a_index - until - not (s[i].is_alpha_numeric or s[i] = '_' or s[i] = '.') - loop - i := i + 1 - end - Result := s.substring (a_index, i - 1) - end - -end diff --git a/draft/application/cms/src/theme/cms_theme.e b/draft/application/cms/src/theme/cms_theme.e deleted file mode 100644 index bec379ae..00000000 --- a/draft/application/cms/src/theme/cms_theme.e +++ /dev/null @@ -1,101 +0,0 @@ -note - description: "Summary description for {WSF_CMS_THEME}." - author: "" - date: "$Date$" - revision: "$Revision$" - -deferred class - CMS_THEME - -inherit - WSF_THEME - undefine - url_encoded, - html_encoded - end - - CMS_COMMON_API - -feature {NONE} -- Access - - service: CMS_SERVICE - deferred - end - -feature -- Access - - name: STRING - deferred - end - - regions: ARRAY [STRING] - deferred --- Result := <<"header", "content", "footer">> - end - - page_template: CMS_TEMPLATE - deferred - end - -feature -- Conversion - - menu_html (a_menu: CMS_MENU; is_horizontal: BOOLEAN): STRING_8 - do - create Result.make_from_string ("
    ") - if is_horizontal then - Result.append ("
      %N") - else - Result.append ("
        %N") - end - across - a_menu as c - loop - append_cms_link_to (c.item, Result) - end - Result.append ("
      %N") - Result.append ("
    ") - end - - page_html (page: CMS_HTML_PAGE): STRING_8 - deferred - end - -feature {NONE} -- Implementation - - append_cms_link_to (lnk: CMS_LINK; s: STRING_8) - local - cl: STRING - do - create cl.make_empty - if lnk.is_active then - cl.append ("active ") - end - if lnk.is_expandable then - cl.append ("expandable ") - end - if lnk.is_expanded then - cl.append ("expanded ") - end - if cl.is_empty then - s.append ("
  • ") - else - s.append ("
  • ") - end - s.append ("" + html_encoded (lnk.title) + "") - if - lnk.is_expanded and then - attached lnk.children as l_children - then - s.append ("
      %N") - across - l_children as c - loop - append_cms_link_to (c.item, s) - end - s.append ("
    ") - end - s.append ("
  • ") - end - - -end diff --git a/draft/application/cms/www/themes/default/res/ewfcms.js b/draft/application/cms/www/themes/default/res/ewfcms.js deleted file mode 100644 index d4ebbef7..00000000 --- a/draft/application/cms/www/themes/default/res/ewfcms.js +++ /dev/null @@ -1,91 +0,0 @@ -/* - * EWF CMS javascript based on JQuery - */ - -/** - * Override jQuery.fn.init to guard against XSS attacks. - * - * See http://bugs.jquery.com/ticket/9521 - */ - -(function () { - var jquery_init = jQuery.fn.init; - jQuery.fn.init = function (selector, context, rootjQuery) { - // If the string contains a "#" before a "<", treat it as invalid HTML. - if (selector && typeof selector === 'string') { - var hash_position = selector.indexOf('#'); - if (hash_position >= 0) { - var bracket_position = selector.indexOf('<'); - if (bracket_position > hash_position) { - throw 'Syntax error, unrecognized expression: ' + selector; - } - } - } - return jquery_init.call(this, selector, context, rootjQuery); - }; - jQuery.fn.init.prototype = jquery_init.prototype; -})(); - - -var EWFCMS = EWFCMS || { }; - -EWFCMS.toggleFieldset = function(fieldset) { - if ($(fieldset).is('.collapsed')) { - var content = $('> div:not(.action)', fieldset); - $(fieldset).removeClass('collapsed'); - content.hide(); - content.slideDown( { - duration: 'fast', - easing: 'linear', - complete: function() { - //Drupal.collapseScrollIntoView(this.parentNode); - this.parentNode.animating = false; - $('div.action', fieldset).show(); - }, - step: function() { - // Scroll the fieldset into view - //Drupal.collapseScrollIntoView(this.parentNode); - } - }); - } else { - var content = $('> div:not(.action)', fieldset).slideUp('fast', function() { - $(this.parentNode).addClass('collapsed'); - this.parentNode.animating = false; - }); - } - }; - -jQuery(document).ready(function(){ - //$('.collapsed').hide(); - $('fieldset.collapsible > legend').each(function() { - var fieldset = $(this.parentNode); - // turn legen into clickable link and wrap contents - var text = this.innerHTML; - $(this).empty() - .append($(''+ text + '').click(function() { - var fieldset = $(this).parents('fieldset:first')[0]; - if (!fieldset.animating) { - fieldset.animating = true; - EWFCMS.toggleFieldset(fieldset); - } - return false; - } - )) - .after($('
    ') - .append(fieldset.children(':not(legend):not(.action)'))) - .addClass('collapse-processed'); - }); - $('fieldset.collapsed').each(function() { - $(this).removeClass('collapsed'); - EWFCMS.toggleFieldset(this); - }); -}); - -jQuery(document).ready(function(){ - $('#tabs').tabs(); -}); - -//jQuery(document).ready(function(){ - //$('#second_sidebar').hide(); -//}); - diff --git a/draft/application/cms/www/themes/default/res/favicon.ico b/draft/application/cms/www/themes/default/res/favicon.ico deleted file mode 100644 index 343067f9fc7b0829212336f7f67fa96328ba71a3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 786 zcmV+t1MU0(0096201yxW0096X0Q>>~02TlM0EtjeM-2)Z3IG5A4M|8uQUCw|5C8xG z5C{eU001BJ|6u?C0>eo}K~y-)rITAo({U8XKfnL}o7;5Gf7`#NrbcCZOZiN?Bp`q9v&rArV=Mld@&Dx&PKSEvK3Odzg!e zdg==Y&VlnioXhtJ{y^)!D+Qj;_Oh_%%bysJ<^fo3_I^c8?_0KhQ`6SsL$80&7YRq# zb#dK&yr#S5R<$jsp}U>;>vzx2%kf@ zM}q!Xb8AIj|+G1a}*ss!q;$!u9gNI=~);}Nn|WuPWQtmEGag2R2(H5 z3NY+>%k|po(4MN(TVzjXdzm)kb-1#Z@a91;2P!kRBXF{9OHCrxz`4UXc>%)w-~5YhasShJar1HA|#NK;+d z6ej>-&6h7HPSxMj!LGwqAOt3h72l8tAxZd#Jh&DuB@!Iv+gOBp_laLiofwbi$%)`; z^EJW)FG#g3jQhP@J9&Vw(-Mozt@+e#{WR~MDKqtg;aSx~(aa#Q0)2BUG}^lZF?d<9f9#AXDmi%Q+wN-BEAFDV}@ zZyxPvD3+Ne5QAi6ybF^AsiyeiTvnJ75(_r$yB$0D_Y3q952X)P+y6pC29P$?E$7oY+GgzT9tlVmapStr|M zoB7>8CbMOhYhGiQFk_kEuCeZKGeJn#AwL{a1hA*#2t{l1>Awq>H#mSC~;DTn&| zl|z<(6@XkBG9V8Lu_%?H79mK|8Xgt*Nmz935uocvR4&YrNJ_iW@MvF8_ub94mFh44 zdO%%y>8z}`yCa}dSY!-2`HM$xU%TF<$;dHdSste&O?i z(}(_`sVymkcHOWNn#9 zb|NCG)_VO1MXzqZ?d- zgmWhjhnzcc=+XA(#=`M=<6|WH+S$_=UU+0hh9e>$RP3a8#}s|$&YO#tBJ{@-C89U(@YOu@2M zNM*qYg7*mj&m;R7=r!~F{(scYUA+7jpwpQtilXypGU)ehz9ZLme+J_H8Hf++WMcJ| zFU3H3cjr&VKmOuL=ldUa{6uu4%-QBfP>#h~AFzU;lP4TUj_mP#iaDonp`tmET zLUQu}kOj+GQTQWgx?HJZ*#l1i5Ti~eG%^|hL-|(#tlGF0S+IP8;hL}uBE#3!et3<>j)b&yOO z`v<5WBa)b!E`sI-y_;=9{T;g-OlItc5O>an?3(cb(-$`?nJZ|7rw~rFg1E8 zN@c;$=Z}lt;)6F{^djQG^~O5llhaAbnTsHi5TBIp%o`l&L!k;KJ~`ck5P+e=PDCPc zImgRCUQ5}RpZcu}pu^Ni#f2~O)M+{`V3Yu~8S6KkI{2nKkfL0nA}%S->!%D22VCwY zSE@)%&2kzoiXxR4&j2{dIeHCTuH_D?EZApVK|xXvxl;$x`6c1eIpV@-u-raQ&@GFQN- z&B}B3NPBYwEe1Vc-+Lry&vwRxQD2UAbY$9filT_Ira}WmN_#uo@B94N0nJ28=8o(1 zo4t3Xeckqg+Gc{i_EgD@5k?mF(c-dM-z$go$sue8sP9nj3X z?R)o0d%D_|S6}{8HW86yZ@t9vw_ov_-_}%5e@{0d;gO`~=Alr90`{P6sndRlsdb-+{OGKM3aiTpofHq^+gfb0d!*EPu5+UJ{fW1fB zjRvgNQ2e-f=u^6K7y{^gHc{KtoY zedNkr_-&8;_T~nx)=}Dx1`<*-J@VY=pP68I$fA-CSqA(PsV}?i@xEZ`N-vr6^Pf4N zD~ivs^3kW9@1iKuSX~N0ZOJ7MBBr`3dOF*tZ@n9aECVXZ@Zg|dBE_E^=i{Qcyk=N` z`1eOgXsEpAdjH#BXs)dU;OHAWv01IoyrMncL-}+uJUFNlu6*|Qnw^i`nGr}ZEHZ|K z)J)_GZ_X_SJsmBs(;JywLH>8XPhWQ@W#>P|eOQl*SChBoPAZGfV5+b7C?{i1fpbZt zzj~e_i{D+X7oL0P@3qokguFDDY#q=GI2WIpz#hic%XM(=b0xl%PCmC02WK@jjYv&$s#vpk3h z_MtrnN9!(%hwr*gs}E$_jjc4h%KA|*M2)S~=f!}<3VW_Xa1cD52jKx`vtU1)Zb1-` z$yFAKL?W0%BV&9DMau(|aL26)<0=4dj&r^1B3vXKD2Rg~0kXmalL&;+$QUFN!6Xfj ziaVW?zxY2cp8n9Qs8F|*jv;&N8G1cs933h5;rH1QuIE{i-uY6&?yjM3i(1nFym}3c z{hqSEVh$iDfAL6oRNQGvSaj@>C2QB4e2clzW&yn!Mr@wHQ6CkwSnU6q;UEz_iHJa} z#eY5RgZ9Q6UyscXktJ)_o5G@Fk4S-Tb-K{UW zlC#4hH58O%u2d(kn0v7C7s^#BR2T69{T-kO_D-<$Jp|98=GS^Df_{-XE*8c7Zpb* zXtkZK#u-p>8CGS6*->^Pj@}SODC>qbK6E}d!lx}TFB;?$K!67`T`s7LfC|^y1JMau zboq;l0TZ~LG-}dwHf?xzkKe1Wpef#nI9gsC0(0yqKh*X4Z*_oSt34jhw8EJd_{6PE z$5+4M**y)K^qftOclX_VQ|8=)Q_0!0pJ=Qu6~HyLf<0*G$3XYEP1@k7Ym{z#HV+rGyaZ$l=XR>ekAH4j5+w}1IS=o*4cV`UX?-Pxv2(`{$m{i1ZdQmiJqXwm9* z`G$(Geth=C;n3YzAwSl>jtcdX21DQ2f3K@mM#o01KiAktoM<_`Q)Q0+@(zQ z>J1pwX5}v3ytnA&?Q0(D`+7{A7`Lx^sBiP$qLYD0z$CAyTN-O#K7aCq#}2;qv)CK> z?Mgrhg22Q7^PBdCcir<&Vshrw6UtBegMsG8!nUURUHe{mDy6>c%GdhAK-x|7#mArD z+YpzO_KdH<_J!$u!tt`9;_Ax%yS61cuGnrA;F!vRhQ2R)7=6H5(&Bmi^OFQJYmY3cgy)?-JG8=wtkvYIWzS6#FmDd z4VE7B+7?5#=JR8J(o|phx2&hL&F2{a*nK}dI*#o5-x^u+gNK?EQ?r|u;SqmLOv!u? zXqm1dGbQ4V(C+Ik_xAU8t+d%h^~lhGYREF6bQ}N%D-;8ArOG0cs|F+z!4wh}^-*Me f;!)s+jEMgaKSv*+{l^)l00000NkvXXu0mjf$2x5w diff --git a/draft/application/cms/www/themes/default/res/menu-collapsed.png b/draft/application/cms/www/themes/default/res/menu-collapsed.png deleted file mode 100644 index 95a214a6e6d17fee2f098804997f3826ffc9d4ca..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 108 zcmeAS@N?(olHy`uVBq!ia0vp^>>$j@3?%=}IXVGIu?6^qxc>kDAIJlF_r}R z1v5B2yO9Ruh>$j@3?%=}IXVGIu?6^qxc>kDAIJlF_r}R z1v5B2yO9Ru2zk0VhE&W+{&76uaKb@_0}N~oA{!VF-#vS9IZ&3t)78&qol`;+0EMF; ATL1t6 diff --git a/draft/application/cms/www/themes/default/res/style.css b/draft/application/cms/www/themes/default/res/style.css deleted file mode 100644 index b0615aed..00000000 --- a/draft/application/cms/www/themes/default/res/style.css +++ /dev/null @@ -1,251 +0,0 @@ -body { margin: 0; background-color: #eeeeff;} -div#header { background-color: #003; color: #fff; border: solid 1px #003; padding: 0px; margin: 0px;} -div#header img#logo { float: left; margin: 5px 15px 5px 10px; } -div#header div#title {font-size: 180%; font-weight: bold; margin-top: 10px; } -ul.horizontal { - list-style-type: none; -} -ul.horizontal li { - display: inline; - padding: 0 5px 0 5px; -} - -div#menu-bar li.active { - border: solid 1px #ff0; - color: #ff0; -} -div#menu-bar li:hover { - background-color: #fff; - color: #00f; -} -div#menu-bar li a { - text-decoration: none; - color: #fff; -} -div#menu-bar li:hover a { - color: #00f; - font-style: bold; -} - - -div#primary-tabs li { - color: #00f; - padding: 2px 5px 2px 5px; - background-color: #eee; - border: solid 1px #ccf; -} -div#primary-tabs li.active { - padding: 2px 7px 1px 7px; - border-top: solid 2px #99f; - border-left: solid 1px #99f; - border-right: solid 1px #99f; - border-bottom: 0; - background-color: #fff; - color: #00f; -} -div#primary-tabs li:hover { - background-color: #fff; - color: #00f; -} -div#primary-tabs li a { - text-decoration: none; - color: #00f; -} -div#primary-tabs li:hover a { - color: #00f; - font-style: bold; -} - - - -div#menu-first { margin-left: 20%; color: #ccf; background-color: #003; } -div#menu-first a { color: #ccf; } -div#menu-second { color: #99f; background-color: #333; } -div#menu-second a { color: #99f; } - -div#main-wrapper { - clear: both; - display: block; - height: 0; -} -div#main { margin: 0; padding: 0; clear: both; height:0; display: block; } - -div#content { - padding: 5px 3px 5px 20px; - margin-top: 10px; - min-width: 60%; - display: inline; - float: left; - position: relative; - background-color: #ffffff; - padding-bottom: 30px; -} - -div#first_sidebar { - width: 20%; - margin: 5px; - padding: 5px; - display: inline; - float: left; - position: relative; -} -div#second_sidebar { - width: 20%; - margin: 5px; - padding: 5px; - display: inline; - float: left; - position: relative; - background-color: #eee; -} -div.sidebar div.block { - margin-bottom: 5px; - padding: 0; - border: dotted 1px #999; - background-color: #fff; -} -div.sidebar div.block div.title { - padding: 3px 3px 3px 3px; - font-weight: bold; - background-color: #dedede; - border-bottom: dotted 1px #999; -} -div.sidebar div.block div.inside { - margin: 3px; -} -div#footer { margin: 10px 0 10px 0; clear: both; display: block; text-align: center; padding: 10px; border-top: solid 1px #00f; color: #fff; background-color: #333;} -div#footer a { color: #ff0; } - -form div.error { - border-top: dotted 1px #f00; - border-bottom: dotted 1px #f00; - border-left: solid 3px #f00; -} -div.node div.title { - font-weight: bold; - font-size: 110%; - border-bottom: dotted 1 px #009; -} -div.description { - font-style: italic; - font-color: #999; -} - -div.node-wrapper { - margin: 5px 2px 5px 2px; - border: dotted 1px #dddddd; - padding: 5px 3px 5px 3px; -} -div.node div.title { - font-weight: bold; - font-size: 110%; - border-bottom: dotted 1 px #009; - float: left; -} -div.node div.description { - text-align: right; -} -div.node div.inner { - padding: 5px 5px 5px 10px; - border-top: dotted 1px #dddddd; -} - -form#user-login { - border: dotted 1px #099; - display: inline-block; - padding: 10px; - margin: 10px; -} - -form#user-login>div { - margin-bottom: 10px; -} -form#user-login .input { - float: left; -} -form#user-login img.logo { -} - -div#message { - border: solid 1px #fc0; - background-color: #fed; - color: #000; - padding: 5px; - margin: 5px; -} - -div#message li { - padding-left: 5px; - margin-left: 3px; -} -div#message li.success { - color: #003300; - background-color: #ccffcc; -} - -div#message li.error { - color: #330000; - background-color: #ff9494; -} -div#message li.warning { - color: #aa2200; - background-color: #ffcc99; -} - -div.columns { - margin-top: 10px; - display: inline-block; - clear: both; -} - -div.columns>* { - padding-left: 10px; - padding-top: 5px; - border-top: dotted 1px #999; - border-left: dotted 1px #999; - margin-left: 1px; - margin-right: 10px; - float: left; -} - -/* Link */ - -a { - text-decoration: none; -} -a:hover { - text-decoration: underline; -} - -div.menu ul.vertical { - margin: 0; - padding-left: 10px; - list-style-type: none; -} - -div.menu ul.vertical ul { - border-left: solid 3px #eee; - list-style-type: none; - margin: 0; - padding-left: 5px; - margin-left: 5px; - margin-bottom: 5px; -} - -/* Fieldset and collapsible */ - -fieldset.collapsible legend a { - padding-left: 15px; - background: url(menu-expanded.png) 5px 75% no-repeat; -} - -fieldset.collapsed legend a { - padding-left: 15px; - background: url(menu-collapsed.png) 5px 50% no-repeat; -} - -fieldset.collapsed { - border: none; - border-top: dotted 1px #000; -} - diff --git a/draft/application/cms/www/themes/test/res/favicon.ico b/draft/application/cms/www/themes/test/res/favicon.ico deleted file mode 100644 index 343067f9fc7b0829212336f7f67fa96328ba71a3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 786 zcmV+t1MU0(0096201yxW0096X0Q>>~02TlM0EtjeM-2)Z3IG5A4M|8uQUCw|5C8xG z5C{eU001BJ|6u?C0>eo}K~y-)rITAo({U8XKfnL}o7;5Gf7`#NrbcCZOZiN?Bp`q9v&rArV=Mld@&Dx&PKSEvK3Odzg!e zdg==Y&VlnioXhtJ{y^)!D+Qj;_Oh_%%bysJ<^fo3_I^c8?_0KhQ`6SsL$80&7YRq# zb#dK&yr#S5R<$jsp}U>;>vzx2%kf@ zM}q!Xb8AIj|+G1a}*ss!q;$!u9gNI=~);}Nn|WuPWQtmEGag2R2(H5 z3NY+>%k|po(4MN(TVzjXdzm)kb-1#Z@a91;2P!kRBXF{9OHCrxz`4UXc>%)w-~5YhasShJar1HA|#NK;+d z6ej>-&6h7HPSxMj!LGwqAOt3h72l8tAxZd#Jh&DuB@!Iv+gOBp_laLiofwbi$%)`; z^EJW)FG#g3jQhP@J9&Vw(-Mozt@+e#{WR~MDKqtg;aSx~(aa#Q0)2BUG}^lZF?d<9f9#AXDmi%Q+wN-BEAFDV}@ zZyxPvD3+Ne5QAi6ybF^AsiyeiTvnJ75(_r$yB$0D_Y3q952X)P+y6pC29P$?E$7oY+GgzT9tlVmapStr|M zoB7>8CbMOhYhGiQFk_kEuCeZKGeJn#AwL{a1hA*#2t{l1>Awq>H#mSC~;DTn&| zl|z<(6@XkBG9V8Lu_%?H79mK|8Xgt*Nmz935uocvR4&YrNJ_iW@MvF8_ub94mFh44 zdO%%y>8z}`yCa}dSY!-2`HM$xU%TF<$;dHdSste&O?i z(}(_`sVymkcHOWNn#9 zb|NCG)_VO1MXzqZ?d- zgmWhjhnzcc=+XA(#=`M=<6|WH+S$_=UU+0hh9e>$RP3a8#}s|$&YO#tBJ{@-C89U(@YOu@2M zNM*qYg7*mj&m;R7=r!~F{(scYUA+7jpwpQtilXypGU)ehz9ZLme+J_H8Hf++WMcJ| zFU3H3cjr&VKmOuL=ldUa{6uu4%-QBfP>#h~AFzU;lP4TUj_mP#iaDonp`tmET zLUQu}kOj+GQTQWgx?HJZ*#l1i5Ti~eG%^|hL-|(#tlGF0S+IP8;hL}uBE#3!et3<>j)b&yOO z`v<5WBa)b!E`sI-y_;=9{T;g-OlItc5O>an?3(cb(-$`?nJZ|7rw~rFg1E8 zN@c;$=Z}lt;)6F{^djQG^~O5llhaAbnTsHi5TBIp%o`l&L!k;KJ~`ck5P+e=PDCPc zImgRCUQ5}RpZcu}pu^Ni#f2~O)M+{`V3Yu~8S6KkI{2nKkfL0nA}%S->!%D22VCwY zSE@)%&2kzoiXxR4&j2{dIeHCTuH_D?EZApVK|xXvxl;$x`6c1eIpV@-u-raQ&@GFQN- z&B}B3NPBYwEe1Vc-+Lry&vwRxQD2UAbY$9filT_Ira}WmN_#uo@B94N0nJ28=8o(1 zo4t3Xeckqg+Gc{i_EgD@5k?mF(c-dM-z$go$sue8sP9nj3X z?R)o0d%D_|S6}{8HW86yZ@t9vw_ov_-_}%5e@{0d;gO`~=Alr90`{P6sndRlsdb-+{OGKM3aiTpofHq^+gfb0d!*EPu5+UJ{fW1fB zjRvgNQ2e-f=u^6K7y{^gHc{KtoY zedNkr_-&8;_T~nx)=}Dx1`<*-J@VY=pP68I$fA-CSqA(PsV}?i@xEZ`N-vr6^Pf4N zD~ivs^3kW9@1iKuSX~N0ZOJ7MBBr`3dOF*tZ@n9aECVXZ@Zg|dBE_E^=i{Qcyk=N` z`1eOgXsEpAdjH#BXs)dU;OHAWv01IoyrMncL-}+uJUFNlu6*|Qnw^i`nGr}ZEHZ|K z)J)_GZ_X_SJsmBs(;JywLH>8XPhWQ@W#>P|eOQl*SChBoPAZGfV5+b7C?{i1fpbZt zzj~e_i{D+X7oL0P@3qokguFDDY#q=GI2WIpz#hic%XM(=b0xl%PCmC02WK@jjYv&$s#vpk3h z_MtrnN9!(%hwr*gs}E$_jjc4h%KA|*M2)S~=f!}<3VW_Xa1cD52jKx`vtU1)Zb1-` z$yFAKL?W0%BV&9DMau(|aL26)<0=4dj&r^1B3vXKD2Rg~0kXmalL&;+$QUFN!6Xfj ziaVW?zxY2cp8n9Qs8F|*jv;&N8G1cs933h5;rH1QuIE{i-uY6&?yjM3i(1nFym}3c z{hqSEVh$iDfAL6oRNQGvSaj@>C2QB4e2clzW&yn!Mr@wHQ6CkwSnU6q;UEz_iHJa} z#eY5RgZ9Q6UyscXktJ)_o5G@Fk4S-Tb-K{UW zlC#4hH58O%u2d(kn0v7C7s^#BR2T69{T-kO_D-<$Jp|98=GS^Df_{-XE*8c7Zpb* zXtkZK#u-p>8CGS6*->^Pj@}SODC>qbK6E}d!lx}TFB;?$K!67`T`s7LfC|^y1JMau zboq;l0TZ~LG-}dwHf?xzkKe1Wpef#nI9gsC0(0yqKh*X4Z*_oSt34jhw8EJd_{6PE z$5+4M**y)K^qftOclX_VQ|8=)Q_0!0pJ=Qu6~HyLf<0*G$3XYEP1@k7Ym{z#HV+rGyaZ$l=XR>ekAH4j5+w}1IS=o*4cV`UX?-Pxv2(`{$m{i1ZdQmiJqXwm9* z`G$(Geth=C;n3YzAwSl>jtcdX21DQ2f3K@mM#o01KiAktoM<_`Q)Q0+@(zQ z>J1pwX5}v3ytnA&?Q0(D`+7{A7`Lx^sBiP$qLYD0z$CAyTN-O#K7aCq#}2;qv)CK> z?Mgrhg22Q7^PBdCcir<&Vshrw6UtBegMsG8!nUURUHe{mDy6>c%GdhAK-x|7#mArD z+YpzO_KdH<_J!$u!tt`9;_Ax%yS61cuGnrA;F!vRhQ2R)7=6H5(&Bmi^OFQJYmY3cgy)?-JG8=wtkvYIWzS6#FmDd z4VE7B+7?5#=JR8J(o|phx2&hL&F2{a*nK}dI*#o5-x^u+gNK?EQ?r|u;SqmLOv!u? zXqm1dGbQ4V(C+Ik_xAU8t+d%h^~lhGYREF6bQ}N%D-;8ArOG0cs|F+z!4wh}^-*Me f;!)s+jEMgaKSv*+{l^)l00000NkvXXu0mjf$2x5w diff --git a/draft/application/cms/www/themes/test/res/style.css b/draft/application/cms/www/themes/test/res/style.css deleted file mode 100644 index deb06a83..00000000 --- a/draft/application/cms/www/themes/test/res/style.css +++ /dev/null @@ -1,192 +0,0 @@ -body { margin: 0; background-color: #eeeeff;} -div#header { background-color: #300; color: #fff; border: solid 1px #003; padding: 0px; margin: 0px;} -div#header img#logo { float: left; margin: 5px 15px 5px 10px; } -div#header div#title {font-size: 180%; font-weight: bold; margin-top: 10px; } -ul.horizontal { - list-style-type: none; -} -ul.horizontal li { - display: inline; - padding: 0 5px 0 5px; -} - -div#menu-bar li.active { - border: solid 1px #ff0; - color: #ff0; -} -div#menu-bar li:hover { - background-color: #fff; - color: #00f; -} -div#menu-bar li a { - text-decoration: none; - color: #fff; -} -div#menu-bar li:hover a { - color: #00f; - font-style: bold; -} - - -div#primary-tabs li { - color: #00f; - padding: 2px 5px 2px 5px; - background-color: #eee; - border: solid 1px #ccf; -} -div#primary-tabs li.active { - padding: 2px 7px 1px 7px; - border-top: solid 2px #99f; - border-left: solid 1px #99f; - border-right: solid 1px #99f; - border-bottom: 0; - background-color: #fff; - color: #00f; -} -div#primary-tabs li:hover { - background-color: #fff; - color: #00f; -} -div#primary-tabs li a { - text-decoration: none; - color: #00f; -} -div#primary-tabs li:hover a { - color: #00f; - font-style: bold; -} - - - -div#menu-first { margin-left: 20%; color: #ccf; background-color: #003; } -div#menu-first a { color: #ccf; } -div#menu-second { color: #99f; background-color: #333; } -div#menu-second a { color: #99f; } - -div#main-wrapper { - clear: both; - display: block; - height: 0; -} -div#main { margin: 0; padding: 0; clear: both; height:0; display: block; } - -div#content { padding: 5px 3px 5px 20px; - margin-top: 10px; - min-width: 80%; - display: inline; - float: left; - position: relative; - background-color: #ffffff; - padding-bottom: 30px; -} - -div#first_sidebar { - width: 200px; - margin: 5px; - padding: 5px; - display: inline; - float: left; - position: relative; -} -div#second_sidebar { - width: 100px; - margin: 5px; - padding: 5px; - display: inline; - float: left; - position: relative; -} -div.sidebar div.block { - margin-bottom: 5px; - padding: 0; - border: dotted 1px #999; - background-color: #fff; -} -div.sidebar div.block div.title { - padding: 3px 3px 3px 3px; - font-weight: bold; - background-color: #dedede; - border-bottom: dotted 1px #999; -} -div.sidebar div.block div.inside { - margin: 3px; -} - -div#content { padding: 5px 3px 5px 20px; - margin-top: 10px; - width: 50%; - display: inline; - float: left; - position: relative; - background-color: #ffffff; - padding-bottom: 30px; -} -div#footer { margin: 10px 0 10px 0; clear: both; display: block; text-align: center; padding: 10px; border-top: solid 1px #00f; color: #fff; background-color: #333;} -div#footer a { color: #ff0; } - -form div.error { - border-top: dotted 1px #f00; - border-bottom: dotted 1px #f00; - border-left: solid 3px #f00; -} -div.node div.title { - font-weight: bold; - font-size: 110%; - border-bottom: dotted 1 px #009; -} -div.description { - font-style: italic; - font-color: #999; -} - -div.node-wrapper { - margin: 5px 2px 5px 2px; - border: dotted 1px #dddddd; - padding: 5px 3px 5px 3px; -} -div.node div.title { - font-weight: bold; - font-size: 110%; - border-bottom: dotted 1 px #009; - float: left; -} -div.node div.description { - text-align: right; -} -div.node div.inner { - padding: 5px 5px 5px 10px; - border-top: dotted 1px #dddddd; -} - -form#login-form { - border: dotted 1px #099; - display: inline-block; - padding: 10px; - margin: 10px; -} - -div#message { - border: solid 1px #fc0; - background-color: #fed; - color: #000; - padding: 5px; - margin: 5px; -} - -div#message li { - padding-left: 5px; - margin-left: 3px; -} -div#message li.success { - color: #003300; - background-color: #ccffcc; -} - -div#message li.error { - color: #330000; - background-color: #ff9494; -} -div#message li.warning { - color: #aa2200; - background-color: #ffcc99; -} From 0efcd3cd070de44196ba69792aeed9912d1ebe15 Mon Sep 17 00:00:00 2001 From: Jocelyn Fiat Date: Thu, 4 Jul 2013 07:03:22 -0700 Subject: [PATCH 24/38] Created Doc_Index (mediawiki) --- Doc_Index.mediawiki | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 Doc_Index.mediawiki diff --git a/Doc_Index.mediawiki b/Doc_Index.mediawiki new file mode 100644 index 00000000..b9db9b15 --- /dev/null +++ b/Doc_Index.mediawiki @@ -0,0 +1,7 @@ += Eiffel Web Framework = +Framework to build web applications in Eiffel + +Menu :: [[Doc_Getting Started|Getting Started]] :: [[Doc_Community|Community]] + +[http://github.com/EiffelWebFramework/EWF/zipball/ Download Current] +[http://github.com/EiffelWebFramework/EWF/zipball/release-0.3 Download v0.3] \ No newline at end of file From e4f495b2825b010ccf263a0650a70c2c4bcfca5a Mon Sep 17 00:00:00 2001 From: Jocelyn Fiat Date: Thu, 4 Jul 2013 07:04:18 -0700 Subject: [PATCH 25/38] Created Doc_Getting_Started (mediawiki) --- Doc_Getting_Started.mediawiki | 1 + 1 file changed, 1 insertion(+) create mode 100644 Doc_Getting_Started.mediawiki diff --git a/Doc_Getting_Started.mediawiki b/Doc_Getting_Started.mediawiki new file mode 100644 index 00000000..88593f1e --- /dev/null +++ b/Doc_Getting_Started.mediawiki @@ -0,0 +1 @@ += Getting Started = \ No newline at end of file From 60a80209dc3ff19e2f85508986bcdd47b181ffc0 Mon Sep 17 00:00:00 2001 From: Jocelyn Fiat Date: Thu, 4 Jul 2013 07:04:51 -0700 Subject: [PATCH 26/38] Updated Doc_Index (mediawiki) --- Doc_Index.mediawiki | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc_Index.mediawiki b/Doc_Index.mediawiki index b9db9b15..bb498aea 100644 --- a/Doc_Index.mediawiki +++ b/Doc_Index.mediawiki @@ -1,7 +1,7 @@ = Eiffel Web Framework = Framework to build web applications in Eiffel -Menu :: [[Doc_Getting Started|Getting Started]] :: [[Doc_Community|Community]] +Menu :: [[Doc_Getting_Started|Getting Started]] :: [[Doc_Community|Community]] [http://github.com/EiffelWebFramework/EWF/zipball/ Download Current] [http://github.com/EiffelWebFramework/EWF/zipball/release-0.3 Download v0.3] \ No newline at end of file From ed1f899534263da5fac5b556ab516405b6647b8e Mon Sep 17 00:00:00 2001 From: Jocelyn Fiat Date: Thu, 4 Jul 2013 07:05:20 -0700 Subject: [PATCH 27/38] Updated Doc_Index (mediawiki) --- Doc_Index.mediawiki | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc_Index.mediawiki b/Doc_Index.mediawiki index bb498aea..c88b0bc9 100644 --- a/Doc_Index.mediawiki +++ b/Doc_Index.mediawiki @@ -3,5 +3,5 @@ Framework to build web applications in Eiffel Menu :: [[Doc_Getting_Started|Getting Started]] :: [[Doc_Community|Community]] -[http://github.com/EiffelWebFramework/EWF/zipball/ Download Current] -[http://github.com/EiffelWebFramework/EWF/zipball/release-0.3 Download v0.3] \ No newline at end of file +[ [http://github.com/EiffelWebFramework/EWF/zipball/ Download Current] ] +[ [http://github.com/EiffelWebFramework/EWF/zipball/release-0.3 Download v0.3] ] \ No newline at end of file From 917388b99e0cb8b5ecab97b57cffbc5fa9aeed2f Mon Sep 17 00:00:00 2001 From: Jocelyn Fiat Date: Thu, 4 Jul 2013 07:07:00 -0700 Subject: [PATCH 28/38] Updated Doc_Index (mediawiki) --- Doc_Index.mediawiki | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc_Index.mediawiki b/Doc_Index.mediawiki index c88b0bc9..90016448 100644 --- a/Doc_Index.mediawiki +++ b/Doc_Index.mediawiki @@ -1,7 +1,7 @@ +Menu :: [[Doc_Getting_Started|Getting Started]] :: [[Doc_Community|Community]] + = Eiffel Web Framework = Framework to build web applications in Eiffel -Menu :: [[Doc_Getting_Started|Getting Started]] :: [[Doc_Community|Community]] - [ [http://github.com/EiffelWebFramework/EWF/zipball/ Download Current] ] [ [http://github.com/EiffelWebFramework/EWF/zipball/release-0.3 Download v0.3] ] \ No newline at end of file From e20f45b2c3bdb134fd7a035b654ac884ab4069a1 Mon Sep 17 00:00:00 2001 From: Jocelyn Fiat Date: Thu, 4 Jul 2013 07:08:54 -0700 Subject: [PATCH 29/38] Updated Doc_Getting_Started (mediawiki) --- Doc_Getting_Started.mediawiki | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/Doc_Getting_Started.mediawiki b/Doc_Getting_Started.mediawiki index 88593f1e..50579c63 100644 --- a/Doc_Getting_Started.mediawiki +++ b/Doc_Getting_Started.mediawiki @@ -1 +1,24 @@ -= Getting Started = \ No newline at end of file +Menu :: [[Doc_Getting_Started|Getting Started]] :: [[Doc_Community|Community]] + += Getting Started = +This page will help you to get started with EWF. We will first see how to install EWF and then how to compile and run the venerable Hello World example. + +== Installation == +=== EiffelStudio 7.2 === +EWF is already included in EiffelStudio 7.2: you don't have to do anything in this case! This is the recommanded solution if you are a new developer or are new to Eiffel. + +=== Other EiffelStudio versions === +If you have another version of EiffelStudio than 7.2, you have to + +* dowload EWF +* create a directory where you will put your custum Eiffel libraries +* extract EWF in the newly created directory +* define the environment variable EIFFEL_LIBRARY to point to the newly created directory + +=== Source code === +The source code is available on Github. You can get it by running the command: + +: git clone git://github.com/EiffelWebFramework/EWF.git + + + From 2d373cab5b77957b7efa8992b7a4eb51be5d48a2 Mon Sep 17 00:00:00 2001 From: Jocelyn Fiat Date: Thu, 4 Jul 2013 07:25:44 -0700 Subject: [PATCH 30/38] Updated Doc_Getting_Started (mediawiki) --- Doc_Getting_Started.mediawiki | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/Doc_Getting_Started.mediawiki b/Doc_Getting_Started.mediawiki index 50579c63..d2692f4b 100644 --- a/Doc_Getting_Started.mediawiki +++ b/Doc_Getting_Started.mediawiki @@ -18,7 +18,40 @@ If you have another version of EiffelStudio than 7.2, you have to === Source code === The source code is available on Github. You can get it by running the command: -: git clone git://github.com/EiffelWebFramework/EWF.git +git clone git://github.com/EiffelWebFramework/EWF.git +== Hello World == +The hello world example is located in the directory $ISE_EIFFEL/contrib/examples/web/ewf/simple. Just double click on the simple.ecf file and select the simple target or if you prefer the command line, run the command: +estudio -config simple.ecf -target simple +Once the project is compiled, we will adapt the root class to point to port number 9090. +'''Note''': By default, the application listens on port 80, which is often already used by standard webservers (Apache, nginx, ...). Moreover, on Linux, ports below 1024 can only be opened by root. + +To do this, we will redefine the feature initialize as follows: + + +class + APPLICATION + +inherit + WSF_DEFAULT_SERVICE + redefine + initialize + end + +create + make_and_launch + +feature {NONE} -- Initialization + + initialize + -- Initialize current service + do + set_service_option ("port", 9090) + end +end + + +After one more compile, you can now launch the application and point your browser to [http://localhost:9090]. +You should now see a simple page with Hello World. \ No newline at end of file From 717b0f7ba8c3cee6c73be630e576f5b6c9421090 Mon Sep 17 00:00:00 2001 From: Jocelyn Fiat Date: Thu, 4 Jul 2013 07:27:51 -0700 Subject: [PATCH 31/38] Updated Doc_Getting_Started (mediawiki) --- Doc_Getting_Started.mediawiki | 40 +++++++++++++++++------------------ 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/Doc_Getting_Started.mediawiki b/Doc_Getting_Started.mediawiki index d2692f4b..f3eebb63 100644 --- a/Doc_Getting_Started.mediawiki +++ b/Doc_Getting_Started.mediawiki @@ -31,26 +31,26 @@ Once the project is compiled, we will adapt the root class to point to port numb To do this, we will redefine the feature initialize as follows: -class - APPLICATION - -inherit - WSF_DEFAULT_SERVICE - redefine - initialize - end - -create - make_and_launch - -feature {NONE} -- Initialization - - initialize - -- Initialize current service - do - set_service_option ("port", 9090) - end -end + class + APPLICATION + + inherit + WSF_DEFAULT_SERVICE + redefine + initialize + end + + create + make_and_launch + + feature {NONE} -- Initialization + + initialize + -- Initialize current service + do + set_service_option ("port", 9090) + end + end After one more compile, you can now launch the application and point your browser to [http://localhost:9090]. From 2d795eb3c1d2b9abb885011abf4fe2da6470bcda Mon Sep 17 00:00:00 2001 From: Jocelyn Fiat Date: Thu, 4 Jul 2013 07:28:09 -0700 Subject: [PATCH 32/38] Updated Doc_Getting_Started (mediawiki) --- Doc_Getting_Started.mediawiki | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Doc_Getting_Started.mediawiki b/Doc_Getting_Started.mediawiki index f3eebb63..a3d22099 100644 --- a/Doc_Getting_Started.mediawiki +++ b/Doc_Getting_Started.mediawiki @@ -30,7 +30,6 @@ Once the project is compiled, we will adapt the root class to point to port numb To do this, we will redefine the feature initialize as follows: - class APPLICATION @@ -51,7 +50,7 @@ To do this, we will redefine the feature initialize as follows: set_service_option ("port", 9090) end end - + After one more compile, you can now launch the application and point your browser to [http://localhost:9090]. You should now see a simple page with Hello World. \ No newline at end of file From 6dee9e85b557fd880529b5f64de19fe24d95cff5 Mon Sep 17 00:00:00 2001 From: Jocelyn Fiat Date: Thu, 4 Jul 2013 07:28:37 -0700 Subject: [PATCH 33/38] Updated Doc_Getting_Started (mediawiki) --- Doc_Getting_Started.mediawiki | 1 + 1 file changed, 1 insertion(+) diff --git a/Doc_Getting_Started.mediawiki b/Doc_Getting_Started.mediawiki index a3d22099..550862d8 100644 --- a/Doc_Getting_Started.mediawiki +++ b/Doc_Getting_Started.mediawiki @@ -30,6 +30,7 @@ Once the project is compiled, we will adapt the root class to point to port numb To do this, we will redefine the feature initialize as follows: + class APPLICATION From 5b988ab760715539ec664fb2eb39f7f1daccc672 Mon Sep 17 00:00:00 2001 From: Jocelyn Fiat Date: Fri, 5 Jul 2013 12:44:09 +0200 Subject: [PATCH 34/38] Added first attempt to provide a application builder. For now only trying to have a generic template. Do not expect anything working for now, this is just the start of a draft --- src/gewf/gewf-safe.ecf | 16 ++++ src/gewf/gewf.ecf | 16 ++++ src/gewf/src/gewf.e | 32 +++++++ .../basic/ecf-target-any_connector.tpl | 8 ++ .../template/basic/ecf-target-connector.tpl | 6 ++ .../basic/launcher/any/application_launcher.e | 85 +++++++++++++++++++ .../launcher/default/application_launcher.e | 19 +++++ src/gewf/template/basic/project.ecf | 44 ++++++++++ src/gewf/template/basic/project.ecf.tpl | 45 ++++++++++ src/gewf/template/basic/src/app_service.e | 46 ++++++++++ 10 files changed, 317 insertions(+) create mode 100644 src/gewf/gewf-safe.ecf create mode 100644 src/gewf/gewf.ecf create mode 100644 src/gewf/src/gewf.e create mode 100644 src/gewf/template/basic/ecf-target-any_connector.tpl create mode 100644 src/gewf/template/basic/ecf-target-connector.tpl create mode 100644 src/gewf/template/basic/launcher/any/application_launcher.e create mode 100644 src/gewf/template/basic/launcher/default/application_launcher.e create mode 100644 src/gewf/template/basic/project.ecf create mode 100644 src/gewf/template/basic/project.ecf.tpl create mode 100644 src/gewf/template/basic/src/app_service.e diff --git a/src/gewf/gewf-safe.ecf b/src/gewf/gewf-safe.ecf new file mode 100644 index 00000000..cc243148 --- /dev/null +++ b/src/gewf/gewf-safe.ecf @@ -0,0 +1,16 @@ + + + + + + /.git$ + /EIFGENs$ + /.svn$ + + + + + + + diff --git a/src/gewf/gewf.ecf b/src/gewf/gewf.ecf new file mode 100644 index 00000000..3213ca47 --- /dev/null +++ b/src/gewf/gewf.ecf @@ -0,0 +1,16 @@ + + + + + + /.git$ + /EIFGENs$ + /.svn$ + + + + + + + diff --git a/src/gewf/src/gewf.e b/src/gewf/src/gewf.e new file mode 100644 index 00000000..7e805323 --- /dev/null +++ b/src/gewf/src/gewf.e @@ -0,0 +1,32 @@ +note + description : "Objects that ..." + author : "$Author$" + date : "$Date$" + revision : "$Revision$" + +class + GEWF + +create + make + +feature {NONE} -- Initialization + + make + -- Initialize `Current'. + do + + end + +feature -- Status + +feature -- Access + +feature -- Change + +feature {NONE} -- Implementation + +invariant +-- invariant_clause: True + +end diff --git a/src/gewf/template/basic/ecf-target-any_connector.tpl b/src/gewf/template/basic/ecf-target-any_connector.tpl new file mode 100644 index 00000000..eb7f6c90 --- /dev/null +++ b/src/gewf/template/basic/ecf-target-any_connector.tpl @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/src/gewf/template/basic/ecf-target-connector.tpl b/src/gewf/template/basic/ecf-target-connector.tpl new file mode 100644 index 00000000..d4a6fd75 --- /dev/null +++ b/src/gewf/template/basic/ecf-target-connector.tpl @@ -0,0 +1,6 @@ + + + + + + diff --git a/src/gewf/template/basic/launcher/any/application_launcher.e b/src/gewf/template/basic/launcher/any/application_launcher.e new file mode 100644 index 00000000..7182d350 --- /dev/null +++ b/src/gewf/template/basic/launcher/any/application_launcher.e @@ -0,0 +1,85 @@ +note + description: "Summary description for {APPLICATION_LAUNCHER}." + author: "" + date: "$Date: 2013-06-12 13:55:42 +0200 (mer., 12 juin 2013) $" + revision: "$Revision: 36 $" + +deferred class + APPLICATION_LAUNCHER + +feature {NONE} -- Initialization + + launcher_nature: detachable READABLE_STRING_8 + -- Initialize the launcher nature + -- either cgi, libfcgi, or nino. + --| We could extend with more connector if needed. + --| and we could use WSF_DEFAULT_SERVICE_LAUNCHER to configure this at compilation time. + local + p: PATH + l_entry_name: READABLE_STRING_32 + ext: detachable READABLE_STRING_32 + do + create p.make_from_string (execution_environment.arguments.command_name) + if attached p.entry as l_entry then + ext := l_entry.extension + end + if ext /= Void then + if ext.same_string (nature_nino) then + Result := nature_nino + end + if ext.same_string (nature_cgi) then + Result := nature_cgi + end + if ext.same_string (nature_libfcgi) or else ext.same_string ("fcgi") then + Result := nature_libfcgi + end + end + end + +feature {NONE} -- nino + + nature_nino: STRING = "nino" + + launch_nino (a_service: WSF_SERVICE; opts: detachable WSF_SERVICE_LAUNCHER_OPTIONS) + do + create {WSF_NINO_SERVICE_LAUNCHER} launcher.make_and_launch (a_service, opts) + end + +feature {NONE} -- cgi + + nature_cgi: STRING = "cgi" + + launch_cgi (a_service: WSF_SERVICE; opts: detachable WSF_SERVICE_LAUNCHER_OPTIONS) + do + create {WSF_CGI_SERVICE_LAUNCHER} launcher.make_and_launch (a_service, opts) + end + +feature {NONE} -- libfcgi + + nature_libfcgi: STRING = "libfcgi" + + launch_libfcgi (a_service: WSF_SERVICE; opts: detachable WSF_SERVICE_LAUNCHER_OPTIONS) + do + create {WSF_LIBFCGI_SERVICE_LAUNCHER} launcher.make_and_launch (a_service, opts) + end + +feature {NONE} -- Launcher + + launch (a_service: WSF_SERVICE; opts: detachable WSF_SERVICE_LAUNCHER_OPTIONS) + local + nature: like launcher_nature + do + nature := launcher_nature + if nature = Void or else nature = nature_nino then + launch_nino (a_service, opts) + elseif nature = nature_cgi then + launch_cgi (a_service, opts) + elseif nature = nature_libfcgi then + launch_libfcgi (a_service, opts) + else + -- bye bye + (create {EXCEPTIONS}).die (-1) + end + end + +end diff --git a/src/gewf/template/basic/launcher/default/application_launcher.e b/src/gewf/template/basic/launcher/default/application_launcher.e new file mode 100644 index 00000000..e20b06ac --- /dev/null +++ b/src/gewf/template/basic/launcher/default/application_launcher.e @@ -0,0 +1,19 @@ +note + description: "Summary description for {APPLICATION}." + author: "" + date: "$Date: 2013-06-12 13:55:42 +0200 (mer., 12 juin 2013) $" + revision: "$Revision: 36 $" + +deferred class + APPLICATION_LAUNCHER + +feature {NONE} -- Launcher + + launch (a_service: WSF_SERVICE; opts: detachable WSF_SERVICE_LAUNCHER_OPTIONS) + local + launcher: WSF_SERVICE_LAUNCHER + do + create {WSF_DEFAULT_SERVICE_LAUNCHER} launcher.make_and_launch (a_service, opts) + end + +end diff --git a/src/gewf/template/basic/project.ecf b/src/gewf/template/basic/project.ecf new file mode 100644 index 00000000..ff9b4ab7 --- /dev/null +++ b/src/gewf/template/basic/project.ecf @@ -0,0 +1,44 @@ + + + + + /EIFGENs$ + /CVS$ + /.svn$ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/gewf/template/basic/project.ecf.tpl b/src/gewf/template/basic/project.ecf.tpl new file mode 100644 index 00000000..3fe8bac0 --- /dev/null +++ b/src/gewf/template/basic/project.ecf.tpl @@ -0,0 +1,45 @@ + + + + + /EIFGENs$ + /CVS$ + /.svn$ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/gewf/template/basic/src/app_service.e b/src/gewf/template/basic/src/app_service.e new file mode 100644 index 00000000..23caa88a --- /dev/null +++ b/src/gewf/template/basic/src/app_service.e @@ -0,0 +1,46 @@ +note + description: "[ + application service + ]" + date: "$Date$" + revision: "$Revision$" + +class + APPLICATION + +inherit + WSF_LAUNCHABLE_SERVICE + redefine + initialize + end + + WSF_ROUTED_SERVICE + + APPLICATION_LAUNCHER + +create + make_and_launch + +feature {NONE} -- Initialization + + initialize + -- Initialize current service. + do + Precursor + set_service_option ("port", 9090) + initialize_router + end + + setup_router + -- Setup `router' + local + doc: WSF_ROUTER_SELF_DOCUMENTATION_HANDLER + fhdl: WSF_FILE_SYSTEM_HANDLER + do + router.handle_with_request_methods ("/doc", create {WSF_ROUTER_SELF_DOCUMENTATION_HANDLER}.make (router), router.methods_GET) + create fhdl.make_hidden (".") + fhdl.set_directory_index (<<"index.html">>) + router.handle_with_request_methods ("", fhdl, router.methods_GET) + end + +end From eea889472448a27561804e7a49903d732cbe8b8b Mon Sep 17 00:00:00 2001 From: Jocelyn Fiat Date: Fri, 5 Jul 2013 15:06:30 +0200 Subject: [PATCH 35/38] First working (but limited) tool --- src/gewf/gewf-safe.ecf | 16 --- src/gewf/gewf.ecf | 13 +- src/gewf/src/gewf.e | 133 +++++++++++++++++- src/gewf/src/gewf_generator.e | 122 ++++++++++++++++ .../{project.ecf.tpl => ${APPNAME}.ecf.tpl} | 10 +- src/gewf/template/basic/project.ecf | 44 ------ .../src/{app_service.e => ${APP_ROOT}.e.tpl} | 3 +- src/gewf/testing/README.txt | 9 ++ src/gewf/testing/demo.cfg | 4 + 9 files changed, 280 insertions(+), 74 deletions(-) delete mode 100644 src/gewf/gewf-safe.ecf create mode 100644 src/gewf/src/gewf_generator.e rename src/gewf/template/basic/{project.ecf.tpl => ${APPNAME}.ecf.tpl} (91%) delete mode 100644 src/gewf/template/basic/project.ecf rename src/gewf/template/basic/src/{app_service.e => ${APP_ROOT}.e.tpl} (92%) create mode 100644 src/gewf/testing/README.txt create mode 100644 src/gewf/testing/demo.cfg diff --git a/src/gewf/gewf-safe.ecf b/src/gewf/gewf-safe.ecf deleted file mode 100644 index cc243148..00000000 --- a/src/gewf/gewf-safe.ecf +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - /.git$ - /EIFGENs$ - /.svn$ - - - - - - - diff --git a/src/gewf/gewf.ecf b/src/gewf/gewf.ecf index 3213ca47..140da892 100644 --- a/src/gewf/gewf.ecf +++ b/src/gewf/gewf.ecf @@ -1,16 +1,21 @@ - + + Generator for EWF project /.git$ /EIFGENs$ /.svn$ - + - - + + + + + diff --git a/src/gewf/src/gewf.e b/src/gewf/src/gewf.e index 7e805323..f0140dba 100644 --- a/src/gewf/src/gewf.e +++ b/src/gewf/src/gewf.e @@ -14,19 +14,146 @@ feature {NONE} -- Initialization make -- Initialize `Current'. + local + args: ARGUMENTS_32 + cfg: detachable READABLE_STRING_32 do - + create args + if args.argument_count > 0 then + cfg := args.argument (1) + end + if cfg /= Void then + load_configuration (cfg) + end + execute end feature -- Status feature -- Access -feature -- Change + config (k: READABLE_STRING_GENERAL): detachable READABLE_STRING_32 + local + l_keys: LIST [READABLE_STRING_GENERAL] + do + if attached {JSON_STRING} json_item (json, k) as js then + Result := js.unescaped_string_32 + end + end + + json_item (j: detachable JSON_VALUE; k: READABLE_STRING_GENERAL): detachable JSON_VALUE + local + l_keys: LIST [READABLE_STRING_GENERAL] + v: detachable JSON_VALUE + s: STRING_32 + js: JSON_STRING + do + if attached {JSON_OBJECT} j as jo then + l_keys := k.split ('.') + l_keys.start + create js.make_json_from_string_32 (l_keys.item.as_readable_string_32) + v := jo.item (js) + l_keys.remove + if l_keys.count > 0 then + if v /= Void then + create s.make (k.count) + across + l_keys as c + loop + s.append_string_general (c.item) + s.append_character ('.') + end + s.remove_tail (1) + Result := json_item (v, s) + end + else + Result := v + end + end + end + + load_configuration (fn: READABLE_STRING_GENERAL) + local + p: JSON_PARSER + f: PLAIN_TEXT_FILE + s: STRING + do + create s.make (1_024) + + create f.make_with_name (fn) + if f.exists and then f.is_access_readable then + f.open_read + from + until + f.exhausted + loop + f.read_stream_thread_aware (1_024) + s.append (f.last_string) + end + f.close + end + + create p.make_parser (s) + json := p.parse + end + + json: detachable JSON_VALUE + +feature -- Execution + + execute + local + tpl_name: READABLE_STRING_32 + vals: STRING_TABLE [READABLE_STRING_8] + uuid_gen: UUID_GENERATOR + do + if attached config ("template") as s32 then + create vals.make (5) + + tpl_name := s32 + create uuid_gen + vals.force (uuid_gen.generate_uuid.out, "UUID") + + if + attached config ("application.name") as appname + then + vals.force (appname.to_string_8, "APPNAME") + else + vals.force ("application", "APPNAME") + end + + if + attached config ("application.root_class") as approot + then + vals.force (approot.to_string_8, "APP_ROOT") + else + vals.force ("APPLICATION", "APP_ROOT") + end + generate (tpl_name, vals) + else + io.error.put_string ("Error no template value! %N") + end + end + + generate (tpl: READABLE_STRING_32; vals: STRING_TABLE [READABLE_STRING_8]) + local + gen: GEWF_GENERATOR + p: PATH + appname: detachable READABLE_STRING_GENERAL + do + create p.make_from_string ("template") + p := p.extended (tpl) + appname := vals.item ("APPNAME") + if appname = Void then + appname := "_generated" + end + create gen.make (p, create {PATH}.make_from_string (appname)) + gen.execute (vals) + end feature {NONE} -- Implementation invariant --- invariant_clause: True +-- invariant_clause: True end diff --git a/src/gewf/src/gewf_generator.e b/src/gewf/src/gewf_generator.e new file mode 100644 index 00000000..91312a39 --- /dev/null +++ b/src/gewf/src/gewf_generator.e @@ -0,0 +1,122 @@ +note + description: "Summary description for {GEWF_GENERATOR}." + author: "" + date: "$Date$" + revision: "$Revision$" + +class + GEWF_GENERATOR + +inherit + DIRECTORY_ITERATOR + redefine + process_directory, + process_file + end + +create + make + +feature {NONE} -- Initialization + + make (tpl: PATH; tgt: PATH) + do + template_folder := tpl + target_folder := tgt + end + +feature -- Execution + + execute (vals: STRING_TABLE [READABLE_STRING_8]) + do + values := vals + process_directory (template_folder) + values := Void + end + +feature -- Operation + + process_file (fn: PATH) + -- + local + s: STRING_32 + line: STRING + src,tgt: RAW_FILE + do + create s.make_from_string (fn.name) + s := s.substring (template_folder.name.count + 2, s.count) + if attached fn.extension as ext and then ext.is_case_insensitive_equal ("tpl") then + s.remove_tail (4) -- ".tpl" + end + + evaluate_string_32 (s) + s.to_lower + create src.make_with_path (fn) + create tgt.make_with_path (target_folder.extended (s)) + tgt.create_read_write + src.open_read + from + until + src.exhausted + loop + src.read_line_thread_aware + line := src.last_string + evaluate_string_8 (line) + tgt.put_string (line) + tgt.put_new_line + end + src.close + tgt.close + +-- Precursor (fn) + end + + process_directory (dn: PATH) + -- + local + s: STRING_32 + p: PATH + dir: DIRECTORY + do + create s.make_from_string (dn.name) + s := s.substring (template_folder.name.count + 1, s.count) + evaluate_string_32 (s) + p := target_folder.extended (s) + create dir.make_with_path (p) + dir.recursive_create_dir + Precursor (dn) + end + +feature -- Access + + values: detachable STRING_TABLE [READABLE_STRING_8] + + template_folder: PATH + target_folder: PATH + +feature -- Implementation + + evaluate_string_8 (s: STRING_8) + do + if attached values as l_values then + across + l_values as c + loop + s.replace_substring_all ({STRING_8} "${" + c.key.as_string_8 + "}", c.item) + end + end + end + + evaluate_string_32 (s: STRING_32) + do + if attached values as l_values then + across + l_values as c + loop + s.replace_substring_all ({STRING_32} "${" + c.key.as_string_32 + "}", c.item) + end + end + end + + +end diff --git a/src/gewf/template/basic/project.ecf.tpl b/src/gewf/template/basic/${APPNAME}.ecf.tpl similarity index 91% rename from src/gewf/template/basic/project.ecf.tpl rename to src/gewf/template/basic/${APPNAME}.ecf.tpl index 3fe8bac0..d293c122 100644 --- a/src/gewf/template/basic/project.ecf.tpl +++ b/src/gewf/template/basic/${APPNAME}.ecf.tpl @@ -1,6 +1,6 @@ - + /EIFGENs$ /CVS$ @@ -13,7 +13,7 @@ - + @@ -21,19 +21,19 @@ - + - + - + diff --git a/src/gewf/template/basic/project.ecf b/src/gewf/template/basic/project.ecf deleted file mode 100644 index ff9b4ab7..00000000 --- a/src/gewf/template/basic/project.ecf +++ /dev/null @@ -1,44 +0,0 @@ - - - - - /EIFGENs$ - /CVS$ - /.svn$ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/gewf/template/basic/src/app_service.e b/src/gewf/template/basic/src/${APP_ROOT}.e.tpl similarity index 92% rename from src/gewf/template/basic/src/app_service.e rename to src/gewf/template/basic/src/${APP_ROOT}.e.tpl index 23caa88a..d93b9ef5 100644 --- a/src/gewf/template/basic/src/app_service.e +++ b/src/gewf/template/basic/src/${APP_ROOT}.e.tpl @@ -6,7 +6,7 @@ note revision: "$Revision$" class - APPLICATION + ${APP_ROOT} inherit WSF_LAUNCHABLE_SERVICE @@ -34,7 +34,6 @@ feature {NONE} -- Initialization setup_router -- Setup `router' local - doc: WSF_ROUTER_SELF_DOCUMENTATION_HANDLER fhdl: WSF_FILE_SYSTEM_HANDLER do router.handle_with_request_methods ("/doc", create {WSF_ROUTER_SELF_DOCUMENTATION_HANDLER}.make (router), router.methods_GET) diff --git a/src/gewf/testing/README.txt b/src/gewf/testing/README.txt new file mode 100644 index 00000000..1d7b2986 --- /dev/null +++ b/src/gewf/testing/README.txt @@ -0,0 +1,9 @@ +To generate "demo" + + +gewf demo.cfg + + +It will generate the project under demo\demo.ecf + +note for now, the "template" folder should be in the current folder. diff --git a/src/gewf/testing/demo.cfg b/src/gewf/testing/demo.cfg new file mode 100644 index 00000000..545f164c --- /dev/null +++ b/src/gewf/testing/demo.cfg @@ -0,0 +1,4 @@ +{ +"template": "basic", +"application": {"name" : "demo", "root_class": "EWF_DEMO" } +} From a149d8de97ce3cf487a1492c9ec1cf3fbb962b29 Mon Sep 17 00:00:00 2001 From: Jocelyn Fiat Date: Fri, 5 Jul 2013 15:07:14 +0200 Subject: [PATCH 36/38] licensing and copyright --- src/gewf/license.lic | 10 ++++++++++ src/gewf/src/gewf.e | 10 ++++++++++ src/gewf/src/gewf_generator.e | 10 ++++++++++ 3 files changed, 30 insertions(+) create mode 100644 src/gewf/license.lic diff --git a/src/gewf/license.lic b/src/gewf/license.lic new file mode 100644 index 00000000..27384d13 --- /dev/null +++ b/src/gewf/license.lic @@ -0,0 +1,10 @@ +${NOTE_KEYWORD} + copyright: "2011-${YEAR}, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others" + license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" + source: "[ + Eiffel Software + 5949 Hollister Ave., Goleta, CA 93117 USA + Telephone 805-685-1006, Fax 805-685-6869 + Website http://www.eiffel.com + Customer support http://support.eiffel.com + ]" diff --git a/src/gewf/src/gewf.e b/src/gewf/src/gewf.e index f0140dba..41f04891 100644 --- a/src/gewf/src/gewf.e +++ b/src/gewf/src/gewf.e @@ -156,4 +156,14 @@ feature {NONE} -- Implementation invariant -- invariant_clause: True +note + copyright: "2011-2013, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others" + license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" + source: "[ + Eiffel Software + 5949 Hollister Ave., Goleta, CA 93117 USA + Telephone 805-685-1006, Fax 805-685-6869 + Website http://www.eiffel.com + Customer support http://support.eiffel.com + ]" end diff --git a/src/gewf/src/gewf_generator.e b/src/gewf/src/gewf_generator.e index 91312a39..389c606e 100644 --- a/src/gewf/src/gewf_generator.e +++ b/src/gewf/src/gewf_generator.e @@ -119,4 +119,14 @@ feature -- Implementation end +note + copyright: "2011-2013, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others" + license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" + source: "[ + Eiffel Software + 5949 Hollister Ave., Goleta, CA 93117 USA + Telephone 805-685-1006, Fax 805-685-6869 + Website http://www.eiffel.com + Customer support http://support.eiffel.com + ]" end From f7012e5b852cb8c5dc6e3fa79655de263c50253f Mon Sep 17 00:00:00 2001 From: Jocelyn Fiat Date: Fri, 5 Jul 2013 15:12:21 +0200 Subject: [PATCH 37/38] added README for gewf --- src/gewf/README.md | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 src/gewf/README.md diff --git a/src/gewf/README.md b/src/gewf/README.md new file mode 100644 index 00000000..a5cfd020 --- /dev/null +++ b/src/gewf/README.md @@ -0,0 +1,3 @@ +The gewf tool, is an experimentation to generate EWF project from template. + +status: experimental, POC, in-progress, draft From 2676b1642539ac88c0aa222d38caae995693bfa7 Mon Sep 17 00:00:00 2001 From: Jocelyn Fiat Date: Fri, 5 Jul 2013 15:13:43 +0200 Subject: [PATCH 38/38] Moved gewf under draft/src/gewf --- {src => draft/src}/gewf/README.md | 0 {src => draft/src}/gewf/gewf.ecf | 0 {src => draft/src}/gewf/license.lic | 0 {src => draft/src}/gewf/src/gewf.e | 0 {src => draft/src}/gewf/src/gewf_generator.e | 0 {src => draft/src}/gewf/template/basic/${APPNAME}.ecf.tpl | 0 .../src}/gewf/template/basic/ecf-target-any_connector.tpl | 0 {src => draft/src}/gewf/template/basic/ecf-target-connector.tpl | 0 .../src}/gewf/template/basic/launcher/any/application_launcher.e | 0 .../gewf/template/basic/launcher/default/application_launcher.e | 0 {src => draft/src}/gewf/template/basic/src/${APP_ROOT}.e.tpl | 0 {src => draft/src}/gewf/testing/README.txt | 0 {src => draft/src}/gewf/testing/demo.cfg | 0 13 files changed, 0 insertions(+), 0 deletions(-) rename {src => draft/src}/gewf/README.md (100%) rename {src => draft/src}/gewf/gewf.ecf (100%) rename {src => draft/src}/gewf/license.lic (100%) rename {src => draft/src}/gewf/src/gewf.e (100%) rename {src => draft/src}/gewf/src/gewf_generator.e (100%) rename {src => draft/src}/gewf/template/basic/${APPNAME}.ecf.tpl (100%) rename {src => draft/src}/gewf/template/basic/ecf-target-any_connector.tpl (100%) rename {src => draft/src}/gewf/template/basic/ecf-target-connector.tpl (100%) rename {src => draft/src}/gewf/template/basic/launcher/any/application_launcher.e (100%) rename {src => draft/src}/gewf/template/basic/launcher/default/application_launcher.e (100%) rename {src => draft/src}/gewf/template/basic/src/${APP_ROOT}.e.tpl (100%) rename {src => draft/src}/gewf/testing/README.txt (100%) rename {src => draft/src}/gewf/testing/demo.cfg (100%) diff --git a/src/gewf/README.md b/draft/src/gewf/README.md similarity index 100% rename from src/gewf/README.md rename to draft/src/gewf/README.md diff --git a/src/gewf/gewf.ecf b/draft/src/gewf/gewf.ecf similarity index 100% rename from src/gewf/gewf.ecf rename to draft/src/gewf/gewf.ecf diff --git a/src/gewf/license.lic b/draft/src/gewf/license.lic similarity index 100% rename from src/gewf/license.lic rename to draft/src/gewf/license.lic diff --git a/src/gewf/src/gewf.e b/draft/src/gewf/src/gewf.e similarity index 100% rename from src/gewf/src/gewf.e rename to draft/src/gewf/src/gewf.e diff --git a/src/gewf/src/gewf_generator.e b/draft/src/gewf/src/gewf_generator.e similarity index 100% rename from src/gewf/src/gewf_generator.e rename to draft/src/gewf/src/gewf_generator.e diff --git a/src/gewf/template/basic/${APPNAME}.ecf.tpl b/draft/src/gewf/template/basic/${APPNAME}.ecf.tpl similarity index 100% rename from src/gewf/template/basic/${APPNAME}.ecf.tpl rename to draft/src/gewf/template/basic/${APPNAME}.ecf.tpl diff --git a/src/gewf/template/basic/ecf-target-any_connector.tpl b/draft/src/gewf/template/basic/ecf-target-any_connector.tpl similarity index 100% rename from src/gewf/template/basic/ecf-target-any_connector.tpl rename to draft/src/gewf/template/basic/ecf-target-any_connector.tpl diff --git a/src/gewf/template/basic/ecf-target-connector.tpl b/draft/src/gewf/template/basic/ecf-target-connector.tpl similarity index 100% rename from src/gewf/template/basic/ecf-target-connector.tpl rename to draft/src/gewf/template/basic/ecf-target-connector.tpl diff --git a/src/gewf/template/basic/launcher/any/application_launcher.e b/draft/src/gewf/template/basic/launcher/any/application_launcher.e similarity index 100% rename from src/gewf/template/basic/launcher/any/application_launcher.e rename to draft/src/gewf/template/basic/launcher/any/application_launcher.e diff --git a/src/gewf/template/basic/launcher/default/application_launcher.e b/draft/src/gewf/template/basic/launcher/default/application_launcher.e similarity index 100% rename from src/gewf/template/basic/launcher/default/application_launcher.e rename to draft/src/gewf/template/basic/launcher/default/application_launcher.e diff --git a/src/gewf/template/basic/src/${APP_ROOT}.e.tpl b/draft/src/gewf/template/basic/src/${APP_ROOT}.e.tpl similarity index 100% rename from src/gewf/template/basic/src/${APP_ROOT}.e.tpl rename to draft/src/gewf/template/basic/src/${APP_ROOT}.e.tpl diff --git a/src/gewf/testing/README.txt b/draft/src/gewf/testing/README.txt similarity index 100% rename from src/gewf/testing/README.txt rename to draft/src/gewf/testing/README.txt diff --git a/src/gewf/testing/demo.cfg b/draft/src/gewf/testing/demo.cfg similarity index 100% rename from src/gewf/testing/demo.cfg rename to draft/src/gewf/testing/demo.cfg