6. We are now implementing the getters and setters for the book.java class. Enter the following in book.java class: private String title; private String url; private String isbn; private String publisher; private String author; Look at the picture below.

– select in the main menu of jdeveloper > source > Generate Accessors – select all items and click ok. – the getters and setter will be generated. 7. Define the book constructor in book.java class, like the example below.

– Select AmazonSearch.java and insert: ArrayList books = new ArrayList(); See example: – ArrayList will be red underlined, import java.util.ArrayList package. – We need the get and set method for the books ArrayList. Select in the main menu source > Generate Accessors, then select books item and click ok.

13. We must now implement the methods for obtaining results of the search action we will do in our AmazonSearch.jsp page. Weâ€™ve already made a method which is used by the commandButton. 14. The method search() triggers the method searchBooks(). This method has two parameters. The first parameter is the selected criteria in the jsp file and the second parameter is the entered value by the user. – The for loop within the method is used to call different pages. Amazon has restricted the maximum page at 400. – An if statement is used to determine which method must be called to get the proper data. – The rest of the method is used to put the book items in an ArrayList.

15. The ItemSearchRequest object is been used to search with the criteriaâ€™s: author, title, keyword. Therefore there has been made a different method which returns a ItemsType2[] array. The returnvalue will be used to retrieve the items for the searchBooks method. The method is displayed below. Copy and paste this method into AmazonSearch.java class.

16. To enable the searchcriteria: isbn, we cannot use the ItemSearchRequest object, but we must use the ItemLookupRequest object. Therefore we have to make an extra method to retrieve the items in an ItemsType2[] array. The method is displayed below. Copy and paste the method to the AmazonSearch.java class file.

import oracle.adf.view.faces.component.core.input.CoreInputText; import oracle.adf.view.faces.component.core.input.CoreSelectOneChoice; 18. The final thing we have to do is creating a map in de project and insert a transparent gif file in this map. – Create a map in the window explorer like the example below, call the map: images – Find a transparant picture at google pictures – Call it k4transparant.gif – Resize the picture if you are compelled to. – An example of a transparent picture is shown next. 19. Finished, you are now able to run the AmazonSearch.jsp file, an example of the project is shown below.

meta

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 236 other subscribers

Email Address

About

AMIS is internationally recognized for its deep technological insight in Oracle technology. This knowledge is reflected in the presentations we deliver at international conferences such as Oracle OpenWorld, Hotsos and many user conferences around the world. Our AMIS Technology Blog, the most referred Oracle technology knowledge base outside the oracle.com domain. However you arrived here, we appreciate your interest in AMIS. Link to our Google+ Profile AMIS