amazOOP amazOOP
[ class tree: amazOOP ] [ index: amazOOP ] [ all elements ]
< Prev Up Next >
Advanced Settings Advanced Settings amazOOP Categories

Advanced configuration

Customize amazOOP to fit your exact needs...

Mauricio Diaz Orlich
Copyright 2004, Mauricio Diaz
(amazOOP 0.2)

Summary

As the title suggests, this documents deals with the more advanced section of amazOOP.

You should only modify the section described in this document if you fall into one of the following categories

  • You have fair knowledge and understanding of PHP and AWS.
  • You don't mind getting your hands dirty as long as you get to understand how the script works and you can customize it to fit your needs
It's a good idea to keep a backup copy of config.inc.php just in case you don't like the modifications you make after all.

Advanced configuration

This part basically contains a few tables that specify synonyms and shortcuts to be used in amazOOP for paramters sent to AWS.

If you don't understand what I'm saying, keep reading. Hopefully the examples will give you a better idea of what I'm talking about

Basic Information

The first two values that are defined are normally never modified.

$cacheRefreshTime defines values that can be used as time units to store information in the cache.

  1. $cacheRefreshTime = array('hour' => 3600,
  2. 'day' => 86400,
  3. 'week' => 604800,
  4. 'month' => 18144000
  5. );

$sites holds the address to the AWS server that should be used for each locale, as well as some parameters that are always sent to the server.

  1. $sites = array( "us" => "http://xml.amazon.com/onca/xml3?f=xml",
  2. "uk" => "http://xml-eu.amazon.com/onca/xml3?f=xml&locale=uk",
  3. "fr" => "",
  4. "ca" => "",
  5. "de" => "http://xml-eu.amazon.com/onca/xml3?f=xml&locale=de",
  6. "jp" => "http://xml.amazon.co.jp/onca/xml3?f=xml&locale=jp"
  7. );

Search Types

This array associates amazOOP "synonyms" with the corresponding AWS search type. Currently the supported types and their "synonyms" are:

amazOOP synonym AWS search type
Actor ActorSearch
Artist ArtistSearch
ASIN AsinSearch
ISBN AsinSearch
Author AuthorSearch
Blended BlendedSearch
BrowseNode BrowseNodeSearch
Director DirectorSearch
Keywords KeywordSearch
Manufacturer ManufacturerSearch
Power PowerSearch
Similarity SimilaritySearch
UPC UpcSearch

You can add/modify your own "synonyms" by assigning them to valid AWS search types.

  1. $searches = array( "Actor" => "ActorSearch",
  2. "Artist" => "ArtistSearch",
  3. "ASIN" => "AsinSearch",
  4. "ISBN" => "AsinSearch",
  5. "Author" => "AuthorSearch",
  6. "Blended" => "BlendedSearch",
  7. "BrowseNode" => "BrowseNodeSearch",
  8. "Director" => "DirectorSearch",
  9. "Keywords" => "KeywordSearch",
  10. "Manufacturer" => "ManufacturerSearch",
  11. "Power" => "PowerSearch",
  12. "Similarity" => "SimilaritySearch",
  13. "UPC" => "UpcSearch",
  14. );

Product Modes

As with search types, amazOOP also includes "synonyms" for product modes. Most of the time, amazOOP modes match directly AWS modes, but keeping a list of "synonyms" lets you map additional customized modes to the corresponding AWS mode.

According to the AWS SDK, the following are the officially supported product modes:

Product Line US mode parameter UK mode parameter DE mode parameter JP mode parameter
Books books books-uk books-de books-jp
Popular Music music music pop-music-de music-jp
Classical Music classical classical classical-de classical-jp
DVD dvd dvd-uk dvd-de dvd-jp
Video vhs vhs-uk vhs-de vhs-jp
Electronics electronics electronics-uk ce-de electronics-jp
Kitchen & Housewares kitchen kitchen-uk kitchen-de NA
Software software sw-vg-uk software-de software-jp
Computer & Video Games videogames video-games-uk video-games-de videogames-jp
Magazines magazines NA magazines-de NA
Toys & Games toys toys-uk NA NA
Camera & Photo photo NA NA NA
Baby baby NA NA NA
Outdoor Living garden NA NA NA
Computers pc-hardware NA NA NA
Tools & Hardware tools NA NA NA
English/Foreign Books NA NA books-de-intl-us books-us

