Updated CMS code.

Separated code to have a lib and an example.
Improved design, fixed a few issues related to folder location.

This is still experimental and require more work to be really friendly to use.
This commit is contained in:
Jocelyn Fiat
2013-01-31 15:33:24 +01:00
parent 40ea982293
commit ce469b6ede
136 changed files with 1841 additions and 299 deletions

View File

@@ -0,0 +1,60 @@
note
description: "Summary description for {CMS_MODULE}."
author: ""
date: "$Date$"
revision: "$Revision$"
class
DEMO_MODULE
inherit
CMS_MODULE
create
make
feature {NONE} -- Initialization
make (a_service: like service)
do
service := a_service
name := "demo"
version := "1.0"
description := "demo"
package := "misc"
end
feature {CMS_SERVICE} -- Registration
service: CMS_SERVICE
register (a_service: CMS_SERVICE)
do
a_service.map_uri_template ("/demo/date/{arg}", agent handle_date_time_demo)
a_service.map_uri_template ("/demo/format/{arg}", agent handle_format_demo)
end
feature -- Hooks
links: HASH_TABLE [CMS_MODULE_LINK, STRING]
-- Link indexed by path
local
-- lnk: CMS_MODULE_LINK
do
create Result.make (3)
-- create lnk.make ("Date/time demo")
-- lnk.set_callback (agent process_date_time_demo, <<"arg">>)
-- Result["/demo/date/{arg}"] := lnk
end
handle_date_time_demo (req: WSF_REQUEST; res: WSF_RESPONSE)
do
(create {ANY_CMS_EXECUTION}.make_with_text (req, res, service, "<h1>Demo::date/time</h1>")).execute
end
handle_format_demo (req: WSF_REQUEST; res: WSF_RESPONSE)
do
(create {ANY_CMS_EXECUTION}.make_with_text (req, res, service, "<h1>Demo::format</h1>")).execute
end
end