protected void reindexRoot(final long companyId) throws PortalException {
    ActionableDynamicQuery actionableDynamicQuery =
        GroupLocalServiceUtil.getActionableDynamicQuery();

    actionableDynamicQuery.setCompanyId(companyId);
    actionableDynamicQuery.setPerformActionMethod(
        new ActionableDynamicQuery.PerformActionMethod() {

          @Override
          public void performAction(Object object) throws PortalException {

            Group group = (Group) object;

            String portletId = PortletKeys.DOCUMENT_LIBRARY;
            long groupId = group.getGroupId();
            long folderId = groupId;

            String[] newIds = {
              String.valueOf(companyId),
              portletId,
              String.valueOf(groupId),
              String.valueOf(folderId)
            };

            reindex(newIds);
          }
        });

    actionableDynamicQuery.performActions();
  }
  @Override
  public void trashSyncDLObjects(final SyncDLObject parentSyncDLObject) throws PortalException {

    ActionableDynamicQuery actionableDynamicQuery = getActionableDynamicQuery();

    actionableDynamicQuery.setAddCriteriaMethod(
        new ActionableDynamicQuery.AddCriteriaMethod() {

          @Override
          public void addCriteria(DynamicQuery dynamicQuery) {
            dynamicQuery.add(
                RestrictionsFactoryUtil.ne("event", SyncDLObjectConstants.EVENT_TRASH));

            String treePath = parentSyncDLObject.getTreePath();

            dynamicQuery.add(
                RestrictionsFactoryUtil.like("treePath", treePath + StringPool.PERCENT));
          }
        });
    actionableDynamicQuery.setPerformActionMethod(
        new ActionableDynamicQuery.PerformActionMethod<SyncDLObject>() {

          @Override
          public void performAction(SyncDLObject syncDLObject) throws PortalException {

            syncDLObject.setUserId(parentSyncDLObject.getUserId());
            syncDLObject.setUserName(parentSyncDLObject.getUserName());
            syncDLObject.setEvent(SyncDLObjectConstants.EVENT_TRASH);

            syncDLObjectPersistence.update(syncDLObject);
          }
        });

    actionableDynamicQuery.performActions();
  }
Ejemplo n.º 3
0
  protected void reindexKBArticles(long companyId) throws Exception {
    final ActionableDynamicQuery actionableDynamicQuery =
        KBArticleLocalServiceUtil.getActionableDynamicQuery();

    actionableDynamicQuery.setAddCriteriaMethod(
        new ActionableDynamicQuery.AddCriteriaMethod() {

          @Override
          public void addCriteria(DynamicQuery dynamicQuery) {
            Property property = PropertyFactoryUtil.forName("status");

            dynamicQuery.add(property.eq(WorkflowConstants.STATUS_APPROVED));
          }
        });
    actionableDynamicQuery.setCompanyId(companyId);
    actionableDynamicQuery.setPerformActionMethod(
        new ActionableDynamicQuery.PerformActionMethod() {

          @Override
          public void performAction(Object object) throws PortalException {

            KBArticle kbArticle = (KBArticle) object;

            Document document = getDocument(kbArticle);

            actionableDynamicQuery.addDocument(document);
          }
        });
    actionableDynamicQuery.setSearchEngineId(getSearchEngineId());

    actionableDynamicQuery.performActions();
  }
