Search in sources :

Example 1 with KBFolderImpl

use of com.liferay.knowledgebase.model.impl.KBFolderImpl in project liferay-ide by liferay.

the class KBFolderPersistenceImpl method toUnwrappedModel.

protected KBFolder toUnwrappedModel(KBFolder kbFolder) {
    if (kbFolder instanceof KBFolderImpl) {
        return kbFolder;
    }
    KBFolderImpl kbFolderImpl = new KBFolderImpl();
    kbFolderImpl.setNew(kbFolder.isNew());
    kbFolderImpl.setPrimaryKey(kbFolder.getPrimaryKey());
    kbFolderImpl.setUuid(kbFolder.getUuid());
    kbFolderImpl.setKbFolderId(kbFolder.getKbFolderId());
    kbFolderImpl.setGroupId(kbFolder.getGroupId());
    kbFolderImpl.setCompanyId(kbFolder.getCompanyId());
    kbFolderImpl.setUserId(kbFolder.getUserId());
    kbFolderImpl.setUserName(kbFolder.getUserName());
    kbFolderImpl.setCreateDate(kbFolder.getCreateDate());
    kbFolderImpl.setModifiedDate(kbFolder.getModifiedDate());
    kbFolderImpl.setParentKBFolderId(kbFolder.getParentKBFolderId());
    kbFolderImpl.setName(kbFolder.getName());
    kbFolderImpl.setUrlTitle(kbFolder.getUrlTitle());
    kbFolderImpl.setDescription(kbFolder.getDescription());
    return kbFolderImpl;
}
Also used : KBFolderImpl(com.liferay.knowledgebase.model.impl.KBFolderImpl)

Example 2 with KBFolderImpl

use of com.liferay.knowledgebase.model.impl.KBFolderImpl in project liferay-ide by liferay.

the class KBFolderPersistenceImpl method findByUuid_C_PrevAndNext.

/**
 * Returns the k b folders before and after the current k b folder in the ordered set where uuid = ? and companyId = ?.
 *
 * @param kbFolderId the primary key of the current k b folder
 * @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 folder
 * @throws com.liferay.knowledgebase.NoSuchFolderException if a k b folder with the primary key could not be found
 * @throws SystemException if a system exception occurred
 */
@Override
public KBFolder[] findByUuid_C_PrevAndNext(long kbFolderId, String uuid, long companyId, OrderByComparator orderByComparator) throws NoSuchFolderException, SystemException {
    KBFolder kbFolder = findByPrimaryKey(kbFolderId);
    Session session = null;
    try {
        session = openSession();
        KBFolder[] array = new KBFolderImpl[3];
        array[0] = getByUuid_C_PrevAndNext(session, kbFolder, uuid, companyId, orderByComparator, true);
        array[1] = kbFolder;
        array[2] = getByUuid_C_PrevAndNext(session, kbFolder, uuid, companyId, orderByComparator, false);
        return array;
    } catch (Exception e) {
        throw processException(e);
    } finally {
        closeSession(session);
    }
}
Also used : KBFolder(com.liferay.knowledgebase.model.KBFolder) KBFolderImpl(com.liferay.knowledgebase.model.impl.KBFolderImpl) SystemException(com.liferay.portal.kernel.exception.SystemException) NoSuchFolderException(com.liferay.knowledgebase.NoSuchFolderException) Session(com.liferay.portal.kernel.dao.orm.Session)

Example 3 with KBFolderImpl

use of com.liferay.knowledgebase.model.impl.KBFolderImpl in project liferay-ide by liferay.

the class KBFolderPersistenceImpl method findByG_P_PrevAndNext.

/**
 * Returns the k b folders before and after the current k b folder in the ordered set where groupId = &#63; and parentKBFolderId = &#63;.
 *
 * @param kbFolderId the primary key of the current k b folder
 * @param groupId the group ID
 * @param parentKBFolderId the parent k b folder ID
 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
 * @return the previous, current, and next k b folder
 * @throws com.liferay.knowledgebase.NoSuchFolderException if a k b folder with the primary key could not be found
 * @throws SystemException if a system exception occurred
 */
@Override
public KBFolder[] findByG_P_PrevAndNext(long kbFolderId, long groupId, long parentKBFolderId, OrderByComparator orderByComparator) throws NoSuchFolderException, SystemException {
    KBFolder kbFolder = findByPrimaryKey(kbFolderId);
    Session session = null;
    try {
        session = openSession();
        KBFolder[] array = new KBFolderImpl[3];
        array[0] = getByG_P_PrevAndNext(session, kbFolder, groupId, parentKBFolderId, orderByComparator, true);
        array[1] = kbFolder;
        array[2] = getByG_P_PrevAndNext(session, kbFolder, groupId, parentKBFolderId, orderByComparator, false);
        return array;
    } catch (Exception e) {
        throw processException(e);
    } finally {
        closeSession(session);
    }
}
Also used : KBFolder(com.liferay.knowledgebase.model.KBFolder) KBFolderImpl(com.liferay.knowledgebase.model.impl.KBFolderImpl) SystemException(com.liferay.portal.kernel.exception.SystemException) NoSuchFolderException(com.liferay.knowledgebase.NoSuchFolderException) Session(com.liferay.portal.kernel.dao.orm.Session)

