Search in sources :

Example 1 with JournalArticleLocalService

use of com.liferay.portlet.journal.service.JournalArticleLocalService in project liferay-ide by liferay.

the class LegacyAPIsAntPortlet method doView.

@Override
public void doView(RenderRequest renderRequest, RenderResponse renderResponse) throws IOException, PortletException {
    try {
        long groupId = PortalUtil.getScopeGroupId(renderRequest);
        int count = JournalArticleLocalServiceUtil.getArticlesCount(groupId);
        renderRequest.setAttribute("groupJournalArticlesCount", count);
        JournalArticleLocalService service = JournalArticleLocalServiceUtil.getService();
        int journalArticlesCount = service.getJournalArticlesCount();
        renderRequest.setAttribute("journalArticlesCount", journalArticlesCount);
    } catch (PortalException | SystemException e) {
        e.printStackTrace();
    }
    super.doView(renderRequest, renderResponse);
}
Also used : JournalArticleLocalService(com.liferay.portlet.journal.service.JournalArticleLocalService) SystemException(com.liferay.portal.kernel.exception.SystemException) PortalException(com.liferay.portal.kernel.exception.PortalException)

Aggregations

PortalException (com.liferay.portal.kernel.exception.PortalException)1 SystemException (com.liferay.portal.kernel.exception.SystemException)1 JournalArticleLocalService (com.liferay.portlet.journal.service.JournalArticleLocalService)1