info.magnolia.module.rssaggregator.templates.components
Class AbstractFeedModel<RD extends info.magnolia.rendering.template.RenderableDefinition>

java.lang.Object
  extended by info.magnolia.rendering.model.RenderingModelImpl<RD>
      extended by info.magnolia.module.rssaggregator.templates.components.AbstractFeedModel<RD>
Type Parameters:
RD - Definition type.
All Implemented Interfaces:
info.magnolia.rendering.model.RenderingModel<RD>
Direct Known Subclasses:
CombinedFeedModel, FeedListModel, FeedStatisticsModel, FeedSubscriptionsModel, PlanetFeedModel

public abstract class AbstractFeedModel<RD extends info.magnolia.rendering.template.RenderableDefinition>
extends info.magnolia.rendering.model.RenderingModelImpl<RD>
implements info.magnolia.rendering.model.RenderingModel<RD>

Base class for rendering models.

Version:
$Id:$
Author:
had

Field Summary
protected static String FEEDS_NODE
           
protected static org.slf4j.Logger log
           
protected static int MAX_RESULTS
           
static String ORDER_BY_PUBLICATION_DATE
           
static String ORDER_BY_TITLE_NAME
           
static String SORT_ASCENDING
           
static String SORT_DESCENDING
           
protected  info.magnolia.templating.functions.TemplatingFunctions templatingFunctions
           
 
Fields inherited from class info.magnolia.rendering.model.RenderingModelImpl
content, contentMap, definition, parentModel
 
Fields inherited from interface info.magnolia.rendering.model.RenderingModel
SKIP_RENDERING
 
Constructor Summary
AbstractFeedModel(javax.jcr.Node content, RD definition, info.magnolia.rendering.model.RenderingModel<?> parent, info.magnolia.templating.functions.TemplatingFunctions templatingFunctions)
           
 
Method Summary
 Date convertPubDate(Object timestamp)
          This can get sometimes confusing.
 String getContextPath()
           
 String getFeedProperty(javax.jcr.Node parentNode, String subNode, String searchProperty, String searchValue, String resultProperty)
          Find a feed node and return a property.
protected  javax.jcr.NodeIterator runQuery(String queryString)
           
 
Methods inherited from class info.magnolia.rendering.model.RenderingModelImpl
execute, getContent, getDef, getDefinition, getNode, getParent, getRoot
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface info.magnolia.rendering.model.RenderingModel
execute, getContent, getDefinition, getNode, getParent, getRoot
 

Field Detail

log

protected static final org.slf4j.Logger log

ORDER_BY_PUBLICATION_DATE

public static final String ORDER_BY_PUBLICATION_DATE
See Also:
Constant Field Values

ORDER_BY_TITLE_NAME

public static final String ORDER_BY_TITLE_NAME
See Also:
Constant Field Values

SORT_ASCENDING

public static final String SORT_ASCENDING
See Also:
Constant Field Values

SORT_DESCENDING

public static final String SORT_DESCENDING
See Also:
Constant Field Values

FEEDS_NODE

protected static final String FEEDS_NODE
See Also:
Constant Field Values

MAX_RESULTS

protected static final int MAX_RESULTS
See Also:
Constant Field Values

templatingFunctions

protected final info.magnolia.templating.functions.TemplatingFunctions templatingFunctions
Constructor Detail

AbstractFeedModel

@Inject
public AbstractFeedModel(javax.jcr.Node content,
                                RD definition,
                                info.magnolia.rendering.model.RenderingModel<?> parent,
                                info.magnolia.templating.functions.TemplatingFunctions templatingFunctions)
Method Detail

convertPubDate

public Date convertPubDate(Object timestamp)
This can get sometimes confusing. Freemarker will not create date from the java long time stamp format so we need to convert it to date first. Depending on circumstances (whether coming from node or from node wrapper) the time stamp will be passed in as a String or as a Long object


getFeedProperty

public String getFeedProperty(javax.jcr.Node parentNode,
                              String subNode,
                              String searchProperty,
                              String searchValue,
                              String resultProperty)
Find a feed node and return a property.

Parameters:
parentNode - Planet feed node.
subNode - Node of the feed node where search should happen.
searchProperty - Node Property that should be searched.
searchValue - Search value.
resultProperty - Property value od found node to be returned or null.

getContextPath

public String getContextPath()

runQuery

protected javax.jcr.NodeIterator runQuery(String queryString)
                                   throws javax.jcr.RepositoryException
Throws:
javax.jcr.RepositoryException


Copyright © 2013 Magnolia International Ltd.. All Rights Reserved.