Subversion repository browser in Coldfusion; Version 1.1!

svn-repository-browser example screenI already showed this project online, but not yet published as a project. That needed a bit of extra work, as I already explained in this earlier post.

But I just sacrificed part of my weekend to check the code, and add copyright notices, and here it is: the Subversion repository browser in Coldfusion!

Code / source

Howto / installation

1. For starters, download the zip, and extract it within a web root. For this example, I assume you will have it in the root of your website.

2. Optionally, you can copy the jar file 'svnkit.jar' from the unzipped directory "jar files" into your coldfusion class path. The path is either {cf-install-dir}/lib/ or {cf-install-dir}/servers/lib/; read more here. You'll have to restart the CF server afterwards, and change the following setting in svnbrowser.cfc from true to false: &amp;lt;cfset variables.useClassLoader = <strong>false</strong> /&amp;gt;
This step is optional, because by default the project uses the javaLoader class, with which we can dynamically load jar files. This takes a bit more time then just placing it into the lib path I guess, but using the javaloader is more easy...

3. Now open svn.cfm, and edit the following lines to match your repository:

<cfset RepositoryURL="svn://yourserver.com/projectname/trunk/"> <!--- you can also use http:// svn-urls --->
<cfparam name="url.repositorypath" default="" /> <!--- if you want people to start in another directory, add it here --->
<cfset RepositoryUsername="username" />
<cfset RepositoryPassword="password" />

4. You're done! Go to http://yoursite.com/svn.cfm to browse your repository!

(5.) If you look at the html source code, you will see that there is no <head> and <body> tag. That's because I am using this file as an include. If you want to style it as a complete page, then just add the appropriate html into svn.cfm.

Credits

I have combined code from different sources, and then did a pretty rough rewrite:

If you're using the code, or have any questions, leave a comment :-)

del.icio.us Digg StumbleUpon Facebook Technorati Fav reddit Google Bookmarks
| Viewed 3944 times
  1. Jason Fisher

    #1 by Jason Fisher - april 16, 2010 at 16:14

    Breaks on line 38, because there is no CFAPPLICATION tag anywhere. Even a simple Application.cfc in the directory fixes that one, but then it breaks when trying to hit JavaLoader. Does that library have to be installed separately?
  2. Paul Klinkenberg

    #2 by Paul Klinkenberg - april 26, 2010 at 0:43

    Hi Jason, please check the new version 1.1. The javaloader should now work correctly. It is a tricky thing.
    There still is no application.cfm/cfc file available, because this project is (at least for me) meant as an include to a larger project. It is funny to see how everybody is expecting to get fully functional programs out of the box on my site, while my main interest is to help other _developers_ ;-)
    If anything is not working, let me know. Regards, Paul
(will not be published)
Leave this field empty

masquerade-peaceful