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:
2017-01-20 16:05:40 +01:00
parent 3bcfb0a44a
commit 2d698f604b
59 changed files with 1761 additions and 679 deletions

View File

@@ -0,0 +1,15 @@
#main code, #main e, #main eiffel {
display: block;
font-family: monospace;
white-space: pre-wrap;
border: solid 1px #ccc;
background-color: #fff;
line-height: 1.3;
padding: 10px;
margin: 2px 0 2px 0;
}
#main code.inline, #main e.inline, #main eiffel.inline {
display: inline-block;
padding: 0 2px 0 2px;
margin: 0;
}

View File

@@ -0,0 +1,18 @@
#main {
code, e, eiffel {
display: block;
font-family: monospace;
white-space: pre-wrap;
border: solid 1px #ccc;
background-color: #fff;
line-height: 1.3;
padding: 10px;
margin: 2px 0 2px 0;
&.inline {
display: inline-block;
padding: 0 2px 0 2px;
margin: 0;
}
}
}

View File

@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<system xmlns="http://www.eiffel.com/developers/xml/configuration-1-15-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-15-0 http://www.eiffel.com/developers/xml/configuration-1-15-0.xsd" name="wikitext" uuid="7A757B53-6145-4171-833D-27292F65E34C" library_target="wikitext">
<target name="wikitext">
<root all_classes="true"/>
<file_rule>
<exclude>/EIFGENs$</exclude>
<exclude>/CVS$</exclude>
<exclude>/.svn$</exclude>
</file_rule>
<option warning="true" void_safety="all">
</option>
<setting name="concurrency" value="scoop"/>
<library name="base" location="$ISE_LIBRARY\library\base\base-safe.ecf"/>
<library name="cms" location="..\..\cms-safe.ecf"/>
<library name="cms_model" location="..\..\library\model\cms_model-safe.ecf" readonly="false"/>
<library name="error" location="$ISE_LIBRARY\contrib\library\utility\general\error\error-safe.ecf"/>
<library name="http" location="$ISE_LIBRARY\contrib\library\network\protocol\http\http-safe.ecf"/>
<library name="http_authorization" location="$ISE_LIBRARY\contrib\library\network\authentication\http_authorization\http_authorization-safe.ecf" readonly="false"/>
<library name="text_filter" location="$ISE_LIBRARY\unstable\library\text\text_filter\text_filter-safe.ecf"/>
<library name="wikitext" location="$ISE_LIBRARY\contrib\library\text\parser\wikitext\wikitext-safe.ecf"/>
<library name="wsf" location="$ISE_LIBRARY\contrib\library\web\framework\ewf\wsf\wsf-safe.ecf"/>
<library name="wsf_extension" location="$ISE_LIBRARY\contrib\library\web\framework\ewf\wsf\wsf_extension-safe.ecf" readonly="false"/>
<library name="wsf_html" location="$ISE_LIBRARY\contrib\library\web\framework\ewf\wsf_html\wsf_html-safe.ecf" readonly="false"/>
<cluster name="src" location=".\" recursive="true"/>
</target>
</system>

View File

@@ -0,0 +1,65 @@
note
description: "Summary description for {WIKITEXT_FILTER}."
date: "$Date$"
revision: "$Revision$"
class
WIKITEXT_FILTER
inherit
CONTENT_FILTER
redefine
help
end
STRING_HANDLER
feature -- Access
name: STRING_8 = "wikitext_renderer"
title: STRING_8 = "Wikitext renderer"
help: STRING = "Wikitext rendered as HTML"
description: STRING_8 = "Render Wikitext as HTML."
feature -- Conversion
filter (a_text: STRING_GENERAL)
local
wk: WIKI_CONTENT_TEXT
utf: UTF_CONVERTER
l_wikitext: STRING_8
vis: WIKI_XHTML_GENERATOR
html: STRING
do
if attached {STRING_8} a_text as s8 then
l_wikitext := s8
elseif attached {STRING_32} a_text as s32 then
if s32.is_valid_as_string_8 then
l_wikitext := s32.as_string_8
else
l_wikitext := utf.utf_32_string_to_utf_8_string_8 (s32)
end
else
l_wikitext := utf.utf_32_string_to_utf_8_string_8 (a_text)
end
create wk.make_from_string (l_wikitext)
if attached wk.structure as st then
create html.make (l_wikitext.count)
create vis.make (html)
vis.code_aliases.extend ("eiffel")
vis.code_aliases.extend ("e")
st.process (vis)
a_text.set_count (0)
-- if attached {STRING_8} a_text as s8 then
-- s8.wipe_out
-- elseif attached {STRING_32} a_text as s32 then
-- s32.wipe_out
-- end
a_text.append (html)
end
end
end

View File

@@ -0,0 +1,32 @@
note
description: "Summary description for {WIKITEXT_FORMAT}."
date: "$Date$"
revision: "$Revision$"
class
WIKITEXT_FORMAT
inherit
CONTENT_FORMAT
redefine
default_create
end
feature {NONE} -- Initialization
default_create
do
Precursor
create filters.make (1)
filters.force (create {WIKITEXT_FILTER})
end
feature -- Access
name: STRING = "wikitext"
title: STRING_8 = "Wikitext"
filters: ARRAYED_LIST [CONTENT_FILTER]
end

View File

@@ -0,0 +1,80 @@
note
description: "CMS module that bring support for path aliases."
date: "$Date: 2015-02-13 13:08:13 +0100 (ven., 13 févr. 2015) $"
revision: "$Revision: 96616 $"
class
WIKITEXT_MODULE
inherit
CMS_MODULE
rename
module_api as wikitext_api
redefine
initialize,
setup_hooks
end
CMS_HOOK_RESPONSE_ALTER
create
make
feature {NONE} -- Initialization
make (a_setup: CMS_SETUP)
-- Create Current module, disabled by default.
do
version := "1.0"
description := "Wikitext module"
package := "filter"
config := a_setup
end
config: CMS_SETUP
-- Node configuration.
feature -- Access
name: STRING = "wikitext"
feature {CMS_API} -- Module Initialization
initialize (api: CMS_API)
-- <Precursor>
local
f: CMS_FORMAT
do
Precursor (api)
create f.make_from_format (create {WIKITEXT_FORMAT})
api.formats.extend (f)
-- FIXME!!!
across
api.content_types as ic
loop
ic.item.extend_format (f)
end
end
feature -- Router
setup_router (a_router: WSF_ROUTER; a_api: CMS_API)
-- Setup url dispatching for Current module.
do
end
feature -- Hooks
setup_hooks (a_hooks: CMS_HOOK_CORE_MANAGER)
do
a_hooks.subscribe_to_response_alter_hook (Current)
end
response_alter (a_response: CMS_RESPONSE)
do
a_response.add_style (a_response.url ("/module/" + name + "/files/css/wikitext.css", Void), Void)
end
end