Search in sources :

Example 6 with IArtifactsEntity

use of org.whole.lang.artifacts.model.IArtifactsEntity in project whole by wholeplatform.

the class ArtifactsSynchronizerVisitor method synchronize.

@SuppressWarnings({ "unchecked", "rawtypes" })
public static IArtifactsEntity synchronize(IArtifactsEntity entity, Traverse traverse, Synchronize synchronize, IBindingManager bindings, IPersistenceKit defaultPersistenceKit, boolean isLoading) {
    Object rootResource = bindings.wGetValue("rootResource");
    IArtifactsOperations<Object> artifactsOperations = (IArtifactsOperations<Object>) bindings.wGetValue("artifactsOperations");
    ArtifactsSynchronizerVisitor<?> visitor = new ArtifactsSynchronizerVisitor(artifactsOperations, rootResource, traverse, synchronize, isLoading);
    IArtifactsEntity result = visitor.initialize(entity);
    result.accept(visitor);
    if (!isLoading)
        ArtifactsGeneratorOperation.generate(result, bindings);
    else if (traverse.isFileContent()) {
        Object context = artifactsOperations.getDescendant(rootResource, entity);
        defaultPersistenceKit = calculateInheritedPersistence(entity, defaultPersistenceKit);
        ArtifactsLoadFileContentsVisitor.loadContents(result, artifactsOperations, context, defaultPersistenceKit);
    }
    return result;
}
Also used : IArtifactsEntity(org.whole.lang.artifacts.model.IArtifactsEntity) IArtifactsOperations(org.whole.lang.artifacts.util.IArtifactsOperations)

Aggregations

IArtifactsEntity (org.whole.lang.artifacts.model.IArtifactsEntity)6 IOException (java.io.IOException)3 IWholeRuntimeException (org.whole.lang.exceptions.IWholeRuntimeException)3 WholeIllegalArgumentException (org.whole.lang.exceptions.WholeIllegalArgumentException)3 ParseException (org.whole.lang.parsers.ParseException)3 MissingVariableException (org.whole.lang.visitors.MissingVariableException)3 VisitException (org.whole.lang.visitors.VisitException)3 ResourceKind (org.whole.lang.workflows.model.ResourceKind)3 Synchronize (org.whole.lang.artifacts.visitors.ArtifactsSynchronizerVisitor.Synchronize)2 Traverse (org.whole.lang.artifacts.visitors.ArtifactsSynchronizerVisitor.Traverse)2 IBindingManager (org.whole.lang.bindings.IBindingManager)2 IPersistenceKit (org.whole.lang.codebase.IPersistenceKit)2 ArrayList (java.util.ArrayList)1 NameWithExtension (org.whole.lang.artifacts.model.NameWithExtension)1 IArtifactsOperations (org.whole.lang.artifacts.util.IArtifactsOperations)1 IEntity (org.whole.lang.model.IEntity)1 Variable (org.whole.lang.workflows.model.Variable)1