Extract notification library from the CMS draft application

The new library is located in library/runtime/process/notification.
This allows to use it apart from the CMS.
This commit is contained in:
Olivier Ligot
2013-06-12 11:31:31 +02:00
parent fa8b3fdccc
commit 6fbe66ff7b
17 changed files with 69 additions and 31 deletions

View File

@@ -23,6 +23,7 @@
<library name="wsf" location="..\..\..\library\server\wsf\wsf-safe.ecf" readonly="false"/> <library name="wsf" location="..\..\..\library\server\wsf\wsf-safe.ecf" readonly="false"/>
<library name="wsf_html" location="..\..\..\library\server\wsf_html\wsf_html-safe.ecf" readonly="false"/> <library name="wsf_html" location="..\..\..\library\server\wsf_html\wsf_html-safe.ecf" readonly="false"/>
<library name="wsf_session" location="..\..\..\library\server\wsf\wsf_session-safe.ecf" readonly="false"/> <library name="wsf_session" location="..\..\..\library\server\wsf\wsf_session-safe.ecf" readonly="false"/>
<library name="notification" location="..\..\..\library\runtime\process\notification\notification-safe.ecf"/>
<cluster name="src" location=".\src\" recursive="true"/> <cluster name="src" location=".\src\" recursive="true"/>
</target> </target>
</system> </system>

View File

@@ -24,6 +24,7 @@
<library name="uri_template" location="..\..\..\library\text\parser\uri_template\uri_template.ecf"/> <library name="uri_template" location="..\..\..\library\text\parser\uri_template\uri_template.ecf"/>
<library name="wsf" location="..\..\..\library\server\wsf\wsf.ecf" readonly="false"/> <library name="wsf" location="..\..\..\library\server\wsf\wsf.ecf" readonly="false"/>
<library name="wsf_session" location="..\..\..\library\server\wsf\wsf_session.ecf" readonly="false"/> <library name="wsf_session" location="..\..\..\library\server\wsf\wsf_session.ecf" readonly="false"/>
<library name="notification" location="..\..\..\library\runtime\process\notification\notification.ecf"/>
<cluster name="src" location=".\src\" recursive="true"> <cluster name="src" location=".\src\" recursive="true">
</cluster> </cluster>
</target> </target>

View File

@@ -57,7 +57,7 @@ feature -- Access
auth_engine: CMS_AUTH_ENGINE auth_engine: CMS_AUTH_ENGINE
-- CMS Authentication engine -- CMS Authentication engine
mailer: CMS_MAILER mailer: NOTIFICATION_MAILER
feature {NONE} -- Initialization feature {NONE} -- Initialization
@@ -115,12 +115,12 @@ feature {NONE} -- Initialization
build_mailer build_mailer
local local
ch_mailer: CMS_CHAIN_MAILER ch_mailer: NOTIFICATION_CHAIN_MAILER
st_mailer: CMS_STORAGE_MAILER st_mailer: CMS_STORAGE_MAILER
do do
create st_mailer.make (storage) create st_mailer.make (storage)
create ch_mailer.make (st_mailer) create ch_mailer.make (st_mailer)
ch_mailer.set_next (create {CMS_SENDMAIL_MAILER}) ch_mailer.set_next (create {NOTIFICATION_SENDMAIL_MAILER})
mailer := ch_mailer mailer := ch_mailer
end end

View File

@@ -413,7 +413,7 @@ feature -- Content type
feature -- Notification feature -- Notification
mailer: CMS_MAILER mailer: NOTIFICATION_MAILER
feature -- Core Execution feature -- Core Execution

View File

@@ -32,7 +32,7 @@ feature -- Access
deferred deferred
end end
mailer: CMS_MAILER mailer: NOTIFICATION_MAILER
-- CMS email engine -- CMS email engine
deferred deferred
end end

View File

@@ -75,7 +75,7 @@ feature -- Execution
password_form_submit (fd: WSF_FORM_DATA; b: STRING) password_form_submit (fd: WSF_FORM_DATA; b: STRING)
local local
e: detachable CMS_EMAIL e: detachable NOTIFICATION_EMAIL
l_uuid: UUID l_uuid: UUID
do do
debug debug
@@ -144,7 +144,7 @@ feature -- Execution
Result := f Result := f
end end
new_password_email (u: CMS_USER; a_mail_address: STRING; a_extra: READABLE_STRING_8): CMS_EMAIL new_password_email (u: CMS_USER; a_mail_address: STRING; a_extra: READABLE_STRING_8): NOTIFICATION_EMAIL
local local
b: STRING b: STRING
opts: CMS_URL_API_OPTIONS opts: CMS_URL_API_OPTIONS

