Now the 'router' library is part of 'wsf'

Move hello_routed_world under tests/dev since it was not really an example, but more a dev workspace/test
This commit is contained in:
Jocelyn Fiat
2011-12-15 14:10:52 +01:00
parent bfa620eee3
commit da3594db50
44 changed files with 32 additions and 47 deletions

View File

@@ -43,8 +43,7 @@ An alternative to the last 2 instructions is to use the script from tools folder
* connectors: various web server connectors for EWSGI * connectors: various web server connectors for EWSGI
* libfcgi: Wrapper for libfcgi SDK * libfcgi: Wrapper for libfcgi SDK
* __wsf__: Web Server Framework [read more](library/server/wsf) * __wsf__: Web Server Framework [read more](library/server/wsf)
* request * __router__: URL dispatching/routing based on uri, uri_template, or custom [read more](library/server/wsf/router)
* __router__: URL dispatching/routing based on uri, uri_template, or custom [read more](library/server/request/router)
### protocol ### protocol
* __http__: HTTP related classes, constants for status code, content types, ... [read more](library/protocol/http) * __http__: HTTP related classes, constants for status code, content types, ... [read more](library/protocol/http)

View File

@@ -12,8 +12,6 @@
<library name="base" location="$ISE_LIBRARY\library\base\base-safe.ecf"/> <library name="base" location="$ISE_LIBRARY\library\base\base-safe.ecf"/>
<library name="wsf" location="..\..\..\..\..\library\server\wsf\wsf-safe.ecf" readonly="false"/> <library name="wsf" location="..\..\..\..\..\library\server\wsf\wsf-safe.ecf" readonly="false"/>
<library name="http" location="..\..\..\..\..\library\protocol\http\http-safe.ecf"/> <library name="http" location="..\..\..\..\..\library\protocol\http\http-safe.ecf"/>
<library name="router" location="..\..\..\..\..\library\server\request\router\router-safe.ecf" readonly="false"/>
<library name="uri_template" location="..\..\..\..\..\library\protocol\uri_template\uri_template-safe.ecf" readonly="false"/>
<cluster name="contrib" location=".\src\contrib\" recursive="true"> <cluster name="contrib" location=".\src\contrib\" recursive="true">
<file_rule> <file_rule>
<exclude>/html$</exclude> <exclude>/html$</exclude>

View File

@@ -11,8 +11,6 @@
<library name="base" location="$ISE_LIBRARY\library\base\base.ecf"/> <library name="base" location="$ISE_LIBRARY\library\base\base.ecf"/>
<library name="wsf" location="..\..\..\..\..\library\server\wsf\wsf.ecf"/> <library name="wsf" location="..\..\..\..\..\library\server\wsf\wsf.ecf"/>
<library name="http" location="..\..\..\..\..\library\protocol\http\http.ecf"/> <library name="http" location="..\..\..\..\..\library\protocol\http\http.ecf"/>
<library name="router" location="..\..\..\..\..\library\server\request\router\router.ecf" readonly="false"/>
<library name="uri_template" location="..\..\..\..\..\library\protocol\uri_template\uri_template.ecf"/>
<cluster name="contrib" location=".\src\contrib\" recursive="true"> <cluster name="contrib" location=".\src\contrib\" recursive="true">
<file_rule> <file_rule>
<exclude>/html$</exclude> <exclude>/html$</exclude>

View File

