Search in sources :

Example 1 with IArtifactsOperations

use of org.whole.lang.artifacts.util.IArtifactsOperations 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)1 IArtifactsOperations (org.whole.lang.artifacts.util.IArtifactsOperations)1