I 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
- Download project: svn-repository-browser-Coldfusion-v1.1.zip
- View all source files (brought to you by... the Subversion repository browser)
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: &lt;cfset variables.useClassLoader = <strong>false</strong> /&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:
- CFDIFF's SVN-browser by Rick Osborne
- Used the changes given by Harry Klein
- After hours of struggling with CFDIFF.cfc, I happily switched to Diff.cfc by Shlomygantz.com
- SVNKit.com's javaSVN library
- Dynamic loading of svnkit.jar with Mark mandell's JavaLoader (which rocks!!!) (Using version 1.0 beta 2)
- My own colorCoding component
If you're using the code, or have any questions, leave a comment :-)
| Viewed 5888 times
#1 by Jason Fisher - April 16, 2010 at 4:14 PM
#2 by Paul Klinkenberg - April 26, 2010 at 12:43 AM
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