@@ -13,13 +13,16 @@
</option> </option>
<setting name="concurrency" value="thread"/> <setting name="concurrency" value="thread"/>
<library name="base" location="$ISE_LIBRARY\library\base\base-safe.ecf"/> <library name="base" location="$ISE_LIBRARY\library\base\base-safe.ecf"/>
<library name="connector_nino" location="..\..\library\server\ewsgi\connectors\nino\nino-safe.ecf" readonly="false"/> <library name="connector_nino" location="..\..\library\server\ewsgi\connectors\nino\nino-safe.ecf" readonly="false">
<option debug="true">
<debug name="nino" enabled="true"/>
</option>
</library>
<library name="default_nino" location="..\..\library\server\wsf\default\nino-safe.ecf" readonly="false"/> <library name="default_nino" location="..\..\library\server\wsf\default\nino-safe.ecf" readonly="false"/>
<library name="eel" location="..\..\library\crypto\eel\eel-safe.ecf" readonly="false"/> <library name="eel" location="..\..\library\crypto\eel\eel-safe.ecf" readonly="false"/>
<library name="encoder" location="..\..\library\text\encoder\encoder-safe.ecf" readonly="false"/> <library name="encoder" location="..\..\library\text\encoder\encoder-safe.ecf" readonly="false"/>
<library name="http" location="..\..\library\protocol\http\http-safe.ecf" readonly="false"/> <library name="http" location="..\..\library\protocol\http\http-safe.ecf" readonly="false"/>
<library name="json" location="..\..\contrib\library\text\parser\json\library\json-safe.ecf" readonly="false"/> <library name="json" location="..\..\contrib\library\text\parser\json\library\json-safe.ecf" readonly="false"/>
<library name="router" location="..\..\library\server\request\router\router-safe.ecf" readonly="false"/>
<library name="uri_template" location="..\..\library\protocol\uri_template\uri_template-safe.ecf" readonly="false"/> <library name="uri_template" location="..\..\library\protocol\uri_template\uri_template-safe.ecf" readonly="false"/>
<library name="wsf" location="..\..\library\server\wsf\wsf-safe.ecf" readonly="false"/> <library name="wsf" location="..\..\library\server\wsf\wsf-safe.ecf" readonly="false"/>
<cluster name="src" location="src\" recursive="true"/> <cluster name="src" location="src\" recursive="true"/>

View File

