use of javax.portlet.PortletPreferences in project uPortal by Jasig.
the class ActivityController method summary.
@RenderMapping
public ModelAndView summary(PortletRequest request) throws TypeMismatchException {
final Map<String, Object> model = new HashMap<String, Object>();
final PortalActivity now = buildPortalActivity(request, NOW);
final PortalActivity today = buildPortalActivity(request, TODAY);
final PortalActivity yesterday = buildPortalActivity(request, YESTERDAY);
model.put("usageNow", now);
model.put("usageToday", today);
model.put("usageYesterday", yesterday);
// Searches
// default
List<SearchInfo> popularSearchTerms = Collections.emptyList();
final PortletPreferences prefs = request.getPreferences();
final Boolean showSearches = Boolean.valueOf(prefs.getValue(PREFERENCE_SHOW_SEACHES, DEFAULT_PREFERENCE_SHOW_SEARCHES));
if (showSearches) {
popularSearchTerms = getPopularSearchTerms();
}
model.put("showSearches", showSearches);
model.put("popularSearchTerms", popularSearchTerms);
return new ModelAndView("jsp/Activity/activity", model);
}
use of javax.portlet.PortletPreferences in project uPortal by Jasig.
the class RoleBasedBackgroundSetSelectionStrategy method getBackgroundContainerSelector.
@Override
public String getBackgroundContainerSelector(PortletRequest req) {
PreferenceNames names = PreferenceNames.getInstance(req);
PortletPreferences prefs = req.getPreferences();
return prefs.getValue(names.getBackgroundContainerSelectorPreferenceName(), null);
}
use of javax.portlet.PortletPreferences in project uPortal by Jasig.
the class RoleBasedBackgroundSetSelectionStrategy method getImageSet.
@Override
public String[] getImageSet(PortletRequest req) {
final PreferenceNames names = PreferenceNames.getInstance(req);
final PortletPreferences prefs = req.getPreferences();
final String[] images = prefs.getValues(names.getImageSetPreferenceName(), EMPTY_STRING_ARRAY);
for (int i = 0; i < images.length; i++) {
images[i] = evaluateImagePath(images[i]);
}
return images;
}
use of javax.portlet.PortletPreferences in project uPortal by Jasig.
the class RoleBasedBackgroundSetSelectionStrategy method getImageCaptions.
@Override
public String[] getImageCaptions(PortletRequest req) {
PreferenceNames names = PreferenceNames.getInstance(req);
PortletPreferences prefs = req.getPreferences();
return prefs.getValues(names.IMAGE_CAPTIONS_PREFERENCE_NAME, null);
}
use of javax.portlet.PortletPreferences in project uPortal by Jasig.
the class RoleBasedBackgroundSetSelectionStrategy method getSelectedImage.
@Override
public String getSelectedImage(PortletRequest req) {
// No evaluation required (already processed)
PreferenceNames names = PreferenceNames.getInstance(req);
PortletPreferences prefs = req.getPreferences();
return prefs.getValue(names.getSelectedBackgroundImagePreferenceName(), null);
}
Aggregations