Item class has been moved to a new directory 'models', a new class has been added: ItemContent
and same fields from Item were moved to ItemContent Item - id - parent_id - type (file, dir, symlink) - url - subject - template (html template) - sort_index - content_id ItemContent - id - ref -> references (renamed) - user_id - modification_user_id - group_id - privileges - date_creation - date_modification - guest_name - link_to - link_redirect - file_path - file_fs - file_type - file_size - has_thumb -> file_has_thumb (renamed) - hash -> file_hash (renamed) - hash_type -> file_hash_type (renamed) - content -> content_raw (renamed) - content_type -> content_raw_type (renamed) - content_parsed - content_parsed_type - meta - ameta -> meta_admin (renamed) - modify_index (removed) WIP: #4
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2012-2014, Tomasz Sowa
|
||||
* Copyright (c) 2012-2021, Tomasz Sowa
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -68,7 +68,7 @@ void FunExport::ExportFile(const Item & item)
|
||||
{
|
||||
log << log4 << "Export: exporting file: url: " << item.url << ", id: " << item.id << logend;
|
||||
|
||||
if( item.file_type == WINIX_ITEM_FILETYPE_NONE )
|
||||
if( item.item_content.file_type == WINIX_ITEM_FILETYPE_NONE )
|
||||
{
|
||||
export_info->SendFile(item, false, true);
|
||||
}
|
||||
@@ -86,25 +86,36 @@ void FunExport::ExportDir(const Item & dir, bool static_files_too)
|
||||
|
||||
log << log4 << "Export: exporting directory: url: " << dir.url << ", id: " << dir.id << logend;
|
||||
|
||||
iq_dir.SetAll(false, false);
|
||||
iq_dir.sel_parent_id = true;
|
||||
iq_dir.sel_url = true;
|
||||
iq_dir.sel_file = true;
|
||||
iq_dir.WhereParentId(dir.id);
|
||||
iq_dir.WhereType(Item::file);
|
||||
// iq_dir.SetAll(false, false);
|
||||
// iq_dir.sel_parent_id = true;
|
||||
// iq_dir.sel_url = true;
|
||||
// iq_dir.sel_file = true;
|
||||
// iq_dir.WhereParentId(dir.id);
|
||||
// iq_dir.WhereType(Item::file);
|
||||
|
||||
|
||||
morm::Finder<Item> finder(model_connector);
|
||||
|
||||
finder.
|
||||
select().
|
||||
where().
|
||||
eq(L"parent_id", dir.id).
|
||||
eq(L"type", static_cast<int>(Item::file));
|
||||
|
||||
if( !static_files_too )
|
||||
iq_dir.WhereFileType(WINIX_ITEM_FILETYPE_NONE);
|
||||
{
|
||||
//iq_dir.WhereFileType(WINIX_ITEM_FILETYPE_NONE);
|
||||
finder.eq(L"content.file_type", WINIX_ITEM_FILETYPE_NONE);
|
||||
}
|
||||
|
||||
db->GetItems(dir_items, iq_dir);
|
||||
finder.get_vector(dir_items);
|
||||
//db->GetItems(dir_items, iq_dir);
|
||||
|
||||
for(size_t i=0 ; i<dir_items.size() ; ++i)
|
||||
{
|
||||
ExportFile(dir_items[i]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
DirContainer::ParentIterator i = system->dirs.FindFirstChild(dir.id);
|
||||
|
||||
for( ; i != system->dirs.ParentEnd() ; i = system->dirs.NextChild(i) )
|
||||
|
Reference in New Issue
Block a user