Merge pull request #7 from jocelyn/cosmetic_20141112

Cosmetic 20141112
This commit is contained in:
jvelilla
2014-11-12 13:19:59 -03:00
10 changed files with 136 additions and 112 deletions

View File

@@ -1,8 +1,14 @@
note note
description: "[ description: "[
Configure the basic settings for a CMS application, for example where to look for themes, the name of the application, etc. Configure the basic settings for a CMS application,
The settings can be configured by default using the current working directory, using the commands provided by the class or by an external configuration file i.e: where to look for themes, name of the application, etc...
The settings can be configured by default:
- using the current working directory,
- using the commands provided by the class
- or by an external configuration file.
]" ]"
class class
CMS_CONFIGURATION CMS_CONFIGURATION
@@ -119,7 +125,7 @@ feature -- Access
end end
end end
site_url (dft: like site_url): READABLE_STRING_8 site_url (dft: like site_url): detachable READABLE_STRING_8
do do
if attached options.item ("site.url") as s then if attached options.item ("site.url") as s then
Result := s Result := s

View File

@@ -35,7 +35,7 @@ feature {NONE} -- Initialization
configure configure
do do
site_id := configuration.site_id site_id := configuration.site_id
site_url := configuration.site_url ("") site_url := configuration.site_url (Void)
site_name := configuration.site_name ("EWF::CMS") site_name := configuration.site_name ("EWF::CMS")
site_email := configuration.site_email ("webmaster") site_email := configuration.site_email ("webmaster")
themes_location := configuration.themes_location themes_location := configuration.themes_location
@@ -104,7 +104,7 @@ feature -- Compute location
-- assets (js, css, images, etc) -- assets (js, css, images, etc)
-- Not used at the moment. -- Not used at the moment.
do do
debug debug ("refactor_fixme")
fixme ("Check if we really need it") fixme ("Check if we really need it")
end end
theme_resource_location := theme_location theme_resource_location := theme_location

View File

@@ -1,11 +1,11 @@
note note
description: "[ description: "[
CMS API Layout, to provide paths CMS Layout providing file system locations for
*config - config
*application - application
*logs - logs
*documentation - documentation
*themes - themes
]" ]"
date: "$Date$" date: "$Date$"
revision: "$Revision$" revision: "$Revision$"

View File

@@ -39,8 +39,8 @@ feature -- Access: Site
site_email: READABLE_STRING_8 site_email: READABLE_STRING_8
-- Email for the site. -- Email for the site.
site_url: READABLE_STRING_8 site_url: detachable READABLE_STRING_8
-- Base url of the site. -- Optional base url of the site.
front_page_path: detachable READABLE_STRING_8 front_page_path: detachable READABLE_STRING_8
-- Optional path defining the front page. -- Optional path defining the front page.

View File

