Moved EWF workbook from ewf_example to EWF main repository.

This commit is contained in:
jvelilla
2015-05-18 11:06:04 -03:00
parent d4c0ff03b4
commit a7c8d40b3e
41 changed files with 4622 additions and 0 deletions

View File

@@ -0,0 +1,68 @@
note
description : "Basic Service that build a generic front end for the most used search engines."
date : "$Date$"
revision : "$Revision$"
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
feature -- Basic operations
execute (req: WSF_REQUEST; res: WSF_RESPONSE)
-- Execute the incomming request
local
l_message: STRING
do
-- (1) To send a response we need to setup, the status code and the response headers.
-- res.put_header ({HTTP_STATUS_CODE}.ok, <<["Content-Type", "text/html"], ["Content-Length", web_page.count.out]>>)
-- res.put_string (web_page)
-- (2) Using put_header_line
-- res.set_status_code ({HTTP_STATUS_CODE}.ok)
-- res.put_header_line ("Content-Type:text/html")
res.put_header_line ("Content-Length:"+ web_page.count.out)
res.put_header_line ("Content-Type:text/plain")
res.put_string (web_page)
end
feature -- Home Page
web_page: STRING = "[
<!DOCTYPE html>
<html>
<head>
<title>EWF Headers Responses</title>
</head>
<body>
<div class="right">
<h2>Example Header Response</h2>
<p>Response headers</p>
</div>
<div id="footer">
<p>EWF Response Header</p>
</div>
</body>
</html>
]"
end