Re: [greenstone-users] about search and scipts.

From PaingThu Chit
DateThu, 19 Apr 2007 10:41:19 +0800
Subject Re: [greenstone-users] about search and scipts.
In-Reply-To (4626C85C-2050009-dlconsulting-co-nz)
Hi Richard,
 
   Thanks alot for acknowledging me. I will try it out.Thanks again for ur kindness.
Here is my one more question pls.For my bookshelf lvl, I want to show the item counts
like [numleafdocs]-1 for some reasons ? I tried [numleafdocs]-1 and [numleafdocs-1] but not working.
Examples I have 11 items in one bookshelf but one is not needed to show. Is it possible ?
 
With best regards,
    Paing


 
On 4/19/07, Richard Managh <richard@dlconsulting.co.nz> wrote:
Hi Paing,

Although your collection is an images collection, from greenstones point of view, your images are treated as documents. As such, the DocumentText formatstring applies to each image "document".

Try putting your format into the DocumentText format string, you could add something like
<img src='/gsdl/collect/gsarch/index/assoc/[assocfilepath]/[Image]'> to the format somewhere to display your image on that page also.

The formatstring DocumentText is what is displayed on a document page in a collection. You know a document page is being displayed an any given point because in the url, there will be "a=d" and "d=<something>" which generally means greenstones document action has been asked to display a document. It is this meaning of the word document that applies to your image "documents".

Regards,

Richard.


PaingThu Chit wrote:
Hi Richard,
 
no. I havnt ...
my collection is Images collection. I dun have documents. I used metadata to show the information.
Is Document Text formatstring use for document?Thanks for the help.
 
With regards,
  Paing
 
On 4/19/07, Richard Managh <richard@dlconsulting.co.nz > wrote:
Hi PaingThu,

Did you try putting your format in the DocumentText formatstring for your collection in the GLI?
 
 

Regards,

Richard.
-- 
DL Consulting
Greenstone Digital Library and Digitisation Specialists
contact@dlconsulting.com
www.dlconsulting.com


PaingThu Chit wrote:
Hello,.. I still cannot put my metadata info on blank page .. Could u pls help me more ???
 
Here is my format I want to put on new page
 

<table style="font-size:12">
<td width=335 align=left valign=top><b>[link][POI.Title][/link]</b> ([POI.Category]) </td>
</table>

<table>
<td valign=top align=center width=150>[ex.srclink]{Or}{[ex.thumbicon],[ex.srcicon]}[ex./srclink]</td>
<td align=left valign=top>
<table border=0 width=435 cellpadding=2 cellspacing=0>
<tr>
<td width=20 align=left valign=top><b>Location:</b></td>
<td width=335 align=left valign=top>[POI.Zone^Address]<br>[POI.Zone^PostalCode]</td>
</tr>
<tr>
<td width=20 align=left valign=top><b>OpeningHours:</b></td>
{If}{[POI.OpeningHours],
<td width=335 align=left valign=top>[POI.OpeningHours]</td>
}
</tr>

<tr>
<td width=20 align=left valign=top><b>Tel:</b></td>
{If}{[POI.Tel],
<td width=335 align=left valign=top>[sibling(All:';'):POI.Tel]</td>}
</tr>
<tr>
{If}{[POI.WebAddress],
<td width=20 align=left valign=top><b>Web Address:</b></td>
<td width=335 align=left valign=top>[POI.WebAddress]</td>
}
</tr>
<tr>
{If}{[POI.Cuisine],
<td width=20 align=left valign=top><b>Cuisine:</b></td>
<td width=335 align=left valign=top>[sibling(All:';'):POI.Cuisine]</td>}
</tr>
</table>
</td>
</table>
<tr><td colspan=3><hr align=center size=1 noshade></td>
</tr>

Thanks in advance

With best regards,
    Paing
 
On 4/4/07, Richard Managh <richard@dlconsulting.co.nz > wrote:
Hi PaingThu Chit,

For your first question look under Collection-specific formatting options on this page
http://greenstone.sourceforge.net/wiki/index.php/How_to_format_the_output of your_collection

There is a DocumentText formatstring, that you can modify to display your desired metadata when a person clicks on a link.

