If you are stubborn, or an idiot, or you just like using junky apps Open Office is for you. This is probably one of the only situations I'd suggest paying for and installing Office 2007 / 2003. It's just worth it.
I've been doing some automation in C# / Open Office [which I would love to rename Open Orface] and have been having issues porting Java code into C# - especially with this god darn UnoRuntime B.S.
So, what the fark is UnoRuntime and how the hell do I use it in Open Office. Well, I'm not going to get into the nitty gritty about it here - rather I'm going to explain how you don't use this somewhat core seeming object when building automation in C#.
As I'm sure you are aware - UnoRuntime is not available from C# - BUT - Most of the Java examples use this object heavily to query the UI layer and for object creation (or brokering I'm no expert under the Open Orface hood).
At first I took a look into Marshal.QueryInterface method just to see if I couldn't find the UnoRuntime somewhere in the COM layer - I turned around and decided to use an elaborate try catch + reflection algorithm to gain some concrete understanding of what was in the uno objects.
As you work more with Open Office you will realize the C# library uno, and unoidl namespaces merely contain gigantic unorganized transparent object proxy's that point into completely nonintuitive open office objects. Moreover, these open office objects are heavily based on the use of Interfaces - well I looked a bit deeper into the types I was calling and low and behold - they are pretty much huge junky objects that expose a countless number of interfaces - so we don't really even need the UnoRuntime (which makes me wonder why Java uses it).
The bottom line in this article is that UnoRuntime doesn't exist in C#. If you are porting Open Orface Java code into C# then forget about UnoRuntime. Do everything through casting and shut the hell up.
Here is an example of the Java to C# difference in creating a text property replacer:
xRepDesc is of interface type: XReplaceDescriptor AND XPropertyReplace so you can just cast the xRepDesc into XPropertyReplace and boom you're running.
Java:
XPropertyReplace xPropRepl = (XPropertyReplace) UnoRuntime.queryInterface(XPropertyReplace.class, xRepDesc);
C#:
XPropertyReplace xPropRepl = ((XPropertyReplace)xRepDesc);
Just in case you don't know, you create the xRepDesc object by, guess what - casting xComponent (of type - you guessed it XComponet - seriously wtf is an XComponent):
XReplaceDescriptor xRepDesc = ((unoidl.com.sun.star.util.XReplaceable)xComponent).createReplaceDescriptor();
I'm going to go ahead and call this automarshalling and be done with it. It sucks and if I had a server app I'd be tempted to write all my Open Orface automation in Java and write a high level COM abstraction to port a simple oAssWrapper.RunJunk(params) method and not have to deal with the hassle - OR - just go the Open Document route and use MS Word automation and then merely use open office to convert the document.
Over And Out
- Philosophy, Idiocy, Internet Strategy, .Net Development and JavaScript Web Development
Showing posts with label Open Source. Show all posts
Showing posts with label Open Source. Show all posts
23/10/2007
Microsoft vs. Open Source = Hilarity Part 2
I like pointing out other peoples mistakes. I hate it when I make mistakes. But I'm only human, and can only fly in my dreams, so I guess I make mistakes too. But I'm not trying to reflect on my failures. That's not my style, I don't fail all that often, there is nothing to reflect on. I'd rather boast about my success. Or this time, other people's success.
A while ago I wrote an article entitled Microsoft vs. Open Source = Hilarity. Well, this is the follow-up quick blog posting.
Yesterday, Mitchell Baker's the president of the Mozilla Foundation talked about Mozilla's success in fiscal 2006. Give it a read, you will be shocked about the amount of money that is pouring in the door. This serves to be a lesson to everyone including Microsoft that knocks open source. Open Source IS here to stay, and it will only get bigger.
If you have not read my previous post let me refresh your memory. Clint Patterson PR director Microsoft:
I guess the $66.8 million or 25% YOY Revenue increase isn't profitable. I guess a gross profit margin ratio of approximately 0.70:1 isn't that good. And I'm 100% sure that because they are open source they will never be able to leverage the nearly 100 million in cash on hand (well at least 66.8 revenue-17.9 expenses) to support profitable software business that can drive the coordinated research and testing necessary to sustain innovation. This definately won't happen according to Clint Patterson.
I'm going to keep harping on this until Patterson retracts his words, or he dies, or i die.
Dear Microsoft, I am a trusty integrator of your services. Please start to understand just a shred of what's going on here, because it's obvious you don't, and when you go down, your going to bring pretty much everyone else down with you. It's not going to be pretty, and it's not like IBM of the old days. You guys support too much of the PC economy - or pretty much everything in the PC economy outside of internet. Please figure out how to make a proprietary shop demonstrate the ability to support profitable software businesses that can drive the coordinated research and testing necessary to sustain innovation.
(But congrats on the F# announcement, I cannot wait to dive into that language, I just hope you are not becoming the next Sun).
Over and Out
A while ago I wrote an article entitled Microsoft vs. Open Source = Hilarity. Well, this is the follow-up quick blog posting.
Yesterday, Mitchell Baker's the president of the Mozilla Foundation talked about Mozilla's success in fiscal 2006. Give it a read, you will be shocked about the amount of money that is pouring in the door. This serves to be a lesson to everyone including Microsoft that knocks open source. Open Source IS here to stay, and it will only get bigger.
If you have not read my previous post let me refresh your memory. Clint Patterson PR director Microsoft:
"The open-source development model has yet to demonstrate the ability to support profitable software businesses that can drive the coordinated research and testing necessary to sustain innovation," Patterson said.Well, I guess Extensions, Themes, Add-Ons and um ah etc's still don't count as innovation. I guess neither does tabbed web browsing (added to IE 7 in response to firefox), standards compliance (still waiting), and um the few million members participating in this web browsers development community.
I guess the $66.8 million or 25% YOY Revenue increase isn't profitable. I guess a gross profit margin ratio of approximately 0.70:1 isn't that good. And I'm 100% sure that because they are open source they will never be able to leverage the nearly 100 million in cash on hand (well at least 66.8 revenue-17.9 expenses) to support profitable software business that can drive the coordinated research and testing necessary to sustain innovation. This definately won't happen according to Clint Patterson.
I'm going to keep harping on this until Patterson retracts his words, or he dies, or i die.
Dear Microsoft, I am a trusty integrator of your services. Please start to understand just a shred of what's going on here, because it's obvious you don't, and when you go down, your going to bring pretty much everyone else down with you. It's not going to be pretty, and it's not like IBM of the old days. You guys support too much of the PC economy - or pretty much everything in the PC economy outside of internet. Please figure out how to make a proprietary shop demonstrate the ability to support profitable software businesses that can drive the coordinated research and testing necessary to sustain innovation.
(But congrats on the F# announcement, I cannot wait to dive into that language, I just hope you are not becoming the next Sun).
Over and Out
18/09/2007
Microsoft vs. Open Source = Hilarity
I wanted to comment on some amusing quotes from a C-Net article titled Microsoft Resumes Bashing Open Source. Firstly, Clint Patterson, public relations director for Microsoft's Unified Communications Group says the following:
I laughed pretty hard when I read this quote from Matt Asay, vice president of business development at open-source document management company Alfresco:
Over and Out
"The open-source development model has yet to demonstrate the ability to support profitable software businesses that can drive the coordinated research and testing necessary to sustain innovation," Patterson said. "Many in the open-source software community have shifted to hybrid business models. They are making the same business decisions as any commercial software company in terms of what products and services to give away, what intellectual property to protect, how to generate revenue, and how to participate in the community."I wonder if Microsoft recognizes that the Mozilla Foundation (Firefox) with 90 employees made over $52 million dollars in revenue in 2005. I don't want to suggest that's almost $600K per open source developer but I just did. Not to mention that Firefox has pushed browser innovation further than any other company could have anticipated VIA Extensions, Themes, Dictionaries, Search Engines, and Plug-Ins - Something Microsoft claimed was not possible.
I laughed pretty hard when I read this quote from Matt Asay, vice president of business development at open-source document management company Alfresco:
"The open-source community has actually been shifting away from hybrid models," he said, pointing to Alfresco, Funambol and MuleSource as examples. "Hybrid was yesterday's model, when people were still trying to get comfortable with the shift. Tomorrow's is 100 percent open, with 'proprietary services' on top."
Those services, Asay predicted, could be either for support, as in Red Hat's case, or as in Internet-hosed services, the kind of thing Yahoo is getting more serious about with its $350 million acquisition of open-source e-mail software maker Zimbra.
This is the way I've thought of Software recently, so I guess it's tough to take MicroSoft seriously when they seem to again be nothing more than one step behind the pack. Any how ...Over and Out
Subscribe to:
Posts (Atom)