Page structure
This commit is contained in:
21
library/server/wsf_html/webcontrol/wsf_control.e
Normal file
21
library/server/wsf_html/webcontrol/wsf_control.e
Normal file
@@ -0,0 +1,21 @@
|
||||
note
|
||||
description: "Summary description for {WSF_CONTROL}."
|
||||
author: ""
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
deferred class
|
||||
WSF_CONTROL
|
||||
feature
|
||||
name: STRING
|
||||
|
||||
feature {WSF_PAGE_CONTROL}
|
||||
|
||||
handle_callback(event: STRING ; control_name: STRING ; page: WSF_PAGE_CONTROL)
|
||||
deferred
|
||||
end
|
||||
|
||||
render:STRING
|
||||
deferred
|
||||
end
|
||||
end
|
||||
78
library/server/wsf_html/webcontrol/wsf_page_control.e
Normal file
78
library/server/wsf_html/webcontrol/wsf_page_control.e
Normal file
@@ -0,0 +1,78 @@
|
||||
note
|
||||
description: "Summary description for {WSF_PAGE_CONTROL}."
|
||||
author: ""
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
deferred class
|
||||
WSF_PAGE_CONTROL
|
||||
|
||||
feature {NONE} -- Initialization
|
||||
|
||||
make (req: WSF_REQUEST; res: WSF_RESPONSE)
|
||||
do
|
||||
request := req
|
||||
response := res
|
||||
end
|
||||
|
||||
feature -- Access
|
||||
|
||||
request: WSF_REQUEST
|
||||
|
||||
response: WSF_RESPONSE
|
||||
|
||||
feature
|
||||
|
||||
initialize_controls
|
||||
deferred
|
||||
end
|
||||
|
||||
process
|
||||
deferred
|
||||
end
|
||||
|
||||
feature
|
||||
|
||||
|
||||
execute
|
||||
local
|
||||
event: detachable STRING
|
||||
control_name: detachable STRING
|
||||
do
|
||||
initialize_controls
|
||||
control_name := get_parameter("control_name")
|
||||
event := get_parameter("event")
|
||||
if attached event and attached control_name and attached control then
|
||||
control.handle_callback (control_name,event, Current)
|
||||
else
|
||||
process
|
||||
render
|
||||
end
|
||||
end
|
||||
|
||||
render
|
||||
local
|
||||
data: STRING
|
||||
do
|
||||
data := control.render
|
||||
response.put_header ({HTTP_STATUS_CODE}.ok, <<["Content-Type", "text/plain"], ["Content-Length", data.count.out]>>)
|
||||
response.put_string (data)
|
||||
end
|
||||
|
||||
get_parameter(key: STRING) : detachable STRING
|
||||
local
|
||||
value: detachable WSF_VALUE
|
||||
do
|
||||
Result := VOID
|
||||
value := request.query_parameter (key)
|
||||
if attached value then
|
||||
Result := value.as_string.value
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
feature {NONE}
|
||||
|
||||
control: WSF_CONTROL
|
||||
|
||||
end
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<system xmlns="http://www.eiffel.com/developers/xml/configuration-1-11-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-11-0 http://www.eiffel.com/developers/xml/configuration-1-11-0.xsd" name="wsf_html" uuid="6AAAE037-7E66-4F5D-BED0-0042245C26BC" library_target="wsf_html">
|
||||
<system xmlns="http://www.eiffel.com/developers/xml/configuration-1-10-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-10-0 http://www.eiffel.com/developers/xml/configuration-1-10-0.xsd" name="wsf_html" uuid="6AAAE037-7E66-4F5D-BED0-0042245C26BC" library_target="wsf_html">
|
||||
<target name="wsf_html">
|
||||
<root all_classes="true"/>
|
||||
<file_rule>
|
||||
@@ -11,11 +11,13 @@
|
||||
</option>
|
||||
<library name="base" location="$ISE_LIBRARY\library\base\base-safe.ecf"/>
|
||||
<library name="encoder" location="..\..\text\encoder\encoder-safe.ecf"/>
|
||||
<library name="http" location="..\..\network\protocol\http\http-safe.ecf"/>
|
||||
<library name="uri_template" location="..\..\text\parser\uri_template\uri_template-safe.ecf"/>
|
||||
<library name="wsf" location="..\wsf\wsf-safe.ecf"/>
|
||||
<cluster name="api" location=".\api\" recursive="true"/>
|
||||
<cluster name="css" location=".\css\" recursive="true"/>
|
||||
<cluster name="form" location=".\form\" recursive="true"/>
|
||||
<cluster name="webcontrol" location="\home\ynh\Documents\ewf\EWF\library\server\wsf_html\webcontrol\"/>
|
||||
<cluster name="widget" location=".\widget\" recursive="true"/>
|
||||
</target>
|
||||
</system>
|
||||
|
||||
Reference in New Issue
Block a user