diff --git a/cms/src/configuration/cms_configuration.e b/cms/src/configuration/cms_configuration.e index 99de5c4..ae7f91a 100644 --- a/cms/src/configuration/cms_configuration.e +++ b/cms/src/configuration/cms_configuration.e @@ -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 CMS_CONFIGURATION @@ -15,7 +20,7 @@ create feature {NONE} -- Initialization make (a_layout: CMS_LAYOUT) - -- Initialize `Current'. + -- Initialize `Current' with layout `a_layout'. do layout := a_layout create options.make_equal (10) @@ -36,6 +41,7 @@ feature -- Access configuration_location: detachable PATH + -- Path to configuration location. option (a_name: READABLE_STRING_GENERAL): detachable ANY do diff --git a/cms/src/configuration/cms_default_setup.e b/cms/src/configuration/cms_default_setup.e index 76dcab2..a2c38f6 100644 --- a/cms/src/configuration/cms_default_setup.e +++ b/cms/src/configuration/cms_default_setup.e @@ -16,6 +16,7 @@ create feature {NONE} -- Initialization make (a_layout: CMS_LAYOUT) + -- Create a default setup with `a_layout'. do layout := a_layout create configuration.make (layout) @@ -23,6 +24,7 @@ feature {NONE} -- Initialization end initialize + -- Initialize varius cms components. do configure create modules.make (3) @@ -36,9 +38,6 @@ feature {NONE} -- Initialization site_url := configuration.site_url ("") site_name := configuration.site_name ("EWF::CMS") 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 theme_name := configuration.theme_name ("default") @@ -47,6 +46,7 @@ feature {NONE} -- Initialization end initialize_modules + -- Intialize core modules. local m: CMS_MODULE do @@ -104,6 +104,9 @@ feature -- Compute location -- assets (js, css, images, etc) -- Not used at the moment. do + debug + fixme ("Check if we really need it") + end theme_resource_location := theme_location end diff --git a/cms/src/configuration/cms_layout.e b/cms/src/configuration/cms_layout.e index 3037b5b..08297f5 100644 --- a/cms/src/configuration/cms_layout.e +++ b/cms/src/configuration/cms_layout.e @@ -1,5 +1,12 @@ note - description: "Summary description for {CMS_LAYOUT}." + description: "[ + CMS API Layout, to provide paths + *config + *application + *logs + *documentation + *themes + ]" date: "$Date$" revision: "$Revision$" diff --git a/cms/src/configuration/cms_setup.e b/cms/src/configuration/cms_setup.e index 58b0e31..f5dd46f 100644 --- a/cms/src/configuration/cms_setup.e +++ b/cms/src/configuration/cms_setup.e @@ -1,5 +1,5 @@ note - description: "Summary description for {CMS_SETUP}." + description: "Class that enable to set basic configuration, application layout, core modules and themes." date: "$Date$" revision: "$Revision$" @@ -34,16 +34,13 @@ feature -- Access: Site site_id: READABLE_STRING_8 site_name: READABLE_STRING_32 + -- Name of the site. site_email: READABLE_STRING_8 + -- Email for the site. site_url: READABLE_STRING_8 - - site_dir: PATH - - site_var_dir: PATH - - files_location: PATH + -- Base url of the site. front_page_path: detachable READABLE_STRING_8 -- Optional path defining the front page. @@ -52,11 +49,13 @@ feature -- Access: Site feature -- Access: Theme themes_location: PATH + -- Path to themes. theme_location: PATH + -- Path to a particular theme. theme_resource_location: PATH - -- + -- Path to a particular theme resource. theme_information_location: PATH -- theme informations. @@ -65,6 +64,6 @@ feature -- Access: Theme end theme_name: READABLE_STRING_32 - -- theme name + -- theme name. end diff --git a/cms/src/service/cms_api.e b/cms/src/service/cms_api.e index 877bbf7..a727b41 100644 --- a/cms/src/service/cms_api.e +++ b/cms/src/service/cms_api.e @@ -1,5 +1,5 @@ note - description: "Summary description for {CMS_API}." + description: "API for a CMS" date: "$Date$" revision: "$Revision$" @@ -18,20 +18,22 @@ create feature -- Initialize make (a_setup: CMS_SETUP) - -- Create the API service with an storege `a_storage'. + -- Create the API service with a setup `a_setup' do setup := a_setup create error_handler.make initialize set_successful ensure --- storage_set: storage = a_storage + setup_set: setup = a_setup + error_handler_set: not error_handler.has_error end setup: CMS_SETUP -- CMS setup. initialize + -- Initialize the persitent layer. local l_database: DATABASE_CONNECTION retried: BOOLEAN @@ -81,9 +83,10 @@ feature -- Access 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 - Result := storage.is_valid_credential (l_auth_login, l_auth_password) + Result := storage.is_valid_credential (a_auth_login, a_auth_password) end feature -- Access: Node @@ -111,34 +114,39 @@ feature -- Access: Node feature -- Change: Node new_node (a_node: CMS_NODE) - -- Add a new node + -- Add a new node `a_node' do storage.save_node (a_node) end delete_node (a_id: INTEGER_64) + -- Delete a node identified by `a_id', if any. do storage.delete_node (a_id) end update_node (a_id: like {CMS_USER}.id; a_node: CMS_NODE) + -- Update node by id `a_id' with `a_node' data. do storage.update_node (a_id,a_node) 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, with user identified by `a_id', with node id `a_node_id' and a new title `a_title'. do fixme ("Check preconditions") storage.update_node_title (a_id,a_node_id,a_title) 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, with user identified by `a_id', with node id `a_node_id' and a new summary `a_summary'. do fixme ("Check preconditions") storage.update_node_summary (a_id,a_node_id, a_summary) 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, with user identified by `a_id', with node id `a_node_id' and a new content `a_content'. do fixme ("Check preconditions") storage.update_node_content (a_id,a_node_id, a_content) @@ -148,9 +156,11 @@ feature -- Change: Node feature -- Access: User user_by_name (a_username: READABLE_STRING_32): detachable CMS_USER + -- User by name `a_user_name', if any. do Result := storage.user_by_name (a_username) end + feature -- Change User new_user (a_user: CMS_USER) @@ -171,7 +181,7 @@ feature {NONE} -- Implemenataion storage: CMS_STORAGE - -- Persistence storage + -- Persistence storage. end diff --git a/cms/src/service/cms_service.e b/cms/src/service/cms_service.e index 973bc6e..de634a0 100644 --- a/cms/src/service/cms_service.e +++ b/cms/src/service/cms_service.e @@ -42,11 +42,13 @@ create feature {NONE} -- Initialization make (a_api: CMS_API) - -- Build a CMS service with `a_setup' configuration. + -- Build a CMS service with `a_api' do api := a_api configuration := a_api.setup.configuration initialize + ensure + api_set: api = a_api end initialize diff --git a/examples/roc_api/src/ewf_roc_server.e b/examples/roc_api/src/ewf_roc_server.e index 6edeb1b..35f1a31 100644 --- a/examples/roc_api/src/ewf_roc_server.e +++ b/examples/roc_api/src/ewf_roc_server.e @@ -42,7 +42,7 @@ feature {NONE} -- Initialization -- Initialize current service. do 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) end @@ -59,7 +59,7 @@ feature -- Service feature -- Layout layout: CMS_LAYOUT - -- cms layout + -- cms layout. feature {NONE} -- Launch operation