Search in sources :

Example 1 with KBArticleImpl

use of com.liferay.knowledgebase.model.impl.KBArticleImpl in project liferay-ide by liferay.

the class KBArticlePersistenceImpl method findByG_P_S_S_PrevAndNext.

/**
 * Returns the k b articles before and after the current k b article in the ordered set where groupId = ? and parentResourcePrimKey = ? and sections LIKE ? and status = ?.
 *
 * @param kbArticleId the primary key of the current k b article
 * @param groupId the group ID
 * @param parentResourcePrimKey the parent resource prim key
 * @param sections the sections
 * @param status the status
 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
 * @return the previous, current, and next k b article
 * @throws com.liferay.knowledgebase.NoSuchArticleException if a k b article with the primary key could not be found
 * @throws SystemException if a system exception occurred
 */
@Override
public KBArticle[] findByG_P_S_S_PrevAndNext(long kbArticleId, long groupId, long parentResourcePrimKey, String sections, int status, OrderByComparator orderByComparator) throws NoSuchArticleException, SystemException {
    KBArticle kbArticle = findByPrimaryKey(kbArticleId);
    Session session = null;
    try {
        session = openSession();
        KBArticle[] array = new KBArticleImpl[3];
        array[0] = getByG_P_S_S_PrevAndNext(session, kbArticle, groupId, parentResourcePrimKey, sections, status, orderByComparator, true);
        array[1] = kbArticle;
        array[2] = getByG_P_S_S_PrevAndNext(session, kbArticle, groupId, parentResourcePrimKey, sections, status, orderByComparator, false);
        return array;
    } catch (Exception e) {
        throw processException(e);
    } finally {
        closeSession(session);
    }
}
Also used : KBArticle(com.liferay.knowledgebase.model.KBArticle) KBArticleImpl(com.liferay.knowledgebase.model.impl.KBArticleImpl) SystemException(com.liferay.portal.kernel.exception.SystemException) NoSuchArticleException(com.liferay.knowledgebase.NoSuchArticleException) Session(com.liferay.portal.kernel.dao.orm.Session)

Example 2 with KBArticleImpl

use of com.liferay.knowledgebase.model.impl.KBArticleImpl in project liferay-ide by liferay.

the class KBArticlePersistenceImpl method findByP_M_PrevAndNext.

/**
 * Returns the k b articles before and after the current k b article in the ordered set where parentResourcePrimKey = &#63; and main = &#63;.
 *
 * @param kbArticleId the primary key of the current k b article
 * @param parentResourcePrimKey the parent resource prim key
 * @param main the main
 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
 * @return the previous, current, and next k b article
 * @throws com.liferay.knowledgebase.NoSuchArticleException if a k b article with the primary key could not be found
 * @throws SystemException if a system exception occurred
 */
@Override
public KBArticle[] findByP_M_PrevAndNext(long kbArticleId, long parentResourcePrimKey, boolean main, OrderByComparator orderByComparator) throws NoSuchArticleException, SystemException {
    KBArticle kbArticle = findByPrimaryKey(kbArticleId);
    Session session = null;
    try {
        session = openSession();
        KBArticle[] array = new KBArticleImpl[3];
        array[0] = getByP_M_PrevAndNext(session, kbArticle, parentResourcePrimKey, main, orderByComparator, true);
        array[1] = kbArticle;
        array[2] = getByP_M_PrevAndNext(session, kbArticle, parentResourcePrimKey, main, orderByComparator, false);
        return array;
    } catch (Exception e) {
        throw processException(e);
    } finally {
        closeSession(session);
    }
}
Also used : KBArticle(com.liferay.knowledgebase.model.KBArticle) KBArticleImpl(com.liferay.knowledgebase.model.impl.KBArticleImpl) SystemException(com.liferay.portal.kernel.exception.SystemException) NoSuchArticleException(com.liferay.knowledgebase.NoSuchArticleException) Session(com.liferay.portal.kernel.dao.orm.Session)

Example 3 with KBArticleImpl

use of com.liferay.knowledgebase.model.impl.KBArticleImpl in project liferay-ide by liferay.

the class KBArticlePersistenceImpl method filterFindByR_G_S_PrevAndNext.

/**
 * Returns the k b articles before and after the current k b article in the ordered set of k b articles that the user has permission to view where resourcePrimKey = &#63; and groupId = &#63; and status = &#63;.
 *
 * @param kbArticleId the primary key of the current k b article
 * @param resourcePrimKey the resource prim key
 * @param groupId the group ID
 * @param status the status
 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
 * @return the previous, current, and next k b article
 * @throws com.liferay.knowledgebase.NoSuchArticleException if a k b article with the primary key could not be found
 * @throws SystemException if a system exception occurred
 */
