bug_tracker::project_new (public)

 bug_tracker::project_new project_id

Defined in packages/bug-tracker/tcl/bug-tracker-procs.tcl

Create a new Bug Tracker project for a package instance.

Parameters:
project_id (required)
Author:
Peter Marklund

Partial Call Graph (max 5 caller/called nodes):
%3 bug_tracker::install::package_instantiate bug_tracker::install::package_instantiate (private) bug_tracker::project_new bug_tracker::project_new bug_tracker::install::package_instantiate->bug_tracker::project_new content::folder::new content::folder::new (public) bug_tracker::project_new->content::folder::new content::folder::register_content_type content::folder::register_content_type (public) bug_tracker::project_new->content::folder::register_content_type content::keyword::new content::keyword::new (public) bug_tracker::project_new->content::keyword::new db_0or1row db_0or1row (public) bug_tracker::project_new->db_0or1row db_dml db_dml (public) bug_tracker::project_new->db_dml

Testcases:
No testcase defined.
Source code:

    if {![db_0or1row already_there {select 1 from bt_projects where  project_id = :project_id} ] } {
        if {[db_0or1row instance_info { *SQL* } ]} {
            set folder_id [content::folder::new -name "bug_tracker_$project_id"  -package_id $project_id  -parent_id $project_id  -context_id $project_id]
            content::folder::register_content_type -folder_id $folder_id -content_type {bt_bug_revision} -include_subtypes t
            content::folder::register_content_type -folder_id $folder_id -content_type "content_revision"
            content::folder::register_content_type -folder_id $folder_id -content_type "image"
        
        set keyword_id [content::keyword::new -heading "$instance_name"]
            set component_keyword_id [content::keyword::new -heading "Components $instance_name"]
        
        # Inserts into bt_projects
        set component_id [db_nextval acs_object_id_seq]
        db_dml bt_projects_insert {}
        db_dml bt_components_insert {}
    }
    }
Generic XQL file:
<fullquery name="bug_tracker::project_new.instance_info">
    <querytext>
      select p.instance_name, o.creation_user, o.creation_ip from apm_packages p join acs_objects o on (p.package_id = o.object_id) where  p.package_id = :project_id
      </querytext>
</fullquery>

<fullquery name="bug_tracker::project_new.bt_projects_insert">
    <querytext>
      insert into bt_projects
        (project_id, folder_id, root_keyword_id, component_keyword_id)
       values
         (:project_id, :folder_id, :keyword_id, :component_keyword_id)
    </querytext>
</fullquery>

<fullquery name="bug_tracker::project_new.bt_components_insert">
    <querytext>
      insert into bt_components
        (component_id, project_id, component_name)
      values
        (:component_id, :project_id, 'General')
    </querytext>
</fullquery>

<fullquery name="bug_tracker::project_new.instance_info">
    <querytext>
	select p.instance_name, o.creation_user, o.creation_ip
	from apm_packages p join acs_objects o on (p.package_id = o.object_id)
        where p.package_id = :project_id
     </querytext>
</fullquery>
packages/bug-tracker/tcl/bug-tracker-procs.xql

PostgreSQL XQL file:
<fullquery name="bug_tracker::project_new.create_project">
    <querytext>
        select bt_project__new(:project_id);
    </querytext>
</fullquery>
packages/bug-tracker/tcl/bug-tracker-procs-postgresql.xql

Oracle XQL file:
<fullquery name="bug_tracker::project_new.create_project">
    <querytext>
        begin
             bt_project.new(:project_id);
        end;
     </querytext>
</fullquery>
packages/bug-tracker/tcl/bug-tracker-procs-oracle.xql

[ hide source ] | [ make this the default ]
Show another procedure: