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
ConstructorDescriptionTemplateFilesRepository
(org.spincast.website.AppConfig appConfig, TemplatingEngine templatingEngine, SpincastUtils spincastUtils, JsonManager jsonManager) Constructor -
Method Summary
Modifier and TypeMethodDescriptionprotected org.spincast.website.AppConfig
protected JsonManager
getNewsEntries
(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.int
Gets news entries number.getNewsEntry
(long newsId) Gets a specific news entry.protected SpincastUtils
protected TemplatingEngine
void
init()
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:NewsRepository
Gets news entries number.- Specified by:
getNewsEntriesTotalNumber
in interfaceNewsRepository
-
getNewsEntries
Description copied from interface:NewsRepository
Gets all the news entries.- Specified by:
getNewsEntries
in interfaceNewsRepository
- Parameters:
ascOrder
- Iftrue
, returns the entries by their publication date in ascending order. Otherwise, in descending order.
-
getNewsEntries
Description copied from interface:NewsRepository
Gets news entries.- Specified by:
getNewsEntries
in 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:NewsRepository
Gets news entries and the number total of entries in the data source.- Specified by:
getNewsEntriesAndTotalNbr
in 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:NewsRepository
Gets a specific news entry.- Specified by:
getNewsEntry
in interfaceNewsRepository
- Returns:
- the news entry or
null
if not found.
-
getNewsEntriesById
-
getNewsEntriesLocal
-