Added trash feature: Remove or revert a node.

Added Handler to show the current trash nodes for a given user.
An admin can see all the trash nodes.
Updated storage to handle trash and revert nodes.
This commit is contained in:
jvelilla
2015-05-14 11:07:15 -03:00
parent 57bf5ad0dc
commit 9fbadac7ac
10 changed files with 401 additions and 13 deletions

View File

@@ -212,6 +212,14 @@ feature -- Access: Node
Result := node_storage.nodes
end
trash_nodes (a_user: CMS_USER): LIST [CMS_NODE]
-- List of nodes with status in {CMS_NODE_API}.trashed.
-- if the current user is admin, it will retrieve all the trashed nodes
do
Result := node_storage.trash_nodes (a_user.id)
end
recent_nodes (a_offset, a_rows: INTEGER): LIST [CMS_NODE]
-- List of the `a_rows' most recent nodes starting from `a_offset'.
do
@@ -316,6 +324,21 @@ feature -- Change: Node
node_storage.update_node (a_node)
end
trash_node (a_node: CMS_NODE)
-- Trash node `a_node'.
--! remove the node from the storage.
do
node_storage.trash_node (a_node)
end
revert_node (a_node: CMS_NODE)
-- Revert node `a_node'.
-- From {CMS_NODE_API}.trashed to {CMS_NODE_API}.not_published.
do
node_storage.revert_node (a_node)
end
feature -- Node status