use of com.liferay.knowledgebase.model.impl.KBArticleImpl in project liferay-ide by liferay.
the class KBArticlePersistenceImpl method findByUuid_C_PrevAndNext.
/**
* Returns the k b articles before and after the current k b article in the ordered set where uuid = ? and companyId = ?.
*
* @param kbArticleId the primary key of the current k b article
* @param uuid the uuid
* @param companyId the company ID
* @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[] findByUuid_C_PrevAndNext(long kbArticleId, String uuid, long companyId, OrderByComparator orderByComparator) throws NoSuchArticleException, SystemException {
KBArticle kbArticle = findByPrimaryKey(kbArticleId);
Session session = null;
try {
session = openSession();
KBArticle[] array = new KBArticleImpl[3];
array[0] = getByUuid_C_PrevAndNext(session, kbArticle, uuid, companyId, orderByComparator, true);
array[1] = kbArticle;
array[2] = getByUuid_C_PrevAndNext(session, kbArticle, uuid, companyId, orderByComparator, false);
return array;
} catch (Exception e) {
throw processException(e);
} finally {
closeSession(session);
}
}
use of com.liferay.knowledgebase.model.impl.KBArticleImpl in project liferay-ide by liferay.
the class KBArticlePersistenceImpl method findByG_M_PrevAndNext.
/**
* Returns the k b articles before and after the current k b article in the ordered set where groupId = ? and main = ?.
*
* @param kbArticleId the primary key of the current k b article
* @param groupId the group ID
* @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[] findByG_M_PrevAndNext(long kbArticleId, long groupId, boolean main, OrderByComparator orderByComparator) throws NoSuchArticleException, SystemException {
KBArticle kbArticle = findByPrimaryKey(kbArticleId);
Session session = null;
try {
session = openSession();
KBArticle[] array = new KBArticleImpl[3];
array[0] = getByG_M_PrevAndNext(session, kbArticle, groupId, main, orderByComparator, true);
array[1] = kbArticle;
array[2] = getByG_M_PrevAndNext(session, kbArticle, groupId, main, orderByComparator, false);
return array;
} catch (Exception e) {
throw processException(e);
} finally {
closeSession(session);
}
}
use of com.liferay.knowledgebase.model.impl.KBArticleImpl in project liferay-ide by liferay.
the class KBArticlePersistenceImpl method findByR_L_PrevAndNext.
/**
* Returns the k b articles before and after the current k b article in the ordered set where resourcePrimKey = ? and latest = ?.
*
* @param kbArticleId the primary key of the current k b article
* @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 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_L_PrevAndNext(long kbArticleId, long resourcePrimKey, 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_L_PrevAndNext(session, kbArticle, resourcePrimKey, latest, orderByComparator, true);
array[1] = kbArticle;
array[2] = getByR_L_PrevAndNext(session, kbArticle, resourcePrimKey, latest, orderByComparator, false);
return array;
} catch (Exception e) {
throw processException(e);
} finally {
closeSession(session);
}
}
use of com.liferay.knowledgebase.model.impl.KBArticleImpl in project liferay-ide by liferay.
the class KBArticlePersistenceImpl method findByG_S_PrevAndNext.
/**
* Returns the k b articles before and after the current k b article in the ordered set 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[] findByG_S_PrevAndNext(long kbArticleId, 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] = getByG_S_PrevAndNext(session, kbArticle, groupId, status, orderByComparator, true);
array[1] = kbArticle;
array[2] = getByG_S_PrevAndNext(session, kbArticle, groupId, status, orderByComparator, false);
return array;
} catch (Exception e) {
throw processException(e);
} finally {
closeSession(session);
}
}
use of com.liferay.knowledgebase.model.impl.KBArticleImpl in project liferay-ide by liferay.
the class KBArticlePersistenceImpl method toUnwrappedModel.
protected KBArticle toUnwrappedModel(KBArticle kbArticle) {
if (kbArticle instanceof KBArticleImpl) {
return kbArticle;
}
KBArticleImpl kbArticleImpl = new KBArticleImpl();
kbArticleImpl.setNew(kbArticle.isNew());
kbArticleImpl.setPrimaryKey(kbArticle.getPrimaryKey());
kbArticleImpl.setUuid(kbArticle.getUuid());
kbArticleImpl.setKbArticleId(kbArticle.getKbArticleId());
kbArticleImpl.setResourcePrimKey(kbArticle.getResourcePrimKey());
kbArticleImpl.setGroupId(kbArticle.getGroupId());
kbArticleImpl.setCompanyId(kbArticle.getCompanyId());
kbArticleImpl.setUserId(kbArticle.getUserId());
kbArticleImpl.setUserName(kbArticle.getUserName());
kbArticleImpl.setCreateDate(kbArticle.getCreateDate());
kbArticleImpl.setModifiedDate(kbArticle.getModifiedDate());
kbArticleImpl.setRootResourcePrimKey(kbArticle.getRootResourcePrimKey());
kbArticleImpl.setParentResourceClassNameId(kbArticle.getParentResourceClassNameId());
kbArticleImpl.setParentResourcePrimKey(kbArticle.getParentResourcePrimKey());
kbArticleImpl.setKbFolderId(kbArticle.getKbFolderId());
kbArticleImpl.setVersion(kbArticle.getVersion());
kbArticleImpl.setTitle(kbArticle.getTitle());
kbArticleImpl.setUrlTitle(kbArticle.getUrlTitle());
kbArticleImpl.setContent(kbArticle.getContent());
kbArticleImpl.setDescription(kbArticle.getDescription());
kbArticleImpl.setPriority(kbArticle.getPriority());
kbArticleImpl.setSections(kbArticle.getSections());
kbArticleImpl.setViewCount(kbArticle.getViewCount());
kbArticleImpl.setLatest(kbArticle.isLatest());
kbArticleImpl.setMain(kbArticle.isMain());
kbArticleImpl.setSourceURL(kbArticle.getSourceURL());
kbArticleImpl.setStatus(kbArticle.getStatus());
kbArticleImpl.setStatusByUserId(kbArticle.getStatusByUserId());
kbArticleImpl.setStatusByUserName(kbArticle.getStatusByUserName());
kbArticleImpl.setStatusDate(kbArticle.getStatusDate());
return kbArticleImpl;
}
Aggregations