Example usage for com.liferay.portal.kernel.dao.search RowChecker ROW_IDS

List of usage examples for com.liferay.portal.kernel.dao.search RowChecker ROW_IDS

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.dao.search RowChecker ROW_IDS.

Prototype

String ROW_IDS

To view the source code for com.liferay.portal.kernel.dao.search RowChecker ROW_IDS.

Click Source Link

Usage

From source file:com.liferay.adaptive.media.web.internal.search.ImageConfigurationEntriesChecker.java

License:Open Source License

@Override
public String getRowCheckBox(HttpServletRequest request, boolean checked, boolean disabled, String primaryKey) {

    String name = AdaptiveMediaImageConfigurationEntry.class.getSimpleName();

    String checkBoxRowIds = getEntryRowIds();

    return getRowCheckBox(request, checked, disabled,
            _liferayPortletResponse.getNamespace() + RowChecker.ROW_IDS + name, primaryKey, checkBoxRowIds,
            "'#" + getAllRowIds() + "'", StringPool.BLANK);
}

From source file:com.liferay.adaptive.media.web.internal.search.ImageConfigurationEntriesChecker.java

License:Open Source License

protected String getEntryRowIds() {
    StringBundler sb = new StringBundler(5);

    sb.append("['");
    sb.append(_liferayPortletResponse.getNamespace());
    sb.append(RowChecker.ROW_IDS);
    sb.append(AdaptiveMediaImageConfigurationEntry.class.getSimpleName());
    sb.append("']");

    return sb.toString();
}

From source file:com.liferay.announcements.web.internal.search.AnnouncementsEntryChecker.java

License:Open Source License

@Override
public String getRowCheckBox(HttpServletRequest request, boolean checked, boolean disabled, String primaryKey) {

    long entryId = GetterUtil.getLong(primaryKey);

    AnnouncementsEntry entry = null;// w  w w  . j  a v a  2  s  .c o  m

    try {
        entry = AnnouncementsEntryLocalServiceUtil.getEntry(entryId);
    } catch (PortalException pe) {

        // LPS-52675

        if (_log.isDebugEnabled()) {
            _log.debug(pe, pe);
        }

        return StringPool.BLANK;
    }

    String name = AnnouncementsEntry.class.getSimpleName();

    boolean showInput = false;

    try {
        if (AnnouncementsEntryPermission.contains(_permissionChecker, entry, ActionKeys.DELETE)) {

            showInput = true;

            if (!showInput) {
                return StringPool.BLANK;
            }
        }
    } catch (PortalException pe) {

        // LPS-52675

        if (_log.isDebugEnabled()) {
            _log.debug(pe, pe);
        }

        return StringPool.BLANK;
    }

    StringBundler sb = new StringBundler(5);

    sb.append("['");
    sb.append(_liferayPortletResponse.getNamespace());
    sb.append(RowChecker.ROW_IDS);
    sb.append(AnnouncementsEntry.class.getSimpleName());
    sb.append("']");

    String checkBoxRowIds = sb.toString();

    String checkBoxAllRowIds = "'#" + getAllRowIds() + "'";

    return getRowCheckBox(request, checked, disabled,
            _liferayPortletResponse.getNamespace() + RowChecker.ROW_IDS + name, primaryKey, checkBoxRowIds,
            checkBoxAllRowIds, StringPool.BLANK);
}

From source file:com.liferay.bookmarks.web.internal.search.EntriesChecker.java

License:Open Source License

@Override
public String getRowCheckBox(HttpServletRequest request, boolean checked, boolean disabled, String primaryKey) {

    long entryId = GetterUtil.getLong(primaryKey);

    BookmarksEntry entry = BookmarksEntryLocalServiceUtil.fetchBookmarksEntry(entryId);

    BookmarksFolder folder = null;/*from  w w  w .  ja  v  a2 s .c o  m*/

    if (entry == null) {
        folder = BookmarksFolderLocalServiceUtil.fetchBookmarksFolder(entryId);
    }

    boolean showInput = false;

    String name = null;

    if (entry != null) {
        name = BookmarksEntry.class.getSimpleName();

        try {
            if (BookmarksEntryPermissionChecker.contains(_permissionChecker, entry, ActionKeys.DELETE)) {

                showInput = true;
            }
        } catch (Exception e) {
        }
    } else if (folder != null) {
        name = BookmarksFolder.class.getSimpleName();

        try {
            if (BookmarksFolderPermissionChecker.contains(_permissionChecker, folder, ActionKeys.DELETE)) {

                showInput = true;
            }
        } catch (Exception e) {
        }
    }

    if (!showInput) {
        return StringPool.BLANK;
    }

    String checkBoxRowIds = getEntryRowIds();
    String checkBoxAllRowIds = "'#" + getAllRowIds() + "'";

    return getRowCheckBox(request, checked, disabled,
            _liferayPortletResponse.getNamespace() + RowChecker.ROW_IDS + name, primaryKey, checkBoxRowIds,
            checkBoxAllRowIds, StringPool.BLANK);
}

