This module integrates the information service DILVE books.

DILVE is the largest catalog of books published in Spain. http://www.dilve.es/
DILVE uses the international standard ONIX, based on XML.

Features:

  • Import indicating isbn book.
  • Import indicating Title book.
  • Bulk import indicating several isbn, with Batch API.

The book contains information fields:

  • Title
  • Cover image
  • Author
  • Description
  • Categories
  • Number of pages
  • Language

Demo: http://solucionex.com/dilve/?q=node/add/dilve_book/dilve

Other information:

Manual reviews of other projects

Others modules related with book:

Comments

Caseledde’s picture

Status: Needs review » Needs work

Please checkout Ventral. There are a lot of errors reported. Ventral is a automatic tool to review your code style and some other common issues. It will help you to maintain your module.

rbordallo’s picture

Status: Needs work » Needs review

Solved, thanks.

Caseledde’s picture

Status: Needs review » Needs work

Hi again,

I found some issues:

1) Use files[] in .info
You may add a files attribute to your .info file.

files[] = dilve.internal.inc

In this way dilve_init() is obsolete.



2) dilve_settings_form_submit() is obsolete
dilve_settings_form_submit() will not be called because system_settings_form() will handle the submit.

rbordallo’s picture

Status: Needs work » Needs review

Hi, I think it's solved.
Thanks.

Caseledde’s picture

Status: Needs review » Needs work

I was wrong:

The files[]-attribute is not the rigtht way. Its for classes and interfaces.

Sorry.

But I still think, you shouldn't use dilve_init(), because one the one hand the file will be included every time. Even its not needed. And on the other hand, hook_init() will not be called on cached pages.

So here are two other solution possibilities:

1)
1.1) Use form_load_include() in all your forms, where you need the helper functions. It should be enough to add form_load_include() to the form function. The validation and submit handler will have the file already included.

1.2) Use module_load_include() during your bulk opperations.

2)
Just delete dilve.internal.inc and move all its functions to dilve.module. This seems best for me.

rbordallo’s picture

Status: Needs work » Needs review

Hi,

1.2) done, this option seems cleaner and easier.

2) I have moved function to dilve.module.

I like this process, I hope to continue.

Thanks.

Caseledde’s picture

Status: Needs work » Needs review

Whoops, double post.

Caseledde’s picture

Status: Needs review » Needs work

Great, but I think, you don't need module_load_include() in dilve_bulk_op(). You have to try it out.

It was meant 1) or 2).
Not 1.2) or 1.2).

I try to write better to prevent misunderstandings.

I fount some other issues:

1) '\n' dilve_bulk_form_submit().
Use PHP_EOL instead of '\n' to be multiplatform aware, because windows will use '\n\t'.

<?php
$isbns = explode(PHP_EOL, $form_state['values']['isbn_bulk']);
?>

2) Form error handling in submit handler
You should do the validation in dilve_add_form_validate() only. You can validate your booktitle and isbn during the validation handler, add them to the $form_state['storage'] and let the submit handler do just the submit.

<?php
dilve_add_form_validate($form, &$form_state) {
  // Add new variable to storage to tranfer it to the submit handler.
  $form_state['storage']['my_value'] = $a_new_variable;
}

dilve_add_form_submit($form, &$form_state) {
  // Get variable back from storage.
  $a_new_variable = $form_state['storage']['my_value'];
}
?>

3) _dilve_fetch_data()
Maybe you should add a default case to the switch, to initialized $item as FALSE or NULL.

4) First parameter in forms
I think the first parameter already is a form array. So this look invalid for me.

<?php
function dilve_add_form($isbn = '') {...}
?>

Please tryout

<?php
function dilve_add_form($form, $form_state, $isbn = '') {...}
?>

Where do $isbn come from? I can't test it because I have no dilve access. Please validate this.

Same here:

<?php
function dilve_admin_settings($form) {
  // The following line should be obsolete because $form is an array allready.
  $form = array();
  [...]
?>

5) Copy/Paste error in _dilve_check_settings()

<?php
drupal_set_message(t('You must You must select a book database to use before using this feature.'), 'error');
?>

6) Cleanup the code
There is a lot of commented code. Please delete those lines.

7) Re-check the functionality of the module.

Thats all for now;)
Happy coding

rbordallo’s picture

Hi, sorry for the misunderstanding.

I have corrected all points (1-6) and reviewed 7.

I hope all is well!

Thanks!

PA robot’s picture

We are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and put yourself on the high priority list, then we will take a look at your project right away :-)

Also, you should get your friends, colleagues or other community members involved to review this application. Let them go through the review checklist and post a comment that sets this issue to "needs work" (they found some problems with the project) or "reviewed & tested by the community" (they found no major flaws).

I'm a robot and this is an automated message from Project Applications Scraper.

tolivera’s picture

Status: Needs review » Needs work

When you add a new book searching with "book title", if there is more than one book with the same name it returns one of them (I guess it's the first one). I think it should alert the user or alow to select from a list.

For example, try searching "Los pilares de la tierra" by name and the system returns book with ISBN 9788401338359, but you can search using other ISBN number as 9788401328510 and the system returns a different version of the book (with image in this case).

PA robot’s picture

Status: Needs work » Closed (won't fix)

Closing due to lack of activity. Feel free to reopen if you are still working on this application.

I'm a robot and this is an automated message from Project Applications Scraper.

PA robot’s picture

Issue summary: View changes

I add a demo of the module.

keopx’s picture

Issue summary: View changes
keopx’s picture

Issue summary: View changes