View File

@@ -73,7 +73,7 @@ feature -- Execution
b: STRING b: STRING
u: detachable CMS_USER u: detachable CMS_USER
up: detachable CMS_USER_PROFILE up: detachable CMS_USER_PROFILE
e: detachable CMS_EMAIL e: detachable NOTIFICATION_EMAIL
l_pass: detachable READABLE_STRING_32 l_pass: detachable READABLE_STRING_32
l_uuid: UUID l_uuid: UUID
do do
@@ -174,7 +174,7 @@ feature -- Execution
Result := f Result := f
end end
new_registration_email (a_mail_address: STRING; u: CMS_USER; a_password: detachable like {CMS_USER}.password; a_extra: READABLE_STRING_8): CMS_EMAIL new_registration_email (a_mail_address: STRING; u: CMS_USER; a_password: detachable like {CMS_USER}.password; a_extra: READABLE_STRING_8): NOTIFICATION_EMAIL
require require
has_clear_password: u.password /= Void or else a_password /= Void has_clear_password: u.password /= Void or else a_password /= Void
local local
@@ -202,7 +202,7 @@ feature -- Execution
create Result.make (service.site_email, a_mail_address, "Account details for " + u.name + " at " + service.site_name, b) create Result.make (service.site_email, a_mail_address, "Account details for " + u.name + " at " + service.site_name, b)
end end
new_user_account_email (a_mail_address: STRING; u: CMS_USER): CMS_EMAIL new_user_account_email (a_mail_address: STRING; u: CMS_USER): NOTIFICATION_EMAIL
local local
b: STRING b: STRING
opts: CMS_URL_API_OPTIONS opts: CMS_URL_API_OPTIONS

View File

@@ -8,7 +8,7 @@ class
CMS_STORAGE_MAILER CMS_STORAGE_MAILER
inherit inherit
CMS_MAILER NOTIFICATION_MAILER
create create
make make
@@ -30,7 +30,7 @@ feature -- Status
feature -- Basic operation feature -- Basic operation
process_email (a_email: CMS_EMAIL) process_email (a_email: NOTIFICATION_EMAIL)
do do
storage.save_email (a_email) storage.save_email (a_email)
end end

View File

@@ -259,7 +259,7 @@ feature -- Change: user_role
feature -- Email feature -- Email
save_email (a_email: CMS_EMAIL) save_email (a_email: NOTIFICATION_EMAIL)
local local
dn: STRING dn: STRING
fn: FILE_NAME fn: FILE_NAME

View File

@@ -130,7 +130,7 @@ feature -- Change: roles and permissions
feature -- Email feature -- Email
save_email (a_email: CMS_EMAIL) save_email (a_email: NOTIFICATION_EMAIL)
deferred deferred
end end

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<system xmlns="http://www.eiffel.com/developers/xml/configuration-1-8-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-8-0 http://www.eiffel.com/developers/xml/configuration-1-8-0.xsd" name="notification" uuid="99D9A065-CD45-4E20-9C86-579C8AD42E5E" library_target="notification">
<target name="notification">
<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="http" location="..\..\..\network\protocol\http\http-safe.ecf"/>
<library name="process" location="$ISE_LIBRARY\library\process\process-safe.ecf"/>
<library name="time" location="$ISE_LIBRARY\library\time\time-safe.ecf"/>
<cluster name="src" location="." recursive="true"/>
</target>
</system>

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<system xmlns="http://www.eiffel.com/developers/xml/configuration-1-8-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-8-0 http://www.eiffel.com/developers/xml/configuration-1-8-0.xsd" name="notification" uuid="99D9A065-CD45-4E20-9C86-579C8AD42E5E" library_target="notification">
<target name="notification">
<root all_classes="true"/>
<file_rule>
<exclude>/.git$</exclude>
<exclude>/EIFGENs$</exclude>
<exclude>/.svn$</exclude>
</file_rule>
<option warning="true" full_class_checking="true" void_safety="none" syntax="standard">
</option>
<library name="base" location="$ISE_LIBRARY\library\base\base.ecf"/>
<library name="http" location="..\..\..\network\protocol\http\http.ecf"/>
<library name="process" location="$ISE_LIBRARY\library\process\process.ecf"/>
<library name="time" location="$ISE_LIBRARY\library\time\time.ecf"/>
<cluster name="src" location="." recursive="true"/>
</target>
</system>

