To comment on the following update, log in, then open the issue:
http://www.openoffice.org/issues/show_bug.cgi?id=69151
                 Issue #|69151
                 Summary|Inserting remote document into local desktop
               Component|udk
                 Version|OOo 2.0.3
                Platform|Other
                     URL|
              OS/Version|All
                  Status|UNCONFIRMED
       Status whiteboard|
                Keywords|
              Resolution|
              Issue type|DEFECT
                Priority|P3
            Subcomponent|code
             Assigned to|kr
             Reported by|ramboid





------- Additional comments from [EMAIL PROTECTED] Thu Aug 31 11:13:41 -0700 
2006 -------
Could you give me some pointers to load a document from an InputStream?  In a 
Linux server, running OpenOffice in listening mode, I created an OO document 
(*.odt) and saved in the file-system of the server.  Afterwards, I try to load 
the document into the desktop of OpenOffice that runs locally in my PC.  The 
local desktop shows but it never loads the document via an InputStream.  The 
code to load the document into the local desktop is as follows:

        try {

            // Create the name of the file stored in the server

            String name = "file:///";

            name = name.concat("/tmp/testremotesave.odt");

            // Create FileAccess to the remote service

            XSimpleFileAccess fileAccess = (XSimpleFileAccess) 
UnoRuntime.queryInterface(XSimpleFileAccess.class, 
xRemoteServiceManager.createInstanceWithContext
("com.sun.star.ucb.SimpleFileAccess",xRemoteContext));

            // Create properties with remote file

            PropertyValue[] loadProps = new PropertyValue[1];

            loadProps[0] = new PropertyValue();

            loadProps[0].Name = "InputStream";

            loadProps[0].Value = fileAccess.openFileRead(name);

            // Get the local desktop
            xLocalXDesktop = getDesktop(xLocalService);

            // query the XComponentLoader interface from the desktop

            XComponentLoader xComponentLoader = (XComponentLoader)
UnoRuntime.queryInterface(XComponentLoader.class, xLocalXDesktop);

            // load new local writer file
            XComponent xLocalWordComponent = 
xComponentLoader.loadComponentFromURL("private:factory/swriter", "_blank", 0, 
loadProps);

            // Display the local desktop
            xLocalXDesktop.getCurrentFrame().getContainerWindow().setVisible
(true);

        } catch(Exception e) {

            System.out.println(e.toString());

        }

xRemoteServiceManager and xRemoteContext are references to the remote 
OpenOffice services running in the server.  The idea is to create an 
InputStream of the file via the remote service and then load the InputStream 
into the local service.

---------------------------------------------------------------------
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]


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

Reply via email to