Ignore:
Timestamp:
2002-06-17T10:28:16+12:00 (20 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/mgbuildproc.pm

    r2505 r3148  
    239239   
    240240    foreach my $assoc_file (@{$doc_obj->get_assoc_files()}) {
    241     # if assoc file contains directory structure of
    242     # its own use it, otherwise use HASH... directory
    243     if ($assoc_file->[1] =~ /[\/\\]/) {
    244         $afile = &util::filename_cat($self->{'assocdir'}, $assoc_file->[1]);
     241    # if assoc file starts with a slash, we put it relative to the assoc
     242    # dir, otherwise it is relative to the HASH... directory
     243    if ($assoc_file->[1] =~ m@^[/\\]@) {
     244        $afile = &util::filename_cat($self->{'assocdir'},$assoc_file->[1]);
    245245    } else {
    246246        $afile = &util::filename_cat($self->{'assocdir'}, $archivedir, $assoc_file->[1]);
Note: See TracChangeset for help on using the changeset viewer.