Update
This issue is about allowing a Sheetnode to act as a row-oriented data source that can be used by Feeds to import data into Drupal. The idea is to create a FeedsParser that hosts a sheetnode, and parses it into data for Feeds processing. See this comment for an implementation strategy.
Original post
It seems to me that there is a lot of crossover between this module and the Feeds (http://drupal.org/project/feeds) and Data (http://drupal.org/project/data) modules. Some great wins might be allowing uploading of sheetnode data using the feeds parsers (CVS, Shapefile, etc.). Also, there might be some code re-use in terms of how Data module exposes itself to Views. I would encourage the developers to see what they can do to combine approaches and share some common code.
Comments
Comment #1
phayes CreditAttribution: phayes commentedCross posted to Data: http://drupal.org/node/735586
Comment #2
infojunkieCan you be more specific about the integration of Sheetnode with Feeds/Data? How would data flow between them? What are the integration points?
Comment #3
infojunkieI am currently working on various parts of Feeds. One of the possible integration points with Sheetnode is to display the input data in a sheet *before* sending it to the processor. This will allow interactive data massaging.
Comment #4
alex_b CreditAttribution: alex_b commentedsubscribe
Comment #5
BenK CreditAttribution: BenK commentedSubscribing
Comment #6
jaypark CreditAttribution: jaypark commented+1.
infojunkie, great work with sheetnode.
"One of the possible integration points with Sheetnode is to display the input data in a sheet *before* sending it to the processor. This will allow interactive data massaging."
for excel, often it's chosen for familiarity with the end user. it might be nice for them to also be able to edit a table by virtue of editing a sheet. i was about to get going on writing a sheetnode module with a parser to transform sheetnode.value into a data table. whenever a user clicks save for the sheetnode, the module would reload the data table. it would be great if there were a sheetnode hook that could be called whenever the user changes a cell value, that updates the corresponding data field, without having to do a full reload, given that some sheetnodes may be quite large.
note: wasn't able to get it working with phpexcel 1.7.5, works with 1.7.4
Comment #7
infojunkie@jaypark: If I understand you correctly, you're thinking of a new Feeds Parser plugin that takes its input from a sheetnode.
If that's correct, I suggest the following: In your parser's source form, insert a spreadsheet FAPI element using code like the following:
When submitted, you can retrieve the raw sheetnode data via
$form_state['values']['sheet']['value']
, which you can then parse usingsocialcalc_parse_sheet
(located in socialcalc.inc).In your
FeedsParser::parse
method, simply set your batch items to the values of the cells that you parsed above. This scheme would work with any processor, not just Data.Comment #8
infojunkieClosing old issues. Reopen if needed.
Comment #9
ftrebuchet CreditAttribution: ftrebuchet commentedHi,
As Jaypark, I wish to transform a sheetnode in regular nodes (each line becomes a node and each cell populatesa field of that node).
In my case, each user have to populate a sheetnode each year with something like 10 columns and 100 lines (a total of ~3,000 lines per year).
Later these data will be be accessed and used as search criteria using search API or maybe faceted searches.
So, I suppose the solution is to transform sheetnodes to nodes as said above.
Unfortunately, as I am a newbie with Drupal and PHP, it's a little tricky to me.
Does anyone could give me a hand to start with this?
Code snipet would be very appreciate.
Thanks a lot.
Fred
Comment #10
infojunkieftrebuchet, if you are interested to sponsor the development of this feature (for Drupal 7), please contact me privately.
Comment #11
infojunkieHere's how I would approach the code:
Create a new Feeds parser that hosts the sheetnode
You can start using the code of FeedsCSVParser which comes with the Feeds module.
Let's call the new parser FeedsSheetnodeParser.
Host the sheetnode
In
FeedsSheetnodeParser::sourceForm()
, create a form that contains the sheetnode element:Import the sheetnode
In
FeedsSheetnodeParser::parse()
, retrieve the sheet value and create rows that are passed to the next stage of the Feeds pipeline:NOTE: I did NOT run or test this code. It's meant for illustrative purposes only.
Hope this helps!
Comment #12
infojunkieComment #13
infojunkieComment #14
ftrebuchet CreditAttribution: ftrebuchet commentedHi Infojunkie,
As I'm engaged with a non profit organization with a limited budget for this project, I think it will be difficult to collect funds for developing a general response for this subject, but I'll ask, you never know (and it would be great to participate in a contribution).
However, the goal was not to get a development for free, but to get clues on how to proceed cause I thought someone else has already did that. So, thank you very much for the pointer you gave to me, I think (in fact, I hope) that transforming a sheetnode to an array was the missing piece.
I was thinking about transforming the sheetnodes to CSV files, then load the nodes from files using Migrate module or an other one, but an all-in-one solution should be better (and a valuable exercise).
Thank's again.
Comment #15
infojunkieI'd appreciate if you could post any amendments/fixes to the above pseudocode. I might turn this into a new Sheetnode submodule.
Comment #16
ftrebuchet CreditAttribution: ftrebuchet commentedSure I will, as soon as I worked with it (hope during the week).
I'll also certainly post some issues or feature requests about Sheetnode module.
Comment #17
ftrebuchet CreditAttribution: ftrebuchet commentedHi,
I have been occupied with an other project but I'm returning to this one.
I've not created a new feed parser but used your code for a more specific solution.
I've changed some details, but the idea is yours.
Now I'll have some questions about sheetnode's configuration using a separate post.
Thanks again.
Fred
Comment #18
infojunkieGood to see progress. Are you still going ahead with a Feeds plugin?
Comment #19
ftrebuchet CreditAttribution: ftrebuchet commentedFor now I'll stick with a more specific solution that will meet my needs.
Later, perhaps something more generic could be interesting.
For example, a solution to describe the mapping rules (which target entity, which column goes in which field) and control values (ranges of values for numeric fields, etc.) would certainly help.
At the moment, for me everything is hardcoded.
One day maybe ...
In any case, thank you again for your help. It was very useful to me and sheetnode is definitively adopted for my use case.
Fred