Integration

Introduction | iFrame | HTML Inclusion | HTML Inclusion (Ajax/Proxy) | XML

Introduction

The SDAPlus sites provides three different search options: web sites, yellow pages, and products. Each one of these options has its own URI:

  • web - http://www.sdaplus.com/search/web.aspx
  • yellowpages - http://www.sdaplus.com/search/yellowpages.aspx
  • products - http://www.sdaplus.com/search/products.aspx

There are also three different ways to get the search results for the above mentioned options:

We provided an SDAPlus-like CSS stylesheet you can use to manage the display options for your search results. You can use this file as is (just put its address as a form parameter or link directive in your page) or you can download it and change the display options manually.

It is important to mention that you must not change CSS class names, but only the styles predefined in it, since the search engine generates HTML tags with predefined class attributes.

Our CSS stylesheet URI is: http://www.sdaplus.com/search/css/search.css.

For some types of search you will need to include the javascript files. Those files are located at:

Download all examples and resources.

iFrame

Your page needs to have a search form and an IFRAME element where it loads results.

Search form needs to have the following attributes:

  • action - absolute path to our search script, excluding QUERY_STRING
  • target - the name of your IFRAME element (e.g. 'result') where the results will be shown

Once you choose the location for your IFRAME element, you need to set its name attribute. This attribute needs to have the same value as the target attribute mentioned above (e.g. 'result').

Mandatory fields for the search form:

  • search - text field where the search phrase is entered
  • dataType - type of the requested result: this value must always be HTML_PAGE

Optional fields for the search form:

  • show - if you wish to show all possible results, then the value for this field must be set to all
  • pageNumber - desired page for the results (if there is more than one page)
  • itemsPerPage - number of results that show up on each page
  • cssUri - absolute path to the CSS stylesheet with predefined styles; this file will be imported through the LINK directive in resulting page
  • showTopMenu - if you want to include top navigation menu set this field value to yes
  • showSearchForm - if you want to include search form in the page set this field value to yes
  • itemLinkTarget - name of the window where the item's url will be loaded; predefined values are: _self - current window (default), _blank - new window, _parent - parent window (in case of popup or framesets)

To manage display options you can use our predefined CSS stylesheet or you can download it and change classes. CSS stylesheet path must be specified as cssUri parameter in the search form.

Example

HTML Inclusion

If you want to embed search results into your page, you'll have to request the search and write the results into the desired location. However, in order to generate the results, you need to process parameters yourself and then send the search request.

Both mandatory and optional parameters need to be sent to the search page. Once you get the results, you can process them on your page.

There are specific requirements for this type of search: you need include javascript scripts used to process page links in the search result - jquery.js and html_segment.js. They have to be embedded in the HEAD section of the page, e.g:

Your page needs to have a search form with the following attributes:

  • action - path to a location that will process parameters and display results; this is usually the same page that contains the search form

Mandatory fields for the search form:

  • search - text field where the search phrase is entered
  • dataType - type of the requested result: this value must always be HTML_SEGMENT

Optional fields for the search form:

  • show - if you wish to show all possible results, the value for this field must be set to all
  • pageNumber - desired result page (if there is more than one page)
  • itemsPerPage - number of results showing up on each page
  • itemLinkTarget - name of the window where item's url will be loaded; predefined values are: _self - current window (default), _blank - new widnow, _parent - parent window (in case of popup od framesets)

You can manage your display options with our predefined CSS stylesheet or you can download it and change the classes manually. The CSS stylesheet can be included using the LINK directive or the CSS @import directive.

Example - ASPX

Example - PHP

HTML Inclusion (Ajax/Proxy)

If you want to embed search results to your page, you need to request the search and write the results to a desired location. However, in order to get the results, you need to place a particular Proxy file somewhere on your web server so you can access it. Also, place the javascript include directives in the head section of the page.

Proxy is used to retrieve the search results from the search engine, and the javascripts files are used to post-process the page links of the result.

proxy.aspx - to be used for the IIS web server - download

proxy.php - to be used for the PHP-enabled web server - download

* Note that you can write your own Proxy using your favorite programming language following the flow of our proxies.

Javascript files should be used like this (in the HEAD section):

* It is important to set the proxy variable in your page to a path where the chosen Proxy resides. For example:

<script type="text/javascript">
	proxy = "proxy.aspx"; // for ASPX proxy
	proxy = "proxy.php"; // for PHP proxy
</script>
					

Proxy accepts the following mandatory parameters:

  • searchType - the kind of search you request - web, yellowpages or products
  • search - search phrase
  • dataType - type of the requested result: this value must always be HTML_SEGMENT

Additionally, Proxy accepts the following optional parameters:

  • show - the value for this field must be set to all if you wish to show all possible results
  • pageNumber - desired result page (if there is more than one page)
  • itemsPerPage - number of results that show up on each page
  • cssUri - absolute path to the CSS stylesheet with predefined styles; this file will be imported through the LINK directive in the resulting page
  • showTopMenu - set this field value to yes if you want to include the top navigation menu
  • showSearchForm - set this field value to yes if you want to include the search form in the page
  • itemLinkTarget - name of the window where the item's url will be loaded; predefined values are: _self - current window (default), _blank - new widnow, _parent - parent window (in case of popup or framesets)

Examples: for PHP Proxy, for ASPX Proxy

XML

If you want to get the search results in an XML format, you need to make the search request with both mandatory and optional parameters.

Search requests have to be sent to an URI (e.g. http://www.sdaplus.com/search/web.aspx).

There are some mandatory and optional parameters you need to include in the request.

Mandatory parameters:

  • search - search phrase
  • dataType - type of the requested result: this value must always be XML

Optional parameters:

  • show - if you wish to show all possible results, then the value for this parameter must be set to all
  • pageNumber - desired page of result (if there is more than one page)
  • itemsPerPage - number of results that show up on each page
  • showTopMenu - if you want to include links to other search types, set this parameter to yes

URIs for the full search request must look like the following (you may vary parameter list):

http://www.sdaplus.com/search/web.aspx?search=hello&dataType=XML
http://www.sdaplus.com/search/web.aspx?search=hello&dataType=XML&show=all
http://www.sdaplus.com/search/web.aspx?search=hello&dataType=XML&show=all&showTopMenu=yes

http://www.sdaplus.com/search/web.aspx?search=hello&dataType=XML&pageNumber=2&itemsPerPage=10
http://www.sdaplus.com/search/web.aspx?search=hello&dataType=XML&pageNumber=2&itemsPerPage=10&showTopMenu=yes
					

Example - XML - with results for all search types