Re: [dev] proposal for change of cws policies

2007-07-05 Thread Joerg Sievers

Hi Peter,

Peter Junge wrote:
defined wrong. Please refer included link 
.


Done!


Cu,
Jogi

http://qa.openoffice.org/qatesttool
http://wiki.services.openoffice.org/wiki/User:Jsi

--
Sun Microsystems GmbH   Joerg Sievers
Nagelsweg 55Quality Assurance Engineer
20097 Hamburg

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [dev] proposal for change of cws policies

2007-07-05 Thread Joerg Sievers

Hi Martin,

Martin Hollmichel wrote:

I suggest that we make this cws policies official on July 11th if there
are no objections until then.



I have modified some things in the Wiki without changing or deleting the 
content or the meaning of it:


- We should use the common wording in the community 'issue' instead of 
'task'
- we have more than one specification: (functional) software 
specification; test case speification [I have added the links to the 
chapters inside the Wiki]
- Bullet lists are fine but you have priorized the issue categories and 
I have used an ordered list to make it more clear
- A "bug fix"? A "fix" is IMO the same (fixing something that goes 
wrong...); removed the word bug because a fix could also be something 
that makes an existing behaviour faster/more efficient/

- added links to QA rules, Gatekeeper, EIS, 


If these changes get accepted I propose to exchange the "Level of
impact" in the EIS application accordingly to the new categorization of
cws in the policies.


From my point of view more clear than in the past.

Cu,
Jogi

http://qa.openoffice.org/qatesttool
http://wiki.services.openoffice.org/wiki/User:Jsi

--
Sun Microsystems GmbH   Joerg Sievers
Nagelsweg 55Quality Assurance Engineer
20097 Hamburg

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[dev] Re: [qa-dev] Re: [dev] proposal for change of cws policies

2007-07-05 Thread Thorsten Ziehm

Hi Michael,

Michael Meeks schrieb:

Hi Martin,

On Thu, 2007-07-05 at 14:14 +0200, Martin Hollmichel wrote:

With the help of Nikolai we are now able to provide a proposal for a
modified version of the child workspace policies on
http://wiki.services.openoffice.org/wiki/CWS_Policies


This looks like an improvement :-) thanks.

Under the "Setting a CWS to approved by QA" - since this is something
developers can do (for category B) - can you expand on the (should for
bug fixes) section - "Make a test specification / test case available" -
is there some repository of such things somewhere ? how is that done ?
in what form ? can this be waived in the case that a unit test exercises
the code paths ? :-)


I can speak for QA on GUI level. We define 'developer issues' (like the
ones in Category B) as issues, where it isn't possible to create test
case specifications or write test cases for automated testing with
TestTool. If my team get such issues (or CWS with such issues), we do
general regression testing in the areas where the changes were done.
But these issues were tested and still can be tested by another
developer by code review or doing unit test or API testing.

I cannot speak for Unit test or API testing on issues or CWS. But is
this needed to explain in such document? Or what should be include?

Thorsten

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [dev] proposal for change of cws policies

2007-07-05 Thread Thorsten Ziehm

Moin Peter :-)

Peter Junge schrieb:

Hi Martin,

Martin Hollmichel wrote:

Hi,

for a long time it has been already practice that not all child 
workspaces had to be approved by a QA Team member but also by another 
developer. The same applies for the involvement of the user experience 
Team. Together with Lutz for the user experience team and Thorsten for 
the QA team we review the existing Child Workspace policies on 
http://tools.openoffice.org/dev_docs/child_workspace_policies.html.


With the help of Nikolai we are now able to provide a proposal for a 
modified version of the child workspace policies on 
http://wiki.services.openoffice.org/wiki/CWS_Policies


in the section 'Making the CWS "Ready for QA", "Approved by QA" and 
"Nominated" for Integration', the role of the QA-representative is 
defined wrong. Please refer included link 
.


The QA-representative is not the to do the 'necessary tests', but the 
person to coordinate the QA effort. This could even mean, that the QA 
Rep. does no testing at all, when other tasks are on higher priority to 
drive the process of CWS approval.




You are right. I changed this part.

Thorsten

PS.: For me it isn't a wonder that you find this, because you was
responsible to work out with a team the 'Approve a CWS' documentation. ;-)

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [dev] proposal for change of cws policies

2007-07-05 Thread Peter Junge

Hi Martin,

Martin Hollmichel wrote:

Hi,