From source file:com.liferay.bookmarks.web.internal.search.EntriesChecker.java

License:Open Source License

protected String getEntryRowIds() {
    StringBundler sb = new StringBundler(13);

    sb.append("['");
    sb.append(_liferayPortletResponse.getNamespace());
    sb.append(RowChecker.ROW_IDS);
    sb.append(Folder.class.getSimpleName());
    sb.append("', '");
    sb.append(_liferayPortletResponse.getNamespace());
    sb.append(RowChecker.ROW_IDS);// ww w.  ja v  a 2s .c  o  m
    sb.append(DLFileShortcut.class.getSimpleName());
    sb.append("', '");
    sb.append(_liferayPortletResponse.getNamespace());
    sb.append(RowChecker.ROW_IDS);
    sb.append(FileEntry.class.getSimpleName());
    sb.append("']");

    return sb.toString();
}

From source file:com.liferay.document.library.web.internal.search.EntriesChecker.java

License:Open Source License

@Override
public String getRowCheckBox(HttpServletRequest request, boolean checked, boolean disabled, String primaryKey) {

    FileEntry fileEntry = null;/*  www  .j ava2s. c  om*/
    FileShortcut fileShortcut = null;
    Folder folder = null;

    long entryId = GetterUtil.getLong(primaryKey);

    try {
        fileEntry = DLAppServiceUtil.getFileEntry(entryId);
    } catch (Exception e1) {
        if (e1 instanceof NoSuchFileEntryException || e1 instanceof NoSuchRepositoryEntryException) {

            try {
                fileShortcut = DLAppServiceUtil.getFileShortcut(entryId);
            } catch (Exception e2) {
                if (e2 instanceof NoSuchFileShortcutException) {
                    try {
                        folder = DLAppServiceUtil.getFolder(entryId);
                    } catch (Exception e3) {
                        return StringPool.BLANK;
                    }
                } else {
                    return StringPool.BLANK;
                }
            }
        } else {
            return StringPool.BLANK;
        }
    }

    boolean showInput = false;

    String name = null;

    if (fileEntry != null) {
        name = FileEntry.class.getSimpleName();

        try {
            if (DLFileEntryPermission.contains(_permissionChecker, fileEntry, ActionKeys.DELETE)
                    || DLFileEntryPermission.contains(_permissionChecker, fileEntry, ActionKeys.UPDATE)) {

                showInput = true;
            }
        } catch (Exception e) {
        }
    } else if (fileShortcut != null) {
        name = DLFileShortcut.class.getSimpleName();

        try {
            if (DLFileShortcutPermission.contains(_permissionChecker, fileShortcut, ActionKeys.DELETE)
                    || DLFileShortcutPermission.contains(_permissionChecker, fileShortcut, ActionKeys.UPDATE)) {

                showInput = true;
            }
        } catch (Exception e) {
        }
    } else if (folder != null) {
        name = Folder.class.getSimpleName();

        try {
            if (DLFolderPermission.contains(_permissionChecker, folder, ActionKeys.DELETE)
                    || DLFolderPermission.contains(_permissionChecker, folder, ActionKeys.UPDATE)) {

                showInput = true;
            }
        } catch (Exception e) {
        }
    }

    if (!showInput) {
        return StringPool.BLANK;
    }

    String checkBoxRowIds = getEntryRowIds();

    String checkBoxAllRowIds = "'#" + getAllRowIds() + "'";
    String checkBoxPostOnClick = _liferayPortletResponse.getNamespace() + "toggleActionsButton();";

    return getRowCheckBox(request, checked, disabled,
            _liferayPortletResponse.getNamespace() + RowChecker.ROW_IDS + name, primaryKey, checkBoxRowIds,
            checkBoxAllRowIds, checkBoxPostOnClick);
}

