Search in sources :

Example 1 with NoSuchFolderException

use of com.liferay.knowledgebase.NoSuchFolderException in project liferay-ide by liferay.

the class KBFolderPersistenceImpl method findByUuid_C_Last.

/**
 * Returns the last k b folder 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 last matching k b folder
 * @throws com.liferay.knowledgebase.NoSuchFolderException if a matching k b folder could not be found
 * @throws SystemException if a system exception occurred
 */
@Override
public KBFolder findByUuid_C_Last(String uuid, long companyId, OrderByComparator orderByComparator) throws NoSuchFolderException, SystemException {
    KBFolder kbFolder = fetchByUuid_C_Last(uuid, companyId, orderByComparator);
    if (kbFolder != null) {
        return kbFolder;
    }
    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 NoSuchFolderException(msg.toString());
}
Also used : KBFolder(com.liferay.knowledgebase.model.KBFolder) NoSuchFolderException(com.liferay.knowledgebase.NoSuchFolderException) StringBundler(com.liferay.portal.kernel.util.StringBundler)

Example 2 with NoSuchFolderException

use of com.liferay.knowledgebase.NoSuchFolderException in project liferay-ide by liferay.

the class KBFolderPersistenceImpl method findByG_P_UT.

/**
 * Returns the k b folder where groupId = &#63; and parentKBFolderId = &#63; and urlTitle = &#63; or throws a {@link com.liferay.knowledgebase.NoSuchFolderException} if it could not be found.
 *
 * @param groupId the group ID
 * @param parentKBFolderId the parent k b folder ID
 * @param urlTitle the url title
 * @return the matching k b folder
 * @throws com.liferay.knowledgebase.NoSuchFolderException if a matching k b folder could not be found
 * @throws SystemException if a system exception occurred
 */
@Override
public KBFolder findByG_P_UT(long groupId, long parentKBFolderId, String urlTitle) throws NoSuchFolderException, SystemException {
    KBFolder kbFolder = fetchByG_P_UT(groupId, parentKBFolderId, urlTitle);
    if (kbFolder == null) {
        StringBundler msg = new StringBundler(8);
        msg.append(_NO_SUCH_ENTITY_WITH_KEY);
        msg.append("groupId=");
        msg.append(groupId);
        msg.append(", parentKBFolderId=");
        msg.append(parentKBFolderId);
        msg.append(", urlTitle=");
        msg.append(urlTitle);
        msg.append(StringPool.CLOSE_CURLY_BRACE);
        if (_log.isWarnEnabled()) {
            _log.warn(msg.toString());
        }
        throw new NoSuchFolderException(msg.toString());
    }
    return kbFolder;
}
Also used : KBFolder(com.liferay.knowledgebase.model.KBFolder) NoSuchFolderException(com.liferay.knowledgebase.NoSuchFolderException) StringBundler(com.liferay.portal.kernel.util.StringBundler)

Example 3 with NoSuchFolderException

use of com.liferay.knowledgebase.NoSuchFolderException in project liferay-ide by liferay.

the class KBFolderPersistenceImpl method remove.

/**
 * Removes the k b folder with the primary key from the database. Also notifies the appropriate model listeners.
 *
 * @param primaryKey the primary key of the k b folder
 * @return the k b folder that was removed
 * @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 remove(Serializable primaryKey) throws NoSuchFolderException, SystemException {
    Session session = null;
    try {
        session = openSession();
        KBFolder kbFolder = (KBFolder) session.get(KBFolderImpl.class, primaryKey);
        if (kbFolder == null) {
            if (_log.isWarnEnabled()) {
                _log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey);
            }
            throw new NoSuchFolderException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey);
        }
        return remove(kbFolder);
    } catch (NoSuchFolderException nsee) {
        throw nsee;
    } catch (Exception e) {
        throw processException(e);
    } finally {
        closeSession(session);
    }
}
Also used : KBFolder(com.liferay.knowledgebase.model.KBFolder) NoSuchFolderException(com.liferay.knowledgebase.NoSuchFolderException) 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 NoSuchFolderException

use of com.liferay.knowledgebase.NoSuchFolderException 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 = &#63; and companyId = &#63;.
 *
 * @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 5 with NoSuchFolderException

use of com.liferay.knowledgebase.NoSuchFolderException 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)

Aggregations

NoSuchFolderException (com.liferay.knowledgebase.NoSuchFolderException)15 KBFolder (com.liferay.knowledgebase.model.KBFolder)15 StringBundler (com.liferay.portal.kernel.util.StringBundler)9 KBFolderImpl (com.liferay.knowledgebase.model.impl.KBFolderImpl)5 Session (com.liferay.portal.kernel.dao.orm.Session)5 SystemException (com.liferay.portal.kernel.exception.SystemException)5