Search in sources :

Example 1 with FullTextSearchIndexedItemsConfigurationType

use of com.evolveum.midpoint.xml.ns._public.common.common_3.FullTextSearchIndexedItemsConfigurationType in project midpoint by Evolveum.

the class FullTextSearchConfigurationUtil method getFullTextSearchItemPaths.

@NotNull
public static Set<ItemPath> getFullTextSearchItemPaths(@NotNull FullTextSearchConfigurationType config, Class<? extends ObjectType> clazz) {
    List<QName> types = ObjectTypes.getObjectType(clazz).thisAndSupertypes().stream().map(ot -> ot.getTypeQName()).collect(Collectors.toList());
    Set<ItemPath> paths = new HashSet<>();
    for (FullTextSearchIndexedItemsConfigurationType indexed : config.getIndexed()) {
        if (isApplicable(indexed, types)) {
            for (ItemPathType itemPathType : indexed.getItem()) {
                ItemPath path = itemPathType.getItemPath();
                if (!ItemPath.isNullOrEmpty(path) && !ItemPath.containsEquivalent(paths, path)) {
                    paths.add(path);
                }
            }
        }
    }
    return paths;
}
Also used : ObjectType(com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType) FullTextSearchIndexedItemsConfigurationType(com.evolveum.midpoint.xml.ns._public.common.common_3.FullTextSearchIndexedItemsConfigurationType) Set(java.util.Set) FullTextSearchConfigurationType(com.evolveum.midpoint.xml.ns._public.common.common_3.FullTextSearchConfigurationType) Collectors(java.util.stream.Collectors) ItemPath(com.evolveum.midpoint.prism.path.ItemPath) HashSet(java.util.HashSet) QNameUtil(com.evolveum.midpoint.util.QNameUtil) List(java.util.List) ObjectTypes(com.evolveum.midpoint.schema.constants.ObjectTypes) QName(javax.xml.namespace.QName) NotNull(org.jetbrains.annotations.NotNull) ItemPathType(com.evolveum.prism.xml.ns._public.types_3.ItemPathType) FullTextSearchIndexedItemsConfigurationType(com.evolveum.midpoint.xml.ns._public.common.common_3.FullTextSearchIndexedItemsConfigurationType) QName(javax.xml.namespace.QName) ItemPathType(com.evolveum.prism.xml.ns._public.types_3.ItemPathType) HashSet(java.util.HashSet) ItemPath(com.evolveum.midpoint.prism.path.ItemPath) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

ItemPath (com.evolveum.midpoint.prism.path.ItemPath)1 ObjectTypes (com.evolveum.midpoint.schema.constants.ObjectTypes)1 QNameUtil (com.evolveum.midpoint.util.QNameUtil)1 FullTextSearchConfigurationType (com.evolveum.midpoint.xml.ns._public.common.common_3.FullTextSearchConfigurationType)1 FullTextSearchIndexedItemsConfigurationType (com.evolveum.midpoint.xml.ns._public.common.common_3.FullTextSearchIndexedItemsConfigurationType)1 ObjectType (com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType)1 ItemPathType (com.evolveum.prism.xml.ns._public.types_3.ItemPathType)1 HashSet (java.util.HashSet)1 List (java.util.List)1 Set (java.util.Set)1 Collectors (java.util.stream.Collectors)1 QName (javax.xml.namespace.QName)1 NotNull (org.jetbrains.annotations.NotNull)1