From source file:com.liferay.journal.web.internal.search.EntriesChecker.java

License:Open Source License

@Override
public String getRowCheckBox(HttpServletRequest request, boolean checked, boolean disabled, String primaryKey) {

    if (!_journalDisplayContext.isShowEditActions()) {
        return StringPool.BLANK;
    }/* w  w w  .  ja  va 2 s  .  c  om*/

    ThemeDisplay themeDisplay = (ThemeDisplay) request.getAttribute(WebKeys.THEME_DISPLAY);

    JournalFolder folder = null;

    String articleId = GetterUtil.getString(primaryKey);

    JournalArticle article = JournalArticleLocalServiceUtil.fetchArticle(themeDisplay.getScopeGroupId(),
            articleId);

    if (article == null) {
        long folderId = GetterUtil.getLong(primaryKey);

        folder = JournalFolderLocalServiceUtil.fetchFolder(folderId);
    }

    String name = null;
    boolean showInput = false;

    if (article != null) {
        name = JournalArticle.class.getSimpleName();

        try {
            if (JournalArticlePermission.contains(_permissionChecker, article, ActionKeys.DELETE)
                    || JournalArticlePermission.contains(_permissionChecker, article, ActionKeys.EXPIRE)
                    || JournalArticlePermission.contains(_permissionChecker, article, ActionKeys.UPDATE)) {

                showInput = true;
            }
        } catch (Exception e) {
        }
    } else if (folder != null) {
        name = JournalFolder.class.getSimpleName();

        try {
            if (JournalFolderPermission.contains(_permissionChecker, folder, ActionKeys.DELETE)) {

                showInput = true;
            }
        } catch (Exception e) {
        }
    }

    if (!showInput) {
        return StringPool.BLANK;
    }

    StringBundler sb = new StringBundler(9);

    sb.append("['");
    sb.append(_liferayPortletResponse.getNamespace());
    sb.append(RowChecker.ROW_IDS);
    sb.append(JournalFolder.class.getSimpleName());
    sb.append("', '");
    sb.append(_liferayPortletResponse.getNamespace());
    sb.append(RowChecker.ROW_IDS);
    sb.append(JournalArticle.class.getSimpleName());
    sb.append("']");

    String checkBoxRowIds = sb.toString();

    return getRowCheckBox(request, checked, disabled,
            _liferayPortletResponse.getNamespace() + RowChecker.ROW_IDS + name + StringPool.BLANK, primaryKey,
            checkBoxRowIds, "'#" + getAllRowIds() + "'", StringPool.BLANK);
}

From source file:com.liferay.message.boards.web.internal.search.EntriesChecker.java

License:Open Source License

@Override
public String getRowCheckBox(HttpServletRequest request, boolean checked, boolean disabled, String primaryKey) {

    MBThread thread = null;//  ww w. j  a  va 2 s.  com

    long entryId = GetterUtil.getLong(primaryKey);

    MBCategory category = MBCategoryLocalServiceUtil.fetchMBCategory(entryId);

    if (category == null) {
        thread = MBThreadLocalServiceUtil.fetchThread(entryId);
    }

    if ((category == null) && (thread == null)) {
        return StringPool.BLANK;
    }

    boolean showInput = false;

    String name = null;

    if (category != null) {
        name = MBCategory.class.getSimpleName();

        try {
            if (MBCategoryPermission.contains(_permissionChecker, category, ActionKeys.DELETE)) {

                showInput = true;
            }
        } catch (Exception e) {
        }
    } else {
        name = MBThread.class.getSimpleName();

        try {
            if (MBCategoryPermission.contains(_permissionChecker, thread.getGroupId(), thread.getCategoryId(),
                    ActionKeys.LOCK_THREAD)
                    || MBMessagePermission.contains(_permissionChecker, thread.getRootMessageId(),
                            ActionKeys.DELETE)) {

                showInput = true;
            }
        } catch (Exception e) {
        }
    }

    if (!showInput) {
        return StringPool.BLANK;
    }

    String checkBoxRowIds = getEntryRowIds();

    return getRowCheckBox(request, checked, disabled,
            _liferayPortletResponse.getNamespace() + RowChecker.ROW_IDS + name, primaryKey, checkBoxRowIds,
            "'#" + getAllRowIds() + "'", StringPool.BLANK);
}

