Search in sources :

Example 1 with Resolver

use of org.whole.lang.commons.model.Resolver in project whole by wholeplatform.

the class ArtifactsWorkspaceUtils method getContents.

public static IEntity getContents(FileArtifact fileArtifact, String persistenceKitId) {
    IBindingManager bindings = BindingManagerFactory.instance.createBindingManager();
    bindPath(fileArtifact, bindings, false);
    IFile file = (IFile) bindings.wGetValue("file");
    final IPersistenceProvider pp = new IFilePersistenceProvider(file);
    final Resolver resolver = CommonsEntityFactory.instance.createResolver();
    final Content fragment = CommonsEntityAdapterFactory.createStageUpFragment(ArtifactsEntityDescriptorEnum.Content, resolver);
    try {
        fragment.wSet(0, ReflectionFactory.getPersistenceKit(persistenceKitId).readModel(pp));
    } catch (Exception e) {
    }
    return fragment;
}
Also used : IFile(org.eclipse.core.resources.IFile) Resolver(org.whole.lang.commons.model.Resolver) Content(org.whole.lang.artifacts.model.Content) IBindingManager(org.whole.lang.bindings.IBindingManager) IFilePersistenceProvider(org.whole.lang.codebase.IFilePersistenceProvider) IPersistenceProvider(org.whole.lang.codebase.IPersistenceProvider) CoreException(org.eclipse.core.runtime.CoreException)

Aggregations

IFile (org.eclipse.core.resources.IFile)1 CoreException (org.eclipse.core.runtime.CoreException)1 Content (org.whole.lang.artifacts.model.Content)1 IBindingManager (org.whole.lang.bindings.IBindingManager)1 IFilePersistenceProvider (org.whole.lang.codebase.IFilePersistenceProvider)1 IPersistenceProvider (org.whole.lang.codebase.IPersistenceProvider)1 Resolver (org.whole.lang.commons.model.Resolver)1