organizer () documon/src/organizer.js 71
xpath documon.organizer
file documon/src/organizer.js

Organizes the parsed source-code data into a single object that takes the following form:

organ = {

    // There will always be a root node with an absolute ID of "root"
    id : "root",
    name : "root",
    file : "root.html",
    docfile : "root.html",

    packages : [

            { 
                packages : foo

                // Classes included in this package
                classes : [

                    {   
                        class : "foo"
                        methods : [],
                        properties : [],
                        events : []
                    },

                    ... etc ... 
                ],

                // Loose stuff found in this package
                methods : [],
                properties : [],
                events : []
            }

    ],

    // Independent classes that are not part of any package
    classes : [
        {   
            class : "foo"
            methods : [],
            properties : [],
            events : []
        }
        ... etc ... 
    ],

    // Loose stuff that's not part of any package or class, assumed to be accessible "this" (e.g. in javascript it would be the "window" scope)
    methods : [],
    properties : [],
    events : [],

};

All source code hangs off of the "root" node and is organized according it's relationship to a package or class.

This organizer is initialized prior to parsing source code, and as each file is parsed, it is added to the organizer. After all the source-code is finished parsing, the organizer wires up adn cross references inheritance.

Properties
flatClassList
documon/src/organizer.js100
Object

We maintain a "flat list" as a means to cross reference items that are stuffed into the main array.

mainConf
documon/src/organizer.js80
Object

A reference to the main configuration object. See documon.mainConf.

organ
documon/src/organizer.js85
Object

The primary object we store all data into.

sectionNames
documon/src/organizer.js106
Array

The complete list of sections a class or package can contain.

Tclass
documon/src/organizer.js95
Template

The class template processor (jst file).

Tpackage
documon/src/organizer.js90
Template

The package template processor (jst file).

Methods
add (VtaggedPage) documon/src/organizer.js 550

Adds source-code data to the organ. The data needs to be formated from the "tag.js" processor. By reading the data we determine where it is to be added to the main organ.

Parameters
VtaggedPage
type

Source-code data parse by the tag.js processor.

addToClassList (list, taggedPage) documon/src/organizer.js 522

Adds tagged data to a class array. Ensures this item is only addded once, and also place a refernce to the item in the flat list for future processing.

Parameters
list
type

The class array to add the item to.

taggedPage
type

The data to add.

addToPackageList (list, taggedPage) documon/src/organizer.js 480

Adds a new package to the main packages list. Creates a namespace (package) if not exist.

Parameters
list
type

The main package list to add the package to.

taggedPage
type

The package data.

appendPage (existingObj, newObj) documon/src/organizer.js 437

Adds a class or package to the class or package object.

Parameters
existingObj
type

The object ot add the thing to.

newObj
type

THe thing we're adding.

buildMenu () documon/src/organizer.js 632

Generates a copy of the main organ that is sorted alphabetically, suitable for use wiht menuBuilder

Returns type

description description

init (params) documon/src/organizer.js 309

Initializes the the "organ", which is an object that we'll be inserting all the tagged data into.

We'll also be grabbing the templates needed based on the location defined in the params.

Parameters
params
type

The configuration options sent in by the user during documon.mainConf. We keep a refence here so we know where to put things. Note that documon derives some additional properties onto the object.

params properties
templateFolder
type

The base path to the template folder.

merge (a, b, prop) documon/src/organizer.js 381

A classic array merge routine.

Parameters
a
array

The array that we will add items to if "prop"

b
array

The array we will merge into A if one of it's item[prop] doesn't exists in A.

prop
string

The property used to validate if items in B need to be merged into A.

Returns array

A new array containing all unique elements from A and B.

sortObj (obj, prop) documon/src/organizer.js 585

Sorts all main sections of an organ on a given key. By default sorting is conducted on the "id" key.

Parameters
obj
object

The object to sort

prop
string optional id

The key to sort on.