Dec 04, 2008, 12:10 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
Search via SMF or Google: modx forums all of modxcms.com web
  MODxCMS.com   Forums   Help Login Register  
News:Donate to MODx: Donations
Pages: [1] 2   Go Down
  Print  
Author Topic: [Module] fast_content_csv  (Read 5137 times)
0 Members and 1 Guest are viewing this topic.
SamZ
Sr. Member
****
Posts: 401


всегда ищу работу :-)


WWW
« on: May 31, 2007, 03:42 AM »

fast_content_csv_v03
Sample of csv file in attachment.

Module to import data from csv files
1. Save with code as a new module with name fast_content_csv
2. Copy file "data.csv" to your /assets/files/ folder
4. Change t_catalog and t_tovar to your value ( or set them to 1.)
5. Than just insert parent id and filename and push "Run"
p.s. You can use debug mode(debug=1) to run module without inserting data into Data Base
You can use delete param

* fast_content_035.zip (2.58 KB - downloaded 336 times.)
* fast_content_035.tgz (2.35 KB - downloaded 168 times.)
« Last Edit: Dec 14, 2007, 04:24 PM by SamZ » Logged

[MODULE] CSV IMPORT :: модуль для добавления больших каталогов, из файлов с разделителями, с сохранением древовидной структуры. russian english


[FAQ] MODX 096
(основные проблемы и способы их решения)
Dimmy
Testers
*
Posts: 1,827


Я не говорю по-русски 私は日本語を話さない


WWW
« Reply #1 on: May 31, 2007, 05:14 AM »

Nice, in what order does de cvs needs to be? and is it also posible to export to cvs?

Logged

"They say if you play a Microsoft CD backwards, you hear satanic messages. That's nothing, because if you play it forwards, it installs Windows."
Nederlands beste portal voor pda en mobiel internet
SamZ
Sr. Member
****
Posts: 401


всегда ищу работу :-)


WWW
« Reply #2 on: May 31, 2007, 07:17 AM »

Nice, in what order does de cvs needs to be?
cvs file in attachment
samething like this.
Code:
parent1;
;child 1
;child 2
;child 3
parent2;
;child 1
;child 2
;child 3
parent3;
;child 1
;child 2
;child 3
where parent1and child1 = pagetitle

and is it also posible to export to cvs?
Not now. But it is not difficult to realise. May be layter.

« Last Edit: May 31, 2007, 07:20 AM by SamZ » Logged

[MODULE] CSV IMPORT :: модуль для добавления больших каталогов, из файлов с разделителями, с сохранением древовидной структуры. russian english


[FAQ] MODX 096
(основные проблемы и способы их решения)
SamZ
Sr. Member
****
Posts: 401


всегда ищу работу :-)


WWW
« Reply #3 on: Jun 05, 2007, 11:41 AM »

New version is available.
bug fix
+ add "content" fild

Code:
parent1;
;child 1;content1
;child 2;content2
;child 3;content3
parent2;
;child 1;content1
;child 2;content2
;child 3;content3
parent3;
;child 1;content1
;child 2;content2
;child 3;content3
where
parent - pagetitle of parent page
child - pagetitle of child page
content - content of child page
Logged

[MODULE] CSV IMPORT :: модуль для добавления больших каталогов, из файлов с разделителями, с сохранением древовидной структуры. russian english


[FAQ] MODX 096
(основные проблемы и способы их решения)
SamZ
Sr. Member
****
Posts: 401


всегда ищу работу :-)


WWW
« Reply #4 on: Jun 07, 2007, 12:01 AM »

If samebody had test my module, I an waiting for bug report.
And wish list
Logged

[MODULE] CSV IMPORT :: модуль для добавления больших каталогов, из файлов с разделителями, с сохранением древовидной структуры. russian english


[FAQ] MODX 096
(основные проблемы и способы их решения)
lukwe
Full Member
***
Posts: 176



WWW
« Reply #5 on: Jun 21, 2007, 04:00 AM »

Hi, very interesting module, congrats!

I did not have a chance to test it, but I think the natural evolution of this would be to include in the CSV the whole set of controls found in the editing page for a document, i.e. published/cacheable, DocGroups, TVs, keywords..
Logged

----------------------------------------------------------
http://www.linkedin.com/in/lucapost
----------------------------------------------------------
SamZ
Sr. Member
****
Posts: 401


всегда ищу работу :-)


WWW
« Reply #6 on: Aug 12, 2007, 03:49 AM »

Hi, very interesting module, congrats!

I did not have a chance to test it, but I think the natural evolution of this would be to include in the CSV the whole set of controls found in the editing page for a document, i.e. published/cacheable, DocGroups, TVs, keywords..

New version of module fast_content_csv.zip is avalabel. It supports TV.
Logged

[MODULE] CSV IMPORT :: модуль для добавления больших каталогов, из файлов с разделителями, с сохранением древовидной структуры. russian english


