use of com.developmentontheedge.be5.metadata.serialization.LoadContext in project be5 by DevelopmentOnTheEdge.
the class Serialization method reloadLocalization.
public static LanguageLocalizations reloadLocalization(final Path file, final Localizations localizations) throws ReadException {
checkProject(localizations.getProject());
turnOffAutomaticSerialization();
try {
return new YamlDeserializer(new LoadContext()).reloadLocalization(file, localizations);
} finally {
turnOnAutomaticSerialization();
}
}
use of com.developmentontheedge.be5.metadata.serialization.LoadContext in project be5 by DevelopmentOnTheEdge.
the class Serialization method reloadPages.
public static StaticPages reloadPages(final Path file, final Module target) throws ReadException {
checkProject(target.getProject());
turnOffAutomaticSerialization();
try {
return new YamlDeserializer(new LoadContext()).reloadPages(file, target);
} finally {
turnOnAutomaticSerialization();
}
}
use of com.developmentontheedge.be5.metadata.serialization.LoadContext in project be5 by DevelopmentOnTheEdge.
the class YamlDeserializer method readQuery.
public static Query readQuery(final LoadContext loadContext, final String queryName, final Map<String, Object> content, final Entity entity) {
YamlDeserializer yamlDeserializer = new YamlDeserializer(loadContext);
yamlDeserializer.setProject(entity.getProject());
EntityDeserializer entityDeserializer = yamlDeserializer.new EntityDeserializer();
try {
return entityDeserializer.readQuery(queryName, content, entity);
} catch (ReadException e) {
Query query = new Query(queryName, entity);
loadContext.addWarning(e.attachElement(query));
return query;
}
}
use of com.developmentontheedge.be5.metadata.serialization.LoadContext in project be5 by DevelopmentOnTheEdge.
the class YamlDeserializer method readConnectionProfile.
/**
* Parses a connection profile. Doesn't save it to connection profiles collection.
*
* @param serializedProfileBody just a map of properties
* @throws ReadException
*/
private static BeConnectionProfile readConnectionProfile(final LoadContext loadContext, final String profileName, final Map<String, Object> serializedProfileBody, final Project project) throws ReadException {
final YamlDeserializer yamlDeserializer = new YamlDeserializer(loadContext);
final ConnectionProfilesDeserializer connectionProfilesDeserializer = yamlDeserializer.new ConnectionProfilesDeserializer(project.getConnectionProfiles().getLocalProfiles());
final BeConnectionProfile connectionProfile = connectionProfilesDeserializer.deserializeConnectionProfile(profileName, serializedProfileBody);
return connectionProfile;
}
use of com.developmentontheedge.be5.metadata.serialization.LoadContext in project be5 by DevelopmentOnTheEdge.
the class YamlDeserializer method readEntity.
public static Entity readEntity(final LoadContext loadContext, final String entityName, final Map<String, Object> content, final Module module) {
YamlDeserializer yamlDeserializer = new YamlDeserializer(loadContext);
yamlDeserializer.setProject(module.getProject());
EntityDeserializer entityDeserializer = yamlDeserializer.new EntityDeserializer();
try {
return entityDeserializer.readEntity(entityName, content, module);
} catch (ReadException e) {
Entity entity = new Entity(entityName, module, EntityType.TABLE);
loadContext.addWarning(e.attachElement(entity));
return entity;
}
}
Aggregations