The Agrovoc Field module is a module for manually indexing nodes using Agrovoc concepts.
This module creates a new CCK field (called Agrovoc and derived from the Content Taxonomy field) that allows to select Agrovoc terms through an autocomplete textbox connecting to the Agrovoc web services 2.0.
Being a CCK field synchronized with a taxonomy, it allows to exploit both CCK and taxonomy features in Drupal.
The module has very good and very well integrated multi-lingual support: when indexing a node, the module lists Agrovoc terms in the website currently active language, but then stores the selected terms in all the languages enabled in the website. When switching to a different language, the corresponding Agrovoc terms in that language will be displayed and when translating a node that has already been indexed, the translated Agrovoc terms will be displayed and the autocomplete field will only list terms in that language.
I am in contact with the author of another Agrovoc Drupal module (http://drupal.org/project/agrovoc) to coordinate on development.
Both modules derive from the same initial developments and use the same basic functionalities (a common API), but the Agrovoc module only integrates Agrovoc with the Drupal taxonomy, while the Agrovoc Field module integrates it also with CCK.
Note.
AGROVOC is multilingual structured thesaurus for all subject fields in agriculture, forestry, fisheries, food and related domains. It's used all over the world by researchers, librarians, information managers, and others, for indexing, retrieving, and organizing data in agricultural information systems.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | agrovocfield architecture.pdf | 108.99 KB | asanchez75 |
| #1 | agrovocfield.tar_.gz | 12.49 KB | asanchez75 |
Comments
Comment #1
asanchez75 commentedHere you can see a short demo
http://www.youtube.com/watch?v=5ovS1var_tE
I am attaching module too.
Thanks
Comment #2
asanchez75 commentedComment #3
asanchez75 commentedHere you can sse a small overview of parches I posted. This might help you to see my coding skills and take the decision of giving me cvs access.
http://drupal.org/node/794712
http://drupal.org/node/741960
Besides, I have participed as trainer in several activities of Drupal Perú as you can see here.
http://groups.drupal.org/node/86934
http://drupalperu.org/drupalcamp-primavera-2010
http://lima2011.drupal-latino.org/conferencia/web-semantica-drupal
http://lima2011.drupal-latino.org/conferencia/depuraci-n-debugging-usand...
http://lima2011.drupal-latino.org/conferencia/introducci-n-a-jquery
Finally, I have a blog to promote Drupal solutions
http://cambio.name/personal/
This blog was cited here in a list of spanish blogs, see last one
http://groups.drupal.org/node/84219
Regards,
Adam
Comment #4
asanchez75 commentedI am attaching a document about architecture of agrovocfield module.
I hope be useful for my cvs apply.
Comment #5
misseva3105 commentedthanks for this module
Comment #6
arianek commentedHi. Please read all the following and the links provided as this is very important information about your CVS Application:
Drupal.org has moved from CVS to Git! This is a very significant change for the Drupal community and for your application. Please read the following documentation on how this affects and benefits you and the application process:
Migrating from CVS Applications to (Git) Full Project Applications
Comment #7
asanchez75 commentedI just create a git repository for this module.
http://drupal.org/sandbox/asanchez75/1076836
I am sure that it can become in a full project.
Here you can check its development process
https://github.com/asanchez75/agrovocfield/tree/v0.1
Thanks,
Comment #8
berdirJust a short note, since you were already using git, you could have just added the new repo on d.o as a new remote and push it. The advantage would be that the history wouldn't be lost and it would show all your existing commits separate, making it visible that you are continously working on this module and it's not a one-off thing :)
I am not sure if this is still possible because you already pushed now, but maybe next time...
Comment #9
asanchez75 commentedoh! yes yes, you are right. Next time, I will do it. Don't worry because I will continue send many changes because I am very compromised with this module.
Comment #10
asanchez75 commentedJust upping this... If someone can check it... Thanks
Comment #11
sreynen commentedComment #12
asanchez75 commentedJust upping this... If someone can check it... Thanks
Comment #13
ralt commentedHello,
Here is my quick review :
You should remove LICENSE.txt, it will be added automatically by d.o.
All $Id$ lines are not necessary anymore since CVS is not used anymore.
In your agrovocfield.module file :
Why do you use this instead of "default" ?
Nothing big, but why t.tid AND t.* ? t.* should be enough, should it not?
Also, I'm not sure, but I think it is more performance wise to describe the fields one by one if you know what you want (I'm kinda itchy at this star :p).
Found some trailing whitespaces in your agrovocfield_autocomplete.module file.
Except for these little things, the code looks really great! Havent tested it though.
Comment #14
asanchez75 commentedThanks for your suggestions. I just fix it.
http://drupalcode.org/sandbox/asanchez75/1076836.git/commit/cf4ac37
http://drupalcode.org/sandbox/asanchez75/1076836.git/commit/b4b2014
Please, let me know if you have tested it.
Comment #15
asanchez75 commentedJust upping this... If someone can check it... Thanks
Comment #16
jordojuice commentedHi,
Thanks for your contribution and sorry about the long wait!
I did a code review on your module, and overall I think it looks well done. The module follows coding standards well, though there were a few indentation issues and that's it. The module has a README file, no LICENSE files, etc. I'm prepared to mark this RTBC once a few issues are resolved. Looking at your code and your recent posts, I think you have demonstrated your abilities as far as I'm concerned. But a few things to note:
http://drupal.org/coding-standards
Drupal coding and commenting standards dictate that the standard language is US english. So, all of the
type comments should be
Also, if properly formatted, comments should look like this (from line 201 of agrovocfield.module
Additionally, comments should follow sentence structure, starting with a space, capital letter, and end with a period, and inline
//comments are generally discouraged (likeunset($obj->labels); //reseting container).These are pretty simple fixes that shouldn't take long. Your code demonstrates an understanding of PHP. the Drupal API, and makes good use of the Content API.
Lastly, you might want to include some instructions on using the module in your README.txt file rather than only describing what it does.
Comment #17
ralt commentedHi,
Actually, "Implementation of..." should be "Implements...".
Comment #18
jordojuice commentedIndeed that be the new format, though I've gotten mixed signals on whether D6 modules must use this format. All of Drupal core in D6 still uses
Implementation of, as do most D6 modules, and many modules complete this review process with the same. Indeed, I've seen it expressly mentioned in this queue that using this format is okay for D6 modules. But perhaps the safest bet is to use the new format, be bold (while I get clarification from the rest of the review team)!Comment #19
asanchez75 commentedThanks for your suggestions. I just solve it.
http://drupalcode.org/sandbox/asanchez75/1076836.git/commit/b4655a2
I hope this is enough :)
Comment #20
asanchez75 commentedJust upping this... If someone can check it... Thanks
Comment #21
asanchez75 commentedPlease, I would be very grateful if somebody can review it. I guess that everything is ok after your suggestions.
Thanks
Comment #22
jordojuice commentedAgh. Once you correct any issues the application needs to be set back to needs review. That's why it got lost in the sauce!
Comment #23
asanchez75 commentedJust upping this... If someone can check it... :(
Comment #24
asanchez75 commentedI would be grateful if somebody could review it. I just develop a agrovocfield importer plugin for Feeds module but I would like negotiate its inclusion in Feeds module through my own account in Drupal.org.
Please :(
Comment #25
jordojuice commentedElevating priority to get this checked out again. I am busy at the moment but will check it out again soon if nobody beats me to it.
Comment #26
asanchez75 commentedSure you are very busy because 2 weeks have passed since your last comment :(
I will be patient, I understand. I hope you have time very soon.
Thanks
Comment #27
valeriap commentedI hope this module gets reviewed soon and is released as an official module, as we strongly need something like this.
The existing Agrovoc module only uses taxonomy, while this one also stores the URI in the CCK field, which is essential for developing Linked Data-enabled websites. Having been developed in very strict collaboration with the group in the Food and Agriculture Organization of the United Nations (FAO) that manages the Agrovoc thesaurus, this module has the necessary functionalities in order to fully integrate Agrovoc indexing and .linking to the Agrovoc URIs published as Linked Data.
We are already using the module, but it would help our community (http://aims.fao.org/community/group/agridrupal) to have it published on drupal.org so that it can be easily shared and upgrades can be monitored.
Comment #28
develcuy commentedJust to add more noise, a committed maintainer that is working six months to get his module pushed is (at least for me) the best prove that this is a project and not just a pastebin. I encourage the approval of this module.
Comment #29
davidhernandezRegarding module duplication, why not merge functionality with the agrovoc module? Especially since you say you are in contact with that person to coordinate development.
Comment #30
davidhernandezComment #31
asanchez75 commentedHi davidhernandez,
My approach is different because is based on CCK API. My module helps users in 3 key areas:
1. Choose the widget to fetch the tags from the Agrovoc Server. For now I have implemented a widget called autocomplete, but could create more.
2. Choose the format to display the information in a full text node. In this aspect, I have implemented a formatter that displays the terms of the taxonomy as URIs, facilitating the indexing as Linked Data.
3. Choose the formatter to display the terms through Views module.
Also, is fully integrated with the i18n module. For example, when you create a node in one language, and storing terms in that language, you do not need refilling terms again for each node of each available language in the site. My module will automatically display the terms that correspond to each available language. Furthemore, the terms can only be changed from the default language of the site to ensure consistency of information.
For example, if I store the words: "Rice, Milk" in a field of type agrovocfield, my module will automatically show "Arroz, Leche" when the module is translated into Spanish. The user does not fill it again.
On the other hand, this approach allows the integration with Feeds module to import Agrovoc terms from XML files. For example, I just developed a plugin for Feeds, which is not part of agrovocfield because its location should be inside Feeds module.
The plugin is available here
https://github.com/asanchez75/agrovocfield_plugin_for_feeds
but it can't be part of suite of plugins that Feeds module has for importing CCK fields because my module is not official yet :(
There's a video here here about this plugin
http://blip.tv/asanchez75/plugin_feeds4agrovoc-5321989
Finally, the only coordination I have to do with the other developer is about improvements for module agrovoc_api that is part of his module. I used its API, but only to fetch Agrovoc terms from Agrovoc server.
Regards,
Comment #32
asanchez75 commentedPlease, I would be very grateful if someone could review it.
Thanks
Comment #33
davidhernandezAdam, I'm so sorry this is taking so long. We are severely short on volunteers. I'm looking over the code right now, and will post comments tonight or tomorrow. Definitely don't add more comments to bump up the issue. Reviewers can actually skip it over because of that. They see it being commented on, so they think it is being reviewed. Thank you for your patience.
Comment #34
davidhernandezThanks for your README. It is very helpful.
I get a lot of these errors:
Fatal error: Class 'SoapClient' not found in C:\wamp\www\d6\sites\all\modules\agrovoc\agrovoc_api.module on line 30
I know it is not from your module, but it is preventing the autocomplete from working, and the node from saving. It does not show any autocomplete suggestions, but it only fails when typing something that should autocomplete, like "chicken". I am doing this on Windows. I will try Linux tomorrow. Otherwise, I cannot get it to work, so I'll have to review the code only.
Coder does hit on this:
Line 272: Potential problem: "SELECT FROM {node}" statements should probably be wrapped in db_rewrite_sql() and with the alias for {node} table defined (e.g. {node} n)
I'm looking at the code now to see if it necessary in this use case, but I don't immediately see a reason not to use db_rewrite_sql(). http://drupal.org/writing-secure-code
Still looking. Regardless of whether I can get it working, I just want to make sure there are no obvious security issues. I should be finished reading it all by tomorrow.
Comment #35
asanchez75 commentedI just fix the bug. You can check a diff here
http://tinyurl.com/3umzjsl
It is very odd bug because I had reviewed my module months ago with the coder module and had not errors. Maybe, the coder module have updated its database of error detections. Anyway, it is better because I can learn more :)
Later, I will share you a short screencast (7 min) to demonstrate how working my module. Now, I am uploading it.
You are very kind, thanks a lot.
Adam
Comment #36
asanchez75 commentedMy short screencast (7 min) to demonstrate you how working my module
http://tinyurl.com/3tna6mg
I hope help you to understand it.
Regards,
Comment #37
davidhernandezThanks for the information. I set this up on Ubuntu this evening and it is working without any errors. I will try to finish the review very soon.
Comment #38
davidhernandezUse t() for the label and description in hook_field_info(). The agrovocfield_autocomplete_widgets_settings() function seems to have no purpose. Other than that, nothing jumps out at me. Add the t() function and I'll mark it reviewed, as long as no one else has any comments.
Comment #39
asanchez75 commentedOK. I just fix it.
See http://tinyurl.com/3pzf2yd
Thanks
Comment #40
davidhernandezComment #41
gregglesCongratulations and thanks for your patience. Based on davidhernandez' review I've granted you the git vetted user role.
Indeed the db_rewrite_sql was necessary for security reasons. Adding a tag to track that.
Comment #44
avpaderno