Extracted page support from cms_node_module, and add a proper CMS_PAGE_MODULE.
- now, the CMS_PAGE_MODULE has to be declared in the related CMS_SETUP via CMS_EXECUTION. (See demo for example) Improved the export facilities. Implemented blog and page export. Added import facilities. Implemented blog and page import. Improved node revision web interface (allow to edit a past revision, in order to restore it as latest revisionm i.e current). Removed specific tag from blog module, and reuse the taxonomy module for that purpose. Added WIKITEXT module that provide a WIKITEXT_FILTER, so now we can have wikitext content. - for now, no support for wiki links such as [[Foobar]].
This commit is contained in:
@@ -234,7 +234,7 @@ feature -- Hook: export
|
||||
subscribe_to_hook (h, {CMS_HOOK_EXPORT})
|
||||
end
|
||||
|
||||
invoke_export_to (a_export_id_list: detachable ITERABLE [READABLE_STRING_GENERAL]; a_export_parameters: CMS_EXPORT_PARAMETERS; a_response: CMS_RESPONSE)
|
||||
invoke_export_to (a_export_id_list: detachable ITERABLE [READABLE_STRING_GENERAL]; a_export_parameters: CMS_EXPORT_CONTEXT; a_response: CMS_RESPONSE)
|
||||
-- Invoke response alter hook for response `a_response'.
|
||||
local
|
||||
d: DIRECTORY
|
||||
@@ -254,7 +254,36 @@ feature -- Hook: export
|
||||
end
|
||||
end
|
||||
|
||||
feature -- Hook: import
|
||||
|
||||
subscribe_to_import_hook (h: CMS_HOOK_IMPORT)
|
||||
-- Add `h' as subscriber of import hooks CMS_HOOK_IMPORT.
|
||||
do
|
||||
subscribe_to_hook (h, {CMS_HOOK_IMPORT})
|
||||
end
|
||||
|
||||
invoke_import_from (a_import_id_list: detachable ITERABLE [READABLE_STRING_GENERAL]; a_import_ctx: CMS_IMPORT_CONTEXT; a_response: CMS_RESPONSE)
|
||||
-- Invoke response alter hook for response `a_response'.
|
||||
local
|
||||
d: DIRECTORY
|
||||
do
|
||||
if attached subscribers ({CMS_HOOK_IMPORT}) as lst then
|
||||
create d.make_with_path (a_import_ctx.location)
|
||||
if not d.exists then
|
||||
d.recursive_create_dir
|
||||
end
|
||||
across
|
||||
lst as ic
|
||||
loop
|
||||
if attached {CMS_HOOK_IMPORT} ic.item as h then
|
||||
h.import_from (a_import_id_list, a_import_ctx, a_response)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
note
|
||||
copyright: "2011-2016, Jocelyn Fiat, Javier Velilla, Eiffel Software and others"
|
||||
copyright: "2011-2017, Jocelyn Fiat, Javier Velilla, Eiffel Software and others"
|
||||
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
||||
end
|
||||
|
||||
@@ -6,7 +6,7 @@ note
|
||||
revision: "$Revision$"
|
||||
|
||||
class
|
||||
CMS_EXPORT_PARAMETERS
|
||||
CMS_EXPORT_CONTEXT
|
||||
|
||||
create
|
||||
make
|
||||
@@ -13,19 +13,19 @@ inherit
|
||||
|
||||
feature -- Hook
|
||||
|
||||
export_to (a_export_id_list: detachable ITERABLE [READABLE_STRING_GENERAL]; a_export_parameters: CMS_EXPORT_PARAMETERS; a_response: CMS_RESPONSE)
|
||||
export_to (a_export_id_list: detachable ITERABLE [READABLE_STRING_GENERAL]; a_export_ctx: CMS_EXPORT_CONTEXT; a_response: CMS_RESPONSE)
|
||||
-- Export data identified by `a_export_id_list',
|
||||
-- or export all data if `a_export_id_list' is Void.
|
||||
deferred
|
||||
end
|
||||
|
||||
-- export_identifiers: detachable ITERABLE [READABLE_STRING_32]
|
||||
-- export_identifiers: detachable ITERABLE [READABLE_STRING_GENERAL]
|
||||
-- -- Optional list of exportation ids, if any.
|
||||
-- do
|
||||
-- -- To redefine if needed.
|
||||
-- end
|
||||
|
||||
note
|
||||
copyright: "2011-2015, Jocelyn Fiat, Javier Velilla, Eiffel Software and others"
|
||||
copyright: "2011-2017, Jocelyn Fiat, Javier Velilla, Eiffel Software and others"
|
||||
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
||||
end
|
||||
|
||||
23
src/hooks/import/cms_hook_import.e
Normal file
23
src/hooks/import/cms_hook_import.e
Normal file
@@ -0,0 +1,23 @@
|
||||
note
|
||||
description: "Summary description for {CMS_HOOK_IMPORT}."
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
deferred class
|
||||
CMS_HOOK_IMPORT
|
||||
|
||||
inherit
|
||||
CMS_HOOK
|
||||
|
||||
feature -- Hook
|
||||
|
||||
import_from (a_impot_id_list: detachable ITERABLE [READABLE_STRING_GENERAL]; a_import_ctx: CMS_IMPORT_CONTEXT; a_response: CMS_RESPONSE)
|
||||
-- Import data identified by `a_import_id_list',
|
||||
-- or import all data if `a_import_id_list' is Void.
|
||||
deferred
|
||||
end
|
||||
|
||||
note
|
||||
copyright: "2011-2017, Jocelyn Fiat, Javier Velilla, Eiffel Software and others"
|
||||
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
||||
end
|
||||
43
src/hooks/import/cms_import_context.e
Normal file
43
src/hooks/import/cms_import_context.e
Normal file
@@ -0,0 +1,43 @@
|
||||
note
|
||||
description: "[
|
||||
Parameters used by CMS_HOOK_IMPORT subscribers.
|
||||
]"
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
class
|
||||
CMS_IMPORT_CONTEXT
|
||||
|
||||
create
|
||||
make
|
||||
|
||||
feature {NONE} -- Initialization
|
||||
|
||||
make (a_location: PATH)
|
||||
do
|
||||
location := a_location
|
||||
create logs.make (10)
|
||||
end
|
||||
|
||||
feature -- Access
|
||||
|
||||
location: PATH
|
||||
-- Location of import folder.
|
||||
|
||||
feature -- Logs
|
||||
|
||||
logs: ARRAYED_LIST [READABLE_STRING_8]
|
||||
-- Associated importation logs.
|
||||
|
||||
log (m: READABLE_STRING_8)
|
||||
-- Add message `m' into `logs'.
|
||||
do
|
||||
logs.force (m)
|
||||
end
|
||||
|
||||
invariant
|
||||
|
||||
note
|
||||
copyright: "2011-2017, Jocelyn Fiat, Javier Velilla, Eiffel Software and others"
|
||||
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
||||
end
|
||||
57
src/hooks/import/cms_import_json_utilities.e
Normal file
57
src/hooks/import/cms_import_json_utilities.e
Normal file
@@ -0,0 +1,57 @@
|
||||
note
|
||||
description: "[
|
||||
Usefull routines to import to JSON.
|
||||
]"
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
class
|
||||
CMS_IMPORT_JSON_UTILITIES
|
||||
|
||||
feature -- Access
|
||||
|
||||
json_string_item (j: JSON_OBJECT; a_name: READABLE_STRING_GENERAL): detachable STRING_32
|
||||
do
|
||||
if attached {JSON_STRING} j.item (a_name) as s then
|
||||
Result := s.unescaped_string_32
|
||||
end
|
||||
end
|
||||
|
||||
json_string_8_item (j: JSON_OBJECT; a_name: READABLE_STRING_GENERAL): detachable STRING_8
|
||||
do
|
||||
if attached {JSON_STRING} j.item (a_name) as s then
|
||||
Result := s.unescaped_string_8
|
||||
end
|
||||
end
|
||||
|
||||
json_integer_item (j: JSON_OBJECT; a_name: READABLE_STRING_GENERAL): INTEGER_64
|
||||
local
|
||||
s: READABLE_STRING_GENERAL
|
||||
do
|
||||
if attached {JSON_NUMBER} j.item (a_name) as i then
|
||||
Result := i.integer_64_item
|
||||
elseif attached {JSON_STRING} j.item (a_name) as js then
|
||||
s := js.unescaped_string_32
|
||||
if s.is_integer_64 then
|
||||
Result := s.to_integer_64
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
json_date_item (j: JSON_OBJECT; a_name: READABLE_STRING_GENERAL): detachable DATE_TIME
|
||||
local
|
||||
hd: HTTP_DATE
|
||||
do
|
||||
if attached {JSON_NUMBER} j.item (a_name) as num then
|
||||
create hd.make_from_timestamp (num.integer_64_item)
|
||||
Result := hd.date_time
|
||||
elseif attached {JSON_STRING} j.item (a_name) as s then
|
||||
create hd.make_from_string (s.unescaped_string_32)
|
||||
Result := hd.date_time
|
||||
end
|
||||
end
|
||||
|
||||
note
|
||||
copyright: "2011-2017, Jocelyn Fiat, Javier Velilla, Eiffel Software and others"
|
||||
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
||||
end
|
||||
Reference in New Issue
Block a user