Пример #1
0
  @Override
  public void deleteStagedModel(String uuid, long groupId, String className, String extraData)
      throws PortalException, SystemException {

    JournalFolder folder =
        JournalFolderLocalServiceUtil.fetchJournalFolderByUuidAndGroupId(uuid, groupId);

    if (folder != null) {
      JournalFolderLocalServiceUtil.deleteFolder(folder);
    }
  }
  @Test
  public void testJournalFolderTreePathWithJournalFolderInTrash() throws Exception {

    JournalFolder parentFolder =
        JournalTestUtil.addFolder(_group.getGroupId(), RandomTestUtil.randomString());

    JournalFolder folder =
        JournalTestUtil.addFolder(
            _group.getGroupId(), parentFolder.getFolderId(), RandomTestUtil.randomString());

    JournalFolderLocalServiceUtil.moveFolderToTrash(
        TestPropsValues.getUserId(), folder.getFolderId());

    JournalFolderLocalServiceUtil.deleteFolder(parentFolder.getFolderId(), false);

    doVerify();
  }
  @Test
  public void testJournalArticleTreePathWithJournalArticleInTrash() throws Exception {

    JournalFolder parentFolder =
        JournalTestUtil.addFolder(_group.getGroupId(), RandomTestUtil.randomString());

    JournalArticle article =
        JournalTestUtil.addArticle(
            _group.getGroupId(), parentFolder.getFolderId(), "title", "content");

    JournalArticleLocalServiceUtil.moveArticleToTrash(
        TestPropsValues.getUserId(), _group.getGroupId(), article.getArticleId());

    JournalFolderLocalServiceUtil.deleteFolder(parentFolder.getFolderId(), false);

    doVerify();
  }