hi everyone,
i m new to development, till now i have been using contributed modules only but a (hard)time has come to design a module of my own, so though of elaborating it here before starting,

Goal:- i need a AUTO importer:

motive:- it fetches a csv, tsv(or xls if psbl) file (and detects content type) and adds it into respective database table of site rather creates node:

features required:-

It should first compare whether data being imported is existing in DB?? yes or no
If existing it should ask (Prompt), for confirmation like " Do u want to Replace or Merge?"

here is a pictorial representation: http://flic.kr/p/cj3j1u

Current status:- Right now i have tried feeds to import data in form of a node but it doesn't have this features,but i think it can be modified to have this function..

queries:-

  • Is such module Possible in drupal??
  • and can it be done by editing feeds or have to be written from scratch
  • Or are there other (easier)ways to do this?
  • Can anybody help me?? (please)

Problems:-
1. I m basically a electrical engineer student,This is my first website (hence 1st drupal website) so i m not good with coding
2. I dont know drupal API :(
3. I dont know where to start from :(

Comments

johnv’s picture

Hi Rathin,
the most part you can do with Feeds. But Feeds will not discover the node type itself. You must decide by which Importer the file will be processed.
Also the merge/replace question is already fixed in the importer. But you might replace that with a pop-up dialog.
Perhaps these modules may help: Feeds Tamper, Mover.

But if your process involves a pop-up dialog, this means a user is present, so you can present the user N importers, from which he can choose.

rathin2j’s picture

hi sir,
thank u very much for ur suggestion.. yes i know majority of the functions are handled by feeds,but how is it merge/replace question fixed in importer?? is it possible to choose whether to merge or replace?? ya i know that importer setting is having his option of "do nothing", "update node" and "replace".. is there any other way?? please do guide me...

and ya, feeds_tamper is awesome module,i m using it also,well didn't knew move, wil try that one, and by the way is there a way to make more then one field comparable,rather "Unique target"??

along with that as u said yes, there exist a user(me :) to start and do the process,so it's not totally AUTOMATIC!! ;)

but the problem is i dont know how to "pop up" those things :-D hehehe

johnv’s picture

As far as I know, the option you found (option of "do nothing", "update node" and "replace"..) is the correct one.

On the page /import, you can find every importer you created. So you can choose the file-type there, then upload the wanted file. (That would be pop-up 1 :-) )

If you cannot program the pop-up, you can create 2 importers: 1 onf replace, one for update. (that would be pop-up 2) This can only be done if you map to a Unique Target of type GUID or URL.

If you want other fields to be the unique target, and have +1 importer per node type, you should apply #661606: Support unique targets in mappers .
This uses unique_field. First set up unique_field, then add the unique field tot the mapper, and you'll see a new 'Unique target' checkbox.

rathin2j’s picture

okk..gr8 :) I liked ur non POPing popups ;) and,ur idea of multiple importer for same type is excellent..i'll do that..

well in the matter of "Support unique target" i'll have to search for it and experiment coz i haven't done any type of development or designing before so it will be an "experiment"..

but really thank u very much4ur creative and instant follow up..i'll post in the results and progress.. :)

till then "mad scientist" at work :)

johnv’s picture

Status: Active » Postponed (maintainer needs more info)

OK, good luck!

twistor’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)

This has been postponed for a long time. Cleaning up old issues. Hoped it worked out for you.