My name's Jan Azzati. I'm a Drupal Developer at Previon AG. A Swiss enterprise specialized on Content Management and Web portals. We are Drupal fanatic since 2 years now. We realized a lot of web sites using Drupal and I was able to improve my Drupal development skills form project to project.
The Drupal community is outstanding and I’ve been able to solve most of the problems using the fantastic modules that have already been contributed by others. But of course the complexity of our projects always requires some own development.
Now, my motivation behind my request for the cvs account is mainly that I want to participate on the community and would like to share my developments with others who might have a similar problem to solve. This is just one step in my overall plan to be more active in the community (helping in irc or in forums, write a blog, etc…).
In one of our last projects I developed a module called “xml2node” (more details later) which was very useful for us. And I think this module could be useful to others and it also is a good module for my first contribution (I’m excited ;-).
The basic functionality of xml2node is importing data from XML-Files into Drupal. This can be used for a one-time import (for example a content migration) OR for a continuous import on cron (from hot folders).
Now there are some other already contributed modules that can import data. But most of them are optimized for “one-time imports” (Node Import; Migrate; Power Import), most of them only support import from CSV Files or MySQL Dumps. My module is not focused on content migration (although it is very easily possible and also done by us before) but more on providing an interface to import any kind of data either by user interaction or by crawling through hot folders and import the content automatically. So, 3rd party systems could deliver XML files periodically into the hot folders.
Another concept that makes my module different to others is the mapping between the XML-Data and the Content-Type fields. There is no mapping required. In most of the other modules like “Table Wizard” you map the incoming content dynamically to the destination content type. I’m not saying that this is not a cool feature (it really is), but my modules just follows another concept.
The XML Structure must follow a specific structure which is very similar to the structure of the destination node. So the module can get the required content mapping out of the xml structure.
I’ve made a short introduction screencast to present the concept and the features of the modules:
http://www.youtube.com/watch?v=tfU5z6TFmZA
Also you can find a screencast with a demo here:
http://www.youtube.com/watch?v=tfU5z6TFmZA
You can find the sample XML files from the videos here:
http://www.tyze.ch/files/xml2node_sample_xml.tar
And here you can find the module:
http://www.tyze.ch/files/xml2node.tar
Now that you know about the basic principles of the functionality, I’d like to provide some information about the code:
- Import via User Interface is based on the Drupal Batch API
- Import via cron is based on the Drupal Queue module (backport from Drupal 7 Queue functionality)
- A hook is provided
- I followed the Drupal Coding Standards and tested this with the coder module
- I used Drupal Standards, such as hook_menu, the Form API, hook_cron, the t()-Function, etc…
- Whenever possible I used Drupal functions to do basic operations that are also done by standard PHP Functions. (e.g. file_check_directory()).
- The core Logic of the module is implemented using OOP concepts.
- I always tried to code “the Drupal way”. Please correct me if I missed something.
I hope these information give you a basic overview on my contribution. The module is used in a productive system right now, but there are still some improvements I’d like to do in the next couple of weeks (better error-handling, more comfortable CRUD Operations, etc..). I also will add a full documentation on how to use the module as soon as the module is contributed.
Feel free to ask any question about my module or about me.
Thanks in Advance and best regards
Jan “protyze” Azzati
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | xml2node.zip | 12.77 KB | Anonymous (not verified) |
| #1 | xml2node_sample_xml.zip | 1.41 KB | Anonymous (not verified) |
| #1 | xml2node.zip | 12.31 KB | Anonymous (not verified) |
Comments
Comment #1
Anonymous (not verified) commentedComment #2
Anonymous (not verified) commentedComment #3
Anonymous (not verified) commentedThe link to the demo video is actually the following:
http://www.youtube.com/watch?v=K1XCk6u87gM
Comment #4
avpadernoHello, and thanks for applying for a CVS account. I am adding the review tags, and some volunteers will review the code, pointing out what it needs to be changed.
Comment #5
avpadernoStrings passed to
t()must be in English.hook_uninstall().Why isn't the code calling
file_scan_directory()?Why isn't the code using
format_plural()The default value should be the value used the last time the same form has been used. If users need to use a different value, they would need to enter the value they want to use all the times they use the form.
Hook implementation comments should be like the following one:
The comment doesn't report the parameters used by the hook, as they are already known, and don't change for each implementation of the hook.
Crun?
Comment #6
Anonymous (not verified) commentedhi kiamlaluno,
first I want to thank you very much for reviewing my module and giving me feedback. i made some other improvements (performance, etc...) together with your points so it took me a little bit longer.
Thoughts to your reported points:
1: done
2: all english now
3: the module cleans now up
4: thanks for that hint. using it now at several points! also in other projects.
5: corrected on multiple code sections
6: corrected
7: corrected
8: typo. corrected :-)
find attached the corrected version of the module.
Thanks in advance for reviewing it again.
best regards.
Comment #7
avpadernoThank you for your contribution!
I am going to update your account so you can opt into security advisory coverage now.
These are some recommended readings to help with excellent maintainership:
You can find more contributors chatting on the IRC #drupal-contribute channel. So, come hang out and stay involved.
Thank you, 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.
I thank all the dedicated reviewers as well.
Comment #10
avpadernoComment #11
avpadernoI am giving credits to the users who participated in this issue.