MySQL
  Home arrow MySQL arrow Page 2 - Data Management Made Easy Using Nenniu...
Dev Shed Forums 
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Sun Developer Network 
Dedicated Servers 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Moblin 
JMSL Numerical Library 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
MYSQL

Data Management Made Easy Using Nennius: Creating a Web Application
By: Brian Vaughn
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 10
    2005-07-27

    Table of Contents:
  • Data Management Made Easy Using Nennius: Creating a Web Application
  • Configuring a Web Application and Defining Its Menu
  • Creating SQL Tables
  • Creating a Nennius Component, Defining the Entry-Point, and the Descriptor File
  • The Component File

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Data Management Made Easy Using Nennius: Creating a Web Application - Configuring a Web Application and Defining Its Menu


    (Page 2 of 5 )

    Configuring an Web Application

    For the purposes of our example application, our default configuration file will contain the following:

    <?php
    # name of application
    $GLOBALS['nennius_application_name']  = 'News Manager';

    # absolute path to current application on web server
    $GLOBALS['nennius_application_path']  = '/nennius_server_path/webapps/news/';

    # absolute URL to current application
    $GLOBALS['nennius_application_url']   = 'http://www.corporatewebsite.com/nennius/webapps/news/';

    # Nennius database connection variables - configure to match your SQL setup
    $GLOBALS['nennius_db_type']           = 'mysql';     # ex. 'mysql', 'postgresql', 'oracle'

    $GLOBALS['nennius_db_ip']             = 'localhost';
    $GLOBALS['nennius_db_user']           = 'user';
    $GLOBALS['nennius_db_pass']           = 'pass';
    $GLOBALS['nennius_db_name']           = 'news';
    ?>

    Defining an Application’s Menu

    The next step in creating a Nennius application is defining a menu structure. The menu configuration file ('config.menu.php’) contains two basic variables. The first, $nennius_menu_array, is an array specifying menu category names as keys, which in turn hold child arrays containing menu options for the category in question. Put another way each menu link is a self-describing array, contained by a larger array holding similarly grouped items, which is itself contained by yet another array – $nennius_menu_array.

    For the purposes of our sample application, we will create one menu category, "Admin Options", and 2 menu options: “Manage Releases” and “Corporate Website”. Example code for doing this is provided below:

    <?php
    # include config_defaults file for threshold values

    # NOTE: ignore a failed include for the purposes of the admin GUI

    @ include_once '../../config.defaults.php';

    # intiialize nennius menu array
    $nennius_menu_array    = NULL;

    # Manage Releases - links to Nennius page for adding & removing news releases
    $admin_options_array[]         = ( array(     'menu_display_name'    => 'Manage Releases',
                                          'menu_hyperlink'       => 'index.php',
                                          'menu_threshold'       => $GLOBALS['ADMIN'] ) );

    # Corporate Website - links to external corporate website to view changes in realtime
    $admin_options_array[] = ( array(     'menu_display_name'    => 'Corporate Website',
                                          'menu_hyperlink'       => 'http://www.corporatewebsite.com/news.php',
                                          'menu_threshold'       => $GLOBALS['PUBLIC'] ) );
                                         
    # add all menus to nennius menu array

    $nennius_menu_array['Nennius Menu']   = $admin_options_array;

    # globalize nennius menu array for access by Display Template
    $GLOBALS['nennius_menu_array']        = $nennius_menu_array;
    ?>

    As you can see, each menu item contains several attributes: display name, hyperlink, and threshold. Perhaps the only one of these attributes that may not be self-explanatory upon first examination is the threshold. Nennius allows for 6 basic threshold levels: PUBLIC, CLIENT, USER, REVIEWER, MANAGER, and ADMIN. Every user is assigned a level, and in turn those levels are used to determine what content a user has access to as well as what operations a user may pform on specific content. For purposes of the menu configuration, a threshold level defines the minimum threshold required for a user to view a menu link. In our example above, any user (even one who has not yet logged in) will be able to view the "Corporate Website" link, but only ADMIN users will be able to view the link entitled "Manage Releases".

    That's it. We've now defined a basic menu for our 'news' web app. (Note: Nennius will automatically generate 'login' and 'logout' menu options as well when appropriate.)

    More MySQL Articles
    More By Brian Vaughn


       · Again, thank you for reading through this article. I hope that part two of this...
     

       

    MYSQL ARTICLES

    - Take Some Load off MySQL with MemCached
    - MySQL Table Prefix Changer Tool in PHP
    - Using the SIGNAL Statement for Error Handling
    - Error Handling Examples
    - Error Handling
    - Completing a Search Engine with MySQL and PH...
    - Paginating Result Sets for a Search Engine B...
    - Building a Search Engine with MySQL and PHP 5
    - Using Boolean Operators for Full Text and Bo...
    - PHP, MySQL and the PEAR Database
    - Working with PHP and MySQL
    - Getting PHP to Talk to MySQL
    - Creating an RSS Reader: the Reader
    - MySQL Security Overview
    - Creating the Admin Script for a PHP/MySQL Bl...





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway