There is a third-party product called Evanced Events (http://evancedsolutions.com/our-solutions/events/), which we use at my library. It offered a great out-of-the-box solution to manage public and staff programs throughout our three branches. However, the calendar interface it provides the public is less than ideal. In addition to that, we wanted to find a way to get the Evanced events data into Drupal; that way, we could use the Views and Calendar modules to highlight upcoming events on our homepage and elsewhere on the site.
We tried to find an existing module (such as FeedAPI: http://drupal.org/project/feedapi) that would allow us to import data from Evanced, but the complexity of the data that needed to be processed and mapped in Drupal proved to be too much for anything we tested.
The solution was to create a custom module, the "Evanced Events Importer", which imports data using a built-in EXML feed provided by Evanced. Basically, the module creates a Drupal node for each event in Evanced and, using an Evanced ID, keeps them in sync. So whenever cron is run, new events are imported from Evanced, existing events are updated, and missing ones are deleted. Note that our custom module works with CCK (http://drupal.org/project/cck), Views (http://drupal.org/project/views), Calendar (http://drupal.org/project/calendar), Date (http://drupal.org/project/date) and the Addresses (http://drupal.org/project/addresses) modules. All the events currently on the Worthington Libraries calendar (http://www.worthingtonlibraries.org/calendar) are Drupal nodes that were created by importing data from Evanced using this module.
We have spoken to Evanced and have their blessing to post this module (they even wrote an article about the collaboration: http://evanced.blogspot.com/2009/12/drupal-and-evanced-money-saving.html). Many libraries use Evanced and we've already had several contact us, asking if they could use our module (there's even been some interest in co-maintaining it). I am currently trying to update the module so that it is less specific to our environment and easier for others to configure and use. I'm hoping to be done with that by the end of this month (April 2010).
Please let me know if you have any questions or need additional information. Thank you for your time.
-- Stefan Langer
Worthington Libraries Web Developer
| Comment | File | Size | Author |
|---|---|---|---|
| #25 | evanced_events_importer7.zip | 18.67 KB | slanger |
| #15 | evanced_events_importer6.zip | 18.8 KB | slanger |
| #12 | evanced_events_importer5.zip | 19.55 KB | slanger |
| #7 | evanced_events_importer4.zip | 19.18 KB | slanger |
| #5 | evanced_events_importer3.zip | 18.35 KB | slanger |
Comments
Comment #1
yesct commenteddid you forget to attach an archive of you module?
You might want to read http://drupal.org/node/539608
Especially the bit about "Here is a list of common motivation messages that, more often than not, get declined/rejected. If your motivation message resembles one of these then please, think before applying.
[....]
* I am planning to create modules / themes. Who applies for a CVS account should have already a module / theme. The purpose of a CVS application is to review code, and verify the degree of understanding about how a Drupal module is written; without a module there would not be a review, and there is not CVS application. For the same motivation reported in the previous point, future CVS applications reporting only this motivation will be declined. "
Comment #2
slanger commentedI apologize for the delay. I have attached a copy of my module for you to review. Thanks!
Comment #3
avpadernoHello, and thanks for applying for a CVS account. I am adding the review tags, and some volunteers will review your code, pointing out what needs to be changed.
Comment #4
slanger commentedHi there! I have since made some changes to my module: adding additional comments and configuration settings, correcting an issue with hook_perm(), as well as rewriting one of the functions ("evanced_events_importer_taxonomy_ids") to make it more flexible.
Please review the revised version of the Evanced Events Importer module (attached). Let me know if you have any questions.
Thank you for your time.
Comment #5
slanger commentedSince last week, I've made a few more updates: reformatting some of the SQL queries so that they all use %-modifiers, adding instructions to the configuration screens and including a ReadMe file.
I look forward to receiving feedback on this module. Again, thank you in advance for your time.
Comment #6
slanger commentedAny questions / comments / concerns? I'm motivated to get a project page set up for this module as soon as possible, as several libraries have already expressed an interest in it. Thanks!
Comment #7
slanger commentedSeveral libraries and organizations have expressed an interest in seeing an official release of the Evanced Events Importer module. One of them recently volunteered to help me test it further by installing the module on their development site. Based on their feedback and experience using it, I made some additional changes, which include:
With these updates, the module is now working correctly on this latest installation.
I look forward to hearing your feedback on this module as well. Thank you for your time.
Comment #8
mjacobsen commentedI offered up an environment for slanger to test this module and am pleased with the results. I hope this module is tested and approved soon as it will quickly become a must have for public libraries.
Comment #9
Jennifer.ODonnell commentedI would love to use this for our library. What do we need to do to get this approved as a module?
Comment #10
alexjarvis commentedI am reviewing the module and should have some feedback for your shortly.
Comment #11
alexjarvis commentedOK, I've reviewed your module and have some comments. First off let me say that the actual functionality of your module is quite nice and I look forward to using it. However there are a few problems that need to be addressed:
evanced_events_importer.module
You have two includes at the top of this file that are problematic:
evanced_events_importer.install
Your message in evanced_events_importer_install should be using st() instead of t().
Code Density
Your code has some density issues which make it hard to read/understand:
Coding Standards
You are not completely in compliance with Drupal coding standards (http://drupal.org/coding-standards). In particular you don't have spacing around your periods when concatenating and your comments don't follow Doxygen formatting conventions (http://drupal.org/node/1354). I'd recommend setting up a Drupal 7 instance, downloading Coder (http://drupal.org/project/coder) and doing a code review. It will give you exact line numbers for most of the code problems (it won't identify your incorrect comment format however).
Improvements
These are not issues that necessarily need to be addressed immediately, but that would make your module easier to use:
Comment #12
slanger commentedalexjarvis: I believe I've addressed all of the problems that you outlined in your previous post.
When you run my module through Coder, it now only returns one minor error -- and that's simply because it's flagging a bad HTML tag that I'm doing a search-and-replace on. My comments should hopefully be compliant with Doxygen formatting conventions as well.
I appreciate your suggested enhancements and will explore those in the future.
Please review this latest version of the module and let me know if I've missed anything. Thanks again for your time.
Comment #13
alexjarvis commentedLooks good. I'd say it's time to give Slanger a CVS account and put this useful module out in the wild.
Comment #14
avpadernoThose lines need to be removed, or they will confuse the update manager, once the packaging script adds its own lines.
Instead of using
include_once(), the code should use the Drupal function thought for these cases; if the include files are included unconditionally, then it is better to merge the files into the module file.The comment at the end of the function is not contemplated in the Drupal coding standards.
Don't escape the string delimiter inside a SQL query; it is enough to change the string delimiter, in such cases (
$sql .= " WHERE node_field_type = '%s'";).The code is passing too much HTML code to
t(); the code needs also to be re-written to use a theme function.The query is probably database-dependent; the correct way to verify if a module is installed is not that (try with
module_exists()).I am not sure why the code is checking of OG is enabled, if it doesn't use any of the features of the module.
The strings should be probably translated.
Is there any reason to not write the SQL query in a single string?
Instead of using a regular expression, it would be better to use
rtrim().Same case as the previous, with the difference that the code should use a different function.
Comment #15
slanger commentedThank you for your feedback, kiamlaluno! I believe that I've addressed all of the issues you brought up in your previous post, as detailed below.
alexjarvis was good enough to review my code a few weeks ago, which gave me a head start in cleaning up the formatting problems that were there. The attached module should conform to Drupal-coding standards and the comments should meet Doxygen formatting conventions.
Issues:
I hope I've managed to correct all of the pending issues. Again, thank you for your time and feedback.
Comment #16
slanger commentedHi kiamlaluno:
Are there any additional changes that need to be made to this module? Several more organizations have contacted me and expressed an interest in the Evanced Events Importer; so I'm very motivated to provide an official release to them soon.
I appreciate your time and feedback.
Comment #17
slanger commentedHi kiamlaluno:
Any questions or comments? Two weeks ago, I posted the 15 corrections you requested, as well as others that were submitted by the community. I feel like we should be very close to the finish line now.
I look forward to receiving your feedback.
Comment #18
alexjarvis commentedSince there doesn't appear to be any other feedback I think it's fair to flag this as reviewed again.
Comment #19
avpadernoThat is not exact: there have not been reviews since the code has been re-uploaded.
Comment #20
slanger commentedHi kiamlaluno:
I just want to make sure: Should I find a reviewer or will one be assigned to me? If I need to find a reviewer myself, what qualifications do they need?
Comment #21
slanger commentedbump
Comment #22
slanger commentedbump
Comment #23
slanger commentedI made the changes you requested more than eight weeks ago (comment #15). Please review this latest version of my module and provide feedback.
Comment #24
avpadernot()should use a placeholder; in that case,l()is never used togethert(); see the exampled reported in the documentation fort()where similar code is marked as .Strings like that are not passed to
t(); an HTML tag cannot be translated, and the content of HTML comments is not translated either.The first markup element should be used as
#descriptionof the fieldset element, and the second one should use a theme function.evanced_events_importer_admin_settings_xmlmapper()is using the markup element almost for each form element; in such case, a theme function should be used for the form builder.Use
t()-placeholders.The query is probably specific for a database engine, and it's not compatible with the others.
The query can be built concatenating less literal strings.
The SQL operator
!=is not standard, and should be replaced by<>.Is the variable
$fieldname_evanced_idsecure against SQL injection?t()is available fromhook_install(); it is used fromphp_install().Comment #25
slanger commentedThank you for your feedback, kiamlaluno!
I have made the changes you requested. I also ran my module through Coder, which returned zero errors (NOTE: Coder was using its most sensitive setting).
t()function throughout the code, wherever needed.t()function was unnecessary, it was removed throughout the code.evanced_events_importer_admin_settings_xmlmapper()creates a special user-friendly interface for mapping XML elements to specific content-type form fields. As a result, the formatting of the user interface is rather unusual. I've explored using a theme function for this page; but because of the complexities of the layout, I don't believe one will work very well in this particular case.t()function throughout the code, wherever needed.db_table_existsfunction instead.!=has been replaced with<>. Unnecessary whitespace has been removed from the query. However, since the query is rather long, some of the formatting has remained to keep it readable. Additional placeholders were added to this SQL query, as well as to other queries throughout the module code.st()function has been replaced with thet()function instead.I hope these are the final changes needed to get approved for a CVS account. Thank you for your time and attention.
Comment #26
avpadernoComment #27
avpadernoThe first argument of
t()is a literal string, not a concatenation of strings. The script used to create the translation template is not able to handle any dynamic value, even in the case of code similar tot($variable); this means that if the argument of the function is not a literal string, it will not appear in the translation template.A string placeholder cannot be used for a database table.
Comment #28
slanger commentedI received an e-mail saying that my CVS application has been approved! Thank you so much, kiamlaluno! :-) I've learned a lot during this process. Rest assured, I will incorporate the final changes you requested into the module.
Comment #29
slanger commentedP.S. A project page has been created for the Evanced Events Importer module:
http://drupal.org/project/evanced_events_importer
Comment #32
avpadernoComment #33
avpadernoComment #34
avpadernoI am giving credits to the users who participated in this issue.