public FullTextSearchConfigurationType clone() { FullTextSearchConfigurationType object = new FullTextSearchConfigurationType(); PrismContainerValue value = asPrismContainerValue().clone(); object.setupContainerValue(value); return object; }
public static boolean isEnabled(FullTextSearchConfigurationType config) { return config != null && !config.getIndexed().isEmpty() && !Boolean.FALSE.equals(config.isEnabled()); }
public FullTextSearchConfigurationType enabled(Boolean value) { setEnabled(value); return this; }
public List<FullTextSearchIndexedItemsConfigurationType> createIndexedList() { PrismForJAXBUtil.createContainer(asPrismContainerValue(), F_INDEXED); return getIndexed(); }
/** * Create an instance of {@link FullTextSearchConfigurationType } * */ public FullTextSearchConfigurationType createFullTextSearchConfigurationType() { return new FullTextSearchConfigurationType(); }
@BeforeClass public void beforeClass() throws Exception { super.beforeClass(); PrismTestUtil.resetPrismContext(MidPointPrismContextFactory.FACTORY); OperationResult result = new OperationResult("add objects"); PrismObject<UserType> beforeConfig = prismContext.createObjectable(UserType.class) .name("before-config") .description(DESCRIPTION_TO_FIND) .asPrismObject(); beforeConfigOid = repositoryService.addObject(beforeConfig, null, result); FullTextSearchConfigurationType fullTextConfig = new FullTextSearchConfigurationType(); FullTextSearchIndexedItemsConfigurationType entry = new FullTextSearchIndexedItemsConfigurationType(); entry.getItem().add(new ItemPathType(ObjectType.F_NAME)); entry.getItem().add(new ItemPathType(ObjectType.F_DESCRIPTION)); fullTextConfig.getIndexed().add(entry); repositoryService.applyFullTextSearchConfiguration(fullTextConfig); LOGGER.info("Applying full text search configuration: {}", fullTextConfig); List<PrismObject<? extends Objectable>> objects = prismContext.parserFor(new File(FOLDER_BASIC, "objects.xml")).parseObjects(); objects.addAll(prismContext.parserFor(new File(FOLDER_BASIC, "objects-2.xml")).parseObjects()); for (PrismObject object : objects) { repositoryService.addObject(object, null, result); } result.recomputeStatus(); assertTrue(result.isSuccess()); }
public FullTextSearchConfigurationType indexed(FullTextSearchIndexedItemsConfigurationType value) { getIndexed().add(value); return this; }
@Override public boolean equals(Object object) { if (!(object instanceof FullTextSearchConfigurationType)) { return false; } FullTextSearchConfigurationType other = ((FullTextSearchConfigurationType) object); return asPrismContainerValue().equivalent(other.asPrismContainerValue()); }
public FullTextSearchIndexedItemsConfigurationType beginIndexed() { FullTextSearchIndexedItemsConfigurationType value = new FullTextSearchIndexedItemsConfigurationType(); indexed(value); return value; }
public FullTextSearchConfigurationType(PrismContext prismContext) { setupContainerValue(new PrismContainerValueImpl<>(this, prismContext)); }
/** * Create an instance of {@link FullTextSearchConfigurationType } * */ public FullTextSearchConfigurationType createFullTextSearchConfigurationType() { return new FullTextSearchConfigurationType(); }
@Override public void applyFullTextSearchConfiguration(FullTextSearchConfigurationType fullTextSearch) { LOGGER.info("Applying full text search configuration ({} entries)", fullTextSearch != null ? fullTextSearch.getIndexed().size() : 0); fullTextSearchConfiguration = fullTextSearch; }
@Override public String toString() { return asPrismContainerValue().toString(); }
/** * Create an instance of {@link FullTextSearchConfigurationType } * */ public FullTextSearchConfigurationType createFullTextSearchConfigurationType() { return new FullTextSearchConfigurationType(); }
@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.isEmpty(path) && !ItemPathCollectionsUtil.containsEquivalent(paths, path)) { paths.add(path); } } } } return paths; }
@XmlElement(name = "enabled") public Boolean isEnabled() { return PrismForJAXBUtil.getPropertyValue(asPrismContainerValue(), F_ENABLED, Boolean.class); }
public FullTextSearchConfigurationType beginFullTextSearch() { FullTextSearchConfigurationType value = new FullTextSearchConfigurationType(); fullTextSearch(value); return value; }
@Override public int hashCode() { return asPrismContainerValue().hashCode(); }
public void setEnabled(Boolean value) { PrismForJAXBUtil.setPropertyValue(asPrismContainerValue(), F_ENABLED, value); }
@XmlElement(name = "indexed") public List<FullTextSearchIndexedItemsConfigurationType> getIndexed() { PrismContainerValue pcv = asPrismContainerValue(); PrismContainer container = PrismForJAXBUtil.getContainer(pcv, F_INDEXED); return new FullTextSearchConfigurationType.AnonIndexed(container, pcv); }