info.magnolia.module.rssaggregator.util
Class PlanetUtil

java.lang.Object
  extended by info.magnolia.module.rssaggregator.util.PlanetUtil

public final class PlanetUtil
extends Object

Utility methods for Planet RSS.

Author:
lfischer

Method Summary
static javax.jcr.Node findAuthorNode(javax.jcr.Node searchNode, String authorName, String feedLink, int count)
          Search for an author / feed combination in planet statistics and return the authors node if found.
static String formatDescription(String origDescription, Integer abbreviation)
          Format and sanitize description input.
static String formatName(javax.jcr.Node node, String propName)
          Format node content containing author and channel names.
static boolean isPlanetNode(javax.jcr.Node feedNode)
          Determine if a combined feed has the planet attribute set to true.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

isPlanetNode

public static boolean isPlanetNode(javax.jcr.Node feedNode)
                            throws javax.jcr.RepositoryException
Determine if a combined feed has the planet attribute set to true.

Parameters:
feedNode - Feed node to check
Returns:
true, if planet is checked, false otherwise
Throws:
javax.jcr.RepositoryException

formatName

public static String formatName(javax.jcr.Node node,
                                String propName)
                         throws javax.jcr.RepositoryException
Format node content containing author and channel names.

Parameters:
node - the node where the name property is stored.
propName - the name property to be formatted.
Returns:
formatted name property.
Throws:
javax.jcr.RepositoryException

formatDescription

public static String formatDescription(String origDescription,
                                       Integer abbreviation)
Format and sanitize description input.

Parameters:
origDescription - original description as delivered by feed fetcher.
abbreviation - gives the amount of characters used for abbreviation.
Returns:
sanitized HTML output string.

findAuthorNode

public static javax.jcr.Node findAuthorNode(javax.jcr.Node searchNode,
                                            String authorName,
                                            String feedLink,
                                            int count)
Search for an author / feed combination in planet statistics and return the authors node if found. Both the author name and the link for the feed must be found, because several blogs can have the same author name.

Parameters:
searchNode - Starting node for the search.
authorName - Name of the author to search for.
feedLink - Link identifying the blog.
count - Internal counter to create unique node names.
Returns:
A found author's node or a new one if not found.


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