Example 4 with KBFolderImpl

use of com.liferay.knowledgebase.model.impl.KBFolderImpl in project liferay-ide by liferay.

the class KBFolderPersistenceImpl method filterFindByG_P_PrevAndNext.

/**
 * Returns the k b folders before and after the current k b folder in the ordered set of k b folders that the user has permission to view where groupId = &#63; and parentKBFolderId = &#63;.
 *
 * @param kbFolderId the primary key of the current k b folder
 * @param groupId the group ID
 * @param parentKBFolderId the parent k b folder ID
 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
 * @return the previous, current, and next k b folder
 * @throws com.liferay.knowledgebase.NoSuchFolderException if a k b folder with the primary key could not be found
 * @throws SystemException if a system exception occurred
 */
@Override
public KBFolder[] filterFindByG_P_PrevAndNext(long kbFolderId, long groupId, long parentKBFolderId, OrderByComparator orderByComparator) throws NoSuchFolderException, SystemException {
    if (!InlineSQLHelperUtil.isEnabled(groupId)) {
        return findByG_P_PrevAndNext(kbFolderId, groupId, parentKBFolderId, orderByComparator);
    }
    KBFolder kbFolder = findByPrimaryKey(kbFolderId);
    Session session = null;
    try {
        session = openSession();
        KBFolder[] array = new KBFolderImpl[3];
        array[0] = filterGetByG_P_PrevAndNext(session, kbFolder, groupId, parentKBFolderId, orderByComparator, true);
        array[1] = kbFolder;
        array[2] = filterGetByG_P_PrevAndNext(session, kbFolder, groupId, parentKBFolderId, orderByComparator, false);
        return array;
    } catch (Exception e) {
        throw processException(e);
    } finally {
        closeSession(session);
    }
}
Also used : KBFolder(com.liferay.knowledgebase.model.KBFolder) KBFolderImpl(com.liferay.knowledgebase.model.impl.KBFolderImpl) SystemException(com.liferay.portal.kernel.exception.SystemException) NoSuchFolderException(com.liferay.knowledgebase.NoSuchFolderException) Session(com.liferay.portal.kernel.dao.orm.Session)

Example 5 with KBFolderImpl

use of com.liferay.knowledgebase.model.impl.KBFolderImpl in project liferay-ide by liferay.

the class KBFolderPersistenceImpl method findByUuid_PrevAndNext.

/**
 * Returns the k b folders before and after the current k b folder in the ordered set where uuid = &#63;.
 *
 * @param kbFolderId the primary key of the current k b folder
 * @param uuid the uuid
 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
 * @return the previous, current, and next k b folder
 * @throws com.liferay.knowledgebase.NoSuchFolderException if a k b folder with the primary key could not be found
 * @throws SystemException if a system exception occurred
 */
@Override
public KBFolder[] findByUuid_PrevAndNext(long kbFolderId, String uuid, OrderByComparator orderByComparator) throws NoSuchFolderException, SystemException {
    KBFolder kbFolder = findByPrimaryKey(kbFolderId);
    Session session = null;
    try {
        session = openSession();
        KBFolder[] array = new KBFolderImpl[3];
        array[0] = getByUuid_PrevAndNext(session, kbFolder, uuid, orderByComparator, true);
        array[1] = kbFolder;
        array[2] = getByUuid_PrevAndNext(session, kbFolder, uuid, orderByComparator, false);
        return array;
    } catch (Exception e) {
        throw processException(e);
    } finally {
        closeSession(session);
    }
}
Also used : KBFolder(com.liferay.knowledgebase.model.KBFolder) KBFolderImpl(com.liferay.knowledgebase.model.impl.KBFolderImpl) SystemException(com.liferay.portal.kernel.exception.SystemException) NoSuchFolderException(com.liferay.knowledgebase.NoSuchFolderException) Session(com.liferay.portal.kernel.dao.orm.Session)

Aggregations

KBFolderImpl (com.liferay.knowledgebase.model.impl.KBFolderImpl)6 KBFolder (com.liferay.knowledgebase.model.KBFolder)5 NoSuchFolderException (com.liferay.knowledgebase.NoSuchFolderException)4 Session (com.liferay.portal.kernel.dao.orm.Session)4 SystemException (com.liferay.portal.kernel.exception.SystemException)4