@Override
  public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery() {
    IndexableActionableDynamicQuery indexableActionableDynamicQuery =
        new IndexableActionableDynamicQuery();

    indexableActionableDynamicQuery.setBaseLocalService(calendarLocalService);
    indexableActionableDynamicQuery.setClassLoader(getClassLoader());
    indexableActionableDynamicQuery.setModelClass(Calendar.class);

    indexableActionableDynamicQuery.setPrimaryKeyPropertyName("calendarId");

    return indexableActionableDynamicQuery;
  }
  @Override
  public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery() {
    IndexableActionableDynamicQuery indexableActionableDynamicQuery =
        new IndexableActionableDynamicQuery();

    indexableActionableDynamicQuery.setBaseLocalService(shoppingCouponLocalService);
    indexableActionableDynamicQuery.setClassLoader(getClassLoader());
    indexableActionableDynamicQuery.setModelClass(ShoppingCoupon.class);

    indexableActionableDynamicQuery.setPrimaryKeyPropertyName("couponId");

    return indexableActionableDynamicQuery;
  }
  @Override
  public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery() {
    IndexableActionableDynamicQuery indexableActionableDynamicQuery =
        new IndexableActionableDynamicQuery();

    indexableActionableDynamicQuery.setBaseLocalService(mdrRuleGroupLocalService);
    indexableActionableDynamicQuery.setClassLoader(getClassLoader());
    indexableActionableDynamicQuery.setModelClass(MDRRuleGroup.class);

    indexableActionableDynamicQuery.setPrimaryKeyPropertyName("ruleGroupId");

    return indexableActionableDynamicQuery;
  }
  @Override
  public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery() {
    IndexableActionableDynamicQuery indexableActionableDynamicQuery =
        new IndexableActionableDynamicQuery();

    indexableActionableDynamicQuery.setBaseLocalService(resourceBlockPermissionLocalService);
    indexableActionableDynamicQuery.setClassLoader(getClassLoader());
    indexableActionableDynamicQuery.setModelClass(ResourceBlockPermission.class);

    indexableActionableDynamicQuery.setPrimaryKeyPropertyName("resourceBlockPermissionId");

    return indexableActionableDynamicQuery;
  }
  @Override
  public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery() {
    IndexableActionableDynamicQuery indexableActionableDynamicQuery =
        new IndexableActionableDynamicQuery();

    indexableActionableDynamicQuery.setBaseLocalService(
        com.liferay.message.boards.kernel.service.MBDiscussionLocalServiceUtil.getService());
    indexableActionableDynamicQuery.setClassLoader(getClassLoader());
    indexableActionableDynamicQuery.setModelClass(MBDiscussion.class);

    indexableActionableDynamicQuery.setPrimaryKeyPropertyName("discussionId");

    return indexableActionableDynamicQuery;
  }
  @Override
  public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery() {
    IndexableActionableDynamicQuery indexableActionableDynamicQuery =
        new IndexableActionableDynamicQuery();

    indexableActionableDynamicQuery.setBaseLocalService(
        com.liferay.chat.service.StatusLocalServiceUtil.getService());
    indexableActionableDynamicQuery.setClassLoader(getClassLoader());
    indexableActionableDynamicQuery.setModelClass(Status.class);

    indexableActionableDynamicQuery.setPrimaryKeyPropertyName("statusId");

    return indexableActionableDynamicQuery;
  }
  @Override
  public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery() {
    IndexableActionableDynamicQuery indexableActionableDynamicQuery =
        new IndexableActionableDynamicQuery();

    indexableActionableDynamicQuery.setBaseLocalService(
        com.liferay.calendar.service.CalendarResourceLocalServiceUtil.getService());
    indexableActionableDynamicQuery.setClassLoader(getClassLoader());
    indexableActionableDynamicQuery.setModelClass(CalendarResource.class);

    indexableActionableDynamicQuery.setPrimaryKeyPropertyName("calendarResourceId");

    return indexableActionableDynamicQuery;
  }
  @Override
  public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery() {
    IndexableActionableDynamicQuery indexableActionableDynamicQuery =
        new IndexableActionableDynamicQuery();

    indexableActionableDynamicQuery.setBaseLocalService(
        com.liferay.journal.service.JournalArticleImageLocalServiceUtil.getService());
    indexableActionableDynamicQuery.setClassLoader(getClassLoader());
    indexableActionableDynamicQuery.setModelClass(JournalArticleImage.class);

    indexableActionableDynamicQuery.setPrimaryKeyPropertyName("articleImageId");

    return indexableActionableDynamicQuery;
  }
  @Override
  public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery() {
    IndexableActionableDynamicQuery indexableActionableDynamicQuery =
        new IndexableActionableDynamicQuery();

    indexableActionableDynamicQuery.setBaseLocalService(
        com.liferay.mobile.device.rules.service.MDRRuleLocalServiceUtil.getService());
    indexableActionableDynamicQuery.setClassLoader(getClassLoader());
    indexableActionableDynamicQuery.setModelClass(MDRRule.class);

    indexableActionableDynamicQuery.setPrimaryKeyPropertyName("ruleId");

    return indexableActionableDynamicQuery;
  }
  @Override
  public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery() {
    IndexableActionableDynamicQuery indexableActionableDynamicQuery =
        new IndexableActionableDynamicQuery();

    indexableActionableDynamicQuery.setBaseLocalService(
        com.liferay.document.library.kernel.service.DLFileEntryTypeLocalServiceUtil.getService());
    indexableActionableDynamicQuery.setClassLoader(getClassLoader());
    indexableActionableDynamicQuery.setModelClass(DLFileEntryType.class);

    indexableActionableDynamicQuery.setPrimaryKeyPropertyName("fileEntryTypeId");

    return indexableActionableDynamicQuery;
  }
  @Override
  public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery() {
    IndexableActionableDynamicQuery indexableActionableDynamicQuery =
        new IndexableActionableDynamicQuery();

    indexableActionableDynamicQuery.setBaseLocalService(
        com.liferay.sampleservicebuilder.service.FooLocalServiceUtil.getService());
    indexableActionableDynamicQuery.setClassLoader(getClassLoader());
    indexableActionableDynamicQuery.setModelClass(Foo.class);

    indexableActionableDynamicQuery.setPrimaryKeyPropertyName("fooId");

    return indexableActionableDynamicQuery;
  }
  @Override
  public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery() {
    IndexableActionableDynamicQuery indexableActionableDynamicQuery =
        new IndexableActionableDynamicQuery();

    indexableActionableDynamicQuery.setBaseLocalService(
        com.liferay.portal.workflow.kaleo.service.KaleoTaskAssignmentLocalServiceUtil.getService());
    indexableActionableDynamicQuery.setClassLoader(getClassLoader());
    indexableActionableDynamicQuery.setModelClass(KaleoTaskAssignment.class);

    indexableActionableDynamicQuery.setPrimaryKeyPropertyName("kaleoTaskAssignmentId");

    return indexableActionableDynamicQuery;
  }
  @Override
  public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery() {
    IndexableActionableDynamicQuery indexableActionableDynamicQuery =
        new IndexableActionableDynamicQuery();

    indexableActionableDynamicQuery.setBaseLocalService(
        com.liferay.portal.kernel.service.UserTrackerPathLocalServiceUtil.getService());
    indexableActionableDynamicQuery.setClassLoader(getClassLoader());
    indexableActionableDynamicQuery.setModelClass(UserTrackerPath.class);

    indexableActionableDynamicQuery.setPrimaryKeyPropertyName("userTrackerPathId");

    return indexableActionableDynamicQuery;
  }
  @Override
  public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery() {
    IndexableActionableDynamicQuery indexableActionableDynamicQuery =
        new IndexableActionableDynamicQuery();

    indexableActionableDynamicQuery.setBaseLocalService(
        com.liferay.socialcoding.service.JIRAChangeItemLocalServiceUtil.getService());
    indexableActionableDynamicQuery.setClassLoader(getClassLoader());
    indexableActionableDynamicQuery.setModelClass(JIRAChangeItem.class);

    indexableActionableDynamicQuery.setPrimaryKeyPropertyName("jiraChangeItemId");

    return indexableActionableDynamicQuery;
  }
  @Override
  public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery() {
    IndexableActionableDynamicQuery indexableActionableDynamicQuery =
        new IndexableActionableDynamicQuery();

    indexableActionableDynamicQuery.setBaseLocalService(
        com.liferay.portlet.social.service.SocialActivityAchievementLocalServiceUtil.getService());
    indexableActionableDynamicQuery.setClassLoader(getClassLoader());
    indexableActionableDynamicQuery.setModelClass(SocialActivityAchievement.class);

    indexableActionableDynamicQuery.setPrimaryKeyPropertyName("activityAchievementId");

    return indexableActionableDynamicQuery;
  }
  @Override
  public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery() {
    IndexableActionableDynamicQuery indexableActionableDynamicQuery =
        new IndexableActionableDynamicQuery();

    indexableActionableDynamicQuery.setBaseLocalService(
        com.liferay.knowledgebase.service.KBTemplateLocalServiceUtil.getService());
    indexableActionableDynamicQuery.setClassLoader(getClassLoader());
    indexableActionableDynamicQuery.setModelClass(KBTemplate.class);

    indexableActionableDynamicQuery.setPrimaryKeyPropertyName("kbTemplateId");

    return indexableActionableDynamicQuery;
  }
  @Override
  public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery() {
    IndexableActionableDynamicQuery indexableActionableDynamicQuery =
        new IndexableActionableDynamicQuery();

    indexableActionableDynamicQuery.setBaseLocalService(
        com.liferay.dynamic.data.mapping.service.DDMContentLocalServiceUtil.getService());
    indexableActionableDynamicQuery.setClassLoader(getClassLoader());
    indexableActionableDynamicQuery.setModelClass(DDMContent.class);

    indexableActionableDynamicQuery.setPrimaryKeyPropertyName("contentId");

    return indexableActionableDynamicQuery;
  }
  @Override
  public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery() {
    IndexableActionableDynamicQuery indexableActionableDynamicQuery =
        new IndexableActionableDynamicQuery();

    indexableActionableDynamicQuery.setBaseLocalService(
        com.liferay.shopping.service.ShoppingOrderLocalServiceUtil.getService());
    indexableActionableDynamicQuery.setClassLoader(getClassLoader());
    indexableActionableDynamicQuery.setModelClass(ShoppingOrder.class);

    indexableActionableDynamicQuery.setPrimaryKeyPropertyName("orderId");

    return indexableActionableDynamicQuery;
  }
  @Override
  public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery() {
    IndexableActionableDynamicQuery indexableActionableDynamicQuery =
        new IndexableActionableDynamicQuery();

    indexableActionableDynamicQuery.setBaseLocalService(
        com.liferay.microblogs.service.MicroblogsEntryLocalServiceUtil.getService());
    indexableActionableDynamicQuery.setClassLoader(getClassLoader());
    indexableActionableDynamicQuery.setModelClass(MicroblogsEntry.class);

    indexableActionableDynamicQuery.setPrimaryKeyPropertyName("microblogsEntryId");

    return indexableActionableDynamicQuery;
  }
  @Override
  public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery() {
    IndexableActionableDynamicQuery indexableActionableDynamicQuery =
        new IndexableActionableDynamicQuery();

    indexableActionableDynamicQuery.setBaseLocalService(
        com.liferay.so.service.MemberRequestLocalServiceUtil.getService());
    indexableActionableDynamicQuery.setClassLoader(getClassLoader());
    indexableActionableDynamicQuery.setModelClass(MemberRequest.class);

    indexableActionableDynamicQuery.setPrimaryKeyPropertyName("memberRequestId");

    return indexableActionableDynamicQuery;
  }
  @Override
  public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery() {
    IndexableActionableDynamicQuery indexableActionableDynamicQuery =
        new IndexableActionableDynamicQuery();

    indexableActionableDynamicQuery.setBaseLocalService(
        com.liferay.portal.service.RecentLayoutRevisionLocalServiceUtil.getService());
    indexableActionableDynamicQuery.setClassLoader(getClassLoader());
    indexableActionableDynamicQuery.setModelClass(RecentLayoutRevision.class);

    indexableActionableDynamicQuery.setPrimaryKeyPropertyName("recentLayoutRevisionId");

    return indexableActionableDynamicQuery;
  }
  @Override
  public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery() {
    IndexableActionableDynamicQuery indexableActionableDynamicQuery =
        new IndexableActionableDynamicQuery();

    indexableActionableDynamicQuery.setBaseLocalService(
        com.liferay.expando.kernel.service.ExpandoTableLocalServiceUtil.getService());
    indexableActionableDynamicQuery.setClassLoader(getClassLoader());
    indexableActionableDynamicQuery.setModelClass(ExpandoTable.class);

    indexableActionableDynamicQuery.setPrimaryKeyPropertyName("tableId");

    return indexableActionableDynamicQuery;
  }
  @Override
  public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery() {
    IndexableActionableDynamicQuery indexableActionableDynamicQuery =
        new IndexableActionableDynamicQuery();

    indexableActionableDynamicQuery.setBaseLocalService(
        com.liferay.portal.service.WebsiteLocalServiceUtil.getService());
    indexableActionableDynamicQuery.setClassLoader(getClassLoader());
    indexableActionableDynamicQuery.setModelClass(Website.class);

    indexableActionableDynamicQuery.setPrimaryKeyPropertyName("websiteId");

    return indexableActionableDynamicQuery;
  }
  protected void reindexArticles(long companyId) throws PortalException {
    final IndexableActionableDynamicQuery indexableActionableDynamicQuery;

    if (isIndexAllArticleVersions()) {
      indexableActionableDynamicQuery =
          _journalArticleLocalService.getIndexableActionableDynamicQuery();

      indexableActionableDynamicQuery.setPerformActionMethod(
          new ActionableDynamicQuery.PerformActionMethod<JournalArticle>() {

            @Override
            public void performAction(JournalArticle article) {
              try {
                Document document = getDocument(article);

                indexableActionableDynamicQuery.addDocuments(document);
              } catch (PortalException pe) {
                if (_log.isWarnEnabled()) {
                  _log.warn("Unable to index journal article " + article.getId(), pe);
                }
              }
            }
          });
    } else {
      indexableActionableDynamicQuery =
          _journalArticleResourceLocalService.getIndexableActionableDynamicQuery();

      indexableActionableDynamicQuery.setPerformActionMethod(
          new ActionableDynamicQuery.PerformActionMethod<JournalArticleResource>() {

            @Override
            public void performAction(JournalArticleResource articleResource) {

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

              if (latestIndexableArticle == null) {
                return;
              }

              try {
                Document document = getDocument(latestIndexableArticle);

                indexableActionableDynamicQuery.addDocuments(document);
              } catch (PortalException pe) {
                if (_log.isWarnEnabled()) {
                  _log.warn(
                      "Unable to index journal article " + latestIndexableArticle.getId(), pe);
                }
              }
            }
          });
    }

    indexableActionableDynamicQuery.setCompanyId(companyId);
    indexableActionableDynamicQuery.setSearchEngineId(getSearchEngineId());

    indexableActionableDynamicQuery.performActions();
  }