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

org.webpieces.webserver.impl.WebServerTemplateProxy Maven / Gradle / Ivy

package org.webpieces.webserver.impl;

import java.io.StringWriter;
import java.util.Map;
import java.util.Set;

import javax.inject.Inject;
import javax.inject.Singleton;

import org.webpieces.ctx.api.extension.HtmlTagCreator;
import org.webpieces.router.api.TemplateApi;
import org.webpieces.templating.api.TemplateService;
import org.webpieces.templating.api.TemplateUtil;

@Singleton
public class WebServerTemplateProxy implements TemplateApi {

    private TemplateService templateService;

    @Inject
    public WebServerTemplateProxy(TemplateService templateService) {
        this.templateService = templateService;
    }

    @Override
    public void loadAndRunTemplate(String templatePath, StringWriter out, Map pageArgs) {
        templateService.loadAndRunTemplate(templatePath, out, pageArgs);
    }

    @Override
    public String convertTemplateClassToPath(String fullClass) {
        //TODO(dhiller): Fix to not be static, we can't bug fix static code live..
        return TemplateUtil.convertTemplateClassToPath(fullClass);
    }

	@Override
	public void installCustomTags(Set tagCreators) {
		templateService.install(tagCreators);
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy