Class TableViewService
java.lang.Object
edu.kit.datamanager.takita.mainpage.dashboard.contentview.TableViewService
- All Implemented Interfaces:
IContentViewService
Implementation of ContentView Service for type TableView.
Has specific methods for TableView Content, such as get Thumbnails,
add Attribute, delete Attribute.
Has a name/type of ContentView it is implementing and holds the Attributes
that are currently selected to be displayed.
-
Constructor Summary
ConstructorsConstructorDescriptionTableViewService(ISearchIndexService searchIndexService, ISearchService searchService, IAssistanceService assistanceService) Constructor for the Table View Service to autowire required instances. -
Method Summary
Modifier and TypeMethodDescriptionintgets current page number.org.springframework.boot.configurationprocessor.json.JSONArraygetData()Gets results and formats them in JSON Array for table to read.getFirstPage(String manuscriptId) Gets the id of the first Page of the Manuscript with the specified id.longGets all Pages of a Manuscript from searchIndexService.Gets search Results from Search Service.Gets sortField.getType()Gets Type of content view.booleanGet SortAsc boolean.search()Trigger search.voidsetCurrentPage(int currentPage) Sets current page number.voidsetNumberOfResults(int numberOfResults) voidsetSortAscending(boolean sortAscending) Sets sortAsc boolean.voidsetSortField(String sortField) Sets sortField.voidupdateModel(org.springframework.ui.Model model) Update Model with everything from tableViewService.
-
Constructor Details
-
TableViewService
@Autowired public TableViewService(ISearchIndexService searchIndexService, ISearchService searchService, IAssistanceService assistanceService) Constructor for the Table View Service to autowire required instances.- Parameters:
searchIndexService- instance of the logic for search index. Injected with Springs dependency injection system indicated by @autowired annotation.searchService- instance of the logic for search. Injected with Springs dependency injection system indicated by @autowired annotation.assistanceService- instance of the logic for user management. Injected with Springs dependency injection system indicated by @autowired annotation.
-
-
Method Details
-
search
Trigger search.- Returns:
- List of Manuscripts
-
getResults
Gets search Results from Search Service.- Returns:
- List of Manuscripts
-
getType
Gets Type of content view.- Specified by:
getTypein interfaceIContentViewService- Returns:
- type of content view as String
-
getCurrentPage
public int getCurrentPage()gets current page number.- Returns:
- current page number
-
setCurrentPage
public void setCurrentPage(int currentPage) Sets current page number.- Parameters:
currentPage- number to be set
-
isSortAscending
public boolean isSortAscending()Get SortAsc boolean.- Returns:
- if SortAsc is true
-
setSortAscending
public void setSortAscending(boolean sortAscending) Sets sortAsc boolean.- Parameters:
sortAscending- bool to be set
-
getSortField
Gets sortField.- Returns:
- sortField
-
setSortField
Sets sortField.- Parameters:
sortField- to be set
-
getPages
Gets all Pages of a Manuscript from searchIndexService.- Parameters:
manuscriptId- of manuscript- Returns:
- List of pages
- Throws:
NoSuchIndexEntryException- when there is no manuscript with the given ID in the search index
-
getFirstPage
Gets the id of the first Page of the Manuscript with the specified id.- Parameters:
manuscriptId- of manuscript- Returns:
- the id of the first page
- Throws:
NoSuchIndexEntryException- when there is no manuscript with this ID in the search index
-
updateModel
public void updateModel(org.springframework.ui.Model model) Update Model with everything from tableViewService.- Parameters:
model- the holder for model attributes, used to pass attributes back to the view
-
setNumberOfResults
public void setNumberOfResults(int numberOfResults) -
getNumberOfResultsPages
public long getNumberOfResultsPages() -
getData
public org.springframework.boot.configurationprocessor.json.JSONArray getData() throws org.springframework.boot.configurationprocessor.json.JSONExceptionGets results and formats them in JSON Array for table to read.- Returns:
- table data as JSONArray
- Throws:
org.springframework.boot.configurationprocessor.json.JSONException- if the data could not be parsed to a JSONObject
-