Table of Contents
I put this bookmark manager together as an excercise in learning some ColdFusion basics, without much thought to maintainability or usability by other parties; this is my first effort at programming in ColdFusion, and my attention was focused on making things work rather than making sure everything is well-commented, consistently named, or super-secure. For all of that, though, there's no reason not to make the code available for anyone who might be interested, so here it is.
As a point of reference, I developed this application on a Windows desktop, running ColdFusion MX under Apache, and using a MySQL database running on a RedHat Linux 7.3 server. Installation on other platforms shouldn't be particularly different as long as you or someone you know is comfortable with setting up MySQL, and configuring datasources in ColdFusion.
Copy all of the files in the cfbookmark.tar.gz or cfbookmark.zip archive into a directory anywhere in your web server's document path.
The following instructions assume you'll be logged into MySQL as a superuser with the ability to create databases and grant privileges.
Create a mysql database. A logical name to use would be "cfbookmark":
mysql>CREATE DATABASE cfbookmark;
Next, populate the database using the file cfbookmark.sql, which you'll find in the directory you unzipped the archive into. From the mysql command line, you would do this by typing:
mysql>\. /path/to/cfbookmark.sql
Next you'll want to create a user/password that ColdFusion will use to access the database, and give it INSERT, SELECT, UPDATE, and DELETE privileges. For example, if ColdFusion is installed on the same server as the MySQL server, you would type:
mysql>GRANT INSERT, SELECT, UPDATE, DELETE ON cfbookmark.* TO coldfusion@localhost IDENTIFIED BY 'password';
Finally, you'll need to add a Data Source Name for the new database to your ColdFusion configuration. All of the scripts are hard coded to use a DSN named "cfbookmark", but you can name it anything you like as long as you hunt through the code and update all of the datasource attributes in the <cfquery> tags.
You can change the username and password required by the login screen on line 15 of the file login.cfm. By default, the username/password are authuser/pritz
Create a new bookmark in your web browser's native Bookmarks manager, and give it the following URL. (substitute your own host name and installation path in the URL):
javascript:void window.open("http://hostname/path/to/add.cfm?pageurl="
+ escape(document.location)
+ "&pagetitle=" + document.title,
"cfbookmark",
"width=300,height=150,resizable=yes")Name it "Add Bookmark", and file it where it will be convenient; most browsers offer a "Personal Toolbar" for storing frequently used bookmarks.
At this point, you should be ready to go. When you're on a page you want to bookmark, click the "Add Bookmark" link you just created, and a window should pop up with further instructions.
To view your bookmarks, point your browser to http://hostname/path/to/bookmarks.cfm, where hostname is the name of the host running your web server, and /path/to/ is the directory where you unzipped the cfbookmark .tar.gz or .zip file.