Added summary and categories to recent change item.
This commit is contained in:
@@ -362,6 +362,16 @@ feature -- Hooks
|
|||||||
end
|
end
|
||||||
ch.set_information (l_info)
|
ch.set_information (l_info)
|
||||||
ch.set_author (n.author)
|
ch.set_author (n.author)
|
||||||
|
ch.set_summary (n.summary)
|
||||||
|
if attached {CMS_TAXONOMY_API} l_node_api.cms_api.module_api ({CMS_TAXONOMY_MODULE}) as l_taxonomy_api then
|
||||||
|
if attached l_taxonomy_api.terms_of_content (n, Void) as l_terms then
|
||||||
|
across
|
||||||
|
l_terms as t_ic
|
||||||
|
loop
|
||||||
|
ch.add_category (t_ic.item.text)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
a_changes.force (ch)
|
a_changes.force (ch)
|
||||||
else
|
else
|
||||||
-- Forbidden
|
-- Forbidden
|
||||||
|
|||||||
@@ -39,6 +39,12 @@ feature -- Access
|
|||||||
source: READABLE_STRING_8
|
source: READABLE_STRING_8
|
||||||
-- Source of Current event.
|
-- Source of Current event.
|
||||||
|
|
||||||
|
categories: detachable LIST [READABLE_STRING_GENERAL]
|
||||||
|
-- Optional categories (tags, terms) related to associated content.
|
||||||
|
|
||||||
|
summary: detachable READABLE_STRING_32
|
||||||
|
-- Optional summary related to associated content.
|
||||||
|
|
||||||
information: detachable READABLE_STRING_8
|
information: detachable READABLE_STRING_8
|
||||||
-- Optional information related to Current event.
|
-- Optional information related to Current event.
|
||||||
--| For instance: creation, trashed, modified, ...
|
--| For instance: creation, trashed, modified, ...
|
||||||
@@ -60,12 +66,30 @@ feature -- Element change
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
set_summary (a_summary: like summary)
|
||||||
|
-- Set `summary' to `a_summary'.
|
||||||
|
do
|
||||||
|
summary := a_summary
|
||||||
|
end
|
||||||
|
|
||||||
set_information (a_info: like information)
|
set_information (a_info: like information)
|
||||||
-- Set `information' to `a_info'.
|
-- Set `information' to `a_info'.
|
||||||
do
|
do
|
||||||
information := a_info
|
information := a_info
|
||||||
end
|
end
|
||||||
|
|
||||||
|
add_category (a_cat: READABLE_STRING_GENERAL)
|
||||||
|
local
|
||||||
|
cats: like categories
|
||||||
|
do
|
||||||
|
cats := categories
|
||||||
|
if cats = Void then
|
||||||
|
create {ARRAYED_LIST [READABLE_STRING_GENERAL]} cats.make (1)
|
||||||
|
categories := cats
|
||||||
|
end
|
||||||
|
cats.force (a_cat)
|
||||||
|
end
|
||||||
|
|
||||||
feature -- Comparison
|
feature -- Comparison
|
||||||
|
|
||||||
is_less alias "<" (other: like Current): BOOLEAN
|
is_less alias "<" (other: like Current): BOOLEAN
|
||||||
|
|||||||
@@ -107,6 +107,7 @@ feature -- Hook
|
|||||||
l_feed_item: FEED_ITEM
|
l_feed_item: FEED_ITEM
|
||||||
lnk: FEED_LINK
|
lnk: FEED_LINK
|
||||||
nb: NATURAL_32
|
nb: NATURAL_32
|
||||||
|
s: STRING_32
|
||||||
do
|
do
|
||||||
l_user := Void -- Public access for the feed!
|
l_user := Void -- Public access for the feed!
|
||||||
create l_changes.make (a_size, create {DATE_TIME}.make_now_utc, a_source)
|
create l_changes.make (a_size, create {DATE_TIME}.make_now_utc, a_source)
|
||||||
@@ -137,8 +138,25 @@ feature -- Hook
|
|||||||
ch := ic.item
|
ch := ic.item
|
||||||
create l_feed_item.make (ch.link.title)
|
create l_feed_item.make (ch.link.title)
|
||||||
l_feed_item.set_date (ch.date)
|
l_feed_item.set_date (ch.date)
|
||||||
l_feed_item.set_description (ch.information)
|
|
||||||
l_feed_item.set_category (ch.source)
|
create s.make_empty
|
||||||
|
if attached ch.information as l_information then
|
||||||
|
s.append (l_information)
|
||||||
|
end
|
||||||
|
if attached ch.summary as sum then
|
||||||
|
if not s.is_empty then
|
||||||
|
s.append ("%N%N")
|
||||||
|
end
|
||||||
|
s.append (sum)
|
||||||
|
end
|
||||||
|
l_feed_item.set_description (s)
|
||||||
|
if attached ch.categories as lst then
|
||||||
|
across
|
||||||
|
lst as cats_ic
|
||||||
|
loop
|
||||||
|
l_feed_item.set_category (cats_ic.item)
|
||||||
|
end
|
||||||
|
end
|
||||||
create lnk.make (a_response.absolute_url (ch.link.location, Void))
|
create lnk.make (a_response.absolute_url (ch.link.location, Void))
|
||||||
l_feed_item.links.force (lnk, "")
|
l_feed_item.links.force (lnk, "")
|
||||||
l_feed.extend (l_feed_item)
|
l_feed.extend (l_feed_item)
|
||||||
|
|||||||
Reference in New Issue
Block a user