Distill
Distill is a Drupal module that enables other modules to extract and format data from Drupal entities in an organized way. It provides a simple class/method structure for defining extraction/formatting schemas.
How does Distill Work?
Distill contains 2 classes. 1) A class that defines the structure of a processor and 2) a distillation class that takes an entity, a processor class, and a list of fields that should be returned, executes the processor’s formatter methods, and returns an array of data. If the processor passed into the distillation class doesn't have a processor for a specific field type, then it will default to invoking the hook defined for that field type.
The project is located at https://www.drupal.org/sandbox/patrickocoffeyo/2346043 and contains more documentation and an example implementation of this module.
Installation
To install this module, clone it into the module's directory of a Drupal 7 installation, and enable the module:
git clone --branch 7.x-1.x http://git.drupal.org/sandbox/patrickocoffeyo/2346043.git distill
Comments
Comment #1
pcoffey commentedComment #2
pcoffey commentedComment #3
PA robot commentedThere are some errors reported by automated review tools, did you already check them? See http://pareview.sh/pareview/httpgitdrupalorgsandboxpatrickocoffeyo234604...
We are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and put yourself on the high priority list, then we will take a look at your project right away :-)
Also, you should get your friends, colleagues or other community members involved to review this application. Let them go through the review checklist and post a comment that sets this issue to "needs work" (they found some problems with the project) or "reviewed & tested by the community" (they found no major flaws).
I'm a robot and this is an automated message from Project Applications Scraper.
Comment #4
pcoffey commentedModified code to adhere more closely to DCS. Bot will still throw error on README.md file.
Comment #5
skdrupal88Hey, add please git clone command as it recomended in https://www.drupal.org/node/1011698 (5.4 point)
Comment #6
pcoffey commentedAdding git clone command and installation instructions.
Comment #7
sendinblue commentedComment #8
sendinblue commentedAutomatic Review
Please fix following errors and warnings identified by pareview.
Manual Reviews
- Git clone
Please change git clone url into public
- README.txt/README.md
Please follow the guidelines for in-project documentation and/or the README Template.
- Coding style & Drupal API usage
(*) I can't see any hook system. Can you explain me the reason ?
(*) Remove the packaging lins from the .info. These will be added when the module is published.
(+) Please use t() function for plain text
Comment #9
sendinblue commentedComment #10
fluxsauce commentedFirst of all, great work and great start! Can't wait to see this through to completion!
Git clone instructions on the review page should be used by anyone (currently, it's requiring username patrickocoffeyo). The instructions should be:
git clone --branch 7.x-1.x http://git.drupal.org/sandbox/patrickocoffeyo/2346043.git distillREADME.md - please review the module documentation guidelines at https://www.drupal.org/node/161085 and adjust accordingly.
PHP exceptions should use the
tfunction when throwing. See https://www.drupal.org/node/608166 for details.Your comments can be simplified. For example, in
distill_processor.class.inc:could just be
Also, none of your methods in
distill_processor.class.inchave phpdoc for return values.Document that this module requires PHP 5.3 or higher.
Typo in
distill_processor.class.incRegarding the feedback about hooks, I almost said ignore it, but actually there's a definite use case; allowing modules that define new field types to create their own processors. Most people could then just use a straight
Distillclass and only extend in extreme cases. Instead of implementingDistillProcessoras a class, why not a hookable system? The processors you've provided out of the box could then be re-implemented as hooks which will provide additional documentation and examples to others, along with an API.Comment #11
pcoffey commentedFluxSauce,
I've updated the codebase and now the Distill class incorporates hook-based formatters, as I discussed late last year, and as you specified in the above comment. I've also moved all of the sensible defaults into hook implementations. Code passes standards testing, and documentation has been updated to include the new hook system.
Thank you so much for your review! I'm submitting this back to the community for another pass :)
Comment #12
pcoffey commentedUpdating project description
Comment #13
fluxsauce commentedComment #14
vingborg commentedThis is a go. If you need it, you need it bad. Otherwise it's kind of weird.
I can confirm that it works as described, that the code is crisp, clean and well documented, and that it's actually useful.
It's even quite clever :-)
As far as I can tell, the issues raised by previous reviews are all taken care of.
It still lacks a test suite, but I would use it anyway.
Comment #15
cweagansThanks for your contribution!
I updated your account so you can promote this to a full project and also create new projects as either a sandbox or a "full" project.
Here are some recommended readings to help with excellent maintainership:
You can find lots more contributors chatting on IRC in #drupal-contribute. So, come hang out and stay involved!
Thanks, also, for your patience with the review process. Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.
Thanks to the dedicated reviewer(s) as well.
Comment #16
pcoffey commentedThank you for updating my account! I'll read through the links you sent! :)