public class TemplateFilesRepository extends Object implements NewsRepository
| Constructor and Description |
|---|
TemplateFilesRepository(AppConfig appConfig,
org.spincast.core.templating.TemplatingEngine templatingEngine,
org.spincast.core.utils.SpincastUtils spincastUtils,
org.spincast.core.json.JsonManager jsonManager)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
protected AppConfig |
getAppConfig() |
protected org.spincast.core.json.JsonManager |
getJsonManager() |
List<NewsEntry> |
getNewsEntries(boolean ascOrder)
Gets all the news entries.
|
List<NewsEntry> |
getNewsEntries(int startPos,
int endPos,
boolean ascOrder)
Gets news entries.
|
NewsEntriesAndTotalNbr |
getNewsEntriesAndTotalNbr(int startPos,
int endPos,
boolean ascOrder)
Gets news entries and the number total of entries in the data source.
|
protected Map<Long,NewsEntry> |
getNewsEntriesById() |
protected List<NewsEntry> |
getNewsEntriesLocal() |
int |
getNewsEntriesTotalNumber()
Gets news entries number.
|
NewsEntry |
getNewsEntry(long newsId)
Gets a specific news entry.
|
protected org.spincast.core.utils.SpincastUtils |
getSpincastUtils() |
protected org.spincast.core.templating.TemplatingEngine |
getTemplatingEngine() |
void |
init()
Init
|
@Inject public TemplateFilesRepository(AppConfig appConfig, org.spincast.core.templating.TemplatingEngine templatingEngine, org.spincast.core.utils.SpincastUtils spincastUtils, org.spincast.core.json.JsonManager jsonManager)
@Inject public void init()
protected AppConfig getAppConfig()
protected org.spincast.core.templating.TemplatingEngine getTemplatingEngine()
protected org.spincast.core.utils.SpincastUtils getSpincastUtils()
protected org.spincast.core.json.JsonManager getJsonManager()
public int getNewsEntriesTotalNumber()
NewsRepositorygetNewsEntriesTotalNumber in interface NewsRepositorypublic List<NewsEntry> getNewsEntries(boolean ascOrder)
NewsRepositorygetNewsEntries in interface NewsRepositoryascOrder - If true, returns the entries by their
publication date in ascending order. Otherwise, in descending
order.public List<NewsEntry> getNewsEntries(int startPos, int endPos, boolean ascOrder)
NewsRepositorygetNewsEntries in interface NewsRepositorystartPos - 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.public NewsEntriesAndTotalNbr getNewsEntriesAndTotalNbr(int startPos, int endPos, boolean ascOrder)
NewsRepositorygetNewsEntriesAndTotalNbr in interface NewsRepositorystartPos - 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.public NewsEntry getNewsEntry(long newsId)
NewsRepositorygetNewsEntry in interface NewsRepositorynull if not found.Copyright © 2017. All rights reserved.