1 5 package org.exoplatform.faces.search.component.model; 6 7 import org.apache.lucene.document.Document ; 8 import org.exoplatform.commons.utils.PageList; 9 import org.exoplatform.faces.core.component.model.PageListDataHandler; 10 import org.exoplatform.services.indexing.HitPageList; 11 import org.exoplatform.services.indexing.IndexingService; 12 13 14 19 public class DocumentDataHandler extends PageListDataHandler { 20 private Document doc_ ; 21 private float score_ ; 22 private HitPageList hits_ ; 23 24 public String getData(String fieldName) { 25 return "N/A" ; 26 } 27 28 public void setPageList(PageList pageList) throws Exception { 29 hits_ = (HitPageList)pageList ; 30 super.setPageList(pageList) ; 31 } 32 33 public String getTitle() { return doc_.get(IndexingService.TITLE_FIELD) ; } 34 public String getDescription() { return doc_.get(IndexingService.DESCRIPTION_FIELD) ; } 35 public String getAuthor() { return doc_.get(IndexingService.AUTHOR_FIELD) ; } 36 public String getDocumentId() { return doc_.get(IndexingService.IDENTIFIER_FIELD) ; } 37 public String getModule() { return doc_.get(IndexingService.MODULE_FIELD) ; } 38 public float getScore() { return score_ ; } 39 40 public void setCurrentObject(Object o) { 41 doc_ = (Document) o; 42 score_ = hits_.getScoreOfDocumentInPage(getCurrentRow()) ; 43 } 44 } | Popular Tags |