use of com.liferay.knowledgebase.NoSuchArticleException in project liferay-ide by liferay.
the class KBArticlePersistenceImpl method findByR_L_First.
/**
* Returns the first k b article in the ordered set where resourcePrimKey = ? and latest = ?.
*
* @param resourcePrimKey the resource prim key
* @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 findByR_L_First(long resourcePrimKey, boolean latest, OrderByComparator orderByComparator) throws NoSuchArticleException, SystemException {
KBArticle kbArticle = fetchByR_L_First(resourcePrimKey, latest, 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(", 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 filterFindByR_G_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 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[] filterFindByR_G_L_PrevAndNext(long kbArticleId, long resourcePrimKey, long groupId, boolean latest, OrderByComparator orderByComparator) throws NoSuchArticleException, SystemException {
if (!InlineSQLHelperUtil.isEnabled(groupId)) {
return findByR_G_L_PrevAndNext(kbArticleId, resourcePrimKey, groupId, latest, orderByComparator);
}
KBArticle kbArticle = findByPrimaryKey(kbArticleId);
Session session = null;
try {
session = openSession();
KBArticle[] array = new KBArticleImpl[3];
array[0] = filterGetByR_G_L_PrevAndNext(session, kbArticle, resourcePrimKey, groupId, latest, orderByComparator, true);
array[1] = kbArticle;
array[2] = filterGetByR_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 findByG_P_S_M_First.
/**
* Returns the first k b article in the ordered set where groupId = ? and parentResourcePrimKey = ? and sections LIKE ? and main = ?.
*
* @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 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_M_First(long groupId, long parentResourcePrimKey, String sections, boolean main, OrderByComparator orderByComparator) throws NoSuchArticleException, SystemException {
KBArticle kbArticle = fetchByG_P_S_M_First(groupId, parentResourcePrimKey, sections, main, 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(", parentResourcePrimKey=");
msg.append(parentResourcePrimKey);
msg.append(", sections=");
msg.append(sections);
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 findByR_V.
/**
* Returns the k b article where resourcePrimKey = ? and version = ? or throws a {@link com.liferay.knowledgebase.NoSuchArticleException} if it could not be found.
*
* @param resourcePrimKey the resource prim key
* @param version the version
* @return the 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_V(long resourcePrimKey, int version) throws NoSuchArticleException, SystemException {
KBArticle kbArticle = fetchByR_V(resourcePrimKey, version);
if (kbArticle == null) {
StringBundler msg = new StringBundler(6);
msg.append(_NO_SUCH_ENTITY_WITH_KEY);
msg.append("resourcePrimKey=");
msg.append(resourcePrimKey);
msg.append(", version=");
msg.append(version);
msg.append(StringPool.CLOSE_CURLY_BRACE);
if (_log.isWarnEnabled()) {
_log.warn(msg.toString());
}
throw new NoSuchArticleException(msg.toString());
}
return kbArticle;
}
use of com.liferay.knowledgebase.NoSuchArticleException in project liferay-ide by liferay.
the class KBArticlePersistenceImpl method findByG_L_Last.
/**
* Returns the last k b article in the ordered set where groupId = ? and latest = ?.
*
* @param groupId the group ID
* @param latest the latest
* @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_L_Last(long groupId, boolean latest, OrderByComparator orderByComparator) throws NoSuchArticleException, SystemException {
KBArticle kbArticle = fetchByG_L_Last(groupId, latest, orderByComparator);
if (kbArticle != null) {
return kbArticle;
}
StringBundler msg = new StringBundler(6);
msg.append(_NO_SUCH_ENTITY_WITH_KEY);
msg.append("groupId=");
msg.append(groupId);
msg.append(", latest=");
msg.append(latest);
msg.append(StringPool.CLOSE_CURLY_BRACE);
throw new NoSuchArticleException(msg.toString());
}
Aggregations