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

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

Introduction

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

Prototype

int STATUS_APPROVED

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

Click Source Link

Usage

From source file:com.liferay.message.boards.service.impl.MBStatsUserLocalServiceImpl.java

License:Open Source License

@Override
public MBStatsUser updateStatsUser(long groupId, long userId, Date lastPostDate) {

    int messageCount = mbMessageLocalService.getGroupMessagesCount(groupId, userId,
            WorkflowConstants.STATUS_APPROVED);

    return updateStatsUser(groupId, userId, messageCount, lastPostDate);
}

From source file:com.liferay.message.boards.service.test.MBCategoryLocalServiceTest.java

License:Open Source License

@Test
public void testGetCategoriesAndThreadsCountInRootCategory() throws Exception {

    addMessage(MBCategoryConstants.DEFAULT_PARENT_CATEGORY_ID);

    MBCategory category1 = addCategory();

    addMessage(category1.getCategoryId());

    MBCategory category2 = addCategory();

    addMessage(category2.getCategoryId());

    addMessage(MBCategoryConstants.DEFAULT_PARENT_CATEGORY_ID);

    int categoriesAndThreadsCount = MBCategoryLocalServiceUtil.getCategoriesAndThreadsCount(_group.getGroupId(),
            MBCategoryConstants.DEFAULT_PARENT_CATEGORY_ID, WorkflowConstants.STATUS_APPROVED);

    Assert.assertEquals(4, categoriesAndThreadsCount);
}

From source file:com.liferay.message.boards.service.test.MBCategoryLocalServiceTest.java

License:Open Source License

@Test
public void testGetCategoriesAndThreadsCountInRootCategoryWithOnlyCategories() throws Exception {

    MBCategory category1 = addCategory();

    addCategory(category1.getCategoryId());

    addCategory();/*from   w w  w .  j  av a 2s  .  co m*/

    int categoriesAndThreadsCount = MBCategoryLocalServiceUtil.getCategoriesAndThreadsCount(_group.getGroupId(),
            MBCategoryConstants.DEFAULT_PARENT_CATEGORY_ID, WorkflowConstants.STATUS_APPROVED);

    Assert.assertEquals(2, categoriesAndThreadsCount);
}

From source file:com.liferay.message.boards.service.test.MBCategoryLocalServiceTest.java

License:Open Source License

@Test
public void testGetCategoriesAndThreadsCountInRootCategoryWithOnlyThreads() throws Exception {

    addMessage(MBCategoryConstants.DEFAULT_PARENT_CATEGORY_ID);

    addMessage(MBCategoryConstants.DEFAULT_PARENT_CATEGORY_ID);

    int categoriesAndThreadsCount = MBCategoryLocalServiceUtil.getCategoriesAndThreadsCount(_group.getGroupId(),
            MBCategoryConstants.DEFAULT_PARENT_CATEGORY_ID, WorkflowConstants.STATUS_APPROVED);

    Assert.assertEquals(2, categoriesAndThreadsCount);
}

From source file:com.liferay.message.boards.service.test.MBCategoryLocalServiceTest.java

License:Open Source License

@Test
public void testGetCategoriesAndThreadsCountWithOnlyCategories() throws Exception {

    MBCategory category1 = addCategory();

    addCategory(category1.getCategoryId());

    addCategory();//from  w  w  w  .j  a v a2 s  .  c o  m

    int categoriesAndThreadsCount = MBCategoryLocalServiceUtil.getCategoriesAndThreadsCount(_group.getGroupId(),
            category1.getCategoryId(), WorkflowConstants.STATUS_APPROVED);

    Assert.assertEquals(1, categoriesAndThreadsCount);
}

From source file:com.liferay.message.boards.service.test.MBCategoryLocalServiceTest.java

License:Open Source License

@Test
public void testGetCategoriesAndThreadsInRootCategory() throws Exception {
    MBMessage message1 = addMessage(MBCategoryConstants.DEFAULT_PARENT_CATEGORY_ID);

    MBCategory category1 = addCategory();

    addMessage(category1.getCategoryId());

    MBCategory category2 = addCategory();

    addMessage(category2.getCategoryId());

    MBMessage message2 = addMessage(MBCategoryConstants.DEFAULT_PARENT_CATEGORY_ID);

    List<Object> categoriesAndThreads = MBCategoryLocalServiceUtil.getCategoriesAndThreads(_group.getGroupId(),
            MBCategoryConstants.DEFAULT_PARENT_CATEGORY_ID, WorkflowConstants.STATUS_APPROVED);

    Assert.assertEquals(categoriesAndThreads.toString(), 4, categoriesAndThreads.size());
    Assert.assertEquals(category1, categoriesAndThreads.get(0));
    Assert.assertEquals(category2, categoriesAndThreads.get(1));
    Assert.assertEquals(message1.getThread(), categoriesAndThreads.get(2));
    Assert.assertEquals(message2.getThread(), categoriesAndThreads.get(3));
}

