Example usage for com.liferay.portal.kernel.workflow WorkflowConstants STATUS_ANY

List of usage examples for com.liferay.portal.kernel.workflow WorkflowConstants STATUS_ANY

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.workflow WorkflowConstants STATUS_ANY.

Prototype

int STATUS_ANY

To view the source code for com.liferay.portal.kernel.workflow WorkflowConstants STATUS_ANY.

Click Source Link

Usage

From source file:com.liferay.portlet.blogs.service.impl.BlogsEntryLocalServiceImpl.java

License:Open Source License

public int getGroupUserEntriesCount(long groupId, long userId, Date displayDate, int status)
        throws SystemException {

    if (status == WorkflowConstants.STATUS_ANY) {
        return blogsEntryPersistence.countByG_U_LtD(groupId, userId, displayDate);
    } else {/*from  w ww .  j ava2 s  .co m*/
        return blogsEntryPersistence.countByG_U_LtD_S(groupId, userId, displayDate, status);
    }
}

From source file:com.liferay.portlet.blogs.service.impl.BlogsEntryServiceImpl.java

License:Open Source License

public List<BlogsEntry> getGroupEntries(long groupId, Date displayDate, int status, int max)
        throws SystemException {

    if (status == WorkflowConstants.STATUS_ANY) {
        return blogsEntryPersistence.filterFindByG_LtD(groupId, displayDate, 0, max);
    } else {/* ww  w.  jav  a2s. c om*/
        return blogsEntryPersistence.filterFindByG_LtD_S(groupId, displayDate, status, 0, max);
    }
}

From source file:com.liferay.portlet.blogs.service.impl.BlogsEntryServiceImpl.java

License:Open Source License

public List<BlogsEntry> getGroupEntries(long groupId, Date displayDate, int status, int start, int end)
        throws SystemException {

    if (status == WorkflowConstants.STATUS_ANY) {
        return blogsEntryPersistence.filterFindByG_LtD(groupId, displayDate, start, end);
    } else {/*from  w  w  w. j a v  a2s  . c o m*/
        return blogsEntryPersistence.filterFindByG_LtD_S(groupId, displayDate, status, start, end);
    }
}

From source file:com.liferay.portlet.blogs.service.impl.BlogsEntryServiceImpl.java

License:Open Source License

public List<BlogsEntry> getGroupEntries(long groupId, int status, int max) throws SystemException {

    if (status == WorkflowConstants.STATUS_ANY) {
        return blogsEntryPersistence.filterFindByGroupId(groupId, 0, max);
    } else {/*from www  . java 2s  . c  om*/
        return blogsEntryPersistence.filterFindByG_S(groupId, status, 0, max);
    }
}

From source file:com.liferay.portlet.blogs.service.impl.BlogsEntryServiceImpl.java

License:Open Source License

public List<BlogsEntry> getGroupEntries(long groupId, int status, int start, int end) throws SystemException {

    if (status == WorkflowConstants.STATUS_ANY) {
        return blogsEntryPersistence.filterFindByGroupId(groupId, start, end);
    } else {//w ww. ja v a 2 s .c  om
        return blogsEntryPersistence.filterFindByG_S(groupId, status, start, end);
    }
}

From source file:com.liferay.portlet.blogs.service.impl.BlogsEntryServiceImpl.java

License:Open Source License

public int getGroupEntriesCount(long groupId, Date displayDate, int status) throws SystemException {

    if (status == WorkflowConstants.STATUS_ANY) {
        return blogsEntryPersistence.filterCountByG_LtD(groupId, displayDate);
    } else {/*  ww w.j av a  2s  .  co  m*/
        return blogsEntryPersistence.filterCountByG_LtD_S(groupId, displayDate, status);
    }
}

From source file:com.liferay.portlet.blogs.service.impl.BlogsEntryServiceImpl.java

License:Open Source License

public int getGroupEntriesCount(long groupId, int status) throws SystemException {

    if (status == WorkflowConstants.STATUS_ANY) {
        return blogsEntryPersistence.filterCountByGroupId(groupId);
    } else {/*from   w w  w . ja va 2s. c om*/
        return blogsEntryPersistence.filterCountByG_S(groupId, status);
    }
}

From source file:com.liferay.portlet.blogs.service.persistence.BlogsEntryFinderImpl.java

License:Open Source License