From source file:com.liferay.message.boards.web.internal.search.EntriesChecker.java

License:Open Source License

protected String getEntryRowIds() {
    StringBundler sb = new StringBundler(9);

    sb.append("['");
    sb.append(_liferayPortletResponse.getNamespace());
    sb.append(RowChecker.ROW_IDS);
    sb.append(MBCategory.class.getSimpleName());
    sb.append("', '");
    sb.append(_liferayPortletResponse.getNamespace());
    sb.append(RowChecker.ROW_IDS);/*  w w  w . java  2 s  .  c o  m*/
    sb.append(MBThread.class.getSimpleName());
    sb.append("']");

    return sb.toString();
}

From source file:com.liferay.portlet.documentlibrary.search.EntriesChecker.java

License:Open Source License

@Override
public String getRowCheckBox(boolean checked, boolean disabled, String primaryKey) {

    DLFileShortcut dlFileShortcut = null;
    FileEntry fileEntry = null;/*  w ww.  j  a  va  2  s  . com*/
    Folder folder = null;

    long entryId = GetterUtil.getLong(primaryKey);

    try {
        fileEntry = DLAppServiceUtil.getFileEntry(entryId);
    } catch (Exception e1) {
        if (e1 instanceof NoSuchFileEntryException || e1 instanceof NoSuchRepositoryEntryException) {

            try {
                dlFileShortcut = DLAppServiceUtil.getFileShortcut(entryId);
            } catch (Exception e2) {
                if (e2 instanceof NoSuchFileShortcutException) {
                    try {
                        folder = DLAppServiceUtil.getFolder(entryId);
                    } catch (Exception e3) {
                        return StringPool.BLANK;
                    }
                } else {
                    return StringPool.BLANK;
                }
            }
        } else {
            return StringPool.BLANK;
        }
    }

    boolean showInput = false;

    String name = null;

    if (fileEntry != null) {
        name = FileEntry.class.getSimpleName();

        try {
            if (DLFileEntryPermission.contains(_permissionChecker, fileEntry, ActionKeys.DELETE)
                    || DLFileEntryPermission.contains(_permissionChecker, fileEntry, ActionKeys.UPDATE)) {

                showInput = true;
            }
        } catch (Exception e) {
        }
    } else if (dlFileShortcut != null) {
        name = DLFileShortcut.class.getSimpleName();

        try {
            if (DLFileShortcutPermission.contains(_permissionChecker, dlFileShortcut, ActionKeys.DELETE)) {

                showInput = true;
            }
        } catch (Exception e) {
        }
    } else if (folder != null) {
        name = Folder.class.getSimpleName();

        try {
            if (DLFolderPermission.contains(_permissionChecker, folder, ActionKeys.DELETE)) {

                showInput = true;
            }
        } catch (Exception e) {
        }
    }

    if (!showInput) {
        return StringPool.BLANK;
    }

    StringBundler sb = new StringBundler();

    sb.append("['");
    sb.append(_liferayPortletResponse.getNamespace());
    sb.append(RowChecker.ROW_IDS);
    sb.append(Folder.class.getSimpleName());
    sb.append("Checkbox', '");
    sb.append(_liferayPortletResponse.getNamespace());
    sb.append(RowChecker.ROW_IDS);
    sb.append(DLFileShortcut.class.getSimpleName());
    sb.append("Checkbox', '");
    sb.append(_liferayPortletResponse.getNamespace());
    sb.append(RowChecker.ROW_IDS);
    sb.append(FileEntry.class.getSimpleName());
    sb.append("Checkbox']");

    String checkBoxRowIds = sb.toString();

    return getRowCheckBox(checked, disabled,
            _liferayPortletResponse.getNamespace() + RowChecker.ROW_IDS + name + "Checkbox", primaryKey,
            checkBoxRowIds, "'#" + getAllRowIds() + "Checkbox'",
            _liferayPortletResponse.getNamespace() + "toggleActionsButton();");
}