Updated table node to use status (1:not_published, 2:published, 3:trash )instead of deleted_at to implement soft deletes.

Updated queries to use the new status field.
Updated CMS_NODE with a new status attribute.
This commit is contained in:
jvelilla
2015-05-11 16:38:51 -03:00
parent c2d0fbf445
commit e767e1bc47
5 changed files with 83 additions and 12 deletions

View File

@@ -35,6 +35,7 @@ feature{NONE} -- Initialization
set_creation_date (l_time)
set_modification_date (l_time)
set_publication_date (l_time)
mark_not_published
debug ("refactor_fixme")
fixme ("Remove default harcoded format")
@@ -60,6 +61,7 @@ feature -- Conversion
a_node.summary,
a_node.format
)
set_status (a_node.status)
end
feature -- Access
@@ -78,6 +80,10 @@ feature -- Access
deferred
end
status: INTEGER
-- Associated status for the current node
-- [{1,Not_Published}, {2, Published}, {3, Trash}]
feature -- Access
title: READABLE_STRING_32
@@ -211,6 +217,41 @@ feature -- Element change
auther_set: author = u
end
mark_not_published
-- Set status to not_published
do
set_status ({CMS_NODE_CONSTANTS}.not_published)
ensure
status_not_published: status = {CMS_NODE_CONSTANTS}.not_published
end
mark_published
-- Set status to published
do
set_status ({CMS_NODE_CONSTANTS}.published)
ensure
status_published: status = {CMS_NODE_CONSTANTS}.published
end
mark_trash
-- Set status to published
do
set_status ({CMS_NODE_CONSTANTS}.trash)
ensure
status_trash: status = {CMS_NODE_CONSTANTS}.trash
end
feature {NONE} -- Implementation
set_status (a_status: like status)
-- Assign `status' with `a_status'
do
status := a_status
ensure
status_set: status = a_status
end
note
copyright: "2011-2015, Javier Velilla, Jocelyn Fiat, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"

View File

@@ -0,0 +1,17 @@
note
description: "Node Status Not-Published, Published and Trash"
date: "$Date$"
revision: "$Revision$"
class
CMS_NODE_CONSTANTS
Feature
Not_published: INTEGER = 1
Published: INTEGER = 2
Trash: INTEGER = 3
end