Search in sources :

Example 21 with Module

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

the class BeModelElementSupport method isAvailable.

@PropertyName("Available in current project")
@Override
public boolean isAvailable() {
    if (usedInExtras == null || usedInExtras.length == 0)
        return true;
    Module module = getModule();
    String[] extras = module == null ? Strings2.EMPTY : module.getExtras();
    Project project = getProject();
    for (String usedInExtra : usedInExtras) {
        if (!hasExtra(extras, project, usedInExtra))
            return false;
    }
    return true;
}
Also used : Project(com.developmentontheedge.be5.metadata.model.Project) Module(com.developmentontheedge.be5.metadata.model.Module) PropertyName(com.developmentontheedge.beans.annot.PropertyName)

Example 22 with Module

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

the class DataElementUtils method moveBackToItsModule.

/**
 * Moves the model element back to the its module if the element is an entity item.
 *
 * @param modelElement
 */
public static void moveBackToItsModule(final BeModelElement modelElement) {
    if (modelElement instanceof BeElementWithOriginModule) {
        BeElementWithOriginModule r = (BeElementWithOriginModule) modelElement;
        r.setOriginModuleName(r.getModule().getName());
    }
}
Also used : BeElementWithOriginModule(com.developmentontheedge.be5.metadata.model.base.BeElementWithOriginModule)

Example 23 with Module

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

the class Serialization method reloadDaemons.

public static Daemons reloadDaemons(final Path file, final Module target) throws ReadException {
    checkProject(target.getProject());
    turnOffAutomaticSerialization();
    try {
        return new YamlDeserializer(new LoadContext()).reloadDaemons(file, target);
    } finally {
        turnOnAutomaticSerialization();
    }
}
Also used : YamlDeserializer(com.developmentontheedge.be5.metadata.serialization.yaml.YamlDeserializer)

Example 24 with Module

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

the class Serialization method reloadCustomizations.

public static PageCustomizations reloadCustomizations(final Path file, final Module target) throws ReadException {
    checkProject(target.getProject());
    turnOffAutomaticSerialization();
    try {
        return new YamlDeserializer(new LoadContext()).reloadCustomizations(file, target);
    } finally {
        turnOnAutomaticSerialization();
    }
}
Also used : YamlDeserializer(com.developmentontheedge.be5.metadata.serialization.yaml.YamlDeserializer)

Example 25 with Module

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

the class YamlDeserializer method reloadPages.

public StaticPages reloadPages(final Path path, final Module target) throws ReadException {
    final StaticPages pages = new StaticPages(target);
    final StaticPagesDeserializer deserializer = new StaticPagesDeserializer(path, pages);
    deserializer.deserialize();
    DataElementUtils.saveQuiet(pages);
    return pages;
}
Also used : StaticPages(com.developmentontheedge.be5.metadata.model.StaticPages) LanguageStaticPages(com.developmentontheedge.be5.metadata.model.LanguageStaticPages)

Aggregations

Module (com.developmentontheedge.be5.metadata.model.Module)26 Project (com.developmentontheedge.be5.metadata.model.Project)21 Entity (com.developmentontheedge.be5.metadata.model.Entity)19 Query (com.developmentontheedge.be5.metadata.model.Query)12 Test (org.junit.Test)9 Path (java.nio.file.Path)8 ArrayList (java.util.ArrayList)6 Operation (com.developmentontheedge.be5.metadata.model.Operation)5 YamlDeserializer (com.developmentontheedge.be5.metadata.serialization.yaml.YamlDeserializer)5 HashMap (java.util.HashMap)5 ProjectElementException (com.developmentontheedge.be5.metadata.exception.ProjectElementException)4 TableDef (com.developmentontheedge.be5.metadata.model.TableDef)4 Map (java.util.Map)4 FreemarkerCatalog (com.developmentontheedge.be5.metadata.model.FreemarkerCatalog)3 FreemarkerScript (com.developmentontheedge.be5.metadata.model.FreemarkerScript)3 BeModelElement (com.developmentontheedge.be5.metadata.model.base.BeModelElement)3 List (java.util.List)3 FreemarkerSqlException (com.developmentontheedge.be5.metadata.exception.FreemarkerSqlException)2 ReadException (com.developmentontheedge.be5.metadata.exception.ReadException)2 ColumnDef (com.developmentontheedge.be5.metadata.model.ColumnDef)2