Search in sources :

Example 11 with WikiNode

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

the class WikiNodePersistenceImpl method remove.

/**
 * Removes the wiki node with the primary key from the database. Also notifies the appropriate model listeners.
 *
 * @param primaryKey the primary key of the wiki node
 * @return the wiki node that was removed
 * @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 remove(Serializable primaryKey) throws NoSuchNodeException, SystemException {
    Session session = null;
    try {
        session = openSession();
        WikiNode wikiNode = (WikiNode) session.get(WikiNodeImpl.class, primaryKey);
        if (wikiNode == null) {
            if (_log.isWarnEnabled()) {
                _log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey);
            }
            throw new NoSuchNodeException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey);
        }
        return remove(wikiNode);
    } catch (NoSuchNodeException nsee) {
        throw nsee;
    } 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) NoSuchNodeException(com.liferay.portlet.wiki.NoSuchNodeException) SystemException(com.liferay.portal.kernel.exception.SystemException) NoSuchNodeException(com.liferay.portlet.wiki.NoSuchNodeException) Session(com.liferay.portal.kernel.dao.orm.Session)

Example 12 with WikiNode

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

the class WikiNodePersistenceImpl method findByUuid_First.

/**
 * Returns the first wiki node in the ordered set where uuid = ?.
 *
 * @param uuid the uuid
 * @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_First(String uuid, OrderByComparator orderByComparator) throws NoSuchNodeException, SystemException {
    WikiNode wikiNode = fetchByUuid_First(uuid, orderByComparator);
    if (wikiNode != null) {
        return wikiNode;
    }
    StringBundler msg = new StringBundler(4);
    msg.append(_NO_SUCH_ENTITY_WITH_KEY);
    msg.append("uuid=");
    msg.append(uuid);
    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 13 with WikiNode

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

the class WikiNodePersistenceImpl method findByGroupId_First.

/**
 * Returns the first wiki node in the ordered set where groupId = &#63;.
 *
 * @param groupId the group 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 findByGroupId_First(long groupId, OrderByComparator orderByComparator) throws NoSuchNodeException, SystemException {
    WikiNode wikiNode = fetchByGroupId_First(groupId, orderByComparator);
    if (wikiNode != null) {
        return wikiNode;
    }
    StringBundler msg = new StringBundler(4);
    msg.append(_NO_SUCH_ENTITY_WITH_KEY);
    msg.append("groupId=");
    msg.append(groupId);
    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 14 with WikiNode

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

the class WikiNodePersistenceImpl method findByUUID_G.

/**
 * Returns the wiki node where uuid = &#63; and groupId = &#63; or throws a {@link com.liferay.portlet.wiki.NoSuchNodeException} if it could not be found.
 *
 * @param uuid the uuid
 * @param groupId the group ID
 * @return the 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_G(String uuid, long groupId) throws NoSuchNodeException, SystemException {
    WikiNode wikiNode = fetchByUUID_G(uuid, groupId);
    if (wikiNode == null) {
        StringBundler msg = new StringBundler(6);
        msg.append(_NO_SUCH_ENTITY_WITH_KEY);
        msg.append("uuid=");
        msg.append(uuid);
        msg.append(", groupId=");
        msg.append(groupId);
        msg.append(StringPool.CLOSE_CURLY_BRACE);
        if (_log.isWarnEnabled()) {
            _log.warn(msg.toString());
        }
        throw new NoSuchNodeException(msg.toString());
    }
    return wikiNode;
}
Also used : WikiNode(com.liferay.portlet.wiki.model.WikiNode) NoSuchNodeException(com.liferay.portlet.wiki.NoSuchNodeException) StringBundler(com.liferay.portal.kernel.util.StringBundler)

Example 15 with WikiNode

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

the class WikiNodePersistenceImpl method findByC_S_PrevAndNext.

/**
 * Returns the wiki nodes before and after the current wiki node in the ordered set where companyId = &#63; and status = &#63;.
 *
 * @param nodeId the primary key of the current wiki node
 * @param companyId the company ID
 * @param status the status
 * @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[] findByC_S_PrevAndNext(long nodeId, long companyId, int status, OrderByComparator orderByComparator) throws NoSuchNodeException, SystemException {
    WikiNode wikiNode = findByPrimaryKey(nodeId);
    Session session = null;
    try {
        session = openSession();
        WikiNode[] array = new WikiNodeImpl[3];
        array[0] = getByC_S_PrevAndNext(session, wikiNode, companyId, status, orderByComparator, true);
        array[1] = wikiNode;
        array[2] = getByC_S_PrevAndNext(session, wikiNode, companyId, status, 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

WikiNode (com.liferay.portlet.wiki.model.WikiNode)45 NoSuchNodeException (com.liferay.portlet.wiki.NoSuchNodeException)35 StringBundler (com.liferay.portal.kernel.util.StringBundler)33 Session (com.liferay.portal.kernel.dao.orm.Session)21 SystemException (com.liferay.portal.kernel.exception.SystemException)21 SQLQuery (com.liferay.portal.kernel.dao.orm.SQLQuery)19 QueryPos (com.liferay.portal.kernel.dao.orm.QueryPos)18 Query (com.liferay.portal.kernel.dao.orm.Query)15 UnmodifiableList (com.liferay.portal.kernel.util.UnmodifiableList)11 WikiNodeImpl (com.liferay.portlet.wiki.model.impl.WikiNodeImpl)11 ArrayList (java.util.ArrayList)11 List (java.util.List)11 FinderPath (com.liferay.portal.kernel.dao.orm.FinderPath)7