Commit Graph

31 Commits

Author SHA1 Message Date
Jocelyn Fiat
c3c27c5027 Rather use (READABLE_)STRING_GENERAL for argument instead of _8 or _32 variant
Better design to set the WSF_REQUEST.path_parameters
   especially handle the case where the request goes trought more than one route (could be the case when using WSF_ROUTING_HANDLER)
2012-05-14 18:12:28 +02:00
Jocelyn Fiat
278a71eaaf Reviewed WSF_REQUEST.item (..) and items to look into Form, Query, and Path (cookie are excluded for security)
Added WSF_REQUEST.path_parameter (a_name): detachable WSF_VALUE
   - fill path_parameters using `import_raw_path_parameters"
     when executing the route
   - reset to previous value with reset_path_parameters (..),
     just in case the request is executed via severals routes.
2012-05-07 23:16:52 +02:00
Jocelyn Fiat
face4550f2 Fixed wrong signature should be READABLE_STRING_32 instead of _8 2012-05-02 19:22:39 +02:00
Jocelyn Fiat
07b3eddefe Fixed signature issue, the argument `name' should be READABLE_STRING_32 2012-04-30 15:51:10 +02:00
Jocelyn Fiat
21b03a05fd Added WSF_ROUTER.pre_route_execution_actions: ACTION_SEQUENCE [like route]
This way, one can add logger hook to router, to see which "route" was taken by the request.
2012-04-13 16:40:19 +02:00
Jocelyn Fiat
3bbf356f19 Missing commit related to changes on WSF_ROUTER 2012-04-12 11:59:14 +02:00
Jocelyn Fiat
10ebc12852 Removed default handler for WSF_ROUTER
Added 	WSF_ROUTE to replace a TUPLE [H, C]
	WSF_ROUTER.route (req): detachable WSF_ROUTE
	WSF_ROUTER.execute_route (a_route, req, res)
	To help usage of Routers
Remove WSF_HANDLER_CONTEXT obsolete features.
Added comments
2012-04-05 21:13:04 +02:00
Jocelyn Fiat
8344607eb6 Implemented WSF_RESPONSE.put_error (...) and related
Added WSF_RESPONSE.put_character
Renamed  WGI_OUTPUT_STREAM.put_character_8 as put_character  to follow style of put_string  (and not put_string_8)
Refactored the WSF_DEFAULT_SERVICE_LAUNCHER
Added WSF_DEFAULT_SERVICE to be more user friendly
Splitted the wsf/default/ libraries to have wsf/connector/... and being able to handle more than one connector in the same application
2012-03-20 10:29:55 +01:00
Jocelyn Fiat
fea0f115a0 Removed WGI_RESPONSE.write (..)
Replaced any internal call to WGI_RESPONSE.write () by the associated implementation (i.e  output.put_string (...)  )
Added WGI_OUTPUT_STREAM.put_crlf

Renamed WSF_RESPONSE.put_response (a_message) as  `send (a_message)'
WSF_RESPONSE_MESSAGE.send_to (res)  is now exported only to WSF_RESPONSE
2012-03-19 14:52:12 +01:00
Berend de Boer
876f9e02b7 status must be set, else WGI_SERVICE.execute will report the
postcondition violation.

Conflicts:

	library/server/wsf/router/wsf_handler.e
2012-03-19 13:58:17 +01:00
Jocelyn Fiat
487487ad44 Added WSF_RESPONSE_HANDLER based on WSF_RESPONSE_MESSAGE
The descendant has to implement the function

    response (ctx: C; req: WSF_REQUEST): WSF_RESPONSE_MESSAGE

Added related features and class in WSF_ROUTER to be able to use agent easily.
2012-03-19 12:04:46 +01:00
Jocelyn Fiat
ef5ba19c46 Refactored WSF_HANDLER_CONTEXT
- removed path_parameter
  - added `item' to include WSF_REQUEST.item
  - marked obsolete `parameter'

The goal is to remove confusion, remove URI_TEMPLATE specific `path_parameter'
and provide a way to use ctx.item (..) to also include meta variable, query, form, ... items
2012-03-19 10:21:29 +01:00
Jocelyn Fiat
f69ff42564 Created wsf_extension, and moved some classes from wsf to wsf_extension
WSF_HANDLER_HELPER
   WSF_RESOURCE_HANDLER_HELPER
   WSF_HANDLER_ROUTES_RECORDER
