List Info

Thread: Re: Interrupt document loading if it takes too long?




Re: Interrupt document loading if it takes too long?
user name
2007-08-06 01:46:05
Hello Mirko,
> Hi,
> 
> I was wondering if there is any way to tell OOo to stop
loading a
> document - i.e. XComponentLoader.loadComponentFromURL()
- after starting
> the operation?
> 
> I drive OOo from Java/Uno, but some documents can take
a very long time
> to load - see e.g.
> 
>   http://www.openoffice.org/issues/show_bug.cgi?id=78118

> 
> and in some applications it would be better to cancel
the operation
> after a timeout and tell the user "sorry, this
document is unsupported"
> rather than make the user wait for several minutes.

You are right - it would be nice to have such feature in OOo
...
but currently OOo does not have such feature .-)

There are already interface supporting canceling of load
requests.
css.frame.XFrameLoader and css.document.XFilter.
So it seams that only XComponentLoader needs some new
functionality.

But - please dont forget that those cancel request must be
supported
by the code implementing the interface. If e.g. the filter
is blocked by
a system call nobody can cancel these request.

> The only way I can think of is to terminate the OOo
process. Anybody has
> a better idea?

....
Solution a) XDesktop.terminate() wouldnt help. Because it
finds the new
created frame used for the load request. And those frame
hinder the 
office on termination. So this API call will return
"false".

Solution b) Kill the office hardly. Then you will trigger
the mechanism
behind AutoRecovery and CrashSave. Also not an option to be
used realy.

Seams you need the new interface 
XComponentLoader2.cancelLoadComponentFromURL() .-)

> 
> Thanks
> 
> Mirko
> 

Regards
Andreas

------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribeapi.openoffice.org
For additional commands, e-mail: dev-helpapi.openoffice.org


Re: Interrupt document loading if it takes too long?
user name
2007-08-06 03:16:56
Hi Andreas,

Andreas Schlüns wrote:
>>
>> I was wondering if there is any way to tell OOo to
stop loading a
>> document - i.e.
XComponentLoader.loadComponentFromURL() - after starting
>> the operation?
>
> You are right - it would be nice to have such feature
in OOo ...
> but currently OOo does not have such feature .-)
>
> There are already interface supporting canceling of
load requests.
> css.frame.XFrameLoader and css.document.XFilter.
> So it seams that only XComponentLoader needs some new
functionality.
>

Interesting. Maybe there is a way to obtain a frame from the
Desktop and
then use XFrameLoader to load the document instead of using
XComponentLoader then?

>> The only way I can think of is to terminate the OOo
process. Anybody has
>> a better idea?
> [...]
> Solution b) Kill the office hardly. Then you will
trigger the mechanism
> behind AutoRecovery and CrashSave. Also not an option
to be used realy.
>

What if OOo is started with -norestore and -nocrashreport?

Thanks

Mirko

------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribeapi.openoffice.org
For additional commands, e-mail: dev-helpapi.openoffice.org


[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )