File | Line |
---|
info/magnolia/module/rssaggregator/templates/components/FeedStatisticsModel.java | 113 |
info/magnolia/module/rssaggregator/templates/components/FeedSubscriptionsModel.java | 93 |
log.debug(query);
Query q = qm.createQuery(query, "xpath");
QueryResult res = q.execute();
Collection<Content> col = res.getContent(DataConsts.MODULE_DATA_CONTENT_NODE_TYPE);
int resCount = 0;
for (Content c : col) {
resCount++;
if (resCount <= maxResults) {
results.add(new NodeMapWrapper(c, c.getHandle()));
} else {
break;
}
}
log.debug("returning collection with {} items.", "" + results.size());
return results;
} catch (RepositoryException e) {
log.error(e.getLocalizedMessage(), e);
}
return null;
}
/**
* Retrieve the title attribute of an individual feed subscription.
*
* @param feedLink Link to the feed.
* @return Assigned title of a feed if defined in the dialog or null.
*/
public String getFeedTitle(String feedLink) {
String title = null;
try {
if (content.hasProperty("feed")) {
Node rssParent = SessionUtil.getNodeByIdentifier("data", content.getProperty("feed").getString());
if (rssParent.hasNode(FEEDS_NODE)) {
Node settingsNode = rssParent.getNode(FEEDS_NODE);
NodeIterator nit = settingsNode.getNodes();
while (nit.hasNext()) {
Node fsn = nit.nextNode();
if (fsn.hasProperty("link") && fsn.hasProperty("title")) {
if (StringUtils.equalsIgnoreCase(feedLink, fsn.getProperty("link").getString())) {
title = StringUtils.defaultString(fsn.getProperty("title").getString(), null);
break;
}
}
}
}
}
} catch (RepositoryException e) {
log.error("Problem while fetching feed title: " + e.getMessage()); |
File | Line |
---|
info/magnolia/module/rssaggregator/CombinedFeedAction.java | 77 |
info/magnolia/module/rssaggregator/templates/components/CombinedFeedModel.java | 89 |
List<ContentWrapper> results = new ArrayList<ContentWrapper>();
try {
QueryManager qm = MgnlContext.getQueryManager("data");
String orderByNodeValue = PropertyUtil.getString(content, "orderBy");
String sortDirectionNodeValue = PropertyUtil.getString(content, "direction");
String link = PropertyUtil.getString(content, "link");
if(StringUtils.isEmpty(orderByNodeValue)){
orderByNodeValue = orderBy;
}
if(StringUtils.isEmpty(sortDirectionNodeValue)){
sortDirectionNodeValue = sortDirection;
}
String queryString = "/jcr:root"+link+"/data[1]/*/* order by " + orderByNodeValue + " " + sortDirectionNodeValue;
//String queryString = "SELECT * FROM mgnl:contentNode WHERE jcr:path LIKE \'/rssaggregator/news/data/%/%\' order by pubDate";
log.debug(queryString);
Query q = qm.createQuery(queryString, "xpath");
QueryResult res = q.execute();
Collection<Content> col = res.getContent(DataConsts.MODULE_DATA_CONTENT_NODE_TYPE);
for (Content c : col) {
results.add(new NodeMapWrapper(c, c.getHandle())); |
File | Line |
---|
info/magnolia/module/rssaggregator/templates/components/FeedStatisticsModel.java | 147 |
info/magnolia/module/rssaggregator/templates/components/PlanetFeedModel.java | 190 |
Node rssParent = SessionUtil.getNode("data", content.getProperty("link").getString());
if (rssParent.hasNode(FEEDS_NODE)) {
Node settingsNode = rssParent.getNode(FEEDS_NODE);
NodeIterator nit = settingsNode.getNodes();
while (nit.hasNext()) {
Node fsn = nit.nextNode();
if (fsn.hasProperty("link") && fsn.hasProperty("title")) {
if (StringUtils.equalsIgnoreCase(feedLink, fsn.getProperty("link").getString())) {
title = StringUtils.defaultString(fsn.getProperty("title").getString(), null);
break;
}
}
}
}
} catch (RepositoryException e) { |