@@ -94,7 +94,9 @@ feature -- Access: Node
nodes: LIST[CMS_NODE] nodes: LIST[CMS_NODE]
-- List of nodes. -- List of nodes.
do do
debug ("refactor_fixme")
fixme ("Implementation") fixme ("Implementation")
end
Result := storage.recent_nodes (0, 10) Result := storage.recent_nodes (0, 10)
end end
@@ -107,7 +109,9 @@ feature -- Access: Node
node (a_id: INTEGER_64): detachable CMS_NODE node (a_id: INTEGER_64): detachable CMS_NODE
-- Node by ID. -- Node by ID.
do do
debug ("refactor_fixme")
fixme ("Check preconditions") fixme ("Check preconditions")
end
Result := storage.node (a_id) Result := storage.node (a_id)
end end
@@ -134,21 +138,27 @@ feature -- Change: Node
update_node_title (a_id: like {CMS_USER}.id; a_node_id: like {CMS_NODE}.id; a_title: READABLE_STRING_32) update_node_title (a_id: like {CMS_USER}.id; a_node_id: like {CMS_NODE}.id; a_title: READABLE_STRING_32)
-- Update node title, with user identified by `a_id', with node id `a_node_id' and a new title `a_title'. -- Update node title, with user identified by `a_id', with node id `a_node_id' and a new title `a_title'.
do do
debug ("refactor_fixme")
fixme ("Check preconditions") fixme ("Check preconditions")
end
storage.update_node_title (a_id,a_node_id,a_title) storage.update_node_title (a_id,a_node_id,a_title)
end end
update_node_summary (a_id: like {CMS_USER}.id; a_node_id: like {CMS_NODE}.id; a_summary: READABLE_STRING_32) update_node_summary (a_id: like {CMS_USER}.id; a_node_id: like {CMS_NODE}.id; a_summary: READABLE_STRING_32)
-- Update node summary, with user identified by `a_id', with node id `a_node_id' and a new summary `a_summary'. -- Update node summary, with user identified by `a_id', with node id `a_node_id' and a new summary `a_summary'.
do do
debug ("refactor_fixme")
fixme ("Check preconditions") fixme ("Check preconditions")
end
storage.update_node_summary (a_id,a_node_id, a_summary) storage.update_node_summary (a_id,a_node_id, a_summary)
end end
update_node_content (a_id: like {CMS_USER}.id; a_node_id: like {CMS_NODE}.id; a_content: READABLE_STRING_32) update_node_content (a_id: like {CMS_USER}.id; a_node_id: like {CMS_NODE}.id; a_content: READABLE_STRING_32)
-- Update node content, with user identified by `a_id', with node id `a_node_id' and a new content `a_content'. -- Update node content, with user identified by `a_id', with node id `a_node_id' and a new content `a_content'.
do do
debug ("refactor_fixme")
fixme ("Check preconditions") fixme ("Check preconditions")
end
storage.update_node_content (a_id,a_node_id, a_content) storage.update_node_content (a_id,a_node_id, a_content)
end end
@@ -172,9 +182,11 @@ feature -- Change User
then then
storage.save_user (a_user) storage.save_user (a_user)
else else
debug ("refactor_fixme")
fixme ("Add error") fixme ("Add error")
end end
end end
end
feature {NONE} -- Implemenataion feature {NONE} -- Implemenataion

View File

@@ -245,7 +245,7 @@ feature -- Execution
execute_default (req: WSF_REQUEST; res: WSF_RESPONSE) execute_default (req: WSF_REQUEST; res: WSF_RESPONSE)
-- Default request handler if no other are relevant -- Default request handler if no other are relevant
do do
fixme ("To Implement") to_implement ("Default response for CMS_SERVICE")
end end
note note

View File

