Class TemplateFilesRepository
java.lang.Object
org.spincast.website.repositories.TemplateFilesRepository
- All Implemented Interfaces:
NewsRepository
Implementation of the News repository that takes the
news entries from template files.
-
Constructor Summary
ConstructorsConstructorDescriptionTemplateFilesRepository(org.spincast.website.AppConfig appConfig, TemplatingEngine templatingEngine, SpincastUtils spincastUtils, JsonManager jsonManager) Constructor -
Method Summary
Modifier and TypeMethodDescriptionprotected org.spincast.website.AppConfigprotected JsonManagergetNewsEntries(boolean ascOrder) Gets all the news entries.getNewsEntries(int startPos, int endPos, boolean ascOrder) Gets news entries.getNewsEntriesAndTotalNbr(int startPos, int endPos, boolean ascOrder) Gets news entries and the number total of entries in the data source.intGets news entries number.getNewsEntry(long newsId) Gets a specific news entry.protected SpincastUtilsprotected TemplatingEnginevoidinit()Init
-
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
-
getSpincastUtils
-
getJsonManager
-
getNewsEntriesTotalNumber
public int getNewsEntriesTotalNumber()Description copied from interface:NewsRepositoryGets news entries number.- Specified by:
getNewsEntriesTotalNumberin interfaceNewsRepository
-
getNewsEntries
Description copied from interface:NewsRepositoryGets all the news entries.- Specified by:
getNewsEntriesin interfaceNewsRepository- Parameters:
ascOrder- Iftrue, returns the entries by their publication date in ascending order. Otherwise, in descending order.
-
getNewsEntries
Description copied from interface:NewsRepositoryGets news entries.- Specified by:
getNewsEntriesin interfaceNewsRepository- 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- Iftrue, returns the entries by their publication date in ascending order. Otherwise, in descending order.
-
getNewsEntriesAndTotalNbr
Description copied from interface:NewsRepositoryGets news entries and the number total of entries in the data source.- Specified by:
getNewsEntriesAndTotalNbrin interfaceNewsRepository- 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- Iftrue, returns the entries by their publication date in ascending order. Otherwise, in descending order.
-
getNewsEntry
Description copied from interface:NewsRepositoryGets a specific news entry.- Specified by:
getNewsEntryin interfaceNewsRepository- Returns:
- the news entry or
nullif not found.
-
getNewsEntriesById
-
getNewsEntriesLocal
-