use of com.developmentontheedge.be5.metadata.exception.ReadException 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();
}
}
use of com.developmentontheedge.be5.metadata.exception.ReadException 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;
}
use of com.developmentontheedge.be5.metadata.exception.ReadException in project be5 by DevelopmentOnTheEdge.
the class YamlDeserializer method reloadDaemons.
public Daemons reloadDaemons(final Path path, final Module target) throws ReadException {
final Daemons daemons = new Daemons(target);
final DaemonsDeserializer deserializer = new DaemonsDeserializer(path, daemons);
deserializer.deserialize();
DataElementUtils.saveQuiet(daemons);
return daemons;
}
use of com.developmentontheedge.be5.metadata.exception.ReadException in project be5 by DevelopmentOnTheEdge.
the class YamlDeserializer method deserializeConnectionProfile.
/**
* Parses a connection profile. Doesn't save it to connection profiles
* collection.
*
* @param serialized
* Must contain a serialized JSON with a map as a root element.
* This map should have only one key, that represents a
* connection profile name. The value should contain pairs of connection profile fields.
* @throws ReadException
* @throws ClassCastException
* @see Fields#connectionProfile()
* @see Fields#connectionProfileRead()
*/
public static BeConnectionProfile deserializeConnectionProfile(final LoadContext loadContext, final String serialized, final Project project) throws ReadException {
// unsafe
@SuppressWarnings("unchecked") final LinkedHashMap<String, Object> namedProfile = (LinkedHashMap<String, Object>) new Yaml().load(serialized);
final String profileName = namedProfile.keySet().iterator().next();
// unsafe
@SuppressWarnings("unchecked") final Map<String, Object> serializedProfileBody = (Map<String, Object>) namedProfile.get(profileName);
final BeConnectionProfile profile = readConnectionProfile(loadContext, profileName, serializedProfileBody, project);
return profile;
}
use of com.developmentontheedge.be5.metadata.exception.ReadException in project be5 by DevelopmentOnTheEdge.
the class YamlDeserializer method reloadMassChanges.
public MassChanges reloadMassChanges(final Path path, final Module application) throws ReadException {
final MassChanges massChanges = application.newMassChangeCollection();
final MassChangesDeserializer massChangesDeserializer = new MassChangesDeserializer(path, massChanges);
massChangesDeserializer.deserialize();
DataElementUtils.saveQuiet(massChangesDeserializer.getResult());
return massChangesDeserializer.getResult();
}
Aggregations