- 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]].
87 lines
2.1 KiB
Plaintext
87 lines
2.1 KiB
Plaintext
note
|
|
description: "Access to the sql database for the page module"
|
|
date: "$Date$"
|
|
revision: "$Revision$"
|
|
|
|
class
|
|
CMS_PAGE_STORAGE_SQL
|
|
|
|
inherit
|
|
CMS_NODE_STORAGE_SQL
|
|
|
|
CMS_PAGE_STORAGE_I
|
|
|
|
create
|
|
make
|
|
|
|
feature -- Access
|
|
|
|
children (a_node: CMS_NODE): detachable LIST [CMS_NODE]
|
|
-- <Precursor>
|
|
local
|
|
l_parameters: STRING_TABLE [detachable ANY]
|
|
do
|
|
create {ARRAYED_LIST [CMS_NODE]} Result.make (0)
|
|
|
|
error_handler.reset
|
|
write_information_log (generator + ".children")
|
|
|
|
from
|
|
create l_parameters.make (1)
|
|
l_parameters.put (a_node.id, "nid")
|
|
sql_query (sql_select_children_of_node, l_parameters)
|
|
sql_start
|
|
until
|
|
sql_after
|
|
loop
|
|
if attached fetch_node as l_node then
|
|
Result.force (l_node)
|
|
end
|
|
sql_forth
|
|
end
|
|
sql_finalize
|
|
end
|
|
|
|
available_parents_for_node (a_node: CMS_NODE): LIST [CMS_NODE]
|
|
-- <Precursor>
|
|
local
|
|
l_parameters: STRING_TABLE [detachable ANY]
|
|
do
|
|
create {ARRAYED_LIST [CMS_NODE]} Result.make (0)
|
|
|
|
error_handler.reset
|
|
write_information_log (generator + ".available_parents_for_node")
|
|
|
|
from
|
|
create l_parameters.make (1)
|
|
l_parameters.put (a_node.id, "nid")
|
|
sql_query (sql_select_available_parents_for_node, l_parameters)
|
|
sql_start
|
|
until
|
|
sql_after
|
|
loop
|
|
if attached fetch_node as l_node then
|
|
Result.force (l_node)
|
|
end
|
|
sql_forth
|
|
end
|
|
sql_finalize
|
|
end
|
|
|
|
|
|
feature {NONE} -- Queries
|
|
|
|
sql_select_available_parents_for_node : STRING = "[
|
|
SELECT node.nid, node.revision, node.type, title, summary, content, format, author, publish, created, changed, status
|
|
FROM nodes node LEFT JOIN page_nodes pn ON node.nid = pn.nid AND node.nid != :nid
|
|
WHERE node.nid != :nid AND pn.parent != :nid AND node.status != -1 GROUP BY node.nid, node.revision;
|
|
]"
|
|
|
|
sql_select_children_of_node: STRING = "[
|
|
SELECT node.nid, node.revision, node.type, title, summary, content, format, author, publish, created, changed, status
|
|
FROM nodes node LEFT JOIN page_nodes pn ON node.nid = pn.nid
|
|
WHERE pn.parent = :nid AND node.status != -1 GROUP BY node.nid, node.revision;
|
|
]"
|
|
|
|
end
|