Select to view content in your preferred language

How to customize browse tree?

5031
9
09-22-2011 04:11 AM
FerencNagy
Emerging Contributor
How could i customize the browse catalog to show custom categories and search by 'keyword' in the meta xml?
0 Kudos
9 Replies
CliveReece
Esri Contributor
0 Kudos
FerencNagy
Emerging Contributor
Yes, i've seen this post. But this method just uses a predefined 'contentType'.
What i need to do is for example:

- have 3 running projects that has many files, mxds, shapes etc. (Project1, Project2, Project3)
- add a keyword 'project1' in the metadata for Project1 files and so on...
- in geoportal i create categories: Project1,Project2,...
- geoportal fits the metas in the appropriate category (based on the keyword)

Have you checked out this link?  http://sourceforge.net/apps/mediawiki/geoportal/index.php?title=Browse_Tree
0 Kudos
CliveReece
Esri Contributor
You can pretty much do any search in the Browse tree. (the tree is essentially a set of searches)

The tree structure is defined in a configuration file (browse-catalog.xml in ..\geoportal\WEB-INF\classes\gpt\search\browse).

Try this example which adds a 'Popular Tags' folder to the browse tree:   Insert the following right before </tree> in browse-catalog.xml:

<!-- Popular Tags -->
 <item>
  <name resourceKey="">Popular Tags</name>
  <query></query>
  <item>
   <name>service</name>
   <query>searchText=keywords%3Aservice</query>
  </item>
  <item>
   <name>livedata</name>
   <query>searchText=keywords%3Alivedata</query>
  </item>
  <item>
   <name>geographic boundaries</name>
   <query>searchText=keywords%3Ageographic+boundaries</query>
  </item>
  <item>
   <name>natural resources data</name>
   <query>searchText=keywords%3Anatural+resources+data</query>
  </item>
  <item>
   <name>land use data</name>
   <query>searchText=keywords%3Aland+use+data</query>
  </item>
 </item>
0 Kudos
FerencNagy
Emerging Contributor
Thanks. I've tried that, but no success 😞

I'm using ArcGIS Desktop 10 and Inspire theme for the metadata.
In the 'Overview' section, under 'Topics & Keywords' i've added 'project1' for all the possible fields.

Then i've edited the xml:

<!-- Popular Tags -->
 <item>
  <name resourceKey="">Projects</name>
  <query></query>
  <item>
   <name>Project1</name>
   <query>searchText=keywords%3Aproject1</query>
  </item>
 </item>


But not working...

You can pretty much do any search in the Browse tree. (the tree is essentially a set of searches)

The tree structure is defined in a configuration file (browse-catalog.xml in ..\geoportal\WEB-INF\classes\gpt\search\browse).

Try this example which adds a 'Popular Tags' folder to the browse tree:   Insert the following right before </tree> in browse-catalog.xml:
0 Kudos
CliveReece
Esri Contributor
By "not working", I'm not sure if you mean the browse tree code sample is not working or if the custom query that you are encoding in it is not working. 

Check if your query is giving the expected results first.  Try "keywords: project1" (remove the space after the colon ... stupid smilies) (the URL decode of "keywords%3Aproject1") in a basic search.  If it is not giving you the results you expect, then I would investigate that, rather than the Browse tree code.

Another line of troubleshooting is to take a valid search string and add it to your custom browse tree (URL-encoding it if needed).  Does the browse tree give the correct response?

A third line of troubleshooting would be to upload your XML metadata document containing "project1" to gptogc.esri.com.  Approve it for searching.  Wait a few minutes (to make sure indexing kicks in) and then try the "keywords:project1" search.
0 Kudos
FerencNagy
Emerging Contributor
thanks a lot, i've managed to categorize by keywords.
0 Kudos
JeffPickles
Deactivated User
This solved the issue I've been having, as well.

Is it possible to tweak the code here to browse by file author? Say, something like...
<query>searchText=source%3Aauthorname</query>
0 Kudos
CliveReece
Esri Contributor
Is it possible to tweak the code here to browse by file author? Say, something like...
<query>searchText=source%3Aauthorname</query>


Yes, but you will need to do some work in a couple of places.

First, you probably don't have "source" as an indexable yet. 

Next, after you set "source" as a custom indexable, try using it in a search in your geoportal using the "source:searchTerm" pattern (see http://sourceforge.net/apps/mediawiki/geoportal/index.php?title=Using_Lucene_Search_Text_Queries).

When are confident that your "source:searchTerm" search pattern is working, you can then use it for your custom browse configuration.

P.S. don't forget to URLencode your searches in the browse config (see http://meyerweb.com/eric/tools/dencoder/
0 Kudos
tonantzincamacho1
New Contributor
Hi Guys:
I need the keywords of the category of Geoportal carry an accent, but if I add  accents the category tree is not displayed. This is an example of what I add I need in the browse-catalog.xml ......
  <item>
<name resourceKey="catalog.mdCode.topic.boundaries"></name>
    <query>dataCategory=Límites</query>
         </item>
  <item>
           <name resourceKey="catalog.mdCode.topic.society"></name>
           <query>dataCategory=Población</query>
         </item>
Thanks
0 Kudos