@@ -3,8 +3,14 @@
http_client-safe : c:\_dev\Dev-Process\web-framework\library\client\http_client\http_client-safe.ecf http_client-safe : c:\_dev\Dev-Process\web-framework\library\client\http_client\http_client-safe.ecf
http_client : c:\_dev\Dev-Process\web-framework\library\client\http_client\http_client.ecf http_client : c:\_dev\Dev-Process\web-framework\library\client\http_client\http_client.ecf
eapml-safe : c:\_dev\Dev-Process\web-framework\library\crypto\eapml\eapml-safe.ecf
eapml : c:\_dev\Dev-Process\web-framework\library\crypto\eapml\eapml.ecf
eel-safe : c:\_dev\Dev-Process\web-framework\library\crypto\eel\eel-safe.ecf
eel : c:\_dev\Dev-Process\web-framework\library\crypto\eel\eel.ecf
error-safe : c:\_dev\Dev-Process\web-framework\library\error\error-safe.ecf error-safe : c:\_dev\Dev-Process\web-framework\library\error\error-safe.ecf
error : c:\_dev\Dev-Process\web-framework\library\error\error.ecf error : c:\_dev\Dev-Process\web-framework\library\error\error.ecf
conneg-safe : c:\_dev\Dev-Process\web-framework\library\protocol\CONNEG\conneg-safe.ecf
conneg : c:\_dev\Dev-Process\web-framework\library\protocol\CONNEG\conneg.ecf
http-safe : c:\_dev\Dev-Process\web-framework\library\protocol\http\http-safe.ecf http-safe : c:\_dev\Dev-Process\web-framework\library\protocol\http\http-safe.ecf
http : c:\_dev\Dev-Process\web-framework\library\protocol\http\http.ecf http : c:\_dev\Dev-Process\web-framework\library\protocol\http\http.ecf
http_authorization-safe : c:\_dev\Dev-Process\web-framework\library\server\authentication\http_authorization\http_authorization-safe.ecf http_authorization-safe : c:\_dev\Dev-Process\web-framework\library\server\authentication\http_authorization\http_authorization-safe.ecf
@@ -13,8 +19,6 @@ ewsgi-safe : c:\_dev\Dev-Process\web-framework\library\server\ewsgi\ewsgi-safe.e
ewsgi : c:\_dev\Dev-Process\web-framework\library\server\ewsgi\ewsgi.ecf ewsgi : c:\_dev\Dev-Process\web-framework\library\server\ewsgi\ewsgi.ecf
ewsgi_spec-safe : c:\_dev\Dev-Process\web-framework\library\server\ewsgi\ewsgi_spec-safe.ecf ewsgi_spec-safe : c:\_dev\Dev-Process\web-framework\library\server\ewsgi\ewsgi_spec-safe.ecf
ewsgi_spec : c:\_dev\Dev-Process\web-framework\library\server\ewsgi\ewsgi_spec.ecf ewsgi_spec : c:\_dev\Dev-Process\web-framework\library\server\ewsgi\ewsgi_spec.ecf
connector-safe : c:\_dev\Dev-Process\web-framework\library\server\ewsgi\connectors\connector-safe.ecf
connector : c:\_dev\Dev-Process\web-framework\library\server\ewsgi\connectors\connector.ecf
cgi-safe : c:\_dev\Dev-Process\web-framework\library\server\ewsgi\connectors\cgi\cgi-safe.ecf cgi-safe : c:\_dev\Dev-Process\web-framework\library\server\ewsgi\connectors\cgi\cgi-safe.ecf
cgi : c:\_dev\Dev-Process\web-framework\library\server\ewsgi\connectors\cgi\cgi.ecf cgi : c:\_dev\Dev-Process\web-framework\library\server\ewsgi\connectors\cgi\cgi.ecf
libfcgi-safe : c:\_dev\Dev-Process\web-framework\library\server\ewsgi\connectors\libfcgi\libfcgi-safe.ecf libfcgi-safe : c:\_dev\Dev-Process\web-framework\library\server\ewsgi\connectors\libfcgi\libfcgi-safe.ecf
@@ -25,14 +29,12 @@ fcgi-safe : c:\_dev\Dev-Process\web-framework\library\server\libfcgi\fcgi-safe.e
fcgi : c:\_dev\Dev-Process\web-framework\library\server\libfcgi\fcgi.ecf fcgi : c:\_dev\Dev-Process\web-framework\library\server\libfcgi\fcgi.ecf
libfcgi-safe : c:\_dev\Dev-Process\web-framework\library\server\libfcgi\libfcgi-safe.ecf libfcgi-safe : c:\_dev\Dev-Process\web-framework\library\server\libfcgi\libfcgi-safe.ecf
libfcgi : c:\_dev\Dev-Process\web-framework\library\server\libfcgi\libfcgi.ecf libfcgi : c:\_dev\Dev-Process\web-framework\library\server\libfcgi\libfcgi.ecf
rest-safe : c:\_dev\Dev-Process\web-framework\library\server\request\rest\rest-safe.ecf
rest : c:\_dev\Dev-Process\web-framework\library\server\request\rest\rest.ecf
router-safe : c:\_dev\Dev-Process\web-framework\library\server\request\router\router-safe.ecf
router : c:\_dev\Dev-Process\web-framework\library\server\request\router\router.ecf
wsf-safe : c:\_dev\Dev-Process\web-framework\library\server\wsf\wsf-safe.ecf wsf-safe : c:\_dev\Dev-Process\web-framework\library\server\wsf\wsf-safe.ecf
wsf : c:\_dev\Dev-Process\web-framework\library\server\wsf\wsf.ecf wsf : c:\_dev\Dev-Process\web-framework\library\server\wsf\wsf.ecf
cgi-safe : c:\_dev\Dev-Process\web-framework\library\server\wsf\default\cgi-safe.ecf cgi-safe : c:\_dev\Dev-Process\web-framework\library\server\wsf\default\cgi-safe.ecf
cgi : c:\_dev\Dev-Process\web-framework\library\server\wsf\default\cgi.ecf cgi : c:\_dev\Dev-Process\web-framework\library\server\wsf\default\cgi.ecf
libfcgi-safe : c:\_dev\Dev-Process\web-framework\library\server\wsf\default\libfcgi-safe.ecf
libfcgi : c:\_dev\Dev-Process\web-framework\library\server\wsf\default\libfcgi.ecf
nino-safe : c:\_dev\Dev-Process\web-framework\library\server\wsf\default\nino-safe.ecf nino-safe : c:\_dev\Dev-Process\web-framework\library\server\wsf\default\nino-safe.ecf
nino : c:\_dev\Dev-Process\web-framework\library\server\wsf\default\nino.ecf nino : c:\_dev\Dev-Process\web-framework\library\server\wsf\default\nino.ecf
encoder-safe : c:\_dev\Dev-Process\web-framework\library\text\encoder\encoder-safe.ecf encoder-safe : c:\_dev\Dev-Process\web-framework\library\text\encoder\encoder-safe.ecf

