Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF Diff/Merge » Resources loading problems.
Resources loading problems. [message #1274488] Fri, 21 March 2014 14:47 Go to next message
Stephane Bouchet is currently offline Stephane BouchetFriend
Messages: 280
Registered: July 2009
Senior Member
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 #1274503 is a reply to message #1274488] Fri, 21 March 2014 15:14 Go to previous messageGo to next message
Stephane Bouchet is currently offline Stephane BouchetFriend
Messages: 280
Registered: July 2009
Senior Member
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.
Re: Resources loading problems. [message #1274510 is a reply to message #1274503] Fri, 21 March 2014 15:24 Go to previous messageGo to next message
Olivier Constant is currently offline Olivier ConstantFriend
Messages: 106
Registered: January 2012
Senior Member
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 16:55 Go to previous message
Stephane Bouchet is currently offline Stephane BouchetFriend
Messages: 280
Registered: July 2009
Senior Member
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.
Previous Topic:Missing resource in comparisonViewer in latest version
Next Topic:Comparison and reference
Goto Forum:
  


Current Time: Tue Apr 16 07:19:44 GMT 2024

Powered by FUDForum. Page generated in 0.15076 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top