Thursday, July 2, 2009

MyEclipse upgrade - making a war file

In the older version of MyEclipse, we used JBoss plugin for Eclipse for .war file generation. But after the upgrade to MyEclipse 7.1, the JBoss plugin simply doesn't work anymore.

Of course, we could always write our own deployment descriptor, run ANT, and generate the .war file. But that also means install ANT on every developer's local machine, configure the path, go to command line every time, not something easy for everyday life.

So, after some research, here's the alternative:

Although MyEclipse does not require Tomcat plugin, we could just set the path and run different versions of Tomcat. But if we add the Tomcat plugin, we could generate .war file!

Step 1: Right click the project name -> properties

Step 2: Choose Tomcat from the bottom, then click Export to WAR settings.

Step 3: Browse to the correct directory and give the WAR file name.

Step 4: Click Apply and close the properties page.

Step 5: Right click the project name -> Tomcat Project -> Export to the WAR file sets in project properties.

Now we have a .war file ready to be deployed.

XSL-FO checkbox using unicode

When using xsl-fo to generate PDF, according to FO documentations, the best way is to use unicode fonts instead of using fo:external-graphics. After searching the web, I didn't find the best solution, but found a lot of useful information. The existing solution is, there is a way to draw a unchecked box using font "ZapfDingbats", but there is no checked box. For the unchecked box, here's code:

<fo:inline font-family="ZapfDingbats" font-size="10pt">&#x274F;</fo:inline>

For the cheked box, here's my solution:

<fo:inline font-family="ZapfDingbats" font-size="6pt" border="1pt black solid">&#x2715;</fo:inline>
Try to use "X" plus the border to create the checked box.