Class TemplateFilesRepository

java.lang.Object
org.spincast.website.repositories.TemplateFilesRepository
All Implemented Interfaces:
NewsRepository

public class TemplateFilesRepository extends Object implements NewsRepository
Implementation of the News repository that takes the news entries from template files.
  • Constructor Details

    • TemplateFilesRepository

      @Inject public TemplateFilesRepository(org.spincast.website.AppConfig appConfig, TemplatingEngine templatingEngine, SpincastUtils spincastUtils, JsonManager jsonManager)
      Constructor
  • Method Details

    • init

      @Inject public void init()
      Init
    • getAppConfig

      protected org.spincast.website.AppConfig getAppConfig()
    • getTemplatingEngine

      protected TemplatingEngine getTemplatingEngine()
    • getSpincastUtils

      protected SpincastUtils getSpincastUtils()
    • getJsonManager

      protected JsonManager getJsonManager()
    • getNewsEntriesTotalNumber

      public int getNewsEntriesTotalNumber()
      Description copied from interface: NewsRepository
      Gets news entries number.
      Specified by:
      getNewsEntriesTotalNumber in interface NewsRepository
    • getNewsEntries

      public List<NewsEntry> getNewsEntries(boolean ascOrder)
      Description copied from interface: NewsRepository
      Gets all the news entries.
      Specified by:
      getNewsEntries in interface NewsRepository
      Parameters:
      ascOrder - If true, returns the entries by their publication date in ascending order. Otherwise, in descending order.
    • getNewsEntries

      public List<NewsEntry> getNewsEntries(int startPos, int endPos, boolean ascOrder)
      Description copied from interface: NewsRepository
      Gets news entries.
      Specified by:
      getNewsEntries in interface NewsRepository
      Parameters:
      startPos - The position of the first entry to return. The first element is "1", not "0".
      endPos - The position of the last entry to return (inclusive).
      ascOrder - If true, returns the entries by their publication date in ascending order. Otherwise, in descending order.
    • getNewsEntriesAndTotalNbr

      public NewsEntriesAndTotalNbr getNewsEntriesAndTotalNbr(int startPos, int endPos, boolean ascOrder)
      Description copied from interface: NewsRepository
      Gets news entries and the number total of entries in the data source.
      Specified by:
      getNewsEntriesAndTotalNbr in interface NewsRepository
      Parameters:
      startPos - The position of the first entry to return. The first element is "1", not "0".
      endPos - The position of the last entry to return (inclusive).
      ascOrder - If true, returns the entries by their publication date in ascending order. Otherwise, in descending order.
    • getNewsEntry

      public NewsEntry getNewsEntry(long newsId)
      Description copied from interface: NewsRepository
      Gets a specific news entry.
      Specified by:
      getNewsEntry in interface NewsRepository
      Returns:
      the news entry or null if not found.
    • getNewsEntriesById

      protected Map<Long,NewsEntry> getNewsEntriesById()
    • getNewsEntriesLocal

      protected List<NewsEntry> getNewsEntriesLocal()