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:
@@ -23,6 +23,7 @@
|
||||
<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_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"/>
|
||||
</target>
|
||||
</system>
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
<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_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>
|
||||
</target>
|
||||
|
||||
@@ -57,7 +57,7 @@ feature -- Access
|
||||
auth_engine: CMS_AUTH_ENGINE
|
||||
-- CMS Authentication engine
|
||||
|
||||
mailer: CMS_MAILER
|
||||
mailer: NOTIFICATION_MAILER
|
||||
|
||||
feature {NONE} -- Initialization
|
||||
|
||||
@@ -115,12 +115,12 @@ feature {NONE} -- Initialization
|
||||
|
||||
build_mailer
|
||||
local
|
||||
ch_mailer: CMS_CHAIN_MAILER
|
||||
ch_mailer: NOTIFICATION_CHAIN_MAILER
|
||||
st_mailer: CMS_STORAGE_MAILER
|
||||
do
|
||||
create st_mailer.make (storage)
|
||||
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
|
||||
end
|
||||
|
||||
|
||||
@@ -413,7 +413,7 @@ feature -- Content type
|
||||
|
||||
feature -- Notification
|
||||
|
||||
mailer: CMS_MAILER
|
||||
mailer: NOTIFICATION_MAILER
|
||||
|
||||
feature -- Core Execution
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ feature -- Access
|
||||
deferred
|
||||
end
|
||||
|
||||
mailer: CMS_MAILER
|
||||
mailer: NOTIFICATION_MAILER
|
||||
-- CMS email engine
|
||||
deferred
|
||||
end
|
||||
|
||||
@@ -75,7 +75,7 @@ feature -- Execution
|
||||
|
||||
password_form_submit (fd: WSF_FORM_DATA; b: STRING)
|
||||
local
|
||||
e: detachable CMS_EMAIL
|
||||
e: detachable NOTIFICATION_EMAIL
|
||||
l_uuid: UUID
|
||||
do
|
||||
debug
|
||||
@@ -144,7 +144,7 @@ feature -- Execution
|
||||
Result := f
|
||||
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
|
||||
b: STRING
|
||||
opts: CMS_URL_API_OPTIONS
|
||||
|
||||
@@ -73,7 +73,7 @@ feature -- Execution
|
||||
b: STRING
|
||||
u: detachable CMS_USER
|
||||
up: detachable CMS_USER_PROFILE
|
||||
e: detachable CMS_EMAIL
|
||||
e: detachable NOTIFICATION_EMAIL
|
||||
l_pass: detachable READABLE_STRING_32
|
||||
l_uuid: UUID
|
||||
do
|
||||
@@ -174,7 +174,7 @@ feature -- Execution
|
||||
Result := f
|
||||
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
|
||||
has_clear_password: u.password /= Void or else a_password /= Void
|
||||
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)
|
||||
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
|
||||
b: STRING
|
||||
opts: CMS_URL_API_OPTIONS
|
||||
|
||||
@@ -8,7 +8,7 @@ class
|
||||
CMS_STORAGE_MAILER
|
||||
|
||||
inherit
|
||||
CMS_MAILER
|
||||
NOTIFICATION_MAILER
|
||||
|
||||
create
|
||||
make
|
||||
@@ -30,7 +30,7 @@ feature -- Status
|
||||
|
||||
feature -- Basic operation
|
||||
|
||||
process_email (a_email: CMS_EMAIL)
|
||||
process_email (a_email: NOTIFICATION_EMAIL)
|
||||
do
|
||||
storage.save_email (a_email)
|
||||
end
|
||||
|
||||
@@ -259,7 +259,7 @@ feature -- Change: user_role
|
||||
|
||||
feature -- Email
|
||||
|
||||
save_email (a_email: CMS_EMAIL)
|
||||
save_email (a_email: NOTIFICATION_EMAIL)
|
||||
local
|
||||
dn: STRING
|
||||
fn: FILE_NAME
|
||||
|
||||
@@ -130,7 +130,7 @@ feature -- Change: roles and permissions
|
||||
|
||||
feature -- Email
|
||||
|
||||
save_email (a_email: CMS_EMAIL)
|
||||
save_email (a_email: NOTIFICATION_EMAIL)
|
||||
deferred
|
||||
end
|
||||
|
||||
|
||||
18
library/runtime/process/notification/notification-safe.ecf
Normal file
18
library/runtime/process/notification/notification-safe.ecf
Normal 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>
|
||||
18
library/runtime/process/notification/notification.ecf
Normal file
18
library/runtime/process/notification/notification.ecf
Normal 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>
|
||||
@@ -1,14 +1,14 @@
|
||||
note
|
||||
description: "Summary description for {CMS_CHAIN_MAILER}."
|
||||
description: "Summary description for {NOTIFICATION_CHAIN_MAILER}."
|
||||
author: ""
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
class
|
||||
CMS_CHAIN_MAILER
|
||||
NOTIFICATION_CHAIN_MAILER
|
||||
|
||||
inherit
|
||||
CMS_MAILER
|
||||
NOTIFICATION_MAILER
|
||||
|
||||
create
|
||||
make
|
||||
@@ -22,9 +22,9 @@ feature {NONE} -- Initialization
|
||||
|
||||
feature -- Access
|
||||
|
||||
active: CMS_MAILER
|
||||
active: NOTIFICATION_MAILER
|
||||
|
||||
next: detachable CMS_MAILER
|
||||
next: detachable NOTIFICATION_MAILER
|
||||
|
||||
feature -- Status
|
||||
|
||||
@@ -45,7 +45,7 @@ feature -- Change
|
||||
|
||||
feature -- Basic operation
|
||||
|
||||
process_email (a_email: CMS_EMAIL)
|
||||
process_email (a_email: NOTIFICATION_EMAIL)
|
||||
do
|
||||
if active.is_available then
|
||||
active.process_email (a_email)
|
||||
@@ -7,7 +7,7 @@ note
|
||||
revision : "$Revision$"
|
||||
|
||||
class
|
||||
CMS_EMAIL
|
||||
NOTIFICATION_EMAIL
|
||||
|
||||
create
|
||||
make
|
||||
@@ -5,10 +5,10 @@ note
|
||||
revision : "$Revision$"
|
||||
|
||||
class
|
||||
CMS_EXTERNAL_MAILER
|
||||
NOTIFICATION_EXTERNAL_MAILER
|
||||
|
||||
inherit
|
||||
CMS_MAILER
|
||||
NOTIFICATION_MAILER
|
||||
|
||||
-- SHARED_EXECUTION_ENVIRONMENT
|
||||
|
||||
@@ -76,7 +76,7 @@ feature -- Change
|
||||
|
||||
feature -- Basic operation
|
||||
|
||||
process_email (a_email: CMS_EMAIL)
|
||||
process_email (a_email: NOTIFICATION_EMAIL)
|
||||
local
|
||||
l_factory: PROCESS_FACTORY
|
||||
args: like arguments
|
||||
@@ -7,7 +7,7 @@ note
|
||||
revision : "$Revision$"
|
||||
|
||||
deferred class
|
||||
CMS_MAILER
|
||||
NOTIFICATION_MAILER
|
||||
|
||||
feature -- Status
|
||||
|
||||
@@ -18,7 +18,7 @@ feature -- Status
|
||||
|
||||
feature -- Basic operation
|
||||
|
||||
process_emails (lst: ITERABLE [CMS_EMAIL])
|
||||
process_emails (lst: ITERABLE [NOTIFICATION_EMAIL])
|
||||
-- Process set of emails `lst'
|
||||
require
|
||||
is_available
|
||||
@@ -30,7 +30,7 @@ feature -- Basic operation
|
||||
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'
|
||||
do
|
||||
if is_available then
|
||||
@@ -38,7 +38,7 @@ feature -- Basic operation
|
||||
end
|
||||
end
|
||||
|
||||
process_email (a_email: CMS_EMAIL)
|
||||
process_email (a_email: NOTIFICATION_EMAIL)
|
||||
-- Process the sending of `a_email'
|
||||
require
|
||||
is_available
|
||||
@@ -1,16 +1,16 @@
|
||||
note
|
||||
description : "[
|
||||
CMS_MAILER using sendmail as mailtool
|
||||
NOTIFICATION_MAILER using sendmail as mailtool
|
||||
]"
|
||||
author : "$Author$"
|
||||
date : "$Date$"
|
||||
revision : "$Revision$"
|
||||
|
||||
class
|
||||
CMS_SENDMAIL_MAILER
|
||||
NOTIFICATION_SENDMAIL_MAILER
|
||||
|
||||
inherit
|
||||
CMS_EXTERNAL_MAILER
|
||||
NOTIFICATION_EXTERNAL_MAILER
|
||||
redefine
|
||||
default_create
|
||||
end
|
||||
Reference in New Issue
Block a user