Re: Logical architecture for importing CSV or other files?

2007-02-18 Thread [EMAIL PROTECTED]

Why not building a CsvSource extending DataSource ? Maybe this even
already exists because this is something many people could use.
Then you could build models using this CsvSource


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Logical architecture for importing CSV or other files?

2007-02-17 Thread Joe Crawford

So I'm working on an application that has as one of its parts
accepting leads from external entities. We get these as emails in a
quasi CSV format (I'm trying to get a better format, XML maybe, but it
seems unlikely). I wrote some code in PHP to parse these to create SQL
statements to insert this data into a leads table --

The question I have  is this - what's the best way to manage this? I'd
like to do the parsing application in cake - basically a tool to
report what files are imported and which have yet to be imported -- is
there a preferred architecture here?

Sorry this is so scattered, I'm thinking I just want the parser to be
outside of Cake - but if I can think of a way to do it (or if you can
think of a way! *grin* in Cake then I want to do that.

Joe
--
http://joecrawford.com/
805-857-3951

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



RE: Logical architecture for importing CSV or other files?

2007-02-17 Thread Mariano Iglesias

Why not just build it as a component and from the component while importing
populate your Cake models?

-MI

---

Remember, smart coders answer ten questions for every question they ask. 
So be smart, be cool, and share your knowledge. 

BAKE ON!

blog: http://www.MarianoIglesias.com.ar

-Mensaje original-
De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre
de Joe Crawford
Enviado el: Sábado, 17 de Febrero de 2007 03:48 p.m.
Para: cake-php@googlegroups.com
Asunto: Logical architecture for importing CSV or other files?

So I'm working on an application that has as one of its parts
accepting leads from external entities. We get these as emails in a
quasi CSV format (I'm trying to get a better format, XML maybe, but it
seems unlikely). I wrote some code in PHP to parse these to create SQL
statements to insert this data into a leads table --


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Logical architecture for importing CSV or other files?

2007-02-17 Thread Joe Crawford

On 2/17/07, Mariano Iglesias [EMAIL PROTECTED] wrote:
 Why not just build it as a component and from the component while importing
 populate your Cake models?

That sounds promising. I'll dive into the components documentation.

Thanks!

Joe

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



RE: Logical architecture for importing CSV or other files?

2007-02-17 Thread Mariano Iglesias

It's a very simple thing, really. Something like this to give you an idea:

class CsvImporterComponent extends Object
{
var $controller;
var $uses = array ('Model');

function startup($controller)
{
$this-controller = $controller;
}

function import($csvFile)
{
// Do your thing and use $this-Model to save to your model
}
}

Then on your controller you do:

var $components = array('CsvImporter');

and somewhere in there:

$this-CsvImporter-import('myfile.csv');

-MI

---

Remember, smart coders answer ten questions for every question they ask. 
So be smart, be cool, and share your knowledge. 

BAKE ON!

blog: http://www.MarianoIglesias.com.ar


-Mensaje original-
De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre
de Joe Crawford
Enviado el: Sábado, 17 de Febrero de 2007 06:32 p.m.
Para: cake-php@googlegroups.com
Asunto: Re: Logical architecture for importing CSV or other files?

That sounds promising. I'll dive into the components documentation.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---