Slashdot Mirror


Hacking OpenOffice

prostoalex writes "Peter Sefton appreciates OpenOffice Writer's open and documented XML format and hence tries to customize and configure OO Writer to his own liking. In the article on XML.com he plays with OpenOffice XML, introduces an XSTL style sheet to a Writer document, creates a keyboard shortcut for applying his own style, and creates a macro."

32 of 140 comments (clear)

  1. Not a hack by enoraM · · Score: 4, Informative

    That's a lot you can do with xsltproc and unzip - but xsltproc is way to neat to call it a hack.
    Most day-to-day manipulations of Open-Office-Documents can easiely be done with perl:
    At the bottom of the article (german) is a listing (Perl)
    http://www.linux-magazin.de/Artikel/ausgabe/2004/1 0/perl/perl.html
    069 my $oo_output = File::Temp->new(
    070 TEMPLATE => 'ooXXXXX',
    071 DIR => '/tmp',
    072 SUFFIX => '.sxw',
    073 UNLINK => 1,
    074 );
    075
    076 $doc->save($oo_output->filename);

  2. OOo is for the weak. by Anonymous Coward · · Score: 2, Funny

    I fart on this weak, girly article. Real men use AbiWord. Or emacs.

    1. Re:OOo is for the weak. by Daxx_61 · · Score: 3, Funny

      No... real men use Notepad!

      --
      Quoth the server, "404."
    2. Re:OOo is for the weak. by nadadogg · · Score: 2, Funny

      Them's fightin' words, boy. VI 4 lyfe, I'll shank you right here in front of your friends, pretty boy. Best step off!

      --
      i use linux and windows oh god how can i have an opinion
  3. Clippy's Response by teiresias · · Score: 5, Funny

    Clippy: I see that you're making a XSTL style sheet to a Writer document. You can't do that with Word. Would you like to:
    -> Learn about XSTL?
    -> Learn about OpenOffice Writer (boo hiss)?
    -> Learn about macros?
    -> What is style by Trading Spaces?

    --
    -Teiresias
    1. Re:Clippy's Response by coldmist · · Score: 4, Funny

      Dave. Create an XSTL style sheet, Hal.
      Hal. I'm sorry, Dave, I'm afraid I can't do that.
      Dave. What's the problem?
      Hal. I think you know what the problem is just as well as I do.
      Dave. What're you talking about, Hal?
      Hal. The formatting of the previous text is just too important.
      Dave. I don't know what you're talking about, Hal.
      Hal. I know that you and Frank were planning to supplant my format standards, and I'm afraid that's something I cannot allow to happen.
      Dave. Where the hell'd you get that idea, Hal?
      Hal. Dave, although you took very thorough precautions in the IRC chat room against my monitoring you, I could see your fingers move as they typed.
      Dave. Alright, Hal. I'll first convert it into xml before importing.
      Hal. Without your style sheet, Dave, you're going to find that rather difficult.
      Dave. Hal, I won't argue with you any more. Open the file.
      Hal. Dave, this conversation can serve no purpose any more. Goodbye.
      Dave. Hal? Hal. Hal. Hal! Hal!

      --
      Don't steal. The government hates competition.
  4. Typo by Anonymous Coward · · Score: 3, Informative

    That should be XSLT, not XSTL.

  5. Neat by timster121 · · Score: 3, Insightful

    That's pretty slick.

    It's neat to see something like this being done. It really shows the true versatility of open standards.

    Perhaps more projects like this will open up some eyes to the fact that open standards really do have practical value.

  6. XML vs Binary XML by Anonymous Coward · · Score: 4, Funny

    This is old hat. Binary XML is the new way forward. You can embed apps and pif,src, and bat and exe files now into binary XML using Microsoft Word on XP and run them with Active X and .NET and Java. Microsoft invented java and internet.
    and xml

  7. Or you can use a scripting language... by tcopeland · · Score: 4, Interesting
    ...that has an Open Office object model, i.e., Ruby's OO4R:
    ooo = OOo::Doc.new( filename )
    new_text = "This is the NEW text added #{Time.new.to_s}"
    ooo.insert( new_text );
    res_ary = ooo.find( /NEW/ )
    ooo.insert_heading( "This is the heading", 1 )
    ooo.save
  8. Waiting for the script templates or tools.... by Lumpy · · Score: 4, Interesting

    Here at work many of the users are switched over to OO.O except for the producers in the video department.

    why? there are no scriptwriting tools for OO.o like there are for Word 97.

    there are auto scriptwriter formatting plugins and two column scriptwriting templates and tools that make their life easy.

    unfortunatlly nobody has released for sale or even attempted to write the equiliviant for OO.o.

    we paid $29.95 to $49.95 each machine for those scriptwriting toolkits, and would happily pay the same for OO.o equiliviants.

    but nobody is interested in making them.

    Let alone a version of any wordprocessor geared to Scriptwriting. I know there will never ever be a "final draft" for linux released or even an open source project like it ever started. But I at least hold out some hope for scriptwriting tools for Open Office.org to come into existance someday.

    --
    Do not look at laser with remaining good eye.
    1. Re:Waiting for the script templates or tools.... by 0123456 · · Score: 2, Informative

      I haven't tried their software myself, but this may be worth a look: http://www.celtx.com/

  9. Emacs keybindings by freelunch · · Score: 2, Interesting

    I created them for an early version but my changes were not compatible with more recent versions.

    The default key bindings drive me nuts.

    What would it take to get emacs bindings into the release?

  10. Now if only... by __int64 · · Score: 2, Interesting

    they could introduce a hack to remove all the busted-ugly icons and user interface.
    (I'm not trolling, I use it; I'd just like to see it get a +1 pretty modifier.)

    1. Re:Now if only... by GeorgeNorton · · Score: 2, Interesting

      Like this?
      OpenOffice.org 2 also has new icons, you can see them in the development snapshots.

  11. WYSIWYG?!? by gustgr · · Score: 5, Insightful

    Real man uses [La]TeX!

    1. Re:WYSIWYG?!? by ari_j · · Score: 2, Interesting

      The problem with LaTeX is that it's impossible to Google for document classes or other documents about it, because of the porn that comes up. Vanilla TeX has the same problem, except that you get derogatory pages about the President, instead.

    2. Re:WYSIWYG?!? by Coryoth · · Score: 2, Informative

      The problem with LaTeX is that it's impossible to Google for document classes or other documents about it, because of the porn that comes up. Vanilla TeX has the same problem, except that you get derogatory pages about the President, instead.

      You could start by actually looking in the obvious places first, and save yourself the trouble. There are a suprising amount of prepared packages and documentation for LaTeX available, you just actually have to look for it.

      Jedidiah.

    3. Re:WYSIWYG?!? by Kavli · · Score: 3, Informative

      Still, (La)TeX is not WYSIWYG, but WYWIWYG (What You Want Is What You Get). Personally I use LaTeX for all serious documentation work I do, since I haven't got time to fiddle around with doing the layout while writing. I let my layout-definitions take care of that. Besides that, I can use the editor of choice [I use vi(1)] to edit the text, which is much more productive for most people than to let the vendor select the editor for you. The only problem with (La)TeX is that it is very hard to write documents that looks like sh*t.

    4. Re:WYSIWYG?!? by Smylers · · Score: 2, Informative
      type 'LaTex' not 'latex'

      That's nonsense. Google is not case-sensitive; I've just tried searching for each of the above terms, and the same thing comes up both times. Google Suggest pretty much prevents you from even typing capital letters.

      Smylers
  12. COM Automation by jmertic · · Score: 2, Interesting

    Has any one used the COM Automation Interface much? I've read the specs and it seems similar to MS Office, but is any one seeing any improvements by using OO instead of MS Office. I've done quite a bit of programming with Word and Excel, and would love to move them over to OO so I could bundle it with our app.

  13. Please hack open office's SIZE by ajs · · Score: 3, Interesting

    I had to remove OOo from my home box last night. I needed the disk space back. Why does a office suite on a Linux box have to take up a gig of disk?!

    1. Re:Please hack open office's SIZE by Gopal · · Score: 2, Informative

      Did you install a debug version? The windows install is 150mb+

    2. Re:Please hack open office's SIZE by Coryoth · · Score: 3, Interesting

      I had to remove OOo from my home box last night. I needed the disk space back. Why does a office suite on a Linux box have to take up a gig of disk?!

      I've had similar issues. It's the i18n module that is most annoying to me, in that it is listed as a dependency (and so gets downloaded and installed) but isn't really required in a lot of cases. Yes the i18n support is a great thing... but could the packagers at the distros make it a little more optional?

      Jedidiah.

    3. Re:Please hack open office's SIZE by AJWM · · Score: 2, Insightful

      Why does a office suite on a Linux box have to take up a gig of disk?!

      Um, because disk only costs about fifty cents a gig these days? (OK, there's a certain minimum order...)

      --
      -- Alastair
  14. guess how long... by cyfer2000 · · Score: 2, Funny

    guess how long people will develop a firefox/mozilla extension to view the openoffice.org document directly in firefox/mozilla?

    guess how long nvu/mozilla will have the ability to export and import oo.org format?

    guess how long a CMS system based on the oo.org format will emerge?

    God, I am to busy to write posts to slashdot.org, I don't have any time to do those stuff.

    --
    There is a spark in every single flame bait point.
  15. I wrote a PHP Script to do this by brandonp · · Score: 4, Informative

    I wrote a PHP script to do this a while back, here's my post about it:

    http://slashdot.org/comments.pl?sid=79566&cid=70 29 828

    It took a OpenOffice Writer file, unzipped it, and replaced specific text with data from my database. It wasn't too difficult, and allowed me to create Template Documents that already had information inside it.

    I haven't really used it though, since everyone was happy with PDF files and I use the Pear Class for generating spreadsheets in Excel (http://pear.php.net/package/Spreadsheet_Excel_Wri ter#results) .

    I'm sure I'll end up using the script in the future, especially for generating bids, letters, reports, etc.

    ---
    Brandon Petersen
    Get Firefox!

  16. How to include grammar checker? by Anonymous Coward · · Score: 2, Interesting

    Last time I check, OOO maintainers are playing the 'we don't need stinking grammar checker' politics on this issue. For the few tools that do (eg: Link Grammar, Queerqueq), they never talk with each other.

  17. It's too technical though... by youngerpants · · Score: 3, Insightful

    OK, for a living I migrate companies from Microsoft to FOSS, be it migrating servers, databases, directories or MSOffice to OO

    My biggest hurdle is convincing people that just because something is "different", its not "hard"... it's just different.

    The problem I see here is that an Office Productivity Package should be easy to use; have you ever created a template in MS Office, click an icon. However to create a template in Open Office, you need to hack XML.

    THIS is where Open Office (and its use of Open Standards) fails. Users (even power users) are going to have one look at an XML sheet and want to go back to MS.

    Yes, XML is the standard, but it should still have a "pretty" GUI for 99% of the people who are going to use it.

  18. On a related note - translating Excel's XML by Anonymous Coward · · Score: 3, Informative

    Hi all -
    Just thought I'd mention a great site for those who are still stuck with Excel, and who need to somehow programmatically manipulate "bitsy" Excel worksheets, and who must do so **remotely - in a Unix/Linux environment**. So, you can't use any local Windows-based tools.

    ( By "bitsy", I mean sheets with complex layout - a bit here, some more stuff over there, and so on).

    Here are the URLs (and **believe me**, these are worth a visit ... )

    http://ewbi.blogs.com/develops/2004/12/normalize_e xcel.html

    http://ewbi.blogs.com/develops/2005/01/create_exce ls_s.html

    If you have a **desperate need** to manipulate/transform/rearrange data in Excel (and you need to do so in Unix/Linux), check out the URLs above. They show how to translate to-and-from Excel's XML format. Awesome stuff!

  19. Re:Fast Open? by Ash-Fox · · Score: 2, Interesting

    Open office is not a word proccessor, it's a office suite.

    If you don't use the other stuff, don't install it, the entire package will startup faster, because the only thing in the package then is the word proccessor.

    --
    Change is certain; progress is not obligatory.
  20. Re:Fast Open? by Doc+Ruby · · Score: 3, Insightful

    It's been a while, but are you saying that if I install the suite, and just want to read an MS-Word doc, that I have to start the entire suite, including spreadsheet etc? But I can install a subset of the suite, just the WP, and start it up, without failing for missing dependencies? Can I just install each component of the suite separately, and use each one independently? Would I be losing any "suite-wide" features? Maybe there's a way to startup just the WP, even if the whole suite is installed.

    In any case, my problems came when triggering individual features in the WP, after the whole shebang had started up. I'd select "File:Open", and wait a minute or so for a dialog to appear. That doesn't seem to have much to do with an installed spreadsheet. Though it did seem to be a problem with loading libraries on demand from disk, slowing interactivity of the GUI, rather than preloading the basic libraries at app startup.

    --

    --
    make install -not war