To comment on the following update, log in, then open the issue:
http://www.openoffice.org/issues/show_bug.cgi?id=111491
                 Issue #|111491
                 Summary|Defect in XStorable.storeToURL( "Private:stream", xPro
                        |pertySet)
               Component|Database access
                 Version|OOO320m12
                Platform|Macintosh
                     URL|
              OS/Version|All
                  Status|UNCONFIRMED
       Status whiteboard|
                Keywords|
              Resolution|
              Issue type|DEFECT
                Priority|P2
            Subcomponent|MySQL Connector/OOo
             Assigned to|dbaneedsconfirm
             Reported by|keithmcfarlane





------- Additional comments from [email protected] Sun May  9 
15:05:20 +0000 2010 -------
It seems to be impossible in OO3.2 to store a Database document to an 
XOuputStream via the code 
sequence: 
[code]
XComponent xComponent; // Maybe Writer, Impress, Calc or Database document.
java.io.OutputStream output;
PropertyValue [ ] xPropertyValue = new PropertyValue [ 2 ];
xPropertyValue [ 0 ] = new PropertyValue ( );
xPropertyValue [ 0 ] . Name = "FilterName";
ReportOutputStream document; XStorable xStorable;
xPropertyValue [ 0 ] . Value = "writer8"; // for example
 document = new DocumentOutputStream ( output );
 xPropertyValue [ 1 ] = new PropertyValue ( );
 xPropertyValue [ 1 ] . Name = "OutputStream";
 xPropertyValue [ 1 ] . Value = document;
  try
    { xStorable = ( XStorable ) UnoRuntime . queryInterface
        ( XStorable.class, xComponent );
      xStorable . storeToURL ( "private:stream", xPropertyValue );
   }
catch ( final com.sun.star.io.IOException exception )
  { final String message = exception . getMessage ( );
     throw new DatabaseException ( message );
 }
[/code]

The reported error message is as follows (The text "Could not save document" is 
transcribed from the 
underlying OO stack)

com.entropy.reporting.database.DatabaseException: Could not save the document:
com.sun.star.ucb.ContentCreationException:
No Content Provider available for given URL!

 THIS IS IMPORTANT BECAUSE THE METHOD PROVIDES A DIRECT TRANSCRIPTION IF A 
DYNAMICALLY 
GENERATED DOCUMENT TO A SERVLET HTTPServletResponse OutputStream. THE APPROACH 
WORKS for 
Writer, Calc and Impress. IT SHOULD ALSO WORK FOR DATABASE IN MY VIEW. I THINK, 
THEREFORE, 
THAT THIS BUG SHOULD HAVE A HIGH PRIORITY!

The Writer, Calc and Impress documents are typically created as follows:
[code]
XDesktop XDesktop;
xComponentLoader = ( XComponentLoader ) UnoRuntime . queryInterface
  ( XComponentLoader.class, xDesktop );
 PropertyValue [ ] xDeskProps = new PropertyValue [ 1 ];
 xDeskProps [ 0 ] = new PropertyValue ( );
 xDeskProps [ 0 ] . Name = "Hidden";
 xDeskProps [ 0 ] . Value = false;

 xComponent = xComponentLoader . loadComponentFromURL
   ( "private:factory/swriter", "_blank", 0, xDeskProps );

 xComponent = xComponentLoader . loadComponentFromURL
   ( "private:factory/simpress", "_blank", 0, xDeskProps );

 xComponent = xComponentLoader . loadComponentFromURL
   ( "private:factory/scalc", "_blank", 0, xDeskProps );
[/code]

 Note that the same empty document instantiation works for Database also. There 
is however no (not 
even any empty) XDataSource object. NEITHER CAN THIS BE CREATED USING THE 
APPROACH OUTLINED 
IN THE MANUAL / USER-GUIDE (SEE 
http://www.openoffice.org/issues/show_bug.cgi?id=111454 ).

 Your effort (and any reasonable work-around) would be much appreciated.

---------------------------------------------------------------------
Please do not reply to this automatically generated notification from
Issue Tracker. Please log onto the website and enter your comments.
http://qa.openoffice.org/issue_handling/project_issues.html#notification

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to