You might add metadata to it like [title] or [location] in some html structure, with whichever metadata names you have. (this is assuming you actually have [title] and [location] metadata, of course the names of your metadata items might be different.

If you meant that you want the links to open a new window, or tab in a users browser, you would need to modify the relevant format statement for the vertical list that is being displayed.

In this case, the vertical list in question might be Vlist (the default format statement for all vertical lists in a collection) or CL1VList (the more specific Vlist for first classifier defined in your collections collect.cfg file) or SearchVList. You would alter this either in the GLI or directly in your collect.cfg file.

You could add an <a> tag to the format statement, something like <a href="[href]" target="_blank">[title]</a> to ask the browser to open a new window when the user clicks on the links.  Notice that this link makes use of various formatstring items on the wiki page mentioned above. Note also you can display any item of metadata for the current document being displayed in a vertical list format statement by adding [metadata_name]. Obviously you replace the text "metadata_name" with the name of the metadata item you want to display.
(See http://www.w3schools.com/tags/tag_a.asp for more options for the html a tag's target attribute.)


To answer your search form question I did the following search using google.

site:greenstone.sourceforge.net "search form" normal advanced

It revealed the following text:

Using fielded searching

  1. Collections built with MGPP (the default indexer) provide the option of fielded searching. In the browser, go to the PREFERENCES page. You will notice that there is a Query style: option which enables you to switch between "normal" and "fielded" search. Change to fielded search now and click on the Search button. The search form has changed to a fielded form.
  1. You can specify which search form types are available for a particular collection, and which one is the default, using the SearchTypes format statement. In the Format panel select Format Features from the left-hand list. Select the SearchTypes format statement from the list of assigned formats, and set the contents to form. This will make only fielded searching available for this collection.

    Search type options include form and plain. You can specify one or both separated by a comma. If both are specified, the first one is used as the default: this is the one that the user will see when they first enter the collection.

Preview the collection again. Notice that the collection's home page no longer includes a query box. (This is because the search form is too big to fit here nicely.) To search, you have to click Search in the navigation bar. Note that the PREFERENCES page has changed so that the "normal" query style is no longer offered.

on this page.

http://greenstone.sourceforge.net/wiki/gsdoc/tutorial/en/all_tutorials.html

This may not be exactly what you needed, but hopefully it helps.


Regards,


Richard.
-- 
DL Consulting
Greenstone Digital Library and Digitisation Specialists
contact@dlconsulting.com
www.dlconsulting.com



PaingThu Chit wrote:
Hello Richard,
thanks alot for ur help.
I think I have to explain some more. I m doing the collection on tourism information.
when we do searching, we got a list of items that match input criteria. And then when we click on
the link, it will show the doc related to that link. For me, my collection have only images with metadata
set which stored all the necessary information. So when user click on the link, I want to open new page
and show the formated metadata. I think its like shopping cart search result and detail page. I dun have docs to display so I want to open new page and display the metadata information.
 
I have one more question. Some collections have 2 search forms. normal and  advance. would u pls
guide me how to do that?
 
with best regards,
  Paing
 
On 3/29/07, Richard Managh <richard@dlconsulting.co.nz> wrote:
Hi PaingThu Chit,


You can use fielded searching for this. Add something like the following to your collect.cfg file:

buildtype       mgpp
If you already have the "buildtype mg" line, you need to change it to "buildtype mgpp" or "buildtype lucene" to support fielded searching

indexes         allfields text title description location
For mgpp, you need to specify the fields you want to search on.

levels          section document
You need to specify the granularity of the created indexes.

searchtype      form plain
This tells greenstone to display the fielded searching form by default on the search page.


That should cover questions 1 and 2. As for question 3, I'm not sure what you mean.


Hope this helps,

Richard.
-- 
DL Consulting
Greenstone Digital Library and Digitisation Specialists
contact@dlconsulting.com
www.dlconsulting.com

PaingThu Chit wrote:
hello all,
 
  I have some questions to asks.. These are:
 
1. I want to do the searching by  2 criteria .. like results must be like this and and must not be like that.
2. how am i support to change the condition type like OR, AND or NOT OR in my search page.
3. in my search page I show some general info such as title, description,location. and when I click on the title
   I want to open new pages with the detail metadata of the title.
 
Note: I dun have any documents like html, words or pdf. I only have images with metadata. so I want to populate the metadata on greenstone interface without using documents. I tried and still no idea how to do those. So pls guide me how to do those things.
Thanks in advance.
 
with best regards
  Paing.
 
_______________________________________________
greenstone-users mailing list
greenstone-users@list.scms.waikato.ac.nz
https://list.scms.waikato.ac.nz/mailman/listinfo/greenstone-users
  



_______________________________________________
greenstone-users mailing list
greenstone-users@list.scms.waikato.ac.nz
https://list.scms.waikato.ac.nz/mailman/listinfo/greenstone-users





_______________________________________________
greenstone-users mailing list
greenstone-users@list.scms.waikato.ac.nz
https://list.scms.waikato.ac.nz/mailman/listinfo/greenstone-users




-- 
DL Consulting
Greenstone Digital Library and Digitisation Specialists
contact@dlconsulting.com
www.dlconsulting.com

_______________________________________________
greenstone-users mailing list
greenstone-users@list.scms.waikato.ac.nz
https://list.scms.waikato.ac.nz/mailman/listinfo/greenstone-users