@Override
public KBArticle[] filterFindByR_G_S_PrevAndNext(long kbArticleId, long resourcePrimKey, long groupId, int status, OrderByComparator orderByComparator) throws NoSuchArticleException, SystemException {
    if (!InlineSQLHelperUtil.isEnabled(groupId)) {
        return findByR_G_S_PrevAndNext(kbArticleId, resourcePrimKey, groupId, status, orderByComparator);
    }
    KBArticle kbArticle = findByPrimaryKey(kbArticleId);
    Session session = null;
    try {
        session = openSession();
        KBArticle[] array = new KBArticleImpl[3];
        array[0] = filterGetByR_G_S_PrevAndNext(session, kbArticle, resourcePrimKey, groupId, status, orderByComparator, true);
        array[1] = kbArticle;
        array[2] = filterGetByR_G_S_PrevAndNext(session, kbArticle, resourcePrimKey, groupId, status, orderByComparator, false);
        return array;
    } catch (Exception e) {
        throw processException(e);
    } finally {
        closeSession(session);
    }
}
Also used : KBArticle(com.liferay.knowledgebase.model.KBArticle) KBArticleImpl(com.liferay.knowledgebase.model.impl.KBArticleImpl) SystemException(com.liferay.portal.kernel.exception.SystemException) NoSuchArticleException(com.liferay.knowledgebase.NoSuchArticleException) Session(com.liferay.portal.kernel.dao.orm.Session)

Example 4 with KBArticleImpl

use of com.liferay.knowledgebase.model.impl.KBArticleImpl in project liferay-ide by liferay.

the class KBArticlePersistenceImpl method findByG_KBFI_UT_PrevAndNext.

/**
 * Returns the k b articles before and after the current k b article in the ordered set where groupId = &#63; and kbFolderId = &#63; and urlTitle = &#63;.
 *
 * @param kbArticleId the primary key of the current k b article
 * @param groupId the group ID
 * @param kbFolderId the kb folder ID
 * @param urlTitle the url title
 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
 * @return the previous, current, and next k b article
 * @throws com.liferay.knowledgebase.NoSuchArticleException if a k b article with the primary key could not be found
 * @throws SystemException if a system exception occurred
 */
@Override
public KBArticle[] findByG_KBFI_UT_PrevAndNext(long kbArticleId, long groupId, long kbFolderId, String urlTitle, OrderByComparator orderByComparator) throws NoSuchArticleException, SystemException {
    KBArticle kbArticle = findByPrimaryKey(kbArticleId);
    Session session = null;
    try {
        session = openSession();
        KBArticle[] array = new KBArticleImpl[3];
        array[0] = getByG_KBFI_UT_PrevAndNext(session, kbArticle, groupId, kbFolderId, urlTitle, orderByComparator, true);
        array[1] = kbArticle;
        array[2] = getByG_KBFI_UT_PrevAndNext(session, kbArticle, groupId, kbFolderId, urlTitle, orderByComparator, false);
        return array;
    } catch (Exception e) {
        throw processException(e);
    } finally {
        closeSession(session);
    }
}
Also used : KBArticle(com.liferay.knowledgebase.model.KBArticle) KBArticleImpl(com.liferay.knowledgebase.model.impl.KBArticleImpl) SystemException(com.liferay.portal.kernel.exception.SystemException) NoSuchArticleException(com.liferay.knowledgebase.NoSuchArticleException) Session(com.liferay.portal.kernel.dao.orm.Session)

Example 5 with KBArticleImpl

use of com.liferay.knowledgebase.model.impl.KBArticleImpl in project liferay-ide by liferay.

the class KBArticlePersistenceImpl method filterFindByG_P_M_PrevAndNext.

/**
 * Returns the k b articles before and after the current k b article in the ordered set of k b articles that the user has permission to view where groupId = &#63; and parentResourcePrimKey = &#63; and main = &#63;.
 *
 * @param kbArticleId the primary key of the current k b article
 * @param groupId the group ID
 * @param parentResourcePrimKey the parent resource prim key
 * @param main the main
 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
 * @return the previous, current, and next k b article
 * @throws com.liferay.knowledgebase.NoSuchArticleException if a k b article with the primary key could not be found
 * @throws SystemException if a system exception occurred
 */
@Override
public KBArticle[] filterFindByG_P_M_PrevAndNext(long kbArticleId, long groupId, long parentResourcePrimKey, boolean main, OrderByComparator orderByComparator) throws NoSuchArticleException, SystemException {
    if (!InlineSQLHelperUtil.isEnabled(groupId)) {
        return findByG_P_M_PrevAndNext(kbArticleId, groupId, parentResourcePrimKey, main, orderByComparator);
    }
    KBArticle kbArticle = findByPrimaryKey(kbArticleId);
    Session session = null;
    try {
        session = openSession();
        KBArticle[] array = new KBArticleImpl[3];
        array[0] = filterGetByG_P_M_PrevAndNext(session, kbArticle, groupId, parentResourcePrimKey, main, orderByComparator, true);
        array[1] = kbArticle;
        array[2] = filterGetByG_P_M_PrevAndNext(session, kbArticle, groupId, parentResourcePrimKey, main, orderByComparator, false);
        return array;
    } catch (Exception e) {
        throw processException(e);
    } finally {
        closeSession(session);
    }
}
Also used : KBArticle(com.liferay.knowledgebase.model.KBArticle) KBArticleImpl(com.liferay.knowledgebase.model.impl.KBArticleImpl) SystemException(com.liferay.portal.kernel.exception.SystemException) NoSuchArticleException(com.liferay.knowledgebase.NoSuchArticleException) Session(com.liferay.portal.kernel.dao.orm.Session)

Aggregations

KBArticleImpl (com.liferay.knowledgebase.model.impl.KBArticleImpl)46 KBArticle (com.liferay.knowledgebase.model.KBArticle)45 NoSuchArticleException (com.liferay.knowledgebase.NoSuchArticleException)44 Session (com.liferay.portal.kernel.dao.orm.Session)44 SystemException (com.liferay.portal.kernel.exception.SystemException)44