WebSphere Portal Server - Tips on where to start when using Model SPI in Portal 6

This is Interesting: Free IT Magazines  
Home > Archive > WebSphere Portal Server > June 2007 > Tips on where to start when using Model SPI in Portal 6





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Tips on where to start when using Model SPI in Portal 6
RuneH

2007-06-06, 1:23 pm

I have started on developing a theme which will be using a DHTML menu like for instance http://www.aspandjavascript.co.uk/j...rial_version_2/

To do this as I understand I won't be able to use the jsp-tags, since it seems to loop through level 1, then level 2 and so on. I need to start at my selected label, the loop through the first page and subpages, then the next page and subpages to be able
to create the javascript for the menu.

I've seen how it is done for the breadcrump menu (banner_crumbtrail.jspf), but I do not see how I can loop through the rest of the pages, the breadcrump only shows the current selection tree.

When writing this I looked at the SPI doc and had a look at the interface NavigationModelProvider. It seems to me that this is what I want to use, if I can figure out how to select only the limited set of pages in the hierarchy, not every page like the si
temap would do...

Any hints would be great :-)

R.
****************************************
**********
Rune Hellem http://hellem.org
Jessica Garcia-Glennie

2007-06-06, 1:23 pm

Hi, Rune,

Did you already see this article?

http://www.ibm.com/developerworks/w.../0612_behl.html

Jaye

Michael Harris

2007-06-06, 1:23 pm

If you look in sideNav.jsp, you will see that NavigationModel and
NavigationSelectionModel can be used together. I haven't tried your
particular case... but give this a shot:

Get both a NavigationModel and NavigationSelectionModel. Use the
NavigationSelectionModel.iterator() to get to the selected node just
like in banner_crumbtrail.jspf. Then use the
NavigationModel.getChildren(NavigationNode) api to get an iterator for
the children of the selected node. With this technique, you will need
to recursively call .getChildren() on each child node if you need to get
multiple levels of children.
RuneH

2007-06-06, 7:22 pm

Tnx, will try that tomorrow!

R.
****************************************
**********
Rune Hellem http://hellem.org
RuneH

2007-06-06, 7:22 pm

Could not wait, had to check it out tonight...

Pseudocode:

Get selectionmodel
Iterate to where I want to start (not content root, by "my root")
Get the node
Get the nodes children by using navigationModel and NavigationModelProvider
Iterate through all nodes
For each node, check if the node has children
If children, iterate through all the children.

So, it worked :-)

R.
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com