Package org.jasig.portlet.newsreader.mvc
Class AbstractNewsController
java.lang.Object
org.jasig.portlet.newsreader.mvc.AbstractNewsController
- Direct Known Subclasses:
NewsController
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 Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic 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.static intgetMaxStories(javax.portlet.PortletPreferences prefs) getMaxStories.booleanisAdmin(javax.portlet.PortletRequest req) isAdmin.booleanisGuest(javax.portlet.PortletRequest req) isGuest.booleansupportsEdit(javax.portlet.PortletRequest req) supportsEdit.booleansupportsHelp(javax.portlet.PortletRequest req) supportsHelp.
-
Field Details
-
INITIALIZED
ConstantINITIALIZED="initialized"- See Also:
-
NEWS_ADMIN_ROLE
ConstantNEWS_ADMIN_ROLE="newsAdmin"- See Also:
-
ALLOW_EDIT_PREFERENCE
ConstantALLOW_EDIT_PREFERENCE="allowEdit"- See Also:
-
ALLOW_HELP_PREFERENCE
ConstantALLOW_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- aPortletRequestobjectitems- aCollectionobject- Returns:
- a
Listobject
-
isAdmin
@ModelAttribute("isAdmin") public boolean isAdmin(javax.portlet.PortletRequest req) isAdmin.
- Parameters:
req- aPortletRequestobject- Returns:
- a boolean
-
isGuest
@ModelAttribute("isGuest") public boolean isGuest(javax.portlet.PortletRequest req) isGuest.
- Parameters:
req- aPortletRequestobject- Returns:
- a boolean
-
supportsEdit
@ModelAttribute("supportsEdit") public boolean supportsEdit(javax.portlet.PortletRequest req) supportsEdit.
- Parameters:
req- aPortletRequestobject- Returns:
- a boolean
-
supportsHelp
@ModelAttribute("supportsHelp") public boolean supportsHelp(javax.portlet.PortletRequest req) supportsHelp.
- Parameters:
req- aPortletRequestobject- Returns:
- a boolean
-
getMaxStories
public static int getMaxStories(javax.portlet.PortletPreferences prefs) getMaxStories.
- Parameters:
prefs- aPortletPreferencesobject- Returns:
- a int
-