Search in sources :

Example 1 with PrunedTag

use of org.codelibs.fess.util.PrunedTag in project fess by codelibs.

the class FessProp method getCrawlerDocumentHtmlPrunedTagsAsArray.

public default default PrunedTag[] getCrawlerDocumentHtmlPrunedTagsAsArray() {
    PrunedTag[] tags = (PrunedTag[]) propMap.get("crawlerDocumentHtmlPrunedTags");
    if (tags == null) {
        tags = split(getCrawlerDocumentHtmlPrunedTags(), ",").get(stream -> stream.filter(StringUtil::isNotBlank).map(v -> {
            final String[] cssValues = v.split("\\.", 2);
            final String css;
            if (cssValues.length == 2) {
                css = cssValues[1];
            } else {
                css = null;
            }
            final String[] idValues = cssValues[0].split("#", 2);
            final String id;
            if (idValues.length == 2) {
                id = idValues[1];
            } else {
                id = null;
            }
            return new PrunedTag(idValues[0], id, css);
        }).toArray(n -> new PrunedTag[n]));
        propMap.put("crawlerDocumentHtmlPrunedTags", tags);
    }
    return tags;
}
Also used : ClassNotFoundRuntimeException(org.codelibs.core.exception.ClassNotFoundRuntimeException) Constants(org.codelibs.fess.Constants) SortBuilders(org.elasticsearch.search.sort.SortBuilders) Enumeration(java.util.Enumeration) Date(java.util.Date) JobConcurrentExec(org.lastaflute.job.subsidiary.JobConcurrentExec) OptionalThing(org.dbflute.optional.OptionalThing) Pair(org.codelibs.core.misc.Pair) PermissionHelper(org.codelibs.fess.helper.PermissionHelper) IntegerTypeValidator(org.lastaflute.web.validation.theme.typed.IntegerTypeValidator) LaRequestUtil(org.lastaflute.web.util.LaRequestUtil) LongTypeValidator(org.lastaflute.web.validation.theme.typed.LongTypeValidator) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) BasicAttribute(javax.naming.directory.BasicAttribute) FessUserBean(org.codelibs.fess.mylasta.action.FessUserBean) Attribute(javax.naming.directory.Attribute) StreamUtil.split(org.codelibs.core.stream.StreamUtil.split) Locale(java.util.Locale) Map(java.util.Map) PrunedTag(org.codelibs.fess.util.PrunedTag) HtmlNext(org.lastaflute.web.response.next.HtmlNext) SortBuilder(org.elasticsearch.search.sort.SortBuilder) HttpSession(javax.servlet.http.HttpSession) LaJob(org.lastaflute.job.LaJob) StreamUtil.stream(org.codelibs.core.stream.StreamUtil.stream) FloatTypeValidator(org.lastaflute.web.validation.theme.typed.FloatTypeValidator) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) StringUtil(org.codelibs.core.lang.StringUtil) Set(java.util.Set) RequiredValidator(org.lastaflute.web.validation.RequiredValidator) Tuple3(org.codelibs.core.misc.Tuple3) Collectors(java.util.stream.Collectors) List(java.util.List) ComponentUtil(org.codelibs.fess.util.ComponentUtil) SearchRequestBuilder(org.elasticsearch.action.search.SearchRequestBuilder) SortOrder(org.elasticsearch.search.sort.SortOrder) Pattern(java.util.regex.Pattern) Collections(java.util.Collections) DoubleTypeValidator(org.lastaflute.web.validation.theme.typed.DoubleTypeValidator) FessFunctions(org.codelibs.fess.taglib.FessFunctions) PrunedTag(org.codelibs.fess.util.PrunedTag) StringUtil(org.codelibs.core.lang.StringUtil)

Aggregations

ArrayList (java.util.ArrayList)1 Collections (java.util.Collections)1 Date (java.util.Date)1 Enumeration (java.util.Enumeration)1 HashSet (java.util.HashSet)1 List (java.util.List)1 Locale (java.util.Locale)1 Map (java.util.Map)1 Set (java.util.Set)1 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)1 Pattern (java.util.regex.Pattern)1 Collectors (java.util.stream.Collectors)1 Attribute (javax.naming.directory.Attribute)1 BasicAttribute (javax.naming.directory.BasicAttribute)1 HttpSession (javax.servlet.http.HttpSession)1 ClassNotFoundRuntimeException (org.codelibs.core.exception.ClassNotFoundRuntimeException)1 StringUtil (org.codelibs.core.lang.StringUtil)1 Pair (org.codelibs.core.misc.Pair)1 Tuple3 (org.codelibs.core.misc.Tuple3)1 StreamUtil.split (org.codelibs.core.stream.StreamUtil.split)1