Search in sources :

Example 11 with FreemarkerScript

use of com.developmentontheedge.be5.metadata.model.FreemarkerScript in project be5 by DevelopmentOnTheEdge.

the class ProjectFileSystem method isFromFreemarkerScripts.

private boolean isFromFreemarkerScripts(final FreemarkerScript freemarkerScript) {
    final FreemarkerCatalog scripts = freemarkerScript.getModule().getFreemarkerScripts();
    final boolean isFromFreemarkerScripts = scripts != null && scripts.getCompletePath().isAncestorOf(freemarkerScript.getCompletePath());
    return isFromFreemarkerScripts;
}
Also used : FreemarkerCatalog(com.developmentontheedge.be5.metadata.model.FreemarkerCatalog)

Example 12 with FreemarkerScript

use of com.developmentontheedge.be5.metadata.model.FreemarkerScript in project be5 by DevelopmentOnTheEdge.

the class ProjectFileSystem method isFromMacroCollection.

private boolean isFromMacroCollection(final FreemarkerScript freemarkerScript) {
    final FreemarkerCatalog macros = freemarkerScript.getModule().getMacroCollection();
    final boolean isFromMacroCollection = macros != null && macros.getCompletePath().isAncestorOf(freemarkerScript.getCompletePath());
    return isFromMacroCollection;
}
Also used : FreemarkerCatalog(com.developmentontheedge.be5.metadata.model.FreemarkerCatalog)

Example 13 with FreemarkerScript

use of com.developmentontheedge.be5.metadata.model.FreemarkerScript in project be5 by DevelopmentOnTheEdge.

the class ProjectGenerator method addFtlScripts.

private void addFtlScripts(final Project project) {
    final FreemarkerCatalog scripts = project.getApplication().getFreemarkerScripts();
    final FreemarkerScript securityScript = new FreemarkerScript("security", scripts);
    securityScript.setSource("INSERT INTO users (user_name, user_pass) VALUES( '$LOGIN', '$PASSWORD' );\nINSERT INTO user_roles VALUES( '$LOGIN', '$ROLE' );\n".replace("$LOGIN", parameters.getTestUserLogin()).replace("$PASSWORD", parameters.getTestUserPassword()).replace("$ROLE", parameters.getTestUserRole()));
    DataElementUtils.saveQuiet(securityScript);
    final FreemarkerScript dictionariesScript = new FreemarkerScript("dictionaries", scripts);
    final FreemarkerScript attributesScript = new FreemarkerScript("attributes", scripts);
    dictionariesScript.setSource("");
    attributesScript.setSource("");
    DataElementUtils.saveQuiet(dictionariesScript);
    DataElementUtils.saveQuiet(attributesScript);
}
Also used : FreemarkerCatalog(com.developmentontheedge.be5.metadata.model.FreemarkerCatalog) FreemarkerScript(com.developmentontheedge.be5.metadata.model.FreemarkerScript)

Aggregations

FreemarkerScript (com.developmentontheedge.be5.metadata.model.FreemarkerScript)9 FreemarkerCatalog (com.developmentontheedge.be5.metadata.model.FreemarkerCatalog)6 Module (com.developmentontheedge.be5.metadata.model.Module)3 Project (com.developmentontheedge.be5.metadata.model.Project)3 DataElementPath (com.developmentontheedge.be5.metadata.model.base.DataElementPath)3 ReadException (com.developmentontheedge.be5.metadata.exception.ReadException)2 BeSqlExecutor (com.developmentontheedge.be5.metadata.sql.BeSqlExecutor)2 SqlExecutor (com.developmentontheedge.dbms.SqlExecutor)2 IOException (java.io.IOException)2 PrintStream (java.io.PrintStream)2 Path (java.nio.file.Path)2 MojoFailureException (org.apache.maven.plugin.MojoFailureException)2 Test (org.junit.Test)2 FreemarkerSqlException (com.developmentontheedge.be5.metadata.exception.FreemarkerSqlException)1 ProjectElementException (com.developmentontheedge.be5.metadata.exception.ProjectElementException)1 WriteException (com.developmentontheedge.be5.metadata.exception.WriteException)1 FreemarkerSqlHandler (com.developmentontheedge.be5.metadata.freemarker.FreemarkerSqlHandler)1 BeConnectionProfile (com.developmentontheedge.be5.metadata.model.BeConnectionProfile)1 ParseResult (com.developmentontheedge.be5.metadata.model.ParseResult)1 NullLogger (com.developmentontheedge.be5.metadata.util.NullLogger)1