Photo Search Demonstration

The Photo Search demonstration shows you how the XQueryWebService framework can be used with DataDirect XQuery to build a photo database search tool that allows you to query a database, create new user accounts, and perform other administrative tasks. If you want to try the Photo Search Web service demonstration before reading about it, click here.

Note: The Photo Search demonstration uses the Flickr API but is not endorsed or certified by Flickr.


Getting Started

The Photo Search demonstration lets you create a user account and search Flickr for photographs using any keywords that you specify. As shown in the following illustration, to get started all you need to do is login — you can use any value you like for a user name. DataDirect does not record or share any of the information you provide (user name, search terms, and so on).

If you look closely at the URL, you'll see that the file extension is, perhaps, not what you might expect — it's .xquery. The HTML for the login page, as well as for all the other pages in this application, was generated using XQuery. (See for yourself — clicking the View Source button, which you can do from any page of the application, displays static HTML of the XQuery source responsible for generating the page of the Photo Search application you're looking at. You'll learn more about View Source and other tool bar functions in a later topic.)

Once you've logged in, the Photo Search application displays the search page. On this page, you can

  • Specify a search term (the default is Boston downtown)
  • Specify the number of results you want returned (the default is 10)
  • Display all previously run queries
  • Delete all previously run queries

When you click the Search button, the Flickr photos are searched using the keywords you specified; after a moment, thumbnails of the photos matching your search criteria are displayed. If we use the search term XQuery, for example, we find several photos of XQuery conferences and XQuery experts such as Michael Kay and Daniela Florescu.

After you've run a few search terms through the Photo Search demonstration, click the Show me my queries button. In a moment, the application displays a list, sorted chronologically, of all the queries you have run.

You can rerun a search by simply clicking the term in the list. Or, if you want to start fresh, you can click Delete my queries to delete all query history.


What's Next?

The DataDirect XQuery Photo Search demonstration application uses numerous technologies — there's XQuery and Web services, of course, but there's also the REST transport mechanism, HTML, and SQL, among others. A high-level view of the application architecture is shown on the following page.