View File

@@ -11,10 +11,6 @@
<assertions precondition="true"/> <assertions precondition="true"/>
</option> </option>
<library name="base" location="$ISE_LIBRARY\library\base\base-safe.ecf"/> <library name="base" location="$ISE_LIBRARY\library\base\base-safe.ecf"/>
<library name="base_extension" location="$ISE_LIBRARY\library\base_extension\base_extension-safe.ecf"/>
<library name="wsf" location="..\..\wsf\wsf-safe.ecf" readonly="false"/> <library name="wsf" location="..\..\wsf\wsf-safe.ecf" readonly="false"/>
<library name="http" location="..\..\..\protocol\http\http-safe.ecf"/>
<library name="uri_template" location="..\..\..\protocol\uri_template\uri_template-safe.ecf" readonly="false"/>
<cluster name="src" location="src\" recursive="true"/>
</target> </target>
</system> </system>

View File

@@ -11,27 +11,6 @@
<assertions precondition="true"/> <assertions precondition="true"/>
</option> </option>
<library name="base" location="$ISE_LIBRARY\library\base\base.ecf"/> <library name="base" location="$ISE_LIBRARY\library\base\base.ecf"/>
<library name="base_extension" location="$ISE_LIBRARY\library\base_extension\base_extension.ecf"/>
<library name="wsf" location="..\..\wsf\wsf.ecf"/> <library name="wsf" location="..\..\wsf\wsf.ecf"/>
<library name="http" location="..\..\..\protocol\http\http.ecf"/>
<library name="uri_template" location="..\..\..\protocol\uri_template\uri_template.ecf"/>
<cluster name="src" location="src\" recursive="true"/>
</target>
<target name="ewsgi_compliant_router">
<root all_classes="true"/>
<file_rule>
<exclude>/.git$</exclude>
<exclude>/EIFGENs$</exclude>
<exclude>/.svn$</exclude>
</file_rule>
<option warning="true" full_class_checking="true" syntax="provisional">
<assertions precondition="true"/>
</option>
<library name="base" location="$ISE_LIBRARY\library\base\base.ecf"/>
<library name="base_extension" location="$ISE_LIBRARY\library\base_extension\base_extension.ecf"/>
<library name="wsf" location="..\..\wsf\wsf.ecf"/>
<library name="http" location="..\..\..\protocol\http\http.ecf"/>
<library name="uri_template" location="..\..\..\protocol\uri_template\uri_template.ecf"/>
<cluster name="src" location="src\" recursive="true"/>
</target> </target>
</system> </system>

View File