Ejemplo n.º 4
0
  protected void reindexCalendars(long companyId) throws PortalException {
    final ActionableDynamicQuery actionableDynamicQuery =
        _calendarLocalService.getActionableDynamicQuery();

    actionableDynamicQuery.setCompanyId(companyId);
    actionableDynamicQuery.setPerformActionMethod(
        new ActionableDynamicQuery.PerformActionMethod<Calendar>() {

          @Override
          public void performAction(Calendar calendar) {
            try {
              Document document = getDocument(calendar);

              actionableDynamicQuery.addDocument(document);
            } catch (PortalException pe) {
              if (_log.isWarnEnabled()) {
                _log.warn("Unable to index calendar " + calendar.getCalendarId(), pe);
              }
            }
          }
        });

    actionableDynamicQuery.setSearchEngineId(getSearchEngineId());

    actionableDynamicQuery.performActions();
  }
  @Override
  public void reindexDDMStructures(List<Long> ddmStructureIds) throws SearchException {

    if (SearchEngineUtil.isIndexReadOnly() || !isIndexerEnabled()) {
      return;
    }

    try {
      final String[] ddmStructureKeys = new String[ddmStructureIds.size()];

      for (int i = 0; i < ddmStructureIds.size(); i++) {
        long ddmStructureId = ddmStructureIds.get(i);

        DDMStructure ddmStructure = _ddmStructureLocalService.getDDMStructure(ddmStructureId);

        ddmStructureKeys[i] = ddmStructure.getStructureKey();
      }

      ActionableDynamicQuery actionableDynamicQuery =
          _journalArticleLocalService.getActionableDynamicQuery();

      actionableDynamicQuery.setAddCriteriaMethod(
          new ActionableDynamicQuery.AddCriteriaMethod() {

            @Override
            public void addCriteria(DynamicQuery dynamicQuery) {
              Property ddmStructureKey = PropertyFactoryUtil.forName("DDMStructureKey");

              dynamicQuery.add(ddmStructureKey.in(ddmStructureKeys));
            }
          });
      actionableDynamicQuery.setPerformActionMethod(
          new ActionableDynamicQuery.PerformActionMethod() {

            @Override
            public void performAction(Object object) throws PortalException {

              JournalArticle article = (JournalArticle) object;

              try {
                doReindex(article, false);
              } catch (Exception e) {
                throw new PortalException(e);
              }
            }
          });

      actionableDynamicQuery.performActions();
    } catch (Exception e) {
      throw new SearchException(e);
    }
  }
  protected ActionableDynamicQuery getRoleActionableDynamicQuery(
      final PortletDataContext portletDataContext, final boolean export) {

    ActionableDynamicQuery actionableDynamicQuery =
        RoleLocalServiceUtil.getExportActionableDynamicQuery(portletDataContext);

    actionableDynamicQuery.setAddCriteriaMethod(
        new ActionableDynamicQuery.AddCriteriaMethod() {

          @Override
          public void addCriteria(DynamicQuery dynamicQuery) {
            portletDataContext.addDateRangeCriteria(dynamicQuery, "modifiedDate");

            long classNameId = PortalUtil.getClassNameId(Team.class);

            Property classNameIdProperty = PropertyFactoryUtil.forName("classNameId");

            dynamicQuery.add(classNameIdProperty.ne(classNameId));
          }
        });

    final ActionableDynamicQuery.PerformActionMethod performActionMethod =
        actionableDynamicQuery.getPerformActionMethod();

    actionableDynamicQuery.setPerformActionMethod(
        new ActionableDynamicQuery.PerformActionMethod() {

          @Override
          public void performAction(Object object) throws PortalException {

            if (!export) {
              return;
            }

            Role role = (Role) object;

            long defaultUserId =
                UserLocalServiceUtil.getDefaultUserId(portletDataContext.getCompanyId());

            if (!portletDataContext.getBooleanParameter(NAMESPACE, "system-roles")
                && (role.getUserId() == defaultUserId)) {

              return;
            }

            performActionMethod.performAction(object);
          }
        });

    return actionableDynamicQuery;
  }
  protected void reindexFileEntries(long companyId, final long groupId, final long dataRepositoryId)
      throws PortalException {

    final ActionableDynamicQuery actionableDynamicQuery =
        DLFileEntryLocalServiceUtil.getActionableDynamicQuery();

    actionableDynamicQuery.setAddCriteriaMethod(
        new ActionableDynamicQuery.AddCriteriaMethod() {

          @Override
          public void addCriteria(DynamicQuery dynamicQuery) {
            Property property = PropertyFactoryUtil.forName("folderId");

            long folderId = DLFolderConstants.getFolderId(groupId, dataRepositoryId);

            dynamicQuery.add(property.eq(folderId));
          }
        });
    actionableDynamicQuery.setCompanyId(companyId);
    actionableDynamicQuery.setGroupId(groupId);
    actionableDynamicQuery.setPerformActionMethod(
        new ActionableDynamicQuery.PerformActionMethod() {

          @Override
          public void performAction(Object object) {
            DLFileEntry dlFileEntry = (DLFileEntry) object;

            try {
              Document document = getDocument(dlFileEntry);

              if (document != null) {
                actionableDynamicQuery.addDocument(document);
              }
            } catch (PortalException pe) {
              if (_log.isWarnEnabled()) {
                _log.warn(
                    "Unable to index document library file entry " + dlFileEntry.getFileEntryId(),
                    pe);
              }
            }
          }
        });
    actionableDynamicQuery.setSearchEngineId(getSearchEngineId());

    actionableDynamicQuery.performActions();
  }
  @Override
  public void moveSyncDLObjects(final SyncDLObject parentSyncDLObject) throws PortalException {

    final String searchTreePath =
        StringUtil.quote(String.valueOf(parentSyncDLObject.getTypePK()), StringPool.SLASH);

    ActionableDynamicQuery actionableDynamicQuery = getActionableDynamicQuery();

    actionableDynamicQuery.setAddCriteriaMethod(
        new ActionableDynamicQuery.AddCriteriaMethod() {

          @Override
          public void addCriteria(DynamicQuery dynamicQuery) {
            dynamicQuery.add(
                RestrictionsFactoryUtil.like(
                    "treePath", StringUtil.quote(searchTreePath, StringPool.PERCENT)));
          }
        });
    actionableDynamicQuery.setPerformActionMethod(
        new ActionableDynamicQuery.PerformActionMethod<SyncDLObject>() {

          @Override
          public void performAction(SyncDLObject syncDLObject) throws PortalException {

            syncDLObject.setUserId(parentSyncDLObject.getUserId());
            syncDLObject.setUserName(parentSyncDLObject.getUserName());

            String treePath = syncDLObject.getTreePath();

            String oldParentTreePath =
                treePath.substring(0, treePath.indexOf(searchTreePath) + searchTreePath.length());

            treePath =
                StringUtil.replaceFirst(
                    treePath, oldParentTreePath, parentSyncDLObject.getTreePath());

            syncDLObject.setTreePath(treePath);

            syncDLObjectPersistence.update(syncDLObject);
          }
        });

    actionableDynamicQuery.performActions();
  }
