.apm
file from http://www.arsdigita.com/acs-repository/index?&type=acs4x and install through Package Manager.
/serverroot/packages/photo-album-lite/tcl/photo-album-lite-init.tcl
/serverroot/packages/photo-album-lite/sql/photo-album-lite-create.sql
/usr/openwin/lib
[hint: check nsd-oracle
and /etc/shell-mods.sh
]
This package is intended for novices, both to photography and computers. Throughout the package, emphasis is placed on simplicity of interface and minimizing the number of clicks needed to achieve the desired function. Only a small number of fields are stored for each photograph; these fields are filled out while looking at the image, after upload.
This package is not an image manipulation program. Though the underlying software makes use of the powerful ImageMagick libraries, we will mostly shield the end user from these capabilities (perhaps adding rotations in a later release).
acs_object
which generates a certain amount of overhead,
but I did it with the idea that I may actually do some real
permissioning before long. For now, all photos are publicly viewable
but can only be modified by the person who created them. Also, a
moderately savvy hacker can add photos to someone else's folder in
this alpha release.
The tables are laid out so that every photo must be a part of exactly one folder. Or, in data-modeler speak:
Each folder may contain zero or more photos.
Every photo must belong to one and only one folder.
Images are served from a virtual URL having the following format:
wherehttp://your.server.domain/package_instance_url/photo/type/photo_id/filename.ext
type
is orig
(original size), med
("medium"-sized, default
is 400pixels in height) or thumb
(thumbnail, default is
100pixels in height). There is currently no link to the original size
image from the web interface, since images with heights > 400pixels
are too big for most computer screens. In any case this is easy to
add and will happen before long.
The photos are themselves are stored in the Unix filesystem (i.e. not
as BLOBS), in a subdirectory of the server root, as
photo_id-type.ext
. I experimented a bit with
InterMedia's ORDImage
type but it doesn't deliver quite
enough oomph to justify the performance hit we'd take from storing
everything in the database. More specifically, scaling an image down
(using the process
method) produces notable image
degradation.
When an image is deleted through the web interface, all associated
image files are deleted from the filesystem.
Gotchas
1. Installation
pa_param
values at the top of /serverroot/packages/photo-album-lite/tcl/photo-album-lite-init.tcl
[Note: in later versions we will use ad_parameter
, As It Should Be].
/usr/openwin/lib
to the LD_LIBRARY_PATH. ImageMagick/Solaris requires a library called libdpstk.so
. This may not be included in your aolserver's environment by default. If you use the standard aD architecture, you can set this variable in /home/aol32/bin/nsd-oracle
.
dbms_job
to update the InterMedia index. This requires that your database user have the execute
privilege on ctx_ddl
. This privilege must be granted explicitly; granting through the ctxapp
role alone will not work.
2. Uninstall
SQL> update pa_photos set deleted_p = 't';
SQL> update pa_folders set deleted_p = 't';
dbms_job
. By default, the Intermedia index is
rebuilt every 4 hours with a dbms_job
. If you're observant, you will have noticed that the install script prints out a numerical id for the job. This is the job you want to remove. In any case, it is easy to look the job up like so:
You can then drop the job by running this script:
SQL> select job from user_jobs where what = 'pa_rebuild_idx;';
Automatic job removal will be added to the drop script in the next version of this package.
SQL> begin dbms_job.remove(the_job); end;
SQL> /
acs_object.delete()
fails. The drop script may fail to drop the
pa_photo
and pa_folder
object types if there
are any objects of those types lying around. Your first impulse might
be to use acs_object.delete()
. And it might work. If it
doesn't work, it's probably because the extension
tables--pa_photos
and pa_folders
--have
already been dropped. Here is a quick and dirty way to fool the
object system into doing the right thing: recreate straw-man
pa_photos
and pa_folders
tables with just
the primary key column, fill them with entries that have id's
corresponding to the objects of the same type in
acs_objects
, and you're good to go.
The future
1. Easy stuff
Features:
Implementation details:
Harder stuff
aegrumet@arsdigita.com