Compare commits
185 Commits
blog
...
es_rev9797
| Author | SHA1 | Date | |
|---|---|---|---|
| ed24eb7c94 | |||
| 43d6b4a197 | |||
| dffd06e331 | |||
| 463105f29f | |||
| abebd00a4f | |||
| ec53a2682b | |||
|
|
7b2e6ab7b4 | ||
|
|
87f4de1264 | ||
|
|
ed614a662c | ||
|
|
d54ad59e5f | ||
|
|
9173ef2ded | ||
|
|
ad9e908dc2 | ||
|
|
4584917877 | ||
|
|
f7d68d09e4 | ||
| f9ecd4956f | |||
| 18e159ad3c | |||
| 438259033a | |||
| 62e74ea6cd | |||
| 32a409b7e9 | |||
|
|
eb70af6f19 | ||
| 5f4eb2cf10 | |||
| 88bc52fffb | |||
|
|
544e6540ed | ||
| 2431d7af6c | |||
|
|
0d55bd67a2 | ||
|
|
e1727cc445 | ||
|
|
634a078282 | ||
|
|
2f65a084ac | ||
|
|
13df6fd593 | ||
| ad4f020d0e | |||
| 7a13b47131 | |||
| 923089baa1 | |||
| cfec9dc7f8 | |||
| b5e7d5d201 | |||
| e1bdcb965c | |||
| 0061afcbe8 | |||
| 6a9bc8aa42 | |||
| 1d7d79d69e | |||
| 46014da3d8 | |||
| 7cb4c0e9f4 | |||
| aff6b07c80 | |||
| 479194d6c5 | |||
| 3f123dd921 | |||
| cd0c2acd87 | |||
| 44ada4b6b1 | |||
| 8efbddc8cb | |||
| f26b81977c | |||
| bbf7456fa2 | |||
| 62ef07c86b | |||
| a422dea15d | |||
| 6fb7bf9a1d | |||
| bba1d57ce3 | |||
| c271f839e2 | |||
| 5d81f1d195 | |||
|
|
63f3ec12d0 | ||
|
|
863a1e7b98 | ||
|
|
0fe9018ce9 | ||
|
|
1ef4025caa | ||
|
|
3ebffad3d6 | ||
| 500f8f78a4 | |||
| 47573a1950 | |||
|
|
2d5f985037 | ||
|
|
eff3552ea1 | ||
| 43b8c52d34 | |||
| d8ac46f8b0 | |||
|
|
91f1a87b83 | ||
| 769c14caf8 | |||
| 3c0122d98f | |||
|
|
77487e90f3 | ||
|
|
5d498c0bf2 | ||
|
|
e42a7636ae | ||
| f55a52e4d0 | |||
| 2040a746dd | |||
|
|
d4fc9f9411 | ||
|
|
bba504df53 | ||
| 5688cffcf1 | |||
| 19e8607e54 | |||
| 2d77bf6de8 | |||
| 2d985ba05e | |||
| 1b0cc9dc07 | |||
|
|
0164c6ec6d | ||
|
|
2fe2a7f864 | ||
| 3dec559d58 | |||
|
|
dce3f71be9 | ||
| 3ea9e36e7c | |||
| 5da01fd576 | |||
| 7f4a7b3ab9 | |||
| 779064a505 | |||
| 5477bab83c | |||
| d24f124e42 | |||
| bace9657b4 | |||
| 6319d46f26 | |||
| 31095b1b66 | |||
| 16cae0047d | |||
| 85cff0b139 | |||
| cc94c59eed | |||
| 4c8af3ef66 | |||
| 37729f648a | |||
| 26dc018893 | |||
|
|
f0eff2cb98 | ||
| 011a6b7804 | |||
| 83e7f95425 | |||
|
|
4f7acc5dbd | ||
|
|
922fca80ad | ||
|
|
9d465b3d7e | ||
|
|
5288fe4d3c | ||
|
|
9722347736 | ||
|
|
a2598fff92 | ||
| 42e7763528 | |||
|
|
02fe3ba829 | ||
|
|
fe3274e29a | ||
|
|
96bae9f8fb | ||
|
|
1cef32a1fb | ||
|
|
f1e8e1da58 | ||
|
|
26276dad5d | ||
| eb9ac980e6 | |||
| 28ab4786a1 | |||
| 8294a47f17 | |||
| e45dac84c8 | |||
| bb3e3b992f | |||
| ebc5924c01 | |||
| 48b0ad5195 | |||
| ae9eea99dd | |||
|
|
268f53e53f | ||
|
|
e17fc570a1 | ||
| ba7ef17d34 | |||
|
|
c8bbac664b | ||
| 04e98dbb48 | |||
| 2886c90782 | |||
|
|
db6799d55b | ||
|
|
7c0032ada4 | ||
|
|
fa5efede2c | ||
| 0fca03a4d1 | |||
| 642b901856 | |||
| 4f3bcf290f | |||
| 6ca8a9ce82 | |||
| 2c72fe6738 | |||
| 149de898c0 | |||
| c3133c65a1 | |||
|
|
9e51df1e01 | ||
| 967871e427 | |||
| 73e0098c4d | |||
| b4407378db | |||
| f619727997 | |||
|
|
a94a8857ae | ||
| e37dbb0a62 | |||
|
|
53491274dc | ||
|
|
afced59b0c | ||
| 21800e71d3 | |||
|
|
18732a9532 | ||
| 0fc1cb68ad | |||
| 0b8bee3404 | |||
| 53a602d33c | |||
|
|
f652aa8a15 | ||
| 5578a9e622 | |||
|
|
e188625c43 | ||
|
|
96ba3c35a2 | ||
|
|
181c32a895 | ||
|
|
032cc5bdcb | ||
| b8cfff487a | |||
| af8f410684 | |||
| cede341301 | |||
| 70d53b3ef1 | |||
|
|
f056b43ddc | ||
|
|
957ca96bc5 | ||
|
|
ad9dd01f22 | ||
|
|
323ac598d0 | ||
| b77c5cd93c | |||
| 77f52388c1 | |||
|
|
306b39ab78 | ||
|
|
53f3162b4a | ||
| 036013a0a2 | |||
| 50da24d1af | |||
| 91457080fd | |||
| 51699f3bd3 | |||
|
|
77bb1fe123 | ||
|
|
e4e2d662b8 | ||
|
|
f0668e660e | ||
|
|
68fb21a4c1 | ||
|
|
3b90d522f9 | ||
|
|
1c59a65983 | ||
|
|
9fbadac7ac | ||
|
|
57bf5ad0dc | ||
|
|
988f32c6c4 | ||
|
|
44d14c4100 |
@@ -12,21 +12,25 @@
|
||||
</option>
|
||||
<mapping old_name="CMS_LAYOUT" new_name="CMS_ENVIRONMENT"/>
|
||||
<library name="base" location="$ISE_LIBRARY\library\base\base-safe.ecf"/>
|
||||
<library name="base_extension" location="$ISE_LIBRARY\library\base_extension\base_extension-safe.ecf"/>
|
||||
<library name="cms_app_env" location=".\library\app_env\app_env-safe.ecf"/>
|
||||
<library name="cms_model" location=".\library\model\cms_model-safe.ecf" readonly="false"/>
|
||||
<library name="config" location=".\library\configuration\config-safe.ecf"/>
|
||||
<library name="cms_config" location=".\library\configuration\config-safe.ecf"/>
|
||||
<library name="crypto" location="$ISE_LIBRARY\unstable\library\text\encryption\crypto\crypto-safe.ecf"/>
|
||||
<library name="encoder" location="$ISE_LIBRARY\contrib\library\web\framework\ewf\text\encoder\encoder-safe.ecf" readonly="false"/>
|
||||
<library name="error" location="$ISE_LIBRARY\contrib\library\utility\general\error\error-safe.ecf"/>
|
||||
<library name="http" location="$ISE_LIBRARY\contrib\library\network\protocol\http\http-safe.ecf"/>
|
||||
<library name="i18n" location="$ISE_LIBRARY\library\i18n\i18n-safe.ecf"/>
|
||||
<library name="json" location="$ISE_LIBRARY\contrib\library\text\parser\json\library\json-safe.ecf" readonly="false"/>
|
||||
<library name="notification_mailer" location="$ISE_LIBRARY\contrib\library\runtime\process\notification_email\notification_email-safe.ecf"/>
|
||||
<library name="smarty" location="$ISE_LIBRARY\contrib\library\text\template\smarty\smarty-safe.ecf" readonly="false"/>
|
||||
<library name="text_filter" location="$ISE_LIBRARY\unstable\library\text\text_filter\text_filter-safe.ecf"/>
|
||||
<library name="time" location="$ISE_LIBRARY\library\time\time-safe.ecf"/>
|
||||
<library name="uri_template" location="$ISE_LIBRARY\contrib\library\text\parser\uri_template\uri_template-safe.ecf"/>
|
||||
<library name="wsf" location="$ISE_LIBRARY\contrib\library\web\framework\ewf\wsf\wsf-safe.ecf"/>
|
||||
<library name="wsf_extension" location="$ISE_LIBRARY\contrib\library\web\framework\ewf\wsf\wsf_extension-safe.ecf" readonly="false"/>
|
||||
<library name="wsf_html" location="$ISE_LIBRARY\contrib\library\web\framework\ewf\wsf_html\wsf_html-safe.ecf" readonly="false"/>
|
||||
<library name="net" location="$ISE_LIBRARY\library\net\net-safe.ecf"/>
|
||||
<cluster name="src" location=".\src\" recursive="true"/>
|
||||
</target>
|
||||
</system>
|
||||
|
||||
15
cms.ecf
15
cms.ecf
@@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<system xmlns="http://www.eiffel.com/developers/xml/configuration-1-13-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-13-0 http://www.eiffel.com/developers/xml/configuration-1-13-0.xsd" name="cms" uuid="8CC0D052-57D1-4CAA-AFF1-448FA290734B" library_target="cms">
|
||||
<system xmlns="http://www.eiffel.com/developers/xml/configuration-1-14-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-14-0 http://www.eiffel.com/developers/xml/configuration-1-14-0.xsd" name="cms" uuid="8CC0D052-57D1-4CAA-AFF1-448FA290734B" library_target="cms">
|
||||
<description>ROC CMS library</description>
|
||||
<target name="cms">
|
||||
<root all_classes="true"/>
|
||||
<file_rule>
|
||||
@@ -12,21 +13,25 @@
|
||||
</option>
|
||||
<mapping old_name="CMS_LAYOUT" new_name="CMS_ENVIRONMENT"/>
|
||||
<library name="base" location="$ISE_LIBRARY\library\base\base.ecf"/>
|
||||
<library name="config" location=".\library\configuration\config.ecf"/>
|
||||
<library name="base_extension" location="$ISE_LIBRARY\library\base_extension\base_extension.ecf"/>
|
||||
<library name="cms_app_env" location=".\library\app_env\app_env.ecf"/>
|
||||
<library name="cms_model" location=".\library\model\cms_model.ecf" readonly="false"/>
|
||||
<library name="cms_config" location=".\library\configuration\config.ecf"/>
|
||||
<library name="crypto" location="$ISE_LIBRARY\unstable\library\text\encryption\crypto\crypto.ecf"/>
|
||||
<library name="encoder" location="$ISE_LIBRARY\contrib\library\web\framework\ewf\text\encoder\encoder.ecf" readonly="false"/>
|
||||
<library name="error" location="$ISE_LIBRARY\contrib\library\utility\general\error\error.ecf"/>
|
||||
<library name="http" location="$ISE_LIBRARY\contrib\library\network\protocol\http\http.ecf"/>
|
||||
<library name="i18n" location="$ISE_LIBRARY\library\i18n\i18n.ecf"/>
|
||||
<library name="json" location="$ISE_LIBRARY\contrib\library\text\parser\json\library\json.ecf" readonly="false"/>
|
||||
<library name="cms_app_env" location=".\library\app_env\app_env.ecf"/>
|
||||
<library name="cms_model" location=".\library\model\cms_model.ecf" readonly="false"/>
|
||||
<library name="notification_mailer" location="$ISE_LIBRARY\contrib\library\runtime\process\notification_email\notification_email.ecf"/>
|
||||
<library name="smarty" location="$ISE_LIBRARY\contrib\library\text\template\smarty\smarty.ecf" readonly="false"/>
|
||||
<library name="text_filter" location="$ISE_LIBRARY\unstable\library\text\text_filter\text_filter.ecf"/>
|
||||
<library name="time" location="$ISE_LIBRARY\library\time\time.ecf"/>
|
||||
<library name="uri_template" location="$ISE_LIBRARY\contrib\library\text\parser\uri_template\uri_template.ecf"/>
|
||||
<library name="wsf" location="$ISE_LIBRARY\contrib\library\web\framework\ewf\wsf\wsf.ecf"/>
|
||||
<library name="wsf_html" location="$ISE_LIBRARY\contrib\library\web\framework\ewf\wsf_html\wsf_html.ecf" readonly="false"/>
|
||||
<library name="wsf_extension" location="$ISE_LIBRARY\contrib\library\web\framework\ewf\wsf\wsf_extension.ecf" readonly="false"/>
|
||||
<library name="wsf_html" location="$ISE_LIBRARY\contrib\library\web\framework\ewf\wsf_html\wsf_html.ecf" readonly="false"/>
|
||||
<library name="net" location="$ISE_LIBRARY\library\net\net.ecf"/>
|
||||
<cluster name="src" location=".\src\" recursive="true"/>
|
||||
</target>
|
||||
</system>
|
||||
|
||||
@@ -7,33 +7,62 @@
|
||||
<exclude>/CVS$</exclude>
|
||||
<exclude>/.svn$</exclude>
|
||||
</file_rule>
|
||||
<option warning="true" full_class_checking="false" is_attached_by_default="true" void_safety="all" syntax="transitional">
|
||||
<assertions precondition="true" postcondition="true" check="true" invariant="true" loop="true" supplier_precondition="true"/>
|
||||
<option debug="true" warning="true" full_class_checking="false" is_attached_by_default="true" void_safety="all" syntax="transitional">
|
||||
<debug name="dbglog" enabled="true"/>
|
||||
</option>
|
||||
<setting name="concurrency" value="none"/>
|
||||
<setting name="concurrency" value="thread"/>
|
||||
<library name="base" location="$ISE_LIBRARY\library\base\base-safe.ecf"/>
|
||||
<library name="cms" location="..\..\cms-safe.ecf" readonly="false"/>
|
||||
<library name="cms_app_env" location="..\..\library\app_env\app_env-safe.ecf" readonly="false"/>
|
||||
<library name="cms_auth_module" location="..\..\modules\auth\auth-safe.ecf" readonly="false"/>
|
||||
<library name="cms_basic_auth_module" location="..\..\modules\basic_auth\basic_auth-safe.ecf" readonly="false"/>
|
||||
<library name="cms_blog_module" location="modules\blog\cms_blog_module-safe.ecf" readonly="false"/>
|
||||
<library name="cms_blog_module" location="..\..\modules\blog\cms_blog_module-safe.ecf" readonly="false"/>
|
||||
<library name="cms_demo_module" location="modules\demo\cms_demo_module-safe.ecf" readonly="false"/>
|
||||
<library name="cms_email_service" location="..\..\library\email\email-safe.ecf" readonly="false"/>
|
||||
<library name="cms_feed_aggregator_module" location="..\..\modules\feed_aggregator\feed_aggregator-safe.ecf" readonly="false"/>
|
||||
<library name="cms_model" location="..\..\library\model\cms_model-safe.ecf" readonly="false"/>
|
||||
<library name="cms_node_module" location="..\..\modules\node\node-safe.ecf" readonly="false"/>
|
||||
<library name="cms_oauth_20_module" location="..\..\modules\oauth20\oauth20-safe.ecf" readonly="false"/>
|
||||
<library name="cms_openid_module" location="..\..\modules\openid\openid-safe.ecf" readonly="false"/>
|
||||
<library name="cms_admin_module" location="..\..\modules\admin\admin-safe.ecf" readonly="false"/>
|
||||
<library name="cms_recent_changes_module" location="..\..\modules\recent_changes\recent_changes-safe.ecf" readonly="false"/>
|
||||
<library name="persistence_store_odbc" location="..\..\library\persistence\store_odbc\store_odbc-safe.ecf" readonly="false"/>
|
||||
<!--
|
||||
<library name="persistence_mysql" location="..\..\library\persistence\mysql\persistence_mysql-safe.ecf" readonly="false"/>
|
||||
<library name="persistence_store_mysql" location="..\..\library\persistence\store_mysql\store_mysql-safe.ecf" readonly="false"/>
|
||||
-->
|
||||
<library name="persistence_sqlite" location="..\..\library\persistence\sqlite\persistence_sqlite-safe.ecf" readonly="false"/>
|
||||
<library name="wsf" location="$ISE_LIBRARY\contrib\library\web\framework\ewf\wsf\wsf-safe.ecf"/>
|
||||
<library name="wsf_extension" location="$ISE_LIBRARY\contrib\library\web\framework\ewf\wsf\wsf_extension-safe.ecf" readonly="false"/>
|
||||
</target>
|
||||
<target name="demo_any" extends="common">
|
||||
<root class="EWF_ROC_SERVER" feature="make_and_launch"/>
|
||||
<setting name="concurrency" value="thread"/>
|
||||
<library name="cgi" location="$ISE_LIBRARY\contrib\library\web\framework\ewf\wsf\connector\cgi-safe.ecf"/>
|
||||
<library name="libfcgi" location="$ISE_LIBRARY\contrib\library\web\framework\ewf\wsf\connector\libfcgi-safe.ecf"/>
|
||||
<library name="nino" location="$ISE_LIBRARY\contrib\library\web\framework\ewf\wsf\connector\nino-safe.ecf"/>
|
||||
<library name="standalone" location="$ISE_LIBRARY\contrib\library\web\framework\ewf\wsf\connector\standalone-safe.ecf"/>
|
||||
<cluster name="launcher" location=".\launcher\any\" recursive="true"/>
|
||||
<cluster name="src" location=".\src\" recursive="true"/>
|
||||
</target>
|
||||
<target name="demo_standalone" extends="common">
|
||||
<root class="EWF_ROC_SERVER" feature="make_and_launch"/>
|
||||
<option debug="true">
|
||||
<debug name="dbglog" enabled="true"/>
|
||||
</option>
|
||||
<setting name="concurrency" value="thread"/>
|
||||
<variable name="httpd_ssl_disabled" value="true"/>
|
||||
<library name="default_standalone" location="$ISE_LIBRARY\contrib\library\web\framework\ewf\wsf\default\standalone-safe.ecf"/>
|
||||
<cluster name="launcher" location=".\launcher\default\" recursive="true"/>
|
||||
<cluster name="src" location=".\src\" recursive="true"/>
|
||||
</target>
|
||||
<target name="demo_standalone_none" extends="demo_standalone">
|
||||
<setting name="concurrency" value="none"/>
|
||||
</target>
|
||||
<target name="demo_standalone_mt" extends="demo_standalone">
|
||||
<setting name="concurrency" value="thread"/>
|
||||
</target>
|
||||
<target name="demo_standalone_scoop" extends="demo_standalone">
|
||||
<setting name="concurrency" value="scoop"/>
|
||||
</target>
|
||||
<target name="demo_nino" extends="common">
|
||||
<root class="EWF_ROC_SERVER" feature="make_and_launch"/>
|
||||
<setting name="concurrency" value="none"/>
|
||||
@@ -43,16 +72,18 @@
|
||||
</target>
|
||||
<target name="demo_cgi" extends="common">
|
||||
<root class="EWF_ROC_SERVER" feature="make_and_launch"/>
|
||||
<setting name="concurrency" value="none"/>
|
||||
<library name="default_cgi" location="$ISE_LIBRARY\contrib\library\web\framework\ewf\wsf\default\cgi-safe.ecf"/>
|
||||
<cluster name="launcher" location=".\launcher\default\" recursive="true"/>
|
||||
<cluster name="src" location=".\src\" recursive="true"/>
|
||||
</target>
|
||||
<target name="demo_libfcgi" extends="common">
|
||||
<root class="EWF_ROC_SERVER" feature="make_and_launch"/>
|
||||
<setting name="concurrency" value="none"/>
|
||||
<library name="default_libfcgi" location="$ISE_LIBRARY\contrib\library\web\framework\ewf\wsf\default\libfcgi-safe.ecf"/>
|
||||
<cluster name="launcher" location=".\launcher\default\" recursive="true"/>
|
||||
<cluster name="src" location=".\src\" recursive="true"/>
|
||||
</target>
|
||||
<target name="demo" extends="demo_nino">
|
||||
<target name="demo" extends="demo_standalone">
|
||||
</target>
|
||||
</system>
|
||||
|
||||
13
examples/demo/install_modules.bat
Normal file
13
examples/demo/install_modules.bat
Normal file
@@ -0,0 +1,13 @@
|
||||
setlocal
|
||||
set ROC_CMD=call %~dp0..\..\tools\roc.bat
|
||||
set ROC_CMS_DIR=%~dp0
|
||||
|
||||
%ROC_CMD% install --module ..\..\modules\admin --dir %ROC_CMS_DIR%
|
||||
%ROC_CMD% install --module ..\..\modules\auth --dir %ROC_CMS_DIR%
|
||||
%ROC_CMD% install --module ..\..\modules\basic_auth --dir %ROC_CMS_DIR%
|
||||
%ROC_CMD% install --module ..\..\modules\blog --dir %ROC_CMS_DIR%
|
||||
%ROC_CMD% install --module ..\..\modules\node --dir %ROC_CMS_DIR%
|
||||
%ROC_CMD% install --module ..\..\modules\oauth20 --dir %ROC_CMS_DIR%
|
||||
%ROC_CMD% install --module ..\..\modules\openid --dir %ROC_CMS_DIR%
|
||||
%ROC_CMD% install --module ..\..\modules\recent_changes --dir %ROC_CMS_DIR%
|
||||
%ROC_CMD% install --module ..\..\modules\feed_aggregator --dir %ROC_CMS_DIR%
|
||||
@@ -8,10 +8,10 @@ note
|
||||
revision: "$Revision: 36 $"
|
||||
|
||||
class
|
||||
APPLICATION_LAUNCHER
|
||||
APPLICATION_LAUNCHER [G -> WSF_EXECUTION create make end]
|
||||
|
||||
inherit
|
||||
APPLICATION_LAUNCHER_I
|
||||
APPLICATION_LAUNCHER_I [G]
|
||||
|
||||
feature -- Custom
|
||||
|
||||
|
||||
@@ -10,24 +10,28 @@ note
|
||||
revision: "$Revision: 36 $"
|
||||
|
||||
deferred class
|
||||
APPLICATION_LAUNCHER_I
|
||||
APPLICATION_LAUNCHER_I [G -> WSF_EXECUTION create make end]
|
||||
|
||||
inherit
|
||||
SHARED_EXECUTION_ENVIRONMENT
|
||||
|
||||
feature -- Execution
|
||||
|
||||
launch (a_service: WSF_SERVICE; opts: detachable WSF_SERVICE_LAUNCHER_OPTIONS)
|
||||
launch (opts: detachable WSF_SERVICE_LAUNCHER_OPTIONS)
|
||||
local
|
||||
nature: like launcher_nature
|
||||
do
|
||||
nature := launcher_nature
|
||||
if nature = Void or else nature = nature_nino then
|
||||
launch_nino (a_service, opts)
|
||||
if nature = Void then
|
||||
launch_standalone (opts)
|
||||
elseif nature = nature_standalone then
|
||||
launch_standalone (opts)
|
||||
elseif nature = nature_nino then
|
||||
launch_nino (opts)
|
||||
elseif nature = nature_cgi then
|
||||
launch_cgi (a_service, opts)
|
||||
launch_cgi (opts)
|
||||
elseif nature = nature_libfcgi then
|
||||
launch_libfcgi (a_service, opts)
|
||||
launch_libfcgi (opts)
|
||||
else
|
||||
-- bye bye
|
||||
(create {EXCEPTIONS}).die (-1)
|
||||
@@ -43,14 +47,16 @@ feature {NONE} -- Access
|
||||
--| and we could use WSF_DEFAULT_SERVICE_LAUNCHER to configure this at compilation time.
|
||||
local
|
||||
p: PATH
|
||||
l_entry_name: READABLE_STRING_32
|
||||
ext: detachable READABLE_STRING_32
|
||||
do
|
||||
create p.make_from_string (execution_environment.arguments.command_name)
|
||||
if attached p.entry as l_entry then
|
||||
ext := l_entry.extension
|
||||
ext := l_entry.extension
|
||||
end
|
||||
if ext /= Void then
|
||||
if ext.same_string (nature_standalone) then
|
||||
Result := nature_standalone
|
||||
end
|
||||
if ext.same_string (nature_nino) then
|
||||
Result := nature_nino
|
||||
end
|
||||
@@ -61,39 +67,58 @@ feature {NONE} -- Access
|
||||
Result := nature_libfcgi
|
||||
end
|
||||
end
|
||||
Result := default_nature
|
||||
end
|
||||
|
||||
feature {NONE} -- standalone
|
||||
|
||||
nature_standalone: STRING = "standalone"
|
||||
|
||||
launch_standalone (opts: detachable WSF_SERVICE_LAUNCHER_OPTIONS)
|
||||
local
|
||||
launcher: WSF_STANDALONE_SERVICE_LAUNCHER [G]
|
||||
do
|
||||
create launcher.make_and_launch (opts)
|
||||
end
|
||||
|
||||
feature {NONE} -- nino
|
||||
|
||||
nature_nino: STRING = "nino"
|
||||
|
||||
launch_nino (a_service: WSF_SERVICE; opts: detachable WSF_SERVICE_LAUNCHER_OPTIONS)
|
||||
launch_nino (opts: detachable WSF_SERVICE_LAUNCHER_OPTIONS)
|
||||
local
|
||||
launcher: WSF_NINO_SERVICE_LAUNCHER
|
||||
launcher: WSF_NINO_SERVICE_LAUNCHER [G]
|
||||
do
|
||||
create launcher.make_and_launch (a_service, opts)
|
||||
create launcher.make_and_launch (opts)
|
||||
end
|
||||
|
||||
feature {NONE} -- cgi
|
||||
|
||||
nature_cgi: STRING = "cgi"
|
||||
|
||||
launch_cgi (a_service: WSF_SERVICE; opts: detachable WSF_SERVICE_LAUNCHER_OPTIONS)
|
||||
launch_cgi (opts: detachable WSF_SERVICE_LAUNCHER_OPTIONS)
|
||||
local
|
||||
launcher: WSF_CGI_SERVICE_LAUNCHER
|
||||
launcher: WSF_CGI_SERVICE_LAUNCHER [G]
|
||||
do
|
||||
create launcher.make_and_launch (a_service, opts)
|
||||
create launcher.make_and_launch (opts)
|
||||
end
|
||||
|
||||
feature {NONE} -- libfcgi
|
||||
|
||||
nature_libfcgi: STRING = "libfcgi"
|
||||
|
||||
launch_libfcgi (a_service: WSF_SERVICE; opts: detachable WSF_SERVICE_LAUNCHER_OPTIONS)
|
||||
launch_libfcgi (opts: detachable WSF_SERVICE_LAUNCHER_OPTIONS)
|
||||
local
|
||||
launcher: WSF_LIBFCGI_SERVICE_LAUNCHER
|
||||
launcher: WSF_LIBFCGI_SERVICE_LAUNCHER [G]
|
||||
do
|
||||
create launcher.make_and_launch (a_service, opts)
|
||||
create launcher.make_and_launch (opts)
|
||||
end
|
||||
|
||||
feature -- Default
|
||||
|
||||
default_nature: STRING
|
||||
do
|
||||
Result := nature_standalone
|
||||
end
|
||||
|
||||
|
||||
|
||||
@@ -8,10 +8,10 @@ note
|
||||
revision: "$Revision: 36 $"
|
||||
|
||||
class
|
||||
APPLICATION_LAUNCHER
|
||||
APPLICATION_LAUNCHER [G -> WSF_EXECUTION create make end]
|
||||
|
||||
inherit
|
||||
APPLICATION_LAUNCHER_I
|
||||
APPLICATION_LAUNCHER_I [G]
|
||||
|
||||
feature -- Custom
|
||||
|
||||
|
||||
@@ -10,15 +10,15 @@ note
|
||||
revision: "$Revision: 96596 $"
|
||||
|
||||
deferred class
|
||||
APPLICATION_LAUNCHER_I
|
||||
APPLICATION_LAUNCHER_I [G -> WSF_EXECUTION create make end]
|
||||
|
||||
feature -- Execution
|
||||
|
||||
launch (a_service: WSF_SERVICE; opts: detachable WSF_SERVICE_LAUNCHER_OPTIONS)
|
||||
launch (opts: detachable WSF_SERVICE_LAUNCHER_OPTIONS)
|
||||
local
|
||||
launcher: WSF_DEFAULT_SERVICE_LAUNCHER
|
||||
launcher: WSF_DEFAULT_SERVICE_LAUNCHER [G]
|
||||
do
|
||||
create {WSF_DEFAULT_SERVICE_LAUNCHER} launcher.make_and_launch (a_service, opts)
|
||||
create launcher.make_and_launch (opts)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -1,115 +0,0 @@
|
||||
note
|
||||
description: "Storage extension for Blog nodes."
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
class
|
||||
CMS_NODE_STORAGE_SQL_BLOG_EXTENSION
|
||||
|
||||
inherit
|
||||
CMS_NODE_STORAGE_EXTENSION [CMS_BLOG]
|
||||
|
||||
CMS_PROXY_STORAGE_SQL
|
||||
rename
|
||||
sql_storage as node_storage
|
||||
redefine
|
||||
node_storage
|
||||
end
|
||||
|
||||
create
|
||||
make
|
||||
|
||||
feature {NONE} -- Initialization
|
||||
|
||||
node_storage: CMS_NODE_STORAGE_SQL
|
||||
-- <Precursor>
|
||||
|
||||
feature -- Access
|
||||
|
||||
content_type: STRING
|
||||
once
|
||||
Result := {CMS_BLOG_NODE_TYPE}.name
|
||||
end
|
||||
|
||||
feature -- Persistence
|
||||
|
||||
store (a_node: CMS_BLOG)
|
||||
local
|
||||
l_parameters: STRING_TABLE [detachable ANY]
|
||||
l_new_tags: detachable STRING_32
|
||||
l_previous_tags: detachable STRING_32
|
||||
l_update: BOOLEAN
|
||||
do
|
||||
error_handler.reset
|
||||
if attached api as l_api then
|
||||
l_api.logger.put_information (generator + ".store", Void)
|
||||
end
|
||||
|
||||
create l_parameters.make (2)
|
||||
l_parameters.put (a_node.id, "nid")
|
||||
l_parameters.put (a_node.revision, "revision")
|
||||
|
||||
sql_query (sql_select_blog_data, l_parameters)
|
||||
if not has_error then
|
||||
if sql_rows_count = 1 then
|
||||
l_previous_tags := sql_read_string_32 (3)
|
||||
l_update := True
|
||||
end
|
||||
if attached a_node.tags as l_tags and then not l_tags.is_empty then
|
||||
create l_new_tags.make (0)
|
||||
across
|
||||
l_tags as ic
|
||||
loop
|
||||
if not l_new_tags.is_empty then
|
||||
l_new_tags.append_character (',')
|
||||
end
|
||||
l_new_tags.append (ic.item)
|
||||
end
|
||||
else
|
||||
l_new_tags := Void
|
||||
end
|
||||
l_parameters.put (l_new_tags, "tags")
|
||||
if l_update and l_new_tags /~ l_previous_tags then
|
||||
sql_change (sql_update_blog_data, l_parameters)
|
||||
elseif l_new_tags /= Void then
|
||||
sql_change (sql_insert_blog_data, l_parameters)
|
||||
else
|
||||
-- no blog data, means everything is empty.
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
load (a_node: CMS_BLOG)
|
||||
local
|
||||
l_parameters: STRING_TABLE [ANY]
|
||||
n: INTEGER
|
||||
do
|
||||
error_handler.reset
|
||||
create l_parameters.make (2)
|
||||
l_parameters.put (a_node.id, "nid")
|
||||
l_parameters.put (a_node.revision, "revision")
|
||||
sql_query (sql_select_blog_data, l_parameters)
|
||||
if not has_error then
|
||||
n := sql_rows_count
|
||||
if n = 1 then
|
||||
-- nid, revision, parent
|
||||
if
|
||||
attached sql_read_string_32 (3) as l_tags and then
|
||||
not l_tags.is_whitespace
|
||||
then
|
||||
-- FIXME: find a simple way to access the declared content types.
|
||||
a_node.set_tags_from_string (l_tags)
|
||||
end
|
||||
else
|
||||
check unique_data: n = 0 end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
feature -- SQL
|
||||
|
||||
sql_select_blog_data: STRING = "SELECT nid, revision, tags FROM blog_post_nodes WHERE nid =:nid AND revision=:revision;"
|
||||
sql_insert_blog_data: STRING = "INSERT INTO blog_post_nodes (nid, revision, tags) VALUES (:nid, :revision, :tags);"
|
||||
sql_update_blog_data: STRING = "UPDATE blog_post_nodes SET nid=:nid, revision=:revision, tags=:tags WHERE nid=:nid AND revision=:revision;"
|
||||
|
||||
end
|
||||
@@ -12,7 +12,6 @@ inherit
|
||||
redefine
|
||||
register_hooks,
|
||||
initialize,
|
||||
is_installed,
|
||||
install
|
||||
end
|
||||
|
||||
@@ -27,12 +26,15 @@ feature {NONE} -- Initialization
|
||||
|
||||
make
|
||||
do
|
||||
name := "Demo module"
|
||||
version := "1.0"
|
||||
description := "Service to demonstrate and test cms system"
|
||||
package := "demo"
|
||||
end
|
||||
|
||||
feature -- Access
|
||||
|
||||
name: STRING = "demo"
|
||||
|
||||
feature {CMS_API} -- Module Initialization
|
||||
|
||||
initialize (api: CMS_API)
|
||||
@@ -49,12 +51,6 @@ feature {CMS_API} -- Module Initialization
|
||||
|
||||
feature {CMS_API} -- Module management
|
||||
|
||||
is_installed (api: CMS_API): BOOLEAN
|
||||
-- Is Current module installed?
|
||||
do
|
||||
Result := attached api.storage.custom_value ("is_initialized", "module-" + name) as v and then v.is_case_insensitive_equal_general ("yes")
|
||||
end
|
||||
|
||||
install (api: CMS_API)
|
||||
local
|
||||
sql: STRING
|
||||
@@ -63,18 +59,18 @@ 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 ("tb_demo") then
|
||||
sql := "[
|
||||
CREATE TABLE "tb_demo"(
|
||||
"demo_id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL CHECK("demo_id">=0),
|
||||
"name" VARCHAR(100) NOT NULL,
|
||||
"value" TEXT
|
||||
CREATE TABLE tb_demo(
|
||||
`demo_id` INTEGER PRIMARY KEY AUTO_INCREMENT NOT NULL CHECK("demo_id">=0),
|
||||
`name` VARCHAR(100) NOT NULL,
|
||||
`value` TEXT
|
||||
);
|
||||
]"
|
||||
l_sql_storage.sql_execute_script (sql)
|
||||
l_sql_storage.sql_execute_script (sql, Void)
|
||||
if l_sql_storage.has_error then
|
||||
api.logger.put_error ("Could not initialize database for demo module", generating_type)
|
||||
end
|
||||
end
|
||||
api.storage.set_custom_value ("is_initialized", "module-" + name, "yes")
|
||||
Precursor {CMS_MODULE}(api)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -83,21 +79,21 @@ feature -- Access: router
|
||||
setup_router (a_router: WSF_ROUTER; a_api: CMS_API)
|
||||
-- <Precursor>
|
||||
do
|
||||
map_uri_template_agent (a_router, "/demo/", agent handle_demo (?,?,a_api))
|
||||
map_uri_template_agent (a_router, "/demo/{id}", agent handle_demo_entry (?,?,a_api))
|
||||
map_uri_template_agent (a_router, "/demo/", agent handle_demo (?,?,a_api), Void)
|
||||
map_uri_template_agent (a_router, "/demo/{id}", agent handle_demo_entry (?,?,a_api), Void)
|
||||
end
|
||||
|
||||
feature -- Hooks
|
||||
|
||||
register_hooks (a_response: CMS_RESPONSE)
|
||||
do
|
||||
a_response.subscribe_to_menu_system_alter_hook (Current)
|
||||
a_response.subscribe_to_block_hook (Current)
|
||||
a_response.hooks.subscribe_to_menu_system_alter_hook (Current)
|
||||
a_response.hooks.subscribe_to_block_hook (Current)
|
||||
end
|
||||
|
||||
block_list: ITERABLE [like {CMS_BLOCK}.name]
|
||||
do
|
||||
Result := <<"demo-info">>
|
||||
Result := <<"?demo-info">>
|
||||
end
|
||||
|
||||
get_block_view (a_block_id: READABLE_STRING_8; a_response: CMS_RESPONSE)
|
||||
@@ -107,12 +103,12 @@ feature -- Hooks
|
||||
m: CMS_MENU
|
||||
lnk: CMS_LOCAL_LINK
|
||||
do
|
||||
if a_block_id.is_case_insensitive_equal_general ("demo-info") then
|
||||
if a_response.request.request_uri.starts_with ("/demo/") then
|
||||
if a_block_id.same_string ("demo-info") then
|
||||
if a_response.location.starts_with_general ("demo/") then
|
||||
create m.make_with_title (a_block_id, "Demo", 2)
|
||||
create lnk.make ("/demo/abc", a_response.url ("/demo/abc", Void))
|
||||
create lnk.make ("demo: abc", "demo/abc")
|
||||
m.extend (lnk)
|
||||
create lnk.make ("/demo/123", a_response.url ("/demo/123", Void))
|
||||
create lnk.make ("demo: 123", "demo/123")
|
||||
m.extend (lnk)
|
||||
create mb.make (m)
|
||||
a_response.add_block (mb, "sidebar_second")
|
||||
@@ -125,7 +121,7 @@ feature -- Hooks
|
||||
lnk: CMS_LOCAL_LINK
|
||||
-- perms: detachable ARRAYED_LIST [READABLE_STRING_8]
|
||||
do
|
||||
create lnk.make ("Demo", "/demo/")
|
||||
create lnk.make ("Demo", "demo/")
|
||||
a_menu_system.primary_menu.extend (lnk)
|
||||
end
|
||||
|
||||
@@ -137,49 +133,31 @@ feature -- Handler
|
||||
r: NOT_IMPLEMENTED_ERROR_CMS_RESPONSE
|
||||
do
|
||||
create r.make (req, res, a_api)
|
||||
r.set_main_content ("NODE module does not yet implement %"" + req.path_info + "%" ...")
|
||||
r.add_error_message ("NODE Module: not yet implemented")
|
||||
r.set_main_content ("DEMO module does not yet implement %"" + req.percent_encoded_path_info + "%" ...")
|
||||
r.add_error_message ("DEMO Module: not yet implemented")
|
||||
r.execute
|
||||
end
|
||||
|
||||
feature -- Mapping helper: uri template
|
||||
|
||||
map_uri_template (a_router: WSF_ROUTER; a_tpl: STRING; h: WSF_URI_TEMPLATE_HANDLER)
|
||||
-- Map `h' as handler for `a_tpl'
|
||||
require
|
||||
a_tpl_attached: a_tpl /= Void
|
||||
h_attached: h /= Void
|
||||
do
|
||||
map_uri_template_with_request_methods (a_router, a_tpl, h, Void)
|
||||
end
|
||||
|
||||
map_uri_template_with_request_methods (a_router: WSF_ROUTER; a_tpl: READABLE_STRING_8; h: WSF_URI_TEMPLATE_HANDLER; rqst_methods: detachable WSF_REQUEST_METHODS)
|
||||
map_uri_template (a_router: WSF_ROUTER; a_tpl: READABLE_STRING_8; h: WSF_URI_TEMPLATE_HANDLER; rqst_methods: detachable WSF_REQUEST_METHODS)
|
||||
-- Map `h' as handler for `a_tpl' for request methods `rqst_methods'.
|
||||
require
|
||||
a_tpl_attached: a_tpl /= Void
|
||||
h_attached: h /= Void
|
||||
do
|
||||
a_router.map_with_request_methods (create {WSF_URI_TEMPLATE_MAPPING}.make (a_tpl, h), rqst_methods)
|
||||
a_router.map (create {WSF_URI_TEMPLATE_MAPPING}.make (a_tpl, h), rqst_methods)
|
||||
end
|
||||
|
||||
feature -- Mapping helper: uri template agent
|
||||
|
||||
map_uri_template_agent (a_router: WSF_ROUTER; a_tpl: READABLE_STRING_8; proc: PROCEDURE [ANY, TUPLE [req: WSF_REQUEST; res: WSF_RESPONSE]])
|
||||
-- Map `proc' as handler for `a_tpl'
|
||||
require
|
||||
a_tpl_attached: a_tpl /= Void
|
||||
proc_attached: proc /= Void
|
||||
do
|
||||
map_uri_template_agent_with_request_methods (a_router, a_tpl, proc, Void)
|
||||
end
|
||||
|
||||
map_uri_template_agent_with_request_methods (a_router: WSF_ROUTER; a_tpl: READABLE_STRING_8; proc: PROCEDURE [ANY, TUPLE [req: WSF_REQUEST; res: WSF_RESPONSE]]; rqst_methods: detachable WSF_REQUEST_METHODS)
|
||||
map_uri_template_agent (a_router: WSF_ROUTER; a_tpl: READABLE_STRING_8; proc: PROCEDURE [ANY, TUPLE [req: WSF_REQUEST; res: WSF_RESPONSE]]; rqst_methods: detachable WSF_REQUEST_METHODS)
|
||||
-- Map `proc' as handler for `a_tpl' for request methods `rqst_methods'.
|
||||
require
|
||||
a_tpl_attached: a_tpl /= Void
|
||||
proc_attached: proc /= Void
|
||||
do
|
||||
map_uri_template_with_request_methods (a_router, a_tpl, create {WSF_URI_TEMPLATE_AGENT_HANDLER}.make (proc), rqst_methods)
|
||||
map_uri_template (a_router, a_tpl, create {WSF_URI_TEMPLATE_AGENT_HANDLER}.make (proc), rqst_methods)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -1,11 +1,50 @@
|
||||
[layout]
|
||||
root-dir=site/www
|
||||
themes-dir=site/themes
|
||||
#themes-dir=site/themes
|
||||
#modules-dir=site/modules
|
||||
|
||||
[site]
|
||||
name=Eiffel CMS
|
||||
email=your@email.com
|
||||
theme=bootstrap
|
||||
|
||||
[misc]
|
||||
smtp=localhost
|
||||
[mailer]
|
||||
smtp=localhost:25
|
||||
#sendmail=/usr/bin/sendmail
|
||||
#output=@stderr
|
||||
|
||||
[modules]
|
||||
# Module status
|
||||
# *=on -> modules are enabled by default
|
||||
# *=off -> modules are disabled by default
|
||||
# Default is "on"
|
||||
# for each module, this can be overwritten with
|
||||
# module_name= on or off
|
||||
*=all
|
||||
admin=on
|
||||
auth=on
|
||||
basic_auth=on
|
||||
blog=on
|
||||
debug=on
|
||||
demo=on
|
||||
node=on
|
||||
oauth20=on
|
||||
openid=on
|
||||
|
||||
[blocks]
|
||||
#navigation.region=sidebar_first
|
||||
feed.eiffel.region=feed_eiffel
|
||||
feed.eiffel.condition=is_front
|
||||
|
||||
feed.forum.region=feed_forum
|
||||
feed.forum.condition=is_front
|
||||
|
||||
feed.stackoverflow.region=feed_stackoverflow
|
||||
feed.stackoverflow.condition=is_front
|
||||
|
||||
#management.condition=is_front
|
||||
#navigation.condition=is_front
|
||||
|
||||
[admin]
|
||||
# CMS Installation, are accessible by "all", "none" or uppon "permission". (default is none)
|
||||
installation_access=permission
|
||||
|
||||
@@ -1,15 +1,18 @@
|
||||
{
|
||||
"database": {
|
||||
"datasource": {
|
||||
"driver": "sqlite",
|
||||
"environment": "sqlite"
|
||||
"driver": "odbc",
|
||||
"environment": "odbc-sqlite"
|
||||
},
|
||||
"environments": {
|
||||
"sqlite": {
|
||||
"odbc-sqlite": {
|
||||
"connection_string":"Driver=SQLite3 ODBC Driver;Database=./site/database.sqlite;LongNames=0;Timeout=1000;NoTXN=0;SyncPragma=NORMAL;StepAPI=0;"
|
||||
},
|
||||
"test": {
|
||||
"connection_string":"Server=localhost;Port=3306;Database=cms_dev;Uid=root;Pwd=;"
|
||||
"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=;"
|
||||
@@ -23,7 +26,8 @@
|
||||
"server": "localhost"
|
||||
},
|
||||
"logger": {
|
||||
"level":"debug",
|
||||
"level":"error",
|
||||
"type":"stderr",
|
||||
"backup_count":"4"
|
||||
},
|
||||
"server": {
|
||||
28
examples/demo/site/config/modules/feed_aggregator/feeds.json
Normal file
28
examples/demo/site/config/modules/feed_aggregator/feeds.json
Normal file
@@ -0,0 +1,28 @@
|
||||
{
|
||||
"ids": ["eiffel", "forum"],
|
||||
"feeds": {
|
||||
"eiffel": {
|
||||
"title": "Eiffel related posts.",
|
||||
"expiration": "21600",
|
||||
"size": 10,
|
||||
"locations": [
|
||||
"https://bertrandmeyer.com/feed/",
|
||||
"https://room.eiffel.com/blog/feed",
|
||||
"https://room.eiffel.com/article/feed",
|
||||
"https://room.eiffel.com/library/feed"
|
||||
]
|
||||
, "categories": ["Eiffel"]
|
||||
,"option_description": "enabled"
|
||||
},
|
||||
"forum": {
|
||||
"title": "Eiffel Forum",
|
||||
"expiration": "21600",
|
||||
"size": 10,
|
||||
"locations": [
|
||||
"https://groups.google.com/forum/feed/eiffel-users/msgs/atom.xml?num=15".
|
||||
"http://stackoverflow.com/feeds/tag?tagnames=eiffel&sort=newest"
|
||||
]
|
||||
,"option_description": "enabled"
|
||||
}
|
||||
}
|
||||
}
|
||||
34
examples/demo/site/modules/admin/files/css/admin.css
Normal file
34
examples/demo/site/modules/admin/files/css/admin.css
Normal file
@@ -0,0 +1,34 @@
|
||||
ul.cms-users {
|
||||
list-style-type: none;
|
||||
padding: 3px 3px 3px 3px;
|
||||
border: solid 1px #ccc; }
|
||||
ul.cms-users li {
|
||||
border-top: dotted 1px #ccc; }
|
||||
ul.cms-users li:first-child {
|
||||
border-top: none; }
|
||||
ul.cms-users li.cms_user a::before {
|
||||
content: "[users] "; }
|
||||
|
||||
ul.cms-roles {
|
||||
list-style-type: none;
|
||||
padding: 3px 3px 3px 3px;
|
||||
border: solid 1px #ccc; }
|
||||
ul.cms-roles li {
|
||||
border-top: dotted 1px #ccc; }
|
||||
ul.cms-roles li:first-child {
|
||||
border-top: none; }
|
||||
ul.cms-roles li.cms_role a::before {
|
||||
content: "[roles] "; }
|
||||
|
||||
ul.cms-permissions {
|
||||
list-style-type: none;
|
||||
padding: 3px 3px 3px 3px;
|
||||
border: solid 1px #ccc; }
|
||||
ul.cms-permissions li {
|
||||
border-top: dotted 1px #ccc; }
|
||||
ul.cms-permissions li:first-child {
|
||||
border-top: none; }
|
||||
ul.cms-permissions li.cms_permission a::before {
|
||||
content: "[permission] "; }
|
||||
|
||||
/*# sourceMappingURL=admin.css.map */
|
||||
59
examples/demo/site/modules/admin/files/scss/admin.scss
Normal file
59
examples/demo/site/modules/admin/files/scss/admin.scss
Normal file
@@ -0,0 +1,59 @@
|
||||
ul.cms-users {
|
||||
|
||||
list-style-type: none;
|
||||
padding: 3px 3px 3px 3px;
|
||||
border: solid 1px #ccc;
|
||||
|
||||
li{
|
||||
border-top: dotted 1px #ccc;
|
||||
&:first-child {
|
||||
border-top: none;
|
||||
}
|
||||
}
|
||||
|
||||
li.cms_user a::before {
|
||||
content: "[users] ";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
ul.cms-roles {
|
||||
|
||||
list-style-type: none;
|
||||
padding: 3px 3px 3px 3px;
|
||||
border: solid 1px #ccc;
|
||||
|
||||
li{
|
||||
border-top: dotted 1px #ccc;
|
||||
&:first-child {
|
||||
border-top: none;
|
||||
}
|
||||
}
|
||||
|
||||
li.cms_role a::before {
|
||||
content: "[roles] ";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
ul.cms-permissions {
|
||||
|
||||
list-style-type: none;
|
||||
padding: 3px 3px 3px 3px;
|
||||
border: solid 1px #ccc;
|
||||
|
||||
li{
|
||||
border-top: dotted 1px #ccc;
|
||||
&:first-child {
|
||||
border-top: none;
|
||||
}
|
||||
}
|
||||
|
||||
li.cms_permission a::before {
|
||||
content: "[permission] ";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
8
examples/demo/site/modules/auth/auth.json
Normal file
8
examples/demo/site/modules/auth/auth.json
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"email": "webmaster@example.com",
|
||||
"subjet_register": "Thank you for regitering with us, activate account",
|
||||
"subjet_activate": "New account ativation token",
|
||||
"subjet_password": "Password Recovery!!!",
|
||||
"subjet_oauth": "Welcome",
|
||||
"smtp": "127.0.0.1"
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Activation</title>
|
||||
<meta name="description" content="Activation">
|
||||
<meta name="author" content="ROC CMS">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<p>Thank you for registering at <a href="$host">ROC CMS</a></p>
|
||||
|
||||
<p>To complete your registration, please click on this link to activate your account:<p>
|
||||
|
||||
<p><a href="$link">$link</a></p>
|
||||
<p>Thank you for joining us.</p>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,17 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>New Password</title>
|
||||
<meta name="description" content="New Password">
|
||||
<meta name="author" content="ROC CMS">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<p>You have required a new password at <a href="$host">ROC CMS</a></p>
|
||||
|
||||
<p>To complete your request, please click on this link to genereate a new password:<p>
|
||||
|
||||
<p><a href="$link">$link</a></p>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,18 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>New Activation</title>
|
||||
<meta name="description" content="New Activation token">
|
||||
<meta name="author" content="ROC CMS">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<p>You have request a new activation token at <a href="$host">ROC CMS</a></p>
|
||||
|
||||
<p>To complete your registration, please click on this link to activate your account:<p>
|
||||
|
||||
<p><a href="$link">$link</a></p>
|
||||
<p>Thank you for joining us.</p>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,13 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Welcome</title>
|
||||
<meta name="description" content="Welcome">
|
||||
<meta name="author" content="ROC CMS">
|
||||
</head>
|
||||
<body>
|
||||
<p>Welcome to<a href="$host">ROC CMS</a></p>
|
||||
<p>Thank you for joining us.</p>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,67 @@
|
||||
<div class="primary-tabs">
|
||||
{if isset="$user"}
|
||||
<h3>Account Information</h3>
|
||||
<div>
|
||||
<div>
|
||||
<div>
|
||||
<label>Username:</label> {$user.name/}
|
||||
</div>
|
||||
<div>
|
||||
<label>Email:</label> {$user.email/}
|
||||
</div>
|
||||
<div>
|
||||
<label>Creation Date:</label> {$user.creation_date/}
|
||||
</div>
|
||||
<div>
|
||||
<label>Last login:</label> {$user.last_login_date/}
|
||||
</div>
|
||||
<div>
|
||||
<form method="get" action="{$site_url/}{$auth_login_strategy/}">
|
||||
<button type="submit">Logout</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
{include file="block_change_password.tpl" /}
|
||||
<hr>
|
||||
<h4>Roles</h4>
|
||||
<div>
|
||||
{foreach item="ic" from="$roles"}
|
||||
<div>
|
||||
<ul>
|
||||
<li>
|
||||
<strong>{$ic.name/}</strong>
|
||||
<ul>
|
||||
<li> <i>permissions</i>
|
||||
<ul>
|
||||
{foreach item="ip" from="$ic.permissions"}
|
||||
<li>{$ip/}</li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
{/foreach}
|
||||
</div>
|
||||
|
||||
|
||||
<hr>
|
||||
<h4>Profile</h4>
|
||||
<div>
|
||||
{foreach item="the_value" key="the_name" from="$user.profile"}
|
||||
<div>
|
||||
<label>{$the_name/}:</label> {$the_value/}
|
||||
</div>
|
||||
{/foreach}
|
||||
</div>
|
||||
{/if}
|
||||
{unless isset="$user"}
|
||||
<div>
|
||||
<p> You are not logged in </p>
|
||||
<a href="{$site_url/}account/roc-login">Go to the login page</a>
|
||||
</div>
|
||||
{/unless}
|
||||
</div>
|
||||
@@ -0,0 +1,21 @@
|
||||
<div>
|
||||
<form action="{$site_url/}account/change-password" method="post">
|
||||
<fieldset>
|
||||
<legend>Change Password Form</legend>
|
||||
<div>
|
||||
<input type="password" id="password" name="password" value="" required/>
|
||||
<label for="password">Password</label>
|
||||
</div>
|
||||
<div>
|
||||
<input type="password" id="confirm_password" name="confirm_password" value="" required/>
|
||||
<label for="password">Confirm Password</label>
|
||||
</div>
|
||||
|
||||
<button type="submit">Confirm</button>
|
||||
{if isset="$error_password"}
|
||||
<span><i>{$error_password/}</i></span> <br>
|
||||
{/if}
|
||||
|
||||
</fieldset>
|
||||
</form>
|
||||
</div>
|
||||
29
examples/demo/site/modules/auth/templates/block_login.tpl
Normal file
29
examples/demo/site/modules/auth/templates/block_login.tpl
Normal file
@@ -0,0 +1,29 @@
|
||||
<div class="primary-tabs">
|
||||
{unless isset="$user"}
|
||||
<h3>Login or <a href="{$site_url/}account/roc-register">Register</a></h3>
|
||||
<div>
|
||||
<div>
|
||||
<form action method="POST">
|
||||
<div>
|
||||
<input type="text" name="username" required>
|
||||
<label>Username</label>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<input type="password" name="password" required>
|
||||
<label>Password</label>
|
||||
</div>
|
||||
|
||||
<button type="button" onclick="ROC_AUTH.login();">Login</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div>
|
||||
<p>
|
||||
<a href="{$site_url/}account/new-password">Forgot password?</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
{/unless}
|
||||
</div>
|
||||
@@ -0,0 +1,32 @@
|
||||
<div>
|
||||
<form action="{$site_url/}account/new-password" method="post">
|
||||
<fieldset>
|
||||
<legend>Request new password by email</legend>
|
||||
<div>
|
||||
<input type="email" id="email" name="email" value="{$email/}" required/>
|
||||
<label for="email">Email</label>
|
||||
{if isset="$error_email"}
|
||||
<span><i>{$error_email/}</i></span> <br>
|
||||
{/if}
|
||||
<br>
|
||||
</div>
|
||||
<button type="submit">Send</button>
|
||||
</fieldset>
|
||||
</form>
|
||||
<hr>
|
||||
<form action="{$site_url/}account/new-password" method="post">
|
||||
<fieldset>
|
||||
<legend>Request new password by username</legend>
|
||||
<div>
|
||||
<input type="text" id="username" name="username" value="{$username/}" required/>
|
||||
<label for="username">Username</label>
|
||||
{if isset="$error_username"}
|
||||
<span><i>{$error_username/}</i></span> <br>
|
||||
{/if}
|
||||
<br>
|
||||
</div>
|
||||
<button type="submit">Send</button>
|
||||
</fieldset>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
@@ -0,0 +1,3 @@
|
||||
<div>
|
||||
<p>You new password has been saved!, Login again</p>
|
||||
</div>
|
||||
@@ -0,0 +1,3 @@
|
||||
<div>
|
||||
<p>We have send you a new token code, check your email to generate a new password</p>
|
||||
</div>
|
||||
@@ -0,0 +1,3 @@
|
||||
<div>
|
||||
<p>We have send you a new activation code, check your email to activate your account.</p>
|
||||
</div>
|
||||
@@ -0,0 +1,3 @@
|
||||
<div>
|
||||
<p>Thanks for register, check your email to activate your account.</p>
|
||||
</div>
|
||||
@@ -0,0 +1,3 @@
|
||||
<div>
|
||||
<p>You new password has been saved!</p>
|
||||
</div>
|
||||
@@ -0,0 +1,19 @@
|
||||
<div>
|
||||
<form action="{$site_url/}account/reactivate" method="post">
|
||||
<fieldset>
|
||||
<legend>Reactivate Form</legend>
|
||||
<div>
|
||||
<input type="email" id="email" name="email" value="{$email/}" required/>
|
||||
<label for="email">Email</label>
|
||||
{if isset="$error_email"}
|
||||
<span><i>{$error_email/}</i></span> <br>
|
||||
{/if}
|
||||
<br>
|
||||
{if isset="$is_active"}
|
||||
<span><i>{$is_active/}</i></span> <br>
|
||||
{/if}
|
||||
</div>
|
||||
<button type="submit">Reactivate</button>
|
||||
</fieldset>
|
||||
</form>
|
||||
</div>
|
||||
28
examples/demo/site/modules/auth/templates/block_register.tpl
Normal file
28
examples/demo/site/modules/auth/templates/block_register.tpl
Normal file
@@ -0,0 +1,28 @@
|
||||
<div>
|
||||
<form action="{$site_url/}account/roc-register" method="post">
|
||||
<fieldset>
|
||||
<legend>Register Form</legend>
|
||||
<div>
|
||||
<input type="text" id="name" name="name" value="{$name/}" required autofocus />
|
||||
<label for="name">Name</label>
|
||||
{if isset="$error_name"}
|
||||
<span><i>{$error_name/}</i></span> <br>
|
||||
{/if}
|
||||
</div>
|
||||
<div>
|
||||
<input type="password" id="password" name="password" value="" required/>
|
||||
<label for="password">Password</label>
|
||||
</div>
|
||||
<div>
|
||||
<input type="email" id="email" name="email" value="{$email/}" required/>
|
||||
<label for="email">Email</label>
|
||||
{if isset="$error_email"}
|
||||
<span><i>{$error_email/}</i></span> <br>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
|
||||
<button type="submit">Register</button>
|
||||
</fieldset>
|
||||
</form>
|
||||
</div>
|
||||
@@ -0,0 +1,28 @@
|
||||
<div>
|
||||
<form action="{$site_url/}account/reset-password" method="post">
|
||||
<fieldset>
|
||||
<legend>Generate New Password Form</legend>
|
||||
<div>
|
||||
<input type="text" id="token" name="token" value="{$token/}" required />
|
||||
<label for="token">Token</label>
|
||||
{if isset="$error_token"}
|
||||
<span><i>{$error_token/}</i></span> <br>
|
||||
{/if}
|
||||
</div>
|
||||
<div>
|
||||
<input type="password" id="password" name="password" value="" required/>
|
||||
<label for="password">Password</label>
|
||||
</div>
|
||||
<div>
|
||||
<input type="password" id="confirm_password" name="confirm_password" value="" required/>
|
||||
<label for="password">Confirm Password</label>
|
||||
</div>
|
||||
|
||||
<button type="submit">Confirm</button>
|
||||
{if isset="$error_password"}
|
||||
<span><i>{$error_password/}</i></span> <br>
|
||||
{/if}
|
||||
|
||||
</fieldset>
|
||||
</form>
|
||||
</div>
|
||||
@@ -1,12 +1,13 @@
|
||||
var ROC_AUTH = ROC_AUTH || { };
|
||||
|
||||
var loginURL = "/login";
|
||||
var logoutURL = "/logoff";
|
||||
var loginURL = "/basic_auth_login";
|
||||
var logoutURL = "/basic_auth_logoff";
|
||||
|
||||
var userAgent = navigator.userAgent.toLowerCase();
|
||||
var firstLogIn = true;
|
||||
|
||||
ROC_AUTH.login = function() {
|
||||
var form = document.forms[0];
|
||||
var form = document.forms['cms_basic_auth'];
|
||||
var username = form.username.value;
|
||||
var password = form.password.value;
|
||||
//var host = form.host.value;
|
||||
@@ -24,7 +25,7 @@ ROC_AUTH.login = function() {
|
||||
var newdiv = document.createElement('div');
|
||||
newdiv.innerHTML = "<br>Invalid Credentials</br>";
|
||||
newdiv.id = 'myModalFormId';
|
||||
$("body").append(newdiv);
|
||||
$(".primary-tabs").append(newdiv);
|
||||
}
|
||||
}else{
|
||||
|
||||
@@ -38,7 +39,7 @@ ROC_AUTH.login = function() {
|
||||
if (request.readyState == 4) {
|
||||
if (request.status==200) {
|
||||
delete form;
|
||||
window.location=origin;
|
||||
window.location=window.location.origin;
|
||||
}
|
||||
else{
|
||||
if (navigator.userAgent.toLowerCase().indexOf("firefox") != -1){
|
||||
@@ -48,7 +49,7 @@ ROC_AUTH.login = function() {
|
||||
var newdiv = document.createElement('div');
|
||||
newdiv.innerHTML = "<br>Invalid Credentials</br>";
|
||||
newdiv.id = 'myModalFormId';
|
||||
$("body").append(newdiv);
|
||||
$(".primary-tabs").append(newdiv);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -92,7 +93,7 @@ ROC_AUTH.login_with_redirect = function() {
|
||||
var newdiv = document.createElement('div');
|
||||
newdiv.innerHTML = "<br>Invalid Credentials</br>";
|
||||
newdiv.id = 'myModalFormId';
|
||||
$("body").append(newdiv);
|
||||
$(".primary-tabs").append(newdiv);
|
||||
$("#imgProgressRedirect").hide();
|
||||
}
|
||||
}else{
|
||||
@@ -121,8 +122,8 @@ ROC_AUTH.login_with_redirect = function() {
|
||||
var newdiv = document.createElement('div');
|
||||
newdiv.innerHTML = "<br>Invalid Credentials</br>";
|
||||
newdiv.id = 'myModalFormId';
|
||||
$("body").append(newdiv);
|
||||
$("#imgProgressRedirect").hide();
|
||||
$(".primary-tabs").append(newdiv);
|
||||
$("#imgProgressRedirect").hide();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -305,3 +306,20 @@ ROC_AUTH.create_form = function() {
|
||||
};
|
||||
|
||||
|
||||
var password = document.getElementById("password");
|
||||
var confirm_password = document.getElementById("confirm_password");
|
||||
|
||||
ROC_AUTH.validatePassword =function(){
|
||||
if ((password != null) && (confirm_password != null)) {
|
||||
if(password.value != confirm_password.value) {
|
||||
confirm_password.setCustomValidity("Passwords Don't Match");
|
||||
} else {
|
||||
confirm_password.setCustomValidity('');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ((password != null) && (confirm_password != null)) {
|
||||
password.onchange = ROC_AUTH.validatePassword();
|
||||
confirm_password.onkeyup = ROC_AUTH.validatePassword;
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
<div class="primary-tabs">
|
||||
{unless isset="$user"}
|
||||
<h3>Login or <a href="{$site_url/}account/roc-register">Register</a></h3>
|
||||
<div>
|
||||
<div>
|
||||
<form name="cms_basic_auth" action method="POST">
|
||||
<div>
|
||||
<input type="text" name="username" id="username" required>
|
||||
<label>Username</label>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<input type="password" name="password" id="password" required>
|
||||
<label>Password</label>
|
||||
</div>
|
||||
|
||||
<button type="button" onclick="ROC_AUTH.login();">Login</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div>
|
||||
<p>
|
||||
<a href="{$site_url/}account/new-password">Forgot password?</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
{/unless}
|
||||
</div>
|
||||
@@ -0,0 +1,53 @@
|
||||
div.feed ul {
|
||||
list-style: none;
|
||||
position: relative;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
width: 99%;
|
||||
}
|
||||
div.feed li {
|
||||
/* border-top: solid 1px #ddd; */
|
||||
padding: 0;
|
||||
margin: 0 0 5px 0;
|
||||
}
|
||||
div.feed li a {
|
||||
font-weight: bold;
|
||||
}
|
||||
div.feed li .date {
|
||||
font-weight: bold;
|
||||
font-size: small;
|
||||
}
|
||||
div.feed li .category {
|
||||
margin-left: 20px;
|
||||
font-size: 8px;
|
||||
height: 9px;
|
||||
overflow: hidden;
|
||||
color: #999;
|
||||
}
|
||||
div.feed li .description {
|
||||
margin-left: 20px;
|
||||
font-size: small;
|
||||
height: 18px;
|
||||
overflow: hidden;
|
||||
color: #999;
|
||||
}
|
||||
div.feed li:hover {
|
||||
margin-bottom: 23px;
|
||||
}
|
||||
div.feed li:hover .description {
|
||||
padding: 5px;
|
||||
position: absolute;
|
||||
height: auto;
|
||||
overflow-y: scroll;
|
||||
overflow-x: scroll;
|
||||
color: #000;
|
||||
background-color: #fff;
|
||||
border: solid 1px #000;
|
||||
z-index: 10;
|
||||
}
|
||||
div.feed li:hover:last-child {
|
||||
margin-bottom: 28px;
|
||||
}
|
||||
div.feed li .description::after {
|
||||
content: "...";
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
div.feed {
|
||||
ul {
|
||||
list-style: none;
|
||||
position: relative;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
width: 99%;
|
||||
}
|
||||
li {
|
||||
/* border-top: solid 1px #ddd; */
|
||||
padding: 0;
|
||||
margin: 0 0 5px 0;
|
||||
|
||||
a {
|
||||
font-weight: bold;
|
||||
}
|
||||
.date {
|
||||
font-weight: bold;
|
||||
font-size: small;
|
||||
}
|
||||
.category {
|
||||
margin-left: 20px;
|
||||
font-size: 8px;
|
||||
height: 9px;
|
||||
overflow: hidden;
|
||||
color: #999;
|
||||
}
|
||||
.description {
|
||||
margin-left: 20px;
|
||||
font-size: small;
|
||||
height: 18px;
|
||||
overflow: hidden;
|
||||
color: #999;
|
||||
}
|
||||
&:hover {
|
||||
margin-bottom: 23px;
|
||||
.description {
|
||||
padding: 5px;
|
||||
position: absolute;
|
||||
height: auto;
|
||||
overflow-y: scroll;
|
||||
overflow-x: scroll;
|
||||
color: #000;
|
||||
background-color: #fff;
|
||||
border: solid 1px #000;
|
||||
z-index: 10;
|
||||
}
|
||||
&:last-child {
|
||||
margin-bottom: 28px;
|
||||
}
|
||||
}
|
||||
.description::after { content: "..."; }
|
||||
}
|
||||
}
|
||||
37
examples/demo/site/modules/node/scripts/node.sql
Normal file
37
examples/demo/site/modules/node/scripts/node.sql
Normal file
@@ -0,0 +1,37 @@
|
||||
|
||||
CREATE TABLE nodes (
|
||||
`nid` INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT UNIQUE,
|
||||
`revision` INTEGER,
|
||||
`type` TEXT NOT NULL,
|
||||
`title` VARCHAR(255) NOT NULL,
|
||||
`summary` TEXT,
|
||||
`content` TEXT,
|
||||
`format` VARCHAR(128),
|
||||
`author` INTEGER,
|
||||
`publish` DATETIME,
|
||||
`created` DATETIME NOT NULL,
|
||||
`changed` DATETIME NOT NULL,
|
||||
`status` INTEGER,
|
||||
CONSTRAINT Unique_nid_revision UNIQUE (nid,revision)
|
||||
);
|
||||
|
||||
CREATE TABLE node_revisions (
|
||||
`nid` INTEGER NOT NULL,
|
||||
`revision` INTEGER NOT NULL,
|
||||
`title` VARCHAR(255) NOT NULL,
|
||||
`summary` TEXT,
|
||||
`content` TEXT,
|
||||
`format` VARCHAR(128),
|
||||
`author` INTEGER,
|
||||
`changed` DATETIME NOT NULL,
|
||||
`status` INTEGER,
|
||||
CONSTRAINT Unique_nid_revision PRIMARY KEY (nid,revision)
|
||||
);
|
||||
|
||||
CREATE TABLE page_nodes(
|
||||
`nid` INTEGER NOT NULL,
|
||||
`revision` INTEGER NOT NULL,
|
||||
`parent` INTEGER,
|
||||
CONSTRAINT PK_nid_revision PRIMARY KEY (nid,revision)
|
||||
);
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
|
||||
CREATE TABLE oauth2_consumers(
|
||||
`cid` INTEGER PRIMARY KEY NOT NULL CHECK(`cid`>=0),
|
||||
`name` VARCHAR(255) NOT NULL,
|
||||
`api_secret` TEXT NOT NULL,
|
||||
`api_key` TEXT NOT NULL,
|
||||
`scope` VARCHAR (100) NOT NULL,
|
||||
`protected_resource_url` VARCHAR (255) NOT NULL,
|
||||
`callback_name` VARCHAR(255) NOT NULL,
|
||||
`extractor` VARCHAR(50) NOT NULL,
|
||||
`authorize_url` VARCHAR (255) NOT NULL,
|
||||
`endpoint` VARCHAR (255) NOT NULL,
|
||||
CONSTRAINT `cid`
|
||||
UNIQUE(`cid`),
|
||||
CONSTRAINT `name`
|
||||
UNIQUE(`name`)
|
||||
);
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
-- Change the values TO_COMPLETE based on your API.
|
||||
-- API SECTET KEY AND API PUBLIC KEY
|
||||
INSERT INTO oauth2_consumers (name, api_secret, api_key, scope, protected_resource_url, callback_name, extractor, authorize_url, endpoint)
|
||||
VALUES ('google', 'TO-COMPLETE', 'TO-COMPLETE', 'email', 'https://www.googleapis.com/plus/v1/people/me', 'callback_google', 'json','https://accounts.google.com/o/oauth2/auth?response_type=code&client_id=$CLIENT_ID&redirect_uri=$REDIRECT_URI','https://accounts.google.com/o/oauth2/token');
|
||||
|
||||
INSERT INTO oauth2_consumers (name, api_secret, api_key, scope, protected_resource_url, callback_name, extractor, authorize_url, endpoint )
|
||||
VALUES ('facebook', 'TO-COMPLETE', 'TO-COMPLETE', 'email', 'https://graph.facebook.com/me', 'callback_facebook','text','https://www.facebook.com/dialog/oauth?response_type=code&client_id=$CLIENT_ID&redirect_uri=$REDIRECT_URI','https://graph.facebook.com/oauth/access_token');
|
||||
@@ -0,0 +1,13 @@
|
||||
|
||||
CREATE TABLE $table_name (
|
||||
`uid` INTEGER PRIMARY KEY NOT NULL CHECK(`uid`>=0),
|
||||
`access_token` TEXT NOT NULL,
|
||||
`created` DATETIME NOT NULL,
|
||||
`details` TEXT NOT NULL,
|
||||
`email` TEXT NOT NULL,
|
||||
CONSTRAINT `uid`
|
||||
UNIQUE(`uid`),
|
||||
CONSTRAINT `email`
|
||||
UNIQUE(`email`)
|
||||
);
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
<hr>
|
||||
{unless isempty="$oauth_associated"}
|
||||
<h4>Un-Associate Account with Oauth Consumer</h4>
|
||||
<div>
|
||||
{foreach item="consumer" from="$oauth_associated"}
|
||||
<div>
|
||||
<form method="post" action="{$site_url/}account/oauth-un-associate">
|
||||
<input type="hidden" name="consumer" value="{$consumer/}"/>
|
||||
<div>
|
||||
<button type="submit">Unlink {$consumer/}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
{/foreach}
|
||||
</div>
|
||||
{/unless}
|
||||
{unless isempty="$oauth_not_associated"}
|
||||
<h4>Associate Account with Oauth Consumer</h4>
|
||||
<div>
|
||||
{foreach item="consumer" from="$oauth_not_associated"}
|
||||
<div>
|
||||
<form method="post" action="{$site_url/}account/oauth-associate">
|
||||
<input type="hidden" name="consumer" value="{$consumer/}"/>
|
||||
<div>
|
||||
<input type="email" id="email" name="email" value="{$email/}" required/>
|
||||
<button type="submit">Link with {$consumer/}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
{/foreach}
|
||||
</div>
|
||||
{/unless}
|
||||
@@ -0,0 +1,7 @@
|
||||
<div class="primary-tabs">
|
||||
<div>
|
||||
{foreach item="item" from="$oauth_consumers"}
|
||||
<a href="{$site_url/}account/login-with-oauth/{$item/}">Login with {$item/}</a><br>
|
||||
{/foreach}
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,11 @@
|
||||
|
||||
CREATE TABLE openid_consumers(
|
||||
`cid` INTEGER PRIMARY KEY NOT NULL CHECK(`cid`>=0),
|
||||
`name` VARCHAR(255) NOT NULL,
|
||||
`endpoint` VARCHAR (255) NOT NULL,
|
||||
CONSTRAINT `cid`
|
||||
UNIQUE(`cid`),
|
||||
CONSTRAINT `name`
|
||||
UNIQUE(`name`)
|
||||
);
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
-- Change the values TO_COMPLETE based on your API.
|
||||
-- API SECTET KEY AND API PUBLIC KEY
|
||||
INSERT INTO openid_consumers (name, endpoint)
|
||||
VALUES ('yahoo', 'https://me.yahoo.com/');
|
||||
11
examples/demo/site/modules/openid/scripts/openid_items.sql
Normal file
11
examples/demo/site/modules/openid/scripts/openid_items.sql
Normal file
@@ -0,0 +1,11 @@
|
||||
|
||||
CREATE TABLE openid_items (
|
||||
`uid` INTEGER PRIMARY KEY NOT NULL CHECK(`uid`>=0),
|
||||
`identity` TEXT NOT NULL,
|
||||
`created` DATETIME NOT NULL,
|
||||
CONSTRAINT `uid`
|
||||
UNIQUE(`uid`),
|
||||
CONSTRAINT `identity`
|
||||
UNIQUE(`identity`)
|
||||
);
|
||||
|
||||
18
examples/demo/site/modules/openid/templates/block_login.tpl
Normal file
18
examples/demo/site/modules/openid/templates/block_login.tpl
Normal file
@@ -0,0 +1,18 @@
|
||||
<div>
|
||||
<form action="{$site_url/}account/roc-openid-login" id="openid-login" method="POST">
|
||||
<div>
|
||||
<strong><label for="openid">OpenID identifier</label></strong><br/>
|
||||
<input type="text" name="openid" value="" size="50"/>
|
||||
</div>
|
||||
<div><input type="submit" name="op" value="Validate"/></div>
|
||||
<div hgv vtid="openid">Login with
|
||||
{foreach item="item" from="$openid_consumers"}
|
||||
<a href="{$site_url/}account/login-with-openid/{$item/}">{$item/}</a><br>
|
||||
{/foreach}
|
||||
</form>
|
||||
<div>
|
||||
{if isset="$error"}
|
||||
<span><i>{$error/}</i></span> <br>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,28 +1,23 @@
|
||||
BEGIN;
|
||||
|
||||
|
||||
CREATE TABLE "logs"(
|
||||
"id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL CHECK("id">=0),
|
||||
"category" VARCHAR(255) NOT NULL,
|
||||
"level" INTEGER NOT NULL CHECK("level">=1),
|
||||
"uid" INTEGER,
|
||||
"message" TEXT NOT NULL,
|
||||
"info" TEXT,
|
||||
"link" TEXT,
|
||||
"date" DATETIME NOT NULL
|
||||
CREATE TABLE `logs`(
|
||||
`id` INTEGER PRIMARY KEY AUTO_INCREMENT NOT NULL,
|
||||
`category` VARCHAR(255) NOT NULL,
|
||||
`level` INTEGER NOT NULL,
|
||||
`uid` INTEGER,
|
||||
`message` TEXT NOT NULL,
|
||||
`info` TEXT,
|
||||
`link` TEXT,
|
||||
`date` DATETIME NOT NULL
|
||||
);
|
||||
|
||||
CREATE TABLE "custom_values"(
|
||||
"type" VARCHAR(255) NOT NULL,
|
||||
"name" VARCHAR(255) NOT NULL,
|
||||
"value" VARCHAR(255) NOT NULL
|
||||
CREATE TABLE `custom_values`(
|
||||
`type` VARCHAR(255) NOT NULL,
|
||||
`name` VARCHAR(255) NOT NULL,
|
||||
`value` TEXT
|
||||
);
|
||||
|
||||
CREATE TABLE "path_aliases"(
|
||||
"pid" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL CHECK("pid">=0),
|
||||
"source" VARCHAR(255) NOT NULL,
|
||||
"alias" VARCHAR(255) NOT NULL,
|
||||
"lang" VARCHAR(12)
|
||||
CREATE TABLE `path_aliases`(
|
||||
`pid` INTEGER PRIMARY KEY AUTO_INCREMENT NOT NULL,
|
||||
`source` VARCHAR(255) NOT NULL,
|
||||
`alias` VARCHAR(255) NOT NULL,
|
||||
`lang` VARCHAR(12)
|
||||
);
|
||||
|
||||
COMMIT;
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
BEGIN;
|
||||
|
||||
CREATE TABLE "nodes"(
|
||||
"nid" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL CHECK("nid">=0),
|
||||
"revision" INTEGER,
|
||||
"type" TEXT NOT NULL,
|
||||
"title" VARCHAR(255) NOT NULL,
|
||||
"summary" TEXT,
|
||||
"content" MEDIUMTEXT NOT NULL,
|
||||
"format" VARCHAR(255),
|
||||
"author" INTEGER,
|
||||
"publish" DATETIME,
|
||||
"created" DATETIME NOT NULL,
|
||||
"changed" DATETIME NOT NULL,
|
||||
"status" INTEGER
|
||||
);
|
||||
|
||||
CREATE TABLE page_nodes(
|
||||
"nid" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL CHECK("nid">=0),
|
||||
"revision" INTEGER,
|
||||
"parent" INTEGER
|
||||
);
|
||||
|
||||
COMMIT;
|
||||
@@ -1,34 +1,48 @@
|
||||
BEGIN;
|
||||
|
||||
CREATE TABLE "users"(
|
||||
"uid" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL CHECK("uid">=0),
|
||||
"name" VARCHAR(100) NOT NULL,
|
||||
"password" VARCHAR(100) NOT NULL,
|
||||
"salt" VARCHAR(100) NOT NULL,
|
||||
"email" VARCHAR(250) NOT NULL,
|
||||
"status" INTEGER,
|
||||
"created" DATETIME NOT NULL,
|
||||
"signed" DATETIME,
|
||||
CONSTRAINT "name"
|
||||
UNIQUE("name")
|
||||
CREATE TABLE `users`(
|
||||
`uid` INTEGER PRIMARY KEY AUTO_INCREMENT NOT NULL,
|
||||
`name` VARCHAR(100) NOT NULL,
|
||||
`password` VARCHAR(100) NOT NULL,
|
||||
`salt` VARCHAR(100) NOT NULL,
|
||||
`email` VARCHAR(250) NOT NULL,
|
||||
`status` INTEGER,
|
||||
`created` DATETIME NOT NULL,
|
||||
`signed` DATETIME,
|
||||
CONSTRAINT `name`
|
||||
UNIQUE(`name`)
|
||||
);
|
||||
|
||||
CREATE TABLE "roles"(
|
||||
"rid" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL CHECK("rid">=0),
|
||||
"name" VARCHAR(100) NOT NULL,
|
||||
CONSTRAINT "name"
|
||||
UNIQUE("name")
|
||||
CREATE TABLE `roles`(
|
||||
`rid` INTEGER PRIMARY KEY AUTO_INCREMENT NOT NULL,
|
||||
`name` VARCHAR(100) NOT NULL,
|
||||
CONSTRAINT `name`
|
||||
UNIQUE(`name`)
|
||||
);
|
||||
|
||||
CREATE TABLE "users_roles"(
|
||||
"uid" INTEGER NOT NULL CHECK("uid">=0),
|
||||
"rid" INTEGER NOT NULL CHECK("rid">=0)
|
||||
CREATE TABLE `users_roles`(
|
||||
`uid` INTEGER NOT NULL CHECK(`uid`>=0),
|
||||
`rid` INTEGER NOT NULL CHECK(`rid`>=0)
|
||||
);
|
||||
|
||||
CREATE TABLE "role_permissions"(
|
||||
"rid" INTEGER NOT NULL CHECK("rid">=0),
|
||||
"permission" VARCHAR(255) NOT NULL,
|
||||
"module" VARCHAR(255)
|
||||
CREATE TABLE `role_permissions`(
|
||||
`rid` INTEGER NOT NULL,
|
||||
`permission` VARCHAR(255) NOT NULL,
|
||||
`module` VARCHAR(255)
|
||||
);
|
||||
|
||||
CREATE TABLE `users_activations` (
|
||||
`aid` INTEGER PRIMARY KEY AUTO_INCREMENT NOT NULL CHECK (`aid` >= 0),
|
||||
`token` VARCHAR(255) NOT NULL,
|
||||
`uid` INTEGER NOT NULL CHECK (`uid` >= 0),
|
||||
`created` DATETIME NOT NULL,
|
||||
CONSTRAINT `token` UNIQUE (`token`)
|
||||
);
|
||||
|
||||
CREATE TABLE `users_password_recovery` (
|
||||
`aid` INTEGER PRIMARY KEY AUTO_INCREMENT NOT NULL CHECK (`aid` >= 0),
|
||||
`token` VARCHAR(255) NOT NULL,
|
||||
`uid` INTEGER NOT NULL CHECK (`uid` >= 0),
|
||||
`created` DATETIME NOT NULL,
|
||||
CONSTRAINT `token` UNIQUE (`token`)
|
||||
);
|
||||
|
||||
COMMIT;
|
||||
|
||||
@@ -51,16 +51,24 @@ ul.horizontal li {
|
||||
.sidebar {
|
||||
padding: 5px;
|
||||
margin: 3px;
|
||||
border: solid 1px #ccc;
|
||||
/* border: solid 1px #ccc; */
|
||||
}
|
||||
.sidebar#sidebar_first {
|
||||
width: 250px;
|
||||
float: left;
|
||||
position: fixed;
|
||||
top: 45px;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
width: 200px;
|
||||
border-right: solid 1px #ddd;
|
||||
}
|
||||
.sidebar#sidebar_second {
|
||||
width: 250px;
|
||||
float: right;
|
||||
}
|
||||
.sidebar + .main {
|
||||
margin-left: 200px;
|
||||
}
|
||||
|
||||
#primary-tabs ul.horizontal {
|
||||
list-style-type: none;
|
||||
@@ -76,3 +84,9 @@ ul.horizontal li {
|
||||
border-width: 2px 1px 0;
|
||||
padding: 2px 7px 1px;
|
||||
}
|
||||
|
||||
#message li.error {
|
||||
background-color: #f99;
|
||||
border: solid 1px red;
|
||||
padding: 5px 2px 5px 2px;
|
||||
}
|
||||
|
||||
BIN
examples/demo/site/themes/bootstrap/assets/favicon.ico
Normal file
BIN
examples/demo/site/themes/bootstrap/assets/favicon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 994 B |
File diff suppressed because one or more lines are too long
@@ -55,15 +55,24 @@ ul.horizontal {
|
||||
.sidebar {
|
||||
padding: 5px;
|
||||
margin: 3px;
|
||||
border: solid 1px #ccc;
|
||||
/* border: solid 1px #ccc; */
|
||||
&#sidebar_first {
|
||||
width: 250px;
|
||||
float: left;
|
||||
position: fixed;
|
||||
top: 45px;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
width: 200px;
|
||||
border-right: solid 1px #ddd;
|
||||
}
|
||||
&#sidebar_second {
|
||||
width: 250px;
|
||||
float: right;
|
||||
}
|
||||
|
||||
&+.main {
|
||||
margin-left: 200px;
|
||||
}
|
||||
}
|
||||
#primary-tabs {
|
||||
ul.horizontal {
|
||||
@@ -81,3 +90,8 @@ ul.horizontal {
|
||||
}
|
||||
}
|
||||
}
|
||||
#message li.error {
|
||||
background-color: #f99;
|
||||
border: solid 1px red;
|
||||
padding: 5px 2px 5px 2px;
|
||||
}
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
<div class='navbar navbar-inverse'>
|
||||
<div class='navbar-inner nav-collapse' style="height: auto;">
|
||||
<ul class="nav">
|
||||
{$header_block/}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
@@ -4,14 +4,15 @@
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<!-- EWF CMS -->
|
||||
<link rel="stylesheet" href="{$site_url/}/theme/css/style.css">
|
||||
<link rel="stylesheet" href="{$site_url/}/theme/css/node.css">
|
||||
<link rel="stylesheet" href="{$site_url/}theme/css/style.css">
|
||||
|
||||
<!-- CMS Blog Module -->
|
||||
<link rel="stylesheet" href="{$site_url/}/theme/css/blog.css">
|
||||
<!-- jQuery dep -->
|
||||
<script src="{$site_url/}theme/js/jquery-1.10.2.min.js"></script>
|
||||
|
||||
<script src="{$site_url/}/theme/js/jquery-1.10.2.min.js"></script>
|
||||
<script src="{$site_url/}/theme/js/roc_auth.js"></script>
|
||||
{if isset="$head"}{$head/}{/if}
|
||||
{if isset="$styles"}{$styles/}{/if}
|
||||
{if isset="$scripts"}{$scripts/}{/if}
|
||||
{if isset="$head_lines"}{$head_lines/}{/if}
|
||||
|
||||
<!-- bootstrap framework -->
|
||||
<!-- Latest compiled and minified CSS -->
|
||||
@@ -48,7 +49,7 @@
|
||||
{/unless}
|
||||
|
||||
<!-- Highlighted, Help, Content -->
|
||||
<div class='span8 main'>
|
||||
<div id='main' class='span8 main'>
|
||||
<!-- Highlighted Section -->
|
||||
{unless isempty="$page.region_highlighted"}
|
||||
<div id="highlighted">{$page.region_highlighted/}</div>
|
||||
@@ -61,9 +62,15 @@
|
||||
<!-- Main Content Section -->
|
||||
{unless isempty="$page_title"}<h1 class="page-title">{$page_title/}</h1>{/unless}
|
||||
{$page.region_content/}
|
||||
</div>
|
||||
|
||||
|
||||
{if condition="$page.is_front"}
|
||||
{if isset="$page.region_feed_eiffel"}
|
||||
<div class="column" style="width: 45%; float: left">{$page.region_feed_eiffel/}</div>
|
||||
{/if}
|
||||
{if isset="$page.region_feed_forum"}
|
||||
<div class="column" style="width: 45%; float: left">{$page.region_feed_forum/}</div>
|
||||
{/if}
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ regions[content] = Content
|
||||
regions[highlighted] = Highlighted
|
||||
regions[help] = Help
|
||||
regions[footer] = Footer
|
||||
regions[first_sidebar] = first sidebar
|
||||
regions[second_sidebar] = second sidebar
|
||||
regions[sidebar_first] = first sidebar
|
||||
regions[sidebar_second] = second sidebar
|
||||
regions[page_bottom] = Bottom
|
||||
navigation=default_nav
|
||||
navigation=default_nav
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
<h2>Help Section</h2>
|
||||
@@ -1 +0,0 @@
|
||||
<h1>Highlighted Section</h1>
|
||||
@@ -1,8 +0,0 @@
|
||||
<div class='span2 sidebar'>
|
||||
<h3>Left Sidebar</h3>
|
||||
<ul class="nav nav-tabs nav-stacked">
|
||||
<li><a href='#'>Another Link 1</a></li>
|
||||
<li><a href='#'>Another Link 2</a></li>
|
||||
<li><a href='#'>Another Link 3</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
@@ -1,4 +0,0 @@
|
||||
<h2>Main Content Section</h2>
|
||||
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum.<p>
|
||||
|
||||
<p>Typi non habent claritatem insitam; est usus legentis in iis qui facit eorum claritatem. Investigationes demonstraverunt lectores legere me lius quod ii legunt saepius. Claritas est etiam processus dynamicus, qui sequitur mutationem consuetudium lectorum. Mirum est notare quam littera gothica, quam nunc putamus parum claram, anteposuerit litterarum formas humanitatis per seacula quarta decima et quinta decima. Eodem modo typi, qui nunc nobis videntur parum clari, fiant sollemnes in futurum.</p>
|
||||
@@ -1,9 +0,0 @@
|
||||
<div id="footer">
|
||||
<small>
|
||||
<center>
|
||||
<p class="text-muted"><a href="#" target="_blank" class="info">ROC Documentation </a>
|
||||
<a href="http://www.eiffel.com/company/contact/" target="_blank" class="info">Questions? Comments? Let us know! </a></p>
|
||||
<p>© Copyright 2014 Eiffel Software -- <a href="#" target="_blank" class="info">Privacy Policy</a>
|
||||
</center>
|
||||
</small>
|
||||
</div>
|
||||
@@ -1,34 +0,0 @@
|
||||
<div class="navbar navbar-default" role="navigation">
|
||||
<div class="container-fluid">
|
||||
<div class="navbar-header">
|
||||
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
</button>
|
||||
<a class="navbar-brand" href="{$site_url/}" itemprop="home" rel="home">{unless isset="$site_name"}Eiffel CMS{/unless}{if isset="$site_name"}{$site_name/}{/if}</a>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="navbar-collapse collapse">
|
||||
|
||||
{if isset="$primary_nav"}
|
||||
<ul class="nav navbar-nav navbar-left">
|
||||
{foreach item="item" from="$primary_nav.items"}
|
||||
<!-- TODO check if a menu item is active or not -->
|
||||
<li class="active"><a href="{$item.location/}">{$item.title/}</a></li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
{/if}
|
||||
|
||||
{if isset="$secondary_nav"}
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
{foreach item="item" from="$secondary_nav.items"}
|
||||
<!-- TODO check if a menu item is active or not -->
|
||||
<li class="active"><a href="{$item.location/}">{$item.title/}</a></li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
{if isset="$default_nav"}
|
||||
<div class="navbar navbar-default" role="navigation">
|
||||
<div class="container-fluid">
|
||||
<div class="navbar-header">
|
||||
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
</button>
|
||||
<a class="navbar-brand" href="${site_url/}" itemprop="home" rel="home">{$page_title/}</a>
|
||||
</div>
|
||||
|
||||
<div class="navbar-collapse collapse">
|
||||
{/if}
|
||||
|
||||
{if isset="$primary_nav"}
|
||||
{$primary_nav/}
|
||||
{/if}
|
||||
|
||||
{if isset="$secondary_nav"}
|
||||
{$secondary_nav/}
|
||||
{/if}
|
||||
|
||||
{if isset="$default_nav"}
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
@@ -1,6 +0,0 @@
|
||||
<ul class="nav navbar-nav navbar-left">
|
||||
{foreach item="item" from="$menu.items"}
|
||||
<!-- TODO check if a menu item is active or not -->
|
||||
<li class="active"><a href="{$item.location/}">{$item.title/}</a></li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
@@ -1,8 +0,0 @@
|
||||
<div class='span2 sidebar'>
|
||||
<h3>Right Sidebar</h3>
|
||||
<ul class="nav nav-tabs nav-stacked">
|
||||
<li><a href='#'>Another Link 1</a></li>
|
||||
<li><a href='#'>Another Link 2</a></li>
|
||||
<li><a href='#'>Another Link 3</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
@@ -1,7 +0,0 @@
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
{foreach item="item" from="$menu.items"}
|
||||
<!-- TODO check if a menu item is active or not -->
|
||||
<li class="active"><a href="{$item.location/}">{$item.title/}</a></li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
|
||||
5849
examples/demo/site/www/static/css/bootstrap.css
vendored
5849
examples/demo/site/www/static/css/bootstrap.css
vendored
File diff suppressed because it is too large
Load Diff
@@ -1,357 +0,0 @@
|
||||
/*
|
||||
* Base structure
|
||||
*/
|
||||
|
||||
/* Move down content because we have a fixed navbar that is 36px tall on small screen */
|
||||
body {
|
||||
padding-top: 40px;
|
||||
}
|
||||
/* On large screen, we give it more space and the navbar is 30px tall. */
|
||||
@media (min-width: 768px) {
|
||||
body {
|
||||
padding-top: 45px;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Global add-ons
|
||||
*/
|
||||
|
||||
h1 {
|
||||
margin-top: initial;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
h2.sub-header{
|
||||
margin-top: 1px;
|
||||
margin-bottom: 1px;
|
||||
border-bottom: 1px solid #eee;
|
||||
}
|
||||
|
||||
|
||||
.container .jumbotron {
|
||||
padding: 10px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Sidebar
|
||||
*/
|
||||
|
||||
/* Hide for mobile, show later */
|
||||
.sidebar {
|
||||
display: none;
|
||||
}
|
||||
@media (min-width: 768px) {
|
||||
.sidebar {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
z-index: 1000;
|
||||
display: block;
|
||||
padding: 70px 20px 20px;
|
||||
background-color: #f5f5f5;
|
||||
border-right: 1px solid #eee;
|
||||
}
|
||||
}
|
||||
|
||||
/* Sidebar navigation */
|
||||
.nav-sidebar {
|
||||
margin-left: -20px;
|
||||
margin-right: -21px; /* 20px padding + 1px border */
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
.nav-sidebar > li > a {
|
||||
padding-left: 20px;
|
||||
padding-right: 20px;
|
||||
}
|
||||
.nav-sidebar > .active > a {
|
||||
color: #fff;
|
||||
background-color: #428bca;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Main content
|
||||
*/
|
||||
|
||||
.main {
|
||||
padding: 3px;
|
||||
}
|
||||
@media (min-width: 768px) {
|
||||
.main {
|
||||
padding-left: 15px;
|
||||
padding-right: 15px;
|
||||
}
|
||||
}
|
||||
.main .page-header {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Placeholder dashboard ideas
|
||||
*/
|
||||
|
||||
.placeholders {
|
||||
margin-bottom: 30px;
|
||||
text-align: center;
|
||||
}
|
||||
.placeholders h4 {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
.placeholder {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
.placeholder img {
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.navbar-default {
|
||||
background-color:#194573;
|
||||
border-color: #400040;
|
||||
}
|
||||
.navbar-default .navbar-brand {
|
||||
color: #ffffff;
|
||||
}
|
||||
.navbar-default .navbar-brand:hover, .navbar-default .navbar-brand:focus {
|
||||
color: #ffffff;
|
||||
}
|
||||
.navbar-default .navbar-text {
|
||||
color: #ffffff;
|
||||
}
|
||||
.navbar-default .navbar-nav > li > a {
|
||||
color: #ffffff;
|
||||
}
|
||||
.navbar-default .navbar-nav > li > a:hover, .navbar-default .navbar-nav > li > a:focus {
|
||||
color: #ffffff;
|
||||
}
|
||||
.navbar-default .navbar-nav > .active > a, .navbar-default .navbar-nav > .active > a:hover, .navbar-default .navbar-nav > .active > a:focus {
|
||||
color: #ffffff;
|
||||
background-color: #400040;
|
||||
}
|
||||
.navbar-default .navbar-nav > .open > a, .navbar-default .navbar-nav > .open > a:hover, .navbar-default .navbar-nav > .open > a:focus {
|
||||
color: #ffffff;
|
||||
background-color: #400040;
|
||||
}
|
||||
.navbar-default .navbar-toggle {
|
||||
border-color: #400040;
|
||||
}
|
||||
.navbar-default .navbar-toggle:hover, .navbar-default .navbar-toggle:focus {
|
||||
background-color: #400040;
|
||||
}
|
||||
.navbar-default .navbar-toggle .icon-bar {
|
||||
background-color: #ffffff;
|
||||
}
|
||||
.navbar-default .navbar-collapse,
|
||||
.navbar-default .navbar-form {
|
||||
border-color: #ffffff;
|
||||
}
|
||||
.navbar-default .navbar-link {
|
||||
color: #ffffff;
|
||||
}
|
||||
.navbar-default .navbar-link:hover {
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
@media (max-width: 767px) {
|
||||
.navbar-default .navbar-nav .open .dropdown-menu > li > a {
|
||||
color: #ffffff;
|
||||
}
|
||||
.navbar-default .navbar-nav .open .dropdown-menu > li > a:hover, .navbar-default .navbar-nav .open .dropdown-menu > li > a:focus {
|
||||
color: #ffffff;
|
||||
}
|
||||
.navbar-default .navbar-nav .open .dropdown-menu > .active > a, .navbar-default .navbar-nav .open .dropdown-menu > .active > a:hover, .navbar-default .navbar-nav .open .dropdown-menu > .active > a:focus {
|
||||
color: #ffffff;
|
||||
background-color: #400040;
|
||||
}
|
||||
}
|
||||
|
||||
.navbar-nav > li > a {padding-top:5px !important; padding-bottom:5px !important;}
|
||||
.navbar {min-height:30px !important}
|
||||
|
||||
.navbar-brand {
|
||||
float: left;
|
||||
padding: 15px;
|
||||
padding-top: 5px;
|
||||
padding-right: 15px;
|
||||
padding-bottom: 5px;
|
||||
padding-left: 15px;
|
||||
font-size: 18px;
|
||||
line-height: 18px;
|
||||
height: 30px;
|
||||
}
|
||||
|
||||
|
||||
/* Tooltips */
|
||||
.blue-tooltip + .tooltip > .tooltip-inner {background-color: #FF;}
|
||||
.blue-tooltip + .tooltip > .tooltip-arrow { border-bottom-color:#FF; }
|
||||
|
||||
|
||||
.tooltip.top .tooltip-arrow {
|
||||
bottom: 0;
|
||||
left: 50%;
|
||||
margin-left: -5px;
|
||||
border-top-color: #000000;
|
||||
border-width: 5px 5px 0;
|
||||
}
|
||||
.tooltip-inner {
|
||||
text-align: left;
|
||||
color: #000;
|
||||
background: #fff;
|
||||
border: solid 1px #000000;
|
||||
max-width: 450px
|
||||
}
|
||||
|
||||
.tooltip.bottom .tooltip-arrow {
|
||||
top: 0;
|
||||
left: 50%;
|
||||
margin-left: -5px;
|
||||
border-bottom-color: #000000;
|
||||
border-width: 0 5px 5px;
|
||||
}
|
||||
|
||||
/* pre */
|
||||
pre {
|
||||
word-wrap: code;
|
||||
white-space: pre-wrap;
|
||||
background-color:white;
|
||||
}
|
||||
|
||||
|
||||
/* Container -Fluid */
|
||||
.container-fluid {
|
||||
padding: 0 2px;
|
||||
}
|
||||
@media (min-width: 768px) {
|
||||
.container-fluid {
|
||||
padding: 0 5px;
|
||||
}
|
||||
}
|
||||
|
||||
.container-fluid .row {
|
||||
margin: 0px;
|
||||
}
|
||||
|
||||
.row-padding {
|
||||
margin-top: 25px;
|
||||
margin-bottom: 25px;
|
||||
}
|
||||
|
||||
/* Width for the text field to enter a bug report number in the reports page.
|
||||
* We put a maximum width to override the width value coming from `form-control'. */
|
||||
.form-bug-number-entry {
|
||||
max-width: 100px;
|
||||
}
|
||||
|
||||
/* Default width for the entries in a table like layout. */
|
||||
.form-inline .form-control {
|
||||
width: 95%;
|
||||
}
|
||||
|
||||
.form-inline .checkbox {
|
||||
font-weight: initial;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
/* Note that there is also a class called label. */
|
||||
label {
|
||||
padding-right: 5px;
|
||||
}
|
||||
|
||||
.label {
|
||||
padding: 0px;
|
||||
padding-right: 5px;
|
||||
}
|
||||
|
||||
.label-primary-api-default {
|
||||
display: inline-block;
|
||||
width: 105px;
|
||||
text-align: left;
|
||||
background: #fff;
|
||||
color: #000;
|
||||
font-size: 100%;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
|
||||
.label-primary-api-interactions {
|
||||
display: inline-block;
|
||||
padding-right: 5px;
|
||||
text-align: left;
|
||||
color: #000;
|
||||
font-size: 100%;
|
||||
}
|
||||
|
||||
|
||||
pre {
|
||||
padding: 1.5px;
|
||||
display: block;
|
||||
margin: 0 0 10px;
|
||||
font-size: 12px;
|
||||
font-family: monospace;
|
||||
line-height: 1.428571429;
|
||||
word-break: break-word;
|
||||
word-wrap: break-word;
|
||||
color: #333;
|
||||
border: 0px;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
|
||||
/* No padding, so that nested columns are always properly aligned. */
|
||||
.col-xs-1,.col-sm-1,.col-md-1,.col-lg-1,.col-xs-2,.col-sm-2,.col-md-2,.col-lg-2,.col-xs-3,.col-sm-3,.col-md-3,.col-lg-3,.col-xs-4,.col-sm-4,.col-md-4,.col-lg-4,.col-xs-5,.col-sm-5,.col-md-5,.col-lg-5,.col-xs-6,.col-sm-6,.col-md-6,.col-lg-6,.col-xs-7,.col-sm-7,.col-md-7,.col-lg-7,.col-xs-8,.col-sm-8,.col-md-8,.col-lg-8,.col-xs-9,.col-sm-9,.col-md-9,.col-lg-9,.col-xs-10,.col-sm-10,.col-md-10,.col-lg-10,.col-xs-11,.col-sm-11,.col-md-11,.col-lg-11,.col-xs-12,.col-sm-12,.col-md-12,.col-lg-12 {
|
||||
padding-left: 0px;
|
||||
padding-right: 0px;
|
||||
}
|
||||
|
||||
.table>thead>tr>th,.table>tbody>tr>th,.table>tfoot>tr>th,.table>thead>tr>td,.table>tbody>tr>td,.table>tfoot>tr>td {
|
||||
padding:2px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.form-control{
|
||||
height:inherit;
|
||||
padding: 1px 2px;
|
||||
margin: 1px;
|
||||
}
|
||||
|
||||
.btn {
|
||||
padding: 1px 12px;
|
||||
margin: 1px;
|
||||
min-width: 100px;
|
||||
}
|
||||
|
||||
.dropdown-toggle, .login {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.pager {
|
||||
margin:10px 0;
|
||||
}
|
||||
|
||||
.pager li>a,.pager li>span {
|
||||
padding:1px 12px;
|
||||
border-radius:8px;
|
||||
}
|
||||
|
||||
.well {
|
||||
padding: 9px;
|
||||
margin-bottom: 10px;
|
||||
min-height: 44px;
|
||||
}
|
||||
|
||||
.panel-heading {
|
||||
background-color: #ddeaf2 !important;
|
||||
}
|
||||
|
||||
.private-panel-border {
|
||||
border: solid 1px #DBA458 !important;
|
||||
}
|
||||
|
||||
.private-panel {
|
||||
background-color: #f2eadd !important;
|
||||
}
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.4 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 16 KiB |
@@ -1,108 +0,0 @@
|
||||
/*
|
||||
* EWF CMS javascript based on JQuery
|
||||
*/
|
||||
|
||||
/**
|
||||
* Override jQuery.fn.init to guard against XSS attacks.
|
||||
*
|
||||
* See http://bugs.jquery.com/ticket/9521
|
||||
*/
|
||||
|
||||
(function () {
|
||||
var jquery_init = jQuery.fn.init;
|
||||
jQuery.fn.init = function (selector, context, rootjQuery) {
|
||||
// If the string contains a "#" before a "<", treat it as invalid HTML.
|
||||
if (selector && typeof selector === 'string') {
|
||||
var hash_position = selector.indexOf('#');
|
||||
if (hash_position >= 0) {
|
||||
var bracket_position = selector.indexOf('<');
|
||||
if (bracket_position > hash_position) {
|
||||
throw 'Syntax error, unrecognized expression: ' + selector;
|
||||
}
|
||||
}
|
||||
}
|
||||
return jquery_init.call(this, selector, context, rootjQuery);
|
||||
};
|
||||
jQuery.fn.init.prototype = jquery_init.prototype;
|
||||
})();
|
||||
|
||||
|
||||
var ROC = ROC || { };
|
||||
|
||||
$('body').on('click',"a[rel='node']",function(e){
|
||||
|
||||
e.preventDefault();
|
||||
/*
|
||||
if uncomment the above line, html5 nonsupported browers won't change the url but will display the ajax content;
|
||||
if commented, html5 nonsupported browers will reload the page to the specified link.
|
||||
*/
|
||||
|
||||
//get the link location that was clicked
|
||||
pageurl = $(this).attr('href');
|
||||
|
||||
spinner = "<span class='loading'><h3>Loading content..</h3><img src='/static/images/ajax-loader.gif' alt='loading...' class='spinner'></span>";
|
||||
//to get the ajax content and display in div with class 'main'
|
||||
$.ajax({url:pageurl+'?rel=node',success: function(data){
|
||||
$('.main').html(data);
|
||||
}});
|
||||
|
||||
//to change the browser URL to the given link location
|
||||
//if(pageurl!=window.location){
|
||||
//window.history.pushState({path:pageurl},'',pageurl);
|
||||
//}
|
||||
//stop refreshing to the page given in
|
||||
return false;
|
||||
});
|
||||
|
||||
$('body').on('click',"a[rel='register']",function(e){
|
||||
|
||||
e.preventDefault();
|
||||
/*
|
||||
if uncomment the above line, html5 nonsupported browers won't change the url but will display the ajax content;
|
||||
if commented, html5 nonsupported browers will reload the page to the specified link.
|
||||
*/
|
||||
|
||||
//get the link location that was clicked
|
||||
pageurl = $(this).attr('href');
|
||||
|
||||
spinner = "<span class='loading'><h3>Loading content..</h3><img src='/static/images/ajax-loader.gif' alt='loading...' class='spinner'></span>";
|
||||
//to get the ajax content and display in div with class 'main'
|
||||
$.ajax({url:pageurl+'?rel=node',success: function(data){
|
||||
$('.main').html(data);
|
||||
}});
|
||||
|
||||
//to change the browser URL to the given link location
|
||||
//if(pageurl!=window.location){
|
||||
//window.history.pushState({path:pageurl},'',pageurl);
|
||||
//}
|
||||
//stop refreshing to the page given in
|
||||
return false;
|
||||
});
|
||||
|
||||
|
||||
|
||||
$("a[rel='node']").click(function(e){
|
||||
e.preventDefault();
|
||||
/*
|
||||
if uncomment the above line, html5 nonsupported browers won't change the url but will display the ajax content;
|
||||
if commented, html5 nonsupported browers will reload the page to the specified link.
|
||||
*/
|
||||
|
||||
//get the link location that was clicked
|
||||
pageurl = $(this).attr('href');
|
||||
|
||||
spinner = "<span class='loading'><h3>Loading content..</h3><img src='/static/images/ajax-loader.gif' alt='loading...' class='spinner'></span>";
|
||||
//to get the ajax content and display in div with class 'main'
|
||||
$.ajax({url:pageurl+'?rel=node',success: function(data){
|
||||
$('.main').html(data);
|
||||
}});
|
||||
|
||||
//to change the browser URL to the given link location
|
||||
//if(pageurl!=window.location){
|
||||
//window.history.pushState({path:pageurl},'',pageurl);
|
||||
//}
|
||||
//stop refreshing to the page given in
|
||||
return false;
|
||||
});
|
||||
|
||||
|
||||
@@ -16,11 +16,6 @@ inherit
|
||||
initialize
|
||||
end
|
||||
|
||||
WSF_SERVICE
|
||||
redefine
|
||||
execute
|
||||
end
|
||||
|
||||
REFACTORING_HELPER
|
||||
|
||||
SHARED_EXECUTION_ENVIRONMENT
|
||||
@@ -40,37 +35,26 @@ feature {NONE} -- Initialization
|
||||
|
||||
initialize
|
||||
-- Initialize current service.
|
||||
local
|
||||
env: CMS_ENVIRONMENT
|
||||
do
|
||||
-- Launcher
|
||||
Precursor
|
||||
create {WSF_SERVICE_LAUNCHER_OPTIONS_FROM_INI} service_options.make_from_file ("demo.ini")
|
||||
|
||||
-- CMS
|
||||
initialize_cms
|
||||
end
|
||||
|
||||
feature -- Service
|
||||
|
||||
cms_service: CMS_SERVICE
|
||||
-- cms service.
|
||||
|
||||
execute (req: WSF_REQUEST; res: WSF_RESPONSE)
|
||||
do
|
||||
cms_service.execute (req, res)
|
||||
create env.make_default
|
||||
initialize_logger (env)
|
||||
end
|
||||
|
||||
feature {NONE} -- Launch operation
|
||||
|
||||
launcher: APPLICATION_LAUNCHER
|
||||
launcher: APPLICATION_LAUNCHER [EWF_ROC_SERVER_EXECUTION]
|
||||
|
||||
launch (a_service: WSF_SERVICE; opts: detachable WSF_SERVICE_LAUNCHER_OPTIONS)
|
||||
launch (opts: detachable WSF_SERVICE_LAUNCHER_OPTIONS)
|
||||
local
|
||||
l_retry: BOOLEAN
|
||||
l_message: STRING
|
||||
do
|
||||
if not l_retry then
|
||||
write_debug_log (generator + ".launch")
|
||||
launcher.launch (a_service, opts)
|
||||
launcher.launch (opts)
|
||||
else
|
||||
-- error hanling.
|
||||
create l_message.make (1024)
|
||||
@@ -89,77 +73,12 @@ feature {NONE} -- Launch operation
|
||||
l_message.append ("The application crash without available information")
|
||||
l_message.append ("%N%N")
|
||||
end
|
||||
-- notify shutdown
|
||||
write_debug_log (generator + ".launch shutdown")
|
||||
-- send email shutdown
|
||||
end
|
||||
rescue
|
||||
l_retry := True
|
||||
retry
|
||||
end
|
||||
|
||||
feature -- CMS Initialization
|
||||
|
||||
initialize_cms
|
||||
local
|
||||
l_setup: CMS_DEFAULT_SETUP
|
||||
utf: UTF_CONVERTER
|
||||
cms_env: CMS_ENVIRONMENT
|
||||
do
|
||||
-- Application Environment initialization
|
||||
if attached execution_environment.arguments.separate_character_option_value ('d') as l_dir then
|
||||
create cms_env.make_with_directory_name (l_dir)
|
||||
else
|
||||
create cms_env.make_default
|
||||
end
|
||||
initialize_logger (cms_env)
|
||||
|
||||
-- CMS Setup
|
||||
write_debug_log (generator + ".initialize_cms / SETUP based directory=%"" + utf.escaped_utf_32_string_to_utf_8_string_8 (cms_env.path.name) + "%"")
|
||||
create l_setup.make (cms_env)
|
||||
|
||||
-- CMS
|
||||
write_debug_log (generator + ".initialize_cms / CMS")
|
||||
setup_storage (l_setup)
|
||||
setup_modules (l_setup)
|
||||
create cms_service.make (l_setup)
|
||||
end
|
||||
|
||||
feature -- CMS setup
|
||||
|
||||
setup_modules (a_setup: CMS_SETUP)
|
||||
-- Setup additional modules.
|
||||
local
|
||||
m: CMS_MODULE
|
||||
do
|
||||
create {NODE_MODULE} m.make (a_setup)
|
||||
m.enable
|
||||
a_setup.register_module (m)
|
||||
|
||||
create {BASIC_AUTH_MODULE} m.make
|
||||
if not a_setup.module_with_same_type_registered (m) then
|
||||
m.enable
|
||||
a_setup.register_module (m)
|
||||
end
|
||||
|
||||
create {CMS_DEBUG_MODULE} m.make
|
||||
m.enable
|
||||
a_setup.register_module (m)
|
||||
|
||||
create {CMS_DEMO_MODULE} m.make
|
||||
m.enable
|
||||
a_setup.register_module (m)
|
||||
|
||||
create {CMS_BLOG_MODULE} m.make
|
||||
m.enable
|
||||
a_setup.register_module (m)
|
||||
end
|
||||
|
||||
setup_storage (a_setup: CMS_SETUP)
|
||||
-- Setup storage by declaring storage builder.
|
||||
do
|
||||
-- a_setup.storage_drivers.force (create {CMS_STORAGE_MYSQL_BUILDER}.make, "mysql")
|
||||
a_setup.storage_drivers.force (create {CMS_STORAGE_SQLITE_BUILDER}.make, "sqlite")
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
97
examples/demo/src/ewf_roc_server_execution.e
Normal file
97
examples/demo/src/ewf_roc_server_execution.e
Normal file
@@ -0,0 +1,97 @@
|
||||
note
|
||||
description: "Summary description for {EWF_ROC_SERVER_EXECUTION}."
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
class
|
||||
EWF_ROC_SERVER_EXECUTION
|
||||
|
||||
inherit
|
||||
CMS_EXECUTION
|
||||
redefine
|
||||
initialize
|
||||
end
|
||||
|
||||
REFACTORING_HELPER
|
||||
|
||||
SHARED_LOGGER
|
||||
|
||||
create
|
||||
make
|
||||
|
||||
feature {NONE} -- Initialization
|
||||
|
||||
initialize
|
||||
do
|
||||
Precursor
|
||||
end
|
||||
|
||||
initial_cms_setup: CMS_DEFAULT_SETUP
|
||||
-- CMS setup.
|
||||
local
|
||||
l_env: CMS_ENVIRONMENT
|
||||
do
|
||||
if attached execution_environment.arguments.separate_character_option_value ('d') as l_dir then
|
||||
create l_env.make_with_directory_name (l_dir)
|
||||
else
|
||||
create l_env.make_default
|
||||
end
|
||||
create Result.make (l_env)
|
||||
end
|
||||
|
||||
feature -- CMS setup
|
||||
|
||||
setup_storage (a_setup: CMS_SETUP)
|
||||
do
|
||||
debug ("refactor_fixme")
|
||||
to_implement ("To implement custom storage")
|
||||
end
|
||||
-- a_setup.storage_drivers.force (create {CMS_STORAGE_STORE_MYSQL_BUILDER}.make, "mysql")
|
||||
a_setup.storage_drivers.force (create {CMS_STORAGE_STORE_ODBC_BUILDER}.make, "odbc")
|
||||
end
|
||||
|
||||
setup_modules (a_setup: CMS_SETUP)
|
||||
-- Setup additional modules.
|
||||
local
|
||||
m: CMS_MODULE
|
||||
do
|
||||
create {CMS_ADMIN_MODULE} m.make
|
||||
a_setup.register_module (m)
|
||||
|
||||
-- Auth
|
||||
create {CMS_AUTHENTICATION_MODULE} m.make
|
||||
a_setup.register_module (m)
|
||||
|
||||
create {CMS_BASIC_AUTH_MODULE} m.make
|
||||
a_setup.register_module (m)
|
||||
|
||||
create {CMS_OAUTH_20_MODULE} m.make
|
||||
a_setup.register_module (m)
|
||||
|
||||
create {CMS_OPENID_MODULE} m.make
|
||||
a_setup.register_module (m)
|
||||
|
||||
-- Nodes
|
||||
create {CMS_NODE_MODULE} m.make (a_setup)
|
||||
a_setup.register_module (m)
|
||||
|
||||
create {CMS_BLOG_MODULE} m.make
|
||||
a_setup.register_module (m)
|
||||
|
||||
-- Recent changes
|
||||
create {CMS_RECENT_CHANGES_MODULE} m.make
|
||||
a_setup.register_module (m)
|
||||
|
||||
-- Recent changes
|
||||
create {FEED_AGGREGATOR_MODULE} m.make
|
||||
a_setup.register_module (m)
|
||||
|
||||
-- Miscellanious
|
||||
create {CMS_DEBUG_MODULE} m.make
|
||||
a_setup.register_module (m)
|
||||
|
||||
create {CMS_DEMO_MODULE} m.make
|
||||
a_setup.register_module (m)
|
||||
end
|
||||
|
||||
end
|
||||
@@ -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
|
||||
|
||||
@@ -30,6 +30,7 @@ feature -- Initialization
|
||||
backup_count := 4
|
||||
level := Log_debug
|
||||
location := Void
|
||||
type := {STRING_32} "null"
|
||||
ensure then
|
||||
backup_count_set: backup_count = 4
|
||||
level_set: level = Log_debug
|
||||
@@ -48,6 +49,9 @@ feature -- Access
|
||||
level: INTEGER
|
||||
-- Logger level.
|
||||
|
||||
type: IMMUTABLE_STRING_32
|
||||
-- Type of logging.
|
||||
|
||||
feature -- Element Change
|
||||
|
||||
set_location (a_location: detachable PATH)
|
||||
@@ -65,6 +69,15 @@ feature -- Element Change
|
||||
set_location (create {PATH}.make_from_string (a_location))
|
||||
end
|
||||
|
||||
set_type_with_string (a_type: detachable READABLE_STRING_GENERAL)
|
||||
do
|
||||
if a_type /= Void and then not a_type.is_whitespace then
|
||||
create type.make_from_string_general (a_type)
|
||||
else
|
||||
create type.make_from_string_general ("null")
|
||||
end
|
||||
end
|
||||
|
||||
set_backup_count (a_backup: NATURAL)
|
||||
-- Set backup_count to `a_backup'.
|
||||
do
|
||||
|
||||
@@ -32,7 +32,7 @@ feature {NONE} -- Initialization
|
||||
create log.make
|
||||
end
|
||||
|
||||
make_with_environment (app: APPLICATION_ENVIRONMENT)
|
||||
make_with_environment (app: separate APPLICATION_ENVIRONMENT)
|
||||
-- Initialize a logger object with an application environment `app'.
|
||||
do
|
||||
make
|
||||
@@ -49,7 +49,7 @@ feature {NONE} -- Initialization
|
||||
|
||||
feature -- Change
|
||||
|
||||
apply_environment (app: APPLICATION_ENVIRONMENT)
|
||||
apply_environment (app: separate APPLICATION_ENVIRONMENT)
|
||||
do
|
||||
initialize_logger (app, log)
|
||||
end
|
||||
@@ -58,75 +58,107 @@ feature {NONE} -- Internal
|
||||
|
||||
log: LOGGING_FACILITY
|
||||
|
||||
feature -- Settings
|
||||
|
||||
level: INTEGER
|
||||
|
||||
feature -- Logging
|
||||
|
||||
put_debug (a_message: separate READABLE_STRING_8)
|
||||
-- Put message `a_message' to the log at debug level.
|
||||
do
|
||||
if level >= log_debug then
|
||||
log.write_debug (create {STRING}.make_from_separate (a_message))
|
||||
end
|
||||
end
|
||||
|
||||
put_information (a_message: separate READABLE_STRING_8)
|
||||
-- Put message `a_message' to the log at information level.
|
||||
do
|
||||
log.write_information (create {STRING}.make_from_separate (a_message))
|
||||
end
|
||||
|
||||
put_error (a_message: separate READABLE_STRING_8)
|
||||
-- Put message `a_message' to the log at error level.
|
||||
do
|
||||
log.write_error (create {STRING}.make_from_separate (a_message))
|
||||
if level >= log_information then
|
||||
log.write_information (create {STRING}.make_from_separate (a_message))
|
||||
end
|
||||
end
|
||||
|
||||
put_warning (a_message: separate READABLE_STRING_8)
|
||||
-- Put message `a_message' to the log at warning level.
|
||||
do
|
||||
log.write_warning (create {STRING}.make_from_separate (a_message))
|
||||
if level >= log_warning then
|
||||
log.write_warning (create {STRING}.make_from_separate (a_message))
|
||||
end
|
||||
end
|
||||
|
||||
put_error (a_message: separate READABLE_STRING_8)
|
||||
-- Put message `a_message' to the log at error level.
|
||||
do
|
||||
if level >= log_error then
|
||||
log.write_error (create {STRING}.make_from_separate (a_message))
|
||||
end
|
||||
end
|
||||
|
||||
put_critical (a_message: separate READABLE_STRING_8)
|
||||
-- Put message `a_message' to the log at critical level.
|
||||
do
|
||||
log.write_critical (create {STRING}.make_from_separate (a_message))
|
||||
if level >= log_critical then
|
||||
log.write_critical (create {STRING}.make_from_separate (a_message))
|
||||
end
|
||||
end
|
||||
|
||||
put_alert (a_message: separate READABLE_STRING_8)
|
||||
-- Put message `a_message' to the log at alert level.
|
||||
do
|
||||
log.write_alert (create {STRING}.make_from_separate (a_message))
|
||||
end
|
||||
|
||||
put_debug (a_message: separate READABLE_STRING_8)
|
||||
-- Put message `a_message' to the log at debug level.
|
||||
do
|
||||
log.write_debug (create {STRING}.make_from_separate (a_message))
|
||||
if level >= log_alert then
|
||||
log.write_alert (create {STRING}.make_from_separate (a_message))
|
||||
end
|
||||
end
|
||||
|
||||
feature {NONE} -- Implementation
|
||||
|
||||
initialize_logger (app: APPLICATION_ENVIRONMENT; a_log: like log)
|
||||
initialize_logger (app: separate APPLICATION_ENVIRONMENT; a_log: like log)
|
||||
local
|
||||
l_log_writer_file: LOG_ROLLING_WRITER_FILE
|
||||
l_log_writer: LOG_WRITER
|
||||
l_log_writer: detachable LOG_WRITER
|
||||
l_logs_path: detachable PATH
|
||||
l_logger_config: LOGGER_CONFIGURATION
|
||||
ut: FILE_UTILITIES
|
||||
p: PATH
|
||||
l_name: IMMUTABLE_STRING_32
|
||||
do
|
||||
l_logger_config := new_logger_level_configuration (app.application_config_path)
|
||||
l_logs_path := l_logger_config.location
|
||||
if l_logs_path = Void then
|
||||
l_logs_path := app.logs_path
|
||||
create l_name.make_from_separate (app.name)
|
||||
create p.make_from_separate (app.application_config_path)
|
||||
-- l_name := app.name
|
||||
-- p := app.application_config_path
|
||||
|
||||
l_logger_config := new_logger_level_configuration (p)
|
||||
if l_logger_config.type.is_case_insensitive_equal_general ("file") then
|
||||
l_logs_path := l_logger_config.location
|
||||
if l_logs_path = Void then
|
||||
create l_logs_path.make_from_separate (app.logs_path)
|
||||
end
|
||||
if ut.directory_path_exists (l_logs_path) then
|
||||
create l_log_writer_file.make_at_location (l_logs_path.extended (l_name).appended_with_extension ("log"))
|
||||
l_log_writer_file.set_max_file_size ({NATURAL_64} 1024 * 1204)
|
||||
l_log_writer_file.set_max_backup_count (l_logger_config.backup_count)
|
||||
l_log_writer := l_log_writer_file
|
||||
else
|
||||
-- Should we create the directory anyway ?
|
||||
end
|
||||
elseif l_logger_config.type.is_case_insensitive_equal_general ("stderr") then
|
||||
create {LOG_WRITER_STDERR} l_log_writer
|
||||
end
|
||||
if ut.directory_path_exists (l_logs_path) then
|
||||
create l_log_writer_file.make_at_location (l_logs_path.extended (app.name).appended_with_extension ("log"))
|
||||
l_log_writer_file.set_max_file_size ({NATURAL_64} 1024 * 1204)
|
||||
l_log_writer_file.set_max_backup_count (l_logger_config.backup_count)
|
||||
l_log_writer := l_log_writer_file
|
||||
else
|
||||
-- Should we create the directory anyway ?
|
||||
if l_log_writer = Void then
|
||||
create {LOG_WRITER_NULL} l_log_writer
|
||||
set_logger_level (l_log_writer, log_notice)
|
||||
else
|
||||
set_logger_level (l_log_writer, 0) -- None
|
||||
end
|
||||
set_logger_level (l_log_writer, l_logger_config.level)
|
||||
a_log.register_log_writer (l_log_writer)
|
||||
end
|
||||
|
||||
set_logger_level (a_log_writer: LOG_WRITER; a_priority: INTEGER)
|
||||
-- Setup the logger level based on `a_priority'
|
||||
do
|
||||
level := a_priority
|
||||
if a_priority = log_debug then
|
||||
a_log_writer.enable_debug_log_level
|
||||
elseif a_priority = Log_emergency then
|
||||
@@ -167,6 +199,9 @@ feature {NONE} -- Implementation
|
||||
attached l_parser.parsed_json_object as jv and then
|
||||
attached {JSON_OBJECT} jv.item ("logger") as l_logger
|
||||
then
|
||||
if attached {JSON_STRING} l_logger.item ("type") as l_type then
|
||||
Result.set_type_with_string (l_type.item)
|
||||
end
|
||||
if attached {JSON_STRING} l_logger.item ("location") as l_location then
|
||||
Result.set_location_with_string (l_location.item)
|
||||
end
|
||||
|
||||
@@ -35,72 +35,113 @@ feature -- Logging
|
||||
|
||||
write_debug_log (m: READABLE_STRING_8)
|
||||
do
|
||||
write_debug_log_to (m, logger)
|
||||
-- write_debug_log_to (m, logger)
|
||||
end
|
||||
|
||||
write_information_log (m: READABLE_STRING_8)
|
||||
do
|
||||
write_information_log_to (m, logger)
|
||||
-- write_information_log_to (m, logger)
|
||||
end
|
||||
|
||||
write_warning_log (m: READABLE_STRING_8)
|
||||
do
|
||||
write_warning_log_to (m, logger)
|
||||
-- write_warning_log_to (m, logger)
|
||||
end
|
||||
|
||||
write_error_log (m: READABLE_STRING_8)
|
||||
do
|
||||
write_error_log_to (m, logger)
|
||||
-- write_error_log_to (m, logger)
|
||||
end
|
||||
|
||||
write_critical_log (m: READABLE_STRING_8)
|
||||
do
|
||||
write_critical_log_to (m, logger)
|
||||
-- write_critical_log_to (m, logger)
|
||||
end
|
||||
|
||||
write_alert_log (m: READABLE_STRING_8)
|
||||
do
|
||||
write_alert_log_to (m, logger)
|
||||
-- write_alert_log_to (m, logger)
|
||||
end
|
||||
|
||||
feature {NONE} -- Logger: separate implementation
|
||||
|
||||
write_debug_log_to (m: READABLE_STRING_8; a_log: like logger)
|
||||
local
|
||||
retried: BOOLEAN
|
||||
do
|
||||
a_log.put_debug (m)
|
||||
if not retried then
|
||||
a_log.put_debug (m)
|
||||
end
|
||||
rescue
|
||||
retried := True
|
||||
retry
|
||||
end
|
||||
|
||||
write_information_log_to (m: READABLE_STRING_8; a_log: like logger)
|
||||
local
|
||||
retried: BOOLEAN
|
||||
do
|
||||
a_log.put_information (m)
|
||||
if not retried then
|
||||
a_log.put_information (m)
|
||||
end
|
||||
rescue
|
||||
retried := True
|
||||
retry
|
||||
end
|
||||
|
||||
write_warning_log_to (m: READABLE_STRING_8; a_log: like logger)
|
||||
local
|
||||
retried: BOOLEAN
|
||||
do
|
||||
a_log.put_warning (m)
|
||||
if not retried then
|
||||
a_log.put_warning (m)
|
||||
end
|
||||
rescue
|
||||
retried := True
|
||||
retry
|
||||
end
|
||||
|
||||
write_error_log_to (m: READABLE_STRING_8; a_log: like logger)
|
||||
local
|
||||
retried: BOOLEAN
|
||||
do
|
||||
a_log.put_error (m)
|
||||
if not retried then
|
||||
a_log.put_error (m)
|
||||
end
|
||||
rescue
|
||||
retried := True
|
||||
retry
|
||||
end
|
||||
|
||||
write_critical_log_to (m: READABLE_STRING_8; a_log: like logger)
|
||||
local
|
||||
retried: BOOLEAN
|
||||
do
|
||||
a_log.put_critical (m)
|
||||
if not retried then
|
||||
a_log.put_critical (m)
|
||||
end
|
||||
rescue
|
||||
retried := True
|
||||
retry
|
||||
end
|
||||
|
||||
write_alert_log_to (m: READABLE_STRING_8; a_log: like logger)
|
||||
local
|
||||
retried: BOOLEAN
|
||||
do
|
||||
a_log.put_alert (m)
|
||||
if not retried then
|
||||
a_log.put_alert (m)
|
||||
end
|
||||
rescue
|
||||
retried := True
|
||||
retry
|
||||
end
|
||||
|
||||
|
||||
feature {NONE} -- Implementation
|
||||
|
||||
initialize_logger (app: APPLICATION_ENVIRONMENT)
|
||||
local
|
||||
l_logger: LOGGER
|
||||
l_logger: separate LOGGER
|
||||
do
|
||||
create l_logger.make_with_environment (app)
|
||||
set_logger_to (l_logger, logger_cell)
|
||||
|
||||
@@ -33,11 +33,53 @@ feature -- Query
|
||||
end
|
||||
end
|
||||
|
||||
resolved_text_list_item (k: READABLE_STRING_GENERAL): detachable LIST [READABLE_STRING_32]
|
||||
-- List of String item associated with key `k',
|
||||
-- and expanded values to resolved variables ${varname}.
|
||||
do
|
||||
if attached text_list_item (k) as lst then
|
||||
from
|
||||
lst.start
|
||||
until
|
||||
lst.after
|
||||
loop
|
||||
lst.replace (resolved_expression (lst.item))
|
||||
lst.forth
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
resolved_text_table_item (k: READABLE_STRING_GENERAL): detachable STRING_TABLE [READABLE_STRING_32]
|
||||
-- Table of String item associated with key `k',
|
||||
-- and expanded values to resolved variables ${varname}.
|
||||
do
|
||||
if attached text_table_item (k) as tb then
|
||||
from
|
||||
tb.start
|
||||
until
|
||||
tb.after
|
||||
loop
|
||||
tb.replace (resolved_expression (tb.item_for_iteration), tb.key_for_iteration)
|
||||
tb.forth
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
text_item (k: READABLE_STRING_GENERAL): detachable READABLE_STRING_32
|
||||
-- String item associated with key `k'.
|
||||
deferred
|
||||
end
|
||||
|
||||
text_list_item (k: READABLE_STRING_GENERAL): detachable LIST [READABLE_STRING_32]
|
||||
-- List of String item associated with key `k'.
|
||||
deferred
|
||||
end
|
||||
|
||||
text_table_item (k: READABLE_STRING_GENERAL): detachable STRING_TABLE [READABLE_STRING_32]
|
||||
-- Table of String item associated with key `k'.
|
||||
deferred
|
||||
end
|
||||
|
||||
integer_item (k: READABLE_STRING_GENERAL): INTEGER
|
||||
-- Integer item associated with key `k'.
|
||||
deferred
|
||||
@@ -109,7 +151,7 @@ feature -- Duplication
|
||||
end
|
||||
|
||||
note
|
||||
copyright: "2011-2014, Jocelyn Fiat, Eiffel Software and others"
|
||||
copyright: "2011-2015, Jocelyn Fiat, Eiffel Software and others"
|
||||
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
||||
source: "[
|
||||
Eiffel Software
|
||||
|
||||
@@ -119,14 +119,47 @@ feature -- Access: Config Reader
|
||||
|
||||
text_item (k: READABLE_STRING_GENERAL): detachable READABLE_STRING_32
|
||||
-- String item associated with key `k'.
|
||||
local
|
||||
obj: like item
|
||||
do
|
||||
obj := item (k)
|
||||
if attached {READABLE_STRING_32} obj as s32 then
|
||||
Result := s32
|
||||
elseif attached {READABLE_STRING_8} obj as s then
|
||||
Result := utf.utf_8_string_8_to_escaped_string_32 (s)
|
||||
Result := value_to_string_32 (item (k))
|
||||
end
|
||||
|
||||
text_list_item (k: READABLE_STRING_GENERAL): detachable LIST [READABLE_STRING_32]
|
||||
-- List of String item associated with key `k'.
|
||||
do
|
||||
if attached {LIST [READABLE_STRING_8]} item (k) as l_list then
|
||||
create {ARRAYED_LIST [READABLE_STRING_32]} Result.make (l_list.count)
|
||||
Result.compare_objects
|
||||
across
|
||||
l_list as ic
|
||||
until
|
||||
Result = Void
|
||||
loop
|
||||
if attached value_to_string_32 (ic.item) as s32 then
|
||||
Result.force (s32)
|
||||
else
|
||||
Result := Void
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
text_table_item (k: READABLE_STRING_GENERAL): detachable STRING_TABLE [READABLE_STRING_32]
|
||||
-- Table of String item associated with key `k'.
|
||||
do
|
||||
if attached {STRING_TABLE [READABLE_STRING_8]} item (k) as l_list then
|
||||
create {STRING_TABLE [READABLE_STRING_32]} Result.make (l_list.count)
|
||||
Result.compare_objects
|
||||
across
|
||||
l_list as ic
|
||||
until
|
||||
Result = Void
|
||||
loop
|
||||
if attached value_to_string_32 (ic.item) as s32 then
|
||||
Result.force (s32, ic.key)
|
||||
else
|
||||
Result := Void
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -226,6 +259,15 @@ feature -- Access
|
||||
|
||||
feature {NONE} -- Implementation
|
||||
|
||||
value_to_string_32 (obj: detachable ANY): detachable STRING_32
|
||||
do
|
||||
if attached {READABLE_STRING_32} obj as s32 then
|
||||
Result := s32
|
||||
elseif attached {READABLE_STRING_8} obj as s then
|
||||
Result := utf.utf_8_string_8_to_escaped_string_32 (s)
|
||||
end
|
||||
end
|
||||
|
||||
item_from_values (a_values: STRING_TABLE [ANY]; k: READABLE_STRING_GENERAL): detachable ANY
|
||||
local
|
||||
i,j: INTEGER
|
||||
@@ -460,7 +502,7 @@ feature {NONE} -- Implementation
|
||||
invariant
|
||||
|
||||
note
|
||||
copyright: "2011-2014, Jocelyn Fiat, Eiffel Software and others"
|
||||
copyright: "2011-2015, Jocelyn Fiat, Eiffel Software and others"
|
||||
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
||||
source: "[
|
||||
Eiffel Software
|
||||
|
||||
@@ -63,10 +63,46 @@ feature -- Access: Config Reader
|
||||
text_item (k: READABLE_STRING_GENERAL): detachable READABLE_STRING_32
|
||||
-- String item associated with query `k'.
|
||||
do
|
||||
if attached {JSON_STRING} item (k) as l_string then
|
||||
Result := l_string.unescaped_string_32
|
||||
elseif attached {JSON_NUMBER} item (k) as l_number then
|
||||
Result := l_number.item
|
||||
Result := value_to_string_32 (item (k))
|
||||
end
|
||||
|
||||
text_list_item (k: READABLE_STRING_GENERAL): detachable LIST [READABLE_STRING_32]
|
||||
-- List of String item associated with key `k'.
|
||||
do
|
||||
if attached {JSON_ARRAY} item (k) as l_array then
|
||||
create {ARRAYED_LIST [READABLE_STRING_32]} Result.make (l_array.count)
|
||||
Result.compare_objects
|
||||
across
|
||||
l_array as ic
|
||||
until
|
||||
Result = Void
|
||||
loop
|
||||
if attached value_to_string_32 (ic.item) as s32 then
|
||||
Result.force (s32)
|
||||
else
|
||||
Result := Void
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
text_table_item (k: READABLE_STRING_GENERAL): detachable STRING_TABLE [READABLE_STRING_32]
|
||||
-- Table of String item associated with key `k'.
|
||||
do
|
||||
if attached {JSON_OBJECT} item (k) as obj then
|
||||
create {STRING_TABLE [READABLE_STRING_32]} Result.make (obj.count)
|
||||
Result.compare_objects
|
||||
across
|
||||
obj as ic
|
||||
until
|
||||
Result = Void
|
||||
loop
|
||||
if attached value_to_string_32 (ic.item) as s32 then
|
||||
Result.force (s32, ic.key.item)
|
||||
else
|
||||
Result := Void
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -105,6 +141,15 @@ feature -- Access
|
||||
|
||||
feature {NONE} -- Implementation
|
||||
|
||||
value_to_string_32 (v: detachable ANY): detachable STRING_32
|
||||
do
|
||||
if attached {JSON_STRING} v as l_string then
|
||||
Result := l_string.unescaped_string_32
|
||||
elseif attached {JSON_NUMBER} v as l_number then
|
||||
Result := l_number.item
|
||||
end
|
||||
end
|
||||
|
||||
object_json_value (a_object: JSON_OBJECT; a_query: READABLE_STRING_32): detachable JSON_VALUE
|
||||
-- Item associated with query `a_query' from object `a_object' if any.
|
||||
local
|
||||
@@ -163,7 +208,7 @@ feature {NONE} -- JSON
|
||||
end
|
||||
|
||||
note
|
||||
copyright: "2011-2014, Jocelyn Fiat, Eiffel Software and others"
|
||||
copyright: "2011-2015, Jocelyn Fiat, Eiffel Software and others"
|
||||
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
||||
source: "[
|
||||
Eiffel Software
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<system xmlns="http://www.eiffel.com/developers/xml/configuration-1-13-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-13-0 http://www.eiffel.com/developers/xml/configuration-1-13-0.xsd" name="config_tests" uuid="AD1DE0F7-BC8A-4A17-9A44-56C917BD5604">
|
||||
<system xmlns="http://www.eiffel.com/developers/xml/configuration-1-13-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-13-0 http://www.eiffel.com/developers/xml/configuration-1-13-0.xsd" name="config_tests" library_target="config_tests" uuid="AD1DE0F7-BC8A-4A17-9A44-56C917BD5604">
|
||||
<target name="config_tests">
|
||||
<root class="TEST_CONFIG_READER_SET" feature="default_create"/>
|
||||
<file_rule>
|
||||
|
||||
@@ -21,6 +21,18 @@ feature -- Test
|
||||
create {INI_CONFIG} cfg.make_from_string ("[
|
||||
foo = bar
|
||||
|
||||
collection[] = a
|
||||
collection[] = b
|
||||
collection[] = c
|
||||
collection[] = 1
|
||||
collection[] = 2
|
||||
collection[] = 3
|
||||
|
||||
table[a] = 1
|
||||
table[b] = 2
|
||||
table[c] = 3
|
||||
table[d] = test
|
||||
|
||||
[first]
|
||||
abc = 1
|
||||
def = and so on
|
||||
@@ -58,6 +70,21 @@ feature -- Test
|
||||
assert ("has_item (second.is)", cfg.has_item ("second.is"))
|
||||
assert ("item (second.is)", attached cfg.text_item ("second.is") as v and then v.same_string_general ("2"))
|
||||
|
||||
assert ("has_item (collection)", cfg.has_item ("collection"))
|
||||
assert ("item (collection)", attached cfg.text_list_item ("collection") as lst and then (
|
||||
lst.has ("a") and lst.has ("b") and lst.has ("c") and lst.has ("1") and lst.has ("2") and lst.has ("3")
|
||||
)
|
||||
)
|
||||
|
||||
assert ("has_item (table)", cfg.has_item ("table"))
|
||||
assert ("item (table)", attached cfg.text_table_item ("table") as tb and then (
|
||||
tb.item ("a") ~ {STRING_32} "1" and
|
||||
tb.item ("b") ~ {STRING_32} "2" and
|
||||
tb.item ("c") ~ {STRING_32} "3" and
|
||||
tb.item ("d") ~ {STRING_32} "test"
|
||||
)
|
||||
)
|
||||
|
||||
if attached cfg.sub_config ("second") as cfg_second then
|
||||
assert ("has_item (is)", cfg_second.has_item ("is"))
|
||||
assert ("item (is)", attached cfg_second.text_item ("is") as v and then v.same_string_general ("2"))
|
||||
@@ -141,7 +168,9 @@ feature -- Test
|
||||
"is": 2,
|
||||
"the": 3,
|
||||
"end": 4
|
||||
}
|
||||
},
|
||||
"collection": ["a", "b", "c", 1, 2, 3],
|
||||
"table": { "a": 1, "b": 2, "c": 3, "d" : "test" }
|
||||
}
|
||||
]")
|
||||
|
||||
@@ -164,6 +193,21 @@ feature -- Test
|
||||
assert ("item (second.the)", attached cfg.text_item ("second.the") as v and then v.same_string_general ("3"))
|
||||
assert ("item (second.end)", attached cfg.text_item ("second.end") as v and then v.same_string_general ("4"))
|
||||
|
||||
assert ("has_item (collection)", cfg.has_item ("collection"))
|
||||
assert ("item (collection)", attached cfg.text_list_item ("collection") as lst and then (
|
||||
lst.has ("a") and lst.has ("b") and lst.has ("c") and lst.has ("1") and lst.has ("2") and lst.has ("3")
|
||||
)
|
||||
)
|
||||
|
||||
assert ("has_item (table)", cfg.has_item ("table"))
|
||||
assert ("item (table)", attached cfg.text_table_item ("table") as tb and then (
|
||||
tb.item ("a") ~ {STRING_32} "1" and
|
||||
tb.item ("b") ~ {STRING_32} "2" and
|
||||
tb.item ("c") ~ {STRING_32} "3" and
|
||||
tb.item ("d") ~ {STRING_32} "test"
|
||||
)
|
||||
)
|
||||
|
||||
if attached cfg.sub_config ("second") as cfg_second then
|
||||
assert ("has_item (is)", cfg_second.has_item ("is"))
|
||||
assert ("item (is)", attached cfg_second.text_item ("is") as v and then v.same_string_general ("2"))
|
||||
|
||||
17
library/email/email-safe.ecf
Normal file
17
library/email/email-safe.ecf
Normal file
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<system xmlns="http://www.eiffel.com/developers/xml/configuration-1-13-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-13-0 http://www.eiffel.com/developers/xml/configuration-1-13-0.xsd" name="email_service" uuid="261DC9D5-C3A0-498D-A063-0BB6C80423CC" library_target="email_service">
|
||||
<target name="email_service">
|
||||
<root all_classes="true"/>
|
||||
<file_rule>
|
||||
<exclude>/.git$</exclude>
|
||||
<exclude>/EIFGENs$</exclude>
|
||||
<exclude>/.svn$</exclude>
|
||||
</file_rule>
|
||||
<option warning="true" full_class_checking="true" is_attached_by_default="true" void_safety="all" syntax="standard">
|
||||
</option>
|
||||
<library name="base" location="$ISE_LIBRARY\library\base\base-safe.ecf"/>
|
||||
<library name="cms_app_env" location="..\app_env\app_env-safe.ecf"/>
|
||||
<library name="notification_mailer" location="$ISE_LIBRARY\contrib\library\runtime\process\notification_email\notification_email-safe.ecf"/>
|
||||
<cluster name="src" location=".\" recursive="true"/>
|
||||
</target>
|
||||
</system>
|
||||
93
library/email/email_service.e
Normal file
93
library/email/email_service.e
Normal file
@@ -0,0 +1,93 @@
|
||||
note
|
||||
description: "Basic Email Service"
|
||||
date: "$Date: 2015-04-30 05:45:25 -0300 (ju. 30 de abr. de 2015) $"
|
||||
revision: "$Revision: 97218 $"
|
||||
|
||||
class
|
||||
EMAIL_SERVICE
|
||||
|
||||
inherit
|
||||
SHARED_ERROR
|
||||
|
||||
SHARED_LOGGER
|
||||
|
||||
create
|
||||
make
|
||||
|
||||
feature {NONE} -- Initialization
|
||||
|
||||
make (a_params: like parameters)
|
||||
-- Create instance of {EMAIL_SERVICE} with smtp_server `a_params.smtp_server'.
|
||||
-- Using `a_params.admin_email' as admin email.
|
||||
do
|
||||
parameters := a_params
|
||||
initialize
|
||||
end
|
||||
|
||||
initialize
|
||||
-- Initialize service.
|
||||
do
|
||||
admin_email := parameters.admin_email
|
||||
create {NOTIFICATION_SMTP_MAILER} mailer.make (parameters.smtp_server)
|
||||
set_successful
|
||||
end
|
||||
|
||||
parameters: EMAIL_SERVICE_PARAMETERS
|
||||
-- Associated parameters.
|
||||
|
||||
admin_email: IMMUTABLE_STRING_8
|
||||
-- Site admin's email.
|
||||
|
||||
mailer: NOTIFICATION_MAILER
|
||||
-- SMTP protocol.
|
||||
|
||||
feature -- Basic Operations
|
||||
|
||||
send_internal_email (a_content: READABLE_STRING_GENERAL)
|
||||
do
|
||||
send_message (admin_email, admin_email, "Notification Contact", a_content)
|
||||
end
|
||||
|
||||
send_email_internal_server_error (a_content: READABLE_STRING_GENERAL)
|
||||
do
|
||||
send_message (admin_email, admin_email, "Internal Server Error", a_content)
|
||||
end
|
||||
|
||||
send_message (a_from_address, a_to_address: READABLE_STRING_8; a_subjet: READABLE_STRING_GENERAL; a_content: READABLE_STRING_GENERAL)
|
||||
local
|
||||
l_email: NOTIFICATION_EMAIL
|
||||
utf: UTF_CONVERTER
|
||||
do
|
||||
write_debug_log (generator + ".send_message: [from:" + a_from_address + ", to:" + a_to_address + ", subject:" + a_subjet + ", content:" + a_content)
|
||||
create l_email.make (a_from_address, a_to_address, utf.escaped_utf_32_string_to_utf_8_string_8 (a_subjet) , utf.escaped_utf_32_string_to_utf_8_string_8 (a_content))
|
||||
l_email.add_header_line ("MIME-Version:1.0")
|
||||
l_email.add_header_line ("Content-Type: text/html; charset=utf-8")
|
||||
send_email (l_email)
|
||||
end
|
||||
|
||||
feature {NONE} -- Implementation
|
||||
|
||||
send_email (a_email: NOTIFICATION_EMAIL)
|
||||
-- Send the email represented by `a_email'.
|
||||
local
|
||||
l_retried: BOOLEAN
|
||||
do
|
||||
if not l_retried then
|
||||
write_information_log (generator + ".send_email Process send email.")
|
||||
mailer.process_email (a_email)
|
||||
write_information_log (generator + ".send_email Email sent.")
|
||||
if mailer.has_error then
|
||||
set_last_error ("smtp_protocol reported an error", generator + ".send_email")
|
||||
else
|
||||
set_successful
|
||||
end
|
||||
else
|
||||
write_error_log (generator + ".send_email Email not send " + last_error_message)
|
||||
end
|
||||
rescue
|
||||
set_last_error_from_exception (generator + ".send_email")
|
||||
l_retried := True
|
||||
retry
|
||||
end
|
||||
|
||||
end
|
||||
20
library/email/email_service_parameters.e
Normal file
20
library/email/email_service_parameters.e
Normal file
@@ -0,0 +1,20 @@
|
||||
note
|
||||
description: "Basic Email Service customized for cms site"
|
||||
author: ""
|
||||
date: "$Date: 2015-01-16 07:17:14 -0300 (vi. 16 de ene. de 2015) $"
|
||||
revision: "$Revision: 96467 $"
|
||||
|
||||
deferred class
|
||||
EMAIL_SERVICE_PARAMETERS
|
||||
|
||||
feature -- Access
|
||||
|
||||
smtp_server: IMMUTABLE_STRING_8
|
||||
deferred
|
||||
end
|
||||
|
||||
admin_email: IMMUTABLE_STRING_8
|
||||
deferred
|
||||
end
|
||||
|
||||
end
|
||||
@@ -41,6 +41,11 @@ feature -- Status report
|
||||
has_children: BOOLEAN = False
|
||||
-- <Precursor>
|
||||
|
||||
feature -- Security
|
||||
|
||||
is_forbidden: BOOLEAN = False
|
||||
-- <Precursor>
|
||||
|
||||
feature -- Access
|
||||
|
||||
children: detachable LIST [CMS_LINK]
|
||||
@@ -48,6 +53,6 @@ feature -- Access
|
||||
|
||||
invariant
|
||||
note
|
||||
copyright: "2011-2014, Javier Velilla, Jocelyn Fiat, Eiffel Software and others"
|
||||
copyright: "2011-2015, Javier Velilla, Jocelyn Fiat, Eiffel Software and others"
|
||||
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
||||
end
|
||||
|
||||
@@ -49,7 +49,7 @@ feature -- Comparison
|
||||
end
|
||||
end
|
||||
|
||||
feature -- status report
|
||||
feature -- Status report
|
||||
|
||||
is_active: BOOLEAN
|
||||
-- Is current link active?
|
||||
@@ -79,6 +79,14 @@ feature -- status report
|
||||
deferred
|
||||
end
|
||||
|
||||
feature -- Security
|
||||
|
||||
is_forbidden: BOOLEAN
|
||||
-- Is Current link forbidden?
|
||||
-- Current link could be disabled for current CMS user.
|
||||
deferred
|
||||
end
|
||||
|
||||
feature -- Element change
|
||||
|
||||
set_weight (a_weight: INTEGER)
|
||||
|
||||
@@ -25,8 +25,10 @@ create
|
||||
|
||||
feature {NONE} -- Initialization
|
||||
|
||||
make (a_title: detachable like title; a_location: like location)
|
||||
make (a_title: detachable READABLE_STRING_GENERAL; a_location: like location)
|
||||
-- Create current local link with optional title `a_title' and location `a_location'.
|
||||
require
|
||||
is_valid_local_location_argument: not a_location.starts_with_general ("/")
|
||||
do
|
||||
location := a_location
|
||||
set_title (a_title)
|
||||
@@ -69,15 +71,21 @@ feature -- Status report
|
||||
Result := attached children as l_children and then not l_children.is_empty
|
||||
end
|
||||
|
||||
feature -- Security
|
||||
|
||||
is_forbidden: BOOLEAN
|
||||
-- <Precursor>
|
||||
-- Related to `permission_arguments' values.
|
||||
|
||||
feature -- Element change
|
||||
|
||||
set_title (a_title: detachable like title)
|
||||
set_title (a_title: detachable READABLE_STRING_GENERAL)
|
||||
-- Set `title' to `a_title' or `location'.
|
||||
do
|
||||
if a_title /= Void then
|
||||
title := a_title
|
||||
title := a_title.as_string_32
|
||||
else
|
||||
title := location
|
||||
title := location.as_string_32
|
||||
end
|
||||
end
|
||||
|
||||
@@ -165,6 +173,16 @@ feature -- Status change
|
||||
is_expandable: is_expandable = b
|
||||
end
|
||||
|
||||
feature -- Security change
|
||||
|
||||
set_is_forbidden (b: BOOLEAN)
|
||||
-- Set `is_forbidden' to `b'.
|
||||
do
|
||||
is_forbidden := b
|
||||
ensure
|
||||
is_forbidden: is_forbidden = b
|
||||
end
|
||||
|
||||
feature {NONE} -- Implementation
|
||||
|
||||
internal_is_expandable: BOOLEAN
|
||||
|
||||
@@ -27,6 +27,7 @@ feature {NONE} -- Initialization
|
||||
initialize
|
||||
ensure
|
||||
name_set: name = a_name
|
||||
status_not_active: status = not_active
|
||||
end
|
||||
|
||||
make_with_id (a_id: INTEGER_64)
|
||||
@@ -38,11 +39,13 @@ feature {NONE} -- Initialization
|
||||
initialize
|
||||
ensure
|
||||
id_set: id = a_id
|
||||
status_not_active: status = not_active
|
||||
end
|
||||
|
||||
initialize
|
||||
do
|
||||
create creation_date.make_now_utc
|
||||
mark_not_active
|
||||
end
|
||||
|
||||
feature -- Access
|
||||
@@ -71,6 +74,23 @@ feature -- Access
|
||||
last_login_date: detachable DATE_TIME
|
||||
-- User last login.
|
||||
|
||||
status: INTEGER
|
||||
-- Associated status for the current user.
|
||||
-- default: not_active
|
||||
-- active
|
||||
-- trashed
|
||||
|
||||
|
||||
feature -- Access: helper
|
||||
|
||||
utf_8_name: STRING_8
|
||||
-- UTF-8 version of `name'.
|
||||
local
|
||||
utf: UTF_CONVERTER
|
||||
do
|
||||
Result := utf.utf_32_string_to_utf_8_string_8 (name)
|
||||
end
|
||||
|
||||
feature -- Roles
|
||||
|
||||
roles: detachable LIST [CMS_USER_ROLE]
|
||||
@@ -118,6 +138,12 @@ feature -- Status report
|
||||
Result := other /= Void and then id = other.id
|
||||
end
|
||||
|
||||
is_active: BOOLEAN
|
||||
-- is the current user active?
|
||||
do
|
||||
Result := status = {CMS_USER}.active
|
||||
end
|
||||
|
||||
feature -- Change element
|
||||
|
||||
set_id (a_id: like id)
|
||||
@@ -225,6 +251,52 @@ feature -- Change element: data
|
||||
end
|
||||
end
|
||||
|
||||
feature -- Status change
|
||||
|
||||
mark_not_active
|
||||
-- Set status to not_active
|
||||
do
|
||||
set_status (not_active)
|
||||
ensure
|
||||
status_not_active: status = not_active
|
||||
end
|
||||
|
||||
mark_active
|
||||
-- Set status to active.
|
||||
do
|
||||
set_status (active)
|
||||
ensure
|
||||
status_active: status = active
|
||||
end
|
||||
|
||||
mark_trashed
|
||||
-- Set status to trashed.
|
||||
do
|
||||
set_status (trashed)
|
||||
ensure
|
||||
status_trash: status = trashed
|
||||
end
|
||||
|
||||
set_status (a_status: like status)
|
||||
-- Assign `status' with `a_status'.
|
||||
do
|
||||
status := a_status
|
||||
ensure
|
||||
status_set: status = a_status
|
||||
end
|
||||
|
||||
|
||||
feature -- User status
|
||||
|
||||
not_active: INTEGER = 0
|
||||
-- The user is not active.
|
||||
|
||||
active: INTEGER = 1
|
||||
-- The user is active
|
||||
|
||||
Trashed: INTEGER = -1
|
||||
-- The user is trashed (soft delete), ready to be deleted/destroyed from storage.
|
||||
|
||||
invariant
|
||||
|
||||
id_or_name_set: id > 0 or else not name.is_whitespace
|
||||
|
||||
@@ -32,6 +32,15 @@ feature -- Status report
|
||||
Result := connection.is_connected
|
||||
end
|
||||
|
||||
feature -- Basic operation
|
||||
|
||||
close
|
||||
-- <Precursor>
|
||||
-- Disconnect from SQL database.
|
||||
do
|
||||
connection.disconnect
|
||||
end
|
||||
|
||||
feature {NONE} -- Implementation
|
||||
|
||||
db_handler: DATABASE_HANDLER
|
||||
|
||||
@@ -8,16 +8,16 @@ deferred class
|
||||
|
||||
feature -- Database access
|
||||
|
||||
hostname: STRING = ""
|
||||
default_hostname: STRING = ""
|
||||
-- Database hostname.
|
||||
|
||||
username: STRING = ""
|
||||
default_username: STRING = ""
|
||||
-- Database username.
|
||||
|
||||
password: STRING = ""
|
||||
default_password: STRING = ""
|
||||
-- Database password.
|
||||
|
||||
database_name: STRING = "EiffelDB"
|
||||
default_database_name: STRING = "EiffelDB"
|
||||
-- Database name.
|
||||
|
||||
is_keep_connection: BOOLEAN
|
||||
|
||||
@@ -12,27 +12,7 @@ inherit
|
||||
|
||||
feature {NONE} -- Initialization
|
||||
|
||||
make_common
|
||||
-- Create a database handler with common settings.
|
||||
deferred
|
||||
ensure
|
||||
db_application_not_void: db_application /= Void
|
||||
db_control_not_void: db_control /= Void
|
||||
end
|
||||
|
||||
make_basic ( a_database_name: STRING)
|
||||
-- Create a database handler with common settings and
|
||||
-- set database_name with `a_database_name'.
|
||||
require
|
||||
database_name_not_void: a_database_name /= Void
|
||||
database_name_not_empty: not a_database_name.is_empty
|
||||
deferred
|
||||
ensure
|
||||
db_application_not_void: db_application /= Void
|
||||
db_control_not_void: db_control /= Void
|
||||
end
|
||||
|
||||
make (a_username: STRING; a_password: STRING; a_hostname: STRING; a_database_name: STRING; connection: BOOLEAN)
|
||||
login (a_username: STRING; a_password: STRING; a_hostname: STRING; a_database_name: STRING; connection: BOOLEAN)
|
||||
|
||||
-- Create a database handler with user `a_username', password `a_password',
|
||||
-- host `a_hostname', database_name `a_database_name', and keep_connection `connection'.
|
||||
@@ -59,6 +39,26 @@ feature {NONE} -- Initialization
|
||||
db_control_not_void: db_control /= Void
|
||||
end
|
||||
|
||||
login_with_default
|
||||
-- Create a database handler with common settings.
|
||||
deferred
|
||||
ensure
|
||||
db_application_not_void: db_application /= Void
|
||||
db_control_not_void: db_control /= Void
|
||||
end
|
||||
|
||||
login_with_database_name ( a_database_name: STRING)
|
||||
-- Create a database handler with common settings and
|
||||
-- set database_name with `a_database_name'.
|
||||
require
|
||||
database_name_not_void: a_database_name /= Void
|
||||
database_name_not_empty: not a_database_name.is_empty
|
||||
deferred
|
||||
ensure
|
||||
db_application_not_void: db_application /= Void
|
||||
db_control_not_void: db_control /= Void
|
||||
end
|
||||
|
||||
feature -- Database Setup
|
||||
|
||||
db_application: DATABASE_APPL [DATABASE]
|
||||
@@ -168,7 +168,7 @@ feature -- Error Handling
|
||||
|
||||
database_error_handler: DATABASE_ERROR_HANDLER
|
||||
-- Error handler.
|
||||
|
||||
|
||||
feature -- Status Report
|
||||
|
||||
has_error: BOOLEAN
|
||||
@@ -179,11 +179,11 @@ feature -- Status Report
|
||||
|
||||
feature -- Helper
|
||||
|
||||
exception_as_error (a_e: like {EXCEPTION_MANAGER}.last_exception)
|
||||
-- Record exception as an error.
|
||||
exception_as_error (a_exception: like {EXCEPTION_MANAGER}.last_exception)
|
||||
-- Record exception `a_exception' as an error.
|
||||
do
|
||||
if attached a_e as l_e and then attached l_e.trace as l_trace then
|
||||
database_error_handler.add_error_details (l_e.code, once "Exception", l_trace.as_string_32)
|
||||
if a_exception /= Void and then attached a_exception.trace as l_trace then
|
||||
database_error_handler.add_error_details (a_exception.code, once "Exception", l_trace)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -15,33 +15,33 @@ inherit
|
||||
end
|
||||
|
||||
create
|
||||
make, make_common, make_basic
|
||||
login, login_with_default, login_with_database_name
|
||||
|
||||
feature -- Initialization
|
||||
|
||||
make_common
|
||||
login_with_default
|
||||
-- Create a database handler for ODBC with common settings.
|
||||
do
|
||||
create database_error_handler.make
|
||||
create db_application.login (username, password)
|
||||
db_application.set_hostname (hostname)
|
||||
db_application.set_data_source (database_name)
|
||||
create db_application.login (default_username, default_password)
|
||||
db_application.set_hostname (default_username)
|
||||
db_application.set_data_source (default_database_name)
|
||||
db_application.set_base
|
||||
create db_control.make
|
||||
end
|
||||
|
||||
make (a_username: STRING; a_password: STRING; a_hostname: STRING; a_database_name: STRING; connection: BOOLEAN)
|
||||
login (a_username: STRING; a_password: STRING; a_hostname: STRING; a_database_name: STRING; connection: BOOLEAN)
|
||||
|
||||
-- Create a database handler for ODBC.
|
||||
do
|
||||
make_common
|
||||
login_with_default
|
||||
end
|
||||
|
||||
make_basic (a_database_name: STRING)
|
||||
login_with_database_name (a_database_name: STRING)
|
||||
|
||||
-- Create a database handler for ODBC.
|
||||
do
|
||||
make_common
|
||||
login_with_default
|
||||
end
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ feature -- Initialization
|
||||
-- Login with `a_connection_string'
|
||||
-- and immediately connect to database.
|
||||
do
|
||||
make_common
|
||||
login_with_default
|
||||
end
|
||||
|
||||
|
||||
|
||||
@@ -7,117 +7,97 @@ class
|
||||
DATABASE_CONNECTION_ODBC
|
||||
|
||||
inherit
|
||||
|
||||
DATABASE_CONNECTION
|
||||
redefine
|
||||
db_application
|
||||
end
|
||||
|
||||
SHARED_LOGGER
|
||||
|
||||
create
|
||||
make, make_common, make_basic, login_with_connection_string
|
||||
login, login_with_default, login_with_database_name, login_with_connection_string
|
||||
|
||||
feature -- Initialization
|
||||
|
||||
make_common
|
||||
-- Create a database handler for ODBC with common settings.
|
||||
local
|
||||
l_retried: BOOLEAN
|
||||
do
|
||||
create db_application.login (username, password)
|
||||
create database_error_handler.make
|
||||
if not l_retried then
|
||||
db_application.set_hostname (hostname)
|
||||
db_application.set_data_source (database_name)
|
||||
db_application.set_base
|
||||
create db_control.make
|
||||
keep_connection := is_keep_connection
|
||||
if keep_connection then
|
||||
connect
|
||||
end
|
||||
else
|
||||
create db_control.make
|
||||
end
|
||||
rescue
|
||||
create db_control.make
|
||||
-- set_last_error_from_exception ("Connection execution")
|
||||
-- write_critical_log (generator + ".make_common:" + last_error_message)
|
||||
if is_connected then
|
||||
disconnect
|
||||
end
|
||||
l_retried := True
|
||||
retry
|
||||
end
|
||||
|
||||
make_basic (a_database_name: STRING)
|
||||
-- Create a database handler and
|
||||
-- set database_name to `a_database_name'.
|
||||
local
|
||||
l_retried: BOOLEAN
|
||||
do
|
||||
create db_application.login (username, password)
|
||||
create database_error_handler.make
|
||||
if not l_retried then
|
||||
db_application.set_hostname (hostname)
|
||||
db_application.set_data_source (a_database_name)
|
||||
db_application.set_base
|
||||
create db_control.make
|
||||
keep_connection := is_keep_connection
|
||||
if keep_connection then
|
||||
connect
|
||||
end
|
||||
else
|
||||
create db_control.make
|
||||
end
|
||||
rescue
|
||||
create db_control.make
|
||||
-- set_last_error_from_exception ("Connection execution")
|
||||
-- write_critical_log (generator + ".make_common:" + last_error_message)
|
||||
if is_connected then
|
||||
disconnect
|
||||
end
|
||||
l_retried := True
|
||||
retry
|
||||
end
|
||||
|
||||
make (a_username: STRING; a_password: STRING; a_hostname: STRING; a_database_name: STRING; connection: BOOLEAN)
|
||||
login (a_username: STRING; a_password: STRING; a_hostname: STRING; a_database_name: STRING; a_keep_connection: BOOLEAN)
|
||||
|
||||
-- Create a database handler for ODBC and set `username' to `a_username',
|
||||
-- `password' to `a_password'
|
||||
-- `database_name' to `a_database_name'
|
||||
-- `connection' to `a_connection'
|
||||
-- `keep_connection' to `a_keep_connection'
|
||||
local
|
||||
retried: BOOLEAN
|
||||
l_database_error_handler: detachable like database_error_handler
|
||||
do
|
||||
create database_error_handler.make
|
||||
create l_database_error_handler.make
|
||||
database_error_handler := l_database_error_handler
|
||||
create db_application.login (a_username, a_password)
|
||||
db_application.set_hostname (a_hostname)
|
||||
db_application.set_data_source (a_database_name)
|
||||
db_application.set_base
|
||||
create db_control.make
|
||||
keep_connection := connection
|
||||
if keep_connection then
|
||||
connect
|
||||
if not retried then
|
||||
db_application.set_hostname (a_hostname)
|
||||
db_application.set_data_source (a_database_name)
|
||||
db_application.set_base
|
||||
create db_control.make
|
||||
keep_connection := a_keep_connection
|
||||
if keep_connection then
|
||||
connect
|
||||
end
|
||||
else
|
||||
create db_control.make
|
||||
if is_connected then
|
||||
disconnect
|
||||
end
|
||||
end
|
||||
rescue
|
||||
if l_database_error_handler = Void then
|
||||
create l_database_error_handler.make
|
||||
end
|
||||
database_error_handler := l_database_error_handler
|
||||
exception_as_error ((create {EXCEPTION_MANAGER}).last_exception)
|
||||
retried := True
|
||||
retry
|
||||
end
|
||||
|
||||
login_with_default
|
||||
-- Create a database handler for ODBC with common settings.
|
||||
do
|
||||
login_with_database_name (default_database_name)
|
||||
end
|
||||
|
||||
login_with_database_name (a_database_name: STRING)
|
||||
-- Create a database handler and
|
||||
-- set database_name to `a_database_name'.
|
||||
do
|
||||
login (default_username, default_password, default_hostname, default_database_name, is_keep_connection)
|
||||
end
|
||||
|
||||
login_with_connection_string (a_string: STRING)
|
||||
-- Login with `a_connection_string'and immediately connect to database.
|
||||
local
|
||||
retried: BOOLEAN
|
||||
l_database_error_handler: detachable like database_error_handler
|
||||
do
|
||||
write_debug_log (generator +".login_with_connection_string")
|
||||
create l_database_error_handler.make
|
||||
database_error_handler := l_database_error_handler
|
||||
create db_application.login_with_connection_string (a_string)
|
||||
create database_error_handler.make
|
||||
db_application.set_base
|
||||
create db_control.make
|
||||
write_debug_log (generator +".login_with_connection_string, is_keep_connection? "+ is_keep_connection.out )
|
||||
keep_connection := is_keep_connection
|
||||
if keep_connection then
|
||||
connect
|
||||
if not db_control.is_ok then
|
||||
write_critical_log (generator +".login_with_connection_string:"+ db_control.error_code.out )
|
||||
write_critical_log (generator +".login_with_connection_string:"+ db_control.error_message_32 )
|
||||
if not retried then
|
||||
db_application.set_base
|
||||
create db_control.make
|
||||
keep_connection := is_keep_connection
|
||||
if keep_connection then
|
||||
connect
|
||||
end
|
||||
else
|
||||
create db_control.make
|
||||
if is_connected then
|
||||
disconnect
|
||||
end
|
||||
write_debug_log (generator +".login_with_connection_string, After connect, is_connected? "+ is_connected.out)
|
||||
end
|
||||
rescue
|
||||
if l_database_error_handler = Void then
|
||||
create l_database_error_handler.make
|
||||
end
|
||||
database_error_handler := l_database_error_handler
|
||||
exception_as_error ((create {EXCEPTION_MANAGER}).last_exception)
|
||||
retried := True
|
||||
retry
|
||||
end
|
||||
|
||||
feature -- Databse Connection
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user