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

templates.index.ftl Maven / Gradle / Ivy

There is a newer version: 3.0-alpha.47
Show newest version
package ${pkgName};

import io.mateu.core.domain.UIRegistry;
import io.mateu.util.Helper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import jakarta.annotation.PostConstruct;


@RestController
@RequestMapping("${path}")
@Slf4j
public class ${simpleClassName}Controller {

    @GetMapping(value = "", produces = MediaType.TEXT_HTML_VALUE)
    public String getIndex() {
        String html = Helper.leerFichero(this.getClass(), "/index/index.html");
<#list externalScripts as x>
        html = html.replaceAll("AQUIELTITULODELAPAGINA", "AQUIELTITULODELAPAGINA");

        html = html.replaceAll("AQUIELTITULODELAPAGINA", "${caption}");
        html = html.replaceAll("http:\\/\\/localhost:8081\\/mateu\\/v1", "/mateu/v1");
        html = html.replaceAll("com\\.example\\.demoremote\\.ui\\.demoApp\\.DemoApp", "${className}");
<#if keycloak??>
        String keycloakStuff = """


""";
        html = html.replaceAll("", keycloakStuff);
        html = html.replaceAll("", "");
<#else >
    //html = html.replaceAll("", "");
    html = html.replaceAll("", "");
    html = html.replaceAll("", "");

        return html;
    }

    @Autowired
    UIRegistry uiRegistry;

    @PostConstruct
    public void init() {
        try {
            uiRegistry.add(Class.forName("${className}"));
        } catch (ClassNotFoundException e) {
            log.error("Unable to find class ${className} for UI registration");
        }
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy