Re: [greenstone-devel] Not recommended for general audiences! (Was: missing metadata informat results)

From Michael Dewsnip
DateTue, 14 Oct 2003 12:02:36 +1300
Subject Re: [greenstone-devel] Not recommended for general audiences! (Was: missing metadata informat results)
In-Reply-To (3F8B2E5A-B3C9DDB9-cs-waikato-ac-nz)
Hi again,

Sorry, these seem to be resolved during importing, rather than by the
classifiers.

Cheers,

Michael

> Hi Stefan,
>
> I tried this, actually, and it didn't work. There seems to be code in the
> classifiers to remove HTML entities from classifier node titles.
>
> Cheers,
>
> Michael
>
> Stefan Boddie wrote:
>
> > Hi,
> >
> > I haven't been following this thread very closely but is part of the problem
> > that you can't display values surrounded by square brackets? If you want to
> > display a metadata value like [1910] without it being treated as a format
> > statement you could use html entities instead of the raw '[' and ']'
> > characters. That is, set your metadata to "[1910]", instead of
> > "[1910]".
> >
> > Stefan.
> >
> > ----- Original Message -----
> > From: "Michael Dewsnip" <mdewsnip@cs.waikato.ac.nz>
> > To: <Stephen.DeGabrielle@cdu.edu.au>;
> > <greenstone-devel@list.scms.waikato.ac.nz>
> > Sent: Tuesday, October 14, 2003 11:32 AM
> > Subject: [greenstone-devel] Not recommended for general audiences! (Was:
> > missing metadata informat results)
> >
> > > Hi Stephen,
> > >
> > > The following solution to your problem is, I believe, technically known as
> > a
> > > "big gross hairy old hack". And therefore, not recommended for the
> > purists, the
> > > weak of heart, or our younger viewers.
> > >
> > > The underlying cause of the problem goes right into the core of the C++
> > > receptionist code, and I don't really have the time nor the inclination to
> > get
> > > my hands that dirty.
> > >
> > > Luckily, part of the problem is at the building/classifier level, which we
> > can
> > > hack a fix into easily. In your original e-mail you cut out the metadata
> > > associated with a document from the GDB file:
> > >
> > > [HASH01ea77c0a9947c3c85f58bcc]
> > > <dc.Date>\\[1910\\]
> > >
> > > Looking at the information for a classifier node, I think you'll find
> > something
> > > like:
> > >
> > > [CL1.1]
> > > <Title>\[1910\]
> > >
> > > (with some other stuff, of course). The problem is that during the
> > building
> > > process these two values have been escaped differently.
> > >
> > > This can be fixed at the classifier level (warning: hack follows!). If you
> > open
> > > up AZCompactList.pm, at about line 285 there is:
> > >
> > > my $metavalue;
> > > foreach $metavalue (@$metavalues)
> > > {
> > >
> > > Add these two lines just after:
> > >
> > > $metavalue =~ s/\\\[/\\\\\[/g;
> > > $metavalue =~ s/\\\]/\\\\\]/g;
> > >
> > > This replaces all "\]" with "\\]", effectively escaping the brackets once
> > more
> > > (to be consistent with what is in the documents). After rebuilding your
> > > collection, the classifier nodes should now display properly, both when
> > open and
> > > closed.
> > >
> > > (This doesn't fix the underlying problem of different display behaviour in
> > the
> > > C++ code depending on whether the classifier nodes are open or closed, it
> > just
> > > gets around it).
> > >
> > > Rest assured, classifiers are a lot nicer in Greenstone 3...
> > >
> > > Hope this helps,
> > >
> > > Michael
> > >
> > >
> > >
> > >
> > > > Hi Stephen,
> > > >
> > > > This turns out to be very subtle. I've tracked this down, but I'm going
> > to
> > > > need to think about it for a while longer before knowing the best way to
> > fix
> > > > it.
> > > >
> > > > (What follows doesn't directly affect your problem, and I suspect you
> > know
> > > > this already, but it is worth pointing out anyway).
> > > >
> > > > An important point to remember when using classifiers and format
> > statements
> > > > is the difference between document nodes and classifier nodes. Document
> > nodes
> > > > link to the documents in your collection, which have metadata.
> > Therefore, you
> > > > can specify things like [dc.Date] and [dc.Title] (or whatever) in your
> > format
> > > > statements.
> > > >
> > > > Classifier nodes, on the other hand, are created by the classifier to
> > build
> > > > up the browsing structure. These may contain multiple children, some of
> > which
> > > > may be document nodes. But, these nodes contain very little metadata -
> > only
> > > > that added by the classifier (most commonly Title, which I have to say I
> > > > think is a terrible name and always confuses me... something like Label
> > would
> > > > have been much better). Therefore, saying {If}{[numleafdocs],
> > > > <strong>[link][Title][dc.Date][/link]</strong>} is "invalid" in this
> > > > situation, because [dc.Date] will never evaluate to anything (the
> > classifier
> > > > node doesn't know anything about the metadata of the documents it
> > contains).
> > > >
> > > > I hope to get back to you tomorrow with a fix to the C++ code.
> > > >
> > > > Regards,
> > > >
> > > > Michael
> > > >
> > > > Stephen.DeGabrielle@cdu.edu.au wrote:
> > > >
> > > > > Hi,
> > > > >
> > > > > I have a metadata field [dc.date] with a value '[1910]'. It includes
> > the
> > > > > square brackets, as the date is not from the item itself, but from the
> > > > > caltaloguer (as per AACR2 rules)
> > > > >
> > > > > Weirdly the [1910] won't appear in the browse list (AZCompactList),
> > but
> > > > > appears in the group head expanded. (It comes through as [Title] for
> > the
> > > > > head, and works fine for each item (as [dc.Date]).
> > > > >
> > > > > I'm stumped. Any idea what is going on? or how I can fix it?
> > > > >
> > > > > Stephen
> > > > >
> > > > > -images attached-
> > > > >
> > > > > --config.cfg-lines-
> > > > > classify AZCompactList -metadata dc.Date -mingroup
> > 1 -buttonname
> > > > > Year
> > > > >
> > > > > format CL3VList '<td valign=top>[link][icon][/link] {If}
> > > > > {[numleafdocs],<strong>[link][Title][dc.Date][/link]</strong>,
> > > > > [dc.Title] by [dc.Creator] [dc.Date]}</td>'
> > > > >
> > > > > --snip--
> > > > > [HASH01ea77c0a9947c3c85f58bcc]
> > > > > <doctype>doc
> > > > > <hastxt>1
> > > > > <Language>pt
> > > > > <Encoding>utf8
> > > > > <Source>3556956.pdf
> > > > > <dc.Title>A mao d'Obra em timor.
> > > > > <ar.Resolution>600dpi
> > > > > <dc.Creator>\\[J G Montalvo e Silva\\]
> > > > > <ar.Creator>Stephen De Gabrielle
> > > > > <ar.CallNumber>RBC 959.86 SILV
> > > > > <ar.Barcode>3556956
> > > > > <dc.Date>\\[1910\\]
> > > > > <dc.Subject>\\[Timor Timur\\]
> > > > > <Title>/home/sdegabrielle/myhome/arada/gsdl/collect/etimor/tmp/3556956
> > > > > <GENERATOR>pdftohtml 0.34
> > > > > <URL>http://3556956.html
> > > > > <srclink><a href="_httpcollection_/index/assoc/[archivedir]/doc.pdf">
> > > > > <srcicon>_iconpdf_
> > > > > </srclink></a>
> > > > > <assocfilepath>HASH01ea.dir
> > > > > <archivedir>HASH01ea.dir
> > > > > <thistype>Paged
> > > > > <docnum>12
> > > > > --------
> > > > >
> > > > > ________________________________________________
> > > > > Stephen De Gabrielle
> > > > > Digitisation Officer
> > > > > AraDA Project
> > > > >
> > > > > Northern Territory University Library
> > > > > http://www.ntu.edu.au/library
> > > > > Tel: (08) 8946 7009 from overseas: 61 8 8946 7009
> > > > > Postal address: P.O.Box 41246, Casuarina, NT, 0811, Australia
> > > > > CRICOS Provider No: 00300K
> > > > >
> > > >
> > ------------------------------------------------------------------------
> > > > > Name: expanded.gif
> > > > > expanded.gif Type: GIF Image (image/gif)
> > > > > Encoding: base64
> > > > >
> > > > > Name: unexpanded.gif
> > > > > unexpanded.gif Type: GIF Image (image/gif)
> > > > > Encoding: base64
> > > > >
> > > >
> > ------------------------------------------------------------------------
> > > > > _______________________________________________
> > > > > greenstone-devel mailing list
> > > > > greenstone-devel@list.scms.waikato.ac.nz
> > > > > https://list.scms.waikato.ac.nz/mailman/listinfo/greenstone-devel
> > > >
> > > > _______________________________________________
> > > > greenstone-devel mailing list
> > > > greenstone-devel@list.scms.waikato.ac.nz
> > > > https://list.scms.waikato.ac.nz/mailman/listinfo/greenstone-devel
> > >
> >
> > ----------------------------------------------------------------------------
> > ----
> >
> > > _______________________________________________
> > > greenstone-devel mailing list
> > > greenstone-devel@list.scms.waikato.ac.nz
> > > https://list.scms.waikato.ac.nz/mailman/listinfo/greenstone-devel
> > >