Search in sources :

Example 6 with FreemarkerCatalog

use of com.developmentontheedge.be5.metadata.model.FreemarkerCatalog 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 7 with FreemarkerCatalog

use of com.developmentontheedge.be5.metadata.model.FreemarkerCatalog 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 8 with FreemarkerCatalog

use of com.developmentontheedge.be5.metadata.model.FreemarkerCatalog 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

FreemarkerCatalog (com.developmentontheedge.be5.metadata.model.FreemarkerCatalog)6 FreemarkerScript (com.developmentontheedge.be5.metadata.model.FreemarkerScript)6 Module (com.developmentontheedge.be5.metadata.model.Module)3 ReadException (com.developmentontheedge.be5.metadata.exception.ReadException)2 IOException (java.io.IOException)2 Path (java.nio.file.Path)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 DataElementPath (com.developmentontheedge.be5.metadata.model.base.DataElementPath)1 BeSqlExecutor (com.developmentontheedge.be5.metadata.sql.BeSqlExecutor)1 SqlExecutor (com.developmentontheedge.dbms.SqlExecutor)1 SoftCacheStorage (freemarker.cache.SoftCacheStorage)1 Configuration (freemarker.template.Configuration)1 TemplateModelException (freemarker.template.TemplateModelException)1 File (java.io.File)1 PrintStream (java.io.PrintStream)1 UnsupportedEncodingException (java.io.UnsupportedEncodingException)1 InvocationTargetException (java.lang.reflect.InvocationTargetException)1 ArrayList (java.util.ArrayList)1