use of com.enonic.xp.repository.IndexSettings in project xp by enonic.
the class RepositoryNodeTranslator method toNodeData.
private static void toNodeData(final IndexDefinitions indexDefinitions, final PropertyTree data) {
if (indexDefinitions != null) {
final PropertySet indexConfigsPropertySet = data.addSet(INDEX_CONFIG_KEY);
for (IndexType indexType : IndexType.values()) {
final IndexDefinition indexDefinition = indexDefinitions.get(indexType);
if (indexDefinition != null) {
final PropertySet indexConfigPropertySet = indexConfigsPropertySet.addSet(indexType.getName());
final IndexMapping indexMapping = indexDefinition.getMapping();
if (indexMapping != null) {
final PropertySet indexMappingPropertySet = JsonToPropertyTreeTranslator.translate(indexMapping.getNode()).getRoot();
indexConfigPropertySet.setSet(MAPPING_KEY, indexMappingPropertySet);
}
final IndexSettings indexSettings = indexDefinition.getSettings();
if (indexSettings != null) {
final PropertySet indexSettingsPropertySet = JsonToPropertyTreeTranslator.translate(indexSettings.getNode()).getRoot();
indexConfigPropertySet.setSet(SETTINGS_KEY, indexSettingsPropertySet);
}
}
}
}
}
Aggregations