[dev] Re: Java / SWT / OpenOffice / Ole Problem
Good morning, Unfortunately I don't know anything about the SWT stuff. Is it providing an OLE container that stores the embedded document? And what is the file Unfortunatly I don't know anything about ole nor openoffice. But according to the (example) source code I first create a so called OleFrame: oleFrame = new OleFrame(sShell, SWT.NONE); within that frame an oleClientSite object is created, which specifies the actual ole application oleClientSite = new OleClientSite(oleFrame, SWT.NONE, "opendocument.WriterDocument.1"); you mentioned? If this is the result from the "OleSave" call I'm not The file is a java.io.File which you pass to oleClientSite.save(file, oleYesOrNor) whereas boolean oleYesOrNo specifies if you would like to include ole information. astonished that you can't open it in OOo because this is a special format only used for embedding it into an OLE client. If you have a storage viewer you could try to have a look into it. You should be able to find a stream that contains the usual OOo package file format. Not really sure what you mean here. The file that is saved is a "sort of" an openoffice document. I unzipped it and it contains several xml documents, including a content.xml where I can find my bla bla editings. Then I compared it with a "normal saved" document and I found that it was missing some pieces, e.g., the thumbnails directory and the meta.xml file. If you embed OOo via Java I really recommend to use the OOo API for saving the content not some OLE stuff that only works on Windows. Is this still possible when using ole stuff? Thanks -- Tobias - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[dev] Re: Java / SWT / OpenOffice / Ole Problem
>>oleClientSite = new OleClientSite(oleFrame, SWT.NONE, >>"opendocument.WriterDocument.1"); > > > That pretty much looks like OLE stuff. Yes, internalay this oleClient.save method results in a JNI which in turn calls a OleSave function (where ever that comes from). whereas boolean oleYesOrNo specifies if you would like to include ole information. I assume you yes "no", so you directly get the file stream and not the OLE storage. I pass a true value (to leave this yes-no thing), otherwise nothing will be written at all. The appearance of the filter dialog (as mentioned in your first mail) seems to tell us that the file misses a proper MediaType. Is there a manifest.xml with the correct type added? No this is missing too. To my knowledge the file stream OO stores into the OLE storage is a complete OOo document, so it's a miracle to me how something can get lost. Maybe SWT manipulates the file?! Unlikly as SWT does not know any internals of the embedded document and why should it just pick out the manifest.xml? Sorry, but I don't know the SWT stuff and how it communicates with OOo. I'm afraid without further information about the internal processes in SWT I can't be of help. Thank you anyway! Tobias - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[dev] Re: Java / SWT / OpenOffice / Ole Problem
Unlikly as SWT does not know any internals of the embedded document and why should it just pick out the manifest.xml? I puzzled about this. If OOo documents are embedded as OLE servers they store themselves as OLE storage that contains a stream named "package_stream" and contains the whole zip file as usual. So an OleSave should give you the OLE storage (that does not look like a zip file, so it's not what you obviously got). So, what do you think. Is there anything I can do about this and is it more likely an OpenOffice or a SWT problem? Meanwhile I played around with this UNO stuff and was able to embed a OpenOffice in a java.awt.Frame. Would you consider this as a usable and stable alternative? Once again, thanks -- Tobias - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [dev] Re: Java / SWT / OpenOffice / Ole Problem
Tobias Himstedt wrote: > Good morning, > >> Unfortunately I don't know anything about the SWT stuff. Is it providing >> an OLE container that stores the embedded document? And what is the file > > Unfortunatly I don't know anything about ole nor openoffice. But > according to the (example) source code I first create a so called OleFrame: > > oleFrame = new OleFrame(sShell, SWT.NONE); > > within that frame an oleClientSite object is created, which specifies > the actual ole application > > oleClientSite = new OleClientSite(oleFrame, SWT.NONE, > "opendocument.WriterDocument.1"); That pretty much looks like OLE stuff. > whereas boolean oleYesOrNo specifies if you would like to include ole > information. I assume you yes "no", so you directly get the file stream and not the OLE storage. > Not really sure what you mean here. The file that is saved is a "sort > of" an openoffice document. I unzipped it and it contains several xml > documents, including a content.xml where I can find my bla bla editings. > Then I compared it with a "normal saved" document and I found that it > was missing some pieces, e.g., the thumbnails directory and the meta.xml > file. The appearance of the filter dialog (as mentioned in your first mail) seems to tell us that the file misses a proper MediaType. Is there a manifest.xml with the correct type added? To my knowledge the file stream OO stores into the OLE storage is a complete OOo document, so it's a miracle to me how something can get lost. Maybe SWT manipulates the file?! Sorry, but I don't know the SWT stuff and how it communicates with OOo. I'm afraid without further information about the internal processes in SWT I can't be of help. Best regards, Mathias -- Mathias Bauer - OpenOffice.org Application Framework Project Lead Please reply to the list only, [EMAIL PROTECTED] is a spam sink. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [dev] Re: Java / SWT / OpenOffice / Ole Problem
Tobias Himstedt wrote: > >> oleClientSite = new OleClientSite(oleFrame, SWT.NONE, > >>"opendocument.WriterDocument.1"); > > > > > > That pretty much looks like OLE stuff. > > Yes, internalay this oleClient.save method results in a JNI which in > turn calls a OleSave function (where ever that comes from). OleSave is a Windows API call that can be used to retrieve the stored content of an embedded OLE object. >> The appearance of the filter dialog (as mentioned in your first mail) >> seems to tell us that the file misses a proper MediaType. Is there a >> manifest.xml with the correct type added? > > No this is missing too. OK, that explains why you get the dialog. It should load in OOo1.1 and later developer builds of OOo2.0 though if you select the correct filter. >> To my knowledge the file stream OO stores into the OLE storage is a >> complete OOo document, so it's a miracle to me how something can get >> lost. Maybe SWT manipulates the file?! > > Unlikly as SWT does not know any internals of the embedded document and > why should it just pick out the manifest.xml? I puzzled about this. If OOo documents are embedded as OLE servers they store themselves as OLE storage that contains a stream named "package_stream" and contains the whole zip file as usual. So an OleSave should give you the OLE storage (that does not look like a zip file, so it's not what you obviously got). Best regards, Mathias -- Mathias Bauer - OpenOffice.org Application Framework Project Lead Please reply to the list only, [EMAIL PROTECTED] is a spam sink. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [dev] Re: Java / SWT / OpenOffice / Ole Problem
Tobias Himstedt wrote: >>>Unlikly as SWT does not know any internals of the embedded document and >>>why should it just pick out the manifest.xml? >> >> >> I puzzled about this. If OOo documents are embedded as OLE servers they >> store themselves as OLE storage that contains a stream named >> "package_stream" and contains the whole zip file as usual. So an OleSave >> should give you the OLE storage (that does not look like a zip file, so >> it's not what you obviously got). > > So, what do you think. Is there anything I can do about this and is it > more likely an OpenOffice or a SWT problem? As long as I don't know what SWT exactly does I can only guess. In general I wouldn't see this as an OOo problem, because I know the OLE implementation of OOo works in several OLE clients. Maybe someone who has the source code of SWT *and* understands it can tell us more. > Meanwhile I played around with this UNO stuff and was able to embed a > OpenOffice in a java.awt.Frame. Would you consider this as a usable and > stable alternative? Yes, definitely. This is one of the recommended ways we can offer. And the biggest benefit might be that if something goes wrong we will have a better chance to tell you why. :-) Best regards, Mathias -- Mathias Bauer - OpenOffice.org Application Framework Project Lead Please reply to the list only, [EMAIL PROTECTED] is a spam sink. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]