Search in sources :

Example 6 with WikiNodeImpl

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

the class WikiNodePersistenceImpl method findByG_S_PrevAndNext.

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

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

the class WikiNodePersistenceImpl method filterFindByG_S_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; and status = &#63;.
 *
 * @param nodeId the primary key of the current wiki node
 * @param groupId the group 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[] filterFindByG_S_PrevAndNext(long nodeId, long groupId, int status, OrderByComparator orderByComparator) throws NoSuchNodeException, SystemException {
    if (!InlineSQLHelperUtil.isEnabled(groupId)) {
        return findByG_S_PrevAndNext(nodeId, groupId, status, orderByComparator);
    }
    WikiNode wikiNode = findByPrimaryKey(nodeId);
    Session session = null;
    try {
        session = openSession();
        WikiNode[] array = new WikiNodeImpl[3];
        array[0] = filterGetByG_S_PrevAndNext(session, wikiNode, groupId, status, orderByComparator, true);
        array[1] = wikiNode;
        array[2] = filterGetByG_S_PrevAndNext(session, wikiNode, groupId, 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 8 with WikiNodeImpl

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

the class WikiNodePersistenceImpl method toUnwrappedModel.

protected WikiNode toUnwrappedModel(WikiNode wikiNode) {
    if (wikiNode instanceof WikiNodeImpl) {
        return wikiNode;
    }
    WikiNodeImpl wikiNodeImpl = new WikiNodeImpl();
    wikiNodeImpl.setNew(wikiNode.isNew());
    wikiNodeImpl.setPrimaryKey(wikiNode.getPrimaryKey());
    wikiNodeImpl.setUuid(wikiNode.getUuid());
    wikiNodeImpl.setNodeId(wikiNode.getNodeId());
    wikiNodeImpl.setGroupId(wikiNode.getGroupId());
    wikiNodeImpl.setCompanyId(wikiNode.getCompanyId());
    wikiNodeImpl.setUserId(wikiNode.getUserId());
    wikiNodeImpl.setUserName(wikiNode.getUserName());
    wikiNodeImpl.setCreateDate(wikiNode.getCreateDate());
    wikiNodeImpl.setModifiedDate(wikiNode.getModifiedDate());
    wikiNodeImpl.setName(wikiNode.getName());
    wikiNodeImpl.setDescription(wikiNode.getDescription());
    wikiNodeImpl.setLastPostDate(wikiNode.getLastPostDate());
    wikiNodeImpl.setStatus(wikiNode.getStatus());
    wikiNodeImpl.setStatusByUserId(wikiNode.getStatusByUserId());
    wikiNodeImpl.setStatusByUserName(wikiNode.getStatusByUserName());
    wikiNodeImpl.setStatusDate(wikiNode.getStatusDate());
    return wikiNodeImpl;
}
Also used : WikiNodeImpl(com.liferay.portlet.wiki.model.impl.WikiNodeImpl)

Example 9 with WikiNodeImpl

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

the class WikiNodePersistenceImpl method findByUuid_C_PrevAndNext.

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

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

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