Commit Graph

59 Commits

Author SHA1 Message Date
jvelilla
18732a9532 Updated Login Module.
- OAUTH LOGIN: is generic based on a new OAUTH_20_GENERIC_API
        - Storage (at the moment only SQL) for OAUTH_CONSUMER configuration.
        - OAUTH login and callback are generic.
        - Added a OAUTH_20_GENERIC_API.
        - Added scripts and templates to build the new OAUTH tables.
        - Fixed CMS_STORAGE_SQL_I.check_sql_query_validity issue.
        - Extended CMS_STORAGE_SQL_I, to execute scripts with paramerters.
        - Updated filter, now it's generic for every OAUTH consumer.
2015-06-11 10:01:36 -03:00
jvelilla
f652aa8a15 Update Login Module.
- Updated routes relative to /account/
     - Updated emails with template support.
     - Updated cookie to support the new route.
     - Updated smarty block templates to use the new path.
2015-06-09 19:44:52 -03:00
jvelilla
96ba3c35a2 OAuth2 Gmail
Added OAuth2 GMAIL loggin/logout support.
      Added OAuth2 Gmail filter.
LoginModule
      Updated LoginModule with OAuth2 Gmail support.
Persitence
      Extended user persitance api with OAuth2 gmail features.
      (TODO refactor persistance as an user extention)
2015-06-08 12:58:33 -03:00
jvelilla
032cc5bdcb Updated CMS with Login Module.
-- The module handle basic_auth (at the moment).
     -- Handle login, logout, register user, activate/reactivate an account, password recovery.
     -- Send notification emails.

CMS Updates
     -- Added a new service: email.
     -- Updated Basic Auth Module to handle logout based on the browser type.
     -- Updated persistence layer to save and remove and query activation token and password token.
     -- Updated CMS_USER to handle status {active, not_active, trashed}.
     -- Updated MySQL scripts to be in sync with SQLite scripts
2015-06-05 18:39:27 -03:00
af8f410684 Updated the CMS pagination component.
Harmonized count type to NATURAL_64 for recent_nodes (more to do later).
Fix get is active code.
2015-06-02 15:39:08 +02:00
70d53b3ef1 Provide a default CMS_MODULE.is_installed: BOOLEAN implementation based on storage of custom value.
Now use CMS_MODULE.is_initialized: BOOLEAN as precondition of many routines.
Instantiation of node storage is now done in NODE_MODULE and not any more in CMS_NODE_API.
CMS_NODE_API can be instantiated only by NODE_MODULE.
2015-05-29 19:20:31 +02:00
91457080fd Added support for base_url (i.e the CMS can be hosted on the root, or sub folder).
Local paths are relative to cms site url (i.e no starting slash).
Favor CMS_RESPONSE.absolute_url and url .. instead of using directly WSF_REQUEST.absolute_script_url and script_url.
Handled unicode truncation issue for logger.
Code cleaning.
2015-05-19 13:44:08 +02:00
51699f3bd3 updated db schema 2015-05-19 12:25:16 +02:00
29ef17226b Added support for path_aliases.
Refactored CMS_MODULE.router (..): WSF_ROUTER design,
  to create only one router object of type CMS_ROUTER.
Added optional CMS_NODE.link: CMS_LOCAL_LINK
Reviewed permissions related to node module.
Refactor and add CMS_STORAGE_SQL(_BUILDER) abstractions
   for implementation relying only on SQL statements.
Factorized sql builder initialization (to work for sqlite and mysql storage builders).
Added CMS_RESPONSE.formatted_string (a_text: READABLE_STRING_GENERAL; args: TUPLE): STRING_32
Added function "translation", but not implemented for now.
Updated indexing notes and comments.
Code cleaning.
2015-05-13 17:11:39 +02:00
9514f1de9c Updated SQLITE builder using GLOBAL_SETTINGS to map 0 to 0, by default 0 -> NULL
Updated CMS_NODE_API, with status, not_published, published and trashed.
Updated Form response to use permission scopes.
Updated sqlquery to retrieve user author.
Added logger info in cms_response
Updated CMS_NODE with a new status attribute.
Updated table nodes to support trashing (or soft deletes) of node using the new status field
Updated Sqlite builder to test different scenarios for users and roles.
Updated NODE_FORM_RESPONSE.edit_form feature to add a delete operation
  if there is a node ie node id >0 and the current user has delete permission on it.
Updated NODE_HANDLER.do_post to handle the operation "DELETE".
Updated queries to retrieve nodes filter by no logical deleted rows (ie. status is trashed).


Signed-off-by: jvelilla <javier.hector@gmail.com>
2015-05-12 22:02:23 +02:00
99b2fa9fdb Commented line registering the MYSQL storage builder,
since it reguires to setup MYSQL environment variable and so on.
So by default, we use sqlite, easier to run out of the box.
2015-04-30 19:38:17 +02:00
dd3688fab8 Now node and basic_auth modules are standalone cms modules (as .ecf library)
Moved to complete void-safety
Use port 9090 for demo by configuration.
2015-04-29 23:27:36 +02:00
6ff7a6493c Simplify CMS_SERVICE initialization, and CMS server (launcher).
Renamed "layout" lib as "app_env" with APPLICATION_ENVIRONMENT interface.
  applied changed to callers.
Added CMS_THEME.has_region (a_name): BOOLEAN to know if a region is declared in a defined theme.
2015-04-29 23:01:42 +02:00
0eb2b70d0f Cleaned the node module, to remove for now the REST api attempt.
This will be redone with care once the web cms is ready.
2015-04-29 20:02:09 +02:00
c982f0ea9c Implemented view node by content type (no more hardcoded cases).
Added CMS_NODE_TYPE as descendant of CMS_CONTENT_TYPE,
  in case we have content which is not a node in the future.
  (probably useless, but for now, this extra abstraction is harmful)
Moved all node related code under node module cluster.
Applied comments from Javier Velilla.
Code cleaning.
2015-04-29 17:28:33 +02:00
e8bb3790ba Removed unused variables. 2015-04-27 18:50:05 +02:00
jvelilla
8b24c86ff1 Updated Authentication JS, still work in progress 2015-04-23 11:43:57 -03:00
jvelilla
fc4c2e76b6 Added login form with Javascript (example).
Updated feature and class comments.
2015-04-22 18:40:36 -03:00
a56338ad17 Added blog module as example, this is far from being a real blog module.
but this is an example about on to add a new content type, and support it.
Fixed new node form workflow.

The current state is not final, it requires many changes, but for now, it implements a node editing workflow.
2015-04-15 22:32:38 +02:00
f2bb061488 Added support for log stored in CMS_STORAGE.
Added support for custom value stored in CMS_STORAGE.
Added optional css classes addition to CMS_BLOCK output.
Refactored storage, to manage node from node module code only (or mostly).

TODO: improved view for a cms node, for now hardcoded.
2015-04-15 16:39:03 +02:00
ea2b5b87d3 Added helper functions to get uri path for a node, and other related resources.
Added description to cms content type.
Fixed initialization of node module to create test bed nodes.
2015-04-14 16:07:09 +02:00
133c243126 Implemented CMS storage for user and nodes.
Implemented role and permission storage.
Introduced the CMS_PARTIAL_NODE and CMS_PARTIAL_USER.
Added support for node storage extension
  - storage of data specific to each node content type,
  - in addition to the core CMS_NODE)
  - For now, only implemented for SQL storage.
Note: in current version, CMS_PAGE support is hard coded in the core,
    (as opposed to be only supported by the node module.)
Commented/removed for now, the Web API code to update node summary, title, via REST request.
2015-04-14 11:25:02 +02:00
9a8683a139 Updated configuration of the example to use EiffelStore sqlite database by default. 2015-04-09 23:59:57 +02:00
b235fb30a7 Updated design related to logger, to prepare move to SCOOP concurrency. 2015-04-02 21:15:05 +02:00
e94d860fd8 Commented "mysql" support to make it easier to compile at first. 2015-03-20 19:45:14 +01:00
8d59d25ace 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
2015-02-16 13:01:06 +01:00
a810b1176c Revisited application layout, shared logger and relation with cms to avoid mixing various layout. 2015-02-05 10:28:46 +01:00
7d5869f3b9 Revisited the persistence layer.
Simplified schema to focus on user and node.
Now possible to have sqlite via ODBC and/or mysql support, and select using configuration file.
Updated demo example.
2015-01-27 19:48:37 +01:00
db9e40cec4 Updated CMS_SERVICE to make the cms library complete void-safe.
Reviewed configuration related feature.
Renamed JSON_CONFIGURATION as APPLICATION_JSON_CONFIGURATION_HELPER to avoid confusion.
Updated CMS_DEFAULT_SETUP to use configuration from cms configuration library.
Added {CMS_API}.module_configuration (a_module_name: READABLE_STRING_GENERAL; a_name: detachable READABLE_STRING_GENERAL): detachable CONFIG_READER  to help getting access to configuration of a module (for now, only json and ini are supported, but in the future, this could support database layer directly)
Added CMS_HOOK_BLOCK_HELPER to reuse the template_block (..): ... function.
Cosmetic
Removed CMS_SETUP.smtp_server since for now, there is no need for such general setting.
Add header line "X-ServerEWF-App: CMS" as a simple way to know if request is processed by the CMS.
2015-01-14 18:25:26 +01:00
51462829c7 reverted renaming to use `modules' for available modules.
Added CMS_SETUP.register_module (m) to avoid extending directly to the CMS_SETUP.modules
2014-11-20 14:53:54 +01:00
jvelilla
c3d022ce46 Refactor raname {CMS_SETUP}.modules as {CMS_SETUP}.available_modules
Refactor raname {CMS_SETUP}.modules_enabled as {CMS_SETUP}.enabled_modules
Updated code to use the new features names.
2014-11-19 13:20:07 -03:00
jvelilla
d963fd218b Refactor directory structrue 2014-11-13 11:57:36 -03:00
jvelilla
9af6356f0a Added README doc.
Renamed example/roc_api to demo.
Added contracts
2014-11-13 10:50:54 -03:00
71734a6dd7 Renamed model-safe.ecf as cms_model-safe.ecf since it is very specific to the cms.
Fixed compilation issue due to recent use of STRING_TABLE.
2014-11-13 11:15:35 +01:00
jvelilla
789b26eafa Move libraries layout', model', `peristence' under cms folder
Updated code to the new layout.
Added missing comments.
Remove /example/api
2014-11-12 17:24:34 -03:00
jvelilla
2d5c1a5e41 Updated Descriptions to classes and features 2014-11-12 12:30:09 -03:00
c3d48c47cc Renamed CMS_RESPONSE.add_..hook with subscribe_to_..._hook
Renamed CMS_RESPONSE.call_..hook  with invoke_..._hook
Renamed CMS_HOOK_VALUE_ALTER as CMS_HOOK_VALUE_TABLE_ALTER
Renamed CMS_HOOK_MENU_ALTER as CMS_HOOK_MENU_SYSTEM_ALTER
Added new CMS_HOOK_MENU_ALTER that acts on CMS_MENU object.

