Class AbstractNewsController

java.lang.Object
org.jasig.portlet.newsreader.mvc.AbstractNewsController
Direct Known Subclasses:
NewsController

public class AbstractNewsController extends Object
Creating an abstract superclass for news in VIEW mode as a first step toward combining controllers for single-feed and regular. I believe we'd be better served -- have less chance for mismatch and regression -- if the 2 approaches used the same controllers, and the differences in behavior were factored out into different subclasses of service objects. We could then configure these services appropriately in each portlet's Spring sub-context. So I suggest factoring common code out of the subclasses (and into here) bit-by-bit until the controllers are no different, at which point we can remove this class if it seems like a good idea then.
Since:
5.1.1
Author:
awills
  • Field Details

    • INITIALIZED

      public static final String INITIALIZED
      Constant INITIALIZED="initialized"
      See Also:
    • NEWS_ADMIN_ROLE

      public static final String NEWS_ADMIN_ROLE
      Constant NEWS_ADMIN_ROLE="newsAdmin"
      See Also:
    • ALLOW_EDIT_PREFERENCE

      public static final String ALLOW_EDIT_PREFERENCE
      Constant ALLOW_EDIT_PREFERENCE="allowEdit"
      See Also:
    • ALLOW_HELP_PREFERENCE

      public static final String ALLOW_HELP_PREFERENCE
      Constant ALLOW_HELP_PREFERENCE="allowHelp"
      See Also:
  • Constructor Details

    • AbstractNewsController

      public AbstractNewsController()
  • Method Details

    • filterNonWhitelistedConfigurations

      public static List<NewsConfiguration> filterNonWhitelistedConfigurations(javax.portlet.PortletRequest req, Collection<NewsConfiguration> items)
      Utility function for filtering a collection of NewsConfiguration objects based on the Whitelist for this portlet-definition.
      Parameters:
      req - a PortletRequest object
      items - a Collection object
      Returns:
      a List object
    • isAdmin

      @ModelAttribute("isAdmin") public boolean isAdmin(javax.portlet.PortletRequest req)

      isAdmin.

      Parameters:
      req - a PortletRequest object
      Returns:
      a boolean
    • isGuest

      @ModelAttribute("isGuest") public boolean isGuest(javax.portlet.PortletRequest req)

      isGuest.

      Parameters:
      req - a PortletRequest object
      Returns:
      a boolean
    • supportsEdit

      @ModelAttribute("supportsEdit") public boolean supportsEdit(javax.portlet.PortletRequest req)

      supportsEdit.

      Parameters:
      req - a PortletRequest object
      Returns:
      a boolean
    • supportsHelp

      @ModelAttribute("supportsHelp") public boolean supportsHelp(javax.portlet.PortletRequest req)

      supportsHelp.

      Parameters:
      req - a PortletRequest object
      Returns:
      a boolean
    • getMaxStories

      public static int getMaxStories(javax.portlet.PortletPreferences prefs)

      getMaxStories.

      Parameters:
      prefs - a PortletPreferences object
      Returns:
      a int