Package grails.plugin.searchable.internal.compass.mapping

Examples of grails.plugin.searchable.internal.compass.mapping.CompositeSearchableGrailsDomainClassCompassClassMapper


     */
    public void configure(CompassConfiguration compassConfiguration, Map configurationContext) {
        Assert.notNull(grailsApplication, "grailsApplication cannot be null");
        Assert.notNull(classMappingConfigurators, "classMappingConfigurators cannot be null");

        CompositeSearchableGrailsDomainClassCompassClassMapper classMapper = null;

        // determine which classes are mapped by which strategy
        Map classesByStrategy = new HashMap();
        Collection grailsDomainClasses = SearchableUtils.getGrailsDomainClasses(grailsApplication);
        Set mappableClasses = new HashSet();
        Set notMapped = new HashSet(grailsDomainClasses);
        for (int i = 0; i < classMappingConfigurators.length; i++) {
            SearchableGrailsDomainClassMappingConfigurator configurator = classMappingConfigurators[i];

            // Total hack. This seems to be the easiest way to initialise this
            // particular property mapping configurator.
            if (configurator instanceof SearchableClassPropertySearchableGrailsDomainClassMappingConfigurator) {
                classMapper = ((SearchableClassPropertySearchableGrailsDomainClassMappingConfigurator) configurator).
                        getMappingDescriptionProviderManager();
                classMapper.init(
                        compassConfiguration,
                        (Map) configurationContext.get("customConverters"),
                        defaultExcludes,
                        defaultFormats);
            }
View Full Code Here


        mappingXmlMappingStrategy.setResourceLoader(resourceLoader);
        return mappingXmlMappingStrategy;
    }

    public static SearchableClassPropertySearchableGrailsDomainClassMappingConfigurator getSearchableClassPropertyMappingConfigurator(Map defaultFormats, List defaultExcludedProperties, SearchableCompassClassMappingXmlBuilder compassClassMappingXmlBuilder) {
        CompositeSearchableGrailsDomainClassCompassClassMapper classMapper = SearchableGrailsDomainClassCompassClassMapperFactory.getDefaultSearchableGrailsDomainClassCompassClassMapper(defaultExcludedProperties, defaultFormats);

        SearchableClassPropertySearchableGrailsDomainClassMappingConfigurator searchableClassPropertyMappingStrategy = new SearchableClassPropertySearchableGrailsDomainClassMappingConfigurator();
        searchableClassPropertyMappingStrategy.setCompassClassMappingXmlBuilder(compassClassMappingXmlBuilder);
        searchableClassPropertyMappingStrategy.setMappingDescriptionProviderManager(classMapper);
        return searchableClassPropertyMappingStrategy;
View Full Code Here

TOP

Related Classes of grails.plugin.searchable.internal.compass.mapping.CompositeSearchableGrailsDomainClassCompassClassMapper

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.