Cosmetic, comments.
2014-11-12 16:12:42 +01:00
96da59c4cb Added notion of "front" page.
Changed CMS_HOOK_BLOCK.get_block_view to accept only attached string for `a_block_id'.
Keep simple name in CMS_MENU_SYSTEM.
Module that implements a CMS_HOOK need now to redefine CMS_MODULE.register_hooks .
Added simple code for NODE_MODULE, in order to see something.
Added CMS_URL_UTILITIES that should be used to compute url for cms path such as "/foo/bar".
Implemented get_active in CMS_RESPONSE to update the "is_active" on each link.
Added NOT_IMPLEMENTED_ERROR_CMS_RESPONSE.
Implemented a few hooks in DEMO module, for testing.
Updated smarty template related code.
2014-11-10 19:22:01 +01:00
abe9de621e Made examples/api compilable. 2014-11-10 14:59:30 +01:00
241b003542 Renamed CMS_API_SERVICE as CMS_API .
Reversed the design, and break dependency CMS_SETUP => CMS_API .
Now CMS_API has attribute setup: CMS_SETUP .
Moved error_handler from CMS_SETUP to CMS_API.
The instance of CMS_SETUP is used when instanciating modules.
The instance of CMS_API is used when instanciating CMS_REPONSE and Handlers/Filters.
The instance of CMS_API is passed as argument to build the CMS_MODULE.router and filter.
2014-11-10 14:59:17 +01:00
jvelilla
730f6d42a4 Updated Node module and theme to use the new rendering strategy. 2014-11-08 06:10:43 -03:00
jvelilla
2c130cf882 Update theme information defining a navigation strategy
Updated code to use a new navigation strategy.
2014-11-07 09:15:30 -03:00
jvelilla
223a5fafdb Updated page header template 2014-11-07 07:52:44 -03:00
jvelilla
f1b911b6e3 Updated block and template to render regions 2014-11-06 22:33:48 -03:00
jvelilla
b90e3b3df0 Added a CMS_ENCODER utility class.
Added a block header template: smarty engine.
Added a menu template: smarty engine.
2014-11-05 07:45:36 -03:00
jvelilla
bafdc085d9 Added refactoring helper class to add comments. 2014-11-04 11:31:43 -03:00
jvelilla
b11462105a Initial implementation with Hooks, Regions and Templates
Updated Modules to support hooks, still work in progress.
2014-11-03 12:40:54 -03:00
jvelilla
8a06dc11ac Merge branch 'roc_pe' of https://github.com/jocelyn/ROC into roc_pe
Conflicts:
	cms/cms-safe.ecf
2014-10-14 17:22:40 -03:00
jvelilla
b8257e7bf0 Clean code: removed unused variables.
Move BASIC_AUTH module to ROC_SERVER setup, as an example
of module extension
2014-10-14 17:58:01 +02:00
4841039d4a Renamed void-safe ecf using -safe.ecf convention.
Added a cms_demo_module, for now pretty empty, but it will be used to develop/test the cms core.
2014-10-14 15:24:24 +02:00