       ToolLoader @dashboardModel, @createDashboardView
     return @dashboardModel
 
+  createTools: (tools, dataSource, settings=null) ->
+    _.each(tools, (toolType, index) ->
+      tool = 
+        tool_type: toolType
+        name: "#{toolType}-#{index}"
+        data_source: dataSource
+      tool.settings = settings if settings?)
+
+  createDashboard: (name, tools, project=null) ->
+    new DashboardModel
+      name: name
+      project: (project or Manager.get('project'))
+      tools: tools
+
   createDashboardFromZooid: (name, zooid, settings) ->
     params = [ {key: 'id', val: zooid} ]
 

    unless @savedListView? 
      @savedListView = new SavedList 
        collection: User.current.dashboards
    @appFocusView = @savedListView
    @render()
    User.current.getDashboards()

  showMyData: =>
    unless @myDataView? then @myDataView = new MyData
    @myDataView.loadCollections()
    @appFocusView = @myDataView
    @render()

  navigateToDashboard: (trigger=true) =>

      source_type: 'external'
      params: params

    toolset = Toolsets.projects[Manager.get('project')].defaults
    tools = @createTools(toolset, dataSource, settings)

    @dashboardModel = @createDashboard(name, tools)
    
    @dashboardModel.save().done =>
      @navigateToDashboard()
