Creating content programmatically

6 posts / 0 new
Last post
Creating content programmatically

Is it possible to create content including file uploading programmaticaly, like api?

I need to move content from old non drupal application to drupal one.

Yes, it's possible. I would

Yes, it's possible. I would suggest to have a look at the book Pro Drupal 7 Development (VanDyk, Westgate, Tomlinson) where it's well explained how to create content programmatically. There should be one available in the library.

Note that some node import/export modules already exist: they could help you with your migration. It depends on what kind of format your data is available.

If you give me more details maybe I could be more helpful.

I have documents in docdb and

I have documents in docdb and I can get information from there as xml with links to attached files and I need to create content in drupal using this information: set basic fields, set taxonomy terms, upload files.

Feeds and XPath Parser

I would have a look at Feeds with Feeds XPath Parser before starting coding.

Feeds allows you to import content from different formats, depending on the parser selected (Feeds XPath Parser implements the XML parser) to Drupal nodes, allowing you to map XML attributes to various Drupal fields and taxonomy terms.

I've never tried Feeds with XML parser, but I have tried it (and it's working great) with the JSON parser. I managed to map these attributes to text, date (from a timestamp), link (URL+title in two separated JSON attributes) and image (from the img URL) fields.

Hope this helps!

Hi,

Hi,

Sorry to answer a bit late; I just noticed that the ENTICE comments RSS URL has changed. I have some experience with Feeds XPath Parser: a Drupal website importing XML from another site and creating nodes in a pretty complex way (combining several XML elements into a Drupal field, conditions, etc.).

If you need help, please tell me.

Cheers, David

Solution

Finally I used services to get information and restws to create nodes and terms, maybe this will help someone.

Log in to post comments

You are here