public int countByOrganizationIds(List<Long> organizationIds, Date displayDate, int status)
        throws SystemException {

    Timestamp displayDate_TS = CalendarUtil.getTimestamp(displayDate);

    Session session = null;/*from   w ww  . ja  v  a2 s  . c  o m*/

    try {
        session = openSession();

        String sql = CustomSQLUtil.get(COUNT_BY_ORGANIZATION_IDS);

        if (status != WorkflowConstants.STATUS_ANY) {
            sql = CustomSQLUtil.appendCriteria(sql, "AND (BlogsEntry.status = ?)");
        }

        sql = StringUtil.replace(sql, "[$ORGANIZATION_ID$]", getOrganizationIds(organizationIds));

        SQLQuery q = session.createSQLQuery(sql);

        q.addScalar(COUNT_COLUMN_NAME, Type.LONG);

        QueryPos qPos = QueryPos.getInstance(q);

        for (int i = 0; i < organizationIds.size(); i++) {
            Long organizationId = organizationIds.get(i);

            qPos.add(organizationId);
        }

        qPos.add(displayDate_TS);

        if (status != WorkflowConstants.STATUS_ANY) {
            qPos.add(status);
        }

        Iterator<Long> itr = q.iterate();

        if (itr.hasNext()) {
            Long count = itr.next();

            if (count != null) {
                return count.intValue();
            }
        }

        return 0;
    } catch (Exception e) {
        throw new SystemException(e);
    } finally {
        closeSession(session);
    }
}

From source file:com.liferay.portlet.blogs.service.persistence.BlogsEntryFinderImpl.java

License:Open Source License

public List<BlogsEntry> findByGroupIds(long companyId, long groupId, Date displayDate, int status, int start,
        int end) throws SystemException {

    Session session = null;//from  www  .  j a v a 2 s  .c o  m

    try {
        session = openSession();

        String sql = CustomSQLUtil.get(FIND_BY_GROUP_IDS);

        if (status != WorkflowConstants.STATUS_ANY) {
            sql = CustomSQLUtil.appendCriteria(sql, "AND (BlogsEntry.status = ?)");
        }

        SQLQuery q = session.createSQLQuery(sql);

        q.addEntity("BlogsEntry", BlogsEntryImpl.class);

        QueryPos qPos = QueryPos.getInstance(q);

        qPos.add(companyId);
        qPos.add(groupId);
        qPos.add(groupId);
        qPos.add(groupId);
        qPos.add(displayDate);

        if (status != WorkflowConstants.STATUS_ANY) {
            qPos.add(status);
        }

        return (List<BlogsEntry>) QueryUtil.list(q, getDialect(), start, end);
    } catch (Exception e) {
        throw new SystemException(e);
    } finally {
        closeSession(session);
    }
}

From source file:com.liferay.portlet.blogs.service.persistence.BlogsEntryFinderImpl.java

License:Open Source License

public List<BlogsEntry> findByOrganizationIds(List<Long> organizationIds, Date displayDate, int status,
        int start, int end, OrderByComparator obc) throws SystemException {

    Timestamp displayDate_TS = CalendarUtil.getTimestamp(displayDate);

    Session session = null;/*from w w w. j av a 2s.  c om*/

    try {
        session = openSession();

        String sql = CustomSQLUtil.get(FIND_BY_ORGANIZATION_IDS);

        if (status != WorkflowConstants.STATUS_ANY) {
            sql = CustomSQLUtil.appendCriteria(sql, "AND (BlogsEntry.status = ?)");
        }

        sql = StringUtil.replace(sql, "[$ORGANIZATION_ID$]", getOrganizationIds(organizationIds));
        sql = CustomSQLUtil.replaceOrderBy(sql, obc);

        SQLQuery q = session.createSQLQuery(sql);

        q.addEntity("BlogsEntry", BlogsEntryImpl.class);

        QueryPos qPos = QueryPos.getInstance(q);

        for (int i = 0; i < organizationIds.size(); i++) {
            Long organizationId = organizationIds.get(i);

            qPos.add(organizationId);
        }

        qPos.add(displayDate_TS);

        if (status != WorkflowConstants.STATUS_ANY) {
            qPos.add(status);
        }

        return (List<BlogsEntry>) QueryUtil.list(q, getDialect(), start, end);
    } catch (Exception e) {
        throw new SystemException(e);
    } finally {
        closeSession(session);
    }
}