merging from upstream - stage 1

This commit is contained in:
Colin Adams
2013-03-26 17:04:49 +00:00
90 changed files with 1257 additions and 936 deletions

View File

@@ -14,7 +14,7 @@
<setting name="concurrency" value="thread"/>
<library name="base" location="$ISE_LIBRARY\library\base\base-safe.ecf"/>
<library name="encoder" location="..\..\..\library\text\encoder\encoder-safe.ecf" readonly="false"/>
<library name="css" location="..\..\library\text\css\css-safe.ecf" readonly="false"/>
<library name="wsf_html" location="..\..\..\library\server\wsf_html\wsf_html-safe.ecf" readonly="false"/>
<library name="http" location="..\..\..\library\network\protocol\http\http-safe.ecf" readonly="false"/>
<library name="openid" location="..\..\..\library\security\openid\consumer\openid-safe.ecf" readonly="false"/>
<library name="process" location="$ISE_LIBRARY\library\process\process-safe.ecf"/>

View File

@@ -15,7 +15,7 @@
<library name="base" location="$ISE_LIBRARY\library\base\base.ecf"/>
<library name="encoder" location="..\..\..\library\text\encoder\encoder.ecf" readonly="false"/>
<library name="css" location="..\..\library\text\css\css.ecf" readonly="false"/>
<library name="wsf_html" location="..\..\..\library\server\wsf_html\wsf_html.ecf" readonly="false"/>
<library name="http" location="..\..\..\library\network\protocol\http\http.ecf" readonly="false"/>
<library name="openid" location="..\..\..\library\security\openid\consumer\openid.ecf" />
<library name="process" location="$ISE_LIBRARY\library\process\process.ecf"/>

View File

@@ -16,6 +16,7 @@
<library name="http" location="..\..\..\..\library\network\protocol\http\http-safe.ecf" readonly="false"/>
<library name="nino" location="..\..\..\..\library\server\ewsgi\connectors\nino\nino-safe.ecf"/>
<library name="time" location="$ISE_LIBRARY\library\time\time-safe.ecf"/>
<library name="wsf_html" location="..\..\..\..\library\server\wsf_html\wsf_html-safe.ecf" readonly="false"/>
<library name="wsf" location="..\..\..\..\library\server\wsf\wsf-safe.ecf" readonly="false"/>
<cluster name="src" location=".\src\" recursive="true"/>
</target>

View File

