Package org.corrib.s3b.mbb.beans

Examples of org.corrib.s3b.mbb.beans.Book


  }
 

  protected JSONObject jsonBook(Map<String, Map<String, Collection<String>>> triples, String resource, String serverAddress){
    Map<String, Collection<String>> value = triples.get(resource);
    Book book = MbbTypes.getBook(value, triples);
    JSONObject object = new JSONObject();
    object.put("type", "Book");
    object.put("id", resource);
    object.put("uri", resource);

    if(book != null){
      object.put("bookType", book.getBookType());
      object.put("label", book.getTitle());
      object.put("abstract", book.getAbstr());
     
      JSONArray authors = new JSONArray();
      if(book.getAuthors() != null)
        for(Person author : book.getAuthors())
          authors.add(author.getName());
     
      object.put("creator", authors);
     
      JSONArray keywords = new JSONArray();
      if(book.getKeywords() != null)
        keywords.addAll(book.getKeywords());
     
      object.put("keywords", keywords);
     
      this.addProperties(object, book.getOtherProperties());

      String coverFile = (book.getCover() != null)?book.getCover():"image/def_cover_page.jpg";
      object.put("cover", serverAddress+"servlet/showImage?from=cover&file="+coverFile+"&type="+((book.getCoverMime()!=null)?book.getCoverMime():"image/jpg")+"&w=50");
     
    }
   
   
    return object;
View Full Code Here

TOP

Related Classes of org.corrib.s3b.mbb.beans.Book

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.