[development] Data import and synchronization to nodes

Ken Rickard agentrickard at gmail.com
Tue Aug 28 13:08:10 UTC 2007

@Earnie: Take a look at the FeedAPI SoC project, it includes pluggable XML
parsing and node creation hooks.


My preference here is the old 'lazy instantiation' trick. [1]

Import the data and write a callback that will present the table view of
courses, etc.  You're dealing with structured data, so your callbacks
shouldl make it easy for people to browse the data (think MVC).

Keep a {data_node} lookup table.

When writing links for individual items, check the {data_node} table.  If
found, write the link to node/NID, otherwise, write it to a node-generating
callback that also inserts a record into {data_node}.

This way, you only create nodes when your users want to interact with them.
Saves lots of processing overhead.

I have some sample code if you need it.

One drawback: if you want the data to be searchable, you either have to
initiate your own hook_search, or wait for the nodes to be created.

- Ken

[1] http://barcelona2007.drupalcon.org/node/58

On 8/28/07, Earnie Boyd <earnie at users.sourceforge.net> wrote:
> Quoting Larry Garfield <larry at garfieldtech.com>:
> >
> > So, I toss the brain-teaser out there: Is there a good way to have my
> nodes
> > and import them too, or are these cases where nodes are simply the wrong
> tool
> > and the direct-import-and-cache mechanisms described above are the
> optimal
> > solutions?
> >
> Not that I've found and I've spent several hours recently researching
> this.  Chris Mellor and I have begun collaborating on this issue here
> http://portallink.linkmatics.com/gdf and have development staging here
> http://datafeed.progw.org.  Help is welcome, we want to be able to feed
> all types of external data.  Goals are being established and documented
> on the http://portallink.linkmatics.com/gdf pages.  *Note* we are aware
> of all the existing modules and API and our plans are to use the
> existing things as well as create what is missing.
> I've found http://drupal.org/project/feedparser which will accept RSS,
> RDF or ATOM feeds and create nodes or aggregated lists.  I am
> successfully using that module with a change documented in issue
> http://drupal.org/node/169865 at http://give-me-an-offer.com.
> Earnie
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/development/attachments/20070828/be4cd1fa/attachment.htm 

More information about the development mailing list