Ejemplo n.º 9
0
  protected void verifyCreateDate() throws Exception {
    ActionableDynamicQuery actionableDynamicQuery =
        JournalArticleResourceLocalServiceUtil.getActionableDynamicQuery();

    actionableDynamicQuery.setPerformActionMethod(
        new ActionableDynamicQuery.PerformActionMethod() {

          @Override
          public void performAction(Object object) {
            JournalArticleResource articleResource = (JournalArticleResource) object;

            verifyCreateDate(articleResource);
          }
        });

    actionableDynamicQuery.performActions();

    if (_log.isDebugEnabled()) {
      _log.debug("Create dates verified for articles");
    }
  }
  @Test
  public void testActionableDynamicQuery() throws Exception {
    final IntegerWrapper count = new IntegerWrapper();

    ActionableDynamicQuery actionableDynamicQuery =
        OrgLaborLocalServiceUtil.getActionableDynamicQuery();

    actionableDynamicQuery.setPerformActionMethod(
        new ActionableDynamicQuery.PerformActionMethod<OrgLabor>() {
          @Override
          public void performAction(OrgLabor orgLabor) {
            Assert.assertNotNull(orgLabor);

            count.increment();
          }
        });

    actionableDynamicQuery.performActions();

    Assert.assertEquals(count.getValue(), _persistence.countAll());
  }
Ejemplo n.º 11
0
  protected void reindexEntries(long companyId) throws PortalException {
    final ActionableDynamicQuery actionableDynamicQuery =
        BlogsEntryLocalServiceUtil.getActionableDynamicQuery();

    actionableDynamicQuery.setAddCriteriaMethod(
        new ActionableDynamicQuery.AddCriteriaMethod() {

          @Override
          public void addCriteria(DynamicQuery dynamicQuery) {
            Property displayDateProperty = PropertyFactoryUtil.forName("displayDate");

            dynamicQuery.add(displayDateProperty.lt(new Date()));

            Property statusProperty = PropertyFactoryUtil.forName("status");

            Integer[] statuses = {
              WorkflowConstants.STATUS_APPROVED, WorkflowConstants.STATUS_IN_TRASH
            };

            dynamicQuery.add(statusProperty.in(statuses));
          }
        });
    actionableDynamicQuery.setCompanyId(companyId);
    actionableDynamicQuery.setPerformActionMethod(
        new ActionableDynamicQuery.PerformActionMethod() {

          @Override
          public void performAction(Object object) throws PortalException {

            BlogsEntry entry = (BlogsEntry) object;

            Document document = getDocument(entry);

            actionableDynamicQuery.addDocument(document);
          }
        });
    actionableDynamicQuery.setSearchEngineId(getSearchEngineId());

    actionableDynamicQuery.performActions();
  }
