Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » ResourceSet default save options?
ResourceSet default save options? [message #855183] Tue, 24 April 2012 15:36 Go to next message
Bryan Hunt is currently offline Bryan HuntFriend
Messages: 366
Registered: July 2009
Senior Member
Hi Ed,

I'm working on some code that will load/save EMF models across HTTP and I need to support user authentication. I've added the capability to specify the authentication information in load/save options, but it seems rather inconvenient for clients to have to know to specify the authentication information on each call to load and save. Additionally, demand loads must get the authentication information from the default load options in the ResourceSet. It seems a natural extension to put the authentication information in the ResourceSet for saves as well.

Since there are no default save options in the ResourceSet, is there a technical reason for not having them, or has there never been a need to have them? Would my use-case be a good argument for adding default save options to the ResourceSet?

I might be able to contribute this if the solution is fairly straight forward.

Bryan
Re: ResourceSet default save options? [message #855216 is a reply to message #855183] Tue, 24 April 2012 16:03 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
Bryan,

Comments below.

On 24/04/2012 5:36 PM, Bryan Hunt wrote:
> Hi Ed,
>
> I'm working on some code that will load/save EMF models across HTTP
> and I need to support user authentication. I've added the capability
> to specify the authentication information in load/save options, but it
> seems rather inconvenient for clients to have to know to specify the
> authentication information on each call to load and save.
> Additionally, demand loads must get the authentication information
> from the default load options in the ResourceSet. It seems a natural
> extension to put the authentication information in the ResourceSet for
> saves as well.
The only reason it's there for load is because things get loaded on
demand, i.e., Save on the other hand is always an explicit operation
performed on the resource so the client will always have to be aware to
pass in any options that are needed.
>
> Since there are no default save options in the ResourceSet, is there a
> technical reason for not having them, or has there never been a need
> to have them?
Even if we have them, a client would need to know to fetch them and use
them in conjunction with whatever other options they need.
> Would my use-case be a good argument for adding default save options
> to the ResourceSet?
No. :-P It's at best a convenient place. More convenient for the
client if they're in the default save options of the resource itself.
The factory could set them.
>
> I might be able to contribute this if the solution is fairly straight
> forward.
No matter where we put them, other than the resource's own save options,
the client has to know to use them when they call save...
>
> Bryan


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: ResourceSet default save options? [message #856286 is a reply to message #855216] Wed, 25 April 2012 14:30 Go to previous messageGo to next message
Bryan Hunt is currently offline Bryan HuntFriend
Messages: 366
Registered: July 2009
Senior Member
Ok, so you think it would be best to create a resource factory and have it set the credentials in the save options?
Re: ResourceSet default save options? [message #856304 is a reply to message #856286] Wed, 25 April 2012 14:42 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
Bryan,

Well, I'm not sure how the credentials are created in the first
place. If the client has to create the credentials, it's certainly not
unreasonable to expect that to use them in the resource set as a default
load option and to use them again when saving by providing options for
the save. Of course if it's easy for them to set the options in a
factory and have all resources that are loaded or saved automatically
use them, then that's even easier still...


On 25/04/2012 4:30 PM, Bryan Hunt wrote:
> Ok, so you think it would be best to create a resource factory and
> have it set the credentials in the save options?


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: ResourceSet default save options? [message #857848 is a reply to message #856304] Thu, 26 April 2012 22:37 Go to previous message
Bryan Hunt is currently offline Bryan HuntFriend
Messages: 366
Registered: July 2009
Senior Member
The short answer is that the client does not create the credentials.

The long answer involves Mylyn task repository connections, factories, services, managers, listeners, URI handlers, web clients, and screen sharing with lots of beer Smile

I'll investigate the resource factory.
Previous Topic:Entities extending from EObject
Next Topic:Serializing Model data to XML
Goto Forum:
  


Current Time: Thu Apr 25 11:13:02 GMT 2024

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

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

Back to the top