@@ -29,6 +29,7 @@ feature {NONE} -- Initialization
get_theme get_theme
create menu_system.make create menu_system.make
initialize_block_region_settings initialize_block_region_settings
create hook_subscribers.make (0)
register_hooks register_hooks
end end
@@ -273,10 +274,12 @@ feature -- Blocks initialization
local local
l_table: like block_region_settings l_table: like block_region_settings
do do
debug ("refactor_fixme")
fixme ("CHECK:Can we use the same structure as in theme.info?") fixme ("CHECK:Can we use the same structure as in theme.info?")
fixme ("let the user choose ...")
end
create regions.make_caseless (5) create regions.make_caseless (5)
fixme ("let the user choose ...")
create l_table.make_caseless (10) create l_table.make_caseless (10)
l_table["top"] := "top" l_table["top"] := "top"
l_table["header"] := "header" l_table["header"] := "header"
@@ -337,7 +340,9 @@ feature -- Blocks
get_blocks get_blocks
do do
debug ("refactor_fixme")
fixme ("find a way to have this in configuration or database, and allow different order") fixme ("find a way to have this in configuration or database, and allow different order")
end
add_block (top_header_block, "top") add_block (top_header_block, "top")
add_block (header_block, "header") add_block (header_block, "header")
if attached message_block as m then if attached message_block as m then
@@ -476,118 +481,111 @@ feature -- Blocks
create Result.make ("made_with", Void, made_with_html, Void) create Result.make ("made_with", Void, made_with_html, Void)
end end
feature -- Hook: value alter
subscribe_to_value_table_alter_hook (h: like value_table_alter_hooks.item) feature -- Hooks
hook_subscribers: HASH_TABLE [LIST [CMS_HOOK], TYPE [CMS_HOOK]]
-- Hook indexed by hook identifier.
subscribe_to_hook (h: CMS_HOOK; a_hook_type: TYPE [CMS_HOOK])
-- Subscribe `h' to hooks identified by `a_hook_type'.
local local
lst: like value_table_alter_hooks lst: detachable LIST [CMS_HOOK]
do do
lst := value_table_alter_hooks lst := hook_subscribers.item (a_hook_type)
if lst = Void then if lst = Void then
create lst.make (1) create {ARRAYED_LIST [CMS_HOOK]} lst.make (1)
value_table_alter_hooks := lst hook_subscribers.force (lst, a_hook_type)
end end
if not lst.has (h) then if not lst.has (h) then
lst.force (h) lst.force (h)
end end
end end
value_table_alter_hooks: detachable ARRAYED_LIST [CMS_HOOK_VALUE_TABLE_ALTER] feature -- Hook: value alter
invoke_value_table_alter (m: CMS_VALUE_TABLE) subscribe_to_value_table_alter_hook (h: CMS_HOOK_VALUE_TABLE_ALTER)
-- Add `h' as subscriber of value table alter hooks CMS_HOOK_VALUE_TABLE_ALTER.
do do
if attached value_table_alter_hooks as lst then subscribe_to_hook (h, {CMS_HOOK_VALUE_TABLE_ALTER})
end
invoke_value_table_alter (a_table: CMS_VALUE_TABLE)
-- Invoke value table alter hook for table `a_table'.
do
if attached hook_subscribers.item ({CMS_HOOK_VALUE_TABLE_ALTER}) as lst then
across across
lst as c lst as c
loop loop
c.item.value_table_alter (m, Current) if attached {CMS_HOOK_VALUE_TABLE_ALTER} c.item as h then
h.value_table_alter (a_table, Current)
end
end end
end end
end end
feature -- Hook: menu_system_alter feature -- Hook: menu_system_alter
subscribe_to_menu_system_alter_hook (h: like menu_system_alter_hooks.item) subscribe_to_menu_system_alter_hook (h: CMS_HOOK_MENU_SYSTEM_ALTER)
local -- Add `h' as subscriber of menu system alter hooks CMS_HOOK_MENU_SYSTEM_ALTER.
lst: like menu_system_alter_hooks
do do
lst := menu_system_alter_hooks subscribe_to_hook (h, {CMS_HOOK_MENU_SYSTEM_ALTER})
if lst = Void then
create lst.make (1)
menu_system_alter_hooks := lst
end
if not lst.has (h) then
lst.force (h)
end
end end
menu_system_alter_hooks: detachable ARRAYED_LIST [CMS_HOOK_MENU_SYSTEM_ALTER] invoke_menu_system_alter (a_menu_system: CMS_MENU_SYSTEM)
-- Invoke menu system alter hook for menu `a_menu_system'.
invoke_menu_system_alter (m: CMS_MENU_SYSTEM )
do do
if attached menu_system_alter_hooks as lst then if attached hook_subscribers.item ({CMS_HOOK_MENU_SYSTEM_ALTER}) as lst then
across across
lst as c lst as c
loop loop
c.item.menu_system_alter (m, Current) if attached {CMS_HOOK_MENU_SYSTEM_ALTER} c.item as h then
h.menu_system_alter (a_menu_system, Current)
end
end end
end end
end end
feature -- Hook: menu_alter feature -- Hook: menu_alter
subscribe_to_menu_alter_hook (h: like menu_alter_hooks.item) subscribe_to_menu_alter_hook (h: CMS_HOOK_MENU_ALTER)
local -- Add `h' as subscriber of menu alter hooks CMS_HOOK_MENU_ALTER.
lst: like menu_alter_hooks
do do
lst := menu_alter_hooks subscribe_to_hook (h, {CMS_HOOK_MENU_ALTER})
if lst = Void then
create lst.make (1)
menu_alter_hooks := lst
end
if not lst.has (h) then
lst.force (h)
end
end end
menu_alter_hooks: detachable ARRAYED_LIST [CMS_HOOK_MENU_ALTER] invoke_menu_alter (a_menu: CMS_MENU)
-- Invoke menu alter hook for menu `a_menu'.
invoke_menu_alter (m: CMS_MENU)
do do
if attached menu_alter_hooks as lst then if attached hook_subscribers.item ({CMS_HOOK_MENU_ALTER}) as lst then
across across
lst as c lst as c
loop loop
c.item.menu_alter (m, Current) if attached {CMS_HOOK_MENU_ALTER} c.item as h then
h.menu_alter (a_menu, Current)
end
end end
end end
end end
feature -- Hook: form_alter feature -- Hook: form_alter
subscribe_to_form_alter_hook (h: like form_alter_hooks.item) subscribe_to_form_alter_hook (h: CMS_HOOK_FORM_ALTER)
local -- Add `h' as subscriber of form alter hooks CMS_HOOK_FORM_ALTER.
lst: like form_alter_hooks
do do
lst := form_alter_hooks subscribe_to_hook (h, {CMS_HOOK_MENU_ALTER})
if lst = Void then
create lst.make (1)
form_alter_hooks := lst
end
if not lst.has (h) then
lst.force (h)
end
end end
form_alter_hooks: detachable ARRAYED_LIST [CMS_HOOK_FORM_ALTER] invoke_form_alter (a_form: CMS_FORM; a_form_data: detachable WSF_FORM_DATA)
-- Invoke form alter hook for form `a_form' and associated data `a_form_data'
invoke_form_alter (f: CMS_FORM; a_form_data: detachable WSF_FORM_DATA)
do do
if attached form_alter_hooks as lst then if attached hook_subscribers.item ({CMS_HOOK_FORM_ALTER}) as lst then
across across
lst as c lst as c
loop loop
c.item.form_alter (f, a_form_data, Current) if attached {CMS_HOOK_FORM_ALTER} c.item as h then
h.form_alter (a_form, a_form_data, Current)
end
end end
end end
end end
@@ -595,31 +593,24 @@ feature -- Hook: form_alter
feature -- Hook: block feature -- Hook: block
subscribe_to_block_hook (h: CMS_HOOK_BLOCK) subscribe_to_block_hook (h: CMS_HOOK_BLOCK)
local -- Add `h' as subscriber of hooks CMS_HOOK_BLOCK.
lst: like block_hooks
do do
lst := block_hooks subscribe_to_hook (h, {CMS_HOOK_BLOCK})
if lst = Void then
create lst.make (1)
block_hooks := lst
end end
if not lst.has (h) then
lst.force (h)
end
end
block_hooks: detachable ARRAYED_LIST [CMS_HOOK_BLOCK]
invoke_block invoke_block
-- Invoke block hook in order to get block from modules.
do do
if attached block_hooks as lst then if attached hook_subscribers.item ({CMS_HOOK_BLOCK}) as lst then
across across
lst as c lst as c
loop loop
if attached {CMS_HOOK_BLOCK} c.item as h then
across across
c.item.block_list as blst h.block_list as blst
loop loop
c.item.get_block_view (blst.item, Current) h.get_block_view (blst.item, Current)
end
end end
end end
end end
@@ -809,7 +800,9 @@ feature -- Generation
common_prepare (page: CMS_HTML_PAGE) common_prepare (page: CMS_HTML_PAGE)
-- Common preparation for page `page'. -- Common preparation for page `page'.
do do
debug ("refactor_fixme")
fixme ("Fix generation common") fixme ("Fix generation common")
end
-- Information -- Information
page.set_title (title) page.set_title (title)

