Search in sources :

Example 16 with ThemeDisplay

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);
    }
}
Also used : ThemeDisplay(com.liferay.portal.theme.ThemeDisplay)

Example 17 with ThemeDisplay

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);
}
Also used : PortletConfig(javax.portlet.PortletConfig) ThemeDisplay(com.liferay.portal.theme.ThemeDisplay)

Example 18 with ThemeDisplay

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();
    }
}
Also used : Group(com.liferay.portal.model.Group) SystemException(com.liferay.portal.kernel.exception.SystemException) PortalException(com.liferay.portal.kernel.exception.PortalException) ThemeDisplay(com.liferay.portal.theme.ThemeDisplay)

Example 19 with ThemeDisplay

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";
}
Also used : ThemeDisplay(com.liferay.portal.theme.ThemeDisplay)

Example 20 with ThemeDisplay

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";
}
Also used : ThemeDisplay(com.liferay.portal.theme.ThemeDisplay)

Aggregations

ThemeDisplay (com.liferay.portal.theme.ThemeDisplay)63 PermissionChecker (com.liferay.portal.security.permission.PermissionChecker)10 ServiceContext (com.liferay.portal.service.ServiceContext)7 JSONObject (com.liferay.portal.kernel.json.JSONObject)6 PortletURL (javax.portlet.PortletURL)6 PortalException (com.liferay.portal.kernel.exception.PortalException)5 User (com.liferay.portal.model.User)5 Gadget (com.liferay.opensocial.model.Gadget)4 SystemException (com.liferay.portal.kernel.exception.SystemException)4 UploadPortletRequest (com.liferay.portal.kernel.upload.UploadPortletRequest)4 PortletConfig (javax.portlet.PortletConfig)4 KBArticle (com.liferay.knowledgebase.model.KBArticle)3 KBFolder (com.liferay.knowledgebase.model.KBFolder)3 Role (com.liferay.portal.model.Role)3 HashMap (java.util.HashMap)3 LiferayPortletURL (com.liferay.portal.kernel.portlet.LiferayPortletURL)2 FileEntry (com.liferay.portal.kernel.repository.model.FileEntry)2 Folder (com.liferay.portal.kernel.repository.model.Folder)2 Layout (com.liferay.portal.model.Layout)2 SocialActivity (com.liferay.portlet.social.model.SocialActivity)2