This project is a photo management application built on top of MarkLogic Server 5. (It uses external binaries, so porting to 4.x isn't practical.) You can see it in operation at photos.nwalsh.com.
Note: To resolve some bandwidth issues, I've recently implemented a branch, "s3", that stores the images in Amazon S3 and the metadata in XML.
- Install MarkLogic Server 5 if you haven't already.
- Download the project and put it with your other MarkLogic projects. I put
it in
/MarkLogic/photoman
. If you put it elsewhere, make sure you update the paths accordingly. - I'm using the Fico font for the "icons" in lists. You'll have to edit things a bit if you don't want to buy a license for Fico.
- Make sure you've got ExifTool and
the Perl
Image::ExifTool
libraries. - Make sure you've got ImageMagick
- Login to the server as
admin
and run QConsole. - Open
setup/initialize.xqy
and paste it into a QConsole panel. Look at the variables at the top and assure yourself that you're comfortable with them. The initialize script:- Creates a database named
$DATABASE-NAME
(photoman) with a single forest named$FOREST-NAME
(photoman). - Creates an appserver named
$APPSERVER-NAME
(photoman) on port$APPSERVER-PORT
(7070). This will be the server for ordinary users. - Creates an appserver named
$ADMIN-APPSERVER-NAME
(photoman-admin) on port$ADMIN-APPSERVER-PORT
(7071). This will be the server for administration. Do not allow public access to this server - Creates
$WEBLOG-READER
(weblog-reader) and$WEBLOG-UPDATE
(weblog-update) privileges - Creates
$WEBLOG-READER
and$WEBLOG-EDITOR
(weblog-editor) roles. - Creates a
$WEBLOG-READER
(weblog-reader) user.
- Creates a database named
- Copy
setup/amped.xqy
tonwalsh/photoman/amped.xqy
in theModules
directory of the server (often/opt/MarkLogic/Modules
). - In the MarkLogic Server Admin UI, port 8001, in the
Security
section, create an "amp" named "update-views" with the namespace "http://nwalsh.com/ns/modules/photoman/amped" and the URI "/nwalsh/photoman/amped.xqy". Give it the$WEBLOG-EDITOR
role. - Open
/MLS/admin/setup.xqy
and change the top-level variables as necessary. Run/admin/setup.xqy
on your admin server (e.g.,http://localhost:7071/admin/setup.xqy
).
The process for adding images is a little clumsy. I elected to use ExifTool for extracting metadata because it does a good job and produces robust metadata. I decided to scale the images and store them as external binaries because that seemed a good tradeoff of speed vs. space. It's possible to get the server to do the ImageMagick piece, but it means processing horsepower over and over again.
- Create the photos directory and decide how you're
going to organize the images physically. I do it by date, so I create directories
like
/MarkLogic/photoman/photos/2012/04/17
and put the images in there. - Copy an image (or images) into the photo directory or directories.
- Run
bin/imgsize
on those directories. That'll create all the scaled images. - Run
bin/upload-photo
on those directories. Check the defaults in there first. - That should upload the first images. Now you should see the fruits of your efforts on port 7070 and 7071.
Problem? Drop me a note or create an issue. I'll do what I can, when I can.
My offer still stands.