View File

@@ -37,7 +37,9 @@ feature -- Conversion
menu_html (a_menu: CMS_MENU; is_horizontal: BOOLEAN): STRING_8 menu_html (a_menu: CMS_MENU; is_horizontal: BOOLEAN): STRING_8
do do
debug ("refactor_fixme")
fixme ("Refactor HTML code to use the new Bootstrap theme template") fixme ("Refactor HTML code to use the new Bootstrap theme template")
end
create Result.make_from_string ("<div id=%""+ a_menu.name +"%" class=%"menu%">") create Result.make_from_string ("<div id=%""+ a_menu.name +"%" class=%"menu%">")
if is_horizontal then if is_horizontal then
Result.append ("<ul class=%"horizontal%" >%N") Result.append ("<ul class=%"horizontal%" >%N")
@@ -57,7 +59,9 @@ feature -- Conversion
local local
s: STRING s: STRING
do do
debug ("refactor_fixme")
fixme ("Refactor HTML code to use the new Bootstrap theme template") fixme ("Refactor HTML code to use the new Bootstrap theme template")
end
if attached {CMS_CONTENT_BLOCK} a_block as l_content_block and then l_content_block.is_raw then if attached {CMS_CONTENT_BLOCK} a_block as l_content_block and then l_content_block.is_raw then
create s.make_empty create s.make_empty
if attached l_content_block.title as l_title then if attached l_content_block.title as l_title then
@@ -87,7 +91,9 @@ feature {NONE} -- Implementation
local local
cl: STRING cl: STRING
do do
debug ("refactor_fixme")
fixme ("Remove HTML from Eiffel") fixme ("Remove HTML from Eiffel")
end
create cl.make_empty create cl.make_empty
if lnk.is_active then if lnk.is_active then
cl.append ("active ") cl.append ("active ")