@@ -6,6 +6,11 @@ It is built on top of [EWSGI](../ewsgi/) to benefit from the various EWSGI conne
## Requirements ## Requirements
* [EWSGI](../ewsgi) * [EWSGI](../ewsgi)
* [HTTP](../../protocol/http) * [HTTP](../../protocol/http)
* [URI template](../../protocol/uri_template)
## Content
* Core classes for the Web Server Framework
* [Router](router) library
## Overview ## Overview

View File

@@ -1,4 +1,4 @@
This library introduce the notion of router and handler This library introduce the notion of router and handler in the folder "router"
The Router manages the association between URI,URI template and Handler The Router manages the association between URI,URI template and Handler
The Router is in charge to route/dispatch a request to one of the Handler according to the URI and how the Handler is mapped in the Router. The Router is in charge to route/dispatch a request to one of the Handler according to the URI and how the Handler is mapped in the Router.
@@ -11,4 +11,4 @@ create {REQUEST_URI_TEMPLATE_ROUTER} router.make
create {REQUEST_AGENT_HANDLER} hello_handler.make (agent handle_hello) create {REQUEST_AGENT_HANDLER} hello_handler.make (agent handle_hello)
router.map ("/hello/{name}", hello_handler) router.map ("/hello/{name}", hello_handler)
router.map_agent ("/hello/{name}", agent handle_hello) router.map_agent ("/hello/{name}", agent handle_hello)

View File

@@ -1,7 +1,6 @@
# Router library # Router
## Requirements ## Requirements
* [Web Server Framework](../../wsf)
* [URI Template](../../../protocol/rui_template) * [URI Template](../../../protocol/rui_template)
## Overview ## Overview

View File

@@ -10,11 +10,14 @@
<option warning="true" full_class_checking="true" is_attached_by_default="true" void_safety="all" syntax="provisional"> <option warning="true" full_class_checking="true" is_attached_by_default="true" void_safety="all" syntax="provisional">
</option> </option>
<library name="base" location="$ISE_LIBRARY\library\base\base-safe.ecf"/> <library name="base" location="$ISE_LIBRARY\library\base\base-safe.ecf"/>
<library name="base_extension" location="$ISE_LIBRARY\library\base_extension\base_extension-safe.ecf"/>
<library name="ewsgi" location="..\ewsgi\ewsgi-safe.ecf"/> <library name="ewsgi" location="..\ewsgi\ewsgi-safe.ecf"/>
<library name="time" location="$ISE_LIBRARY\library\time\time-safe.ecf"/> <library name="time" location="$ISE_LIBRARY\library\time\time-safe.ecf"/>
<library name="error" location="..\..\error\error-safe.ecf"/> <library name="error" location="..\..\error\error-safe.ecf"/>
<library name="http" location="..\..\protocol\http\http-safe.ecf"/> <library name="http" location="..\..\protocol\http\http-safe.ecf"/>
<library name="uri_template" location="..\..\protocol\uri_template\uri_template-safe.ecf"/>
<library name="encoder" location="..\..\text\encoder\encoder-safe.ecf"/> <library name="encoder" location="..\..\text\encoder\encoder-safe.ecf"/>
<cluster name="src" location=".\src" recursive="true"/> <cluster name="src" location=".\src" recursive="true"/>
<cluster name="router" location=".\router" recursive="true"/>
</target> </target>
</system> </system>

View File

