!! Namespace Index Plugin

-- v1, July 2005, [DF|DirkFrederickx] \\
-- v2, with improved formatting - ref suggestion by Adler, Sep 2006, [DF|DirkFrederickx]\\
-- __This page is obsolete!__ The  ~NamespaceIndexPlugin is now included in NamespacePlugin, as a single package --[DF|DirkFrederickx], Aug 12, 2007.

Due to the absence of a hierarchical folder concept in JSPWiki, I am using extensively a dot syntax to group related pages together. (similar to the java package concept) Therefore, I needed a way to generate Index pages of a subset of wiki pages, based on a certain Namespace or page prefix.
{{{
   Zoo
   Zoo.Birds
   Zoo.Birds.Flamingo
   Zoo.Birds.Stork
}}}
For example, this plugin allows to generate an alphabetical index of all pages of the {{Zoo.Birds}} namespace.
It would list all pages matching a certain Namespace, or page prefix, in alphabetical order. 
The links are displayed relative to the namespace base. 
Have a look at the [PageIndex] if you don't know how an index of pages looks like. 
The plugin implementation is based on the [IndexPlugin]

Related plugin: [NamespacePlugin], [IndexPlugin]

! Usage

The plugin has the similar parameters as the base JSPWiki [IndexPlugin],
including the undocumented arguments ''exclude'' and ''include''. 
Addditionally, the ''namespace'' parameter defines the prefix to be processed.
{{{

 [{brushed.jspwiki.namespaceplugin.NamespaceIndexPlugin }]
 [{NamespaceIndexPlugin }]
 [{NamespaceIndexPlugin namespace='UC'  }]
 [{NamespaceIndexPlugin namespace='UC' exclude='Sandbox' itemsPerLine='1' }]

}}}
Parameters:
* __namespace__ : Optional root page of the namespace. 
  All listed pages share the same namespace prefix.
* __include__ : Optional regular expression which specifies which pages to include. Optional.
   When a namespace prefix is specified, the plugin automatically includes only all prefixed pages.
   If needed, this parameter allows you to specify additional include rules.
* __exclude__ : Optional regular expression which specifies which pages to exclude.
* __itemsPerLine__ : n. Break every 'n' items on line. Optional, default value is zero.
* __delimiter__: Delimiting characters used to breakup the namespace. Default is a dot (.)

! Installation notes

Add following entry to your {{WEB-INF/jspwiki.properties}} file when you want to use the short plugin name. 
Make sure you don't leave any spaces at the end of the property definition.
{{{
jspwiki.plugin.searchPath = brushed.jspwiki.namespaceindexplugin,<other class paths>
}}}
Copy the {{Namespace.jar}} to the {{WEB-INF/lib}} directory.

This jar contains 2 plugins: [NamespaceIndexPlugin] and [Namespace|NamespacePlugin] )

Finally, restart (or reload) your web-server.



!Suggestions

- instead of creating a very formalised index (list of letters, etc), there could be an option to just do a simple list. For instance if the name space is Zoo, we would get a list with a title Zoo and then the animals:
__Zoo__

* Birds
** Flamingo
** Pelican
* Mamals
** Cow
** Cat

--[Adler]

;: That's an excellent suggestion. Indeed, it make sense for hierarchical namespaces to be able to generate this tree like structure.  Would you see this as a mixture then, of an alphabetic tree  and a hierarchtical tree ? (this is not clear from your example where I would expect ''cow'' and ''cat'' in the opposite order)  --[DF|DirkFrederickx]

;: indeed, sure! IMO, it should be alphabetic order. In my example I was just concerned with the organisation and forgot about the order, I'm sorry. (the other items were just luckly in order :) --[Adler]

- or, especially when you have a quite small number of pages, this could be enough (and saves a lot of space in your page)
* Birds: Flamingo, Pelican,...
* Mamals: Cat, Cow,...

;:Plugin has been updated: The output now contains an alpabetic list of all ''branches'' of the namespace, listing per branch all ''contained'' sub-pages.

!! Limiting depth
What about limiting the depth? So, if I say {{ ~[{NamespaceIndexPlugin depth=1 }] I would see just:
* Birds
* Mamals