When importing, do not change modification date.

Display /nodes sorted by changed date.
Improved the import form, and report wrong import folder. Only import from folder inside site/import for security reason.
This commit is contained in:
2017-01-27 23:12:02 +01:00
parent 2568e85c59
commit 32a47fbba3
15 changed files with 95 additions and 48 deletions

View File

@@ -147,6 +147,12 @@ feature -- Commit
node_api.save_node (a_page)
end
import_page (a_page: CMS_PAGE)
-- Save `a_page` without changing the modification date.
do
node_api.import_node (a_page)
end
feature {CMS_MODULE} -- Access nodes storage.
page_storage: CMS_PAGE_STORAGE_I

View File

@@ -295,7 +295,7 @@ feature -- Hooks
l_parentable_list.extend ([l_entity, l_parent])
l_entity.set_parent (Void)
end
l_page_api.save_page (l_entity)
l_page_api.import_page (l_entity)
apply_taxonomy_to_node (j, l_entity, l_page_api.cms_api)
l_new_pages.force (l_entity, l_node_api.node_path (l_entity))
a_import_ctx.log (l_node_type.name + " %"" + fp.utf_8_name + "%" imported as "+ l_entity.id.out +" for user #" + l_author.id.out + ".")
@@ -329,12 +329,14 @@ feature -- Hooks
update_page_parent (l_entity, ic.item.parent, l_new_pages)
if attached l_entity.parent as l_parent then
a_import_ctx.log (l_node_type.name + " #" + l_entity.id.out + " assigned to parent #" + l_parent.id.out)
l_page_api.save_page (l_entity)
l_page_api.import_page (l_entity)
else
a_import_ctx.log (l_node_type.name + " #" + l_entity.id.out + " : unable to find parent!")
end
end
end
else
a_import_ctx.log ("Importing [" + l_node_type.name + "] NOT ALLOWED!")
end
end
end