@Named(value="search") @ApplicationScoped public class SearchManagedBean extends Object
| Constructor and Description |
|---|
SearchManagedBean()
Empty builder for SearchManagedBean
|
| Modifier and Type | Method and Description |
|---|---|
int |
calculateTotalPageNumber()
Calculates the total number of pages and returns the value
|
void |
changePage(int pageNumber,
String keyword)
Changes the current page and refresh the page
|
void |
changePageSize(int pageSize,
String keyword)
Changes the page size and refresh the page
|
int |
getCurrentPageNumber()
Returns the current page number
|
String |
getKeyword()
Returns the keyword
|
int |
getPageSize()
Returns the pageSize
|
List<es.uvigo.esei.dgss.microstories.domain.Story> |
getStoriesByText()
Returns a list of stories based on the current page and the current size
|
List<es.uvigo.esei.dgss.microstories.domain.Story> |
getStoriesByText(int pageNumber)
Returns a list of stories based on the pageNumber
|
int |
getTotalPageNumber()
Returns the total number of pages
|
List<Integer> |
getTotalPageNumberList()
Returns a list of integers based on the current page and the total number of pages
It calculates the number of pages that can be displayed in the pagination bar
|
long |
getTotalSearchRows(String searchedWord)
Returns the total number of stories in a search
|
String |
goToIndex()
Go to home view
|
String |
goToSearch()
Go to search view
|
String |
goToSearchPage1()
Updates currentPageNumber to 1 and the total number of pages and goes to search view
|
void |
init() |
boolean |
isCurrentPage(int pageNumber)
Returns true if the current page matches the value passed
|
boolean |
isFirstPage()
Returns true if the current page is 1
|
boolean |
isLastPage()
Returns true if the current page is the last one
|
void |
nextPage(String keyword)
Changes the current page to the next one
|
void |
previousPage(String keyword)
Changes the page to the previous one
|
void |
setCurrentPageNumber(int currentPageNumber)
Modifies the current page number
|
void |
setKeyword(String keyword)
Modifies the keyword
|
void |
setPageSize(int pageSize)
Modifies the pageSize
|
void |
setTotalPageNumber(int totalPageNumber)
Modifies the total number of pages
|
@PostConstruct public void init()
public String getKeyword()
public void setKeyword(String keyword)
keyword - public List<es.uvigo.esei.dgss.microstories.domain.Story> getStoriesByText(int pageNumber)
pageNumber - public List<es.uvigo.esei.dgss.microstories.domain.Story> getStoriesByText()
public long getTotalSearchRows(String searchedWord)
searchedWord - public int getPageSize()
public void setPageSize(int pageSize)
pageSize - public int getCurrentPageNumber()
public void setCurrentPageNumber(int currentPageNumber)
currentPageNumber - public int getTotalPageNumber()
public void setTotalPageNumber(int totalPageNumber)
totalPageNumber - public int calculateTotalPageNumber()
public List<Integer> getTotalPageNumberList()
public void changePage(int pageNumber,
String keyword)
pageNumber - keyword - public void changePageSize(int pageSize,
String keyword)
pageSize - keyword - public boolean isFirstPage()
public boolean isLastPage()
public void nextPage(String keyword)
keyword - public void previousPage(String keyword)
keyword - public boolean isCurrentPage(int pageNumber)
pageNumber - public String goToSearch()
public String goToSearchPage1()
public String goToIndex()
Copyright © 2020. All rights reserved.