Search in sources :

Example 21 with NoSuchNodeException

use of com.liferay.portlet.wiki.NoSuchNodeException in project liferay-ide by liferay.

the class WikiNodePersistenceImpl method findByUuid_C_First.

/**
 * Returns the first wiki node 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 wiki node
 * @throws com.liferay.portlet.wiki.NoSuchNodeException if a matching wiki node could not be found
 * @throws SystemException if a system exception occurred
 */
@Override
public WikiNode findByUuid_C_First(String uuid, long companyId, OrderByComparator orderByComparator) throws NoSuchNodeException, SystemException {
    WikiNode wikiNode = fetchByUuid_C_First(uuid, companyId, orderByComparator);
    if (wikiNode != null) {
        return wikiNode;
    }
    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 NoSuchNodeException(msg.toString());
}
Also used : WikiNode(com.liferay.portlet.wiki.model.WikiNode) NoSuchNodeException(com.liferay.portlet.wiki.NoSuchNodeException) StringBundler(com.liferay.portal.kernel.util.StringBundler)

Example 22 with NoSuchNodeException

use of com.liferay.portlet.wiki.NoSuchNodeException in project liferay-ide by liferay.

the class WikiNodePersistenceImpl method findByUuid_C_Last.

/**
 * Returns the last wiki node in the ordered set where uuid = &#63; and companyId = &#63;.
 *
 * @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 wiki node
 * @throws com.liferay.portlet.wiki.NoSuchNodeException if a matching wiki node could not be found
 * @throws SystemException if a system exception occurred
 */
@Override
public WikiNode findByUuid_C_Last(String uuid, long companyId, OrderByComparator orderByComparator) throws NoSuchNodeException, SystemException {
    WikiNode wikiNode = fetchByUuid_C_Last(uuid, companyId, orderByComparator);
    if (wikiNode != null) {
        return wikiNode;
    }
    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 NoSuchNodeException(msg.toString());
}
Also used : WikiNode(com.liferay.portlet.wiki.model.WikiNode) NoSuchNodeException(com.liferay.portlet.wiki.NoSuchNodeException) StringBundler(com.liferay.portal.kernel.util.StringBundler)

Example 23 with NoSuchNodeException

use of com.liferay.portlet.wiki.NoSuchNodeException in project liferay-ide by liferay.

the class WikiNodePersistenceImpl method findByUuid_PrevAndNext.

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

Aggregations

NoSuchNodeException (com.liferay.portlet.wiki.NoSuchNodeException)23 WikiNode (com.liferay.portlet.wiki.model.WikiNode)23 StringBundler (com.liferay.portal.kernel.util.StringBundler)14 Session (com.liferay.portal.kernel.dao.orm.Session)9 SystemException (com.liferay.portal.kernel.exception.SystemException)9 WikiNodeImpl (com.liferay.portlet.wiki.model.impl.WikiNodeImpl)9