use of com.liferay.knowledgebase.NoSuchArticleException in project liferay-ide by liferay.
the class KBArticlePersistenceImpl method filterFindByG_P_S_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 = ? and parentResourcePrimKey = ? and sections LIKE ? and main = ?.
*
* @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 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_S_M_PrevAndNext(long kbArticleId, long groupId, long parentResourcePrimKey, String sections, boolean main, OrderByComparator orderByComparator) throws NoSuchArticleException, SystemException {
if (!InlineSQLHelperUtil.isEnabled(groupId)) {
return findByG_P_S_M_PrevAndNext(kbArticleId, groupId, parentResourcePrimKey, sections, main, orderByComparator);
}
KBArticle kbArticle = findByPrimaryKey(kbArticleId);
Session session = null;
try {
session = openSession();
KBArticle[] array = new KBArticleImpl[3];
array[0] = filterGetByG_P_S_M_PrevAndNext(session, kbArticle, groupId, parentResourcePrimKey, sections, main, orderByComparator, true);
array[1] = kbArticle;
array[2] = filterGetByG_P_S_M_PrevAndNext(session, kbArticle, groupId, parentResourcePrimKey, sections, main, 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_First.
/**
* Returns the first k b article in the ordered set where companyId = ? and latest = ?.
*
* @param companyId the company ID
* @param latest the latest
* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
* @return the first 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 findByC_L_First(long companyId, boolean latest, OrderByComparator orderByComparator) throws NoSuchArticleException, SystemException {
KBArticle kbArticle = fetchByC_L_First(companyId, latest, orderByComparator);
if (kbArticle != null) {
return kbArticle;
}
StringBundler msg = new StringBundler(6);
msg.append(_NO_SUCH_ENTITY_WITH_KEY);
msg.append("companyId=");
msg.append(companyId);
msg.append(", latest=");
msg.append(latest);
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 findByR_G_M_Last.
/**
* Returns the last k b article in the ordered set where resourcePrimKey = ? and groupId = ? and main = ?.
*
* @param resourcePrimKey the resource prim key
* @param groupId the group ID
* @param main the main
* @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_M_Last(long resourcePrimKey, long groupId, boolean main, OrderByComparator orderByComparator) throws NoSuchArticleException, SystemException {
KBArticle kbArticle = fetchByR_G_M_Last(resourcePrimKey, groupId, main, orderByComparator);
if (kbArticle != null) {
return kbArticle;
}
StringBundler msg = new StringBundler(8);
msg.append(_NO_SUCH_ENTITY_WITH_KEY);
msg.append("resourcePrimKey=");
msg.append(resourcePrimKey);
msg.append(", groupId=");
msg.append(groupId);
msg.append(", main=");
msg.append(main);
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 findByG_P_L_PrevAndNext.
/**
* Returns the k b articles before and after the current k b article in the ordered set where groupId = ? and parentResourcePrimKey = ? and latest = ?.
*
* @param kbArticleId the primary key of the current k b article
* @param groupId the group ID
* @param parentResourcePrimKey the parent resource prim key
* @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[] findByG_P_L_PrevAndNext(long kbArticleId, long groupId, long parentResourcePrimKey, boolean latest, OrderByComparator orderByComparator) throws NoSuchArticleException, SystemException {
KBArticle kbArticle = findByPrimaryKey(kbArticleId);
Session session = null;
try {
session = openSession();
KBArticle[] array = new KBArticleImpl[3];
array[0] = getByG_P_L_PrevAndNext(session, kbArticle, groupId, parentResourcePrimKey, latest, orderByComparator, true);
array[1] = kbArticle;
array[2] = getByG_P_L_PrevAndNext(session, kbArticle, groupId, parentResourcePrimKey, 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 findByG_P_S_First.
/**
* Returns the first k b article in the ordered set where groupId = ? and parentResourcePrimKey = ? and status = ?.
*
* @param groupId the group ID
* @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 first 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 findByG_P_S_First(long groupId, long parentResourcePrimKey, int status, OrderByComparator orderByComparator) throws NoSuchArticleException, SystemException {
KBArticle kbArticle = fetchByG_P_S_First(groupId, parentResourcePrimKey, status, orderByComparator);
if (kbArticle != null) {
return kbArticle;
}
StringBundler msg = new StringBundler(8);
msg.append(_NO_SUCH_ENTITY_WITH_KEY);
msg.append("groupId=");
msg.append(groupId);
msg.append(", parentResourcePrimKey=");
msg.append(parentResourcePrimKey);
msg.append(", status=");
msg.append(status);
msg.append(StringPool.CLOSE_CURLY_BRACE);
throw new NoSuchArticleException(msg.toString());
}
Aggregations