CVS edit link for colincalnan

I have written a module that pulls in Open government data from a Microsoft Open Data server, via it's API and then outputs it to screen in a nicely formatted table and map.

An example can be seen here - http://www.datadotgc.ca/dataset/location_of_historic_buildings_in_edmonton

Here's the text from the README.txt file of the module

What is OGDI? - http://www.microsoft.com/industry/government/opengovdata/

Module development was sponsored by Microsoft Canada and Raised Eyebrow Web Studio (http://www.raisedeyebrow.com).
Module developed by Colin Calnan @ Raised Eyebrow Web Studio

The OGDI Field Module allows you to add a CCK field to any content type, which accepts a valid URL to a OGDI dataset as input, and outputs a slick, themed scrollable, filterable, sortable, searchable table and a map displaying that data. It does all this magic by communicating with the OGDI API.

This module was originally developed as an extension the DataDotGC.ca website,
a citizen-led open government data portal for Canada. The site was built in Drupal and uses CKAN (the Comprehensive Knowledge Archive Network) for cataloguing the data.
When we became aware of Microsoft's open-source OGDI application, which allows users to browse & filter cloud-hosted datasets within an easy-to-use web interface,
we wanted to integrate OGDI's functionality as well.
Microsoft Canada generously sponsored the module development project, and we now have a method of displaying OGDI instances on Drupal-powered websites.

CommentFileSizeAuthor
#10 ogdi_field.tar_.gz507.75 KBcolincalnan
#1 ogdi_field.tar_.gz12.53 KBcolincalnan

Comments

colincalnan’s picture

StatusFileSize
new12.53 KB
avpaderno’s picture

Status: Postponed (maintainer needs more info) » Needs review

Hello, 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.

colincalnan’s picture

Hi,

this has been here for about 3 weeks now. Is there anything I can do to help push this forward?

Regards,
Colin

boris mann’s picture

Colin -- Talked to NikG about this today. CVS applications are kind of swamped these days, so it may take a while.

sreynen’s picture

Status: Needs review » Reviewed & tested by the community

Code formatting looks great (Coder found no issues), commenting is really thorough, and sanitizing functions seem to be used everywhere they're useful for security. The only issue I see is the use of hook_init for CSS and JS includes that don't seem to be needed on every page. Ideally those would only be added where they're actually needed. But that's not really an issue that needs to be fixed prior to CVS.

avpaderno’s picture

Status: Reviewed & tested by the community » Needs work
  • The points reported in this review are not in order of importance / relevance.
  • Most of the times I report the code that present an issue. In such cases, the same error can be present in other parts of the code; the fact I don't report the same issue more than once doesn't mean the same issue is not present in different places.
  • Not all the reported points are application blockers; some of the points I report are simple suggestions to who applies for a CVS account. For a list of what is considered a blocker for the application approval, see CVS applications review, what to expect. Keep in mind the list is still under construction, and can be changed to adapt it to what has been found out during code review, or to make the list clearer to who applies for a CVS account.
  1. The version line needs to be removed from the .info file.
  2. Hook implementation comments should be like the following one:
    /**
     * Implements hook_menu().
     */
    
  3.     drupal_set_message('Failed to get Metadata for ' . $ogdi->dataset_id, 'warning');
    
    

    Use a t()-placeholder.

  4. The module requires PHP5, but it doesn't declare its dependency from that version of PHP.
  5.     $ch = curl_init($this->datasource . $querystring);
        
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_HEADER, 0);
        curl_setopt($ch, CURLOPT_TIMEOUT, 30);
        $result = curl_exec($ch);
        $info = curl_getinfo($ch);
        curl_close($ch);
    
    

    Why isn't the code using drupal_http_request()?

  6. PHP files should not end with ?>, as reported in the coding standards.
  7.     '#description'  =>  t('The value for the label of the Filter box on the dataset page'),
    
    

    Description strings, as other strings used in the user interface, should end with a period.

colincalnan’s picture

sreynen, thanks for spotting that. The CSS and JS should actually probably not be in there. The original incarnation of this module did not use CCK, and I had to load it everywhere. However now I only have to load it on any page/node that has the CCK field displaying.

Thanks so much. I'll get on that ASAP.
Col.

colincalnan’s picture

kiamlaluno,

thanks for the detailed response. I'll get to work on all of these issues straight away and will put another version up for review.
Also also wasn't aware of drupal_http_request() and will see about using that instead of curl.

Col.

hanno’s picture

Hi, wondering how the progress of this module is. Would propose to add this module to the list of modules for governmental services: http://groups.drupal.org/node/99004

colincalnan’s picture

Status: Needs work » Fixed
StatusFileSize
new507.75 KB

Hi,

I'm made all the modifications as requested by kaimlaluno and sreynen:

  • Removed version from .info file
  • Modified comments for hook implementations
  • Used t() and % placeholders in drupal_set_message()
  • Replaced CURL calls with drupal_http_request()
  • Removed closing PHP tags
  • Added periods to each description string
  • Removed CSS and JS from hook_init() and inserting into theming function instead

If you could please review the attached update and let me know if it passes.

colincalnan’s picture

Hanno,

as soon as this is approved and in CVS I will add it to that page.

hanno’s picture

looking forward

avpaderno’s picture

Status: Fixed » Needs review
moshe weitzman’s picture

Status: Needs review » Reviewed & tested by the community

Code looks great now.

FWIW, Adding JS and CSS unconditionally is better when css/js aggregation is enabled. I don't think we want to ding applicants on that.

avpaderno’s picture

Status: Reviewed & tested by the community » Fixed

Thank 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.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

hanno’s picture

@colincalnan module is ok, cvs account is ready, so looking forward to the project page of this module :)

Coornail’s picture

Component: Miscellaneous » miscellaneous
Status: Closed (fixed) » Reviewed & tested by the community

As I heard this still needs some review, so here are my recommendations:

/**
 * Implements hook_token_list()
 * and hook_token_values().
 *
...

Always write "Implements hook_..." to the appropriate place, so it can be easily search for.

/**
 * @file
 */

Don't just write @file so the coder module would shut up finally ;)

Every file has extremely verbose documentation (which is very great!), except ogdi-api.php, which seems to be the core of this thing.

Use DataTables module as a dependency, don't include the source in your module (so there's no conflict if other modules try to use DataTables).

$output .= '<div id="ogdi-wrapper">' . chr(10);

I'd rather write

$output .= "<div id=\"ogdi-wrapper\">\n";

Or if you don't like \"

$output .= '<div id="ogdi-wrapper">' . "\n";

Not a big deal.

Else the module looks great, I especially loved the huge amount of comments.

sreynen’s picture

Status: Reviewed & tested by the community » Closed (fixed)

As I heard this still needs some review

I don't think it does. The account has been approved, so I believe this issue is done. There's still no project, but that's because colincalnan hasn't created it, not because the module needs more review.

avpaderno’s picture

Assigned: Unassigned » avpaderno
Issue summary: View changes
Status: Closed (fixed) » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

avpaderno’s picture

Component: miscellaneous » new project application