Merge pull request #6 from jvelilla/roc_template

Updated Descriptions to classes and features
This commit is contained in:
Jocelyn Fiat
2014-11-12 16:51:23 +01:00
7 changed files with 51 additions and 24 deletions

View File

@@ -1,3 +1,8 @@
note
description: "[
Configure the basic settings for a CMS application, for example where to look for themes, the 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
@@ -15,7 +20,7 @@ create
feature {NONE} -- Initialization feature {NONE} -- Initialization
make (a_layout: CMS_LAYOUT) make (a_layout: CMS_LAYOUT)
-- Initialize `Current'. -- Initialize `Current' with layout `a_layout'.
do do
layout := a_layout layout := a_layout
create options.make_equal (10) create options.make_equal (10)
@@ -36,6 +41,7 @@ feature -- Access
configuration_location: detachable PATH configuration_location: detachable PATH
-- Path to configuration location.
option (a_name: READABLE_STRING_GENERAL): detachable ANY option (a_name: READABLE_STRING_GENERAL): detachable ANY
do do

View File

@@ -16,6 +16,7 @@ create
feature {NONE} -- Initialization feature {NONE} -- Initialization
make (a_layout: CMS_LAYOUT) make (a_layout: CMS_LAYOUT)
-- Create a default setup with `a_layout'.
do do
layout := a_layout layout := a_layout
create configuration.make (layout) create configuration.make (layout)
@@ -23,6 +24,7 @@ feature {NONE} -- Initialization
end end
initialize initialize
-- Initialize varius cms components.
do do
configure configure
create modules.make (3) create modules.make (3)
@@ -36,9 +38,6 @@ feature {NONE} -- Initialization
site_url := configuration.site_url ("") site_url := configuration.site_url ("")
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")
site_dir := configuration.root_location
site_var_dir := configuration.var_location
files_location := configuration.files_location
themes_location := configuration.themes_location themes_location := configuration.themes_location
theme_name := configuration.theme_name ("default") theme_name := configuration.theme_name ("default")
@@ -47,6 +46,7 @@ feature {NONE} -- Initialization
end end
initialize_modules initialize_modules
-- Intialize core modules.
local local
m: CMS_MODULE m: CMS_MODULE
do do
@@ -104,6 +104,9 @@ 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
fixme ("Check if we really need it")
end
theme_resource_location := theme_location theme_resource_location := theme_location
end end

View File

@@ -1,5 +1,12 @@
note note
description: "Summary description for {CMS_LAYOUT}." description: "[
CMS API Layout, to provide paths
*config
*application
*logs
*documentation
*themes
]"
date: "$Date$" date: "$Date$"
revision: "$Revision$" revision: "$Revision$"

View File

@@ -1,5 +1,5 @@
note note
description: "Summary description for {CMS_SETUP}." description: "Class that enable to set basic configuration, application layout, core modules and themes."
date: "$Date$" date: "$Date$"
revision: "$Revision$" revision: "$Revision$"
@@ -34,16 +34,13 @@ feature -- Access: Site
site_id: READABLE_STRING_8 site_id: READABLE_STRING_8
site_name: READABLE_STRING_32 site_name: READABLE_STRING_32
-- Name of the site.
site_email: READABLE_STRING_8 site_email: READABLE_STRING_8
-- Email for the site.
site_url: READABLE_STRING_8 site_url: READABLE_STRING_8
-- Base url of the site.
site_dir: PATH
site_var_dir: PATH
files_location: PATH
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.
@@ -52,11 +49,13 @@ feature -- Access: Site
feature -- Access: Theme feature -- Access: Theme
themes_location: PATH themes_location: PATH
-- Path to themes.
theme_location: PATH theme_location: PATH
-- Path to a particular theme.
theme_resource_location: PATH theme_resource_location: PATH
-- -- Path to a particular theme resource.
theme_information_location: PATH theme_information_location: PATH
-- theme informations. -- theme informations.
@@ -65,6 +64,6 @@ feature -- Access: Theme
end end
theme_name: READABLE_STRING_32 theme_name: READABLE_STRING_32
-- theme name -- theme name.
end end

View File

@@ -1,5 +1,5 @@
note note
description: "Summary description for {CMS_API}." description: "API for a CMS"
date: "$Date$" date: "$Date$"
revision: "$Revision$" revision: "$Revision$"
@@ -18,20 +18,22 @@ create
feature -- Initialize feature -- Initialize
make (a_setup: CMS_SETUP) make (a_setup: CMS_SETUP)
-- Create the API service with an storege `a_storage'. -- Create the API service with a setup `a_setup'
do do
setup := a_setup setup := a_setup
create error_handler.make create error_handler.make
initialize initialize
set_successful set_successful
ensure ensure
-- storage_set: storage = a_storage setup_set: setup = a_setup
error_handler_set: not error_handler.has_error
end end
setup: CMS_SETUP setup: CMS_SETUP
-- CMS setup. -- CMS setup.
initialize initialize
-- Initialize the persitent layer.
local local
l_database: DATABASE_CONNECTION l_database: DATABASE_CONNECTION
retried: BOOLEAN retried: BOOLEAN
@@ -81,9 +83,10 @@ feature -- Access
feature -- Status Report feature -- Status Report
is_valid_credential (l_auth_login, l_auth_password: READABLE_STRING_32): BOOLEAN is_valid_credential (a_auth_login, a_auth_password: READABLE_STRING_32): BOOLEAN
-- Is the credentials `a_auth_login' and `a_auth_password' valid?
do do
Result := storage.is_valid_credential (l_auth_login, l_auth_password) Result := storage.is_valid_credential (a_auth_login, a_auth_password)
end end
feature -- Access: Node feature -- Access: Node
@@ -111,34 +114,39 @@ feature -- Access: Node
feature -- Change: Node feature -- Change: Node
new_node (a_node: CMS_NODE) new_node (a_node: CMS_NODE)
-- Add a new node -- Add a new node `a_node'
do do
storage.save_node (a_node) storage.save_node (a_node)
end end
delete_node (a_id: INTEGER_64) delete_node (a_id: INTEGER_64)
-- Delete a node identified by `a_id', if any.
do do
storage.delete_node (a_id) storage.delete_node (a_id)
end end
update_node (a_id: like {CMS_USER}.id; a_node: CMS_NODE) update_node (a_id: like {CMS_USER}.id; a_node: CMS_NODE)
-- Update node by id `a_id' with `a_node' data.
do do
storage.update_node (a_id,a_node) storage.update_node (a_id,a_node)
end end
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'.
do do
fixme ("Check preconditions") fixme ("Check preconditions")
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'.
do do
fixme ("Check preconditions") fixme ("Check preconditions")
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'.
do do
fixme ("Check preconditions") fixme ("Check preconditions")
storage.update_node_content (a_id,a_node_id, a_content) storage.update_node_content (a_id,a_node_id, a_content)
@@ -148,9 +156,11 @@ feature -- Change: Node
feature -- Access: User feature -- Access: User
user_by_name (a_username: READABLE_STRING_32): detachable CMS_USER user_by_name (a_username: READABLE_STRING_32): detachable CMS_USER
-- User by name `a_user_name', if any.
do do
Result := storage.user_by_name (a_username) Result := storage.user_by_name (a_username)
end end
feature -- Change User feature -- Change User
new_user (a_user: CMS_USER) new_user (a_user: CMS_USER)
@@ -171,7 +181,7 @@ feature {NONE} -- Implemenataion
storage: CMS_STORAGE storage: CMS_STORAGE
-- Persistence storage -- Persistence storage.
end end

View File

@@ -42,11 +42,13 @@ create
feature {NONE} -- Initialization feature {NONE} -- Initialization
make (a_api: CMS_API) make (a_api: CMS_API)
-- Build a CMS service with `a_setup' configuration. -- Build a CMS service with `a_api'
do do
api := a_api api := a_api
configuration := a_api.setup.configuration configuration := a_api.setup.configuration
initialize initialize
ensure
api_set: api = a_api
end end
initialize initialize

View File

@@ -42,7 +42,7 @@ feature {NONE} -- Initialization
-- Initialize current service. -- Initialize current service.
do do
Precursor Precursor
service_options := create {WSF_SERVICE_LAUNCHER_OPTIONS_FROM_INI}.make_from_file ("roc.ini") create {WSF_SERVICE_LAUNCHER_OPTIONS_FROM_INI} service_options.make_from_file ("roc.ini")
initialize_cms (cms_setup) initialize_cms (cms_setup)
end end
@@ -59,7 +59,7 @@ feature -- Service
feature -- Layout feature -- Layout
layout: CMS_LAYOUT layout: CMS_LAYOUT
-- cms layout -- cms layout.
feature {NONE} -- Launch operation feature {NONE} -- Launch operation