for a long time it has been already practice that not all child 
workspaces had to be approved by a QA Team member but also by another 
developer. The same applies for the involvement of the user experience 
Team. Together with Lutz for the user experience team and Thorsten for 
the QA team we review the existing Child Workspace policies on 
http://tools.openoffice.org/dev_docs/child_workspace_policies.html.


With the help of Nikolai we are now able to provide a proposal for a 
modified version of the child workspace policies on 
http://wiki.services.openoffice.org/wiki/CWS_Policies


in the section 'Making the CWS "Ready for QA", "Approved by QA" and 
"Nominated" for Integration', the role of the QA-representative is 
defined wrong. Please refer included link 
.


The QA-representative is not the to do the 'necessary tests', but the 
person to coordinate the QA effort. This could even mean, that the QA 
Rep. does no testing at all, when other tasks are on higher priority to 
drive the process of CWS approval.


[...]

Best regards
Peter

--
Peter Junge
Program Manager and Senior Engineer Open Source Technology

北京红旗中文贰仟软件技术有限公司
Beijing Redflag Chinese 2000 Software Co., Ltd.
Building No.2, Block A, Huilongsen, 18 Xihuan South Street
Beijing Economic-Technological Development Area
Beijing, P.R.China

Tel:+86-10-51570010 ext.6212
http://www.ch2000.com.cn
http://www.ch2000.com.cn/english/index.htm

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [dev] RE:[dev] question about use XStorag

2007-07-05 Thread chensuchun




[EMAIL PROTECTED] wrote:

sal_Bool SAL_CALL XXFilter::filter( const Sequence< PropertyValue >& rDescriptor ) 
	throw (RuntimeException)

