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

sirius.biz.web.BizContextExtender Maven / Gradle / Ivy

There is a newer version: 9.6
Show newest version
/*
 * Made with all the love in the world
 * by scireum in Remshalden, Germany
 *
 * Copyright by scireum GmbH
 * http://www.scireum.de - [email protected]
 */

package sirius.biz.web;

import sirius.biz.codelists.CodeLists;
import sirius.db.jdbc.Databases;
import sirius.db.mixing.OMA;
import sirius.db.redis.Redis;
import sirius.kernel.di.std.Part;
import sirius.kernel.di.std.Register;
import sirius.web.templates.GlobalContextExtender;

import java.util.function.BiConsumer;

/**
 * Makes central frameworks available in Tagliatelle without any import or reference.
 */
@Register
public class BizContextExtender implements GlobalContextExtender {

    @Part
    private CodeLists codeLists;

    @Part
    private Databases databases;

    @Part
    private Redis redis;

    @Part
    private OMA oma;

    @Override
    public void collectTemplate(BiConsumer globalParameterCollector) {
        globalParameterCollector.accept("codeLists", codeLists);
    }

    @Override
    public void collectScripting(BiConsumer globalParameterCollector) {
        globalParameterCollector.accept("oma", oma);
        globalParameterCollector.accept("databases", databases);
        globalParameterCollector.accept("redis", redis);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy