use of com.liferay.portal.theme.ThemeDisplay in project liferay-ide by liferay.
the class EditDiscussionAction method subscribeToComments.
protected void subscribeToComments(ActionRequest actionRequest, boolean subscribe) throws Exception {
ThemeDisplay themeDisplay = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY);
String className = ParamUtil.getString(actionRequest, "className");
long classPK = ParamUtil.getLong(actionRequest, "classPK");
if (subscribe) {
SubscriptionLocalServiceUtil.addSubscription(themeDisplay.getUserId(), themeDisplay.getScopeGroupId(), className, classPK);
} else {
SubscriptionLocalServiceUtil.deleteSubscription(themeDisplay.getUserId(), className, classPK);
}
}
use of com.liferay.portal.theme.ThemeDisplay in project liferay-ide by liferay.
the class LiferayPortlet method translate.
protected String translate(PortletRequest portletRequest, String key, Object[] arguments) {
PortletConfig portletConfig = (PortletConfig) portletRequest.getAttribute(JavaConstants.JAVAX_PORTLET_CONFIG);
ThemeDisplay themeDisplay = (ThemeDisplay) portletRequest.getAttribute(WebKeys.THEME_DISPLAY);
return LanguageUtil.format(portletConfig, themeDisplay.getLocale(), key, arguments);
}
use of com.liferay.portal.theme.ThemeDisplay in project liferay-ide by liferay.
the class NewPortlet method doView.
@Override
public void doView(RenderRequest renderRequest, RenderResponse renderResponse) throws IOException, PortletException {
ThemeDisplay themeDisplay = (ThemeDisplay) renderRequest.getAttribute(WebKeys.THEME_DISPLAY);
long groupId = themeDisplay.getLayout().getGroupId();
try {
Group group = GroupLocalServiceUtil.getGroup(groupId);
} catch (PortalException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (SystemException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
use of com.liferay.portal.theme.ThemeDisplay in project liferay-ide by liferay.
the class AlbumAssetRenderer method getThumbnailPath.
@Override
public String getThumbnailPath(PortletRequest portletRequest) throws Exception {
ThemeDisplay themeDisplay = (ThemeDisplay) portletRequest.getAttribute(WebKeys.THEME_DISPLAY);
String thumbnailSrc = _album.getImageURL(themeDisplay);
if (Validator.isNotNull(thumbnailSrc)) {
return thumbnailSrc;
}
return themeDisplay.getPortalURL() + "/jukebox-portlet/icons/albums.png";
}
use of com.liferay.portal.theme.ThemeDisplay in project liferay-ide by liferay.
the class ArtistAssetRenderer method getThumbnailPath.
@Override
public String getThumbnailPath(PortletRequest portletRequest) throws Exception {
ThemeDisplay themeDisplay = (ThemeDisplay) portletRequest.getAttribute(WebKeys.THEME_DISPLAY);
String thumbnailSrc = _artist.getImageURL(themeDisplay);
if (Validator.isNotNull(thumbnailSrc)) {
return thumbnailSrc;
}
return themeDisplay.getPortalURL() + "/jukebox-portlet/icons/artists.png";
}
Aggregations