« December 2004 | Main | March 2005 »

January 07, 2005

Using Javascript and XSLT with ANT

Apache ANT has become the standard Java-based build and deployment tool. Many things can be done using ANT's core and optional tasks, such as chmod, copy, jar, and FTP. However, this article on sitepen.com does a good job of explaining how to use external scripting such as Javascript and XSLT along with ANT.

Here is an example of how to use Javascript with ANT:

<project name="helloWorld" default="main" basedir=".">
<target name="setup">
<script language="javascript"> <![CDATA[
        echo = helloWorld.createTask("echo");
        main.addTask(echo);
        echo.setMessage("Hello World!");
    ]]> </script>
</target>
<target name="main" depends="setup"/>
</project>

Make sure to read the article and download the correct JAR files.

Here is an example of how to make an XSL Transformation request with a parameter:

<style in="src/webProject.xml" out="temp/index.html"
	extension="html" style="webSite.xsl" processor="trax">
 <param name="pageId" expression="com.sitepen.pages.home"/>
</style>

If you are tasked with creating ANT scripts, you should take a look at this article.

Posted by Chuck at 09:54 AM | Comments (0) | TrackBack

January 03, 2005

HTTP-Tunnel - Access the Content You Need

More and more companies are adding corporate firewalls that restrict network traffic going in as well as out. This increases security but decreases capabilities for a select few that need access to the ports being blocked. Enter HTTP-Tunnel (for Windows, from $4.99 / month). HTTP-Tunnel allows access to would-be-blocked ports while still maintaining the level of security that the firewalls represent.

According to their website:

HTTP-Tunnel NG acts as a socks server, allowing subscribers to use your Internet applications despite of restrictive firewalls anonymously. Your Internet application sends data to the HTTP-Tunnel NG Client, which in turn tunnels the data over HTTP (port 80) to the HTTP-Tunnel servers. The servers then send the data to the intended destination and forward the responses back to the HTTP-Tunnel NG client. This forwarding technique effectively bypasses firewalls, permitting the users to successfully use most Internet applications.

What does this mean? Let me give you two examples, both of which have happened to me:

1. I want to transfer a data file to a client via FTP but my company's firewall is blocking port 21 - This is easy to fix with HTTP-Tunnel. Just go into the HTTP-Tunnel client and tell it that whenever you access the client on port 21, have it go to whatever FTP site you need. Then, point your FTP client to "localhost" instead of the FTP site and HTTP-Tunnel will take care of the rest. This technique can be used for almost any program that accesses data on different ports.

2. I want to access a technology tutorial on a site that is hosted on port 8080 but my company only allows access to sites on port 80 - Luckily, HTTP-Tunnel includes a SOCKS server that is compatible with most browsers. Just change the proxy settings of your browser to have the SOCKS server point to localhost:1080 and you will be good to go.

As you can see, HTTP-Tunnel makes it possible to access necessary content, even behind a corporate firewall. Please do not use this software to violate your company's Internet Access Policy. When in doubt, ask. Use HTTP-Tunnel at your own risk.

Posted by Chuck at 10:41 AM | Comments (1) | TrackBack