[FAQ] MODX 096
(основные проблемы и способы их решения)
rthrash
Foundation
*
Posts: 9,577



WWW
« Reply #7 on: Aug 13, 2007, 09:04 AM »

Excellent news SamZ ... this is a very handy module indeed. I hope to test soon. Thanks!
Logged

MODx is a framework that allows web professionals to turn over sites to end-users for daily maintenance without worrying. Community participation and questions are encouraged, especially when you help us help you, read the wiki, and review snippet parameters – even if you have to look at the source. Searching the forums helps, too.
Ryan Thrash
MODx Co-Founder
Principal @ Collabpad
work productively.
work intelligently.
work together.
AndreasT
Member
**
Posts: 84


« Reply #8 on: Dec 14, 2007, 03:43 PM »

This is very interesting.

The sample file seems very limited and the text is unreadable, is it possible for you to provide a more complete sample file with examples of all the fields supported, preferably in english please?

Thanks.

Cheers,

Andreas
Logged
sottwell
Documentation Team
*
Posts: 8,170



WWW
« Reply #9 on: Dec 14, 2007, 03:59 PM »

I would put each field through $modx->db->escape(), and would also use trim() instead of the ereg_replace:
Code:
 
$parent_title = $modx->db->escape(trim($parent_title));
$page_title = $modx->db->escape(trim($page_title));
Logged

sottwell.com has moved to a lovely Solaris 10 server!
Log in username guest, password guestuser.
Templates are now becoming available at http://sottwell.com/templates.html
SamZ
Sr. Member
****
Posts: 401


всегда ищу работу :-)


WWW
« Reply #10 on: Dec 14, 2007, 04:09 PM »

I would put each field through $modx->db->escape(), and would also use trim() instead of the ereg_replace:
Code:
 
$parent_title = $modx->db->escape(trim($parent_title));
$page_title = $modx->db->escape(trim($page_title));

I use this module just by my self.
Because of that I don't use esceping.
And row php function works more fast. I understood it when was working on complex import from text files (4 files about 3mb size) to MODX 5000doc and 400000tv _http://kipby.com/test/  Smiley
« Last Edit: Dec 15, 2007, 06:07 AM by SamZ » Logged

[MODULE] CSV IMPORT :: модуль для добавления больших каталогов, из файлов с разделителями, с сохранением древовидной структуры. russian english


[FAQ] MODX 096
(основные проблемы и способы их решения)
Bruno17
Full Member
***
Posts: 143


« Reply #11 on: Sep 23, 2008, 01:29 AM »

Have Rewritten this usefull module for me and for everbody, who wants to use it.

module:fast_content_csv
Rewritten by Bruno b.perner@gmx.de
First Release by SamZ samz@fromru.com
v.05
Module to import data from csv files
1. Upload the files in /assets/modules
1. Save this code as a new module with name fast_content_csv
2. Copy csv files to your /assets/files/folder
3. Start the module
4. Than just insert parent id and defaults in default.csv (you can do it in the module) and save it
5. Choose the source-file and the template, if not in default.csv or your csv-file from dropdown
6. Push the Button Get Fields
7. In the next form choose the fields you want to insert or update, if not autodetected or choose ----empty if you not want to update this field
8. Make sure to choose update or insert and you are not in Testmode (checkbox) and pusch RUN
TIP: You can generate CSV-files from documents and its TVs easy with Ditto
##################################
changelog:
#
Release v05 Bruno b.perner@gmx.de
New:
fast_content_csv.class.inc.php
autodetect fieldnames for docs and TVs from first line
drop-downs to set fields manually
drop-down for csv-files and templates
use defaults from default.csv
change and save values of defaults.csv directly in the module
update docs and TVs from csv with given docid
and some little features more.
#
Release v035 by SamZ samz@fromru.com
###################################

*/

You can download my version here: http://modxcms.com/forums/index.php/topic,29616.msg180038.html#msg180038
« Last Edit: Oct 10, 2008, 02:14 PM by Bruno17 » Logged

a.tuzhilkin
Full Member
***
Posts: 236



« Reply #12 on: Sep 23, 2008, 02:41 AM »

bad archive! reload plz.
Logged

Bruno17
Full Member
***
Posts: 143


« Reply #13 on: Sep 23, 2008, 02:51 AM »

did download it and opened it without problems.
anybody else?
Logged

AndreasT
Member
**
Posts: 84


« Reply #14 on: Sep 23, 2008, 02:59 AM »

Worked fine for me. Unzipped without issues. Haven't testet it yet tho.

Cheers,

Andreas
Logged
Pages: [1] 2   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP

Copyright © 2005-2008 MODxCMS, All rights reserved. Contact Us
Styles by ziworks.com

Powered by SMF 1.1.4 | SMF © 2005, Simple Machines LLC

Valid XHTML 1.0! Valid CSS!