Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Cancellation of XMI load/save
Cancellation of XMI load/save [message #467867] Mon, 03 August 2009 09:04 Go to next message
Romain Dervaux is currently offline Romain DervauxFriend
Messages: 40
Registered: July 2009
Member
Hi, i would to provide cancellation of long-running XMIResource save
operation.

I noticed this discussion :
http://dev.eclipse.org/newslists/news.eclipse.tools.emf/msg1 2862.html

But it isn't very clear to me.
Is progress monitoring supported (as indicated in the javadoc) and if
yes, what is the procedure to pass the IProgressMonitor to the save method ?

Thanks !

PS : Sorry for bad english.
Re: Cancellation of XMI load/save [message #467936 is a reply to message #467867] Mon, 03 August 2009 12:15 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 30692
Registered: July 2009
Senior Member
Romain,

There is currently no support for progress monitoring of load or save.
XSDResourceImpl supports it for load so you could look at that example,
but I'm not sure what canceling save would mean: given that the document
could be partly written out to the file system it sounds like perhaps a
very bad thing to do.


Romain Dervaux wrote:
> Hi, i would to provide cancellation of long-running XMIResource save
> operation.
>
> I noticed this discussion :
> http://dev.eclipse.org/newslists/news.eclipse.tools.emf/msg1 2862.html
>
> But it isn't very clear to me.
> Is progress monitoring supported (as indicated in the javadoc) and if
> yes, what is the procedure to pass the IProgressMonitor to the save
> method ?
>
> Thanks !
>
> PS : Sorry for bad english.
Re: Cancellation of XMI load/save [message #467943 is a reply to message #467936] Mon, 03 August 2009 12:36 Go to previous messageGo to next message
Romain Dervaux is currently offline Romain DervauxFriend
Messages: 40
Registered: July 2009
Member
Hi Ed,

If the user cancels the save operation, i would have deleted the
partially written file of course :)

Thanks for your response.


Ed Merks a écrit :
> Romain,
>
> There is currently no support for progress monitoring of load or save.
> XSDResourceImpl supports it for load so you could look at that example,
> but I'm not sure what canceling save would mean: given that the document
> could be partly written out to the file system it sounds like perhaps a
> very bad thing to do.
>
>
> Romain Dervaux wrote:
>> Hi, i would to provide cancellation of long-running XMIResource save
>> operation.
>>
>> I noticed this discussion :
>> http://dev.eclipse.org/newslists/news.eclipse.tools.emf/msg1 2862.html
>>
>> But it isn't very clear to me.
>> Is progress monitoring supported (as indicated in the javadoc) and if
>> yes, what is the procedure to pass the IProgressMonitor to the save
>> method ?
>>
>> Thanks !
>>
>> PS : Sorry for bad english.
Re: Cancellation of XMI load/save [message #467968 is a reply to message #467943] Mon, 03 August 2009 13:37 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 30692
Registered: July 2009
Senior Member
Romain,

And you'd have the restore the original contents or write to a temporary
file that you rename. If multiple resources are involved, you'd want to
restore them all. You really have resources that are so big that
clients might change their mind part way during saving them? It's hard
to imagine...


Romain Dervaux wrote:
> Hi Ed,
>
> If the user cancels the save operation, i would have deleted the
> partially written file of course :)
>
> Thanks for your response.
>
>
> Ed Merks a écrit :
>> Romain,
>>
>> There is currently no support for progress monitoring of load or
>> save. XSDResourceImpl supports it for load so you could look at that
>> example, but I'm not sure what canceling save would mean: given that
>> the document could be partly written out to the file system it sounds
>> like perhaps a very bad thing to do.
>>
>>
>> Romain Dervaux wrote:
>>> Hi, i would to provide cancellation of long-running XMIResource save
>>> operation.
>>>
>>> I noticed this discussion :
>>> http://dev.eclipse.org/newslists/news.eclipse.tools.emf/msg1 2862.html
>>>
>>> But it isn't very clear to me.
>>> Is progress monitoring supported (as indicated in the javadoc) and
>>> if yes, what is the procedure to pass the IProgressMonitor to the
>>> save method ?
>>>
>>> Thanks !
>>>
>>> PS : Sorry for bad english.
Re: Cancellation of XMI load/save [message #467975 is a reply to message #467968] Mon, 03 August 2009 13:45 Go to previous message
Romain Dervaux is currently offline Romain DervauxFriend
Messages: 40
Registered: July 2009
Member
Well, that's just a "bonus" feature :-D but as the user can cancel the
process during model creation, it would be logic to be able to cancel
the serialization (usually 500 MB models or more, which can take several
minutes : i use the XMLResource.OPTION_FLUSH_THRESHOLD &
XMLResource.OPTION_USE_FILE_BUFFER options).

Well, after reflexion, I already handle cancellation during model
creation, we can consider that the user had time to change his mind
before serialization.

Thanks.


Ed Merks a écrit :
> Romain,
>
> And you'd have the restore the original contents or write to a temporary
> file that you rename. If multiple resources are involved, you'd want to
> restore them all. You really have resources that are so big that
> clients might change their mind part way during saving them? It's hard
> to imagine...
>
>
> Romain Dervaux wrote:
>> Hi Ed,
>>
>> If the user cancels the save operation, i would have deleted the
>> partially written file of course :)
>>
>> Thanks for your response.
>>
>>
>> Ed Merks a écrit :
>>> Romain,
>>>
>>> There is currently no support for progress monitoring of load or
>>> save. XSDResourceImpl supports it for load so you could look at that
>>> example, but I'm not sure what canceling save would mean: given that
>>> the document could be partly written out to the file system it sounds
>>> like perhaps a very bad thing to do.
>>>
>>>
>>> Romain Dervaux wrote:
>>>> Hi, i would to provide cancellation of long-running XMIResource save
>>>> operation.
>>>>
>>>> I noticed this discussion :
>>>> http://dev.eclipse.org/newslists/news.eclipse.tools.emf/msg1 2862.html
>>>>
>>>> But it isn't very clear to me.
>>>> Is progress monitoring supported (as indicated in the javadoc) and
>>>> if yes, what is the procedure to pass the IProgressMonitor to the
>>>> save method ?
>>>>
>>>> Thanks !
>>>>
>>>> PS : Sorry for bad english.
Previous Topic:[Teneo] Problems with Teneo Gmf Mindmap Tutorial
Next Topic:Multivalued feature names
Goto Forum:
  


Current Time: Fri Dec 13 21:01:25 GMT 2019

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

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

Back to the top