Matt RaibleMatt Raible is a Web Developer and Java Champion. Connect with him on LinkedIn.

The Angular Mini-Book The Angular Mini-Book is a guide to getting started with Angular. You'll learn how to develop a bare-bones application, test it, and deploy it. Then you'll move on to adding Bootstrap, Angular Material, continuous integration, and authentication.

Spring Boot is a popular framework for building REST APIs. You'll learn how to integrate Angular with Spring Boot and use security best practices like HTTPS and a content security policy.

For book updates, follow @angular_book on Twitter.

The JHipster Mini-Book The JHipster Mini-Book is a guide to getting started with hip technologies today: Angular, Bootstrap, and Spring Boot. All of these frameworks are wrapped up in an easy-to-use project called JHipster.

This book shows you how to build an app with JHipster, and guides you through the plethora of tools, techniques and options you can use. Furthermore, it explains the UI and API building blocks so you understand the underpinnings of your great application.

For book updates, follow @jhipster-book on Twitter.

10+ YEARS


Over 10 years ago, I wrote my first blog post. Since then, I've authored books, had kids, traveled the world, found Trish and blogged about it all.

Velocity Templates in RTF

For most of this week, I've been developing Velocity templates for rendering resumes in HTML and RTF (Word). Thanks for Mathias once again for showing me this was possible. The HTML part has been pretty easy, but the RTF stuff has been a bear. Mostly because I want to hide/show different sections of a person's resume based on whether they've entered information or not. In order to do this, I first created a rough draft of the RTF template in Word and then I began hand editing it with a text editor (HomeSite and BBEdit). And if you look at the RTF syntax, it's pretty damn ugly. The main thing I'm struggling with now is showing hiding rows of a table based on whether data exists or now. In HTML - it's easy - you just put your #if statement before a <tr> and you can easily hide the row. In RTF - it seems like the number of rows/columns/borders, etc. is all defined at the beginning of the table - but I can't really read the syntax well enough to understand it.

Therefore, my question is - does anyone know RTF well enough to tell me how I can hide a row? Is there something in the beginning of the table definition I can modify with Velocity #if statements? For now, I'm simply putting "Not Specified" text in rows where no data exists.

Finally, how about some RTF syntax I've learned in this process:

{\f116\fs20 = Verdana 10pt Font
The document must end with " }}" (no quotes) on the same line as the last bit of text
Escape "\n" with "\\par "
{\b\f116\fs24\cf17 = Bold, Verdana, 12pt, Ocean colored Font

How's that for a bunch of useless information! ;-)

Posted in Java at Mar 11 2004, 10:51:18 AM MST 4 Comments
Comments:

Why don't you do it the way XMLResume (http://xmlresume.sourceforge.net) does it?

Posted by jeje on March 11, 2004 at 12:03 PM MST #

XML Resume, as far as I can tell, is really just an XML &rarr; HTML, PDF, Text converter. It says they support RTF, but it requires 3rd party software. So they aren't producing RTF out-of-the-box. That being said, I realize that PDF is just as good for storing files offline as RTF is. However, if folks ever want to download the resume they've built (to send to other employers), I think RTF is a must. Most employers these days (at least in Denver), expect your resume in Word format.

I *do* like XML Resume and I do plan to support its DTD/Schema/Stylesheets in Struts Resume someday. However, for the time being, I'd rather deal with getting the database populated with user input and then displaying that information with Velocity templates. I figure it shouldn't be too hard to eventually manipulate that data into XML format.

I realize I could use an XML database, but I think my client would ever going to go for that. They've spent too much on DB2 and WebSphere to do something different. Besides, when's the last time you heard of an XML database DBA? ;-)

Posted by Matt Raible on March 11, 2004 at 12:20 PM MST #

From what I read, it seems that a row is delimited by the couple \trowd \row. There doesn't seem to be such a thing as a table header ?

Posted by Damien Bonvillain on March 11, 2004 at 05:01 PM MST #

I solved this doing this:
  • add an additional (empty) column
  • delete everything from your target column, flag the cell as hidden
  • enter the keyword which gets velocity parsed in your target column - be careful NOT to mark the cell
  • delete the helper column if you like - otherwise flag it's cell as hidden
When initializing your keywords with \webhidden the whole row is hidden (your helper columns cell if you kept it, the cell of your target column AND the text within the target column) and effectivly ceases to exist.

Posted by Joern Barthel on March 14, 2004 at 06:03 PM MST #

Post a Comment:
  • HTML Syntax: Allowed