use of com.liferay.knowledgebase.NoSuchArticleException in project liferay-ide by liferay.
the class KBArticlePersistenceImpl method findByR_G_L_PrevAndNext.
/**
* Returns the k b articles before and after the current k b article in the ordered set where resourcePrimKey = ? and groupId = ? and latest = ?.
*
* @param kbArticleId the primary key of the current k b article
* @param resourcePrimKey the resource prim key
* @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[] findByR_G_L_PrevAndNext(long kbArticleId, long resourcePrimKey, long groupId, boolean latest, OrderByComparator orderByComparator) throws NoSuchArticleException, SystemException {
KBArticle kbArticle = findByPrimaryKey(kbArticleId);
Session session = null;
try {
session = openSession();
KBArticle[] array = new KBArticleImpl[3];
array[0] = getByR_G_L_PrevAndNext(session, kbArticle, resourcePrimKey, groupId, latest, orderByComparator, true);
array[1] = kbArticle;
array[2] = getByR_G_L_PrevAndNext(session, kbArticle, resourcePrimKey, 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 findByP_S_First.
/**
* Returns the first k b article in the ordered set where parentResourcePrimKey = ? and status = ?.
*
* @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 findByP_S_First(long parentResourcePrimKey, int status, OrderByComparator orderByComparator) throws NoSuchArticleException, SystemException {
KBArticle kbArticle = fetchByP_S_First(parentResourcePrimKey, status, orderByComparator);
if (kbArticle != null) {
return kbArticle;
}
StringBundler msg = new StringBundler(6);
msg.append(_NO_SUCH_ENTITY_WITH_KEY);
msg.append("parentResourcePrimKey=");
msg.append(parentResourcePrimKey);
msg.append(", status=");
msg.append(status);
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_KBFI_UT_ST_Last.
/**
* Returns the last k b article in the ordered set where groupId = ? and kbFolderId = ? and urlTitle = ? and status = ?.
*
* @param groupId the group ID
* @param kbFolderId the kb folder ID
* @param urlTitle the url title
* @param status the status
* @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 findByG_KBFI_UT_ST_Last(long groupId, long kbFolderId, String urlTitle, int status, OrderByComparator orderByComparator) throws NoSuchArticleException, SystemException {
KBArticle kbArticle = fetchByG_KBFI_UT_ST_Last(groupId, kbFolderId, urlTitle, status, orderByComparator);
if (kbArticle != null) {
return kbArticle;
}
StringBundler msg = new StringBundler(10);
msg.append(_NO_SUCH_ENTITY_WITH_KEY);
msg.append("groupId=");
msg.append(groupId);
msg.append(", kbFolderId=");
msg.append(kbFolderId);
msg.append(", urlTitle=");
msg.append(urlTitle);
msg.append(", status=");
msg.append(status);
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 findByUuid_C_First.
/**
* Returns the first k b article in the ordered set where uuid = ? and companyId = ?.
*
* @param uuid the uuid
* @param companyId the company ID
* @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 findByUuid_C_First(String uuid, long companyId, OrderByComparator orderByComparator) throws NoSuchArticleException, SystemException {
KBArticle kbArticle = fetchByUuid_C_First(uuid, companyId, orderByComparator);
if (kbArticle != null) {
return kbArticle;
}
StringBundler msg = new StringBundler(6);
msg.append(_NO_SUCH_ENTITY_WITH_KEY);
msg.append("uuid=");
msg.append(uuid);
msg.append(", companyId=");
msg.append(companyId);
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_S_PrevAndNext.
/**
* Returns the k b articles before and after the current k b article in the ordered set where resourcePrimKey = ? and groupId = ? and status = ?.
*
* @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[] findByR_G_S_PrevAndNext(long kbArticleId, long resourcePrimKey, long groupId, int status, OrderByComparator orderByComparator) throws NoSuchArticleException, SystemException {
KBArticle kbArticle = findByPrimaryKey(kbArticleId);
Session session = null;
try {
session = openSession();
KBArticle[] array = new KBArticleImpl[3];
array[0] = getByR_G_S_PrevAndNext(session, kbArticle, resourcePrimKey, groupId, status, orderByComparator, true);
array[1] = kbArticle;
array[2] = getByR_G_S_PrevAndNext(session, kbArticle, resourcePrimKey, groupId, status, orderByComparator, false);
return array;
} catch (Exception e) {
throw processException(e);
} finally {
closeSession(session);
}
}
Aggregations