You will see in the following example how I use synonyms to remove the trailing "dash locale" in international modes and to map several amazOOP modes to a single AWS mode.

You may also notice how amazOOP is enabled to use some non-official AWS modes such as apparel, gourmet, etc. Use them at your own risk

  1. $modes = array( "us" => array( "books" => "books",
  2. "music" => "music",
  3. "classical" => "classical",
  4. "dvd" => "dvd",
  5. "vhs" => "vhs",
  6. "electronics" => "electronics",
  7. "kitchen" => "kitchen",
  8. "software" => "software",
  9. "videogames" => "videogames",
  10. "magazines" => "magazines",
  11. "toys" => "toys",
  12. "photo" => "photo",
  13. "apparel" => "apparel",
  14. "baby" => "baby",
  15. "garden" => "garden",
  16. "computers" => "pc-hardware",
  17. "universal" => "universal",
  18. "all" => "all",
  19. "books_es" => "books",
  20. "sports" => "sporting",
  21. "gourmet" => "food",
  22. "jewelry" => "jewelry",
  23. "music_es" => "music",
  24. "software_es" => "software",
  25. "food" => "gourmet"
  26. ),
  27. "uk" => array( "books" => "books-uk",
  28. "music" => "music",
  29. "classical" => "classical",
  30. "dvd" => "dvd-uk",
  31. "vhs" => "vhs-uk",
  32. "electronics" => "electronics-uk",
  33. "kitchen" => "kitchen-uk",
  34. "software" => "software-uk",
  35. "videogames" => "video-games-uk",
  36. "toys" => "toys-uk",
  37. "all" => "all"
  38. ),
  39. "de" => array( "books" => "books-de",
  40. "books_en" => "books-de-intl-us",
  41. "books_fr" => "books-de-intl-us",
  42. "books_es" => "books-de-intl-us",
  43. "books_it" => "books-de-intl-us",
  44. "music" => "pop-music-de",
  45. "classical" => "classical-de",
  46. "dvd" => "dvd-de",
  47. "vhs" => "vhs-de",
  48. "electronics" => "ce-de",
  49. "kitchen" => "kitchen-de",
  50. "software" => "software-de",
  51. "videogames" => "video-games-de",
  52. "magazines" => "magazines-de",
  53. "all" => "all",
  54. "computers" => "pc-de",
  55. "photo" => "photo-de",
  56. "kitchen" => "kitchen-de-all",
  57. "universal" => "tools-de",
  58. "garden" => "garden-de",
  59. "health" => "hpc-de"
  60. ),
  61. "fr" => array(),
  62. "ca" => array(),
  63. "jp" => array( "books" => "books-jp",
  64. "books_en" => "books-us",
  65. "music" => "music-jp",
  66. "dvd" => "dvd-jp",
  67. "electronics" => "electronics-jp",
  68. "vhs" => "vhs-jp",
  69. "software" => "software-jp",
  70. "videogames" => "videogames-jp",
  71. "all" => "all"
  72. )
  73. );

Once this is configured, you are ready to start using amazOOP. AmazOOP can be further customized to fit your specific needs, however, you have to be confortable with PHP, and be armed with a lot of patience to understand the code. AmazOOP's advanced configuration is documented in the next section.

< Prev Up Next >
Advanced Settings Advanced Settings amazOOP Categories
 
Documentation generated on Sat, 21 Aug 2004 17:39:30 +0200 by phpDocumentor 1.3.0RC3
hosted by
SourceForge.net Logo