Announcement Announcement Module
No announcement yet.
Addon: Manage navigation menu with gvNIX 0.8.1 Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Addon: Manage navigation menu with gvNIX 0.8.1

    Add-on to manage application structure from Roo shell.

    The bundle symbolic name for this add-on is . To install it, read the installation guide.


    I've always liked how easy CMS manages the structure of a site. Really, it is easy to provide a basic site structure management based on managing menu entries because at the end, the menu is what the user see and it symbolizes the application structure.

    Add pages to a Roo-based application is easy to do, Roo provides several commands that will create pages automatically. Then use gvNIX menu addon to organize them: nest pages as deeply as you wish, move a page as sub-page under any other page or category, later decide you don't like the order of your pages, you can move them to put them in whatever order you want.
    Imho, the 4 gems that this add-on includes are:
    • Manage menu labels and messages from Roo shell.
    • Hide/show menu entries, will let you to create your own basic flows.
    • Grant page access to roles from Roo shell.
    • Separation of concerns: Application structure model vs Application structure visualization.
    Some enterprises centralize applications structure and authorization roles for easier management. Spliting the model from visualization will give our projects the ability to change where the model is, rendering it as expected.

    Menu management in Pet clinic

    Create a new directory for the project

    Bash shell:
    mkdir clinic
    cd clinic
    Start gvNIX:
          ____  ____  ____  
         / __ \/ __ \/ __ \ 
        / /_/ / / / / / / / 
       / _, _/ /_/ / /_/ /   X.X.X.RELEASE [rev xxxxxxx]
      /_/ |_|\____/\____/   gvNIX distribution X.X.X
      Welcome to Spring Roo. For assistance press TAB or type "hint" then hit ENTER.
    Create the project

    roo> script clinic.roo
    Setup menu management: install dependencies, create menu model and load initial menu data structure from menu.jspx.

    roo> menu setup
    Create a new menu category to contain all finders:

      roo> // Create a category to contain application finders
      roo> menu entry add --label Finders
      roo> // Change default ID to Category_ID
      roo> menu entry update --id i_page_finders --nid c_finders
      roo> // Move to root level
      roo> menu entry move --id c_finders --before c_seleniumtests
      roo> // Move finders to new finders category
      roo> menu entry move --id fi_pet_nameandweight --into c_finders
      roo> menu entry move --id fi_pet_sendremindersandweightlessthan --into c_finders
      roo> menu entry move --id fi_pet_owner --into c_finders
      roo> menu entry move --id fi_pet_typeandnamelike --into c_finders
      roo> menu entry move --id fi_visit_descriptionandvisitdate --into c_finders
      roo> menu entry move --id fi_visit_descriptionlike --into c_finders
      roo> menu entry move --id fi_visit_visitdatebetween --into c_finders
    Run mvn tomcat:run in the root of your project and the new application structure should be available under the URL http://localhost:8080/petclinic/

    More info at:

    - English:
    - Spanish:
    Last edited by mmartinez; Nov 17th, 2011, 01:48 AM.