View File

@@ -25,9 +25,13 @@ feature{NONE} -- Initialization
set_creation_date (l_time) set_creation_date (l_time)
set_modification_date (l_time) set_modification_date (l_time)
set_publication_date (l_time) set_publication_date (l_time)
debug ("refactor_fixme")
fixme ("Remove harcode format") fixme ("Remove harcode format")
end
set_format ("HTML") set_format ("HTML")
debug ("refactor_fixme")
fixme ("Remove harcode content type") fixme ("Remove harcode content type")
end
set_content_type ("Page") set_content_type ("Page")
ensure ensure
content_set: content = a_content content_set: content = a_content

View File

@@ -39,7 +39,7 @@ feature -- Access: user
all_users: LIST [CMS_USER] all_users: LIST [CMS_USER]
do do
to_implement("Not implemented!!!") to_implement (generator + ".all_users")
create {ARRAYED_LIST[CMS_USER]} Result.make (0) create {ARRAYED_LIST[CMS_USER]} Result.make (0)
end end
@@ -88,14 +88,14 @@ feature -- User Nodes
user_collaborator_nodes (a_id: like {CMS_USER}.id): LIST[CMS_NODE] user_collaborator_nodes (a_id: like {CMS_USER}.id): LIST[CMS_NODE]
-- Possible list of nodes where the user identified by `a_id', is a collaborator. -- Possible list of nodes where the user identified by `a_id', is a collaborator.
do do
fixme ("Not implemented!!!") to_implement (generator + ".user_collaborator_nodes")
create {ARRAYED_LIST[CMS_NODE]} Result.make (0) create {ARRAYED_LIST[CMS_NODE]} Result.make (0)
end end
user_author_nodes (a_id: like {CMS_USER}.id): LIST[CMS_NODE] user_author_nodes (a_id: like {CMS_USER}.id): LIST[CMS_NODE]
-- Possible list of nodes where the user identified by `a_id', is the author. -- Possible list of nodes where the user identified by `a_id', is the author.
do do
fixme ("Not implemented!!!") to_implement (generator + ".user_author_nodes")
create {ARRAYED_LIST[CMS_NODE]} Result.make (0) create {ARRAYED_LIST[CMS_NODE]} Result.make (0)
end end
@@ -103,12 +103,12 @@ feature -- Access: roles and permissions
user_role_by_id (a_id: like {CMS_USER_ROLE}.id): detachable CMS_USER_ROLE user_role_by_id (a_id: like {CMS_USER_ROLE}.id): detachable CMS_USER_ROLE
do do
fixme ("Not Implemented!!!") to_implement (generator + ".user_role_by_id")
end end
user_roles: LIST [CMS_USER_ROLE] user_roles: LIST [CMS_USER_ROLE]
do do
fixme ("Not Implemented!!!") to_implement (generator + ".user_roles")
create {ARRAYED_LIST[CMS_USER_ROLE]} Result.make (0) create {ARRAYED_LIST[CMS_USER_ROLE]} Result.make (0)
end end
@@ -116,7 +116,7 @@ feature -- Change: roles and permissions
save_user_role (a_user_role: CMS_USER_ROLE) save_user_role (a_user_role: CMS_USER_ROLE)
do do
fixme ("Not Implemented!!!") to_implement (generator + ".save_user_role")
end end
feature -- Change: user feature -- Change: user
@@ -133,6 +133,9 @@ feature -- Change: user
user_provider.new_user (a_user.name, l_password, l_email) user_provider.new_user (a_user.name, l_password, l_email)
connection.commit connection.commit
else else
debug ("refactor_fixme")
fixme ("maybe we should not always carry password, in this case, to implement the else part..")
end
end end
end end