Provide a default CMS_MODULE.is_installed: BOOLEAN implementation based on storage of custom value.
Now use CMS_MODULE.is_initialized: BOOLEAN as precondition of many routines. Instantiation of node storage is now done in NODE_MODULE and not any more in CMS_NODE_API. CMS_NODE_API can be instantiated only by NODE_MODULE.
This commit is contained in:
@@ -16,20 +16,21 @@ inherit
|
||||
|
||||
REFACTORING_HELPER
|
||||
|
||||
create
|
||||
make
|
||||
create {NODE_MODULE}
|
||||
make_with_storage
|
||||
|
||||
feature {NONE} -- Implementation
|
||||
feature {NONE} -- Initialization
|
||||
|
||||
make_with_storage (a_api: CMS_API; a_node_storage: CMS_NODE_STORAGE_I)
|
||||
do
|
||||
node_storage := a_node_storage
|
||||
make (a_api)
|
||||
end
|
||||
|
||||
initialize
|
||||
-- <Precursor>
|
||||
do
|
||||
Precursor
|
||||
if attached {CMS_STORAGE_SQL_I} storage as l_storage_sql then
|
||||
create {CMS_NODE_STORAGE_SQL} node_storage.make (l_storage_sql)
|
||||
else
|
||||
create {CMS_NODE_STORAGE_NULL} node_storage.make
|
||||
end
|
||||
initialize_node_types
|
||||
end
|
||||
|
||||
@@ -212,7 +213,6 @@ feature -- Access: Node
|
||||
Result := node_storage.nodes
|
||||
end
|
||||
|
||||
|
||||
trashed_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
|
||||
|
||||
Reference in New Issue
Block a user