Search in sources :

Example 1 with WikiNodeImpl

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

the class WikiNodePersistenceImpl method create.

/**
 * Creates a new wiki node with the primary key. Does not add the wiki node to the database.
 *
 * @param nodeId the primary key for the new wiki node
 * @return the new wiki node
 */
@Override
public WikiNode create(long nodeId) {
    WikiNode wikiNode = new WikiNodeImpl();
    wikiNode.setNew(true);
    wikiNode.setPrimaryKey(nodeId);
    String uuid = PortalUUIDUtil.generate();
    wikiNode.setUuid(uuid);
    return wikiNode;
}
Also used : WikiNodeImpl(com.liferay.portlet.wiki.model.impl.WikiNodeImpl) WikiNode(com.liferay.portlet.wiki.model.WikiNode)

Example 2 with WikiNodeImpl

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

the class WikiNodePersistenceImpl method findByCompanyId_PrevAndNext.

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

Example 3 with WikiNodeImpl

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

the class WikiNodePersistenceImpl method findByGroupId_PrevAndNext.

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

Example 4 with WikiNodeImpl

use of com.liferay.portlet.wiki.model.impl.WikiNodeImpl 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)

Example 5 with WikiNodeImpl

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

the class WikiNodePersistenceImpl method filterFindByGroupId_PrevAndNext.

/**
 * Returns the wiki nodes before and after the current wiki node in the ordered set of wiki nodes that the user has permission to view where groupId = &#63;.
 *
 * @param nodeId the primary key of the current wiki node
 * @param groupId the group ID
 * @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[] filterFindByGroupId_PrevAndNext(long nodeId, long groupId, OrderByComparator orderByComparator) throws NoSuchNodeException, SystemException {
    if (!InlineSQLHelperUtil.isEnabled(groupId)) {
        return findByGroupId_PrevAndNext(nodeId, groupId, orderByComparator);
    }
    WikiNode wikiNode = findByPrimaryKey(nodeId);
    Session session = null;
    try {
        session = openSession();
        WikiNode[] array = new WikiNodeImpl[3];
        array[0] = filterGetByGroupId_PrevAndNext(session, wikiNode, groupId, orderByComparator, true);
        array[1] = wikiNode;
        array[2] = filterGetByGroupId_PrevAndNext(session, wikiNode, groupId, 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

WikiNodeImpl (com.liferay.portlet.wiki.model.impl.WikiNodeImpl)10 WikiNode (com.liferay.portlet.wiki.model.WikiNode)9 Session (com.liferay.portal.kernel.dao.orm.Session)8 SystemException (com.liferay.portal.kernel.exception.SystemException)8 NoSuchNodeException (com.liferay.portlet.wiki.NoSuchNodeException)8