Re: [greenstone-users] Page turn and go to page capabilities

From Katherine Don
DateWed, 19 Jan 2005 13:52:46 +1300
Subject Re: [greenstone-users] Page turn and go to page capabilities
In-Reply-To (41EC1092-6020903-ubcic-bc-ca)
Hi Jenn

Greenstone does this for you automatically if the sections of your
documents are titled 1, 2, 3... (numbers, not letters) and they are a
linear list.
Eg, if you have pdfs which are separated into sections, one per page,
then this happens for them.

During building, documents that meet this criteria are labelled as paged
documents in the database. You can force this to happen by setting
"gsdlthistype" metadata to "Paged" during import. I am not sure if
putting this in metadata.xml files is enough.
I have done this in PagedImgPlug -
$doc_obj->set_utf8_metadata_element ($topsection, "gsdlthistype",

the relevant section in the building code is in
perllib/mg(pp), sub get_document_type.

If you just have some documents that you want to be paged, you could
modify plugins to set gsdlthistype to Paged. you will need to reimport
and rebuild.
If you want all your documents like that, the easiest way is probably to
modify the get_document_type function to always return paged. eg

sub get_document_type {
my $self = shift (@_);
my ($doc_obj) = @_;

my $thistype = "";
my $childtype = "Paged";
if ($doc_obj->get_text_length ($doc_obj->get_top_section())) {
$thistype = "Paged";
} else {
$thistype = "Invisible";

return ($thistype, $childtype);

Then you just need to rebuild the gdbm database: -mode infodb <collname>
copy collect/collname/building/text/collname.ldb to

Note the extra stuff determines whether to display the enclosing section
or not.
Noe also that this will not work properly if you have nested sections.
There can only be one level of sections inside the enclosing document

does this make sense? I hope its not too confusing.

Katherine Don

Jenn Cole wrote:
> Hello,
> I have searched your e-mail list archives for an answer to this question
> but have been unable to find an answer that works for me. If anyone had
> code for the following I would appreciate it.
> I have a collection of textual documents, I would like to know how I can:
> 1. Instead of a table of contents listing all of my pages, have a "go to
> page x" functionality, while keeping the expand text box on the screen.
> I have found references to PageId, but not quite sure how to set it up.
> Thanks,
> Jenn Cole
> UBCIC Library Technician
> _______________________________________________
> greenstone-users mailing list