public boolean isEnabled()

in core/src/main/java/org/apache/sling/cms/core/insights/impl/providers/ReadabilityInsightProvider.java [174:193]


    public boolean isEnabled(InsightRequest request) {
        Site site = null;
        SiteManager smgr = request.getResource().adaptTo(SiteManager.class);
        if (smgr != null) {
            site = smgr.getSite();
        }
        if (request.getType() != InsightRequest.TYPE.PAGE) {
            log.debug("Insight is not of page type");
            return false;
        }
        if (site == null || site.getLocale() == null) {
            log.debug("Did not find site or locale");
            return false;
        }
        if (factory.getReadabilityService(site.getLocale()) == null) {
            log.debug("Unable to get readability service for locale {}", site.getLocale());
            return false;
        }
        return true;
    }