{
Window* pFocusWindow = Application::GetFocusWindow();

if( pFocusWindow )
pFocusWindow->EnterWait();


Please! Don't use any GUI code in filter components. This is not a job
of the filter. You never know in which content your code will be called.


sal_Bool XXFilter::implImport( const Sequence< PropertyValue >& rDescriptor )
{
...
uno::Reference< document::XStorageBasedDocument > xDoc( mxDesDoc, 
uno::UNO_QUERY );///mxDesDoc is set by setTargetDocument

...

///I use loadFromStorage to load document
uno::Sequence< beans::PropertyValue > afArgs( 1 );
afArgs[0].Name = ::rtl::OUString::createFromAscii( "FilterName" );
afArgs[0].Value <<= ::rtl::OUString::createFromAscii( "writer8" );
/**xSourceStorage is read form InputStream, I remove the sub storage and it's 
odt format now */
xDoc->loadFromStorage( xSourceStorage, afArgs ); 
...

///End
when I open a document,it goes into the function implImport
but the function loadFromStorage don't load the document.
Is there other API or method that I can load the odt document in my filter ? 

I don't understand why you need to write a filter that does the same as
the default filter. I assume that you have some additional code in your
filter that loads your own data and then wants to pass the storage to
the document so that it can load as it would to for the original format,
correct?

Yes, I add the fingerprints of the document's creator into the 
substorage when saving the document.
when opening it, I want to judge if the fingerprints are match the 
fingerprints of who open it ,if match loading the document as original 
format.

There's a new API especially for filters that create a legal ODF
document storage themselves and just want to hand it over to the document
model. It goes like this:

Sequence< Any > aArgs( 2 );
aArgs[0] <<= xDoc;
aArgs[1] <<= xStream; // the stream you have got!

Reference< XFilter > xSubFilter;
try
{
// mxMSF is the service factory you received in
// the ctor of your filter
xSubFilter = Reference(
mxMSF->createInstanceWithArguments(
OUString( RTL_CONSTASCII_USTRINGPARAM(  
"com.sun.star.document.OwnSubFilter" ) ),
aArgs ),
UNO_QUERY );
xSubFilter->filter( aDescriptor ); // the original descriptor
}
catch(Exception& )
{
// ...
}

I don't know if it works when the provided stream itself *is* an ODF
storage but you can try it out and tell us if it works. :-)


Sorry, there is no OwnSubFilter service in my openoffice, my openoffice
is based on the source of OOB680 .

I want to try an other way.
My idea is  as following:
1. use loadComponentFromURLto open the document in hidden mode.
2. copy the whole content and style from the  XComponent returned fronm 
loadComponentFromURL to the mxDesDoc which is set by setTargetDocument.

3. close the hidden document.

Can I do in the filter in this way?
Could you tell me how to copy the whole content and style from one 
document to another if this way works?

Thanks!

Best wishes!

chensuchun

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [dev] RE:[dev] question about use XStorag

2007-07-05 Thread Mathias Bauer
[EMAIL PROTECTED] wrote:

> sal_Bool SAL_CALL XXFilter::filter( const Sequence< PropertyValue >& 
> rDescriptor ) 
>   throw (RuntimeException)
> {
> Window* pFocusWindow = Application::GetFocusWindow();
> 
> if( pFocusWindow )
>   pFocusWindow->EnterWait();

Please! Don't use any GUI code in filter components. This is not a job
of the filter. You never know in which content your code will be called.

> sal_Bool XXFilter::implImport( const Sequence< PropertyValue >& rDescriptor )
> {
> ...
> uno::Reference< document::XStorageBasedDocument > xDoc( mxDesDoc, 
> uno::UNO_QUERY );///mxDesDoc is set by setTargetDocument
> 
> ...
> 
> ///I use loadFromStorage to load document
> uno::Sequence< beans::PropertyValue > afArgs( 1 );
> afArgs[0].Name = ::rtl::OUString::createFromAscii( "FilterName" );
> afArgs[0].Value <<= ::rtl::OUString::createFromAscii( "writer8" );
> /**xSourceStorage is read form InputStream, I remove the sub storage and it's 
> odt format now */
> xDoc->loadFromStorage( xSourceStorage, afArgs ); 
> ...
> ///End
> when I open a document,it goes into the function implImport
> but the function loadFromStorage don't load the document.
> Is there other API or method that I can load the odt document in my filter ? 
I don't understand why you need to write a filter that does the same as
the default filter. I assume that you have some additional code in your
filter that loads your own data and then wants to pass the storage to
the document so that it can load as it would to for the original format,
correct?

There's a new API especially for filters that create a legal ODF
document storage themselves and just want to hand it over to the document
model. It goes like this:

Sequence< Any > aArgs( 2 );
aArgs[0] <<= xDoc;
aArgs[1] <<= xStream; // the stream you have got!

Reference< XFilter > xSubFilter;
try
{
// mxMSF is the service factory you received in
// the ctor of your filter
xSubFilter = Reference(
mxMSF->createInstanceWithArguments(
OUString( RTL_CONSTASCII_USTRINGPARAM(  
"com.sun.star.document.OwnSubFilter" ) ),
aArgs ),
UNO_QUERY );
xSubFilter->filter( aDescriptor ); // the original descriptor
}
catch(Exception& )
{
// ...
}

I don't know if it works when the provided stream itself *is* an ODF
storage but you can try it out and tell us if it works. :-)

Ciao,
Mathias

-- 
Mathias Bauer (mba) - Project Lead OpenOffice.org Writer
OpenOffice.org Engineering at Sun: http://blogs.sun.com/GullFOSS
Please don't reply to "[EMAIL PROTECTED]".
I use it for the OOo lists and only rarely read other mails sent to it.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[dev] Bug in determining Java type for UNO_LONG properties ?

2007-07-05 Thread Rony G. Flatscher
Hi there,

tried to find an entry on this in the issue tracker, but have not been
successful.

Hence, first asking whether this is a bug in the Java interface to UNO
or a misconception on my side.

Problem: using a property's' Type attribute ("prop.Type") one works with
a "com.sun.star.uno.Type" object (cf.
) it
seems that for UNO_LONG types ("prop.Type.getTypeClass()" returns an
UNO_LONG TypeClass object), whereas "prop.Type.getTypeName" returns the
string name "long" instead of "int".

As a result, using this information to cast Java types to the
corresponding UNO type yields a type error as supplying java.lang.Long
objects for UNO_LONG properties is not possible, rather
java.lang.Integer objects need to be supplied for them.

The documentation of "com.sun.star.uno.Type" is not totally clear for
me, therefore I would like to discuss this, before really going out and
filing an issue (possibly wrongly).

Any comments/hints/insights?

---rony


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [dev] proposal for change of cws policies

2007-07-05 Thread Michael Meeks
Hi Martin,

On Thu, 2007-07-05 at 14:14 +0200, Martin Hollmichel wrote:
> With the help of Nikolai we are now able to provide a proposal for a
> modified version of the child workspace policies on
> http://wiki.services.openoffice.org/wiki/CWS_Policies

This looks like an improvement :-) thanks.

Under the "Setting a CWS to approved by QA" - since this is something
developers can do (for category B) - can you expand on the (should for
bug fixes) section - "Make a test specification / test case available" -
is there some repository of such things somewhere ? how is that done ?
in what form ? can this be waived in the case that a unit test exercises
the code paths ? :-)