Ejemplo n.º 12
0
  protected void verifyPermissionsAndAssets() throws Exception {
    ActionableDynamicQuery actionableDynamicQuery =
        JournalArticleLocalServiceUtil.getActionableDynamicQuery();

    actionableDynamicQuery.setPerformActionMethod(
        new ActionableDynamicQuery.PerformActionMethod() {

          @Override
          public void performAction(Object object) throws PortalException {

            JournalArticle article = (JournalArticle) object;

            verifyPermissionsAndAssets(article);
          }
        });

    actionableDynamicQuery.performActions();

    if (_log.isDebugEnabled()) {
      _log.debug("Permissions and assets verified for articles");
    }
  }
  protected void reindexCalendars(long companyId) throws PortalException {
    final ActionableDynamicQuery actionableDynamicQuery =
        CalendarLocalServiceUtil.getActionableDynamicQuery();

    actionableDynamicQuery.setCompanyId(companyId);
    actionableDynamicQuery.setPerformActionMethod(
        new ActionableDynamicQuery.PerformActionMethod() {

          @Override
          public void performAction(Object object) throws PortalException {
            Calendar calendar = (Calendar) object;

            Document document = getDocument(calendar);

            actionableDynamicQuery.addDocument(document);
          }
        });

    actionableDynamicQuery.setSearchEngineId(getSearchEngineId());

    actionableDynamicQuery.performActions();
  }
  protected void reindexArticles(long companyId) throws PortalException {
    final ActionableDynamicQuery actionableDynamicQuery =
        _journalArticleLocalService.getActionableDynamicQuery();

    actionableDynamicQuery.setCompanyId(companyId);
    actionableDynamicQuery.setPerformActionMethod(
        new ActionableDynamicQuery.PerformActionMethod() {

          @Override
          public void performAction(Object object) {
            JournalArticle article = (JournalArticle) object;

            if (!JournalServiceConfigurationValues.JOURNAL_ARTICLE_INDEX_ALL_VERSIONS) {

              JournalArticle latestIndexableArticle =
                  fetchLatestIndexableArticleVersion(article.getResourcePrimKey());

              if (latestIndexableArticle == null) {
                return;
              }

              article = latestIndexableArticle;
            }

            try {
              Document document = getDocument(article);

              actionableDynamicQuery.addDocument(document);
            } catch (PortalException pe) {
              if (_log.isWarnEnabled()) {
                _log.warn("Unable to index journal article " + article.getId(), pe);
              }
            }
          }
        });
    actionableDynamicQuery.setSearchEngineId(getSearchEngineId());

    actionableDynamicQuery.performActions();
  }
  protected ActionableDynamicQuery getPageActionableDynamicQuery(
      final PortletDataContext portletDataContext, final long nodeId, final String portletId)
      throws SystemException {

    ActionableDynamicQuery actionableDynamicQuery =
        WikiPageLocalServiceUtil.getExportActionableDynamicQuery(portletDataContext);

    final ActionableDynamicQuery.AddCriteriaMethod addCriteriaMethod =
        actionableDynamicQuery.getAddCriteriaMethod();

    actionableDynamicQuery.setAddCriteriaMethod(
        new ActionableDynamicQuery.AddCriteriaMethod() {

          @Override
          public void addCriteria(DynamicQuery dynamicQuery) {
            addCriteriaMethod.addCriteria(dynamicQuery);

            Property property = PropertyFactoryUtil.forName("nodeId");

            dynamicQuery.add(property.eq(nodeId));
          }
        });

    actionableDynamicQuery.setPerformActionMethod(
        new ActionableDynamicQuery.PerformActionMethod() {

          @Override
          public void performAction(Object object) throws PortalException {

            WikiPage page = (WikiPage) object;

            StagedModelDataHandlerUtil.exportReferenceStagedModel(
                portletDataContext, portletId, page);
          }
        });

    return actionableDynamicQuery;
  }
  protected void updateGroups(long companyId) throws PortalException {
    ActionableDynamicQuery actionableDynamicQuery =
        GroupLocalServiceUtil.getActionableDynamicQuery();

    actionableDynamicQuery.setCompanyId(companyId);
    actionableDynamicQuery.setPerformActionMethod(
        new ActionableDynamicQuery.PerformActionMethod<Group>() {

          @Override
          public void performAction(Group group) throws PortalException {
            if (!group.isRegularSite()) {
              return;
            }

            if (!SocialOfficeServiceUtil.isSocialOfficeGroup(group.getGroupId())) {

              return;
            }

            if (group.hasPrivateLayouts()) {
              updateLayoutSetPrototype(group.getGroupId(), true);
            }

            if (group.hasPublicLayouts()) {
              updateLayoutSetPrototype(group.getGroupId(), false);
            }

            UnicodeProperties typeSettingsProperties = group.getTypeSettingsProperties();

            typeSettingsProperties.remove("customJspServletContextName");

            GroupLocalServiceUtil.updateGroup(
                group.getGroupId(), typeSettingsProperties.toString());
          }
        });

    actionableDynamicQuery.performActions();
  }
