CVS edit link for jbiechele

Hello, my name is Josef Biechele and I would like to request a CVS access to contribute a new module ("IS24")
which will provide a bridge to the ImmobilienScout24.de API
to request real estate offers from their site and display them in a drupal block.

ImmobilienScout24.de is a big german internet portal for real estate offerings and widely used by german estate agencies.
At the moment I'm working on a new drupal website for an estate agent in Germany implementing this kind of functionality.

When I "googled" for this kind of interaction between Drupal and ImmobilienScout24.de I of course recognized that I'm not the first
one searching for it. So maybe an official drupal module which connects to this estate portal could help some fellows to resolve
their tasks more easily with Drupal. At the same time I hope that publishing this module will bring the people together who are thinking
about writing something similar.

The module successfully passed testing on my clients site and beside the english original version includes a german translation.
I'm not allowed to publish the clients site right now but could provide a test site to give an online view of it.

Here an extract of the module's help description

"
DESCRIPTION
---------------
IS24 provides a bridge to the API of ImmobilienScout24.de (is24.de),
an internet portal for real estates widely used by german estate agencies.

The module

* displays all or selected estate offers from is24.de in a drupal block
* let you configure the search options, sort order and the appearance
of the block
* links the displayed offers to the is24.de synopsis ("expose") page

To use the module productively you have to be registered with is24.de.
Request your API key and get your Vendor ID.

For test purposes you can get a free API key from is24.de and use the
test Vendor ID 6687764.
"

Thanks for reviewing and all the best.

Comments

jbiechele’s picture

Status: Postponed (maintainer needs more info) » Needs review
StatusFileSize
new18.01 KB

Archived copy of my proposed module "is24".

avpaderno’s picture

Issue tags: +Module review
avpaderno’s picture

Status: Needs review » Needs work
  1. The file LICENSE.txt needs to be removed; Drupal.org CVS doesn't allow to commit that file.
  2. function is24_menu() {
      $items = array();
      $items['admin/settings/is24'] = array(
        'title' => 'ImmobilienScout24.de',
        'access arguments' => array('administer is24'),
        'page callback' => 'drupal_get_form',
        'page arguments' => array('is24_settings_form'),
        'file' => 'is24.admin.inc',
        'type' => MENU_NORMAL_ITEM,
      );
      
      return $items;
    }
    
    
    /**
     * Implement hook_perm()
     */
    function is24_perm() {
      return array('administer ImmobilienScout24.de');
    }
    

    The defined permission is not the used one.

  3.     case 'list':
          $blocks[0] = array(
            'info' => t('ImmobilienScout24.de Estate Offers'),
          );
    

    Strings used in user interface should have the first word in capital case, and the other words in lower case (with the exception of proper nouns, adjectives derived from proper nouns, and acronyms).

  4.             '#options' => array(
                	'AddressCity' => 'Address City', 
                	'CreationDate' => 'Creation Date', 
                	'DeactivationDate' => 'Deactivation Date', 
                	'Distance' => 'Distance', 
                	'ForignKey' => 'Foreign Key', 
                	'GroupNumber' => 'Group Number', 
                	'Heading' => 'Heading', 
                	'ImmoType' => 'Estate Type', 
                	'LastModificationDate' => 'Last Modification Date', 
                	'MarketingPrice' => 'Marketing Price', 
                	'NetArea' => 'Net Area', 
                	'NetRent' => 'Net Rent', 
                	'NoRooms' => 'No Rooms', 
    

    Strings used in the user interface needs to be translated; this includes also the strings used as options for the form fields.

  5. function is24_install() {  
      variable_set('is24_api_key', '');
      // Set is24.de test vendor id
      variable_set('is24_vendor_id', '6687764');
      variable_set('is24_block_offers_items', '3');
      variable_set('is24_block_offers_type', array('all' => 'all'));
      variable_set('is24_block_offers_image_type', 'Expose');
      variable_set('is24_block_offers_sort_criteria', 'LastModificationDate');
      variable_set('is24_block_offers_sort_order', 'DESC');
      variable_set('is24_block_offers_show_heading', '1');
      variable_set('is24_block_offers_show_image', '1');
    }
    

    Drupal variables should not be initialized to their default values during installation.

jbiechele’s picture

Status: Needs work » Needs review
StatusFileSize
new14.48 KB
new14.48 KB

Please find attached the fixed version. Hopefully it's ok now.
Sorry for the extra review work I caused.

avpaderno’s picture

@jbiechele: There no reason to feel sorry. It can happen that what I report is not clear; anyway, this is the first review for your code.

avpaderno’s picture

Status: Needs review » Needs work
  1. /**
    * Implementation of hook_enable().
    */
    function is24_enable() {
      drupal_set_message(t('ImmobilienScout24.de API bridge successfully installed. <br />1. Specify your vendor ID and API key in the <a href="@settings_config">configuration settings</a>.  <br />2. Enable a block and configure the display options in <a href="@settings_block">block settings</a>.',
        array(
          '@settings_config' => url('admin/settings/is24'),
          '@settings_block' => url('admin/build/block/list'),
        )));
    }
    

    That hook is called all times the module is enable, not only when the module is installed. The message could confuse users who would wonder why the module keeps to install itself. If there is the need to show such message, the code can be moved in hook_install().

  2. /**
    * Implement hook_uninstall()
    */
    function is24_uninstall() {  
      // Delete is24 variables
      $result = db_query("SELECT name FROM {variable} WHERE name LIKE 'is24_%'");
      while ($row = db_fetch_object($result)) {
        variable_del($row->name);
      }
      // Delete is24 block
      db_query("DELETE FROM {blocks} WHERE module = 'is24'");
    }
    

    It is better to call variable_del() for each variable the module defines. This avoids any conflict with other modules that could have a name starting with is24_.

  3.             '#multiple'   => 'TRUE',
    

    The value should be a boolean, not a string. It works simply because any not empty string would have the same effect of the boolean TRUE, but that is also true for the string FALSE.

jbiechele’s picture

Status: Needs work » Needs review
StatusFileSize
new14.48 KB

Next try. Fixed all your advices in the attached version.

avpaderno’s picture

Status: Needs review » Fixed

I apologize for the delay in approving this application.

Thank you for your contribution! I am going to update your account.

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.

jbiechele’s picture

When I look at the amount of tickets you have to process here in I'm glad you found time to review that one again.
Thank you for your advices and hints.

Status: Fixed » Closed (fixed)
Issue tags: -Module review

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

avpaderno’s picture

Component: Miscellaneous » new project application
Assigned: Unassigned » avpaderno
Issue summary: View changes