Package com.apps.datastore.dao

Examples of com.apps.datastore.dao.BookInformation


  @Test
  public void test() {
   
    SaveonbookService sss = SaveonBookServiceFactory.getSaveonbookService();
    BookInformation testbi = new BookInformation("Discrete Mathematics W/Applications 4/E", "Required", "EPP", "9780495391326");

    List<SaveonBookModel> sbml1 =  sss.search(testbi);
    List<SaveonBookModel> sbml2 =  sss.titleSearch("Discrete Mathematics with Applications");
   
    assertTrue(sbml2.get(0).getCourse().equals(">CPSC121"));
View Full Code Here


                isbn = s;
                break;
             
              books = books.substring(books.indexOf("</td>") + 5);
            }
            bookList.add(new BookInformation(title,required,author,isbn));
          }
        }
      }
      if (line.contains("Note: The remaining seats in this section are only available through a Standard Timetable (STT)")) {
        return 0;
View Full Code Here

      List<BookInformation> biol = new ArrayList<BookInformation>();
      biol.addAll(w.getBookList());
      builder.append("\t<error>none</error>\n");
      // out += "\t<error>none</error>\n";
      for (Iterator<BookInformation> i = biol.iterator(); i.hasNext();) {
        BookInformation bi = i.next();
        builder.append("\t<book>\n");
        builder.append("\t\t<title>"
            + StringEscapeUtils.escapeXml(bi.getTitle())
            + "</title>\n");
        builder.append("\t\t<required>"
            + StringEscapeUtils.escapeXml(bi.getRequired())
            + "</required>\n");
        builder.append("\t\t<author>"
            + StringEscapeUtils.escapeXml(bi.getAuthor())
            + "</author>\n");
        builder.append("\t\t<isbn>" + bi.getISBN() + "</isbn>\n");
        builder.append("\t</book>\n");

        // out += "\t<book>\n";
        // out += "\t\t<title>" +
        // StringEscapeUtils.escapeXml(bi.getTitle()) + "</title>\n";
View Full Code Here

    out += "<tr>\n";
    out += "Books: \n";
    out += "</tr>\n";
    }
    for(Iterator<BookInformation> i = biol.iterator(); i.hasNext();){
      BookInformation bio = i.next();
      SaveonbookService sbss = SaveonBookServiceFactory.getSaveonbookService();
      String optimizedTitle = sbss.getOptimizedTitle(bio);
      String searchTitle = optimizedTitle.replaceAll(" ", "%20");
      out += "<tr>\n";
      out += "<table>\n";
      out += "<tr>\n";
      out += "<a href=\"http://saveonbook.com/search/title-search.jsp?title="+searchTitle+"&active=0\">SaveOnBook</a>";
      out += "</tr>\n";
      out += "<tr>\n";
      out += "<td><b>Title: </b>"+bio.getTitle()+" - "+bio.getRequired()+"</td>\n";
      int pr[] = sbss.getPriceRange(sbss.titleSearch(optimizedTitle));
      out += "<td><b>Price Range </b>: $"+pr[0]+" - $"+pr[1]+"</td>\n";
      out += "</tr>\n";
      out += "</table>\n";
      out += "</tr>\n";
    }
    for(Iterator<BookInformation> i = biol.iterator(); i.hasNext();){
      BookInformation bio = i.next();
      AmazonWebService aws = AmazonWebServiceFactory.getAmazonWebService();
      AmazonBookModel abm = aws.search(bio.getISBN());
      out += "<tr>\n";
      out += "<table>\n";
      if (!abm.getAsin().equals("")) {
        out += "<tr>\n";
        out += "<a href=\"" + abm.getDetailUrl() + "\">Amazon</a>";
        out += "</tr>\n";
        out += "<tr>\n";
        out += "<td><img src=\"" + abm.getImageUrl() + "\"></td>\n";
        out += "<td><b>Title: </b>" + abm.getTitle() + " - "
            + bio.getRequired() + "</td>\n";
        out += "</tr>\n";
        out += "<tr>\n";
        out += "<td><b>Price(New): </b>" + abm.getPriceNew()
            + "</td>\n";
        out += "</tr>\n";
View Full Code Here

 
  public void doGet(HttpServletRequest req, HttpServletResponse resp) {
    String title = UrlEncodingUtils.decodeURL(req.getParameter("title"));
    String author =  UrlEncodingUtils.decodeURL(req.getParameter("author"));
    String isbn =  UrlEncodingUtils.decodeURL(req.getParameter("isbn"));
    BookInformation bi = new BookInformation(title,"",author, isbn);
    String optimizedtitle = sbss.getOptimizedTitle(bi);
    List<SaveonBookModel> sbml = sbss.titleSearch(optimizedtitle);
    int[] priceRange = sbss.getPriceRange(sbml);
    String low = "$"+priceRange[0];
    String high = "$"+priceRange[1];
View Full Code Here

TOP

Related Classes of com.apps.datastore.dao.BookInformation

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.