Ejemplo n.º 17
0
  @Override
  protected void doVerify() throws Exception {
    ActionableDynamicQuery socialRequestActionableDynamicQuery =
        SocialRequestLocalServiceUtil.getActionableDynamicQuery();

    socialRequestActionableDynamicQuery.setAddCriteriaMethod(
        new ActionableDynamicQuery.AddCriteriaMethod() {

          @Override
          public void addCriteria(DynamicQuery dynamicQuery) {
            Property classNameIdProperty = PropertyFactoryUtil.forName("classNameId");

            long classNameId = PortalUtil.getClassNameId(Group.class);

            dynamicQuery.add(classNameIdProperty.eq(classNameId));

            Property classPKProperty = PropertyFactoryUtil.forName("classPK");

            DynamicQuery groupDynamicQuery = DynamicQueryFactoryUtil.forClass(Group.class);

            Projection projection = ProjectionFactoryUtil.property("groupId");

            groupDynamicQuery.setProjection(projection);

            dynamicQuery.add(classPKProperty.notIn(groupDynamicQuery));
          }
        });
    socialRequestActionableDynamicQuery.setPerformActionMethod(
        new ActionableDynamicQuery.PerformActionMethod<SocialRequest>() {

          @Override
          public void performAction(SocialRequest socialRequest) {
            SocialRequestLocalServiceUtil.deleteRequest(socialRequest);
          }
        });

    socialRequestActionableDynamicQuery.performActions();
  }
  @Test
  public void testActionableDynamicQuery() throws Exception {
    final IntegerWrapper count = new IntegerWrapper();

    ActionableDynamicQuery actionableDynamicQuery =
        KaleoTaskInstanceTokenLocalServiceUtil.getActionableDynamicQuery();

    actionableDynamicQuery.setPerformActionMethod(
        new ActionableDynamicQuery.PerformActionMethod() {
          @Override
          public void performAction(Object object) {
            KaleoTaskInstanceToken kaleoTaskInstanceToken = (KaleoTaskInstanceToken) object;

            Assert.assertNotNull(kaleoTaskInstanceToken);

            count.increment();
          }
        });

    actionableDynamicQuery.performActions();

    Assert.assertEquals(count.getValue(), _persistence.countAll());
  }
  @Test
  public void testActionableDynamicQuery() throws Exception {
    final IntegerWrapper count = new IntegerWrapper();

    ActionableDynamicQuery actionableDynamicQuery =
        SocialActivitySettingLocalServiceUtil.getActionableDynamicQuery();

    actionableDynamicQuery.setPerformActionMethod(
        new ActionableDynamicQuery.PerformActionMethod() {
          @Override
          public void performAction(Object object) {
            SocialActivitySetting socialActivitySetting = (SocialActivitySetting) object;

            Assert.assertNotNull(socialActivitySetting);

            count.increment();
          }
        });

    actionableDynamicQuery.performActions();

    Assert.assertEquals(count.getValue(), _persistence.countAll());
  }
  @Test
  public void testActionableDynamicQuery() throws Exception {
    final IntegerWrapper count = new IntegerWrapper();

    ActionableDynamicQuery actionableDynamicQuery =
        CalendarResourceLocalServiceUtil.getActionableDynamicQuery();

    actionableDynamicQuery.setPerformActionMethod(
        new ActionableDynamicQuery.PerformActionMethod() {
          @Override
          public void performAction(Object object) {
            CalendarResource calendarResource = (CalendarResource) object;

            Assert.assertNotNull(calendarResource);

            count.increment();
          }
        });

    actionableDynamicQuery.performActions();

    Assert.assertEquals(count.getValue(), _persistence.countAll());
  }
  @Test
  public void testActionableDynamicQuery() throws Exception {
    final IntegerWrapper count = new IntegerWrapper();

    ActionableDynamicQuery actionableDynamicQuery =
        ExportImportConfigurationLocalServiceUtil.getActionableDynamicQuery();

    actionableDynamicQuery.setPerformActionMethod(
        new ActionableDynamicQuery.PerformActionMethod() {
          @Override
          public void performAction(Object object) {
            ExportImportConfiguration exportImportConfiguration =
                (ExportImportConfiguration) object;

            Assert.assertNotNull(exportImportConfiguration);

            count.increment();
          }
        });

    actionableDynamicQuery.performActions();

    Assert.assertEquals(count.getValue(), _persistence.countAll());
  }
