Adapted to new layout, with module files inside site/modules/$module_name/...
This commit is contained in:
@@ -1,39 +0,0 @@
|
||||
{
|
||||
"database": {
|
||||
"datasource": {
|
||||
"driver": "odbc",
|
||||
"environment": "odbc-sqlite"
|
||||
},
|
||||
"environments": {
|
||||
"odbc-sqlite": {
|
||||
"connection_string":"Driver=SQLite3 ODBC Driver;Database=./site/database.sqlite;LongNames=0;Timeout=1000;NoTXN=0;SyncPragma=NORMAL;StepAPI=0;"
|
||||
},
|
||||
"odbc-mysql": {
|
||||
"connection_string":"Driver=mysql ODBC Driver;Server=localhost;Port=3306;Database=roc;Uid=roc;Pwd=roc;"
|
||||
},
|
||||
"mysql": {
|
||||
"connection_string":"Driver=mysql;Server=localhost;Port=3306;Database=roc;Uid=roc;Pwd=roc;"
|
||||
},
|
||||
"development": {
|
||||
"connection_string":"Server=localhost;Port=3306;Database=cms_dev;Uid=root;Pwd=;"
|
||||
},
|
||||
"production": {
|
||||
"connection_string":""
|
||||
}
|
||||
}
|
||||
},
|
||||
"smtp": {
|
||||
"server": "localhost"
|
||||
},
|
||||
"logger": {
|
||||
"level":"error",
|
||||
"type":"stderr",
|
||||
"backup_count":"4"
|
||||
},
|
||||
"server": {
|
||||
"mode":"html"
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -109,7 +109,7 @@ feature -- Access: internal
|
||||
do
|
||||
p := internal_application_config_path
|
||||
if p = Void then
|
||||
p := config_path.extended ("application_configuration.json")
|
||||
p := config_path.extended (name + ".json")
|
||||
internal_application_config_path := p
|
||||
end
|
||||
Result := p
|
||||
|
||||
@@ -21,7 +21,7 @@ feature {NONE} -- Initialization
|
||||
s: detachable READABLE_STRING_32
|
||||
l_contact_email, l_subject_register, l_subject_activate, l_subject_password, l_subject_oauth: detachable READABLE_STRING_8
|
||||
do
|
||||
setup := a_cms_api.setup
|
||||
cms_api := a_cms_api
|
||||
-- Use global smtp setting if any, otherwise "localhost"
|
||||
smtp_server := utf.escaped_utf_32_string_to_utf_8_string_8 (a_cms_api.setup.text_item_or_default ("smtp", "localhost"))
|
||||
l_site_name := utf.escaped_utf_32_string_to_utf_8_string_8 (a_cms_api.setup.site_name)
|
||||
@@ -92,6 +92,8 @@ feature {NONE} -- Initialization
|
||||
|
||||
feature -- Access
|
||||
|
||||
cms_api: CMS_API
|
||||
|
||||
smtp_server: IMMUTABLE_STRING_8
|
||||
|
||||
admin_email: IMMUTABLE_STRING_8
|
||||
@@ -132,8 +134,11 @@ feature {NONE} -- Implementation: Template
|
||||
|
||||
template_path (a_name: READABLE_STRING_GENERAL): PATH
|
||||
-- Location of template named `a_name'.
|
||||
local
|
||||
p: PATH
|
||||
do
|
||||
Result := setup.environment.config_path.extended ("modules").extended ("login").extended (a_name)
|
||||
create p.make_from_string (a_name)
|
||||
Result := cms_api.module_location_by_name ("login").extended ("mail_templates").extended (a_name)
|
||||
end
|
||||
|
||||
template_string (a_name: READABLE_STRING_GENERAL; a_default: STRING): STRING
|
||||
@@ -151,8 +156,6 @@ feature {NONE} -- Implementation: Template
|
||||
|
||||
feature {NONE} -- Implementation
|
||||
|
||||
setup: CMS_SETUP
|
||||
|
||||
read_template_file (a_path: PATH): detachable STRING
|
||||
-- Read the content of the file at path `a_path'.
|
||||
local
|
||||
|
||||
@@ -102,13 +102,13 @@ feature {CMS_API} -- Module management
|
||||
if attached {CMS_STORAGE_SQL_I} api.storage as l_sql_storage then
|
||||
if not l_sql_storage.sql_table_exists ("oauth2_consumers") then
|
||||
--| Schema
|
||||
l_sql_storage.sql_execute_file_script (l_setup.environment.path.extended ("scripts").extended ("oauth2_consumers.sql"))
|
||||
l_sql_storage.sql_execute_file_script (api.modules_location.extended ("scripts").extended ("oauth2_consumers.sql"))
|
||||
|
||||
if l_sql_storage.has_error then
|
||||
api.logger.put_error ("Could not initialize database for blog module", generating_type)
|
||||
end
|
||||
-- TODO workaround.
|
||||
l_sql_storage.sql_execute_file_script (l_setup.environment.path.extended ("scripts").extended ("oauth2_consumers_initialize.sql"))
|
||||
l_sql_storage.sql_execute_file_script (api.modules_location.extended ("scripts").extended ("oauth2_consumers_initialize.sql"))
|
||||
end
|
||||
|
||||
-- TODO workaround, until we have an admin module
|
||||
@@ -131,7 +131,7 @@ feature {CMS_API} -- Module management
|
||||
if not l_sql_storage.sql_table_exists (ic.item) then
|
||||
create l_params.make (1)
|
||||
l_params.force (ic.item, "table_name")
|
||||
l_sql_storage.sql_execute_file_script_with_params (l_setup.environment.path.extended ("scripts").extended ("oauth2_template.sql"), l_params)
|
||||
l_sql_storage.sql_execute_file_script_with_params (api.modules_location.extended ("scripts").extended ("oauth2_template.sql"), l_params)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user