2012-03-16 14:12:02 +01:00
Jocelyn Fiat
eb3e9f2186 applied removal of HTTP_HEADER.put_status (..) 2012-03-16 13:53:22 +01:00
Jocelyn Fiat
46eb92ac37 Major renaming, adopt the WSF_ prefix for all classes under "wsf", and simplify some class names
Removed in WGI_INPUT_STREAM, the assertion "same_last_string_reference"
Copyright updates
2012-03-16 09:49:41 +01:00
Jocelyn Fiat
5abc79b7c3 Nino connector:
- fixed issue related to `ready_for_reading'  now use the `try_...' variant
 - for now Nino does not support persistent connection, then we have to respond with "Connection: close"

REQUEST_FILE_SYSTEM_HANDLER:
 - added not_found_handler and access_denied_handler, so that the user can customize related response

WSF_REQUEST and WSF_VALUE:
 - modified how uploaded file are handled, fixed various issues, and added WSF_UPLOADED_FILE (it is a WSF_VALUE)

WSF_VALUE:
 - added change_name (a_name: like name)
 - added url_encoded_name to other WSF_values

WSF_REQUEST:
 - added `destroy' to perform end of request cleaning (such as deleting temp uploaded files)
 - renamed `raw_post_data_recorded' as `raw_input_data_recorded', and related feature
 - do not store the RAW_POST_DATA in meta variable anymore, but in WSF_REQUEST.raw_input_data is asked

Added WSF_HTML_PAGE_RESPONSE to help user

WSF_REPONSE.redirect_... now use "temp_redirect" as default
  instead of "moved_permanently" which is specific usage

Removed many obsolete features.
2012-03-13 18:07:28 +01:00
Jocelyn Fiat
ac3e969b3c Added assertions to catch if route mapping does not already exists 2012-02-29 11:27:46 +01:00
jvelilla
468b2851be Refactor REQUEST_RESOURCE_HANDLER_HELPER to figure out the
transfer encoding: Chunked.
Added a new method to retrieve_data independently if the
transfer is chunked or not.
Updated ORDER_HANLDER to use this new feature.
Sync with Jocelyn repo
2012-02-17 08:48:27 -03:00
Jocelyn Fiat
67e6b460b3 removed unwanted set_status_code, since we already use put_header to set the status code. 2012-02-01 16:05:30 +01:00
Jocelyn Fiat
a1354136fa Fixed usage of lst[] in web form, now we are url-decoding the name because the [] could escaped...
Fixed bad code for assertion related to variable url-encoded name
2012-01-31 17:57:59 +01:00
Jocelyn Fiat
945ef79857 added REQUEST_HANDLER_CONTEXT.string_array_path_parameter (...) to help user handling list/array parameters
fixed postcondition WSF_REQUEST.set_meta_string_variable ...
2012-01-31 12:12:41 +01:00
Jocelyn Fiat
2c4df29877 Make sure to return a response
Added precondition to check URI_TEMPLATE is valid
2012-01-25 16:27:22 +01:00
Jocelyn Fiat
6dc1c0d2b0 Removed most of the "retry" in rescue clauses, since it was hidding critical issue.
This should be the choice of the application to "retry" on exception, otherwise let the framework handle this in the lower part.

Better handling of response termination (alias commit)
Added the notion of "status_committed"
2012-01-23 15:31:34 +01:00
Jocelyn Fiat
abdd68863d Removed any "format" related query from router lib, this is too application specific to be there.
Better handling of base_url for REQUEST_ROUTER
2012-01-20 15:35:03 +01:00
Jocelyn Fiat
4486df14cc export handler from REQUEST_ROUTER 2012-01-17 07:51:26 -08:00
Jocelyn Fiat
60574ee85f REQUEST_ROUTER now inherit from ITERABLE [..] 2012-01-17 16:35:52 +01:00
Jocelyn Fiat
d90ecbd5fe removed obsolete call on WSF_RESPONSE.write_..' by using the up-to-date WSF_RESPONSE.put_..' 2012-01-09 10:21:35 +01:00
Jocelyn Fiat
20281bc922 HTTP_HEADER: - added put_last_modified
- added RFC1123 http date format helper
             - added put_cookie_with_expiration_date as DATE_TIME
REQUEST: added `execution_variable' to provide a way to keep object attached to the request
         and indexed by a string. A typical usage is a SESSION object
2012-01-06 18:27:52 +01:00
Jocelyn Fiat
7207a021be Applied renaming from write_ to put_ 2011-12-15 19:34:20 +01:00
Jocelyn Fiat
1698a06ea0 Fixed typo and missing uri_template reference for draft rest library 2011-12-15 14:40:43 +01:00
Jocelyn Fiat
da3594db50 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
2011-12-15 14:10:52 +01:00