Ejemplo n.º 22
0
  protected void reindexUsers(long companyId) throws PortalException {
    final ActionableDynamicQuery actionableDynamicQuery =
        UserLocalServiceUtil.getActionableDynamicQuery();

    actionableDynamicQuery.setCompanyId(companyId);
    actionableDynamicQuery.setPerformActionMethod(
        new ActionableDynamicQuery.PerformActionMethod() {

          @Override
          public void performAction(Object object) throws PortalException {

            User user = (User) object;

            if (!user.isDefaultUser()) {
              Document document = getDocument(user);

              actionableDynamicQuery.addDocument(document);
            }
          }
        });
    actionableDynamicQuery.setSearchEngineId(getSearchEngineId());

    actionableDynamicQuery.performActions();
  }
  protected void reindexExportImportConfigurations(long companyId) throws PortalException {

    final ActionableDynamicQuery actionableDynamicQuery =
        ExportImportConfigurationLocalServiceUtil.getActionableDynamicQuery();

    actionableDynamicQuery.setCompanyId(companyId);
    actionableDynamicQuery.setPerformActionMethod(
        new ActionableDynamicQuery.PerformActionMethod() {

          @Override
          public void performAction(Object object) throws PortalException {

            ExportImportConfiguration exportImportConfiguration =
                (ExportImportConfiguration) object;

            Document document = getDocument(exportImportConfiguration);

            actionableDynamicQuery.addDocument(document);
          }
        });
    actionableDynamicQuery.setSearchEngineId(getSearchEngineId());

    actionableDynamicQuery.performActions();
  }
  @Override
  public void reindexDDMStructures(List<Long> ddmStructureIds) throws SearchException {

    if (IndexWriterHelperUtil.isIndexReadOnly() || !isIndexerEnabled()) {
      return;
    }

    try {
      final String[] ddmStructureKeys = new String[ddmStructureIds.size()];

      for (int i = 0; i < ddmStructureIds.size(); i++) {
        long ddmStructureId = ddmStructureIds.get(i);

        DDMStructure ddmStructure = _ddmStructureLocalService.getDDMStructure(ddmStructureId);

        ddmStructureKeys[i] = ddmStructure.getStructureKey();
      }

      final Indexer<JournalArticle> indexer =
          IndexerRegistryUtil.nullSafeGetIndexer(JournalArticle.class);

      final ActionableDynamicQuery actionableDynamicQuery =
          _journalArticleLocalService.getActionableDynamicQuery();

      actionableDynamicQuery.setAddCriteriaMethod(
          new ActionableDynamicQuery.AddCriteriaMethod() {

            @Override
            public void addCriteria(DynamicQuery dynamicQuery) {
              Property ddmStructureKey = PropertyFactoryUtil.forName("DDMStructureKey");

              dynamicQuery.add(ddmStructureKey.in(ddmStructureKeys));

              if (!isIndexAllArticleVersions()) {
                Property statusProperty = PropertyFactoryUtil.forName("status");

                Integer[] statuses = {
                  WorkflowConstants.STATUS_APPROVED, WorkflowConstants.STATUS_IN_TRASH
                };

                dynamicQuery.add(statusProperty.in(statuses));
              }
            }
          });
      actionableDynamicQuery.setPerformActionMethod(
          new ActionableDynamicQuery.PerformActionMethod<JournalArticle>() {

            @Override
            public void performAction(JournalArticle article) throws PortalException {

              try {
                indexer.reindex(indexer.getClassName(), article.getResourcePrimKey());
              } catch (Exception e) {
                throw new PortalException(e);
              }
            }
          });

      actionableDynamicQuery.performActions();
    } catch (Exception e) {
      throw new SearchException(e);
    }
  }