private void createClassView( FileOutputStream fos, ModClass modClass ) throws Exception
    {
        String[] menus =modClass.getMenuPath().split( "/" );
        if( ( menus.length == 0 ) || menus[ 0 ].isEmpty() )
        {
            throw new Exception( "The class '" + modClass.getName() + "'menu Path with errors." );
        }
        // Create the menu entries
        // Search for the root menu. If doesnt exist yet create it.
        MenuItem rootMenu = MenuItem.searchMenuItem( menus[ 0 ].toLowerCase() );
        if( rootMenu == null )
        {
            rootMenu = new MenuItem( menus[ 0 ] );
            MenuItem.appendMenuItem( rootMenu );
        }
        MenuItem parentMenu = rootMenu;
        MenuItem menuItem = null;
        for( int index = 1; index < menus.length; index++ )
        {
            menuItem = MenuItem.searchMenuItem( menus[ index ].toLowerCase() );
            if( menuItem == null )
            {
                // Check if its the last menu entry that indicate it is the action menu 
                if( index == ( menus.length - 1 ) ) // It is the action 
                {
                    menuItem = new MenuItem( menus[ index ], "", parentMenu.getId(), "action_" + nameToId( modClass.getName() ).toLowerCase() );
                    MenuItem.appendMenuItem( menuItem );
                }
                else
                {
                    menuItem = new MenuItem( menus[ index ], parentMenu.getId() );
                    MenuItem.appendMenuItem( menuItem );
                }
            }
            parentMenu = menuItem;
        }
        if( menuItem == null )
        {
            menuItem = rootMenu;
            menuItem.setAction( "action_" + nameToId( modClass.getName() ).toLowerCase() );
        }
        
        String content = MODULE_VIEW_CLASS;
        content = content.replace( "{MODULE_VIEW_CLASS_NAME_ID}", nameToId( modClass.getName() ) );
        content = content.replace( "{MODULE_VIEW_CLASS_NAME}", modClass.getName() );
        content = content.replace( "{MODULE_VIEW_MENU_NAME}", menuItem.getName() );
        content = content.replace( "{MODULE_VIEW_CLASS_FORM}", getClassViewForm( modClass ) );
        content = content.replace( "{MODULE_VIEW_CLASS_TREE}", getClassViewTree( modClass ) );
        content = content.replace( "{MODULE_VIEW_CLASS_MODE}", getClassViewMode( modClass ) );
        fos.write( content.getBytes() );
    }