View File

@@ -1,14 +1,14 @@
note note
description: "Summary description for {CMS_CHAIN_MAILER}." description: "Summary description for {NOTIFICATION_CHAIN_MAILER}."
author: "" author: ""
date: "$Date$" date: "$Date$"
revision: "$Revision$" revision: "$Revision$"
class class
CMS_CHAIN_MAILER NOTIFICATION_CHAIN_MAILER
inherit inherit
CMS_MAILER NOTIFICATION_MAILER
create create
make make
@@ -22,9 +22,9 @@ feature {NONE} -- Initialization
feature -- Access feature -- Access
active: CMS_MAILER active: NOTIFICATION_MAILER
next: detachable CMS_MAILER next: detachable NOTIFICATION_MAILER
feature -- Status feature -- Status
@@ -45,7 +45,7 @@ feature -- Change
feature -- Basic operation feature -- Basic operation
process_email (a_email: CMS_EMAIL) process_email (a_email: NOTIFICATION_EMAIL)
do do
if active.is_available then if active.is_available then
active.process_email (a_email) active.process_email (a_email)

View File

@@ -7,7 +7,7 @@ note
revision : "$Revision$" revision : "$Revision$"
class class
CMS_EMAIL NOTIFICATION_EMAIL
create create
make make

View File

@@ -5,10 +5,10 @@ note
revision : "$Revision$" revision : "$Revision$"
class class
CMS_EXTERNAL_MAILER NOTIFICATION_EXTERNAL_MAILER
inherit inherit
CMS_MAILER NOTIFICATION_MAILER
-- SHARED_EXECUTION_ENVIRONMENT -- SHARED_EXECUTION_ENVIRONMENT
@@ -76,7 +76,7 @@ feature -- Change
feature -- Basic operation feature -- Basic operation
process_email (a_email: CMS_EMAIL) process_email (a_email: NOTIFICATION_EMAIL)
local local
l_factory: PROCESS_FACTORY l_factory: PROCESS_FACTORY
args: like arguments args: like arguments

View File

@@ -7,7 +7,7 @@ note
revision : "$Revision$" revision : "$Revision$"
deferred class deferred class
CMS_MAILER NOTIFICATION_MAILER
feature -- Status feature -- Status
@@ -18,7 +18,7 @@ feature -- Status
feature -- Basic operation feature -- Basic operation
process_emails (lst: ITERABLE [CMS_EMAIL]) process_emails (lst: ITERABLE [NOTIFICATION_EMAIL])
-- Process set of emails `lst' -- Process set of emails `lst'
require require
is_available is_available
@@ -30,7 +30,7 @@ feature -- Basic operation
end end
end end
safe_process_email (a_email: CMS_EMAIL) safe_process_email (a_email: NOTIFICATION_EMAIL)
-- Same as `process_email', but include the check of `is_available' -- Same as `process_email', but include the check of `is_available'
do do
if is_available then if is_available then
@@ -38,7 +38,7 @@ feature -- Basic operation
end end
end end
process_email (a_email: CMS_EMAIL) process_email (a_email: NOTIFICATION_EMAIL)
-- Process the sending of `a_email' -- Process the sending of `a_email'
require require
is_available is_available

View File

@@ -1,16 +1,16 @@
note note
description : "[ description : "[
CMS_MAILER using sendmail as mailtool NOTIFICATION_MAILER using sendmail as mailtool
]" ]"
author : "$Author$" author : "$Author$"
date : "$Date$" date : "$Date$"
revision : "$Revision$" revision : "$Revision$"
class class
CMS_SENDMAIL_MAILER NOTIFICATION_SENDMAIL_MAILER
inherit inherit
CMS_EXTERNAL_MAILER NOTIFICATION_EXTERNAL_MAILER
redefine redefine
default_create default_create
end end