Thanks,

Michael.

-- 
 [EMAIL PROTECTED]  <><, Pseudo Engineer, itinerant idiot


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[dev] OOo Accessibility on WIndows via IAccessible2

2007-07-05 Thread Malte Timmermann
Hi,

I am not sure if all of you are aware of IAccessible2 (IA2,
http://www.linux-foundation.org/en/Accessibility/IAccessible2 ), and the
influence that it will have on Assistive Technology (AT) on Windows.

Right now, OOo is not well accessible (with screen readers) on Windows.

OOo itself has a very rich Accessibility API, and is offering all needed
information via this API.
But the AT vendors don't make use of that, because this would mean
implementing something "only" for OpenOffice.org.

So the only way to get their support is by implementing some API that
also other important applications are implementing.

For this reason OOo currently bridges the UNO Accessibility API (UAA) to
Java Accessibility API (JAA), because some AT tools at least support Java.
This helps for the user interface, and for some standard things in the
documents, but currently the AT products don't make use of all
interfaces which are needed to expose the content of complex documents.

For AT, the situation on Windows is worse than on Linux/Solaris with GNOME.
GNOME comes with a full featured Accessibility Architecture.
AT tools can quite easily support any GNOME application, because of the
architecture they don't have to know anything about the applications!
They (basically) just track the focus events, and ask for roles and
interfaces of the focused elements.

On Windows, there is nothing like this.
There is some API (MSAA - Microsoft Active Accessibility), but this is
not a complete architecture. That API is only a complement to Win32 API
to fill some gaps, but still doesn't support exposure of document content.

Microsoft started "UIAutomation" with Windows Vista, but it seems that
this is also not very sufficient.
Supporting this would also be quite difficult (requires managed instead
of native code) and expensive (lot's of new development)  for AT vendors.

For this reason, IBM has "created" IAccessible2.
Mainly they looked into OOo's Accessibility API, and extracted all
things that are not covered by the Win32/MSAA combo.
They brought this to theFree Standards Group (nowadays Linux Foundation)
for further standardization, and the major AT vendors are working on IA2
support.
One of the benefits from IA2 for them is that it's not something
completely new, but only complements existing API. This means they can
keep all their working MSAA implementations, and exchange/enhance some
implementations with IA2.

The AT vendors  already start replacing some "custom" or ugly
implementations with clean solutions based on IA2.
This means, if OOo would support IA2, it could benefit from these
efforts, and quite soon we should have a very well accessible OOo even
on Windows!
For the same reason people are already working on IA2 support in FireFox
and Thunderbird.

Implementing IA2 would be similar to what we are doing on GNOME now. A
small bridge layer maps our UAA implementations to the systems
Accessibility Architecture. In this case, this would mean implementing a
bridge for MSAA and IA2.

A lot of code should be very similar to our GNOME bridge, so I think we
could make quite fast progress if we started this.

Now I wonder - are there any volunteers for this?

This would be great!

Best regards,
Malte.

-- 
http://openoffice.org/access
http://blogs.sun.com/Malte

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [dev] Netbeans (with Openoffice Plugin ) does not start a new client application

2007-07-05 Thread Werner Schulte

Hi Juergen

Juergen Schmidt wrote:

Hi Werner,

mmh, no that is a hack and i don't want to have it documented in the 
wiki (i will remove it). Anyway, thanks for your commitment and please 
don't misunderstand me your feedback is valuable.

Thats OK for me as long as it is solved ;-)


Your described scenario is wrong, the pre-build classes from the SDK 
are packed in the application jar file and the necessary manifest 
entries are inserted. If it won't work with a default OO.org 
installation the only useful and correct hint is to specify the VM 
option -Dcom.sun.star.lib.loader.unopath="/usr/lib/openoffice/program"
anything else shouldn't be necessary. If the bootstrap glue code is 
not packed into your application jar, try the latest version and the 
latest SDK and office. If it still doesn't work please submit an issue.

Maybe I can try this weekend.
So you say, I should try the 2.2.1 stuff (Application + SDK) ?

Regards

Werner


Juergen


Werner Schulte wrote:

Hi Juergen.

I finally found a "solution" and posted the result into the OO Wiki.

http://wiki.services.openoffice.org/wiki/OpenOffice_NetBeans_Integration


Thanks anyway

Werner


Juergen Schmidt wrote:

Hi Werner,

from where do you get the office installation? I remember that we 
have had problems with distro builds of OpenOffice where the 
bootstrap mechanism  doesn't work because of some magic system 
integration stuff of the distros. But i thought that these problems 
was solved at least for Debian ...
Office : 2.0.4 from the Debian repositories. The same applies for the 
developer packages.

Netbeans was downloaded from netbeans.org !


Mmh, you can try to create a link /usr/bin/soffice -> 
/opt/openoffice.org2.0.4/program/soffice (or something else matching 
your installation) and try it again. Please let us know if it works 
then or not.

The link already exists in debian.


This is not really satisfying but we can't prevent it and of course 
it limits the attraction of the simple bootstrap mechanism. It 
doesn't work reliable.


Juergen

Werner Schulte wrote:

Hi all.

I want to use the Netbeans OO plugin to start learning writing Java 
Extensions for OO.


I have the
- Netbeans 5.5.1 IDE
- OO 2.0.4
- OO 2.0.4 SDK
all running on Debian Linux (4.0).

I am able to create a new OO client application using the wizard, 
but Netbeans does NOT start

the application. Instead I get the error message

com.sun.star.comp.helper.BootstrapException: no office executable 
found!

   at com.sun.star.comp.helper.Bootstrap.bootstrap(Bootstrap.java)
   at 
org.openoffice.OfficeUNOClientApp.main(OfficeUNOClientApp.java:29)

.
When I start the Test Application from the console (out of the 
jar), it  the XComponentContext is found.


Any help would be appreciated !

Thanks

Werner

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [dev] proposal for change of cws policies

2007-07-05 Thread Eike Rathke
Hi Martin,

On Wednesday, 2007-07-04 17:04:39 +0200, Martin Hollmichel wrote:

> modified version of the child workspace policies on 
> http://wiki.services.openoffice.org/wiki/CWS_Policies

http://wiki.services.openoffice.org/wiki/CWS_Policies#Build_Configurations
| A CWS must be built on at least two platforms in the "product" version
| (Windows and one UNIX platform)

How will we ensure that non-Hamburg based CWSs can be built on these
platforms and install sets be made available?

> The main difference compared with the old policies are
> * How to group task goes now much more in detail to make more clear in 
> which cases what people are needed to review the work on a child workspace.
> * added more links to documentation on "how to approve a CWS"
> * removed superfluous wording and sentences.

Nice work.

> I suggest that we make this cws policies official on July 11th if there 
> are no objections until then.

+1 (given that the platform obstacle will be sorted out or handled relaxed)

I think some sections need to be checked against / merged with / link to
sections of http://wiki.services.openoffice.org/wiki/CWS which in some
aspects is more detailed, and in other aspects should be replaced with
the new policy.

> If these changes get accepted I propose to exchange the "Level of 
> impact" in the EIS application accordingly to the new categorization of 
> cws in the policies.

+1

  Eike

-- 
 OOo/SO Calc core developer. Number formatter stricken i18n transpositionizer.
 OpenOffice.org Engineering at Sun: http://blogs.sun.com/GullFOSS
 Please don't send personal mail to this [EMAIL PROTECTED] account, which I use 
for
 mailing lists only and don't read from outside Sun. Use [EMAIL PROTECTED] 
Thanks.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[dev] proposal for change of cws policies

2007-07-05 Thread Martin Hollmichel

Hi,

for a long time it has been already practice that not all child
workspaces had to be approved by a QA Team member but also by another
developer. The same applies for the involvement of the user experience
Team. Together with Lutz for the user experience team and Thorsten for
the QA team we review the existing Child Workspace policies on
http://tools.openoffice.org/dev_docs/child_workspace_policies.html.

With the help of Nikolai we are now able to provide a proposal for a
modified version of the child workspace policies on
http://wiki.services.openoffice.org/wiki/CWS_Policies

The main difference compared with the old policies are
* How to group task goes now much more in detail to make more clear in
which cases what people are needed to review the work on a child workspace.
* added more links to documentation on "how to approve a CWS"
* removed superfluous wording and sentences.

I suggest that we make this cws policies official on July 11th if there
are no objections until then.

If these changes get accepted I propose to exchange the "Level of
impact" in the EIS application accordingly to the new categorization of
cws in the policies.

Martin


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[dev] RE:[dev] question about use XStorag

2007-07-05 Thread cokecola13574
Hi!
   With your help ,the exoprt in filter works well.
But now I get some problem with importing the file that I export.

I implement the XImporter as following:
void SAL_CALL XXFilter::setTargetDocument( const Reference< XComponent >& xDoc 
) 
throw(IllegalArgumentException, RuntimeException)
{
mxDesDoc = xDoc;
m_bImport = sal_True;
}
sal_Bool SAL_CALL XXFilter::filter( const Sequence< PropertyValue >& 
rDescriptor ) 
throw (RuntimeException)
{
Window* pFocusWindow = Application::GetFocusWindow();

if( pFocusWindow )
pFocusWindow->EnterWait();

sal_Bool bRet ;
if( m_bImport )
bRet = implImport( rDescriptor );
else
bRet = implExport( rDescriptor );

if( pFocusWindow )
pFocusWindow->LeaveWait();

return bRet;
}

sal_Bool XXFilter::implImport( const Sequence< PropertyValue >& rDescriptor )
{
...
uno::Reference< document::XStorageBasedDocument > xDoc( mxDesDoc, 
uno::UNO_QUERY );///mxDesDoc is set by setTargetDocument

...

///I use loadFromStorage to load document
uno::Sequence< beans::PropertyValue > afArgs( 1 );
afArgs[0].Name = ::rtl::OUString::createFromAscii( "FilterName" );
afArgs[0].Value <<= ::rtl::OUString::createFromAscii( "writer8" );
/**xSourceStorage is read form InputStream, I remove the sub storage and it's 
odt format now */
xDoc->loadFromStorage( xSourceStorage, afArgs ); 
...
///End
when I open a document,it goes into the function implImport
but the function loadFromStorage don't load the document.
Is there other API or method that I can load the odt document in my filter ? 

Thanks!

- Original Message -
From:[EMAIL PROTECTED]
To:dev@openoffice.org
Subject:[dev] RE:Re: [dev] RE:Re: [dev] RE:[dev] question about use XStorage in 
filt
Date:07-06-26 15:17:15


Thank you for your explaination!
Now I get an idea of storing a file clearly.:-)

- Original Message -
From:Mathias Bauer 
To:dev@openoffice.org
Subject:Re: [dev] RE:Re: [dev] RE:[dev] question about use XStorage in filter
Date:07-06-25 14:55:37

Hi,

first thanks for fixing the problem with the mail client.
Now about the possible problem.

[EMAIL PROTECTED] wrote:

> ///create the target storage
> 
> uno::Sequence aArgs( 2 );
>  aArgs[0]   aArgs[1]   uno::Reference xTargetStorage( 
>   xStorageFactory->createInstanceWithArguments( aArgs ),
> uno::UNO_QUERY );

The problem is that you shouldn't use the URL, you must use the
outputstream that is provided to you. The framework opens a temporary
stream and finally copies it over the target file in the Commit() in
SfxObjectShell that you have quoted. The reason is simple: if something
goes wrong in the filter the original files isn't destroyed.

So even if you already create your file at the target location the
SfxObjectShell will overwrite it with all the content stored in the
output stream. In your case the stream is empty, thus the zero byte
length of the result.

Here's what a filter creating a storage should do:

- first create a temporary file
- get the XStream interface from it
- open a storage based on that stream
- copy the document into it
- add your substorage
- commit this storage(!)
- dispose of it
- copy from this stream to the XOutputStream from the arguments
- dispose of the TempFile

The content of the output stream is handled by the framework code. It
will close the stream and copy the bits if everything went fine.

Seeing your code I wonder whether we should add a "Stream" argument so
that you don't need to create the temporary copy. But for the time being
you should proceed as recommended.

Ciao,
Mathias

-- 
Mathias Bauer (mba) - Project Lead OpenOffice.org Writer
OpenOffice.org Engineering at Sun: http://blogs.sun.com/GullFOSS
Please don't reply to "[EMAIL PROTECTED]".
I use it for the OOo lists and only rarely read other mails sent to it.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---
MOTO新摄会 狂拍无极限 超多好礼等你来赢( 
http://d1.sina.com.cn/sina/limeng3/mail_zhuiyu/2007/mail_zhuiyu_20070625.html )

===
注册新浪2G免费邮箱( http://mail.sina.com.cn/chooseMode.html ) 

---
7月11日《变形金刚》首映电影票开抢了!( 
http://d1.sina.com.cn/sina/limeng3/mail_zhuiyu/2007/mail_zhuiyu_20070702.html )

===
注册新浪2G免费邮箱( http://mail.sina.com.cn/chooseMode.html )