That's my work of the weekend. It's a proof of concept of how we could do presets based on content types in feedapi. This stuff is not finished at all. I just post it for showing where it could go and to have a basis for discussion.
Here is what's changed:
* FeedAPI is configured on content types. Create a content type, enable FeedAPI, select and configure parsers and processors
* When you create a node of the content type you configured, you'll see that the node form is replaced by a simple URL input textfield from where you can directly create a node or create the node and edit it on the next step. This feature is not directly related to presets but I think it's an important detai for usability. Error handling (e. g. when the feed you entered is not reachable from the server) is still bumpy.
* When you edit the feed node, you ll have some feedapi settings on it.
Here is what's missing:
* feedapi settings on nodes. Currently there is only the URL that can be edited on a per feed basis. Actual parser and processor settings should be editable on a per node basis, too. I think you shouldn't be able to chose parsers and processors on a per node basis, though.
* Store per node settings correctly. Settings need to be stored in the feedapi-way.
* As in this scenario feeds are always nodes the feed-related hooks of feedapi become obsolete.
* Implement editing of feedapi settings on feed nodes - currently you can only create them.
* Iron out UI.
I will keep on working on this one. In the meantime your input is very much appreciated.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | feedapi_presets_as_content_types_1.patch | 26.43 KB | alex_b |
| #1 | feedapi_presets_as_content_types_0.patch | 21.63 KB | alex_b |
| feedapi_presets_as_content_types.patch | 16.36 KB | alex_b |
Comments
Comment #1
alex_b commentedI was working today on storing feedapi_item settings on a per node level.
That means basically storing the content types presets per node, once a node is created.
There is lots of overlap between these tasks. If we are happy with presets stored as a serialized array, we could have feedapi handling
* Storing and updating per content type presets
* Storing and updating per node presets
Only by providing feedapi an array in a call back function. E. g.:
Storage on a per-content type level and storage on a per node (feed) level would be done by feedapi automatically.
For how much those settings overlap, apply patch and see feedapi_item.module comments
// Extend node edit form.
// Extend the content type form.
Comment #2
alex_b commentedRead *per node settings instead of *per node presets in previous post.
Comment #3
alex_b commentedI did the implementation of the hook_feedapi_settings_form() as described above. The thing works pretty nifty. An add on module just needs to return a form snippet in this manner...
...and feedapi handles per content type preset storage/manipulation and per feed (=node) settings storage/manipulation. Per content-type presets are stored in the variable table, per node settings are stored in a new settings field in the feedapi table. Enabling/disabling and order of call of add on modules is entirely handled by feedapi module.
How to try out this patch:
* Grab latest DRUPAL-5 cvs version of feedapi
* Install all feedapi modules
* Apply patch
* Create content type and enable feedapi on the content type editing page, chose a parser and a processor, configure presets.
* Create node of this content type.
* Play around with settings.
* You won't be able to actually download feed items with it.
*This patch is still experimental and rather proof of concept.*
Here is what's still missing:
* Testing presets and settings: Creating, updating, deleting.
* Work through the todo's in the code :)
* Load settings on node load so that implementing modules can access them.
* Implement loading feed settings on node load in the feedapi format - feed aggregating should then be possible again.
* Refactor remaining feedapi.module and add on module to adjust to these changes.
* Iron out UI.
Comment #4
alex_b commentedpatch committed and adapted by aron.
Comment #5
(not verified) commented