Example usage for com.liferay.portal.kernel.security.permission ActionKeys VIEW

List of usage examples for com.liferay.portal.kernel.security.permission ActionKeys VIEW

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.security.permission ActionKeys VIEW.

Prototype

String VIEW

To view the source code for com.liferay.portal.kernel.security.permission ActionKeys VIEW.

Click Source Link

Usage

From source file:com.liferay.wiki.service.impl.WikiPageServiceImpl.java

License:Open Source License

@Override
public WikiPage getPage(long nodeId, String title, Boolean head) throws PortalException {

    WikiPagePermissionChecker.check(getPermissionChecker(), nodeId, title, ActionKeys.VIEW);

    return wikiPageLocalService.getPage(nodeId, title, head);
}

From source file:com.liferay.wiki.service.impl.WikiPageServiceImpl.java

License:Open Source License

@Override
public WikiPage getPage(long nodeId, String title, double version) throws PortalException {

    WikiPagePermissionChecker.check(getPermissionChecker(), nodeId, title, version, ActionKeys.VIEW);

    return wikiPageLocalService.getPage(nodeId, title, version);
}

From source file:com.liferay.wiki.service.impl.WikiPageServiceImpl.java

License:Open Source License

@Override
public List<WikiPage> getPages(long groupId, long nodeId, boolean head, int status, int start, int end,
        OrderByComparator<WikiPage> obc) throws PortalException {

    WikiNodePermissionChecker.check(getPermissionChecker(), nodeId, ActionKeys.VIEW);

    if (status == WorkflowConstants.STATUS_ANY) {
        return wikiPagePersistence.filterFindByG_N_H(groupId, nodeId, head, start, end, obc);
    } else {//from w w  w  . j  a v  a2  s  .c  om
        return wikiPagePersistence.filterFindByG_N_H_S(groupId, nodeId, head, status, start, end, obc);
    }
}

From source file:com.liferay.wiki.service.impl.WikiPageServiceImpl.java

License:Open Source License

@Override
public List<WikiPage> getPages(long groupId, long nodeId, boolean head, long userId, boolean includeOwner,
        int status, int start, int end, OrderByComparator<WikiPage> obc) throws PortalException {

    WikiNodePermissionChecker.check(getPermissionChecker(), nodeId, ActionKeys.VIEW);

    QueryDefinition<WikiPage> queryDefinition = new QueryDefinition<>(status, userId, includeOwner);

    queryDefinition.setEnd(end);//from w  w w . j a v a  2  s .com
    queryDefinition.setOrderByComparator(obc);
    queryDefinition.setStart(start);

    return wikiPageFinder.filterFindByG_N_H_S(groupId, nodeId, head, queryDefinition);
}

From source file:com.liferay.wiki.service.impl.WikiPageServiceImpl.java

License:Open Source License

@Override
public List<WikiPage> getPages(long groupId, long userId, long nodeId, int status, int start, int end)
        throws PortalException {

    WikiNodePermissionChecker.check(getPermissionChecker(), nodeId, ActionKeys.VIEW);

    if (userId > 0) {
        return wikiPagePersistence.filterFindByG_U_N_S(groupId, userId, nodeId, status, start, end,
                new PageCreateDateComparator(false));
    } else {/*  w ww  .j a  v a  2 s  . c  o  m*/
        return wikiPagePersistence.filterFindByG_N_S(groupId, nodeId, status, start, end,
                new PageCreateDateComparator(false));
    }
}

From source file:com.liferay.wiki.service.impl.WikiPageServiceImpl.java

License:Open Source License

@Override
public int getPagesCount(long groupId, long nodeId, boolean head) throws PortalException {

    WikiNodePermissionChecker.check(getPermissionChecker(), nodeId, ActionKeys.VIEW);

    return wikiPagePersistence.filterCountByG_N_H_S(groupId, nodeId, head, WorkflowConstants.STATUS_APPROVED);
}

From source file:com.liferay.wiki.service.impl.WikiPageServiceImpl.java

License:Open Source License

@Override
public int getPagesCount(long groupId, long nodeId, boolean head, long userId, boolean includeOwner, int status)
        throws PortalException {

    WikiNodePermissionChecker.check(getPermissionChecker(), nodeId, ActionKeys.VIEW);

    QueryDefinition<WikiPage> queryDefinition = new QueryDefinition<>(status, userId, includeOwner);

    return wikiPageFinder.filterCountByG_N_H_S(groupId, nodeId, head, queryDefinition);
}

From source file:com.liferay.wiki.service.impl.WikiPageServiceImpl.java

License:Open Source License

@Override
public int getPagesCount(long groupId, long userId, long nodeId, int status) throws PortalException {

    WikiNodePermissionChecker.check(getPermissionChecker(), nodeId, ActionKeys.VIEW);

    if (userId > 0) {
        return wikiPagePersistence.filterCountByG_U_N_S(groupId, userId, nodeId, status);
    } else {//from   ww  w. j a v a  2  s  . co m
        return wikiPagePersistence.filterCountByG_N_S(groupId, nodeId, status);
    }
}

From source file:com.liferay.wiki.service.impl.WikiPageServiceImpl.java

License:Open Source License

@Override
public String getPagesRSS(long nodeId, String title, int max, String type, double version, String displayStyle,
        String feedURL, String entryURL, String attachmentURLPrefix, Locale locale) throws PortalException {

    WikiPagePermissionChecker.check(getPermissionChecker(), nodeId, title, ActionKeys.VIEW);

    List<WikiPage> pages = wikiPageLocalService.getPages(nodeId, title, 0, max,
            new PageCreateDateComparator(true));

    return exportToRSS(title, title, type, version, displayStyle, feedURL, entryURL, attachmentURLPrefix, pages,
            true, locale);//  w w w  .  ja  va2s .  c  om
}

From source file:com.liferay.wiki.service.impl.WikiPageServiceImpl.java

License:Open Source License

@Override
public List<WikiPage> getRecentChanges(long groupId, long nodeId, int start, int end) throws PortalException {

    WikiNodePermissionChecker.check(getPermissionChecker(), nodeId, ActionKeys.VIEW);

    Calendar calendar = CalendarFactoryUtil.getCalendar();

    calendar.add(Calendar.WEEK_OF_YEAR, -1);

    return wikiPageFinder.filterFindByCreateDate(groupId, nodeId, calendar.getTime(), false, start, end);
}