From source file:com.liferay.message.boards.service.test.MBCategoryLocalServiceTest.java

License:Open Source License

@Test
public void testGetCategoriesAndThreadsInRootCategoryWithOnlyCategories() throws Exception {

    MBCategory category1 = addCategory();

    addCategory(category1.getCategoryId());

    MBCategory category2 = addCategory();

    List<Object> categoriesAndThreads = MBCategoryLocalServiceUtil.getCategoriesAndThreads(_group.getGroupId(),
            MBCategoryConstants.DEFAULT_PARENT_CATEGORY_ID, WorkflowConstants.STATUS_APPROVED);

    Assert.assertEquals(categoriesAndThreads.toString(), 2, categoriesAndThreads.size());
    Assert.assertEquals(category1, categoriesAndThreads.get(0));
    Assert.assertEquals(category2, categoriesAndThreads.get(1));
}

From source file:com.liferay.message.boards.service.test.MBCategoryLocalServiceTest.java

License:Open Source License

@Test
public void testGetCategoriesAndThreadsInRootCategoryWithOnlyThreads() throws Exception {

    MBMessage message1 = addMessage(MBCategoryConstants.DEFAULT_PARENT_CATEGORY_ID);

    MBMessage message2 = addMessage(MBCategoryConstants.DEFAULT_PARENT_CATEGORY_ID);

    List<Object> categoriesAndThreads = MBCategoryLocalServiceUtil.getCategoriesAndThreads(_group.getGroupId(),
            MBCategoryConstants.DEFAULT_PARENT_CATEGORY_ID, WorkflowConstants.STATUS_APPROVED);

    Assert.assertEquals(categoriesAndThreads.toString(), 2, categoriesAndThreads.size());
    Assert.assertEquals(message1.getThread(), categoriesAndThreads.get(0));
    Assert.assertEquals(message2.getThread(), categoriesAndThreads.get(1));
}

From source file:com.liferay.message.boards.service.test.MBCategoryLocalServiceTest.java

License:Open Source License

@Test
public void testGetCategoriesAndThreadsWithOnlyCategories() throws Exception {

    MBCategory category1 = addCategory();

    MBCategory subcategory1 = addCategory(category1.getCategoryId());

    addCategory();//from  www .  j  a v a2 s. c o m

    List<Object> categoriesAndThreads = MBCategoryLocalServiceUtil.getCategoriesAndThreads(_group.getGroupId(),
            category1.getCategoryId(), WorkflowConstants.STATUS_APPROVED);

    Assert.assertEquals(categoriesAndThreads.toString(), 1, categoriesAndThreads.size());
    Assert.assertEquals(subcategory1, categoriesAndThreads.get(0));
}

From source file:com.liferay.message.boards.service.test.MBCategoryLocalServiceTest.java

License:Open Source License

@Test
public void testGetCategoriesAndThreadsWithPriorityThread() throws Exception {

    MBMessage message1 = addMessage(MBCategoryConstants.DEFAULT_PARENT_CATEGORY_ID);

    MBCategory category1 = addCategory();

    addMessage(category1.getCategoryId());

    MBMessage priorityMessage = addMessage(MBCategoryConstants.DEFAULT_PARENT_CATEGORY_ID, 2.0);

    MBMessage message2 = addMessage(MBCategoryConstants.DEFAULT_PARENT_CATEGORY_ID);

    List<Object> categoriesAndThreads = MBCategoryLocalServiceUtil.getCategoriesAndThreads(_group.getGroupId(),
            MBCategoryConstants.DEFAULT_PARENT_CATEGORY_ID, WorkflowConstants.STATUS_APPROVED);

    Assert.assertEquals(categoriesAndThreads.toString(), 4, categoriesAndThreads.size());
    Assert.assertEquals(category1, categoriesAndThreads.get(0));
    Assert.assertEquals(priorityMessage.getThread(), categoriesAndThreads.get(1));
    Assert.assertEquals(message1.getThread(), categoriesAndThreads.get(2));
    Assert.assertEquals(message2.getThread(), categoriesAndThreads.get(3));
}