List Info

Thread: officebean : NoRestore Property and document Recovery




officebean : NoRestore Property and document Recovery
user name
2007-01-08 11:49:20
Andreas Schlüns schrieb:
> news.gmane.org schrieb:
>
>> Hello,
>> I'm using the OfficeBean in a java project in
windows, and I'd like 
>> to disable document recovery after a crash for some
documents.
>> I've tried to use the NoRestore Property, with no
success.
>> If I close the application after loading the
document, and then I 
>> terminate soffice.bin, on the next start of
openoffice I get the 
>> Recovery window.
>> Any ideas?
>>
>> Here's an extract from my code, look down for the
complete working 
>> code if you want to test:
>>
>> PropertyValue[] loadProps = new PropertyValue[1];
>> loadProps[0] = new PropertyValue();
>> loadProps[0].Name = "NoRestore";
>> loadProps[0].Value = new Boolean(Boolean.TRUE);
>> System.out.println(System.currentTimeMillis() +
" - Loading blank 
>> document");
>>            
oBean.loadFromURL("private:factory/swriter",loadPr
ops);
>> String docUrl = 
>>
createUNOFileURL("\\mobyv01\test\HP_DX2200_uT_P4_52
4.doc", oBean);
>> System.out.println(System.currentTimeMillis() +
" - Loading document: 
>> " + docUrl);
>> oBean.loadFromURL(docUrl, loadProps);
>>
>
> The property "NoRestore" is unknwon and so
not supported by 
> loadComponentFromURL(). The only way to disable
recovery is using
> of the command line parameter "-norestore" on
starting the office.
>
> But that can be a problem for you. I do not know if the
bean provide
> a way to influence the start process of an used office
instance ...

I use the following property:

System.setProperty("com.sun.star.officebean.Options&quo
t;, "-norestore");

Cheers
Harald

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

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

[1]

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