Merge branch 'master' of github.com:EiffelWebFramework/EWF

This commit is contained in:
Jocelyn Fiat
2012-06-29 11:42:36 +02:00
6 changed files with 10 additions and 7 deletions

View File

@@ -113,13 +113,14 @@ feature -- Access
Result.append_character ('}') Result.append_character ('}')
end end
feature -- Mesurement
count: INTEGER count: INTEGER
-- Number of field -- Number of field
do do
Result := object.count Result := object.count
end end
feature -- Access feature -- Access
new_cursor: TABLE_ITERATION_CURSOR [JSON_VALUE, JSON_STRING] new_cursor: TABLE_ITERATION_CURSOR [JSON_VALUE, JSON_STRING]

View File

@@ -37,7 +37,7 @@ feature -- Access
resource_value (ctx: C): detachable READABLE_STRING_32 resource_value (ctx: C): detachable READABLE_STRING_32
do do
if attached {WSF_STRING} ctx.item ("resource") as s then if attached {WSF_STRING} ctx.item ("resource") as s then
Result := s.string Result := s.value
end end
end end

View File

@@ -23,6 +23,9 @@ feature {NONE} -- Initialization
do do
create h.make create h.make
sess := h.new_session ("http://127.0.0.1:9090") sess := h.new_session ("http://127.0.0.1:9090")
-- Uncomment the following 2 lines, if you use fiddler2 web debugging tool
-- sess.set_is_debug (True)
-- sess.set_proxy ("127.0.0.1", 8888)
-- Create Order -- Create Order
print ("%N Create Order %N") print ("%N Create Order %N")

View File

@@ -3,8 +3,7 @@
This class implements the `Hello World' service. This class implements the `Hello World' service.
It inherits from WSF_DEFAULT_SERVICE to get default EWF connector ready It inherits from WSF_DEFAULT_SERVICE to get default EWF connector ready
only `response' needs to be implemented. And from WSF_URI_TEMPLATE_ROUTED_SERVICE to use the router service
In this example, it is redefined and specialized to be WSF_PAGE_RESPONSE
`initialize' can be redefine to provide custom options if needed. `initialize' can be redefine to provide custom options if needed.
@@ -30,7 +29,7 @@ feature {NONE} -- Initialization
do do
router.map_agent ("/hello", agent execute_hello) router.map_agent ("/hello", agent execute_hello)
router.map_with_request_methods ("/users/{user}/message/{mesgid}", create {USER_MESSAGE_HANDLER}, router.methods_GET_POST) router.map_with_request_methods ("/users/{user}/message/{mesgid}", create {USER_MESSAGE_HANDLER}, router.methods_HEAD_GET_POST)
router.map_with_request_methods ("/users/{user}/message/", create {USER_MESSAGE_HANDLER}, router.methods_GET_POST) router.map_with_request_methods ("/users/{user}/message/", create {USER_MESSAGE_HANDLER}, router.methods_GET_POST)
router.map_agent_response_with_request_methods ("/users/{user}/{?op}", agent response_user, router.methods_GET) router.map_agent_response_with_request_methods ("/users/{user}/{?op}", agent response_user, router.methods_GET)
@@ -107,7 +106,7 @@ feature -- Execution
attached {WSF_STRING} req.query_parameter ("op") as l_op attached {WSF_STRING} req.query_parameter ("op") as l_op
then then
if l_op.is_case_insensitive_equal ("quit") then if l_op.is_case_insensitive_equal ("quit") then
create redir.make (req.script_url ("/hello"), 5) create redir.make (req.script_url ("/hello"), 3)
redir.set_title ("Bye " + u.url_encoded_value) redir.set_title ("Bye " + u.url_encoded_value)
redir.set_body ("Bye " + u.url_encoded_value + ",<br/> see you soon.<p>You will be redirected to " + redir.set_body ("Bye " + u.url_encoded_value + ",<br/> see you soon.<p>You will be redirected to " +
redir.url_location + " in " + redir.delay.out + " second(s) ...</p>" redir.url_location + " in " + redir.delay.out + " second(s) ...</p>"

View File

@@ -188,7 +188,7 @@ feature -- Convertion
-- String value from `a_value' if relevant. -- String value from `a_value' if relevant.
do do
if attached {WSF_STRING} a_value as val then if attached {WSF_STRING} a_value as val then
Result := val.string Result := val.value
end end
end end