Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 333126

Summary: Snaps for submenu with Snap-ContextPath
Product: [RT] Virgo Reporter: Gary Lee <jakarta99>
Component: snapsAssignee: Project Inbox <virgo-inbox>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3 CC: dmarthaler, dmitry, eclipse, glyn.normington, k2eric
Version: unspecifiedKeywords: helpwanted
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Gary Lee CLA 2010-12-22 20:55:38 EST
Build Identifier: 

if we want to make the menu-structure in snap web-application, now, it support *ONLY* one-level menus. However, we usually need the hierarchy of menus, i think that we can use Snap-ContextPath to decide the hierarchy of menus. 

for example.
Snap-ContextPath:/cat
Snap-ContextPath:/cat/cat1
Snap-ContextPath:/cat/cat2
Snap-ContextPath:/dog
Snap-ContextPath:/dog/dog1

and in jsp, we can generate the menu-structures with snapsTree attributes.

I have a sample codes in http://www.eclipse.org/forums/index.php?t=msg&th=201754&start=0&S=2e545c93991a8f62080721829bd62aa2

Reproducible: Always
Comment 1 Chris Frost CLA 2011-07-25 06:31:10 EDT
Hi, 

Thanks for raising the issue, I realize it's been here quite a while so just to update yourself. Snaps is no longer a prototype and will be released alongside Virgo 3.0. This Enhancement will be considered for the following release, I think it's a good one to have as it will force Snaps to deal with snaps nested more than one level deep and a generic solution will give people more flexibility beyond nested menus.

Chris.
Comment 2 Chris Frost CLA 2011-09-30 12:06:13 EDT
Gary,

I've done some work on this and wanted you opinion. I see two options, we either support snaps with more than one path element in their context path as you have suggested or we support nested snaps. So in your case you would attach the cat1 and cat2 snaps to the cat snap as their host making them grandchildren of the top level host. I don't want to support both as there is too much potential for multiple snaps being about to respond to a request and there isn't a logical way to decide which snap would take priority. If we go with the grandchild approach we would place a ban on snaps with more than one path element in their context path. I prefer this approach but wanted to give you the chance to argue with me.

Chris.
Comment 3 Eric Hough CLA 2011-10-01 20:53:26 EDT
My vote (FWIW) is also to go with the grandchild approach. Limit snaps to a single path element in their Snap-ContextPath, but allow the snap to attach itself to either a "regular" host or another Snap with the host filters set up.
Comment 4 Glyn Normington CLA 2011-11-23 10:34:24 EST
Note that the snaps user guide refers to grandchildren in the concepts section, so we should probably add a known issue to that guide pointing at this bug.