Search in sources :

Example 6 with WriteException

use of com.developmentontheedge.be5.metadata.exception.WriteException in project be5 by DevelopmentOnTheEdge.

the class YamlSerializer method serialize.

public void serialize(final MassChanges massChanges) throws WriteException {
    this.fileSystem = new ProjectFileSystem(massChanges.getProject());
    new MassChangesSerializer().serialize(massChanges);
}
Also used : ProjectFileSystem(com.developmentontheedge.be5.metadata.serialization.ProjectFileSystem)

Example 7 with WriteException

use of com.developmentontheedge.be5.metadata.exception.WriteException in project be5 by DevelopmentOnTheEdge.

the class YamlSerializer method serialize.

public void serialize(final JavaScriptForms forms) throws WriteException {
    this.fileSystem = new ProjectFileSystem(forms.getProject());
    new FormsSerializer().serialize(forms);
}
Also used : ProjectFileSystem(com.developmentontheedge.be5.metadata.serialization.ProjectFileSystem)

Example 8 with WriteException

use of com.developmentontheedge.be5.metadata.exception.WriteException in project be5 by DevelopmentOnTheEdge.

the class YamlSerializer method serializeSources.

private void serializeSources(final Project project) throws WriteException {
    for (SourceFileCollection collection : project.getApplication().getSourceFiles()) {
        for (final SourceFile file : collection) {
            if (!file.isLoaded())
                continue;
            try {
                fileSystem.writeSourceFile(collection.getName(), file.getName(), file.getSource());
                file.setLinkedFile(fileSystem.getNameSpaceFile(collection.getName(), file.getName()));
            } catch (final IOException e) {
                throw new WriteException(file, e);
            }
        }
    }
}
Also used : WriteException(com.developmentontheedge.be5.metadata.exception.WriteException) SourceFile(com.developmentontheedge.be5.metadata.model.SourceFile) IOException(java.io.IOException) SourceFileCollection(com.developmentontheedge.be5.metadata.model.SourceFileCollection)

Example 9 with WriteException

use of com.developmentontheedge.be5.metadata.exception.WriteException in project be5 by DevelopmentOnTheEdge.

the class YamlSerializer method serialize.

public void serialize(final BeConnectionProfiles connectionProfiles) throws WriteException {
    this.fileSystem = new ProjectFileSystem(connectionProfiles.getProject());
    new ConnectionProfilesSerializer().serialize(connectionProfiles.getType(), connectionProfiles);
}
Also used : ProjectFileSystem(com.developmentontheedge.be5.metadata.serialization.ProjectFileSystem)

Example 10 with WriteException

use of com.developmentontheedge.be5.metadata.exception.WriteException in project be5 by DevelopmentOnTheEdge.

the class YamlSerializer method serializeApplication.

private Object serializeApplication(final Module application, boolean serializeReferencedFiles) throws WriteException {
    final List<Object> serializedEntities = list();
    final Iterable<Entity> entities = application.getEntities();
    for (final Entity entity : entities) {
        if (serializeReferencedFiles)
            new EntitySerializer().serialize(entity);
        serializedEntities.add(entity.getName());
    }
    return serializedEntities;
}
Also used : Entity(com.developmentontheedge.be5.metadata.model.Entity)

Aggregations

ProjectFileSystem (com.developmentontheedge.be5.metadata.serialization.ProjectFileSystem)9 WriteException (com.developmentontheedge.be5.metadata.exception.WriteException)4 IOException (java.io.IOException)3 Entity (com.developmentontheedge.be5.metadata.model.Entity)2 ProjectSaveException (com.developmentontheedge.be5.metadata.exception.ProjectSaveException)1 ReadException (com.developmentontheedge.be5.metadata.exception.ReadException)1 FreemarkerScript (com.developmentontheedge.be5.metadata.model.FreemarkerScript)1 Module (com.developmentontheedge.be5.metadata.model.Module)1 SourceFile (com.developmentontheedge.be5.metadata.model.SourceFile)1 SourceFileCollection (com.developmentontheedge.be5.metadata.model.SourceFileCollection)1 YamlSerializer (com.developmentontheedge.be5.metadata.serialization.yaml.YamlSerializer)1 UnsupportedEncodingException (java.io.UnsupportedEncodingException)1 Path (java.nio.file.Path)1