Added weight into to the CMS_LINK and provide a `sort' feature for CMS_MENU and related.
Protected cms service from registering many time the same module type.
Moved library/persistence/implementation/* under library/persistence/.
Moved site/www/themes to site/themes
For SQLite storage driver, auto create sqlite db file using associated sql script (to be completed).
Added code in demo module to reuse storage for module purpose.
Always call sql_post_execution in sql_query and sql_change, and not anymore by the callers.
Removed is_web and is_html from {CMS_SETUP}, it was not used.
Reused SHARED_*_ENCODER in CMS_ENCODERS
Added CMS_API.logger rather than using directly the SHARED_LOGGER.log ...
Centralize the implementation of current_user in CMS_REQUEST_UTIL
Removed the inheritance on WSF_FILTER for node handlers, since it is useless and unused.
Added CMS_NODE_API and CMS_USER_API
Prefix html id for block generated html items with "block-", to avoid css name conflict on "main", "content" or similar.
Code cleaning
This commit is contained in:
@@ -5,8 +5,8 @@
|
||||
<option warning="true" void_safety="all">
|
||||
<assertions precondition="true" postcondition="true" check="true" invariant="true" loop="true" supplier_precondition="true"/>
|
||||
</option>
|
||||
<setting name="console_application" value="true"/>
|
||||
<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="time" location="$ISE_LIBRARY\library\time\time-safe.ecf"/>
|
||||
<cluster name="cms_model" location=".\src\" recursive="true">
|
||||
<file_rule>
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
<option warning="true" void_safety="none">
|
||||
<assertions precondition="true" postcondition="true" check="true" invariant="true" loop="true" supplier_precondition="true"/>
|
||||
</option>
|
||||
<setting name="console_application" value="true"/>
|
||||
<library name="base" location="$ISE_LIBRARY\library\base\base.ecf"/>
|
||||
<library name="base_extension" location="$ISE_LIBRARY\library\base_extension\base_extension.ecf"/>
|
||||
<library name="time" location="$ISE_LIBRARY\library\time\time.ecf"/>
|
||||
<cluster name="cms_model" location=".\src\" recursive="true">
|
||||
<file_rule>
|
||||
|
||||
@@ -2,18 +2,29 @@ note
|
||||
description: "[
|
||||
Abstraction to represent a URI link in the CMS system.
|
||||
]"
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
date: "$Date: 2015-02-09 22:29:56 +0100 (lun., 09 févr. 2015) $"
|
||||
revision: "$Revision: 96596 $"
|
||||
|
||||
deferred class
|
||||
CMS_LINK
|
||||
|
||||
inherit
|
||||
REFACTORING_HELPER
|
||||
undefine
|
||||
is_equal
|
||||
end
|
||||
|
||||
DEBUG_OUTPUT
|
||||
undefine
|
||||
is_equal
|
||||
end
|
||||
|
||||
ITERABLE [CMS_LINK]
|
||||
undefine
|
||||
is_equal
|
||||
end
|
||||
|
||||
COMPARABLE
|
||||
|
||||
feature -- Access
|
||||
|
||||
@@ -23,6 +34,21 @@ feature -- Access
|
||||
location: READABLE_STRING_8
|
||||
-- Associated url location.
|
||||
|
||||
weight: INTEGER
|
||||
-- Optional weight used for order.
|
||||
|
||||
feature -- Comparison
|
||||
|
||||
is_less alias "<" (other: like Current): BOOLEAN
|
||||
-- Is current object less than `other'?
|
||||
do
|
||||
if weight = other.weight then
|
||||
Result := title < other.title
|
||||
else
|
||||
Result := weight < other.weight
|
||||
end
|
||||
end
|
||||
|
||||
feature -- status report
|
||||
|
||||
is_active: BOOLEAN
|
||||
@@ -53,6 +79,16 @@ feature -- status report
|
||||
deferred
|
||||
end
|
||||
|
||||
feature -- Element change
|
||||
|
||||
set_weight (a_weight: INTEGER)
|
||||
-- Set `weight' to `a_weight'.
|
||||
do
|
||||
weight := a_weight
|
||||
ensure
|
||||
weight_set: weight = a_weight
|
||||
end
|
||||
|
||||
feature -- Query
|
||||
|
||||
parent: detachable CMS_LINK
|
||||
@@ -84,9 +120,12 @@ feature -- Status report
|
||||
create Result.make_from_string (title)
|
||||
Result.append_string_general (" -> ")
|
||||
Result.append_string_general (location)
|
||||
Result.append_string_general (" [")
|
||||
Result.append_integer (weight)
|
||||
Result.append_string_general ("]")
|
||||
end
|
||||
|
||||
note
|
||||
copyright: "2011-2014, Javier Velilla, Jocelyn Fiat, Eiffel Software and others"
|
||||
copyright: "2011-2015, Javier Velilla, Jocelyn Fiat, Eiffel Software and others"
|
||||
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
||||
end
|
||||
|
||||
@@ -2,8 +2,8 @@ note
|
||||
description: "[
|
||||
Abstraction to represent a links container in the CMS system.
|
||||
]"
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
date: "$Date: 2015-02-09 22:29:56 +0100 (lun., 09 févr. 2015) $"
|
||||
revision: "$Revision: 96596 $"
|
||||
|
||||
deferred class
|
||||
CMS_LINK_COMPOSITE
|
||||
@@ -30,6 +30,27 @@ feature -- Element change
|
||||
deferred
|
||||
end
|
||||
|
||||
sort
|
||||
-- Sort `items' and also recursively in sub items.
|
||||
local
|
||||
l_sorter: QUICK_SORTER [CMS_LINK]
|
||||
do
|
||||
create l_sorter.make (create {COMPARABLE_COMPARATOR [CMS_LINK]})
|
||||
if attached items as lst then
|
||||
l_sorter.sort (lst)
|
||||
across
|
||||
lst as ic
|
||||
loop
|
||||
if
|
||||
attached {CMS_LINK_COMPOSITE} ic.item as l_composite and then
|
||||
not l_composite.is_empty
|
||||
then
|
||||
l_composite.sort
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
feature -- status report
|
||||
|
||||
is_empty: BOOLEAN
|
||||
@@ -47,6 +68,6 @@ feature -- status report
|
||||
end
|
||||
|
||||
note
|
||||
copyright: "2011-2014, Javier Velilla, Jocelyn Fiat, Eiffel Software and others"
|
||||
copyright: "2011-2015, Javier Velilla, Jocelyn Fiat, Eiffel Software and others"
|
||||
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
||||
end
|
||||
|
||||
@@ -2,8 +2,8 @@ note
|
||||
description: "[
|
||||
Abstraction to represent a link to a CMS resource.
|
||||
]"
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
date: "$Date: 2015-02-09 22:29:56 +0100 (lun., 09 févr. 2015) $"
|
||||
revision: "$Revision: 96596 $"
|
||||
|
||||
class
|
||||
CMS_LOCAL_LINK
|
||||
@@ -16,6 +16,8 @@ inherit
|
||||
items as children,
|
||||
extend as add_link,
|
||||
remove as remove_link
|
||||
undefine
|
||||
is_equal
|
||||
end
|
||||
|
||||
create
|
||||
@@ -168,6 +170,6 @@ feature {NONE} -- Implementation
|
||||
invariant
|
||||
|
||||
note
|
||||
copyright: "2011-2014, Javier Velilla, Jocelyn Fiat, Eiffel Software and others"
|
||||
copyright: "2011-2015, Javier Velilla, Jocelyn Fiat, Eiffel Software and others"
|
||||
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
||||
end
|
||||
|
||||
@@ -3,8 +3,8 @@ note
|
||||
Abstraction to represent a MENU in the CMS system.
|
||||
It has items as sub menu/link.
|
||||
]"
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
date: "$Date: 2015-02-09 22:29:56 +0100 (lun., 09 févr. 2015) $"
|
||||
revision: "$Revision: 96596 $"
|
||||
|
||||
class
|
||||
CMS_MENU
|
||||
@@ -61,6 +61,17 @@ feature -- Status report
|
||||
Result := items.is_empty
|
||||
end
|
||||
|
||||
has (lnk: CMS_LINK): BOOLEAN
|
||||
do
|
||||
across
|
||||
items as ic
|
||||
until
|
||||
Result
|
||||
loop
|
||||
Result := ic.item.location.same_string (lnk.location)
|
||||
end
|
||||
end
|
||||
|
||||
feature -- Element change
|
||||
|
||||
extend (lnk: CMS_LINK)
|
||||
@@ -91,6 +102,6 @@ feature -- Access
|
||||
invariant
|
||||
|
||||
note
|
||||
copyright: "2011-2014, Javier Velilla, Jocelyn Fiat, Eiffel Software and others"
|
||||
copyright: "2011-2015, Javier Velilla, Jocelyn Fiat, 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