use of com.developmentontheedge.be5.metadata.model.Module in project be5 by DevelopmentOnTheEdge.
the class ProjectGenerator method addModules.
private void addModules(final Project project) {
final String[] modules;
{
final List<String> ms = Lists.newArrayList(parameters.getModules());
ms.remove(SYSTEM_MODULE);
ms.add(0, SYSTEM_MODULE);
modules = Iterables.toArray(ms, String.class);
}
for (final String module : modules) {
final Module newModule = new Module(module, project.getModules());
DataElementUtils.saveQuiet(newModule);
}
}
use of com.developmentontheedge.be5.metadata.model.Module in project be5 by DevelopmentOnTheEdge.
the class ProjectGenerator method addIncludes.
public static void addIncludes(final Project project) {
final StringBuilder sb = new StringBuilder();
for (final Module module : project.getModules()) {
final FreemarkerCatalog collection = module.getMacroCollection();
if (collection == null)
continue;
final FreemarkerScript script = collection.optScript(FreemarkerCatalog.MAIN_MACRO_LIBRARY);
if (script == null)
continue;
sb.append("<#include \"../../Modules/" + module.getName() + "/Macros/common\"/>\n");
}
final String includes = sb.toString();
if (!includes.isEmpty()) {
final FreemarkerScript script = new FreemarkerScript(FreemarkerCatalog.MAIN_MACRO_LIBRARY, project.getMacroCollection());
script.setSource(includes);
DataElementUtils.saveQuiet(script);
}
}
use of com.developmentontheedge.be5.metadata.model.Module in project be5 by DevelopmentOnTheEdge.
the class Entity method getErrors.
@Override
public List<ProjectElementException> getErrors() {
final List<ProjectElementException> errors = new ArrayList<>();
if (getName().length() > Constants.MAX_ID_LENGTH) {
errors.add(new ProjectElementException(getCompletePath(), "name", "Entity name is too long."));
}
for (final Module module : getProject().getModulesAndApplication()) {
final Module thisModule = getModule();
if (module == thisModule)
break;
final Entity duplicate = module.getEntity(getName());
if (duplicate != null) {
errors.add(new ProjectElementException(getCompletePath(), "name", "Entity with name '" + getName() + "' already exists."));
break;
}
}
final TableDef tableDef = findTableDefinition();
if (tableDef != null) {
errors.addAll(tableDef.getErrors());
}
for (final Query query : getQueries()) {
errors.addAll(query.getErrors());
}
for (final Operation operation : getOperations()) {
errors.addAll(operation.getErrors());
}
return errors;
}
use of com.developmentontheedge.be5.metadata.model.Module in project be5 by DevelopmentOnTheEdge.
the class Serialization method reloadMassChanges.
public static MassChanges reloadMassChanges(final Path file, final Module application) throws ReadException {
checkProject(application.getProject());
turnOffAutomaticSerialization();
try {
return new YamlDeserializer(new LoadContext()).reloadMassChanges(file, application);
} finally {
turnOnAutomaticSerialization();
}
}
use of com.developmentontheedge.be5.metadata.model.Module in project be5 by DevelopmentOnTheEdge.
the class Serialization method reloadForms.
public static JavaScriptForms reloadForms(final Path file, final Module target) throws ReadException {
checkProject(target.getProject());
turnOffAutomaticSerialization();
try {
return new YamlDeserializer(new LoadContext()).reloadForms(file, target);
} finally {
turnOnAutomaticSerialization();
}
}
Aggregations