@@ -35,9 +35,9 @@ feature -- Execution
set_main_content (s)
end
new_table: CMS_WIDGET_AGENT_TABLE [READABLE_STRING_8]
new_table: WSF_WIDGET_AGENT_TABLE [READABLE_STRING_8]
local
l_table: CMS_WIDGET_AGENT_TABLE [READABLE_STRING_8]
l_table: WSF_WIDGET_AGENT_TABLE [READABLE_STRING_8]
do
create l_table.make
l_table.add_css_style ("width: 85%%; border: solid 1px #999; padding: 2px;")
@@ -53,10 +53,10 @@ feature -- Execution
l_table.set_data (<<"foo", "bar", "foobar">>)
l_table.set_foot_data (<<"abc", "def">>)
l_table.set_compute_item_function (agent (d: READABLE_STRING_8): CMS_WIDGET_TABLE_ROW
l_table.set_compute_item_function (agent (d: READABLE_STRING_8): WSF_WIDGET_TABLE_ROW
local
i: INTEGER
w: CMS_WIDGET_TABLE_ITEM
w: WSF_WIDGET_TABLE_ITEM
do
create Result.make (d.count)
if d.is_case_insensitive_equal ("bar") then

View File

@@ -264,7 +264,7 @@ feature -- Message
add_message (a_msg, "success")
end
report_form_errors (fd: CMS_FORM_DATA)
report_form_errors (fd: WSF_FORM_DATA)
require
has_error: not fd.is_valid
do

View File

@@ -203,7 +203,7 @@ feature -- Hook: form_alter
form_alter_hooks: detachable ARRAYED_LIST [CMS_HOOK_FORM_ALTER]
call_form_alter_hooks (f: CMS_FORM; a_form_data: detachable CMS_FORM_DATA; a_execution: CMS_EXECUTION)
call_form_alter_hooks (f: CMS_FORM; a_form_data: detachable WSF_FORM_DATA; a_execution: CMS_EXECUTION)
do
if attached form_alter_hooks as lst then
across
@@ -438,11 +438,12 @@ feature -- Core Execution
-- Default request handler if no other are relevant
local
e: CMS_EXECUTION
sess: WSF_ROUTER_SESSION
do
initialize_urls (req)
if attached router.dispatch_and_return_handler (req, res) as p then
-- ok
else
create sess
router.dispatch (req, res, sess)
if not sess.dispatched then
create {NOT_FOUND_CMS_EXECUTION} e.make (req, res, Current)
e.execute
end

View File

@@ -0,0 +1,43 @@
note
description: "Summary description for {CMS_FORM}."
author: ""
date: "$Date$"
revision: "$Revision$"
class
CMS_FORM
inherit
WSF_FORM
rename
process as process_form
end
create
make
feature -- Basic operation
prepare (a_execution: CMS_EXECUTION)
do
a_execution.service.call_form_alter_hooks (Current, Void, a_execution)
end
process (a_execution: CMS_EXECUTION)
do
process_form (a_execution.request, agent on_prepared (a_execution, ?), agent on_processed (a_execution, ?))
end
on_prepared (a_execution: CMS_EXECUTION; fd: WSF_FORM_DATA)
do
a_execution.service.call_form_alter_hooks (Current, fd, a_execution)
end
on_processed (a_execution: CMS_EXECUTION; fd: WSF_FORM_DATA)
do
if not fd.is_valid or fd.has_error then
a_execution.report_form_errors (fd)
end
end
end

View File

@@ -12,7 +12,7 @@ inherit
feature -- Hook
form_alter (a_form: CMS_FORM; a_form_data: detachable CMS_FORM_DATA; a_execution: CMS_EXECUTION)
form_alter (a_form: CMS_FORM; a_form_data: detachable WSF_FORM_DATA; a_execution: CMS_EXECUTION)
deferred
end

View File

@@ -8,7 +8,7 @@ class
CMS_API_OPTIONS
inherit
TABLE_ITERABLE [detachable ANY, STRING]
WSF_API_OPTIONS
create
make,
@@ -22,77 +22,5 @@ convert
feature {NONE} -- Initialization
make (n: INTEGER)
do
create table.make (n)
end
make_from_manifest (lst: ARRAY [TUPLE [key: STRING; value: detachable ANY]])
do
make (lst.count)
across
lst as c
loop
force (c.item.value, c.item.key)
end
end
feature -- Access
item (k: STRING): detachable ANY
do
Result := table.item (k)
end
force (v: detachable ANY; k: STRING)
do
table.force (v, k)
end
boolean_item (k: STRING; dft: BOOLEAN): BOOLEAN
do
if attached {BOOLEAN} item (k) as b then
Result := b
else
Result := dft
end
end
string_general_item (k: STRING): detachable READABLE_STRING_GENERAL
do
if attached {READABLE_STRING_GENERAL} item (k) as s then
Result := s
end
end
string_item, string_8_item (k: STRING): detachable READABLE_STRING_8
do
if attached {READABLE_STRING_8} item (k) as s then
Result := s
end
end
table: HASH_TABLE [detachable ANY, STRING]
feature -- Change
import (a_opts: CMS_API_OPTIONS)
do
across
a_opts as c
loop
force (c.item, c.key)
end
end
feature -- Access
new_cursor: TABLE_ITERATION_CURSOR [detachable ANY, STRING]
-- Fresh cursor associated with current structure
do
Result := table.new_cursor
end
invariant
end

View File

@@ -7,104 +7,28 @@ note
deferred class
CMS_COMMON_API
inherit
WSF_API_UTILITIES
feature {NONE} -- Access
service: CMS_SERVICE
deferred
end
site_url: READABLE_STRING_8
do
Result := service.site_url
end
base_url: detachable READABLE_STRING_8
-- Base url if any.
do
Result := service.script_url
end
based_path (p: STRING): STRING
-- Path `p' in the context of the `base_url'
do
if attached base_url as l_base_url then
create Result.make_from_string (l_base_url)
if p.is_empty then
else
if p[1] = '/' then
Result.append (p.substring (2, p.count))
else
Result.append (p)
end
end
else
Result := p
end
end
feature -- Access
url_encoded (s: detachable READABLE_STRING_GENERAL): STRING_8
local
enc: URL_ENCODER
do
create enc
if s /= Void then
Result := enc.general_encoded_string (s)
else
create Result.make_empty
end
end
html_encoded (s: detachable READABLE_STRING_GENERAL): STRING_8
local
enc: HTML_ENCODER
do
create enc
if s /= Void then
Result := enc.general_encoded_string (s)
else
create Result.make_empty
end
end
link (a_text: detachable READABLE_STRING_GENERAL; a_path: STRING; opts: detachable CMS_API_OPTIONS): STRING
local
l_html: BOOLEAN
t: READABLE_STRING_GENERAL
do
l_html := True
if opts /= Void then
l_html := opts.boolean_item ("html", l_html)
end
Result := "<a href=%"" + checked_url (url (a_path, opts)) + "%">"
if a_text = Void then
t := a_path
else
t := a_text
end
if l_html then
Result.append (html_encoded (t))
else
Result.append (checked_plain (t))
end
Result.append ("</a>")
end
link_with_raw_text (a_text: detachable READABLE_STRING_8; a_path: STRING; opts: detachable CMS_API_OPTIONS): STRING
local
l_html: BOOLEAN
t: READABLE_STRING_8
do
l_html := True
if opts /= Void then
l_html := opts.boolean_item ("html", l_html)
end
Result := "<a href=%"" + checked_url (url (a_path, opts)) + "%">"
if a_text = Void then
t := a_path
else
t := a_text
end
Result.append (t)
Result.append ("</a>")
end
user_link (u: CMS_USER): like link
do
Result := link (u.name, "/user/" + u.id.out, Void)
@@ -125,91 +49,6 @@ feature -- Access
Result := url ("/node/" + n.id.out, Void)
end
absolute_url (a_path: STRING; opts: detachable CMS_API_OPTIONS): STRING
local
l_opts: detachable CMS_API_OPTIONS
do
l_opts := opts
if l_opts = Void then
create l_opts.make (1)
end
l_opts.force (True, "absolute")
Result := url (a_path, l_opts)
end
url (a_path: STRING; opts: detachable CMS_API_OPTIONS): STRING
local
q,f: detachable STRING_8
l_abs: BOOLEAN
do
l_abs := False
if opts /= Void then
l_abs := opts.boolean_item ("absolute", l_abs)
if attached opts.item ("query") as l_query then
if attached {READABLE_STRING_8} l_query as s_value then
q := s_value
elseif attached {ITERABLE [TUPLE [key, value: READABLE_STRING_GENERAL]]} l_query as lst then
create q.make_empty
across
lst as c
loop
if q.is_empty then
else
q.append_character ('&')
end
q.append (url_encoded (c.item.key))
q.append_character ('=')
q.append (url_encoded (c.item.value))
end
end
end
if attached opts.string_item ("fragment") as s_frag then
f := s_frag
end
end
if l_abs then
if a_path.substring_index ("://", 1) = 0 then
create Result.make_from_string (service.site_url)
if a_path.is_empty then
elseif Result.ends_with ("/") then
if a_path[1] = '/' then
Result.append_string (a_path.substring (2, a_path.count))
else
Result.append_string (a_path)
end
else
if a_path[1] = '/' then
Result.append_string (a_path)
else
Result.append_character ('/')
Result.append_string (a_path)
end
end
else
Result := a_path
end
else
Result := based_path (a_path)
end
if q /= Void then
Result.append ("?" + q)
end
if f /= Void then
Result.append ("#" + f)
end
end
checked_url (a_url: STRING): STRING
do
Result := a_url
end
checked_plain (a_text: READABLE_STRING_GENERAL): STRING_8
do
Result := html_encoder.general_encoded_string (a_text)
end
feature -- Helper
is_empty (s: detachable READABLE_STRING_GENERAL): BOOLEAN
@@ -255,9 +94,9 @@ feature {NONE} -- Implementation
end
end
html_encoder: HTML_ENCODER
once ("thread")
create Result
end
-- html_encoder: HTML_ENCODER
-- once ("thread")
-- create Result
-- end
end

View File

@@ -34,14 +34,14 @@ feature -- Factory
deferred
end
change_node (a_execution: CMS_EXECUTION; a_form_data: CMS_FORM_DATA; a_node: like new_node)
change_node (a_execution: CMS_EXECUTION; a_form_data: WSF_FORM_DATA; a_node: like new_node)
-- Apply data from `a_form_data' to a_node
require
a_node.has_id
deferred
end
new_node (a_execution: CMS_EXECUTION; a_form_data: CMS_FORM_DATA; a_node: detachable like new_node): CMS_NODE
new_node (a_execution: CMS_EXECUTION; a_form_data: WSF_FORM_DATA; a_node: detachable like new_node): CMS_NODE
-- New content created with `a_form_data'
deferred
ensure

View File

@@ -1,17 +0,0 @@
note
description: "Summary description for {CMS_FORM_ITEM}."
author: ""
date: "$Date$"
revision: "$Revision$"
deferred class
CMS_FORM_ITEM
inherit
CMS_WIDGET
WITH_CSS_CLASS
WITH_CSS_STYLE
end

View File

@@ -7,147 +7,11 @@ note
class
CMS_PAGER
inherit
WSF_WIDGET_PAGER
create
make
feature {NONE} -- Initialization
make (tpl: READABLE_STRING_8; a_lower, a_upper: NATURAL_64; a_step: NATURAL_64)
do
create template.make (tpl)
lower := a_lower
upper := a_upper
step := a_step
end
feature -- Change
set_active_range (a_lower, a_upper: NATURAL_64)
do
if a_upper = 0 then
active_range := [{NATURAL_64} 1, {NATURAL_64} 0]
elseif a_lower > 0 and a_lower <= a_upper then
active_range := [a_lower, a_upper]
else
active_range := Void
end
ensure
valid_range: attached active_range as rg implies (rg.upper = 0 or else rg.lower <= rg.upper)
end
feature -- Access
template: URI_TEMPLATE
lower: NATURAL_64
upper: NATURAL_64
step: NATURAL_64
active_range: detachable TUPLE [lower_index, upper_index: NATURAL_64]
feature -- Conversion
to_html (a_theme: CMS_THEME): STRING_8
local
l_step: INTEGER
nb: INTEGER
curr: INTEGER
n, i: INTEGER
tb: HASH_TABLE [detachable ANY, STRING_8]
do
create Result.make (32)
Result.append ("<div")
Result.append_character ('>')
nb := ((upper - lower) // step).to_integer_32 + 1
if nb > 1 then
if attached active_range as rg then
if rg.upper_index = 0 then
-- all
else
curr := ((rg.lower_index - lower) // step).to_integer_32
if step * curr.to_natural_64 < rg.lower_index then
curr := curr + 1
end
end
end
l_step := step.to_integer_32
create tb.make (2)
tb.force (1, "lower")
tb.force (step, "upper")
if curr > 1 then
if curr > 2 then
tb.force (1, "lower")
tb.force (l_step, "upper")
Result.append_character (' ')
Result.append (a_theme.link ("<<", template.expanded_string (tb), Void))
Result.append_character (' ')
end
tb.force ((curr - 1) * l_step + 1, "lower")
tb.force ((curr ) * l_step , "upper")
Result.append_character (' ')
Result.append (a_theme.link ("<", template.expanded_string (tb), Void))
Result.append_character (' ')
end
from
i := (curr - 1).max (1)
n := 5
until
n = 0 or i > nb
loop
Result.append_character (' ')
tb.force ((i - 1) * l_step + 1, "lower")
tb.force ((i ) * l_step , "upper")
if i = curr then
Result.append ("<strong>")
end
Result.append (a_theme.link (i.out, template.expanded_string (tb), Void))
if i = curr then
Result.append ("</strong>")
end
Result.append_character (' ')
i := i + 1
n := n - 1
end
if curr < nb then
Result.append_character (' ')
tb.force ((curr ) * l_step + 1, "lower")
tb.force ((curr + 1) * l_step , "upper")
Result.append (a_theme.link (">", template.expanded_string (tb), Void))
Result.append_character (' ')
if curr + 1 < nb then
tb.force ((nb - 1) * l_step + 1, "lower")
tb.force ( upper , "upper")
Result.append_character (' ')
Result.append (a_theme.link (">>", template.expanded_string (tb), Void))
Result.append_character (' ')
end
end
Result.append_character (' ')
tb.force (1, "lower")
tb.force (upper , "upper")
Result.append (a_theme.link ("all", template.expanded_string (tb), Void))
Result.append_character (' ')
end
Result.append ("</div>")
debug
Result.append ("curr=" + curr.out +" step=" + step.out + " nb=" + nb.out)
end
end
end

View File

@@ -91,7 +91,7 @@ feature -- Change
feature -- Conversion
to_html (a_theme: CMS_THEME): STRING_8
to_html (a_theme: WSF_THEME): STRING_8
do
Result := "<div class=%"log " + category + " " + level_name + "%" id=%"log-" + id.out + "%">"
Result.append ("<div class=%"inner%">")

View File

@@ -81,7 +81,7 @@ feature -- Execution
feature -- Forms
edit_form_submit (fd: CMS_FORM_DATA; a_roles: LIST [CMS_USER_ROLE])
edit_form_submit (fd: WSF_FORM_DATA; a_roles: LIST [CMS_USER_ROLE])
local
l_role: CMS_USER_ROLE
do
@@ -120,9 +120,9 @@ feature -- Forms
new_edit_form (a_action: READABLE_STRING_8; a_roles: LIST [CMS_USER_ROLE]; a_use_data: BOOLEAN): CMS_FORM
local
perms: ARRAYED_SET [READABLE_STRING_8]
tb: CMS_WIDGET_AGENT_TABLE [READABLE_STRING_8]
tb: WSF_WIDGET_AGENT_TABLE [READABLE_STRING_8]
i: INTEGER
tf: CMS_FORM_TEXT_INPUT
tf: WSF_FORM_TEXT_INPUT
do
create perms.make (10)
perms.compare_objects
@@ -158,10 +158,10 @@ feature -- Forms
tb.add_css_style ("border: solid 1px #999;")
tb.set_data (perms)
tb.set_compute_item_function (agent (p: READABLE_STRING_8; ia_roles: LIST [CMS_USER_ROLE]; ia_use_data: BOOLEAN): CMS_WIDGET_TABLE_ROW
tb.set_compute_item_function (agent (p: READABLE_STRING_8; ia_roles: LIST [CMS_USER_ROLE]; ia_use_data: BOOLEAN): WSF_WIDGET_TABLE_ROW
local
it: CMS_WIDGET_TABLE_ITEM
cb: CMS_FORM_CHECKBOX_INPUT
it: WSF_WIDGET_TABLE_ITEM
cb: WSF_FORM_CHECKBOX_INPUT
do
create Result.make (1 + ia_roles.count)
create it.make_with_text (p)
@@ -188,21 +188,21 @@ feature -- Forms
create Result.make (a_action, "edit-user-roles")
Result.set_method_post
Result.extend (tb.to_computed_table)
Result.extend (create {CMS_FORM_SUBMIT_INPUT}.make_with_text ("op", "Apply"))
Result.extend (create {WSF_FORM_SUBMIT_INPUT}.make_with_text ("op", "Apply"))
create tf.make ("new-role")
tf.add_css_class ("horizontal")
tf.set_size (24)
tf.set_label ("New user role")
Result.extend (tf)
Result.extend (create {CMS_FORM_SUBMIT_INPUT}.make_with_text ("op", "Add role"))
Result.extend (create {WSF_FORM_SUBMIT_INPUT}.make_with_text ("op", "Add role"))
create tf.make ("new-permission")
tf.add_css_class ("horizontal")
tf.set_size (24)
tf.set_label ("New permission")
Result.extend (tf)
Result.extend (create {CMS_FORM_SUBMIT_INPUT}.make_with_text ("op", "Add permission"))
Result.extend (create {WSF_FORM_SUBMIT_INPUT}.make_with_text ("op", "Add permission"))

View File

@@ -41,11 +41,11 @@ feature -- Factory
fill_edit_form (f: CMS_FORM; a_node: detachable CMS_NODE)
local
ti: CMS_FORM_TEXT_INPUT
fset: CMS_FORM_FIELD_SET
ta: CMS_FORM_TEXTAREA
tselect: CMS_FORM_SELECT
opt: CMS_FORM_SELECT_OPTION
ti: WSF_FORM_TEXT_INPUT
fset: WSF_FORM_FIELD_SET
ta: WSF_FORM_TEXTAREA
tselect: WSF_FORM_SELECT
opt: WSF_FORM_SELECT_OPTION
do
create ti.make ("title")
ti.set_label ("Title")
@@ -96,7 +96,7 @@ feature -- Factory
end
change_node (a_execution: CMS_EXECUTION; fd: CMS_FORM_DATA; a_node: like new_node)
change_node (a_execution: CMS_EXECUTION; fd: WSF_FORM_DATA; a_node: like new_node)
local
b: detachable READABLE_STRING_8
f: detachable CMS_FORMAT
@@ -123,7 +123,7 @@ feature -- Factory
end
end
new_node (a_execution: CMS_EXECUTION; fd: CMS_FORM_DATA; a_node: detachable like new_node): CMS_PAGE
new_node (a_execution: CMS_EXECUTION; fd: WSF_FORM_DATA; a_node: detachable like new_node): CMS_PAGE
-- <Precursor>
local
b: detachable READABLE_STRING_8

View File

@@ -18,7 +18,7 @@ feature -- Execution
local
b: STRING_8
f: like edit_form
fd: detachable CMS_FORM_DATA
fd: detachable WSF_FORM_DATA
do
create b.make_empty
if attached non_empty_string_path_parameter ("type") as s_type then

View File

@@ -12,7 +12,7 @@ inherit
feature -- Form
edit_form_validate (fd: CMS_FORM_DATA; b: STRING)
edit_form_validate (fd: WSF_FORM_DATA; b: STRING)
local
l_preview: BOOLEAN
l_format: detachable CMS_FORMAT
@@ -39,7 +39,7 @@ feature -- Form
end
end
edit_form_submit (fd: CMS_FORM_DATA; a_node: detachable CMS_NODE; a_type: CMS_CONTENT_TYPE; b: STRING)
edit_form_submit (fd: WSF_FORM_DATA; a_node: detachable CMS_NODE; a_type: CMS_CONTENT_TYPE; b: STRING)
local
l_preview: BOOLEAN
l_node: detachable CMS_NODE
@@ -77,7 +77,7 @@ feature -- Form
end
end
-- edit_form_submit (fd: CMS_FORM_DATA; a_type: CMS_CONTENT_TYPE; b: STRING)
-- edit_form_submit (fd: WSF_FORM_DATA; a_type: CMS_CONTENT_TYPE; b: STRING)
-- local
-- l_preview: BOOLEAN
-- do
@@ -110,8 +110,8 @@ feature -- Form
edit_form (a_node: detachable CMS_NODE; a_url: READABLE_STRING_8; a_name: STRING; a_type: CMS_CONTENT_TYPE): CMS_FORM
local
f: CMS_FORM
ts: CMS_FORM_SUBMIT_INPUT
th: CMS_FORM_HIDDEN_INPUT
ts: WSF_FORM_SUBMIT_INPUT
th: WSF_FORM_HIDDEN_INPUT
do
create f.make (a_url, a_name)

View File

@@ -18,7 +18,7 @@ feature -- Execution
local
b: STRING_8
f: like edit_form
fd: detachable CMS_FORM_DATA
fd: detachable WSF_FORM_DATA
do
create b.make_empty
if

View File

@@ -18,8 +18,8 @@ feature -- Execution
local
b: STRING
f: CMS_FORM
tf: CMS_FORM_TEXT_INPUT
ts: CMS_FORM_SUBMIT_INPUT
tf: WSF_FORM_TEXT_INPUT
ts: WSF_FORM_SUBMIT_INPUT
o: OPENID_CONSUMER
v: OPENID_CONSUMER_VALIDATION
tb: HASH_TABLE [READABLE_STRING_8, STRING_8]

View File

@@ -60,10 +60,10 @@ feature -- Hooks
end
end
form_alter (a_form: CMS_FORM; a_form_data: detachable CMS_FORM_DATA; a_execution: CMS_EXECUTION)
form_alter (a_form: CMS_FORM; a_form_data: detachable WSF_FORM_DATA; a_execution: CMS_EXECUTION)
local
i: CMS_FORM_DIV
fh: CMS_FORM_HIDDEN_INPUT
i: WSF_FORM_DIV
fh: WSF_FORM_HIDDEN_INPUT
do
if a_form.id.same_string ("openid-login") then
create i.make_with_text_and_css_id (
@@ -82,7 +82,7 @@ feature -- Hooks
,
"openid"
)
if attached a_form.items_by_type ({CMS_WIDGET_TEXT}) as lst and then not lst.is_empty then
if attached a_form.items_by_type ({WSF_WIDGET_TEXT}) as lst and then not lst.is_empty then
a_form.insert_before (i, lst.last)
else
a_form.extend (i)
@@ -98,7 +98,7 @@ feature -- Hooks
across
f_lst as c
loop
if attached {CMS_FORM_TEXT_INPUT} c.item as txt then
if attached {WSF_FORM_TEXT_INPUT} c.item as txt then
txt.set_text_value (l_openid_nickname.to_string_32)
end
end
@@ -110,7 +110,7 @@ feature -- Hooks
across
f_lst as c
loop
if attached {CMS_FORM_TEXT_INPUT} c.item as txt then
if attached {WSF_FORM_TEXT_INPUT} c.item as txt then
txt.set_text_value (l_openid_email.to_string_32)
end
end
@@ -122,7 +122,7 @@ feature -- Hooks
end
end
openid_user_register_submitted (a_form_data: CMS_FORM_DATA)
openid_user_register_submitted (a_form_data: WSF_FORM_DATA)
do
end

View File

@@ -94,7 +94,7 @@ feature -- Execution
l_url: detachable READABLE_STRING_8
b: STRING_8
f: CMS_FORM
fd: detachable CMS_FORM_DATA
fd: detachable WSF_FORM_DATA
do
if
attached {WSF_STRING} request.item ("destination") as s_dest
@@ -134,7 +134,7 @@ feature -- Execution
end
end
on_form_submitted (fd: CMS_FORM_DATA)
on_form_submitted (fd: WSF_FORM_DATA)
local
u: detachable CMS_USER
do
@@ -159,12 +159,12 @@ feature -- Execution
login_form (a_action: READABLE_STRING_8; a_form_name: READABLE_STRING_8; a_destination: READABLE_STRING_8): CMS_FORM
local
th: CMS_FORM_HIDDEN_INPUT
ti: CMS_FORM_TEXT_INPUT
tp: CMS_FORM_PASSWORD_INPUT
ts: CMS_FORM_SUBMIT_INPUT
l_logo: CMS_FORM_RAW_TEXT
d: CMS_FORM_DIV
th: WSF_FORM_HIDDEN_INPUT
ti: WSF_FORM_TEXT_INPUT
tp: WSF_FORM_PASSWORD_INPUT
ts: WSF_FORM_SUBMIT_INPUT
l_logo: WSF_FORM_RAW_TEXT
d: WSF_FORM_DIV
do
create Result.make (a_action, a_form_name)

View File

@@ -20,7 +20,7 @@ feature -- Execution
local
b: STRING_8
f: CMS_FORM
fd: detachable CMS_FORM_DATA
fd: detachable WSF_FORM_DATA
u: detachable CMS_USER
l_is_editing_current_user: BOOLEAN
do
@@ -63,7 +63,7 @@ feature -- Execution
set_main_content (b)
end
edit_form_validate (fd: CMS_FORM_DATA; u: CMS_USER)
edit_form_validate (fd: WSF_FORM_DATA; u: CMS_USER)
local
fu: detachable CMS_USER
do
@@ -81,7 +81,7 @@ feature -- Execution
end
end
edit_form_submit (fd: CMS_FORM_DATA; u: CMS_USER; a_is_editing_current_user: BOOLEAN; b: STRING)
edit_form_submit (fd: WSF_FORM_DATA; u: CMS_USER; a_is_editing_current_user: BOOLEAN; b: STRING)
local
up: detachable CMS_USER_PROFILE
l_roles: like {CMS_USER}.roles
@@ -138,12 +138,12 @@ feature -- Execution
edit_form (u: CMS_USER; a_url: READABLE_STRING_8; a_name: STRING): CMS_FORM
local
f: CMS_FORM
ti: CMS_FORM_TEXT_INPUT
tp: CMS_FORM_PASSWORD_INPUT
ta: CMS_FORM_TEXTAREA
ts: CMS_FORM_SUBMIT_INPUT
tset: CMS_FORM_FIELD_SET
cb: CMS_FORM_CHECKBOX_INPUT
ti: WSF_FORM_TEXT_INPUT
tp: WSF_FORM_PASSWORD_INPUT
ta: WSF_FORM_TEXTAREA
ts: WSF_FORM_SUBMIT_INPUT
tset: WSF_FORM_FIELD_SET
cb: WSF_FORM_CHECKBOX_INPUT
do
create f.make (a_url, a_name)

View File

@@ -21,7 +21,7 @@ feature -- Execution
b: STRING_8
f: CMS_FORM
u: detachable CMS_USER
fd: detachable CMS_FORM_DATA
fd: detachable WSF_FORM_DATA
do
set_title ("Request new password")
create b.make_empty
@@ -56,7 +56,7 @@ feature -- Execution
set_main_content (b)
end
password_form_validate (fd: CMS_FORM_DATA)
password_form_validate (fd: WSF_FORM_DATA)
local
u: detachable CMS_USER
do
@@ -73,7 +73,7 @@ feature -- Execution
initialize_primary_tabs (u)
end
password_form_submit (fd: CMS_FORM_DATA; b: STRING)
password_form_submit (fd: WSF_FORM_DATA; b: STRING)
local
e: detachable CMS_EMAIL
l_uuid: UUID
@@ -113,9 +113,9 @@ feature -- Execution
local
u: like user
f: CMS_FORM
ti: CMS_FORM_TEXT_INPUT
th: CMS_FORM_HIDDEN_INPUT
ts: CMS_FORM_SUBMIT_INPUT
ti: WSF_FORM_TEXT_INPUT
th: WSF_FORM_HIDDEN_INPUT
ts: WSF_FORM_SUBMIT_INPUT
err: BOOLEAN
do
create f.make (a_url, a_name)

View File

@@ -20,7 +20,7 @@ feature -- Execution
local
b: STRING_8
f: CMS_FORM
fd: detachable CMS_FORM_DATA
fd: detachable WSF_FORM_DATA
do
set_title ("Create new account")
create b.make_empty
@@ -50,7 +50,7 @@ feature -- Execution
set_main_content (b)
end
registration_form_validate (fd: CMS_FORM_DATA)
registration_form_validate (fd: WSF_FORM_DATA)
local
u: detachable CMS_USER
do
@@ -68,7 +68,7 @@ feature -- Execution
end
end
registration_form_submitted (fd: CMS_FORM_DATA; buf: STRING)
registration_form_submitted (fd: WSF_FORM_DATA; buf: STRING)
local
b: STRING
u: detachable CMS_USER
@@ -124,17 +124,17 @@ feature -- Execution
registration_form (a_url: READABLE_STRING_8; a_name: STRING): CMS_FORM
local
f: CMS_FORM
ti: CMS_FORM_TEXT_INPUT
tp: CMS_FORM_PASSWORD_INPUT
ta: CMS_FORM_TEXTAREA
ts: CMS_FORM_SUBMIT_INPUT
ti: WSF_FORM_TEXT_INPUT
tp: WSF_FORM_PASSWORD_INPUT
ta: WSF_FORM_TEXTAREA
ts: WSF_FORM_SUBMIT_INPUT
do
create f.make (a_url, a_name)
create ti.make ("username")
ti.set_label ("Username")
ti.set_is_required (True)
ti.set_validation_action (agent (fd: CMS_FORM_DATA)
ti.set_validation_action (agent (fd: WSF_FORM_DATA)
do
if attached {WSF_STRING} fd.item ("username") as f_username and then f_username.value.count >= 5 then
else

View File

@@ -8,6 +8,12 @@ deferred class
CMS_THEME
inherit
WSF_THEME
undefine
url_encoded,
html_encoded
end
CMS_COMMON_API
feature {NONE} -- Access

View File

@@ -250,6 +250,85 @@ feature -- Header: merging
end
end
feature -- Status report
has, has_header_named (a_name: READABLE_STRING_8): BOOLEAN
-- Has header item for `n'?
do
Result := across headers as c some has_same_header_name (c.item, a_name) end
end
has_content_length: BOOLEAN
-- Has header "Content-Length"
do
Result := has_header_named ({HTTP_HEADER_NAMES}.header_content_length)
end
has_content_type: BOOLEAN
-- Has header "Content-Type"
do
Result := has_header_named ({HTTP_HEADER_NAMES}.header_content_type)
end
has_transfer_encoding_chunked: BOOLEAN
-- Has "Transfer-Encoding: chunked" header
do
if has_header_named ({HTTP_HEADER_NAMES}.header_transfer_encoding) then
Result := attached header_named_value ({HTTP_HEADER_NAMES}.header_transfer_encoding) as v and then v.same_string (str_chunked)
end
end
feature -- Access
header_named_value (a_name: READABLE_STRING_8): detachable STRING_8
-- First header item found for `a_name' if any
require
has_header: has_header_named (a_name)
local
c: like headers.new_cursor
n: INTEGER
l_line: READABLE_STRING_8
do
from
n := a_name.count
c := headers.new_cursor
until
c.after or Result /= Void
loop
l_line := c.item
if has_same_header_name (l_line, a_name) then
Result := l_line.substring (n + 2, l_line.count)
Result.left_adjust
Result.right_adjust
end
c.forth
end
end
feature -- Removal
remove_header_named (a_name: READABLE_STRING_8)
-- Remove any header line related to name `a_name'.
local
lst: like headers
do
from
lst := headers
lst.start
until
lst.after
loop
if has_same_header_name (lst.item, a_name) then
-- remove
lst.remove
else
lst.forth
end
end
ensure
removed: not has_header_named (a_name)
end
feature -- Header change: general
add_header (h: READABLE_STRING_8)
@@ -280,6 +359,8 @@ feature -- Header change: general
s.append (colon_space)
s.append (v)
add_header (s)
ensure
added: has_header_named (k)
end
put_header_key_value (k,v: READABLE_STRING_8)
@@ -292,6 +373,8 @@ feature -- Header change: general
s.append (colon_space)
s.append (v)
put_header (s)
ensure
added: has_header_named (k)
end
put_header_key_values (k: READABLE_STRING_8; a_values: ITERABLE [READABLE_STRING_8]; a_separator: detachable READABLE_STRING_8)
@@ -318,6 +401,8 @@ feature -- Header change: general
if not s.is_empty then
put_header_key_value (k, s)
end
ensure
added: has_header_named (k)
end
feature -- Content related header
@@ -607,6 +692,12 @@ feature -- Others
feature -- Redirection
remove_location
-- Remove any location header line.
do
remove_header_named ({HTTP_HEADER_NAMES}.header_location)
end
put_location (a_location: READABLE_STRING_8)
-- Tell the client the new location `a_location'
require
@@ -669,83 +760,18 @@ feature -- Cookie
put_cookie (key, value, date_to_rfc1123_http_date_format (expiration), path, domain, secure, http_only)
end
feature -- Status report
header_named_value (a_name: READABLE_STRING_8): detachable STRING_8
-- Has header item for `n'?
require
has_header: has_header_named (a_name)
local
c: like headers.new_cursor
n: INTEGER
l_line: READABLE_STRING_8
do
from
n := a_name.count
c := headers.new_cursor
until
c.after or Result /= Void
loop
l_line := c.item
if l_line.starts_with (a_name) then
if l_line.valid_index (n + 1) then
if l_line [n + 1] = ':' then
Result := l_line.substring (n + 2, l_line.count)
Result.left_adjust
Result.right_adjust
end
end
end
c.forth
end
end
has_header_named (a_name: READABLE_STRING_8): BOOLEAN
-- Has header item for `n'?
local
c: like headers.new_cursor
n: INTEGER
l_line: READABLE_STRING_8
do
from
n := a_name.count
c := headers.new_cursor
until
c.after or Result
loop
l_line := c.item
if l_line.starts_with (a_name) then
if l_line.valid_index (n + 1) then
Result := l_line [n + 1] = ':'
end
end
c.forth
end
end
has_content_length: BOOLEAN
-- Has header "Content-Length"
do
Result := has_header_named ({HTTP_HEADER_NAMES}.header_content_length)
end
has_content_type: BOOLEAN
-- Has header "Content-Type"
do
Result := has_header_named ({HTTP_HEADER_NAMES}.header_content_type)
end
has_transfer_encoding_chunked: BOOLEAN
-- Has "Transfer-Encoding: chunked" header
do
if has_header_named ({HTTP_HEADER_NAMES}.header_transfer_encoding) then
Result := attached header_named_value ({HTTP_HEADER_NAMES}.header_transfer_encoding) as v and then v.same_string (str_chunked)
end
end
feature {NONE} -- Implementation: Header
has_same_header_name (h: READABLE_STRING_8; a_name: READABLE_STRING_8): BOOLEAN
-- Header line `h' has same name as `a_name' ?
do
if h.starts_with (a_name) then
if h.valid_index (a_name.count + 1) then
Result := h[a_name.count + 1] = ':'
end
end
end
force_header_by_name (n: detachable READABLE_STRING_8; h: READABLE_STRING_8)
-- Add header `h' or replace existing header of same header name `n'
require

View File

@@ -54,7 +54,7 @@ feature -- Input
do
src := source
last_string.wipe_out
if src.socket_ok then
if src.readable then
src.read_stream_thread_aware (nb)
last_string.append_string (src.last_string)
end

View File

@@ -11,10 +11,10 @@ feature {WGI_CONNECTOR, WGI_SERVICE} -- Commit
push
-- Commit and push response
do
commit
if attached post_commit_action as act then
act.call (Void)
end
commit
end
commit
@@ -22,6 +22,7 @@ feature {WGI_CONNECTOR, WGI_SERVICE} -- Commit
deferred
ensure
status_is_set: status_is_set
status_committed: status_committed
header_committed: header_committed
message_committed: message_committed
end

View File

@@ -14,7 +14,7 @@ feature {NONE} -- Initialization
make (m: like mapping)
do
mapping := m
create {STRING_32} description.make_empty
create descriptions.make (0)
end
feature -- Status report
@@ -27,7 +27,7 @@ feature -- Status report
-- Is Current empty?
-- i.e: does not carry any information.
do
Result := description.is_empty
Result := descriptions.is_empty
end
feature -- Access
@@ -35,7 +35,18 @@ feature -- Access
mapping: WSF_ROUTER_MAPPING
-- Associated mapping
descriptions: ARRAYED_LIST [READABLE_STRING_GENERAL]
description: STRING_32
do
create Result.make_empty
across
descriptions as c
loop
Result.append_string_general (c.item)
Result.append ("%N")
end
end
feature -- Change
@@ -46,7 +57,17 @@ feature -- Change
add_description (d: READABLE_STRING_GENERAL)
do
description.append_string_general (d)
descriptions.force (d)
end
note
copyright: "2011-2013, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
source: "[
Eiffel Software
5949 Hollister Ave., Goleta, CA 93117 USA
Telephone 805-685-1006, Fax 805-685-6869
Website http://www.eiffel.com
Customer support http://support.eiffel.com
]"
end

View File

@@ -204,6 +204,7 @@ feature {WSF_RESPONSE} -- Output
l_url: detachable STRING_8
l_base_url: detachable READABLE_STRING_8
l_doc: detachable WSF_ROUTER_MAPPING_DOCUMENTATION
l_first: BOOLEAN
do
if attached {WSF_SELF_DOCUMENTED_ROUTER_MAPPING} m as l_doc_mapping then
l_doc := l_doc_mapping.documentation (meths)
@@ -256,7 +257,17 @@ feature {WSF_RESPONSE} -- Output
if l_doc /= Void and then not l_doc.is_empty then
s.append ("%N<ul class=%"handlerdoc%">")
s.append (html_encoder.encoded_string (l_doc.description))
l_first := True
across
l_doc.descriptions as c
loop
if not l_first then
s.append ("<br/>")
else
l_first := False
end
s.append (html_encoder.general_encoded_string (c.item))
end
s.append ("%N</ul>%N")
else
debug

View File

@@ -0,0 +1,44 @@
note
description: "Summary description for {WSF_STARTS_WITH_AGENT_HANDLER}."
author: ""
date: "$Date$"
revision: "$Revision$"
class
WSF_STARTS_WITH_AGENT_HANDLER
inherit
WSF_STARTS_WITH_HANDLER
create
make
feature {NONE} -- Initialization
make (a_action: like action)
do
action := a_action
end
feature -- Access
action: PROCEDURE [ANY, TUPLE [start_path: READABLE_STRING_8; request: WSF_REQUEST; response: WSF_RESPONSE]]
feature -- Execution
execute (a_start_path: READABLE_STRING_8; req: WSF_REQUEST; res: WSF_RESPONSE)
do
action.call ([a_start_path, req, res])
end
note
copyright: "2011-2013, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
source: "[
Eiffel Software
5949 Hollister Ave., Goleta, CA 93117 USA
Telephone 805-685-1006, Fax 805-685-6869
Website http://www.eiffel.com
Customer support http://support.eiffel.com
]"
end

View File

@@ -13,8 +13,11 @@ inherit
execute as execute_starts_with
end
WSF_SELF_DOCUMENTED_HANDLER
create
make
make,
make_hidden
feature {NONE} -- Initialization
@@ -34,6 +37,29 @@ feature {NONE} -- Initialization
not document_root.is_empty and then not document_root.ends_with (operating_environment.directory_separator.out)
end
make_hidden (d: like document_root)
require
valid_d: (d /= Void and then not d.is_empty) implies not d.ends_with (operating_environment.directory_separator.out)
do
make (d)
is_hidden := True
ensure
hidden: is_hidden
end
is_hidden: BOOLEAN
-- Current mapped handler should be hidden from self documentation
feature -- Documentation
mapping_documentation (m: WSF_ROUTER_MAPPING; a_request_methods: detachable WSF_REQUEST_METHODS): WSF_ROUTER_MAPPING_DOCUMENTATION
-- <Precursor>
do
create Result.make (m)
Result.set_is_hidden (is_hidden)
Result.add_description ("File service")
end
feature -- Access
document_root: STRING

View File

@@ -14,7 +14,8 @@ inherit
put_string,
put_substring,
flush,
message_writable
message_writable,
message_committed
end
WSF_RESPONSE_EXPORTER
@@ -36,10 +37,10 @@ feature {NONE} -- Implementation
commit
do
Precursor
if not header_committed then
process_header
end
Precursor
end
process_header
@@ -65,6 +66,12 @@ feature -- Status report
message_writable: BOOLEAN = True
-- Can message be written?
message_committed: BOOLEAN
-- <Precursor>
do
Result := header_committed
end
feature -- Output operation
put_character (c: CHARACTER_8)

View File

@@ -26,7 +26,7 @@ feature {NONE} -- Initialization
url_location := a_url_location
delay := a_delay_in_seconds
make_html
set_status_code ({HTTP_STATUS_CODE}.found)
status_code := {HTTP_STATUS_CODE}.found
end
feature -- Header
@@ -65,7 +65,7 @@ feature {NONE} -- Output
end
note
copyright: "2011-2012, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others"
copyright: "2011-2013, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
source: "[
Eiffel Software

View File

@@ -197,7 +197,7 @@ feature {NONE} -- HTML Generation
end
note
copyright: "2011-2012, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others"
copyright: "2011-2013, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
source: "[
Eiffel Software

View File

@@ -18,7 +18,7 @@ feature {NONE} -- Initialization
make (a_url_location: like url_location)
do
status_code := {HTTP_STATUS_CODE}.ok
status_code := {HTTP_STATUS_CODE}.found
url_location := a_url_location
create header.make
end
@@ -100,7 +100,7 @@ feature {WSF_RESPONSE} -- Output
end
note
copyright: "2011-2012, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others"
copyright: "2011-2013, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
source: "[
Eiffel Software

View File

@@ -252,23 +252,23 @@ feature -- Header output operation: helpers
message_writable: message_writable
end
put_header_lines (a_lines: ITERABLE [TUPLE [name: READABLE_STRING_8; value: READABLE_STRING_8]])
put_header_lines (a_lines: ITERABLE [READABLE_STRING_8])
-- Put headers from `a_lines'
require
header_not_committed: not header_committed
do
across a_lines as c loop
put_header_line (c.item.name + ": " + c.item.value)
put_header_line (c.item)
end
end
add_header_lines (a_lines: ITERABLE [TUPLE [name: READABLE_STRING_8; value: READABLE_STRING_8]])
add_header_lines (a_lines: ITERABLE [READABLE_STRING_8])
-- Add headers from `a_lines'
require
header_not_committed: not header_committed
do
across a_lines as c loop
add_header_line (c.item.name + ": " + c.item.value)
add_header_line (c.item)
end
end
@@ -409,8 +409,7 @@ feature -- Response object
do
a_message.send_to (Current)
ensure
status_committed: status_committed
header_committed: header_committed
status_committed: status_is_set
end
feature -- Redirect

View File

@@ -26,11 +26,10 @@ feature {WSF_RESPONSE} -- Output
deferred
ensure
res_status_set: res.status_is_set
res_header_committed: res.header_committed
end
note
copyright: "2011-2012, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others"
copyright: "2011-2013, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
source: "[
Eiffel Software

View File

@@ -1,25 +0,0 @@
<?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="wsf" uuid="A37CE5AA-4D2A-4441-BC6A-0A1D7EC49647" library_target="wsf">
<target name="wsf">
<root all_classes="true"/>
<file_rule>
<exclude>/.git$</exclude>
<exclude>/EIFGENs$</exclude>
<exclude>/.svn$</exclude>
</file_rule>
<option warning="true" full_class_checking="true" is_attached_by_default="true" void_safety="all" syntax="provisional">
</option>
<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="time" location="$ISE_LIBRARY\library\time\time-safe.ecf"/>
<library name="error" location="../../utility/general/error/error-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="encoder"
location="..\..\text\encoder\encoder-safe.ecf"/>
<library name="uri" location="$ISE_LIBRARY\library\text\uri\uri-safe.ecf" readonly="true"/>
<cluster name="src" location=".\src" recursive="true"/>
<cluster name="router" location=".\router" recursive="true"/>
</target>
</system>

View File

@@ -0,0 +1,98 @@
note
description: "Summary description for {WSF_API_OPTIONS}."
author: ""
date: "$Date$"
revision: "$Revision$"
class
WSF_API_OPTIONS
inherit
TABLE_ITERABLE [detachable ANY, STRING]
create
make,
make_from_manifest
convert
make_from_manifest ({ ARRAY [TUPLE [key: STRING; value: detachable ANY]],
ARRAY [TUPLE [STRING_8, ARRAY [TUPLE [STRING_8, STRING_32]]]],
ARRAY [TUPLE [STRING_8, ARRAY [TUPLE [STRING_8, STRING_8]]]]
})
feature {NONE} -- Initialization
make (n: INTEGER)
do
create table.make (n)
end
make_from_manifest (lst: ARRAY [TUPLE [key: STRING; value: detachable ANY]])
do
make (lst.count)
across
lst as c
loop
force (c.item.value, c.item.key)
end
end
feature -- Access
item (k: STRING): detachable ANY
do
Result := table.item (k)
end
force (v: detachable ANY; k: STRING)
do
table.force (v, k)
end
boolean_item (k: STRING; dft: BOOLEAN): BOOLEAN
do
if attached {BOOLEAN} item (k) as b then
Result := b
else
Result := dft
end
end
string_general_item (k: STRING): detachable READABLE_STRING_GENERAL
do
if attached {READABLE_STRING_GENERAL} item (k) as s then
Result := s
end
end
string_item, string_8_item (k: STRING): detachable READABLE_STRING_8
do
if attached {READABLE_STRING_8} item (k) as s then
Result := s
end
end
table: HASH_TABLE [detachable ANY, STRING]
feature -- Change
import (a_opts: WSF_API_OPTIONS)
do
across
a_opts as c
loop
force (c.item, c.key)
end
end
feature -- Access
new_cursor: TABLE_ITERATION_CURSOR [detachable ANY, STRING]
-- Fresh cursor associated with current structure
do
Result := table.new_cursor
end
invariant
end

View File

@@ -0,0 +1,208 @@
note
description: "Summary description for {WSF_API_UTILITIES}."
author: ""
date: "$Date$"
revision: "$Revision$"
deferred class
WSF_API_UTILITIES
feature -- Core
site_url: READABLE_STRING_8
deferred
end
base_url: detachable READABLE_STRING_8
-- Base url if any.
deferred
end
based_path (p: STRING): STRING
-- Path `p' in the context of the `base_url'
do
if attached base_url as l_base_url then
create Result.make_from_string (l_base_url)
if p.is_empty then
else
if p[1] = '/' then
Result.append (p.substring (2, p.count))
else
Result.append (p)
end
end
else
Result := p
end
end
feature -- Conversion
link (a_text: detachable READABLE_STRING_GENERAL; a_path: READABLE_STRING_8; opts: detachable WSF_API_OPTIONS): STRING
do
create Result.make (32)
append_link_to_html (a_text, a_path, opts, Result)
end
link_with_raw_text (a_raw_text: detachable READABLE_STRING_8; a_path: READABLE_STRING_8; opts: detachable WSF_API_OPTIONS): STRING
do
create Result.make (32)
append_link_with_raw_text_to_html (a_raw_text, a_path, opts, Result)
end
append_link_to_html (a_text: detachable READABLE_STRING_GENERAL; a_path: READABLE_STRING_8; opts: detachable WSF_API_OPTIONS; a_html: STRING_8)
local
l_html: BOOLEAN
t: READABLE_STRING_GENERAL
do
l_html := True
if opts /= Void then
l_html := opts.boolean_item ("html", l_html)
end
a_html.append ("<a href=%"" + checked_url (url (a_path, opts)) + "%">")
if a_text = Void then
t := a_path
else
t := a_text
end
if l_html then
a_html.append (html_encoded (t))
else
a_html.append (checked_plain (t))
end
a_html.append ("</a>")
end
append_link_with_raw_text_to_html (a_raw_text: detachable READABLE_STRING_8; a_path: READABLE_STRING_8; opts: detachable WSF_API_OPTIONS; a_html: STRING_8)
local
l_html: BOOLEAN
t: READABLE_STRING_8
do
l_html := True
if opts /= Void then
l_html := opts.boolean_item ("html", l_html)
end
a_html.append ("<a href=%"" + checked_url (url (a_path, opts)) + "%">")
if a_raw_text = Void then
t := a_path
else
t := a_raw_text
end
a_html.append (t)
a_html.append ("</a>")
end
absolute_url (a_path: STRING; opts: detachable WSF_API_OPTIONS): STRING
local
l_opts: detachable WSF_API_OPTIONS
do
l_opts := opts
if l_opts = Void then
create l_opts.make (1)
end
l_opts.force (True, "absolute")
Result := url (a_path, l_opts)
end
url (a_path: READABLE_STRING_8; opts: detachable WSF_API_OPTIONS): STRING
local
q,f: detachable STRING_8
l_abs: BOOLEAN
do
l_abs := False
if opts /= Void then
l_abs := opts.boolean_item ("absolute", l_abs)
if attached opts.item ("query") as l_query then
if attached {READABLE_STRING_8} l_query as s_value then
q := s_value
elseif attached {ITERABLE [TUPLE [key, value: READABLE_STRING_GENERAL]]} l_query as lst then
create q.make_empty
across
lst as c
loop
if q.is_empty then
else
q.append_character ('&')
end
q.append (url_encoded (c.item.key))
q.append_character ('=')
q.append (url_encoded (c.item.value))
end
end
end
if attached opts.string_item ("fragment") as s_frag then
f := s_frag
end
end
if l_abs then
if a_path.substring_index ("://", 1) = 0 then
create Result.make_from_string (site_url)
if a_path.is_empty then
elseif Result.ends_with ("/") then
if a_path[1] = '/' then
Result.append_string (a_path.substring (2, a_path.count))
else
Result.append_string (a_path)
end
else
if a_path[1] = '/' then
Result.append_string (a_path)
else
Result.append_character ('/')
Result.append_string (a_path)
end
end
else
Result := a_path
end
else
Result := based_path (a_path)
end
if q /= Void then
Result.append ("?" + q)
end
if f /= Void then
Result.append ("#" + f)
end
end
checked_url (a_url: READABLE_STRING_8): READABLE_STRING_8
do
Result := a_url
end
checked_plain (a_text: READABLE_STRING_GENERAL): STRING_8
do
Result := html_encoded (a_text)
end
feature -- Encoding
url_encoded (s: detachable READABLE_STRING_GENERAL): STRING_8
local
enc: URL_ENCODER
do
create enc
if s /= Void then
Result := enc.general_encoded_string (s)
else
create Result.make_empty
end
end
html_encoded (s: detachable READABLE_STRING_GENERAL): STRING_8
local
enc: HTML_ENCODER
do
create enc
if s /= Void then
Result := enc.general_encoded_string (s)
else
create Result.make_empty
end
end
end

View File

@@ -0,0 +1,40 @@
note
description: "[
WF_THEME associated with a request
]"
date: "$Date$"
revision: "$Revision$"
class
WSF_REQUEST_THEME
inherit
WSF_THEME
create
make_with_request
feature {NONE} -- Initialization
make_with_request (req: WSF_REQUEST)
do
request := req
end
request: WSF_REQUEST
-- Associated request
feature -- Core
site_url: READABLE_STRING_8
do
Result := request.absolute_script_url ("")
end
base_url: detachable READABLE_STRING_8
-- Base url if any.
do
Result := request.script_url ("")
end
end

View File

@@ -0,0 +1,14 @@
note
description: "Summary description for {WSF_THEME}."
author: ""
date: "$Date$"
revision: "$Revision$"
deferred class
WSF_THEME
inherit
WSF_API_UTILITIES
end

View File

@@ -0,0 +1,25 @@
note
description: "Summary description for {WSF_URL_API_OPTIONS}."
author: ""
date: "$Date$"
revision: "$Revision$"
class
WSF_URL_API_OPTIONS
inherit
WSF_API_OPTIONS
create
make,
make_absolute
feature {NONE} -- Initialization
make_absolute
do
make (1)
force (True, "absolute")
end
end

View File

@@ -1,14 +1,16 @@
note
description: "Summary description for {CMS_FORM}."
description: "Summary description for {WSF_FORM}."
author: ""
date: "$Date$"
revision: "$Revision$"
class
CMS_FORM
WSF_FORM
inherit
CMS_FORM_COMPOSITE
WSF_FORM_COMPOSITE
WSF_WITH_HTML_ATTRIBUTE
create
make
@@ -48,41 +50,42 @@ feature -- Access
-- Form's method
--| GET or POST
encoding_type: detachable READABLE_STRING_8
-- Encoding type
feature -- Basic operation
prepare (a_execution: CMS_EXECUTION)
do
a_execution.service.call_form_alter_hooks (Current, Void, a_execution)
end
process (a_execution: CMS_EXECUTION)
process (req: WSF_REQUEST; a_before_callback, a_after_callback: detachable PROCEDURE [ANY, TUPLE [WSF_FORM_DATA]])
-- Process Current form with request `req'
-- agent `a_before_callback' is called before the validation
-- agent `a_after_callback' is called after the validation
local
fd: CMS_FORM_DATA
fd: WSF_FORM_DATA
do
create fd.make (a_execution.request, Current)
create fd.make (req, Current)
last_data := fd
a_execution.service.call_form_alter_hooks (Current, fd, a_execution)
if a_before_callback /= Void then
a_before_callback.call ([fd])
end
fd.validate
fd.apply_to_associated_form -- Maybe only when has error?
if fd.is_valid then
fd.submit
if fd.has_error then
a_execution.report_form_errors (fd)
end
else
a_execution.report_form_errors (fd)
if a_after_callback /= Void then
a_after_callback.call ([fd])
end
end
last_data: detachable CMS_FORM_DATA
last_data: detachable WSF_FORM_DATA
feature -- Validation
validation_actions: ACTION_SEQUENCE [TUPLE [CMS_FORM_DATA]]
validation_actions: ACTION_SEQUENCE [TUPLE [WSF_FORM_DATA]]
-- Procedure to validate the data
-- report error if not valid
submit_actions: ACTION_SEQUENCE [TUPLE [CMS_FORM_DATA]]
submit_actions: ACTION_SEQUENCE [TUPLE [WSF_FORM_DATA]]
-- Submit actions
feature -- Element change
@@ -97,17 +100,30 @@ feature -- Element change
method := "POST"
end
set_encoding_type (s: like encoding_type)
do
encoding_type := s
end
set_multipart_form_data_encoding_type
do
encoding_type := "multipart/form-data"
end
feature -- Optional
html_classes: ARRAYED_LIST [STRING_8]
feature -- Conversion
append_to_html (a_theme: CMS_THEME; a_html: STRING_8)
append_to_html (a_theme: WSF_THEME; a_html: STRING_8)
local
s: STRING_8
do
a_html.append ("<form action=%""+ action +"%" id=%""+ id +"%" method=%""+ method +"%" ")
a_html.append ("<form action=%""+ action +"%" id=%""+ id +"%" method=%""+ method +"%"")
if attached encoding_type as enctype then
a_html.append (" enctype=%""+ enctype +"%"")
end
if not html_classes.is_empty then
create s.make_empty
across
@@ -129,7 +145,7 @@ feature -- Conversion
a_html.append ("</form>%N")
end
to_html (a_theme: CMS_THEME): STRING_8
to_html (a_theme: WSF_THEME): STRING_8
do
create Result.make_empty
append_to_html (a_theme, Result)

View File

@@ -1,14 +1,14 @@
note
description: "Summary description for {CMS_FORM_BUTTON_INPUT}."
description: "Summary description for {WSF_FORM_BUTTON_INPUT}."
author: ""
date: "$Date$"
revision: "$Revision$"
class
CMS_FORM_BUTTON_INPUT
WSF_FORM_BUTTON_INPUT
inherit
CMS_FORM_INPUT
WSF_FORM_INPUT
create
make

View File

@@ -1,14 +1,14 @@
note
description: "Summary description for {CMS_FORM_CHECKBOX_INPUT}."
description: "Summary description for {WSF_FORM_CHECKBOX_INPUT}."
author: ""
date: "$Date$"
revision: "$Revision$"
class
CMS_FORM_CHECKBOX_INPUT
WSF_FORM_CHECKBOX_INPUT
inherit
CMS_FORM_SELECTABLE_INPUT
WSF_FORM_SELECTABLE_INPUT
create
make,

View File

@@ -5,10 +5,10 @@ note
revision : "$Revision$"
deferred class
CMS_FORM_COMPOSITE
WSF_FORM_COMPOSITE
inherit
CMS_WIDGET_COMPOSITE
WSF_WIDGET_COMPOSITE
redefine
extend
end
@@ -22,18 +22,18 @@ feature -- Status
feature -- Access
fields_by_name (a_name: READABLE_STRING_GENERAL): detachable LIST [CMS_FORM_FIELD]
fields_by_name (a_name: READABLE_STRING_GENERAL): detachable LIST [WSF_FORM_FIELD]
do
Result := fields_by_name_from (Current, a_name)
end
feature -- Change
extend (i: CMS_WIDGET)
extend (i: WSF_WIDGET)
local
n: READABLE_STRING_8
do
if attached {CMS_FORM_FIELD} i as l_field then
if attached {WSF_FORM_FIELD} i as l_field then
n := l_field.name
if n.is_empty then
n := (items.count + 1).out
@@ -45,34 +45,34 @@ feature -- Change
feature {NONE} -- Implementation: Items
container_has_field (a_container: ITERABLE [CMS_WIDGET]; a_name: READABLE_STRING_GENERAL): BOOLEAN
container_has_field (a_container: ITERABLE [WSF_WIDGET]; a_name: READABLE_STRING_GENERAL): BOOLEAN
do
across
a_container as i
until
Result
loop
if attached {CMS_FORM_FIELD} i.item as l_field and then l_field.name.same_string_general (a_name) then
if attached {WSF_FORM_FIELD} i.item as l_field and then l_field.name.same_string_general (a_name) then
Result := True
elseif attached {ITERABLE [CMS_WIDGET]} i.item as l_cont then
elseif attached {ITERABLE [WSF_WIDGET]} i.item as l_cont then
Result := container_has_field (l_cont, a_name)
end
end
end
fields_by_name_from (a_container: ITERABLE [CMS_WIDGET]; a_name: READABLE_STRING_GENERAL): detachable ARRAYED_LIST [CMS_FORM_FIELD]
fields_by_name_from (a_container: ITERABLE [WSF_WIDGET]; a_name: READABLE_STRING_GENERAL): detachable ARRAYED_LIST [WSF_FORM_FIELD]
local
res: detachable ARRAYED_LIST [CMS_FORM_FIELD]
res: detachable ARRAYED_LIST [WSF_FORM_FIELD]
do
across
a_container as i
loop
if attached {CMS_FORM_FIELD} i.item as l_field and then l_field.name.same_string_general (a_name) then
if attached {WSF_FORM_FIELD} i.item as l_field and then l_field.name.same_string_general (a_name) then
if res = Void then
create res.make (1)
end
res.force (l_field)
elseif attached {ITERABLE [CMS_WIDGET]} i.item as l_cont then
elseif attached {ITERABLE [WSF_WIDGET]} i.item as l_cont then
if attached fields_by_name_from (l_cont, a_name) as lst then
if res = Void then
res := lst

View File

@@ -1,21 +1,20 @@
note
description : "Objects that ..."
author : "$Author$"
description : "Objects that represent a form filled with data from request."
date : "$Date$"
revision : "$Revision$"
class
CMS_FORM_DATA
WSF_FORM_DATA
inherit
TABLE_ITERABLE [detachable WSF_VALUE, READABLE_STRING_8]
create {CMS_FORM}
create {WSF_FORM}
make
feature {NONE} -- Initialization
make (req: WSF_REQUEST; a_form: CMS_FORM)
make (req: WSF_REQUEST; a_form: WSF_FORM)
-- Initialize `Current'.
do
form := a_form
@@ -25,7 +24,7 @@ feature {NONE} -- Initialization
feature -- Access
form: CMS_FORM
form: WSF_FORM
feature -- Status
@@ -34,6 +33,9 @@ feature -- Status
Result := errors = Void
end
is_applied_to_associated_form: BOOLEAN
-- Data already applied to `form'?
feature -- Access
item_same_string (a_name: READABLE_STRING_GENERAL; s: READABLE_STRING_GENERAL): BOOLEAN
@@ -132,11 +134,11 @@ feature -- Basic operation
form.validation_actions.call ([Current])
end
validate_item (w: CMS_WIDGET)
validate_item (w: WSF_WIDGET)
do
if attached {CMS_FORM_FIELD} w as l_field then
if attached {WSF_FORM_FIELD} w as l_field then
l_field.validate (Current)
elseif attached {ITERABLE [CMS_WIDGET]} w as lst then
elseif attached {ITERABLE [WSF_WIDGET]} w as lst then
across
lst as c
loop
@@ -158,6 +160,7 @@ feature -- Basic operation
apply_to_associated_form
do
if not is_applied_to_associated_form then
if attached errors as errs then
across
errs as e
@@ -178,20 +181,22 @@ feature -- Basic operation
apply_to_associated_form_item (c.key, c.item, i.item)
end
end
is_applied_to_associated_form := True
end
end
feature {NONE} -- Implementation: apply
apply_to_associated_form_item (a_name: READABLE_STRING_8; a_value: detachable WSF_VALUE; i: CMS_WIDGET)
apply_to_associated_form_item (a_name: READABLE_STRING_8; a_value: detachable WSF_VALUE; i: WSF_WIDGET)
local
do
if attached {CMS_FORM_FIELD} i as l_field then
if not attached {CMS_FORM_SUBMIT_INPUT} l_field then
if attached {WSF_FORM_FIELD} i as l_field then
if not attached {WSF_FORM_SUBMIT_INPUT} l_field then
if l_field.name.same_string (a_name) then
l_field.set_value (a_value)
end
end
elseif attached {ITERABLE [CMS_WIDGET]} i as l_set then
elseif attached {ITERABLE [WSF_WIDGET]} i as l_set then
across
l_set as c
loop
@@ -231,20 +236,20 @@ feature {NONE} -- Implementation
get_form_items (req, form)
end
get_form_items (req: WSF_REQUEST; lst: ITERABLE [CMS_WIDGET])
get_form_items (req: WSF_REQUEST; lst: ITERABLE [WSF_WIDGET])
do
across
lst as c
loop
if attached {CMS_FORM_FIELD} c.item as l_field then
if attached {WSF_FORM_FIELD} c.item as l_field then
get_form_field_item (req, l_field, l_field.name)
elseif attached {ITERABLE [CMS_WIDGET]} c.item as l_set then
elseif attached {ITERABLE [WSF_WIDGET]} c.item as l_set then
get_form_items (req, l_set)
end
end
end
get_form_field_item (req: WSF_REQUEST; i: CMS_FORM_FIELD; n: READABLE_STRING_8)
get_form_field_item (req: WSF_REQUEST; i: WSF_FORM_FIELD; n: READABLE_STRING_8)
local
v: detachable WSF_VALUE
do
@@ -269,7 +274,7 @@ feature {NONE} -- Implementation
end
end
add_error (a_field: detachable CMS_FORM_FIELD; a_msg: detachable READABLE_STRING_8)
add_error (a_field: detachable WSF_FORM_FIELD; a_msg: detachable READABLE_STRING_8)
local
err: like errors
do
@@ -322,7 +327,7 @@ feature -- Reports
Result := attached errors as err and then not err.is_empty
end
errors: detachable ARRAYED_LIST [TUPLE [field: detachable CMS_FORM_FIELD; message: detachable READABLE_STRING_8]]
errors: detachable ARRAYED_LIST [TUPLE [field: detachable WSF_FORM_FIELD; message: detachable READABLE_STRING_8]]
invariant

View File

@@ -5,14 +5,14 @@ note
revision : "$Revision$"
class
CMS_FORM_DIV
WSF_FORM_DIV
inherit
CMS_FORM_ITEM
WSF_FORM_ITEM
CMS_FORM_COMPOSITE
WSF_FORM_COMPOSITE
WITH_CSS_ID
WSF_WITH_CSS_ID
create
make,
@@ -32,16 +32,16 @@ feature {NONE} -- Initialization
make_with_text (s: READABLE_STRING_8)
do
make_with_item (create {CMS_FORM_RAW_TEXT}.make (s))
make_with_item (create {WSF_FORM_RAW_TEXT}.make (s))
end
make_with_item (i: CMS_WIDGET)
make_with_item (i: WSF_WIDGET)
do
initialize_with_count (1)
extend (i)
end
make_with_items (it: ITERABLE [CMS_WIDGET])
make_with_items (it: ITERABLE [WSF_WIDGET])
do
initialize_with_count (2)
across
@@ -51,7 +51,7 @@ feature {NONE} -- Initialization
end
end
make_with_item_and_css_id (i: CMS_WIDGET; a_css_id: READABLE_STRING_8)
make_with_item_and_css_id (i: WSF_WIDGET; a_css_id: READABLE_STRING_8)
do
make_with_item (i)
set_css_id (a_css_id)
@@ -65,7 +65,7 @@ feature {NONE} -- Initialization
feature -- Conversion
append_to_html (a_theme: CMS_THEME; a_html: STRING_8)
append_to_html (a_theme: WSF_THEME; a_html: STRING_8)
do
a_html.append ("<div")
append_css_class_to (a_html, Void)

View File

@@ -1,16 +1,16 @@
note
description: "Summary description for {CMS_FORM_ITEM}."
description: "Summary description for {WSF_FORM_ITEM}."
author: ""
date: "$Date$"
revision: "$Revision$"
deferred class
CMS_FORM_FIELD
WSF_FORM_FIELD
inherit
CMS_FORM_ITEM
WSF_FORM_ITEM
WITH_CSS_ID
WSF_WITH_CSS_ID
DEBUG_OUTPUT
@@ -40,10 +40,10 @@ feature -- Status report
feature -- Validation
validation_action: detachable PROCEDURE [ANY, TUPLE [CMS_FORM_DATA]]
validation_action: detachable PROCEDURE [ANY, TUPLE [WSF_FORM_DATA]]
-- Function returning True if valid, otherwise False
validate (fd: CMS_FORM_DATA)
validate (fd: WSF_FORM_DATA)
do
if attached validation_action as act then
act.call ([fd])
@@ -102,7 +102,7 @@ feature -- Element change
feature -- Conversion
append_to_html (a_theme: CMS_THEME; a_html: STRING_8)
append_to_html (a_theme: WSF_THEME; a_html: STRING_8)
local
l_class_items: detachable ARRAYED_LIST [READABLE_STRING_8]
do
@@ -138,7 +138,7 @@ feature -- Conversion
a_html.append ("</div>")
end
append_item_to_html (a_theme: CMS_THEME; a_html: STRING_8)
append_item_to_html (a_theme: WSF_THEME; a_html: STRING_8)
deferred
end

View File

@@ -5,14 +5,14 @@ note
revision : "$Revision$"
class
CMS_FORM_FIELD_SET
WSF_FORM_FIELD_SET
inherit
CMS_FORM_ITEM
WSF_FORM_ITEM
CMS_FORM_COMPOSITE
WSF_FORM_COMPOSITE
WITH_CSS_ID
WSF_WITH_CSS_ID
create
make
@@ -59,7 +59,7 @@ feature -- Change
feature -- Conversion
append_to_html (a_theme: CMS_THEME; a_html: STRING_8)
append_to_html (a_theme: WSF_THEME; a_html: STRING_8)
do
a_html.append ("<fieldset")
append_css_class_to (a_html, Void)

View File

@@ -1,14 +1,14 @@
note
description: "Summary description for {CMS_FORM_FILE_INPUT}."
description: "Summary description for {WSF_FORM_FILE_INPUT}."
author: ""
date: "$Date$"
revision: "$Revision$"
class
CMS_FORM_FILE_INPUT
WSF_FORM_FILE_INPUT
inherit
CMS_FORM_INPUT
WSF_FORM_INPUT
redefine
specific_input_attributes_string
end

View File

@@ -1,14 +1,14 @@
note
description: "Summary description for {CMS_FORM_INPUT}."
description: "Summary description for {WSF_FORM_INPUT}."
author: ""
date: "$Date$"
revision: "$Revision$"
class
CMS_FORM_HIDDEN_INPUT
WSF_FORM_HIDDEN_INPUT
inherit
CMS_FORM_INPUT
WSF_FORM_INPUT
redefine
input_type,
append_item_to_html
@@ -27,7 +27,7 @@ feature -- Access
feature -- Conversion
append_item_to_html (a_theme: CMS_THEME; a_html: STRING_8)
append_item_to_html (a_theme: WSF_THEME; a_html: STRING_8)
do
a_html.append ("<div style=%"display:none%">")
Precursor (a_theme, a_html)

View File

@@ -1,14 +1,14 @@
note
description: "Summary description for {CMS_FORM_IMAGE_INPUT}."
description: "Summary description for {WSF_FORM_IMAGE_INPUT}."
author: ""
date: "$Date$"
revision: "$Revision$"
class
CMS_FORM_IMAGE_INPUT
WSF_FORM_IMAGE_INPUT
inherit
CMS_FORM_INPUT
WSF_FORM_INPUT
redefine
specific_input_attributes_string
end

View File

@@ -1,14 +1,14 @@
note
description: "Summary description for {CMS_FORM_INPUT}."
description: "Summary description for {WSF_FORM_INPUT}."
author: ""
date: "$Date$"
revision: "$Revision$"
deferred class
CMS_FORM_INPUT
WSF_FORM_INPUT
inherit
CMS_FORM_FIELD
WSF_FORM_FIELD
feature {NONE} -- Initialization
@@ -78,7 +78,7 @@ feature -- Element change
feature -- Conversion
append_item_to_html (a_theme: CMS_THEME; a_html: STRING_8)
append_item_to_html (a_theme: WSF_THEME; a_html: STRING_8)
local
old_count: INTEGER
do
@@ -121,7 +121,7 @@ feature -- Conversion
feature {NONE} -- Implementation
append_child_to_html (a_theme: CMS_THEME; a_html: STRING_8)
append_child_to_html (a_theme: WSF_THEME; a_html: STRING_8)
-- Specific child element if any.
--| To redefine if needed
do

View File

@@ -0,0 +1,17 @@
note
description: "Summary description for {WSF_FORM_ITEM}."
author: ""
date: "$Date$"
revision: "$Revision$"
deferred class
WSF_FORM_ITEM
inherit
WSF_WIDGET
WSF_WITH_CSS_CLASS
WSF_WITH_CSS_STYLE
end

View File

@@ -1,14 +1,14 @@
note
description: "Summary description for {CMS_FORM_PASSWORD_INPUT}."
description: "Summary description for {WSF_FORM_PASSWORD_INPUT}."
author: ""
date: "$Date$"
revision: "$Revision$"
class
CMS_FORM_PASSWORD_INPUT
WSF_FORM_PASSWORD_INPUT
inherit
CMS_FORM_INPUT
WSF_FORM_INPUT
redefine
input_type
end

View File

@@ -1,14 +1,14 @@
note
description: "Summary description for {CMS_FORM_RADIO_INPUT}."
description: "Summary description for {WSF_FORM_RADIO_INPUT}."
author: ""
date: "$Date$"
revision: "$Revision$"
class
CMS_FORM_RADIO_INPUT
WSF_FORM_RADIO_INPUT
inherit
CMS_FORM_SELECTABLE_INPUT
WSF_FORM_SELECTABLE_INPUT
create
make,

View File

@@ -1,14 +1,14 @@
note
description: "Summary description for {CMS_FORM_RAW_TEXT}."
description: "Summary description for {WSF_FORM_RAW_TEXT}."
author: ""
date: "$Date$"
revision: "$Revision$"
class
CMS_FORM_RAW_TEXT
WSF_FORM_RAW_TEXT
inherit
CMS_WIDGET_TEXT
WSF_WIDGET_TEXT
rename
set_text as set_value,
make_with_text as make
@@ -21,12 +21,12 @@ create
feature -- Conversion
append_to_html (a_theme: CMS_THEME; a_html: STRING_8)
append_to_html (a_theme: WSF_THEME; a_html: STRING_8)
do
append_item_html_to (a_theme, a_html)
end
append_item_html_to (a_theme: CMS_THEME; a_html: STRING_8)
append_item_html_to (a_theme: WSF_THEME; a_html: STRING_8)
do
a_html.append (text)
end

View File

@@ -1,14 +1,14 @@
note
description: "Summary description for {CMS_FORM_RESET_INPUT}."
description: "Summary description for {WSF_FORM_RESET_INPUT}."
author: ""
date: "$Date$"
revision: "$Revision$"
class
CMS_FORM_RESET_INPUT
WSF_FORM_RESET_INPUT
inherit
CMS_FORM_INPUT
WSF_FORM_INPUT
create
make

View File

@@ -1,16 +1,18 @@
note
description: "Summary description for {CMS_FORM_SELECT}."
description: "Summary description for {WSF_FORM_SELECT}."
author: ""
date: "$Date$"
revision: "$Revision$"
class
CMS_FORM_SELECT
WSF_FORM_SELECT
inherit
CMS_FORM_FIELD
WSF_FORM_FIELD
CMS_FORM_UTILITY
WSF_FORM_UTILITY
WSF_WITH_HTML_ATTRIBUTE
create
make
@@ -25,13 +27,13 @@ feature {NONE} -- Initialization
feature -- Access
options: ARRAYED_LIST [CMS_FORM_SELECT_OPTION]
options: ARRAYED_LIST [WSF_FORM_SELECT_OPTION]
feature -- Element change
set_text_by_value (a_text: detachable READABLE_STRING_GENERAL)
local
opt: CMS_FORM_SELECT_OPTION
opt: WSF_FORM_SELECT_OPTION
l_found: BOOLEAN
v: READABLE_STRING_8
do
@@ -96,14 +98,14 @@ feature -- Element change
end
end
add_option (opt: CMS_FORM_SELECT_OPTION)
add_option (opt: WSF_FORM_SELECT_OPTION)
do
options.force (opt)
end
feature -- Conversion
append_item_to_html (a_theme: CMS_THEME; a_html: STRING_8)
append_item_to_html (a_theme: WSF_THEME; a_html: STRING_8)
local
l_is_already_selected: BOOLEAN
h: detachable STRING_8
@@ -115,6 +117,7 @@ feature -- Conversion
append_css_class_to (a_html, Void)
append_css_id_to (a_html)
append_css_style_to (a_html)
append_html_attributes_to (a_html)
if is_readonly then
a_html.append (" readonly=%"readonly%" />")

View File

@@ -5,10 +5,10 @@ note
revision : "$Revision$"
class
CMS_FORM_SELECT_OPTION
WSF_FORM_SELECT_OPTION
inherit
CMS_FORM_SELECTABLE_ITEM
WSF_FORM_SELECTABLE_ITEM
create
make

View File

@@ -1,14 +1,14 @@
note
description: "Summary description for {CMS_FORM_SELECTABLE_INPUT}."
description: "Summary description for {WSF_FORM_SELECTABLE_INPUT}."
author: ""
date: "$Date$"
revision: "$Revision$"
deferred class
CMS_FORM_SELECTABLE_INPUT
WSF_FORM_SELECTABLE_INPUT
inherit
CMS_FORM_INPUT
WSF_FORM_INPUT
rename
default_value as value,
make_with_text as make_with_value
@@ -18,7 +18,7 @@ inherit
append_child_to_html
end
CMS_FORM_SELECTABLE_ITEM
WSF_FORM_SELECTABLE_ITEM
rename
is_selected as checked,
set_is_selected as set_checked
@@ -87,7 +87,7 @@ feature -- Change
feature {NONE} -- Implementation
append_child_to_html (a_theme: CMS_THEME; a_html: STRING_8)
append_child_to_html (a_theme: WSF_THEME; a_html: STRING_8)
-- Specific child element if any.
--| To redefine if needed
do

View File

@@ -1,10 +1,10 @@
note
description: "Summary description for {CMS_FORM_SELECTABLE_ITEM}."
description: "Summary description for {WSF_FORM_SELECTABLE_ITEM}."
date: "$Date$"
revision: "$Revision$"
deferred class
CMS_FORM_SELECTABLE_ITEM
WSF_FORM_SELECTABLE_ITEM
feature -- Status report

View File

@@ -1,14 +1,14 @@
note
description: "Summary description for {CMS_FORM_INPUT}."
description: "Summary description for {WSF_FORM_INPUT}."
author: ""
date: "$Date$"
revision: "$Revision$"
class
CMS_FORM_SUBMIT_INPUT
WSF_FORM_SUBMIT_INPUT
inherit
CMS_FORM_INPUT
WSF_FORM_INPUT
create
make,

View File

@@ -1,14 +1,14 @@
note
description: "Summary description for {CMS_FORM_TEXT_INPUT}."
description: "Summary description for {WSF_FORM_TEXT_INPUT}."
author: ""
date: "$Date$"
revision: "$Revision$"
class
CMS_FORM_TEXT_INPUT
WSF_FORM_TEXT_INPUT
inherit
CMS_FORM_INPUT
WSF_FORM_INPUT
create
make,

View File

@@ -1,14 +1,14 @@
note
description: "Summary description for {CMS_FORM_INPUT}."
description: "Summary description for {WSF_FORM_INPUT}."
author: ""
date: "$Date$"
revision: "$Revision$"
class
CMS_FORM_TEXTAREA
WSF_FORM_TEXTAREA
inherit
CMS_FORM_FIELD
WSF_FORM_FIELD
create
make
@@ -61,7 +61,7 @@ feature -- Element change
feature -- Conversion
append_item_to_html (a_theme: CMS_THEME; a_html: STRING_8)
append_item_to_html (a_theme: WSF_THEME; a_html: STRING_8)
do
a_html.append ("<textarea name=%""+ name +"%"")
if rows > 0 then

View File

@@ -1,11 +1,11 @@
note
description: "Summary description for {CMS_FORM_UTILITY}."
description: "Summary description for {WSF_FORM_UTILITY}."
author: ""
date: "$Date$"
revision: "$Revision$"
class
CMS_FORM_UTILITY
WSF_FORM_UTILITY
feature -- Converter

View File

@@ -1,19 +1,19 @@
note
description: "Summary description for {CMS_WIDGET}."
description: "Summary description for {WSF_WIDGET}."
author: ""
date: "$Date$"
revision: "$Revision$"
deferred class
CMS_WIDGET
WSF_WIDGET
feature -- Conversion
append_to_html (a_theme: CMS_THEME; a_html: STRING_8)
append_to_html (a_theme: WSF_THEME; a_html: STRING_8)
deferred
end
to_html (a_theme: CMS_THEME): STRING_8
to_html (a_theme: WSF_THEME): STRING_8
do
create Result.make_empty
append_to_html (a_theme, Result)

View File

@@ -1,26 +1,26 @@
note
description: "Summary description for {CMS_WIDGET_TABLE}."
description: "Summary description for {WSF_WIDGET_TABLE}."
author: ""
date: "$Date$"
revision: "$Revision$"
class
CMS_WIDGET_AGENT_TABLE [G]
WSF_WIDGET_AGENT_TABLE [G]
inherit
CMS_WIDGET
WSF_WIDGET
WITH_CSS_ID
WSF_WITH_CSS_ID
WITH_CSS_CLASS
WSF_WITH_CSS_CLASS
WITH_CSS_STYLE
WSF_WITH_CSS_STYLE
create
make
convert
to_computed_table: {CMS_WIDGET_TABLE}
to_computed_table: {WSF_WIDGET_TABLE}
feature {NONE} -- Initialization
@@ -36,9 +36,9 @@ feature -- Access
Result := columns.count
end
columns: ARRAY [CMS_WIDGET_TABLE_COLUMN]
columns: ARRAY [WSF_WIDGET_TABLE_COLUMN]
column (c: INTEGER): CMS_WIDGET_TABLE_COLUMN
column (c: INTEGER): WSF_WIDGET_TABLE_COLUMN
do
if c > column_count then
set_column_count (c)
@@ -60,7 +60,7 @@ feature -- Access
data: detachable ITERABLE [G]
-- tbody
compute_item_function: detachable FUNCTION [ANY, TUPLE [data: G], CMS_WIDGET_TABLE_ROW]
compute_item_function: detachable FUNCTION [ANY, TUPLE [data: G], WSF_WIDGET_TABLE_ROW]
feature -- Change
@@ -87,12 +87,12 @@ feature -- Change
set_column_count (nb: INTEGER)
do
if nb > columns.count then
-- columns.conservative_resize_with_default (create {CMS_WIDGET_TABLE_COLUMN}, 1, nb)
-- columns.conservative_resize_with_default (create {WSF_WIDGET_TABLE_COLUMN}, 1, nb)
from
until
columns.count = nb
loop
columns.force (create {CMS_WIDGET_TABLE_COLUMN}.make (columns.upper + 1), columns.upper + 1)
columns.force (create {WSF_WIDGET_TABLE_COLUMN}.make (columns.upper + 1), columns.upper + 1)
end
else
columns.remove_tail (columns.count - nb)
@@ -111,9 +111,9 @@ feature -- Change
feature -- Conversion
to_computed_table: CMS_WIDGET_TABLE
to_computed_table: WSF_WIDGET_TABLE
local
col: CMS_WIDGET_TABLE_COLUMN
col: WSF_WIDGET_TABLE_COLUMN
do
create Result.make
Result.set_column_count (column_count)
@@ -156,7 +156,7 @@ feature -- Conversion
feature -- Conversion: HTML
append_to_html (a_theme: CMS_THEME; a_html: STRING_8)
append_to_html (a_theme: WSF_THEME; a_html: STRING_8)
local
l_use_tbody: BOOLEAN
do
@@ -200,7 +200,7 @@ feature -- Conversion: HTML
a_html.append ("</table>")
end
append_data_to_html (lst: ITERABLE [G]; a_theme: CMS_THEME; a_html: STRING_8)
append_data_to_html (lst: ITERABLE [G]; a_theme: WSF_THEME; a_html: STRING_8)
local
fct: like compute_item_function
do

View File

@@ -5,10 +5,10 @@ note
revision : "$Revision$"
deferred class
CMS_WIDGET_COMPOSITE
WSF_WIDGET_COMPOSITE
inherit
ITERABLE [CMS_WIDGET]
ITERABLE [WSF_WIDGET]
feature {NONE} -- Initialization
@@ -24,7 +24,7 @@ feature -- Status
Result := count = 0
end
has_item (i: CMS_WIDGET): BOOLEAN
has_item (i: WSF_WIDGET): BOOLEAN
do
if has_immediate_item (i) then
Result := True
@@ -32,21 +32,21 @@ feature -- Status
across
items as c
loop
if attached {CMS_WIDGET_COMPOSITE} c.item as comp then
if attached {WSF_WIDGET_COMPOSITE} c.item as comp then
Result := comp.has_item (i)
end
end
end
end
has_immediate_item (i: CMS_WIDGET): BOOLEAN
has_immediate_item (i: WSF_WIDGET): BOOLEAN
do
Result := items.has (i)
end
feature -- Access: cursor
new_cursor: ITERATION_CURSOR [CMS_WIDGET]
new_cursor: ITERATION_CURSOR [WSF_WIDGET]
-- Fresh cursor associated with current structure
do
Result := items.new_cursor
@@ -60,7 +60,7 @@ feature -- Access
across
items as c
loop
if attached {CMS_WIDGET_COMPOSITE} c.item as comp then
if attached {WSF_WIDGET_COMPOSITE} c.item as comp then
Result := Result + comp.count
end
end
@@ -71,9 +71,9 @@ feature -- Access
Result := items.count
end
items_by_type (a_type: TYPE [detachable ANY]): detachable LIST [CMS_WIDGET]
-- All CMS_WIDGET items conforming to a_type.
-- Warning: you should pass {detachable CMS_FORM_SUBMIT_INPUT} rather than just {CMS_FORM_SUBMIT_INPUT}
items_by_type (a_type: TYPE [detachable ANY]): detachable LIST [WSF_WIDGET]
-- All WSF_WIDGET items conforming to a_type.
-- Warning: you should pass {detachable WSF_FORM_SUBMIT_INPUT} rather than just {WSF_FORM_SUBMIT_INPUT}
local
int: INTERNAL
tid: INTEGER
@@ -93,12 +93,12 @@ feature -- Access
Result := items_by_type_from (Current, t)
end
items_by_css_id (a_id: READABLE_STRING_GENERAL): detachable LIST [CMS_WIDGET]
items_by_css_id (a_id: READABLE_STRING_GENERAL): detachable LIST [WSF_WIDGET]
do
Result := items_by_css_id_from (Current, a_id)
end
first_item_by_css_id (a_id: READABLE_STRING_GENERAL): detachable CMS_WIDGET
first_item_by_css_id (a_id: READABLE_STRING_GENERAL): detachable WSF_WIDGET
do
if attached items_by_css_id_from (Current, a_id) as lst then
if not lst.is_empty then
@@ -109,7 +109,7 @@ feature -- Access
feature -- Change
insert_before (i: CMS_WIDGET; a_item: CMS_WIDGET)
insert_before (i: WSF_WIDGET; a_item: WSF_WIDGET)
-- Insert `i' before `a_item'
require
has_item (a_item)
@@ -130,7 +130,7 @@ feature -- Change
until
done
loop
if attached {CMS_WIDGET_COMPOSITE} c.item as comp and then comp.has_item (a_item) then
if attached {WSF_WIDGET_COMPOSITE} c.item as comp and then comp.has_item (a_item) then
comp.insert_before (i, a_item)
done := True
end
@@ -138,7 +138,7 @@ feature -- Change
end
end
insert_after (i: CMS_WIDGET; a_item: CMS_WIDGET)
insert_after (i: WSF_WIDGET; a_item: WSF_WIDGET)
-- Insert `i' after `a_item'
require
has_item (a_item)
@@ -159,7 +159,7 @@ feature -- Change
until
done
loop
if attached {CMS_WIDGET_COMPOSITE} c.item as comp and then comp.has_item (a_item) then
if attached {WSF_WIDGET_COMPOSITE} c.item as comp and then comp.has_item (a_item) then
comp.insert_after (i, a_item)
done := True
end
@@ -167,26 +167,26 @@ feature -- Change
end
end
extend (i: CMS_WIDGET)
extend (i: WSF_WIDGET)
do
items.force (i)
end
prepend (i: CMS_WIDGET)
prepend (i: WSF_WIDGET)
do
items.put_front (i)
end
extend_text (t: READABLE_STRING_8)
do
extend (create {CMS_WIDGET_TEXT}.make_with_text (t))
extend (create {WSF_WIDGET_TEXT}.make_with_text (t))
end
feature {NONE} -- Implementation: Items
items_by_type_from (a_container: ITERABLE [CMS_WIDGET]; a_type: TYPE [detachable ANY]): detachable ARRAYED_LIST [CMS_WIDGET]
items_by_type_from (a_container: ITERABLE [WSF_WIDGET]; a_type: TYPE [detachable ANY]): detachable ARRAYED_LIST [WSF_WIDGET]
local
res: detachable ARRAYED_LIST [CMS_WIDGET]
res: detachable ARRAYED_LIST [WSF_WIDGET]
do
across
a_container as i
@@ -196,7 +196,7 @@ feature {NONE} -- Implementation: Items
create res.make (1)
end
res.force (i.item)
elseif attached {ITERABLE [CMS_WIDGET]} i.item as l_cont then
elseif attached {ITERABLE [WSF_WIDGET]} i.item as l_cont then
if attached items_by_type_from (l_cont, a_type) as lst then
if res = Void then
res := lst
@@ -209,15 +209,15 @@ feature {NONE} -- Implementation: Items
Result := res
end
items_by_css_id_from (a_container: ITERABLE [CMS_WIDGET]; a_id: READABLE_STRING_GENERAL): detachable ARRAYED_LIST [CMS_WIDGET]
items_by_css_id_from (a_container: ITERABLE [WSF_WIDGET]; a_id: READABLE_STRING_GENERAL): detachable ARRAYED_LIST [WSF_WIDGET]
local
res: detachable ARRAYED_LIST [CMS_WIDGET]
res: detachable ARRAYED_LIST [WSF_WIDGET]
do
across
a_container as i
loop
if
attached {WITH_CSS_ID} i.item as l_with_css_id and then
attached {WSF_WITH_CSS_ID} i.item as l_with_css_id and then
attached l_with_css_id.css_id as l_css_id and then
l_css_id.same_string_general (a_id)
then
@@ -225,7 +225,7 @@ feature {NONE} -- Implementation: Items
create res.make (1)
end
res.force (i.item)
elseif attached {ITERABLE [CMS_WIDGET]} i.item as l_cont then
elseif attached {ITERABLE [WSF_WIDGET]} i.item as l_cont then
if attached items_by_css_id_from (l_cont, a_id) as lst then
if res = Void then
res := lst
@@ -240,7 +240,7 @@ feature {NONE} -- Implementation: Items
feature {NONE} -- Implementation
items: ARRAYED_LIST [CMS_WIDGET]
items: ARRAYED_LIST [WSF_WIDGET]
-- name => item
invariant

View File

@@ -0,0 +1,161 @@
note
description: "Summary description for {WSF_WIDGET_PAGER}."
author: ""
date: "$Date$"
revision: "$Revision$"
class
WSF_WIDGET_PAGER
inherit
WSF_WIDGET
create
make
feature {NONE} -- Initialization
make (tpl: READABLE_STRING_8; a_lower, a_upper: NATURAL_64; a_step: NATURAL_64)
do
create template.make (tpl)
lower := a_lower
upper := a_upper
step := a_step
end
feature -- Change
set_active_range (a_lower, a_upper: NATURAL_64)
do
if a_upper = 0 then
active_range := [{NATURAL_64} 1, {NATURAL_64} 0]
elseif a_lower > 0 and a_lower <= a_upper then
active_range := [a_lower, a_upper]
else
active_range := Void
end
ensure
valid_range: attached active_range as rg implies (rg.upper = 0 or else rg.lower <= rg.upper)
end
feature -- Access
template: URI_TEMPLATE
lower: NATURAL_64
upper: NATURAL_64
step: NATURAL_64
active_range: detachable TUPLE [lower_index, upper_index: NATURAL_64]
feature -- Conversion
append_to_html (a_theme: WSF_THEME; a_html: STRING_8)
local
l_step: INTEGER
nb: INTEGER
curr: INTEGER
n, i: INTEGER
tb: HASH_TABLE [detachable ANY, STRING_8]
do
a_html.append ("<div")
a_html.append_character ('>')
nb := ((upper - lower) // step).to_integer_32 + 1
if nb > 1 then
if attached active_range as rg then
if rg.upper_index = 0 then
-- all
else
curr := ((rg.lower_index - lower) // step).to_integer_32
if step * curr.to_natural_64 < rg.lower_index then
curr := curr + 1
end
end
end
l_step := step.to_integer_32
create tb.make (2)
tb.force (1, "lower")
tb.force (step, "upper")
if curr > 1 then
if curr > 2 then
tb.force (1, "lower")
tb.force (l_step, "upper")
a_html.append_character (' ')
append_link_to_html (a_theme, "<<", template.expanded_string (tb), a_html)
a_html.append_character (' ')
end
tb.force ((curr - 1) * l_step + 1, "lower")
tb.force ((curr ) * l_step , "upper")
a_html.append_character (' ')
append_link_to_html (a_theme, "<", template.expanded_string (tb), a_html)
a_html.append_character (' ')
end
from
i := (curr - 1).max (1)
n := 5
until
n = 0 or i > nb
loop
a_html.append_character (' ')
tb.force ((i - 1) * l_step + 1, "lower")
tb.force ((i ) * l_step , "upper")
if i = curr then
a_html.append ("<strong>")
end
append_link_to_html (a_theme, i.out, template.expanded_string (tb), a_html)
if i = curr then
a_html.append ("</strong>")
end
a_html.append_character (' ')
i := i + 1
n := n - 1
end
if curr < nb then
a_html.append_character (' ')
tb.force ((curr ) * l_step + 1, "lower")
tb.force ((curr + 1) * l_step , "upper")
append_link_to_html (a_theme, ">", template.expanded_string (tb), a_html)
a_html.append_character (' ')
if curr + 1 < nb then
tb.force ((nb - 1) * l_step + 1, "lower")
tb.force ( upper , "upper")
a_html.append_character (' ')
append_link_to_html (a_theme, ">>", template.expanded_string (tb), a_html)
a_html.append_character (' ')
end
end
a_html.append_character (' ')
tb.force (1, "lower")
tb.force (upper , "upper")
append_link_to_html (a_theme, "all", template.expanded_string (tb), a_html)
a_html.append_character (' ')
end
a_html.append ("</div>")
debug
a_html.append ("curr=" + curr.out +" step=" + step.out + " nb=" + nb.out)
end
end
feature -- Factory
append_link_to_html (a_theme: WSF_THEME; a_text: detachable READABLE_STRING_GENERAL; a_path: STRING; a_html: STRING_8)
do
a_theme.append_link_to_html (a_text, a_path, Void, a_html)
end
end

View File

@@ -1,21 +1,21 @@
note
description: "Summary description for {CMS_WIDGET_FILLED_TABLE}."
description: "Summary description for {WSF_WIDGET_FILLED_TABLE}."
date: "$Date$"
revision: "$Revision$"
class
CMS_WIDGET_TABLE
WSF_WIDGET_TABLE
inherit
CMS_WIDGET
WSF_WIDGET
WITH_CSS_ID
WSF_WITH_CSS_ID
WITH_CSS_CLASS
WSF_WITH_CSS_CLASS
WITH_CSS_STYLE
WSF_WITH_CSS_STYLE
ITERABLE [CMS_WIDGET_TABLE_ITEM]
ITERABLE [WSF_WIDGET_TABLE_ITEM]
create
make
@@ -27,9 +27,9 @@ feature {NONE} -- Initialization
create columns.make_empty
end
make_from_table (tb: CMS_WIDGET_AGENT_TABLE [detachable ANY])
make_from_table (tb: WSF_WIDGET_AGENT_TABLE [detachable ANY])
local
fct: like {CMS_WIDGET_AGENT_TABLE [detachable ANY]}.compute_item_function
fct: like {WSF_WIDGET_AGENT_TABLE [detachable ANY]}.compute_item_function
do
make
set_column_count (tb.column_count)
@@ -75,7 +75,7 @@ feature {NONE} -- Initialization
feature -- Access
new_cursor: CMS_WIDGET_TABLE_ITERATION_CURSOR
new_cursor: WSF_WIDGET_TABLE_ITERATION_CURSOR
-- Fresh cursor associated with current structure
do
create Result.make (Current)
@@ -112,10 +112,10 @@ feature -- Access
Result := head_row_count + body_row_count + foot_row_count
end
columns: ARRAY [CMS_WIDGET_TABLE_COLUMN]
columns: ARRAY [WSF_WIDGET_TABLE_COLUMN]
column (c: INTEGER): CMS_WIDGET_TABLE_COLUMN
column (c: INTEGER): WSF_WIDGET_TABLE_COLUMN
do
if c > column_count then
set_column_count (c)
@@ -123,7 +123,7 @@ feature -- Access
Result := columns[c]
end
row (r: INTEGER): detachable CMS_WIDGET_TABLE_ROW
row (r: INTEGER): detachable WSF_WIDGET_TABLE_ROW
do
if r <= head_row_count then
if attached head_rows as lst then
@@ -145,13 +145,13 @@ feature -- Access
Result := across columns as c some c.item.title /= Void end
end
head_rows: detachable ARRAYED_LIST [CMS_WIDGET_TABLE_ROW]
head_rows: detachable ARRAYED_LIST [WSF_WIDGET_TABLE_ROW]
-- thead
foot_rows: detachable ARRAYED_LIST [CMS_WIDGET_TABLE_ROW]
foot_rows: detachable ARRAYED_LIST [WSF_WIDGET_TABLE_ROW]
-- tfoot
rows: detachable ARRAYED_LIST [CMS_WIDGET_TABLE_ROW]
rows: detachable ARRAYED_LIST [WSF_WIDGET_TABLE_ROW]
-- tbody
feature -- Change
@@ -163,37 +163,37 @@ feature -- Change
rows := Void
end
add_head_row (r: CMS_WIDGET_TABLE_ROW)
add_head_row (r: WSF_WIDGET_TABLE_ROW)
local
lst: like head_rows
do
lst := head_rows
if lst = Void then
create {ARRAYED_LIST [CMS_WIDGET_TABLE_ROW]} lst.make (1)
create {ARRAYED_LIST [WSF_WIDGET_TABLE_ROW]} lst.make (1)
head_rows := lst
end
lst.force (r)
end
add_foot_row (r: CMS_WIDGET_TABLE_ROW)
add_foot_row (r: WSF_WIDGET_TABLE_ROW)
local
lst: like foot_rows
do
lst := foot_rows
if lst = Void then
create {ARRAYED_LIST [CMS_WIDGET_TABLE_ROW]} lst.make (1)
create {ARRAYED_LIST [WSF_WIDGET_TABLE_ROW]} lst.make (1)
foot_rows := lst
end
lst.force (r)
end
add_row (r: CMS_WIDGET_TABLE_ROW)
add_row (r: WSF_WIDGET_TABLE_ROW)
local
lst: like rows
do
lst := rows
if lst = Void then
create {ARRAYED_LIST [CMS_WIDGET_TABLE_ROW]} lst.make (1)
create {ARRAYED_LIST [WSF_WIDGET_TABLE_ROW]} lst.make (1)
rows := lst
end
lst.force (r)
@@ -206,7 +206,7 @@ feature -- Change
until
columns.count = nb
loop
columns.force (create {CMS_WIDGET_TABLE_COLUMN}.make (columns.upper + 1), columns.upper + 1)
columns.force (create {WSF_WIDGET_TABLE_COLUMN}.make (columns.upper + 1), columns.upper + 1)
end
else
columns.remove_tail (columns.count - nb)
@@ -225,7 +225,7 @@ feature -- Change
feature -- Conversion
append_to_html (a_theme: CMS_THEME; a_html: STRING_8)
append_to_html (a_theme: WSF_THEME; a_html: STRING_8)
local
l_use_tbody: BOOLEAN
do
@@ -269,7 +269,7 @@ feature -- Conversion
a_html.append ("</table>")
end
append_rows_to_html (lst: ITERABLE [CMS_WIDGET_TABLE_ROW]; a_theme: CMS_THEME; a_html: STRING_8)
append_rows_to_html (lst: ITERABLE [WSF_WIDGET_TABLE_ROW]; a_theme: WSF_THEME; a_html: STRING_8)
do
across
lst as r

View File

@@ -1,16 +1,16 @@
note
description: "Summary description for {CMS_WIDGET_COLUMN}."
description: "Summary description for {WSF_WIDGET_COLUMN}."
author: ""
date: "$Date$"
revision: "$Revision$"
class
CMS_WIDGET_TABLE_COLUMN
WSF_WIDGET_TABLE_COLUMN
inherit
WITH_CSS_CLASS
WSF_WITH_CSS_CLASS
WITH_CSS_STYLE
WSF_WITH_CSS_STYLE
create
make
@@ -37,7 +37,7 @@ feature -- Change
feature -- Conversion
append_table_header_to_html (a_theme: CMS_THEME; a_html: STRING_8)
append_table_header_to_html (a_theme: WSF_THEME; a_html: STRING_8)
do
a_html.append ("<th")
append_css_class_to (a_html, Void)

View File

@@ -1,22 +1,22 @@
note
description: "Summary description for {CMS_WIDGET_TABLE_ITEM}."
description: "Summary description for {WSF_WIDGET_TABLE_ITEM}."
author: ""
date: "$Date$"
revision: "$Revision$"
class
CMS_WIDGET_TABLE_ITEM
WSF_WIDGET_TABLE_ITEM
inherit
CMS_WIDGET
WSF_WIDGET
WITH_HTML_ATTRIBUTE
WSF_WITH_HTML_ATTRIBUTE
WITH_CSS_CLASS
WSF_WITH_CSS_CLASS
WITH_CSS_STYLE
WSF_WITH_CSS_STYLE
ITERABLE [CMS_WIDGET]
ITERABLE [WSF_WIDGET]
create
make_with_text,
@@ -27,7 +27,7 @@ feature {NONE} -- Initialization
make_with_text (a_text: READABLE_STRING_8)
do
make_with_content (create {CMS_WIDGET_TEXT}.make_with_text (a_text))
make_with_content (create {WSF_WIDGET_TEXT}.make_with_text (a_text))
end
make_with_text_and_css (a_text: READABLE_STRING_8; a_css_classes: detachable ITERABLE [READABLE_STRING_8])
@@ -42,21 +42,21 @@ feature {NONE} -- Initialization
end
end
make_with_content (a_widget: CMS_WIDGET)
make_with_content (a_widget: WSF_WIDGET)
do
content := a_widget
end
feature -- Access
content: CMS_WIDGET
content: WSF_WIDGET
feature -- Access
new_cursor: ITERATION_CURSOR [CMS_WIDGET]
new_cursor: ITERATION_CURSOR [WSF_WIDGET]
-- Fresh cursor associated with current structure
local
lst: ARRAYED_LIST [CMS_WIDGET]
lst: ARRAYED_LIST [WSF_WIDGET]
do
create lst.make (1)
lst.extend (content)
@@ -65,7 +65,7 @@ feature -- Access
feature -- Conversion
append_to_html (a_theme: CMS_THEME; a_html: STRING_8)
append_to_html (a_theme: WSF_THEME; a_html: STRING_8)
do
a_html.append ("<td")
append_css_class_to (a_html, Void)

View File

@@ -1,27 +1,27 @@
note
description: "Summary description for {CMS_WIDGET_TABLE_ITERATION_CURSOR}."
description: "Summary description for {WSF_WIDGET_TABLE_ITERATION_CURSOR}."
author: ""
date: "$Date$"
revision: "$Revision$"
class
CMS_WIDGET_TABLE_ITERATION_CURSOR
WSF_WIDGET_TABLE_ITERATION_CURSOR
inherit
ITERATION_CURSOR [CMS_WIDGET_TABLE_ITEM]
ITERATION_CURSOR [WSF_WIDGET_TABLE_ITEM]
create
make
feature {NONE} -- Initialization
make (a_table: CMS_WIDGET_TABLE)
make (a_table: WSF_WIDGET_TABLE)
do
table := a_table
start
end
table: CMS_WIDGET_TABLE
table: WSF_WIDGET_TABLE
row_index: INTEGER
column_index: INTEGER
@@ -35,7 +35,7 @@ feature -- Access
forth
end
item: CMS_WIDGET_TABLE_ITEM
item: WSF_WIDGET_TABLE_ITEM
-- Item at current cursor position.
do
if attached table.row (row_index) as r then

View File

@@ -1,18 +1,18 @@
note
description: "Summary description for {CMS_WIDGET_TABLE_ROW}."
description: "Summary description for {WSF_WIDGET_TABLE_ROW}."
author: ""
date: "$Date$"
revision: "$Revision$"
class
CMS_WIDGET_TABLE_ROW
WSF_WIDGET_TABLE_ROW
inherit
WITH_CSS_CLASS
WSF_WITH_CSS_CLASS
WITH_CSS_STYLE
WSF_WITH_CSS_STYLE
ITERABLE [CMS_WIDGET_TABLE_ITEM]
ITERABLE [WSF_WIDGET_TABLE_ITEM]
create
make,
@@ -25,7 +25,7 @@ feature {NONE} -- Initialization
create items.make (n)
end
make_with_items (lst: ITERABLE [CMS_WIDGET_TABLE_ITEM])
make_with_items (lst: ITERABLE [WSF_WIDGET_TABLE_ITEM])
local
n: INTEGER
do
@@ -40,11 +40,11 @@ feature {NONE} -- Initialization
end
end
items: ARRAYED_LIST [CMS_WIDGET_TABLE_ITEM]
items: ARRAYED_LIST [WSF_WIDGET_TABLE_ITEM]
feature -- Access
new_cursor: ITERATION_CURSOR [CMS_WIDGET_TABLE_ITEM]
new_cursor: ITERATION_CURSOR [WSF_WIDGET_TABLE_ITEM]
do
Result := items.new_cursor
end
@@ -54,14 +54,14 @@ feature -- Access
Result := items.count
end
item (c: INTEGER): CMS_WIDGET_TABLE_ITEM
item (c: INTEGER): WSF_WIDGET_TABLE_ITEM
do
Result := items [c]
end
feature -- Change
set_item (w: CMS_WIDGET_TABLE_ITEM; col: INTEGER)
set_item (w: WSF_WIDGET_TABLE_ITEM; col: INTEGER)
do
if col > items.count then
items.grow (col)
@@ -69,7 +69,7 @@ feature -- Change
until
items.count >= col - 1
loop
items.force (create {CMS_WIDGET_TABLE_ITEM}.make_with_text (""))
items.force (create {WSF_WIDGET_TABLE_ITEM}.make_with_text (""))
end
items.force (w)
else
@@ -77,19 +77,19 @@ feature -- Change
end
end
add_widget (w: CMS_WIDGET)
add_widget (w: WSF_WIDGET)
do
add_item (create {CMS_WIDGET_TABLE_ITEM}.make_with_content (w))
add_item (create {WSF_WIDGET_TABLE_ITEM}.make_with_content (w))
end
force, add_item (w: CMS_WIDGET_TABLE_ITEM)
force, add_item (w: WSF_WIDGET_TABLE_ITEM)
do
items.force (w)
end
feature -- Conversion
append_to_html (a_theme: CMS_THEME; a_html: STRING_8)
append_to_html (a_theme: WSF_THEME; a_html: STRING_8)
do
a_html.append ("<tr")
append_css_class_to (a_html, Void)

View File

@@ -1,14 +1,14 @@
note
description: "Summary description for {CMS_WIDGET_TEXT}."
description: "Summary description for {WSF_WIDGET_TEXT}."
author: ""
date: "$Date$"
revision: "$Revision$"
class
CMS_WIDGET_TEXT
WSF_WIDGET_TEXT
inherit
CMS_WIDGET
WSF_WIDGET
create
make_with_text
@@ -33,7 +33,7 @@ feature -- Change
feature -- Conversion
append_to_html (a_theme: CMS_THEME; a_html: STRING_8)
append_to_html (a_theme: WSF_THEME; a_html: STRING_8)
do
a_html.append (text)
end

View File

@@ -1,10 +1,10 @@
note
description: "Summary description for {WITH_CSS_CLASS}."
description: "Summary description for {WSF_WITH_CSS_CLASS}."
date: "$Date$"
revision: "$Revision$"
deferred class
WITH_CSS_CLASS
WSF_WITH_CSS_CLASS
feature -- Status report

View File

@@ -1,10 +1,10 @@
note
description: "Summary description for {WITH_CSS_ID}."
description: "Summary description for {WSF_WITH_CSS_ID}."
date: "$Date$"
revision: "$Revision$"
deferred class
WITH_CSS_ID
WSF_WITH_CSS_ID
feature -- Status report

View File

@@ -1,10 +1,10 @@
note
description: "Summary description for {WITH_CSS_STYLE}."
description: "Summary description for {WSF_WITH_CSS_STYLE}."
date: "$Date$"
revision: "$Revision$"
deferred class
WITH_CSS_STYLE
WSF_WITH_CSS_STYLE
feature -- Status report

View File

@@ -1,10 +1,10 @@
note
description: "Summary description for {WITH_HTML_ATTRIBUTE}."
description: "Summary description for {WSF_WITH_HTML_ATTRIBUTE}."
date: "$Date$"
revision: "$Revision$"
deferred class
WITH_HTML_ATTRIBUTE
WSF_WITH_HTML_ATTRIBUTE
feature -- Status report

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<system xmlns="http://www.eiffel.com/developers/xml/configuration-1-8-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-8-0 http://www.eiffel.com/developers/xml/configuration-1-8-0.xsd" name="css" uuid="1A3423E5-9B5B-431D-A8C3-1CF638F74B6F" library_target="css">
<target name="css">
<system xmlns="http://www.eiffel.com/developers/xml/configuration-1-8-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-8-0 http://www.eiffel.com/developers/xml/configuration-1-8-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>
<exclude>/.git$</exclude>
@@ -10,6 +10,12 @@
<option warning="true" full_class_checking="true" is_attached_by_default="true" void_safety="all" syntax="standard">
</option>
<library name="base" location="$ISE_LIBRARY/library/base/base-safe.ecf"/>
<cluster name="src" location="." recursive="true"/>
<library name="encoder" location="../../text/encoder/encoder-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="form" location="./form" recursive="true"/>
<cluster name="widget" location="./widget" recursive="true"/>
<cluster name="css" location="./css" recursive="true"/>
<cluster name="api" location="./api" recursive="true"/>
</target>
</system>

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<system xmlns="http://www.eiffel.com/developers/xml/configuration-1-8-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-8-0 http://www.eiffel.com/developers/xml/configuration-1-8-0.xsd" name="css" uuid="1A3423E5-9B5B-431D-A8C3-1CF638F74B6F" library_target="css">
<target name="css">
<system xmlns="http://www.eiffel.com/developers/xml/configuration-1-8-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-8-0 http://www.eiffel.com/developers/xml/configuration-1-8-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>
<exclude>/.git$</exclude>
@@ -10,6 +10,12 @@
<option warning="true" full_class_checking="true" void_safety="none" syntax="standard">
</option>
<library name="base" location="$ISE_LIBRARY/library/base/base.ecf"/>
<cluster name="src" location="." recursive="true"/>
<library name="encoder" location="../../text/encoder/encoder.ecf"/>
<library name="uri_template" location="../../text/parser/uri_template/uri_template.ecf"/>
<library name="wsf" location="../wsf/wsf.ecf"/>
<cluster name="form" location="./form" recursive="true"/>
<cluster name="widget" location="./widget" recursive="true"/>
<cluster name="css" location="./css" recursive="true"/>
<cluster name="api" location="./api" recursive="true"/>
</target>
</system>

View File

@@ -1,52 +0,0 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<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="all" uuid="1172C52C-6979-4293-8F01-80FADA5A2B69">
<description>compile many lib from EWF</description>
<target name="all">
<root all_classes="true"/>
<file_rule>
<exclude>/.git$</exclude>
<exclude>/EIFGENs$</exclude>
<exclude>/.svn$</exclude>
</file_rule>
<option warning="true" full_class_checking="true" is_attached_by_default="true" void_safety="all" syntax="standard">
</option>
<library name="base" location="$ISE_LIBRARY\library\base\base-safe.ecf"/>
<library name="cms" location="..\draft\application\cms\cms-safe.ecf" readonly="false"/>
<library name="connector_cgi" location="..\library\server\ewsgi\connectors\cgi\cgi-safe.ecf" readonly="false"/>
<library name="connector_libfcgi" location="..\library\server\ewsgi\connectors\libfcgi\libfcgi-safe.ecf" readonly="false"/>
<library name="connector_nino" location="..\library\server\ewsgi\connectors\nino\nino-safe.ecf" readonly="false"/>
<library name="connector_null" location="..\library\server\ewsgi\connectors\null\null-safe.ecf" readonly="false"/>
<library name="conneg" location="..\library\network\protocol\CONNEG\conneg-safe.ecf" readonly="false"/>
<library name="css" location="..\draft\library\text\css\css-safe.ecf" readonly="false"/>
<library name="dft_connector_cgi" location="..\library\server\wsf\default\cgi-safe.ecf" readonly="false"/>
<library name="dft_connector_libfcgi" location="..\library\server\wsf\default\libfcgi-safe.ecf" readonly="false"/>
<library name="dft_connector_nino" location="..\library\server\wsf\default\nino-safe.ecf" readonly="false"/>
<library name="dft_connector_openshift" location="..\library\server\wsf\default\openshift-safe.ecf" readonly="false"/>
<library name="encoder" location="..\library\text\encoder\encoder-safe.ecf" readonly="false"/>
<library name="ewf_support" location="..\library\server\ewf_support\ewf_support-safe.ecf" readonly="false"/>
<library name="ewsgi" location="..\library\server\ewsgi\ewsgi-safe.ecf" readonly="false"/>
<library name="ex_filter" location="..\examples\filter\filter-safe.ecf" readonly="false"/>
<library name="ex_restbuck" location="..\examples\restbucksCRUD\restbucks-safe.ecf" readonly="false"/>
<library name="ex_simple" location="..\examples\simple\simple.ecf" readonly="false"/>
<library name="http" location="..\library\network\protocol\http\http-safe.ecf" readonly="false"/>
<library name="http_authorization" location="..\library\server\authentication\http_authorization\http_authorization-safe.ecf" readonly="false"/>
<library name="http_client" location="..\library\network\http_client\http_client-safe.ecf" readonly="false"/>
<library name="thread" location="$ISE_LIBRARY\library\thread\thread-safe.ecf"/>
<library name="wsf" location="..\library\server\wsf\wsf-safe.ecf" readonly="false"/>
<library name="wsf_connector_nino" location="..\library\server\wsf\connector\nino-safe.ecf" readonly="false"/>
<library name="wsf_connector_openshift" location="..\library\server\wsf\connector\openshift-safe.ecf" readonly="false"/>
<library name="wsf_extension" location="..\library\server\wsf\wsf_extension-safe.ecf" readonly="false"/>
<library name="wsf_router_context" location="..\library\server\wsf\wsf_router_context-safe.ecf" readonly="false"/>
<library name="wsf_session" location="..\library\server\wsf\wsf_session-safe.ecf" readonly="false"/>
</target>
<target name="all_windows" extends="all">
<description>Compiling as Windows , on other platforms than Windows</description>
<root all_classes="true"/>
<setting name="platform" value="windows"/>
</target>
<target name="all_unix" extends="all">
<description>Compiling as UNIX , on other platforms than Unix</description>
<root all_classes="true"/>
<setting name="platform" value="unix"/>
</target>
</system>