use of com.liferay.knowledgebase.NoSuchArticleException in project liferay-ide by liferay.
the class KBArticlePersistenceImpl method filterFindByG_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 groupId = ? and status = ?.
*
* @param kbArticleId the primary key of the current k b article
* @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[] filterFindByG_S_PrevAndNext(long kbArticleId, long groupId, int status, OrderByComparator orderByComparator) throws NoSuchArticleException, SystemException {
if (!InlineSQLHelperUtil.isEnabled(groupId)) {
return findByG_S_PrevAndNext(kbArticleId, groupId, status, orderByComparator);
}
KBArticle kbArticle = findByPrimaryKey(kbArticleId);
Session session = null;
try {
session = openSession();
KBArticle[] array = new KBArticleImpl[3];
array[0] = filterGetByG_S_PrevAndNext(session, kbArticle, groupId, status, orderByComparator, true);
array[1] = kbArticle;
array[2] = filterGetByG_S_PrevAndNext(session, kbArticle, groupId, status, orderByComparator, false);
return array;
} catch (Exception e) {
throw processException(e);
} finally {
closeSession(session);
}
}
use of com.liferay.knowledgebase.NoSuchArticleException in project liferay-ide by liferay.
the class KBArticlePersistenceImpl method findByR_G_Last.
/**
* Returns the last k b article in the ordered set where resourcePrimKey = ? and groupId = ?.
*
* @param resourcePrimKey the resource prim key
* @param groupId the group ID
* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
* @return the last matching k b article
* @throws com.liferay.knowledgebase.NoSuchArticleException if a matching k b article could not be found
* @throws SystemException if a system exception occurred
*/
@Override
public KBArticle findByR_G_Last(long resourcePrimKey, long groupId, OrderByComparator orderByComparator) throws NoSuchArticleException, SystemException {
KBArticle kbArticle = fetchByR_G_Last(resourcePrimKey, groupId, orderByComparator);
if (kbArticle != null) {
return kbArticle;
}
StringBundler msg = new StringBundler(6);
msg.append(_NO_SUCH_ENTITY_WITH_KEY);
msg.append("resourcePrimKey=");
msg.append(resourcePrimKey);
msg.append(", groupId=");
msg.append(groupId);
msg.append(StringPool.CLOSE_CURLY_BRACE);
throw new NoSuchArticleException(msg.toString());
}
use of com.liferay.knowledgebase.NoSuchArticleException in project liferay-ide by liferay.
the class KBArticlePersistenceImpl method findByP_S_PrevAndNext.
/**
* Returns the k b articles before and after the current k b article in the ordered set where parentResourcePrimKey = ? and status = ?.
*
* @param kbArticleId the primary key of the current k b article
* @param parentResourcePrimKey the parent resource prim key
* @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[] findByP_S_PrevAndNext(long kbArticleId, long parentResourcePrimKey, int status, OrderByComparator orderByComparator) throws NoSuchArticleException, SystemException {
KBArticle kbArticle = findByPrimaryKey(kbArticleId);
Session session = null;
try {
session = openSession();
KBArticle[] array = new KBArticleImpl[3];
array[0] = getByP_S_PrevAndNext(session, kbArticle, parentResourcePrimKey, status, orderByComparator, true);
array[1] = kbArticle;
array[2] = getByP_S_PrevAndNext(session, kbArticle, parentResourcePrimKey, status, orderByComparator, false);
return array;
} catch (Exception e) {
throw processException(e);
} finally {
closeSession(session);
}
}
use of com.liferay.knowledgebase.NoSuchArticleException in project liferay-ide by liferay.
the class KBArticlePersistenceImpl method filterFindByG_L_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 = ? and latest = ?.
*
* @param kbArticleId the primary key of the current k b article
* @param groupId the group ID
* @param latest the latest
* @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_L_PrevAndNext(long kbArticleId, long groupId, boolean latest, OrderByComparator orderByComparator) throws NoSuchArticleException, SystemException {
if (!InlineSQLHelperUtil.isEnabled(groupId)) {
return findByG_L_PrevAndNext(kbArticleId, groupId, latest, orderByComparator);
}
KBArticle kbArticle = findByPrimaryKey(kbArticleId);
Session session = null;
try {
session = openSession();
KBArticle[] array = new KBArticleImpl[3];
array[0] = filterGetByG_L_PrevAndNext(session, kbArticle, groupId, latest, orderByComparator, true);
array[1] = kbArticle;
array[2] = filterGetByG_L_PrevAndNext(session, kbArticle, groupId, latest, orderByComparator, false);
return array;
} catch (Exception e) {
throw processException(e);
} finally {
closeSession(session);
}
}
use of com.liferay.knowledgebase.NoSuchArticleException in project liferay-ide by liferay.
the class KBArticlePersistenceImpl method findByC_L_PrevAndNext.
/**
* Returns the k b articles before and after the current k b article in the ordered set where companyId = ? and latest = ?.
*
* @param kbArticleId the primary key of the current k b article
* @param companyId the company ID
* @param latest the latest
* @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[] findByC_L_PrevAndNext(long kbArticleId, long companyId, boolean latest, OrderByComparator orderByComparator) throws NoSuchArticleException, SystemException {
KBArticle kbArticle = findByPrimaryKey(kbArticleId);
Session session = null;
try {
session = openSession();
KBArticle[] array = new KBArticleImpl[3];
array[0] = getByC_L_PrevAndNext(session, kbArticle, companyId, latest, orderByComparator, true);
array[1] = kbArticle;
array[2] = getByC_L_PrevAndNext(session, kbArticle, companyId, latest, orderByComparator, false);
return array;
} catch (Exception e) {
throw processException(e);
} finally {
closeSession(session);
}
}
Aggregations