Resources loading problems. [message #1274488] |
Fri, 21 March 2014 10:47  |
Eclipse User |
|
|
|
Hello,
It may be a simple question, but I would like to know a few things about method load() of persistent model scopes, since I override it in order to get remote resources (from scm).
I am using FragmentedModelScope, where I see :
public boolean load() throws Exception {
boolean result = false;
if (_state == ScopeState.INITIALIZED || _state == ScopeState.LOADED) {
for (Resource rootResource : _rootResources) {
rootResource.load(null);
}
_state = ScopeState.LOADED;
result = true;
}
return result;
}
Q1 : Is the "if ... LOADED" normal?
Q2 : What are the resources which are being used? I load my own resources then add them into list _resources, but I don't see anything in the viewer.
|
|
|
|
Re: Resources loading problems. [message #1274510 is a reply to message #1274503] |
Fri, 21 March 2014 11:24   |
Eclipse User |
|
|
|
Hello,
Quote:Q1 : Is the "if ... LOADED" normal?
Well, I don't see why not. If the list of _resources has changed since the last call to load() but scope exploration is not yet complete, then it will load missing resources.
Quote:Q2 : What are the resources which are being used? I load my own resources then add them into list _resources, but I don't see anything in the viewer.
FragmentedModelScope was designed to start from a single file/resource URI and incrementally extend, load and explore the scope according to user-defined / metamodel-specific rules. It was not initially designed to start from a set of resources. Nevertheless, this scenario would make sense too. I do not see why it would not work in this scenario at first glance, but I may be missing something. So I am interested in extending FragmentedModelScope to support your scenario if a change is needed. Just tell me if you notice anything abnormal during your tests.
Quote:i found a solution for Q2 :
i have to add my resource in the _resources list to be compared, and add it again to _rootresources to be displayed in the viewer.
Indeed, a class invariant is that _rootResources must be included into _resources. I will make it more explicit in the Javadoc.
Cheers,
Olivier
|
|
|
Re: Resources loading problems. [message #1274572 is a reply to message #1274510] |
Fri, 21 March 2014 12:55  |
Eclipse User |
|
|
|
Olivier,
for Q1, that makes sense now, since you can effectively add rootresources via the notify* methods.
for remote contents, i start with a single resource but i have to load it from an inputstream.
i am interrested in the possiblities to include some other remote resources during exploration.
for now the load() method suits partially muy needs ( not a edm problem ).
thanks for the explanation.
|
|
|
Powered by
FUDForum. Page generated in 0.05827 seconds