@@ -10,11 +10,14 @@
<option warning="true" full_class_checking="true" void_safety="none" syntax="provisional"> <option warning="true" full_class_checking="true" void_safety="none" syntax="provisional">
</option> </option>
<library name="base" location="$ISE_LIBRARY/library/base/base.ecf"/> <library name="base" location="$ISE_LIBRARY/library/base/base.ecf"/>
<library name="base_extension" location="$ISE_LIBRARY\library\base_extension\base_extension.ecf"/>
<library name="ewsgi" location="..\ewsgi\ewsgi.ecf"/> <library name="ewsgi" location="..\ewsgi\ewsgi.ecf"/>
<library name="time" location="$ISE_LIBRARY\library\time\time.ecf"/> <library name="time" location="$ISE_LIBRARY\library\time\time.ecf"/>
<library name="error" location="..\..\error\error.ecf"/> <library name="error" location="..\..\error\error.ecf"/>
<library name="http" location="..\..\protocol\http\http.ecf"/> <library name="http" location="..\..\protocol\http\http.ecf"/>
<library name="uri_template" location="..\..\protocol\uri_template\uri_template.ecf"/>
<library name="encoder" location="..\..\text\encoder\encoder.ecf"/> <library name="encoder" location="..\..\text\encoder\encoder.ecf"/>
<cluster name="src" location=".\src" recursive="true"/> <cluster name="src" location=".\src" recursive="true"/>
<cluster name="router" location=".\router" recursive="true"/>
</target> </target>
</system> </system>

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="ISO-8859-1"?> <?xml version="1.0" encoding="ISO-8859-1"?>
<system xmlns="http://www.eiffel.com/developers/xml/configuration-1-9-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-9-0 http://www.eiffel.com/developers/xml/configuration-1-9-0.xsd" name="hello_routed_world" uuid="7C9887BD-4AE4-47F2-A0AA-4BBB6736D433"> <system xmlns="http://www.eiffel.com/developers/xml/configuration-1-9-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-9-0 http://www.eiffel.com/developers/xml/configuration-1-9-0.xsd" name="hello_dev" uuid="7C9887BD-4AE4-47F2-A0AA-4BBB6736D433">
<target name="hello_connector" abstract="true"> <target name="hello_dev" abstract="true">
<root class="HELLO_ROUTED_WORLD" feature="make"/> <root class="HELLO_ROUTED_WORLD" feature="make"/>
<file_rule> <file_rule>
<exclude>/EIFGENs$</exclude> <exclude>/EIFGENs$</exclude>
@@ -14,7 +14,6 @@
<setting name="concurrency" value="thread"/> <setting name="concurrency" value="thread"/>
<library name="base" location="$ISE_LIBRARY\library\base\base-safe.ecf"/> <library name="base" location="$ISE_LIBRARY\library\base\base-safe.ecf"/>
<library name="http" location="..\..\library\protocol\http\http-safe.ecf" readonly="false"/> <library name="http" location="..\..\library\protocol\http\http-safe.ecf" readonly="false"/>
<library name="router" location="..\..\library\server\request\router\router-safe.ecf" readonly="false"/>
<library name="wsf" location="..\..\library\server\wsf\wsf-safe.ecf" readonly="false"/> <library name="wsf" location="..\..\library\server\wsf\wsf-safe.ecf" readonly="false"/>
</target> </target>
<target name="hello_nino" extends="hello_connector"> <target name="hello_nino" extends="hello_connector">
@@ -22,8 +21,9 @@
<debug name="nino" enabled="true"/> <debug name="nino" enabled="true"/>
<assertions precondition="true" postcondition="true" check="true" invariant="true" supplier_precondition="true"/> <assertions precondition="true" postcondition="true" check="true" invariant="true" supplier_precondition="true"/>
</option> </option>
<library name="default_nino" location="..\..\library\server\wsf\default\nino-safe.ecf" use_application_options="true"/> <library name="default_nino" location="..\..\library\server\wsf\default\nino-safe.ecf" readonly="false" use_application_options="true"/>
<cluster name="src" location="src\" recursive="true"/> <cluster name="src" location="src\" recursive="true"/>
<override name="override" location="override\" recursive="true"/>
</target> </target>
<target name="hello_cgi" extends="hello_connector"> <target name="hello_cgi" extends="hello_connector">
<library name="default_cgi" location="..\..\library\server\wsf\default\cgi-safe.ecf"/> <library name="default_cgi" location="..\..\library\server\wsf\default\cgi-safe.ecf"/>