java.lang.Object
edu.kit.datamanager.takita.mainpage.dashboard.contentview.TableViewService
All Implemented Interfaces:
IContentViewService

@SessionScope @Service public class TableViewService extends Object implements 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 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

      public List<Manuscript> search()
      Trigger search.
      Returns:
      List of Manuscripts
    • getResults

      public List<Manuscript> getResults()
      Gets search Results from Search Service.
      Returns:
      List of Manuscripts
    • getType

      public String getType()
      Gets Type of content view.
      Specified by:
      getType in interface IContentViewService
      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

      public String getSortField()
      Gets sortField.
      Returns:
      sortField
    • setSortField

      public void setSortField(String sortField)
      Sets sortField.
      Parameters:
      sortField - to be set
    • getPages

      public List<Page> getPages(String manuscriptId) throws NoSuchIndexEntryException
      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

      public String getFirstPage(String manuscriptId) throws NoSuchIndexEntryException
      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.JSONException
      Gets 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