Saturday, November 5, 2011

Icefaces 2.0.2 with Grails

I finally managed to get Icefaces 2.0.2 to run with Grails. The steps are as follows:

1) Create a new grails application:
grails create-app myapp
cd myapp

2) Install the jsf2 plugin:
grails install-plugin jsf2

3) Install the templates to edit the web.xml file:
grails install-templates

4) Copy the following JARs into the lib directory:
icefaces-2.0.2.jar
icefaces-ace-2.0.2.jar
icefaces-compat-2.0.2.jar
icepush.jar

5) Add the following lines into the web.xml template in src/templates/war:
<servlet>
<servlet-name>Resource Servlet</servlet-name>
<servlet-class>com.icesoft.faces.webapp.CompatResourceServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>

<servlet-mapping>
<servlet-name>Resource Servlet</servlet-name>
<url-pattern>/xmlhttp/*</url-pattern>
</servlet-mapping>

<context-param>
<param-name>javax.faces.FACELETS_SKIP_COMMENTS</param-name>
<param-value>true</param-value>
</context-param>

<context-param>
<param-name>javax.faces.VALIDATE_EMPTY_FIELDS</param-name>
<param-value>false</param-value>
</context-param>

And that's it. You can now create JSF files with the extension .xhtml in
the grails-app/view directory (following the JSF2 format).

Wednesday, November 2, 2011

Running Forms 6i remotely without Terminal Services

We still use a lot of Oracle Forms 6i programs in-house and for our customers. One of the issue is that users do not want to install the Forms 6i runtime client on each PC and it also creates deployment issue unless we share out the FMX programs from a central file server. Also, since Forms 6i is only a 32-bit software, it should run only on Windows Server 2003 32-bits Terminal Server, although some users have tried making it work on Windows 7 64-bit. This create another issue on the need to have MS Terminal Service licenses.

However there is another way, which does not even require a MS Terminal Services, and that is to use the following set of packages on Linux: Wine, XRDP and VNC Server.

We started first by installing the XRDP (version 0.5.0) package and VNC-server, running on Centos 5.4, to allow the Remote Desktop Connection program to connect to a window session on the linux server. We have tested this on both Windows XP and Windows 7. Add a new user and test out the remote desktop access to the linux server (the window will ask you for a userid and password). It may start up a window manager (if there are any installed) or just open an xterm.

Next, using the latest version of Wine (1.3.31), we have managed to install the Oracle Forms 6i (Release 2 for XP with Patch 18) runtime and run WITHOUT recompiling the FMX, our existing Forms programs. One problem we faced was that you need to CUSTOM install the Oracle TCP Protocol Adapter which for some reason does not install by default. Also, you may want to install the MS Windows TrueType fonts if it will help. The Forms 6i programs were all installed in the user which we created earlier for the XRDP access.

With that in placed, you can create start-up scripts to auto-run a specific Forms program (via Wine). If you want the XRDP to auto-run your start-up script, you can try modifying the /etc/xrdp/startwm.sh script.