Ignore:
Timestamp:
2002-06-17T10:28:16+12:00 (22 years ago)
Author:
jrm21
Message:

If a document has associated files that are also given a subdirectory, that subdirectory is now a subdir of the HASH... dir and not just a subdir of the assoc dir. If the given subdir starts with a '/' then it will be a subdir of the assoc dir.

Eg
"1.jpg" will be put into building/assoc/HASHnnn.dir/1.jpg
"0/1.jpg" will be put into building/assoc/HASHnnn.dir/0/1.jpg
"/foo/1.jpg" -> building/assoc/foo/1.jpg

This is because HTMLPlug was putting first 1000 assoc files into "assoc/0", next thousand into "assoc/1", etc. But this meant that if you updated a collection, files in "0" would get overridden.

The only change to HTMLPlug is to use the _httpdocimg_ macro instead of the _httpcolling_ so we link to the right place.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/perllib/mgppbuildproc.pm

    r2771 r3148  
    272272   
    273273    foreach my $assoc_file (@{$doc_obj->get_assoc_files()}) {
    274     # if assoc file contains directory structure of
    275     # its own use it, otherwise use HASH... directory
    276     if ($assoc_file->[1] =~ /[\/\\]/) {
    277         $afile = &util::filename_cat($self->{'assocdir'}, $assoc_file->[1]);
     274    # if assoc file starts with a slash, we put it relative to the assoc
     275    # dir, otherwise it is relative to the HASH... directory
     276    if ($assoc_file->[1] =~ m@^[/\\]@) {
     277        $afile = &util::filename_cat($self->{'assocdir'},$assoc_file->[1]);
    278278    } else {
    279279        $afile = &util::filename_cat($self->{'assocdir'}, $archivedir, $assoc_file->[1]);
Note: See TracChangeset for help on using the changeset viewer.