All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.contentgrid.spring.boot.autoconfigure.automation.ContentGridAutomationAutoConfiguration Maven / Gradle / Ivy

There is a newer version: 0.16.0
Show newest version
package com.contentgrid.spring.boot.autoconfigure.automation;

import com.contentgrid.automations.rest.AutomationAnnotationRepresentationModelAssembler;
import com.contentgrid.automations.rest.AutomationRepresentationModelAssembler;
import com.contentgrid.automations.rest.AutomationsRestController;
import com.contentgrid.thunx.predicates.model.ThunkExpression;
import com.contentgrid.thunx.spring.data.context.AbacContextSupplier;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Import;

@AutoConfiguration
@ConditionalOnClass({ AutomationsRestController.class, AbacContextSupplier.class, ThunkExpression.class })
@Import({
        AutomationRepresentationModelAssembler.class,
        AutomationAnnotationRepresentationModelAssembler.class
})
public class ContentGridAutomationAutoConfiguration {

    @Autowired
    private ApplicationContext applicationContext;

    @Bean
    AutomationsRestController automationsRestController(AutomationRepresentationModelAssembler assembler,
            AbacContextSupplier abacContextSupplier) {
        return new AutomationsRestController(applicationContext.getResource("classpath:automation/automations.json"),
                assembler, abacContextSupplier);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy