Index: openacs-4/packages/imsld/sql/postgresql/imsld-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/sql/postgresql/imsld-create.sql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/imsld/sql/postgresql/imsld-create.sql 13 Sep 2005 13:15:02 -0000 1.2 +++ openacs-4/packages/imsld/sql/postgresql/imsld-create.sql 19 Sep 2005 17:20:14 -0000 1.3 @@ -22,8 +22,6 @@ parameters varchar(4000) ); -create index imsld_learning_o_env_id_idx on imsld_learning_objects(environment_id); - comment on table imsld_learning_objects is ' Learning objects are incorporated (in dotLRN) by referencing resources through the item elements.'; @@ -33,9 +31,6 @@ comment on column imsld_learning_objects.type is ' The type of learning object (e.g. knowledge-object, tool-object test-object). Vocabulary used can be the one of ''learning resource type'' element from the IEEE LTSC LOM.'; -comment on column imsld_learning_objects.schema_version is ' -Indicate the version of the schema to be used.'; - comment on column imsld_learning_objects.is_visible_p is ' Initial visibility attribute'; @@ -67,6 +62,9 @@ references cr_items --imsld_prerequisites ); +create index imsld_imsld_loid_idx on imsld_imslds(learning_objective_id); +create index imsld_imsld_pid_idx on imsld_imslds(prerequisite_id); + comment on table imsld_imslds is ' IMS-LD main table, where the imsld general information is stored.'; @@ -125,6 +123,8 @@ parameters varchar(4000) ); +create index imsld_items_pid_idx on imsld_items(parent_item_id); + comment on table imsld_items is ' This table holds the imsld items of the unit of learning'; @@ -189,6 +189,7 @@ ); create index imsld_roles_parent_id_idx on imsld_roles(parent_role_id); +create index imsld_roles_comp_id_idx on imsld_roles(component_id); comment on table imsld_roles is ' Roles of the unit of learning. Whenever possible, they are treated just like the roles in dotLRN'; @@ -207,7 +208,7 @@ This attribute is used when there are several sub roles (e.g. chair, secretary, member). Persons can be matched exclusively to the sub roles, meaning that a person, who has the role of chair, may not be bound to one of the other roles at the same time. When it is not exclusive, persons may be bound to more than one sub role (this is the default situation). True means exclusively-in-roles and false means not-exlusively.'; -create table imsld_activity_description ( +create table imsld_activity_desc ( description_id integer constraint imsld_act_desc_fk references cr_revisions @@ -217,7 +218,7 @@ pretty_title varchar(200) ); -comment on table iimsld_activity_description is ' +comment on table imsld_activity_desc is ' This table holds the descrition of a learning activity. Technically it is just a mapping table between items and the learning activity, but this table was created to provide simplicity and clarification in the data model'; @@ -233,6 +234,10 @@ constraint imsld_la_component_id_fk references cr_items --imsld_components not null, + activity_description_id integer + constraint imsld_la_desc_id_fk + references cr_items --imsld_activity_descs + not null, parameters varchar(4000), is_visible_p char(1) check (is_visible_p in ('t','f')) @@ -254,8 +259,11 @@ ); create index imsld_la_comp_id_idx on imsld_learning_activities(component_id); +create index imsld_la_ad_id_idx on imsld_learning_activities(activity_description_id); create index imsld_la_timel_id_idx on imsld_learning_activities(time_limit_id); create index imsld_la_oncomp_id_idx on imsld_learning_activities(on_completion_id); +create index imsld_la_lo_id_idx on imsld_learning_activities(learning_objective_id); +create index imsld_la_prereq_id_idx on imsld_learning_activities(prerequisite_id); comment on table imsld_learning_activities is ' This table stores the learning activitis of the component of the unit of learning.'; @@ -322,13 +330,19 @@ constraint imsld_as_component_id_fk references cr_items --imsld_components not null, + information_id integer + constraint imsld_as_info_id_fk + references cr_items --imsld_components + not null, identifier varchar(100), number_to_select integer, structure_type char(9) - check (structure_type in ('selection','sequence')) + check (structure_type in ('selection','sequence')), + sort varchar(4) ); create index imsld_as_comp_id_idx on imsld_activity_structures(component_id); +create index imsld_as_info_id_idx on imsld_activity_structures(information_id); comment on table imsld_activity_structures is ' The activity structures of a component determine the sets and order of activities in the unit of learning, as well as the @@ -355,10 +369,11 @@ identifier varchar(100), learning_object_id integer constraint imsld_env_loid_fk - references cr_items, --imsld_learning_objects + references cr_items --imsld_learning_objects ); create index imsld_envs_comp_id_idx on imsld_environments(component_id); +create index imsld_learno_id_idx on imsld_environments(learning_object_id); comment on table imsld_environments is ' The environments are learning objects, services or more environments that complement a given activity. @@ -391,7 +406,7 @@ comment on table imsld_services is ' This table stores all the services that are found in the IMS-LD. The services are supposed to use the other .LRN packages (because that is how -the service is provided) but we also hold the information in this table.' +the service is provided) but we also hold the information in this table.'; comment on column imsld_services.is_visible_p is ' Initial visibility attribute'; @@ -412,7 +427,7 @@ references cr_items --imsld_services not null, recipients varchar(11) - check (recipients in ('all-in-role','selection')), + check (recipients in ('all-in-role','selection')) ); create index imsld_send_m_serv_id_idx on imsld_send_mail_services(service_id); @@ -519,9 +534,9 @@ check (is_visible_p in ('t','f')) default 't', identifier varchar(100), - when_last_act_completed_id integer - constraint imsld_plays_lastact_fk - references cr_items, --imsld_acts + when_last_act_completed_p char(1) + check (when_last_act_completed_p in ('t','f')) + default 't', time_limit_id integer constraint imsld_plays_timelid_fk references cr_items, --imsld_time_limits @@ -531,7 +546,6 @@ ); create index imsld_plays_meth_id_idx on imsld_plays(method_id); -create index imsld_plays_act_id_idx on imsld_plays(when_last_act_completed_id); create index imsld_plays_timel_id_idx on imsld_plays(time_limit_id); create index imsld_plays_oncomp_id_idx on imsld_plays(on_completion_id); @@ -585,9 +599,6 @@ support_activity_id integer constraint imsld_rp_said_fk references cr_items, --imsld_support_activities - unit_of_learning_id integer - constraint imsld_rp_imslds_fk - references cr_items, --imsld_imslds activity_structure_id integer constraint imsld_rp_asid_fk references cr_items, --imsld_activity_structures @@ -599,7 +610,6 @@ create index imsld_rp_role_id_idx on imsld_role_parts(role_id); create index imsld_rp_la_id_idx on imsld_role_parts(learning_activity_id); create index imsld_rp_sa_id_idx on imsld_role_parts(support_activity_id); -create index imsld_rp_imsld_id_idx on imsld_role_parts(unit_of_learning_id); create index imsld_rp_as_id_idx on imsld_role_parts(activity_structure_id); create index imsld_rp_env_id_idx on imsld_role_parts(environment_id); @@ -634,8 +644,6 @@ feedback_title varchar(200) ); -create index imsld_oncomp_feedb_id_idx on imsld_on_completion(feedback_id); - comment on table imsld_on_completion is ' The underlying item elements point to a resource (of type webcontent or imsldcontent), where the feedback description can be found. After completion (of the component pointing to this row) this text becomes visible. Index: openacs-4/packages/imsld/sql/postgresql/imsld-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/sql/postgresql/imsld-drop.sql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/imsld/sql/postgresql/imsld-drop.sql 13 Sep 2005 13:15:02 -0000 1.2 +++ openacs-4/packages/imsld/sql/postgresql/imsld-drop.sql 19 Sep 2005 17:20:14 -0000 1.3 @@ -19,6 +19,8 @@ drop table imsld_roles cascade; +drop table imsld_activity_desc; + drop table imsld_learning_activities cascade; drop table imsld_support_activities cascade; Index: openacs-4/packages/imsld/tcl/apm-callback-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/tcl/apm-callback-procs.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/imsld/tcl/apm-callback-procs.tcl 13 Sep 2005 13:15:03 -0000 1.2 +++ openacs-4/packages/imsld/tcl/apm-callback-procs.tcl 19 Sep 2005 17:20:15 -0000 1.3 @@ -19,7 +19,9 @@ imsld::install::init_content_repository # create default relationships - ismld::install::init_rels + imsld::install::init_rels + + return 1 } ad_proc -public imsld::apm_callback::before_uninstall { @@ -31,5 +33,7 @@ # clean the cr imsld::uninstall::empty_content_repository + + return 1 } Index: openacs-4/packages/imsld/tcl/imsld-cp-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/tcl/imsld-cp-procs.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/imsld/tcl/imsld-cp-procs.tcl 5 Aug 2005 15:25:33 -0000 1.1 +++ openacs-4/packages/imsld/tcl/imsld-cp-procs.tcl 19 Sep 2005 17:20:15 -0000 1.2 @@ -51,7 +51,6 @@ set content_type imsld_cp_manifest set item_name "${item_id}_[string tolower $identifier]" - ns_log notice "edit p viene $edit_p !!!!!!!!!!! y version $version" if { !$edit_p } { # create set item_id [content::item::new -item_id $item_id \ Index: openacs-4/packages/imsld/tcl/imsld-fs-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/tcl/imsld-fs-procs.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/imsld/tcl/imsld-fs-procs.tcl 5 Aug 2005 15:25:33 -0000 1.1 +++ openacs-4/packages/imsld/tcl/imsld-fs-procs.tcl 19 Sep 2005 17:20:15 -0000 1.2 @@ -59,6 +59,7 @@ # structx = directory loop, count_y and count_x are going to be used to update the files_structure_list set structx $files_struct_list set count_y 0 + ns_log notice "a buscar en $structx \n\n\n" while { [llength $structx] > 0 && $found_p == 0 } { # for each directory set dirx [lindex $structx 0] Index: openacs-4/packages/imsld/tcl/imsld-install-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/tcl/imsld-install-procs.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/imsld/tcl/imsld-install-procs.tcl 13 Sep 2005 13:15:03 -0000 1.2 +++ openacs-4/packages/imsld/tcl/imsld-install-procs.tcl 19 Sep 2005 17:20:15 -0000 1.3 @@ -18,7 +18,6 @@ } { ### IMS-LD - # learning objects content::type::new -content_type imsld_learning_object -supertype content_revision -pretty_name "<#_ Learning Object #>" -pretty_plural "<#_ Learning Objects #>" -table_name imsld_learning_objects -id_column learning_object_id @@ -35,7 +34,7 @@ content::type::attribute::new -content_type imsld_imsld -attribute_name version -datatype string -pretty_name "<#_ Version #>" -column_spec "varchar(10)" content::type::attribute::new -content_type imsld_imsld -attribute_name level -datatype string -pretty_name "<#_ Level #>" -column_spec "char(1)" content::type::attribute::new -content_type imsld_imsld -attribute_name sequence_used_p -datatype string -pretty_name "<#_ Sequence Used #>" -column_spec "char(1)" - content::type::attribute::new -content_type imsld_imsld -attribute_name learning_object_id -datatype number -pretty_name "<#_ Learning Objects ID #>" -column_spec "integer" + content::type::attribute::new -content_type imsld_imsld -attribute_name learning_objective_id -datatype number -pretty_name "<#_ Learning Objectives ID #>" -column_spec "integer" content::type::attribute::new -content_type imsld_imsld -attribute_name prerequisite_id -datatype number -pretty_name "<#_ Prerequistes ID #>" -column_spec "integer" # learning objectives @@ -46,7 +45,7 @@ # imsld prerequisites content::type::new -content_type imsld_prerequisite -supertype content_revision -pretty_name "<#_ IMS-LD Prerequisite #>" -pretty_plural "<#_ IMS-LD Prerequisites #>" -table_name imsld_prerequisites -id_column prerequisite_id - content::type::attribute::new -content_type imsld_prerequisite -attribute_name pretty_title -datatype title -pretty_name "<#_ Pretty Title #>" -column_spec "varchar(200)" + content::type::attribute::new -content_type imsld_prerequisite -attribute_name pretty_title -datatype string -pretty_name "<#_ Pretty Title #>" -column_spec "varchar(200)" # imsld items content::type::new -content_type imsld_item -supertype content_revision -pretty_name "<#_ IMS-LD Item #>" -pretty_plural "<#_ IMS-LD Items #>" -table_name imsld_items -id_column imsld_item_id @@ -76,15 +75,16 @@ content::type::attribute::new -content_type imsld_role -attribute_name href -datatype string -pretty_name "<#_ Href #>" -column_spec "varchar(2000)" # imsld activity description - content::type::new -content_type imsld_activity_description -supertype content_revision -pretty_name "<#_ IMS-LD Activity Description #>" -pretty_plural "<#_ IMS-LD Activity Descriptions #>" -table_name imsld_activity_description -id_column description_id + content::type::new -content_type imsld_activity_desc -supertype content_revision -pretty_name "<#_ IMS-LD Activity Description #>" -pretty_plural "<#_ IMS-LD Activity Descriptions #>" -table_name imsld_activity_desc -id_column description_id - content::type::attribute::new -content_type imsld_activity_description -attribute_name pretty_title -datatype title -pretty_name "<#_ Pretty Title #>" -column_spec "varchar(200)" + content::type::attribute::new -content_type imsld_activity_desc -attribute_name pretty_title -datatype string -pretty_name "<#_ Pretty Title #>" -column_spec "varchar(200)" # learning activities content::type::new -content_type imsld_learning_activity -supertype content_revision -pretty_name "<#_ IMS-LD Learning Activity #>" -pretty_plural "<#_ IMS-LD Learning Activities #>" -table_name imsld_learning_activities -id_column activity_id content::type::attribute::new -content_type imsld_learning_activity -attribute_name identifier -datatype string -pretty_name "<#_ Identifier #>" -column_spec "varchar(100)" content::type::attribute::new -content_type imsld_learning_activity -attribute_name component_id -datatype number -pretty_name "<#_ Component Identifier #>" -column_spec "integer" + content::type::attribute::new -content_type imsld_learning_activity -attribute_name activity_description_id -datatype number -pretty_name "<#_ Activity Description Identifier #>" -column_spec "integer" content::type::attribute::new -content_type imsld_learning_activity -attribute_name is_visible_p -datatype string -pretty_name "<#_ Is Visible? #>" -column_spec "char(1)" content::type::attribute::new -content_type imsld_learning_activity -attribute_name user_choice_p -datatype string -pretty_name "<#_ User Choice? #>" -column_spec "char(1)" content::type::attribute::new -content_type imsld_learning_activity -attribute_name time_limit_id -datatype number -pretty_name "<#_ Time Limit Identifier #>" -column_spec "integer" @@ -112,6 +112,7 @@ content::type::attribute::new -content_type imsld_activity_structure -attribute_name identifier -datatype string -pretty_name "<#_ Identifier #>" -column_spec "varchar(100)" content::type::attribute::new -content_type imsld_activity_structure -attribute_name number_to_select -datatype number -pretty_name "<#_ Number to Select #>" -column_spec "integer" content::type::attribute::new -content_type imsld_activity_structure -attribute_name structure_type -datatype string -pretty_name "<#_ Structure Type #>" -column_spec "char(9)" + content::type::attribute::new -content_type imsld_activity_structure -attribute_name sort -datatype string -pretty_name "<#_ Sort #>" -column_spec "varchar(4)" # environments content::type::new -content_type imsld_environment -supertype content_revision -pretty_name "<#_ IMD-LD Environment #>" -pretty_plural "<#_ IMD-LD Environments #>" -table_name imsld_environments -id_column environment_id @@ -141,7 +142,7 @@ # send mail data content::type::new -content_type imsld_send_mail_data -supertype content_revision -pretty_name "<#_ IMS-LD Sendmail Data #>" -pretty_plural "<#_ IMS-LD Sendmail Data #>" -table_name imsld_send_mail_data -id_column data_id - content::type::attribute::new -content_type imsld_send_mail_data -attribute_name send_mail_id -datatype number -pretty_name "<#_ Sendmail Identifier #>" -column_spec "itneger" + content::type::attribute::new -content_type imsld_send_mail_data -attribute_name send_mail_id -datatype number -pretty_name "<#_ Sendmail Identifier #>" -column_spec "integer" content::type::attribute::new -content_type imsld_send_mail_data -attribute_name role_id -datatype number -pretty_name "<#_ Role Identifier #>" -column_spec "integer" content::type::attribute::new -content_type imsld_send_mail_data -attribute_name mail_data -datatype string -pretty_name "<#_ Mail Data #>" -column_spec "varchar(4000)" @@ -166,7 +167,7 @@ content::type::attribute::new -content_type imsld_play -attribute_name method_id -datatype number -pretty_name "<#_ Method Identifier #>" -column_spec "integer" content::type::attribute::new -content_type imsld_play -attribute_name is_visible_p -datatype string -pretty_name "<#_ Is Visible? #>" -column_spec "char(1)" content::type::attribute::new -content_type imsld_play -attribute_name identifier -datatype string -pretty_name "<#_ Identifier #>" -column_spec "varchar(100)" - content::type::attribute::new -content_type imsld_play -attribute_name when_last_act_completed_id -datatype number -pretty_name "<#_ When Last Act Completed Identifier #>" -column_spec "integer" + content::type::attribute::new -content_type imsld_play -attribute_name when_last_act_completed_p -datatype string -pretty_name "<#_ When Last Act Completed? #>" -column_spec "char(1)" content::type::attribute::new -content_type imsld_play -attribute_name time_limit_id -datatype number -pretty_name "<#_ Time Limit Identifier #>" -column_spec "integer" content::type::attribute::new -content_type imsld_play -attribute_name on_completion_id -datatype number -pretty_name "<#_ On Completion Identifier #>" -column_spec "integer" @@ -185,16 +186,9 @@ content::type::attribute::new -content_type imsld_role_part -attribute_name role_id -datatype number -pretty_name "<#_ Role Identifier #>" -column_spec "integer" content::type::attribute::new -content_type imsld_role_part -attribute_name learning_activity_id -datatype number -pretty_name "<#_ Learning Activity Identifier #>" -column_spec "integer" content::type::attribute::new -content_type imsld_role_part -attribute_name support_activity_id -datatype number -pretty_name "<#_ Support Activity Identifier #>" -column_spec "integer" - content::type::attribute::new -content_type imsld_role_part -attribute_name unit_of_learning_id -datatype number -pretty_name "<#_ IMS-LD Identifier #>" -column_spec "integer" content::type::attribute::new -content_type imsld_role_part -attribute_name activity_structure_id -datatype number -pretty_name "<#_ Activity Structure Identifier #>" -column_spec "integer" content::type::attribute::new -content_type imsld_role_part -attribute_name environment_id -datatype number -pretty_name "<#_ Environment Identifier #>" -column_spec "integer" - # parameters - content::type::new -content_type imsld_parameter -supertype content_revision -pretty_name "<#_ IMS-LD Parameter #>" -pretty_plural "<#_ IMS-LD Parameters #>" -table_name imsld_parameters -id_column parameter_id - - content::type::attribute::new -content_type imsld_parameter -attribute_name value -datatype string -pretty_name "<#_ Value #>" -column_spec "varchar(4000)" - - # time limits content::type::new -content_type imsld_time_limit -supertype content_revision -pretty_name "<#_ IMS-LD Time Limit #>" -pretty_plural "<#_ IMS-LD Time Limits #>" -table_name imsld_time_limits -id_column time_limit_id @@ -205,7 +199,7 @@ content::type::attribute::new -content_type imsld_on_completion -attribute_name feedback_title -datatype string -pretty_name "<#_ Feedbach Title #>" -column_spec "varchar(200)" - ### IMS-LD Content Packagin + ### IMS-LD Content Packaging # manifests content::type::new -content_type imsld_cp_manifest -supertype content_revision -pretty_name "<#_ IMS-LD CP Manifest #>" -pretty_plural "<#_ IMS-LD CP Manifests #>" -table_name imsld_cp_manifests -id_column manifest_id @@ -241,12 +235,14 @@ content::type::attribute::new -content_type imsld_cp_file -attribute_name path_to_file -datatype string -pretty_name "<#_ Path to File #>" -column_spec "varchar(2000)" content::type::attribute::new -content_type imsld_cp_file -attribute_name file_name -datatype string -pretty_name "<#_ File name #>" -column_spec "varchar(2000)" content::type::attribute::new -content_type imsld_cp_file -attribute_name href -datatype string -pretty_name "<#_ Href #>" -column_spec "varchar(2000)" + } ad_proc -public imsld::install::init_rels { } { Create default rels between imsld items } { + # Learing Objetcives - IMS-LD Items rel_types::new imsld_lo_item_rel "Learing Objective - Imsld Item rel" "Learing Objective - Imsld Item rels" \ imsld_learning_objective 0 {} \ @@ -257,7 +253,7 @@ imsld_prerequisite 0 {} \ imsld_item 0 {} - # IMS-LD Items - Resources + # IMS-LD Items - Resources (resource-ref) rel_types::new imsld_item_res_rel "Imsld Item - Resources rel" "Imsld Item - Resources rels" \ imsld_item 0 {} \ imsld_cp_resource 0 {} @@ -273,16 +269,16 @@ imsld_learning_objective 0 {} # Learning Object - IMS-LD Item - rel_types::new imsld_lobject_item_rel "Learning Object - IMS-LD Item rel" "Learning Object - IMS-LD Item rels" \ + rel_types::new imsld_l_object_item_rel "Learning Object - IMS-LD Item rel" "Learning Object - IMS-LD Item rels" \ imsld_learning_object 0 {} \ imsld_item 0 {} - # Conference Service - Participants + # Conference Service - Participants (role-ref) rel_types::new imsld_conf_part_rel "Conference Serice - Participants rel" "Conference Serice - Participants rels" \ imsld_conference_service 0 {} \ imsld_role 0 {} - # Conference Service - Observers + # Conference Service - Observers (role-ref) rel_types::new imsld_conf_obser_rel "Conference Serice - Observers rel" "Conference Serice - Observers rels" \ imsld_conference_service 0 {} \ imsld_role 0 {} @@ -292,43 +288,99 @@ imsld_conference_service 0 {} \ imsld_role 0 {} - # Environment - Environment + # Environment - Environment (environment-ref) rel_types::new imsld_env_env_rel "Environment - Environment rel" "Environment - Environment rels" \ imsld_environment 0 {} \ imsld_environment 0 {} - # Activity Description - IMS-LD Items + # Activity Description - IMS-LD Items rel_types::new imsld_actdesc_item_rel "Activity Description - Imsld Item rel" "Activity Description - Imsld Item rels" \ - imsld_activity_description 0 {} \ + imsld_activity_desc 0 {} \ imsld_item 0 {} - # Learning Activity - Environment + # Learning Activity - Environment (environment-ref) rel_types::new imsld_la_env_rel "Learning Activity - Environment rel" "Learning Activity - Environment rels" \ imsld_learning_activity 0 {} \ imsld_environment 0 {} + # Support Activity - Environment (environment-ref) + rel_types::new imsld_sa_env_rel "Support Activity - Environment rel" "Support Activity - Environment rels" \ + imsld_support_activity 0 {} \ + imsld_environment 0 {} + # On Completion - Feedback rel_types::new imsld_feedback_rel "On Completion - Feedback rel" "On Completion - Feedback rels" \ imsld_on_completion 0 {} \ imsld_item 0 {} + # Support Activity - Role (role-ref) + rel_types::new imsld_sa_role_rel "Support Activity - Role rel" "Support Activity - Role rels" \ + imsld_support_activity 0 {} \ + imsld_role 0 {} + + # Activity Structure - Items (information) + rel_types::new imsld_as_info_i_rel "Activity Structure - Item (information) rel" "Activity Structure - Item (information) rels" \ + imsld_activity_structure 0 {} \ + imsld_item 0 {} + + # Activity Structure - Environments (environment-ref) + rel_types::new imsld_as_env_rel "Activity Structure - Environment (environment-ref) rel" "Activity Structure - Environment (environment-ref) rels" \ + imsld_activity_structure 0 {} \ + imsld_environment 0 {} + + # Activity Structure - Learning Activities (learning-activity-ref) + rel_types::new imsld_as_la_rel "Activity Structure - Learning Activities (learning-activity-ref) rel" "Activity Structure - Learning Activities (learning-activity-ref) rels" \ + imsld_activity_structure 0 {} \ + imsld_learning_activity 0 {} + + # Activity Structure - Support Activities (support-activity-ref) + rel_types::new imsld_as_sa_rel "Activity Structure - Support Activities (support-activity-ref) rel" "Activity Structure - Support Activities (support-activity-ref) rels" \ + imsld_activity_structure 0 {} \ + imsld_support_activity 0 {} + + # Activity Structure - Activity Structures (activity-structure-ref) + rel_types::new imsld_as_as_rel "Activity Structure - Activity Structures (activity-structure-ref) rel" "Activity Structure - Activity Structures (activity-structure-ref) rels" \ + imsld_activity_structure 0 {} \ + imsld_activity_structure 0 {} + + # Act - Role Parts (when-role-part-completed) + rel_types::new imsld_act_rp_completed_rel "Act - Role Parts (when-role-part-completed) rel" "Act - Role Parts (when-role-part-completed) rels" \ + imsld_act 0 {} \ + imsld_role_part 0 {} + + # Method - Plays (when-play-completed) + rel_types::new imsld_mp_completed_rel "Method - Plays (when-play-completed) rel" "Method - Plays (when-play-completed) rels" \ + imsld_method 0 {} \ + imsld_play 0 {} + } -ad_proc -public imsld::install::delete_rels { +ad_proc -public imsld::uninstall::delete_rels { } { Delete default rels between imsld items } { imsld::rel_type_delete -rel_type imsld_lo_item_rel imsld::rel_type_delete -rel_type imsld_preq_item_rel imsld::rel_type_delete -rel_type imsld_item_res_rel imsld::rel_type_delete -rel_type imsld_role_item_rel - imsld::rel_type_delete -rel_type imsld_lobject_item_rel + imsld::rel_type_delete -rel_type imsld_imsld_lob_rel + imsld::rel_type_delete -rel_type imsld_l_object_item_rel imsld::rel_type_delete -rel_type imsld_conf_part_rel imsld::rel_type_delete -rel_type imsld_conf_obser_rel imsld::rel_type_delete -rel_type imsld_conf_moder_rel imsld::rel_type_delete -rel_type imsld_env_env_rel - imsld::rel_type_delete -rel_type imsld_la_env_rel imsld::rel_type_delete -rel_type imsld_actdesc_item_rel + imsld::rel_type_delete -rel_type imsld_la_env_rel + imsld::rel_type_delete -rel_type imsld_sa_env_rel + imsld::rel_type_delete -rel_type imsld_feedback_rel + imsld::rel_type_delete -rel_type imsld_sa_role_rel + imsld::rel_type_delete -rel_type imsld_as_info_i_rel + imsld::rel_type_delete -rel_type imsld_as_env_rel + imsld::rel_type_delete -rel_type imsld_as_la_rel + imsld::rel_type_delete -rel_type imsld_as_sa_rel + imsld::rel_type_delete -rel_type imsld_as_as_rel + imsld::rel_type_delete -rel_type imsld_act_rp_completed_rel + imsld::rel_type_delete -rel_type imsld_mp_completed_rel } ad_proc -public imsld::uninstall::empty_content_repository { @@ -381,12 +433,13 @@ content::type::attribute::delete -content_type imsld_role -attribute_name min_persons content::type::attribute::delete -content_type imsld_role -attribute_name href - # imsld prerequisites - content::type::attribute::delete -content_type imsld_activity_description -attribute_name pretty_title + # activity descriptions + content::type::attribute::delete -content_type imsld_activity_desc -attribute_name pretty_title # learning activities content::type::attribute::delete -content_type imsld_learning_activity -attribute_name identifier content::type::attribute::delete -content_type imsld_learning_activity -attribute_name component_id + content::type::attribute::delete -content_type imsld_learning_activity -attribute_name activity_description_id content::type::attribute::delete -content_type imsld_learning_activity -attribute_name is_visible_p content::type::attribute::delete -content_type imsld_learning_activity -attribute_name user_choice_p content::type::attribute::delete -content_type imsld_learning_activity -attribute_name time_limit_id @@ -410,6 +463,7 @@ content::type::attribute::delete -content_type imsld_activity_structure -attribute_name identifier content::type::attribute::delete -content_type imsld_activity_structure -attribute_name number_to_select content::type::attribute::delete -content_type imsld_activity_structure -attribute_name structure_type + content::type::attribute::delete -content_type imsld_activity_structure -attribute_name sort # environments content::type::attribute::delete -content_type imsld_environment -attribute_name component_id @@ -450,7 +504,7 @@ content::type::attribute::delete -content_type imsld_play -attribute_name method_id content::type::attribute::delete -content_type imsld_play -attribute_name is_visible_p content::type::attribute::delete -content_type imsld_play -attribute_name identifier - content::type::attribute::delete -content_type imsld_play -attribute_name when_last_act_completed_id + content::type::attribute::delete -content_type imsld_play -attribute_name when_last_act_completed_p content::type::attribute::delete -content_type imsld_play -attribute_name time_limit_id content::type::attribute::delete -content_type imsld_play -attribute_name on_completion_id @@ -465,20 +519,16 @@ content::type::attribute::delete -content_type imsld_role_part -attribute_name role_id content::type::attribute::delete -content_type imsld_role_part -attribute_name learning_activity_id content::type::attribute::delete -content_type imsld_role_part -attribute_name support_activity_id - content::type::attribute::delete -content_type imsld_role_part -attribute_name unit_of_learning_id content::type::attribute::delete -content_type imsld_role_part -attribute_name activity_structure_id content::type::attribute::delete -content_type imsld_role_part -attribute_name environment_id - # parameters - content::type::attribute::delete -content_type imsld_parameter -attribute_name value - # time limits content::type::attribute::delete -content_type imsld_time_limit -attribute_name time_in_seconds # on completion content::type::attribute::delete -content_type imsld_on_completion -attribute_name feedback_title - ### IMS-LD Content Packagin + ### IMS-LD Content Packaging # manifests content::type::attribute::delete -content_type imsld_cp_manifest -attribute_name identifier @@ -514,7 +564,8 @@ content::type::delete -content_type imsld_item -drop_table_p t content::type::delete -content_type imsld_component -drop_table_p t content::type::delete -content_type imsld_role -drop_table_p t - content::type::delete -content_type imsld_activity_description -drop_table_p t + content::type::delete -content_type imsld_prerequisite -drop_table_p t + content::type::delete -content_type imsld_activity_desc -drop_table_p t content::type::delete -content_type imsld_learning_activity -drop_table_p t content::type::delete -content_type imsld_support_activity -drop_table_p t content::type::delete -content_type imsld_activity_structure -drop_table_p t @@ -527,7 +578,6 @@ content::type::delete -content_type imsld_play -drop_table_p t content::type::delete -content_type imsld_act -drop_table_p t content::type::delete -content_type imsld_role_part -drop_table_p t - content::type::delete -content_type imsld_parameter -drop_table_p t content::type::delete -content_type imsld_time_limit -drop_table_p t content::type::delete -content_type imsld_on_completion -drop_table_p t Index: openacs-4/packages/imsld/tcl/imsld-parse-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/tcl/imsld-parse-procs.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/imsld/tcl/imsld-parse-procs.tcl 13 Sep 2005 13:15:03 -0000 1.3 +++ openacs-4/packages/imsld/tcl/imsld-parse-procs.tcl 19 Sep 2005 17:20:15 -0000 1.4 @@ -137,7 +137,7 @@ # ported compression method or encryption with an unknown # password. - # Therefor it if it is 1, then it concluded successfully + # Therefore it if it is 1, then it concluded successfully # but with warnings, so we switch it back to 0 if { $error_p == 1 } { @@ -473,7 +473,6 @@ content::folder::register_content_type -folder_id $cr_folder_id -content_type imsld_play content::folder::register_content_type -folder_id $cr_folder_id -content_type imsld_act content::folder::register_content_type -folder_id $cr_folder_id -content_type imsld_role_part - content::folder::register_content_type -folder_id $cr_folder_id -content_type imsld_parameter content::folder::register_content_type -folder_id $cr_folder_id -content_type imsld_time_limit content::folder::register_content_type -folder_id $cr_folder_id -content_type imsld_on_completion content::folder::register_content_type -folder_id $cr_folder_id -content_type imsld_cp_manifest @@ -574,7 +573,7 @@ } { Parse IMS-LD item node and stores all the information in the database, such as the resources, resources items, etc. - Returns a list with the new imsld_item_id created if there were no errors, or 0 and an explanatio messge if there was an error. + Returns a list with the new imsld_item_id created if there were no errors, or 0 and an explanation messge if there was an error. @param manifest Manifest tree @param manifest_id Manifest ID or the manifest being parsed @@ -584,18 +583,21 @@ @option parent_item_id In case it's a nested item. Default null } { upvar files_struct_list files_struct_list + set item_title [imsld::parse::get_title -node $item_node -prefix imsld] set item_identifier [imsld::parse::get_attribute -node $item_node -attr_name identifier] set item_is_visible_p [imsld::parse::get_bool_attribute -node $item_node -attr_name isvisible -default t] set item_parameters [imsld::parse::get_attribute -node $item_node -attr_name parameters] set item_identifierref [imsld::parse::get_attribute -node $item_node -attr_name identifierref] - set item_id [imsld::item_new -title $item_title \ - -identifier $item_identifier \ - -is_visible_p $item_is_visible_p \ - -parameters $item_parameters \ - -identifierref $item_identifierref \ - -parent_id $parent_id \ - -parent_item_id $parent_item_id] + set item_id [imsld::item_revision_new -title $item_title \ + -content_type imsld_item \ + -attributes [list [list identifier $item_identifier] \ + [list is_visible_p $item_is_visible_p] \ + [list parameters $item_parameters] \ + [list identifierref $item_identifierref] \ + [list parent_item_id $parent_item_id]] \ + -parent_id $parent_id] + if { ![empty_string_p $item_identifierref] } { # look for the resource in the manifest and add it to the CR set resources [$manifest child all imscp:resources] @@ -653,7 +655,7 @@ } { Parse IMS-LD role node and stores all the information in the database. - Returns a list with the new role_id (item_id) created if there were no errors, or 0 and an explanatio messge if there was an error. + Returns a list with the new role_id (item_id) created if there were no errors, or 0 and an explanation messge if there was an error. @param role_type staff or learner @param component_id Component identifier which this role belongs to @@ -664,8 +666,10 @@ @param tmp_dir Temporary directory where the files were exctracted @option parent_role_id Parent role identifier. Default to null } { + upvar files_struct_list files_struct_list + # get the info of the role node and create the respective role - set role_create_new [imsld::parse::get_attribute -node $role -attr_name create-new] + set role_create_new [imsld::parse::get_attribute -node $roles_node -attr_name create-new] switch [string tolower $role_create_new] { allowed { set role_create_new_p t @@ -677,9 +681,9 @@ set role_create_new_p t } } - set role_href [imsld::parse::get_attribute -node $role -attr_name href] - set role_identifier [imsld::parse::get_attribute -node $role -attr_name identifier] - set role_match_persons [imsld::parse::get_attribute -node $role -attr_name identifier] + set role_href [imsld::parse::get_attribute -node $roles_node -attr_name href] + set role_identifier [imsld::parse::get_attribute -node $roles_node -attr_name identifier] + set role_match_persons [imsld::parse::get_attribute -node $roles_node -attr_name identifier] switch [string tolower $role_match_persons] { exclusively-in-roles { set role_match_persons_p t @@ -691,24 +695,26 @@ set role_match_persons_p f } } - set role_max_persons [imsld::parse::get_attribute -node $role -attr_name max-persons] - set role_min_persons [imsld::parse::get_attribute -node $role -attr_name min-persons] - set role_title [imsld::parse::get_title -node $role -prefix imsld] + set role_max_persons [imsld::parse::get_attribute -node $roles_node -attr_name max-persons] + set role_min_persons [imsld::parse::get_attribute -node $roles_node -attr_name min-persons] + set role_title [imsld::parse::get_title -node $roles_node -prefix imsld] # create the role - set role_id [imsld::role_new -identifier $role_identifier \ - -role_type $role_type \ - -parent_role_id $parent_role_id \ - -create_new_p $role_create_new_p \ - -match_persons_p $role_match_persons_p \ - -max_persons $role_max_persons \ - -min_persons $role_min_persons \ - -href $role_href \ - -component_id $component_id \ - -title $title] + set role_id [imsld::item_revision_new -attributes [list [list identifier $role_identifier] \ + [list role_type $role_type] \ + [list parent_role_id $parent_role_id] \ + [list create_new_p $role_create_new_p] \ + [list match_persons_p $role_match_persons_p] \ + [list max_persons $role_max_persons] \ + [list min_persons $role_min_persons] \ + [list href $role_href] \ + [list component_id $component_id]] \ + -content_type imsld_role \ + -title $role_title \ + -parent_id $parent_id] # continue with the role information and nested roles - set role_information [$role child all imsld:information] + set role_information [$roles_node child all imsld:information] if { [llength $role_information] } { # parse the item, create it and map it to the role set information_item [$role_information child all imsld:item] @@ -732,7 +738,7 @@ } # nested roles - set nested_role [$role child all "imsld:${role_type}"] + set nested_role [$roles_node child all "imsld:${role_type}"] if { [llength $nested_role] } { imsld::parse::parse_and_create_role -role_type $role_type \ -manifest $manifest \ @@ -749,24 +755,27 @@ ad_proc -public imsld::parse::parse_and_create_learning_objective { -learning_objective_node - -manifest - -manifest_id - -parent_id - -tmp_dir + -manifest:required + -manifest_id:required + -parent_id:required + -tmp_dir:required } { Parse a learning objective and stores all the information in the database. - Returns a list with the new learning_objective_id (item_id) created if there were no errors, or 0 and an explanatio messge if there was an error. + Returns a list with the new learning_objective_id (item_id) created if there were no errors, or 0 and an explanation messge if there was an error. @param learning_objective_node learning objective node to parse @param manifest Manifest tree @param manifest_id Manifest ID or the manifest being parsed @param parent_id Parent folder ID @param tmp_dir Temporary directory where the files were exctracted } { + upvar files_struct_list files_struct_list + # get learning objective info set learning_objective_title [imsld::parse::get_title -node $learning_objective_node -prefix imsld] - set learning_objective_id [imsld::learning_objective_new -title $learning_objective_title \ + set learning_objective_id [imsld::item_revision_new -title $learning_objective_title \ + -content_type imsld_learning_objective \ -parent_id $parent_id] # learning objective: imsld_items @@ -801,18 +810,21 @@ } { Parse a prerequisite and stores all the information in the database. - Returns a list with the new prerequisite_id (item_id) created if there were no errors, or 0 and an explanatio messge if there was an error. + Returns a list with the new prerequisite_id (item_id) created if there were no errors, or 0 and an explanation messge if there was an error. @param prerequisite_node prerequisite node to parse @param manifest Manifest tree @param manifest_id Manifest ID or the manifest being parsed @param parent_id Parent folder ID @param tmp_dir Temporary directory where the files were exctracted } { + upvar files_struct_list files_struct_list + # get prerequisite info set prerequisite_title [imsld::parse::get_title -node $prerequisite_node -prefix imsld] - set prerequisite_id [imsld::prerequisite_new -title $prerequisite_title \ - -parent_id $parent_id] + set prerequisite_id [imsld::item_revision_new -title $prerequisite_title \ + -content_type imsld_prerequisite \ + -parent_id $parent_id] # prerequisite: imsld_items set prerequisite_items [$prerequisite_node child all imsld:item] @@ -846,17 +858,20 @@ } { Parse a activity description and stores all the information in the database. - Returns a list with the new activity_description_id (item_id) created if there were no errors, or 0 and an explanatio messge if there was an error. + Returns a list with the new activity_description_id (item_id) created if there were no errors, or 0 and an explanation messge if there was an error. @param activity_description_node activity description node to parse @param manifest Manifest tree @param manifest_id Manifest ID or the manifest being parsed @param parent_id Parent folder ID @param tmp_dir Temporary directory where the files were exctracted } { + upvar files_struct_list files_struct_list + # get activity description info set activity_description_title [imsld::parse::get_title -node $activity_description_node -prefix imsld] - set activity_description_id [imsld::activity_description_new -title $activity_description_title \ + set activity_description_id [imsld::item_revision_new -title $activity_description_title \ + -content_type imsld_activity_desc \ -parent_id $parent_id] # activity description: imsld_items @@ -891,14 +906,16 @@ } { Parse a learning object and stores all the information in the database. - Returns a list with the new learning_object_id (item_id) created if there were no errors, or 0 and an explanatio messge if there was an error. + Returns a list with the new learning_object_id (item_id) created if there were no errors, or 0 and an explanation messge if there was an error. @param learning_object_node learning object node to parse @param manifest Manifest tree @param manifest_id Manifest ID or the manifest being parsed @param parent_id Parent folder ID @param tmp_dir Temporary directory where the files were exctracted } { + upvar files_struct_list files_struct_list + # get learning object info set learning_object_class [imsld::parse::get_attribute -node $learning_object_node -attr_name class] set identifier [imsld::parse::get_attribute -node $learning_object_node -attr_name identifier] @@ -907,11 +924,12 @@ set type [imsld::parse::get_attribute -node $learning_object_node -attr_name type] set title [imsld::parse::get_title -node $learning_object_node -prefix imsld] - set learning_object_id [imsld::learning_object_new -class $learning_object_class \ - -identifier $identifier \ - -is_visible_p $is_visible_p \ - -parameters $parameters \ - -type $type \ + set learning_object_id [imsld::item_revision_new -attributes [list [list class $learning_object_class] \ + [list identifier $identifier] \ + [listis_visible_p $is_visible_p] \ + [listparameters $parameters] \ + [listtype $type]] \ + -content_type imsld_learning_object \ -title $title \ -parent_id $parent_id] @@ -931,7 +949,7 @@ return $item_list } # map item with the learning_object - relation_add imsld_lobject_item_rell $learning_object_id $item_id + relation_add imsld_l_object_item_rel $learning_object_id $item_id } return $learning_object_id } @@ -946,7 +964,7 @@ } { Parse a service and stores all the information in the database. - Returns a list with the new service_ids (item_ids) created if there were no errors, or 0 and an explanatio messge if there was an error. The service element can have conference or send-mail services (index service is currently not supported in .LRN), and they are created directly as a service, i.e. there is no table for storing the services, they are stored directly in the send-mail or conference tables. + Returns a list with the new service_ids (item_ids) created if there were no errors, or 0 and an explanation messge if there was an error. The service element can have conference or send-mail services (index service is currently not supported in .LRN), and they are created directly as a service, i.e. there is no table for storing the services, they are stored directly in the send-mail or conference tables. @param service_node service node to parse @param environment_id @@ -955,6 +973,8 @@ @param parent_id Parent folder ID @param tmp_dir Temporary directory where the files were exctracted } { + upvar files_struct_list files_struct_list + # get service info set service_class [imsld::parse::get_attribute -node $service_node -attr_name class] set identifier [imsld::parse::get_attribute -node $service_node -attr_name identifier] @@ -967,22 +987,23 @@ imsld::parse::validate_multiplicity -tree $send_mail -multiplicity 1 -element_name send-mail -equal set select [imsld::parse::get_attribute -node $send_mail -attr_name select] expr { [string eq [string tolower $select] all-persons-in-role] ? [set recipients all-in-role] : [set recipients selection] } - ns_log notice "!!!recipients es $recipients \n\n" set title [imsld::parse::get_title -node $send_mail -prefix imsld] # create the service - set service_id [imsld::service_new -environment_id $environment_id \ - -class $service_class \ - -identifier $identifier \ - -is_visible_p $is_visible_p \ - -parameters $parameters \ - -service_type send-mail \ + set service_id [imsld::item_revision_new -attributes [list [list environment_id $environment_id] \ + [list class $service_class] \ + [list identifier $identifier] \ + [list is_visible_p $is_visible_p] \ + [list parameters $parameters] \ + [list service_type send-mail]] \ + -content_type imsld_service \ -parent_id $parent_id] # create the send mail service - set send_mail_id [imsld::send_mail_service_new -service_id $service_id \ - -is_visible_p $is_visible_p \ - -parameters $parameters \ - -recipients $recipients \ + set send_mail_id [imsld::item_revision_new -attributes [list [list service_id $service_id] \ + [list is_visible_p $is_visible_p] \ + [list parameters $parameters] \ + [list recipients $recipients]] \ -parent_id $parent_id \ + -content_type imsld_send_mail_service \ -title $title] set email_data_list [$send_mail child all imsld:email-data] @@ -995,9 +1016,11 @@ # there is no role with that identifier, return the error return [list 0 "<#_ There is no role with the identifier %ref% (referenced by an email data) #>"] } - set email_data_id [imsld::email_data_new -send_mail_service_id $send_mail_id \ - -role_id $role_id \ - -mail_data {}] + set email_data_id [imsld::item_revision_new -attributes [list [list send_mail_service_id $send_mail_id] \ + [list role_id $role_id] \ + [list mail_data {}]] \ + -content_type imsld_send_mail_data \ + -parent_id $parent_id] } } @@ -1035,21 +1058,23 @@ } # create the service - set service_id [imsld::service_new -environment_id $environment_id \ - -class $service_class \ - -identifier $identifier \ - -is_visible_p $is_visible_p \ - -parameters $parameters \ - -service_type conferencel \ + set service_id [imsld::item_revision_new -attributes [list [list environment_id $environment_id] \ + [list class $service_class] \ + [list identifier $identifier] \ + [list is_visible_p $is_visible_p] \ + [list parameters $parameters] \ + [list service_type conferencel]] \ + -content_type imsld_service \ -parent_id $parent_id] - + # create the conference service - set conference_id [imsld::conference_service_new -service_id $service_id \ - -manager_id $manager_id \ - -conference_type $conference_type \ - -imsld_item_id $imsld_item_id \ - -parent_id $parent_id] - + set conference_id [imsld::conference_service_new -attributes [list [list service_id $service_id] \ + [list manager_id $manager_id] \ + [list conference_type $conference_type] \ + [list imsld_item_id $imsld_item_id]] \ + -content_type imsld_conference_service \ + -parent_id $parent_id] + # participants set participant_list [$conference child all imsld:participant] imsld::parse::validate_multiplicity -tree $participant_list -multiplicity 1 -element_name conference-participant -greather_than @@ -1110,7 +1135,7 @@ } { Parse a environment and stores all the information in the database. - Returns a list with the new environment_id (item_id) created if there were no errors, or 0 and an explanatio messge if there was an error. + Returns a list with the new environment_id (item_id) created if there were no errors, or 0 and an explanation messge if there was an error. @param environment_node environment node to parse @param manifest Manifest tree @@ -1138,9 +1163,10 @@ } # create the environment - set environment_id [imsld::environment_new -component_id $component_id \ - -identifier $identifier \ - -learning_object_id $learning_object_id \ + set environment_id [imsld::item_revision_new -attributes [list [list component_id $component_id] \ + [list identifier $identifier] \ + [list learning_object_id $learning_object_id]] \ + -content_type imsld_environment \ -parent_id $parent_id] # environment: service @@ -1179,11 +1205,12 @@ set referenced_identifier [string tolower [imsld::parse::get_attribute -node $referenced_environment -attr_name identifier]] if { [string eq $ref $referenced_identifier] } { set found_p 1 + set environment_referenced_node $referenced_environment } } if { $found_p } { # ok, let's create the environment - set environment_ref_list [imsld::parse::parse_and_create_environment -environment_node $environment \ + set environment_ref_list [imsld::parse::parse_and_create_environment -environment_node $environment_referenced_node \ -manifest_id $manifest_id \ -item_node $imsld_item \ -parent_id $parent_id \ @@ -1215,20 +1242,20 @@ } { Parse a learning activity and stores all the information in the database. - Returns a list with the new activity_id (item_id) created if there were no errors, or 0 and an explanatio messge if there was an error. + Returns a list with the new activity_id (item_id) created if there were no errors, or 0 and an explanation messge if there was an error. - @param role_type staff or learner @param component_id Component identifier which this role belongs to @param manifest Manifest tree @param manifest_id Manifest ID or the manifest being parsed - @param roles_node The role node to parse + @param activity_node The activity node to parse @param parent_id Parent folder ID @param tmp_dir Temporary directory where the files were exctracted - @option parent_role_id Parent role identifier. Default to null } { + upvar files_struct_list files_struct_list + # get the info of the learning activity and create it set identifier [imsld::parse::get_attribute -node $activity_node -attr_name identifier] - set is_visible_p [imsld::parse::get_bool_attribute -tree $activity_node -attr_name isvisible -default t] + set is_visible_p [imsld::parse::get_bool_attribute -node $activity_node -attr_name isvisible -default t] set parameters [imsld::parse::get_attribute -node $activity_node -attr_name parameters] set title [imsld::parse::get_title -node $activity_node -prefix imsld] @@ -1238,8 +1265,8 @@ imsld::parse::validate_multiplicity -tree $learning_objectives -multiplicity 1 -element_name learning-objectives(learning-activity) -equal set learning_objective_list [imsld::parse::parse_and_create_learning_objective -learning_objective_node $learning_objectives \ -manifest_id $manifest_id \ - -item_node $imsld_item \ -parent_id $parent_id \ + -manifest $manifest \ -tmp_dir $tmp_dir] set learning_objective_id [lindex $learning_objective_list 0] @@ -1255,9 +1282,9 @@ set prerequisites [$activity_node child all imsld:prerequisites] if { [llength $prerequisites] } { imsld::parse::validate_multiplicity -tree $prerequisites -multiplicity 1 -element_name prerequisites(learning-activity) -equal - set prerequisite_list [imsld::parse::parse_and_create_perequiste -prerequisite_node $prerequisites \ + set prerequisite_list [imsld::parse::parse_and_create_prerequisite -prerequisite_node $prerequisites \ -manifest_id $manifest_id \ - -item_node $imsld_item \ + -manifest $manifest \ -parent_id $parent_id \ -tmp_dir $tmp_dir] @@ -1270,6 +1297,21 @@ set prerequisite_id "" } + set activity_description [$activity_node child all imsld:activity-description] + imsld::parse::validate_multiplicity -tree $activity_description -multiplicity 1 -element_name activity-description(learning-activity) -equal + + set activity_description_list [imsld::parse::parse_and_create_activity_description -activity_description_node $activity_description \ + -manifest_id $manifest_id \ + -manifest $manifest \ + -parent_id $parent_id \ + -tmp_dir $tmp_dir] + + set activity_description_id [lindex $activity_description_list 0] + if { !$activity_description_id } { + # there is an error, abort and return the list with the error + return $activity_description_list + } + # Learning Activity: Complete Activity # If the learning activity has a "user choice" node, the learner decides when the activity is completed # otherwise, the activity ends when "time-limit" is complete. @@ -1294,7 +1336,9 @@ if { [llength $time_limit] } { imsld::parse::validate_multiplicity -tree $time_limit -multiplicity 1 -element_name time-limit(learning-activity) -equal set time_amount [imsld::parse::get_element_text -node $time_limit] - set time_limit_id [imsld::time_limit_new -time_in_seconds $time_amount] + set time_limit_id [imsld::item_revision_new -attributes [list [list time_in_seconds $time_amount]] \ + -content_type imsld_time_limit \ + -parent_id $parent_id] } } @@ -1306,7 +1350,9 @@ if { [llength $feedback_desc] } { imsld::parse::validate_multiplicity -tree $feedback_desc -multiplicity 1 -element_name feedback(learning-activity) -equal set feedback_title [imsld::parse::get_title -node $feedback_desc -prefix imsld] - set on_completion_id [imsld::on_completion_new -feedback_title $feedback_title] + set on_completion_id [imsld::item_revision_new -parent_id $parent_id \ + -content_type imsld_on_completion \ + -attributes [list [list feedback_title $feedback_title]]] set feedback_items [$feedback_desc child all imsld:item] foreach feedback_item $feedback_items { set item_list [imsld::parse_and_create_item -manifest $manifest \ @@ -1326,16 +1372,19 @@ } # crete learning activity - set learning_activity_id [imsld::learning_activity_new -identifier $identifier \ - -component_id $component_id \ - -parameters $parameters \ - -is_visible_p $is_visible_p \ - -user_choice_p $user_choice_p \ - -time_limit_id $time_limit_id \ - -on_completion_id $on_completion_id \ - -learning_objective_id $learning_objective_id \ - -prerequisite_id $prerequisite_id \ - -title $title] + set learning_activity_id [imsld::item_revision_new -attributes [list [list identifier $identifier] \ + [list component_id $component_id] \ + [list activity_description_id $activity_description_id] \ + [list parameters $parameters] \ + [list is_visible_p $is_visible_p] \ + [list user_choice_p $user_choice_p] \ + [list time_limit_id $time_limit_id] \ + [list on_completion_id $on_completion_id] \ + [list learning_objective_id $learning_objective_id] \ + [list prerequisite_id $prerequisite_id]] \ + -content_type imsld_learning_activity \ + -title $title \ + -parent_id $parent_id] # Learning Activity: Environments set environment_refs [$activity_node child all imsld:environment-ref] @@ -1354,10 +1403,647 @@ relation_add imsld_la_env_rel $learning_activity_id $environment_id } } + return $learning_activity_id +} +ad_proc -public imsld::parse::parse_and_create_support_activity { + -component_id + -activity_node + -manifest + -manifest_id + -parent_id + -tmp_dir +} { + Parse a support activity and stores all the information in the database. + Returns a list with the new activity_id (item_id) created if there were no errors, or 0 and an explanation messge if there was an error. + + @param role_type staff or learner + @param component_id Component identifier which this role belongs to + @param manifest Manifest tree + @param manifest_id Manifest ID or the manifest being parsed + @param roles_node The role node to parse + @param parent_id Parent folder ID + @param tmp_dir Temporary directory where the files were exctracted + @option parent_role_id Parent role identifier. Default to null +} { + upvar files_struct_list files_struct_list + + # get the info of the support activity and create it + set identifier [imsld::parse::get_attribute -node $activity_node -attr_name identifier] + set is_visible_p [imsld::parse::get_bool_attribute -node $activity_node -attr_name isvisible -default t] + set parameters [imsld::parse::get_attribute -node $activity_node -attr_name parameters] + set title [imsld::parse::get_title -node $activity_node -prefix imsld] + + set activity_description [$activity_node child all imsld:activity-description] + imsld::parse::validate_multiplicity -tree $activity_description -multiplicity 1 -element_name activity-description(support-activity) -equal + + set activity_description_list [imsld::parse::parse_and_create_activity_description -activity_description_node $activity_description \ + -manifest_id $manifest_id \ + -item_node $imsld_item \ + -parent_id $parent_id \ + -tmp_dir $tmp_dir] + + set activity_description_id [lindex $activity_description_list 0] + if { !$activity_description_id } { + # there is an error, abort and return the list with the error + return $activity_description_list + } + + # Support Activity: Complete Activity + # If the support activity has a "user choice" node, the learner decides when the activity is completed + # otherwise, the activity ends when "time-limit" is complete. + # When this element does not occur, the activity is set to 'completed' by default. + + set complete_activity [$activity_node child all imsld:complete-activity] + set user_choice_p f + set time_limit_id "" + if { [llength $complete_activity] } { + imsld::parse::validate_multiplicity -tree $complete_activity -multiplicity 1 -element_name complete-activity(support-activity) -equal + + # Support Activity: Complete Activity: User Choice + set user_choice [$complete_activity child all imsld:user-choice] + if { [llength $user_choice] } { + imsld::parse::validate_multiplicity -tree $user_choice -multiplicity 1 -element_name user-choice(support-activity) -equal + # that's it, the learner decides when the activity is completed + set user_choice_p t + } + + # Support Activity: Complete Activity: Time Limit + set time_limit [$complete_activity child all imsld:time-limit] + if { [llength $time_limit] } { + imsld::parse::validate_multiplicity -tree $time_limit -multiplicity 1 -element_name time-limit(support-activity) -equal + set time_amount [imsld::parse::get_element_text -node $time_limit] + set time_limit_id [imsld::item_revision_new -parent_id $parent_id \ + -content_type imsld_time_limit \ + -attributes [list [list time_in_seconds $time_amount]]] + } + } + + # Support Activity: On completion + set on_completion [$activity_node child all imsld:on-completion] + set on_completion_id "" + if { [llength $on_completion] } { + imsld::parse::validate_multiplicity -tree $on_completion -multiplicity 1 -element_name on-completion(support-activity) -equal + set feedback_desc [$on_completion child all imsld:feedback-description] + if { [llength $feedback_desc] } { + imsld::parse::validate_multiplicity -tree $feedback_desc -multiplicity 1 -element_name feedback(support-activity) -equal + set feedback_title [imsld::parse::get_title -node $feedback_desc -prefix imsld] + set on_completion_id [imsld::item_revision_new -parent_id $parent_id \ + -content_type imsld_on_completion \ + -attributes [list [list feedback_title $feedback_title]]] + set feedback_items [$feedback_desc child all imsld:item] + foreach feedback_item $feedback_items { + set item_list [imsld::parse_and_create_item -manifest $manifest \ + -manifest_id $manifest_id \ + -item_node $feedback_item \ + -parent_id $parent_id \ + -tmp_dir $tmp_dir] + set item_id [lindex $item_list 0] + if { !$item_id } { + # an error happened, abort and return the list whit the error + return $item_list + } + # map item with the support objective + relation_add imsld_feedback_rel $on_completion_id $item_id + } + } + } + + # crete support activity + set support_activity_id [imsld::item_revision_new -attributes [list [list identifier $identifier] \ + [list component_id $component_id] \ + [list activity_description_id $activity_description_id] \ + [list parameters $parameters] \ + [list is_visible_p $is_visible_p] \ + [list user_choice_p $user_choice_p] \ + [list time_limit_id $time_limit_id] \ + [list on_completion_id $on_completion_id]] \ + -content_type imsld_support_activity \ + -title $title \ + -parent_id $parent_id] + + # Support Activity: Role ref + set role_ref_list [$activity_node child all imsld:role-ref] + foreach role_ref $role_ref_list { + set ref [string tolower [imsld::parse::get_attribute -node $role_ref -attr_name role-ref]] + if { ![db_0or1row get_role_id {select role_id as role_id from imsld_roles where identifier = :ref and content_revision__is_live(role_id) = 't' }] } { + # there is no role with that identifier, return the error + return [list 0 "<#_ There is no role with the identifier %ref% (referenced by: support activity) #>"] + } + # map support activity with the role + relation_add imsld_sa_role_rel $support_activity_id $role_id + } + + # Support Activity: Environments + set environment_refs [$activity_node child all imsld:environment-ref] + if { [llength $environment_refs] } { + foreach environment_ref_node $environment_refs { + # the environments have been already parsed by now, + # so the referenced environment has to be in the database. + # If not found, return the error + set environment_ref [string tolower [imsld::parse::get_attribute -node $environment_ref_node -attr_name ref]] + if { ![db_0or1row get_environment_id {select environment_id from imsld_environments where identifier = :environment_ref}] } { + # error, referenced environment does not exist + return [list 0 "<#_ Referenced environment (%environment_ref%) in support activity does not exist. #>"] + } + + # map environment with support-activity + relation_add imsld_sa_env_rel $support_activity_id $environment_id + } + } + return $support_activity_id } +ad_proc -public imsld::parse::parse_and_create_activity_structure { + -component_id + -activity_node + -manifest + -manifest_id + -parent_id + -tmp_dir +} { + Parse a activity structure and stores all the information in the database. + + Returns a list with the new activivty_structure_id (item_id) created if there were no errors, or 0 and an explanation messge if there was an error. + + @param component_id Component identifier which this role belongs to + @param manifest Manifest tree + @param manifest_id Manifest ID or the manifest being parsed + @param activity_node The activity structure node to parse + @param parent_id Parent folder ID + @param tmp_dir Temporary directory where the files were exctracted +} { + upvar files_struct_list files_struct_list + + # get the info of the activity structure and create it + set identifier [imsld::parse::get_attribute -node $activity_node -attr_name identifier] + set number_to_select [imsld::parse::get_attribute -tree $activity_node -attr_name number-to-select] + set sort [imsld::parse::get_attribute -node $activity_node -attr_name sort] + set structure_type [imsld::parse::get_attribute -node $activity_node -attr_name structure-type] + set title [imsld::parse::get_title -node $activity_node -prefix imsld] + + # crete activity structure + set activity_structure_id [imsld::item_revision_new -attributes [list [list identifier $identifier] \ + [list number_to_select $number_to_select] \ + [list sort $sort] \ + [list structure_type $structure_type] \ + [list component_id $component_id]] \ + -content_type imsld_activity_structure \ + -title $title \ + -parent_id $parent_id] + + # activity structure information + set structure_information [$activity_node child all imsld:information] + if { [llength $structure_information] } { + # parse the item, create it and map it to the activity structure + set information_item [$activity_node child all imsld:item] + if { ![llength $information_item] } { + return [list 0 "<#_ Information given but no item associated to it for the activity structure %identifier% #>"] + } + + set item_list [imsld::parse::parse_and_create_item -manifest $manifest \ + -manifest_id $manifest_id \ + -item_node $information_item \ + -parent_id $parent_id \ + -tmp_dir $tmp_dir] + + set item_id [lindex $item_list 0] + if { !$item_id } { + # an error happened, abort and return the list whit the error + return $item_list + } + # map information item with the activity structure + relation_add imsld_as_info_i_rel $activity_structure_id $item_id + } + + # Activity Structure: Environments + set environment_refs [$activity_node child all imsld:environment-ref] + if { [llength $environment_refs] } { + foreach environment_ref_node $environment_refs { + # the environments have been already parsed by now, + # so the referenced environment has to be in the database. + # If not found, return the error + set environment_ref [string tolower [imsld::parse::get_attribute -node $environment_ref_node -attr_name ref]] + if { ![db_0or1row get_environment_id {select environment_id from imsld_environments where identifier = :environment_ref}] } { + # error, referenced environment does not exist + return [list 0 "<#_ Referenced environment (%environment_ref%) in activity structure %identifier% does not exist. #>"] + } + + # map environment with activity structure + relation_add imsld_as_env_rel $activity_structure_id $environment_id + } + } + + # Activity Structure: Learning Activities ref + set learning_activity_ref_node [$activity_node child all imsld:learning-activity-ref] + if { [llength $learning_activity_ref_node] } { + imsld::parse::validate_multiplicity -tree $learning_activity_ref_node -multiplicity 1 -element_name learning-activity-ref(activity-structure) -equal + + # the learning activities have been already parsed by now, so the referenced learning activity has to be in the database. + # If not, return the error + set learning_activity_ref [string tolower [imsld::parse::get_attribute -node $learning_activity_ref_node -attr_name ref]] + if { ![db_0or1row get_learning_activity_id {select learning_activity_id from imsld_learning_activities where identifier = :learning_activity_ref}] } { + # error, referenced learning activity does not exist + return [list 0 "<#_ Referenced learning activity (%learning_activity_ref%) in activity structure %identifier% does not exist. #>"] + } + + # map learning activity with activity structure + relation_add imsld_as_la_rel $activity_structure_id $learning_activity_id + } + + # Activity Structure: Support Activities ref + set support_activity_ref_node [$activity_node child all imsld:support-activity-ref] + if { [llength $support_activity_ref_node] } { + imsld::parse::validate_multiplicity -tree $support_activity_ref_node -multiplicity 1 -element_name support-activity-ref(activity-structure) -equal + + # the support activities have been already parsed by now, so the referenced support activity has to be in the database. + # If not, return the error + set support_activity_ref [string tolower [imsld::parse::get_attribute -node $support_activity_ref_node -attr_name ref]] + if { ![db_0or1row get_support_activity_id {select support_activity_id from imsld_support_activities where identifier = :support_activity_ref}] } { + # error, referenced support activity does not exist + return [list 0 "<#_ Referenced support activity (%support_activity_ref%) in activity structure %identifier% does not exist. #>"] + } + + # map support activity with activity structure + relation_add imsld_as_sa_rel $activity_structure_id $support_activity_id + } + + # TO-DO: Unit of Learning ref ? + + # Activity Structure: Activity Structures ref + set activity_structure_ref_list [$activity_node child all imsld:activity-structure-ref] + if { [llength $activity_structure_ref_list] } { + foreach activity_structure_ref $activity_structure_ref_list { + set ref [string tolower [imsld::parse::get_attribute -node $activity_structure_ref -attr_name ref]] + # we have to search for the referenced activity structure and there are two cases: + # 1. the referenced activity structure has already been created: get the id from the database and do the mappings + # 2. the referenced activity structure hasn't been created: invoke the parse_and_create_activity_structure proc, + # but first verify that the activity structure exists in the manifest + if { [db_0or1row get_struct_id {select activity_structure_id as refrenced_struct_id from imsld_activity_structures where identifier = :ref and content_revision__is_live(activity_structure_id) = 't'}] } { + # case one, just do the mappings + relation_add imsld_as_as_rel $activity_structure_id $refrenced_struct_id + } else { + # case two, first verify that the referenced activity structure exists + set activity_structures [[[[[$manifest child all imscp:organizations] child all imsld:learning-design] child all imsld:components] child all imsld:activities] child all imsld:activity-structures] + + set found_p 0 + foreach referenced_activity_structure $activity_structures { + set referenced_identifier [string tolower [imsld::parse::get_attribute -node $referenced_activity_structure -attr_name identifier]] + if { [string eq $ref $referenced_identifier] } { + set found_p 1 + set referenced_structure_node $referenced_activity_structure + } + } + if { $found_p } { + # ok, let's create the activity structure + set activity_structure_ref_list [imsld::parse::parse_and_create_activity_structure -activity_node $referenced_structure_node \ + -component_id $component_id \ + -manifest_id $manifest_id \ + -item_node $imsld_item \ + -parent_id $parent_id \ + -tmp_dir $tmp_dir] + + set activity_structure_ref_id [lindex $activity_structure_ref_list 0] + if { !$activity_structure_ref_id } { + # there is an error, abort and return the list with the error + return $activity_structure_ref_list + } + # finally, do the mappings + relation_add imsld_as_as_rel $activity_structure_id $activity_structure_ref_id + } else { + # error, return + return [list 0 "<#_ Referenced activity structure %referenced_identifier% does not exist #>"] + } + } + } + } + + return $activity_structure_id +} + +ad_proc -public imsld::parse::parse_and_create_role_part { + -act_id + -role_part_node + -manifest + -manifest_id + -parent_id + -tmp_dir +} { + Parse a role part and stores all the information in the database. + + Returns a list with the new role_part_id (item_id) created if there were no errors, or 0 and an explanation messge if there was an error. + + @param act_id Act identifier which this role part belongs to + @param role_part_node The role part node to parse + @param manifest Manifest tree + @param manifest_id Manifest ID or the manifest being parsed + @param parent_id Parent folder ID + @param tmp_dir Temporary directory where the files were exctracted +} { + # get the info of the role part and create it + set identifier [imsld::parse::get_attribute -node $role_part_node -attr_name identifier] + set title [imsld::parse::get_title -node $role_part_node -prefix imsld] + + # Role Part: Roles + set role_id "" + set role_ref [$role_part_node child all imsld:role-ref] + if { [llength $role_ref] } { + imsld::parse::validate_multiplicity -tree $role_ref -multiplicity 1 -element_name role-ref(role-part) -equal + # the roles have already been parsed by now, so the referenced role has to be in the database. + # If not, return the error + set role_ref_ref [string tolower [imsld::parse::get_attribute -node $role_ref -attr_name ref]] + if { ![db_0or1row get_role_id {select role_id from imsld_roles where identifier = :role_ref_ref}] } { + # error, referenced role does not exist + return [list 0 "<#_ Referenced role (%role_ref_ref%) in role part %identifier% does not exist. #>"] + } + } + + # Role Part: Learning Activities + set learning_activity_id "" + set learning_activity_ref [$role_part_node child all imsld:learning-activity-ref] + if { [llength $learning_activity_ref] } { + imsld::parse::validate_multiplicity -tree $learning_activity_ref -multiplicity 1 -element_name learning-activity-ref(role-part) -equal + # the learning activities have already been parsed by now, so the referenced learning activity has to be in the database. + # If not, return the error + set learning_activity_ref_ref [string tolower [imsld::parse::get_attribute -node $learning_activity_ref -attr_name ref]] + if { ![db_0or1row get_learning_activity_id {select activity_id as learning_activity_id from imsld_learning_activities where identifier = :learning_activity_ref_ref}] } { + # error, referenced learning activity does not exist + return [list 0 "<#_ Referenced role (%learning_activity_ref_ref%) in role part %identifier% does not exist. #>"] + } + } + + # Role Part: Support Activities + set support_activity_ref [$role_part_node child all imsld:support-activity-ref] + if { [llength $support_activity_ref] } { + imsld::parse::validate_multiplicity -tree $support_activity_ref -multiplicity 1 -element_name support-activity-ref(role-part) -equal + # the support activities have already been parsed by now, so the referenced support activity has to be in the database. + # If not, return the error + set support_activity_ref_ref [string tolower [imsld::parse::get_attribute -node $support_activity_ref -attr_name ref]] + if { ![db_0or1row get_support_activity_id {select activity_id as support_activity_id from imsld_support_activities where identifier = :support_activity_ref_ref}] } { + # error, referenced support activity does not exist + return [list 0 "<#_ Referenced role (%support_activity_ref_ref%) in role part %identifier% does not exist. #>"] + } + } + + # TO-DO: Role Part: Units of Learning + + # Role Part: Activity Structures + set activity_structure_ref [$role_part_node child all imsld:activity-structure-ref] + if { [llength $activity_structure_ref] } { + imsld::parse::validate_multiplicity -tree $activity_structure_ref -multiplicity 1 -element_name activity-structure-ref(role-part) -equal + # the activity structures have already been parsed by now, so the referenced activity structure has to be in the database. + # If not, return the error + set activity_structure_ref_ref [string tolower [imsld::parse::get_attribute -node $activity_structure_ref -attr_name ref]] + if { ![db_0or1row get_activity_structure_id {select structure_id as activity_structure_id from imsld_structures where identifier = :activity_structure_ref_ref}] } { + # error, referenced activity structure does not exist + return [list 0 "<#_ Referenced activity structure (%activity_structure_ref_ref%) in role part %identifier% does not exist. #>"] + } + } + + # Role Part: Environments + set environment_ref [$role_part_node child all imsld:environment-ref] + if { [llength $environment_ref] } { + imsld::parse::validate_multiplicity -tree $environment_ref -multiplicity 1 -element_name environment-ref(role-part) -equal + # the environments have already been parsed by now, so the referenced environment has to be in the database. + # If not, return the error + set environment_ref_ref [string tolower [imsld::parse::get_attribute -node $environment_ref -attr_name ref]] + if { ![db_0or1row get_env_id {select environment_id from imsld_environments where identifier = :environment_ref_ref}] } { + # error, referenced environment does not exist + return [list 0 "<#_ Referenced environment (%environment_ref_ref%) in role part %identifier% does not exist. #>"] + } + } + + set role_part_id [imsld::item_revision_new -attributes [list [list identifier $identifier] \ + [list role_id $role_id] \ + [list learning_activity_id $learning_activity_id] \ + [list support_activity_id $support_activity_id] \ + [list activity_structure_id $activity_structure_id] \ + [list environment_id $environment_id]] \ + -content_type imsld_role_part \ + -title $title \ + -parent_id $parent_id] + + return $role_part_id +} + +ad_proc -public imsld::parse::parse_and_create_act { + -play_id + -act_node + -manifest + -manifest_id + -parent_id + -tmp_dir +} { + Parse a act and stores all the information in the database. + + Returns a list with the new act_id (item_id) created if there were no errors, or 0 and an explanation messge if there was an error. + + @param play_id Play identifier which this act belongs to + @param act_node The act node to parse + @param manifest Manifest tree + @param manifest_id Manifest ID or the manifest being parsed + @param parent_id Parent folder ID + @param tmp_dir Temporary directory where the files were exctracted +} { + upvar files_struct_list files_struct_list + + # get the info of the act and create it + set identifier [imsld::parse::get_attribute -node $act_node -attr_name identifier] + set title [imsld::parse::get_title -node $act_node -prefix imsld] + + # Act: Complete Act: Time Limit + set complete_act [$act_node child all imsld:complete-act] + set time_limit_id "" + if { [llength $complete_act] } { + imsld::parse::validate_multiplicity -tree $complete_act -multiplicity 1 -element_name complete-act -equal + # Act: Complete Act: Time Limit + set time_limit [$complete_act child all imsld:time-limit] + if { [llength $time_limit] } { + imsld::parse::validate_multiplicity -tree $time_limit -multiplicity 1 -element_name time-limit(complete-act) -equal + set time_amount [imsld::parse::get_element_text -node $time_limit] + set time_limit_id [imsld::item_revision_new -parent_id $parent_id \ + -content_type imsld_time_limit \ + -attributes [list [list time_in_seconds $time_amount]]] + } + } + + # Act: On Completion + set on_completion [$act_node child all imsld:on-completion] + set on_completion_id "" + if { [llength $on_completion] } { + imsld::parse::validate_multiplicity -tree $on_completion -multiplicity 1 -element_name on-completion(complete-act) -equal + set feedback_desc [$on_completion child all imsld:feedback-description] + if { [llength $feedback_desc] } { + imsld::parse::validate_multiplicity -tree $feedback_desc -multiplicity 1 -element_name feedback(complete-act) -equal + set feedback_title [imsld::parse::get_title -node $feedback_desc -prefix imsld] + set on_completion_id [imsld::item_revision_new -parent_id $parent_id \ + -content_type imsld_on_completion \ + -attributes [list [list feedback_title $feedback_title]]] + set feedback_items [$feedback_desc child all imsld:item] + foreach feedback_item $feedback_items { + set item_list [imsld::parse_and_create_item -manifest $manifest \ + -manifest_id $manifest_id \ + -item_node $feedback_item \ + -parent_id $parent_id \ + -tmp_dir $tmp_dir] + set item_id [lindex $item_list 0] + if { !$item_id } { + # an error happened, abort and return the list whit the error + return $item_list + } + # map item with the support objective + relation_add imsld_feedback_rel $on_completion_id $item_id + } + } + } + + set act_id [imsld::item_revision_new -attributes [list [list play_id $play_id] \ + [list identifier $identifier] \ + [list time_limit_id $time_limit_id] \ + [list on_completion_id $on_completion_id]] \ + -content_type imsld_act \ + -parent_id $parent_id \ + -title $title] + + # Act: Role Parts + set role_parts [$act_node child all imsld:role-part] + imsld::parse::validate_multiplicity -tree $role_parts -multiplicity 1 -element_name role-parts -greather_than + foreach role_part $role_parts { + imsld::parse::parse_and_create_role_part -act_id $act_id \ + -role_part_node $role_part \ + -manifest $manifest \ + -manifest_id $manifest_id \ + -parent_id $parent_id \ + -tmp_dir $tmp_dir + } + + # Act: Complete Act: When role part comleted + # The act is completed when the referenced role parts are completed + + set complete_act [$act_node child all imsld:complete-act] + if { [llength $complete_act] } { + imsld::parse::validate_multiplicity -tree $complete_act -multiplicity 1 -element_name complete-act -equal + set when_rp_completed_list [$complete_act child all imsld:when-role-part-completed] + foreach when_rp_completed $when_rp_completed_list { + set ref [strint tolower [imsld::parse::get_attribute -node $when_rp_completed -attr_name ref]] + # verify that the referenced role part exists + if { ![db_0or1row get_rp_id {select role_part_id from imsld_role_parts where identifier = :ref and content_revision__is_live(role_part_id) = 't'} ] } { + return [list 0 "<#_ The referenced role part in 'when role part completed' of the act %identifier% does not exist #>"] + } + # found, map the role part (with the imsld_act_rp_completed_rel) with the act + relation_add imsld_act_rp_completed_rel $act_id $role_part_id + } + } + + return $act_id +} + +ad_proc -public imsld::parse::parse_and_create_play { + -method_id + -play_node + -manifest + -manifest_id + -parent_id + -tmp_dir +} { + Parse a play and stores all the information in the database. + + Returns a list with the new play_id (item_id) created if there were no errors, or 0 and an explanation messge if there was an error. + + @param imsld_id IMS-LD identifier which this play belongs to + @param play_node The play node to parse + @param manifest Manifest tree + @param manifest_id Manifest ID or the manifest being parsed + @param parent_id Parent folder ID + @param tmp_dir Temporary directory where the files were exctracted +} { + upvar files_struct_list files_struct_list + + # get the info of the play and create it + set identifier [imsld::parse::get_attribute -node $play_node -attr_name identifier] + set is_visible_p [imsld::parse::get_bool_attribute -node $play_node -attr_name isvisible -default t] + set title [imsld::parse::get_title -node $play_node -prefix imsld] + + # Play: Complete Play + set complete_play [$play_node child all imsld:complete-play] + set time_limit_id "" + set when_last_act_completed_p f + if { [llength $complete_play] } { + imsld::parse::validate_multiplicity -tree $complete_play -multiplicity 1 -element_name complete-play -equal + # Play: Complete Play: Time Limit + set time_limit [$complete_play child all imsld:time-limit] + if { [llength $time_limit] } { + imsld::parse::validate_multiplicity -tree $time_limit -multiplicity 1 -element_name time-limit(complete-play) -equal + set time_amount [imsld::parse::get_element_text -node $time_limit] + set time_limit_id [imsld::item_revision_new -parent_id $parent_id \ + -content_type imsld_time_limit \ + -attributes [list [list time_in_seconds $time_amount]]] + } + # Play: Complete Play: When Last Act Completed + set when_last_act_completed [$complete_play child all imsld:when-last-act-completed] + if { [llength $when_last_act_completed] } { + set when_last_act_completed_p t + } + } + + # Play: On Completion + set on_completion [$play_node child all imsld:on-completion] + set on_completion_id "" + if { [llength $on_completion] } { + imsld::parse::validate_multiplicity -tree $on_completion -multiplicity 1 -element_name on-completion(complete-play) -equal + set feedback_desc [$on_completion child all imsld:feedback-description] + if { [llength $feedback_desc] } { + imsld::parse::validate_multiplicity -tree $feedback_desc -multiplicity 1 -element_name feedback(complete-play) -equal + set feedback_title [imsld::parse::get_title -node $feedback_desc -prefix imsld] + set on_completion_id [imsld::item_revision_new -parent_id $parent_id \ + -content_type imsld_on_completion \ + -attributes [list [list feedback_title $feedback_title]]] + set feedback_items [$feedback_desc child all imsld:item] + foreach feedback_item $feedback_items { + set item_list [imsld::parse_and_create_item -manifest $manifest \ + -manifest_id $manifest_id \ + -item_node $feedback_item \ + -parent_id $parent_id \ + -tmp_dir $tmp_dir] + set item_id [lindex $item_list 0] + if { !$item_id } { + # an error happened, abort and return the list whit the error + return $item_list + } + # map item with the support objective + relation_add imsld_feedback_rel $on_completion_id $item_id + } + } + } + + set play_id [imsld::item_revision_new -attributes [list [list method_id $method_id] \ + [list is_visible_p $is_visible_p] \ + [list identifier $identifier] \ + [list when_last_act_completed_p $when_last_act_completed_p] \ + [list time_limit_id $time_limit_id] \ + [list on_completion_id $on_completion_id]] \ + -content_type imsld_play \ + -title $title \ + -parent_id $parent_id] + + # Play: Acts + set acts [$play_node child all imsld:act] + imsld::parse::validate_multiplicity -tree $acts -multiplicity 1 -element_name acts -greather_than + foreach act $acts { + set act_identifier [imsld::parse::get_attribute -node $act -attr_name identifier] + set act_title [imsld::parse::get_title -node $act -prefix imsld] + imsld::parse::parse_and_create_act -play_id $play_id \ + -act_node $act \ + -manifest $manifest \ + -manifest_id $manifest_id \ + -parent_id $parent_id \ + -tmp_dir $tmp_dir + } + + return $play_id +} + ad_proc -public imsld::parse::parse_and_create_imsld_manifest { -xmlfile:required -manifest_id:required @@ -1425,8 +2111,8 @@ imsld::parse::validate_multiplicity -tree $learning_objectives -multiplicity 1 -element_name learning-objectives(ims-ld) -equal set learning_objective_list [imsld::parse::parse_and_create_learning_objective -learning_objective_node $learning_objectives \ -manifest_id $manifest_id \ - -item_node $imsld_item \ -parent_id $cr_folder_id \ + -manifest $manifest \ -tmp_dir $tmp_dir] set learning_objective_id [lindex $learning_objective_list 0] @@ -1442,13 +2128,13 @@ set prerequisites [$imsld child all imsld:prerequisites] if { [llength $learning_objectives] } { imsld::parse::validate_multiplicity -tree $prerequisites -multiplicity 1 -element_name prerequisites(ims-ld) -equal - set prerequisite_list [imsld::parse::parse_and_create_perequiste -prerequisite_node $prerequisites \ + set prerequisite_list [imsld::parse::parse_and_create_prerequisite -prerequisite_node $prerequisites \ -manifest_id $manifest_id \ - -item_node $imsld_item \ + -manifest $manifest \ -parent_id $cr_folder_id \ -tmp_dir $tmp_dir] - set prerequisite_id [lindex $prerequiste_list 0] + set prerequisite_id [lindex $prerequisite_list 0] if { !$prerequisite_id } { # there is an error, abort and return the list with the error return $prerequisite_list @@ -1458,27 +2144,30 @@ } # now that we have all the necessary information, let's create the imsld - set imsld_id [imsld::imsld_new -identifier $imsld_identifier \ + set imsld_id [imsld::item_revision_new -attributes [list [list identifier $imsld_identifier] \ + [list level $imsld_level] \ + [list version $imsld_version] \ + [list sequence_p $imsld_sequence_p] \ + [list learning_objectives $learning_objective_id] \ + [list prerequisite_id $prerequisite_id]] \ + -content_type imsld_imsld \ -title $imsld_title \ - -level $imsld_level \ - -version $imsld_version \ - -sequence_p $imsld_sequence_p \ - -parent_id $cr_folder_id \ - -learning_objectives $learning_objective_id \ - -prerequisite_id $prerequisite_id] + -parent_id $cr_folder_id] # Components set components [$imsld child all imsld:components] imsld::parse::validate_multiplicity -tree $components -multiplicity 1 -element_name components -equal - set component_id [imsld::component_new -imsld_id $imsld_id \ + set component_id [imsld::item_revision_new -attributes [list [list imsld_id $imsld_id]] \ + -content_type imsld_component \ -parent_id $cr_folder_id] # Components: Roles set roles [$components child all imsld:roles] + imsld::parse::validate_multiplicity -tree $roles -multiplicity 1 -element_name roles -equal # Components: Roles: Learners set learner_list [$roles child all imsld:learner] - imsld::parse::validate_multiplicity -tree $learner_list -multiplicity 1 -element_name components -greather_than + imsld::parse::validate_multiplicity -tree $learner_list -multiplicity 1 -element_name learners(roles) -greather_than foreach learner $learner_list { imsld::parse::parse_and_create_role -role_type learner \ @@ -1517,12 +2206,11 @@ imsld::parse::parse_and_create_environment -environment_node $environment \ -manifest_id $manifest_id \ -item_node $imsld_item \ - -parent_id $parent_id \ + -parent_id $cr_folder_id \ -tmp_dir $tmp_dir } } - # Componetns: Activities set activities [$components child all imsld:activities] if { [llength $activities] } { @@ -1532,7 +2220,7 @@ set learning_activities [$activities child all imsld:learning-activity] imsld::parse::validate_multiplicity -tree $learning_activities -multiplicity 1 -element_name learning-activities -greather_than - foreach learning_activity $learning_atcivities { + foreach learning_activity $learning_activities { imsld::parse::parse_and_create_learning_activity -component_id $component_id \ -activity_node $learning_activity \ -manifest $manifest \ @@ -1541,22 +2229,118 @@ -tmp_dir $tmp_dir } + # Componets: Activities: Support Activities set support_activities [$activities child all imsld:support-activity] - set activity_structures [$activities child all imsld:activity-structure] + + foreach support_activity $support_activities { + imsld::parse::parse_and_create_support_activity -component_id $component_id \ + -activity_node $support_activity \ + -manifest $manifest \ + -manifest_id $manifest_id \ + -parent_id $cr_folder_id \ + -tmp_dir $tmp_dir + } + + # Componets: Activities: Activity Structures + set actvity_structures [$activities child all imsld:activity-structure] + + foreach support_activity $actvity_structures { + imsld::parse::parse_and_create_activity_structure -component_id $component_id \ + -activity_node $actvity_structure \ + -manifest $manifest \ + -manifest_id $manifest_id \ + -parent_id $cr_folder_id \ + -tmp_dir $tmp_dir + } } # Method - set methods [$imsld child all imsld:method] - imsld::parse::validate_multiplicity -tree $methods -multiplicity 1 -element_name methods -equal - - # Method: Play -# set plays [$methods child all imsld:play] -# imsld::parse::validate_multiplicity -tree $plays -multiplicity 1 -element_name plays -equal + set method [$imsld child all imsld:method] + imsld::parse::validate_multiplicity -tree $method -multiplicity 1 -element_name method -equal -# # Method: Acts -# set acts [$plays child all imsld:act] -# imsld::parse::validate_multiplicity -tree $acts -multiplicity 0 -element_name acts -greather_than + # Method: Complete Unit of Learning + set complete_unit_of_learning [$method child all imsld:complete-unit-of-learning] + set time_limit_id "" + if { [llength $complete_unit_of_learning] } { + imsld::parse::validate_multiplicity -tree $complete_unit_of_learning -multiplicity 1 -element_name complete-unit-of-learning -equal + + # Method: Complete Unit of Learning: Time Limit + set time_limit [$complete_unit_of_learning child all imsld:time-limit] + if { [llength $time_limit] } { + imsld::parse::validate_multiplicity -tree $time_limit -multiplicity 1 -element_name time-limit(complete-unit-of-learning) -equal + set time_amount [imsld::parse::get_element_text -node $time_limit] + set time_limit_id [imsld::item_revision_new -parent_id $cr_folder_id \ + -content_type imsld_time_limit \ + -attributes [list [list time_in_seconds $time_amount]]] + } + } + # Method: On Completion + set on_completion [$method child all imsld:on-completion] + set on_completion_id "" + if { [llength $on_completion] } { + imsld::parse::validate_multiplicity -tree $on_completion -multiplicity 1 -element_name on-completion(method) -equal + set feedback_desc [$on_completion child all imsld:feedback-description] + if { [llength $feedback_desc] } { + imsld::parse::validate_multiplicity -tree $feedback_desc -multiplicity 1 -element_name feedback(method) -equal + set feedback_title [imsld::parse::get_title -node $feedback_desc -prefix imsld] + set on_completion_id [imsld::item_revision_new -parent_id $cr_folder_id \ + -content_type imsld_on_completion \ + -attributes [list [list feedback_title $feedback_title]]] + set feedback_items [$feedback_desc child all imsld:item] + foreach feedback_item $feedback_items { + set item_list [imsld::parse_and_create_item -manifest $manifest \ + -manifest_id $manifest_id \ + -item_node $feedback_item \ + -parent_id $cr_folder_id \ + -tmp_dir $tmp_dir] + set item_id [lindex $item_list 0] + if { !$item_id } { + # an error happened, abort and return the list whit the error + return $item_list + } + # map item with the support objective + relation_add imsld_feedback_rel $on_completion_id $item_id + } + } + } + + set method_id [imsld::item_revision_new -parent_id $cr_folder_id \ + -content_type imsld_method \ + -attributes [list [list imsld_id $imsld_id] \ + [list time_limit_id $time_limit_id] \ + [list on_completion_id $on_completion_id]]] + + # Method: Plays + set plays [$method child all imsld:play] + imsld::parse::validate_multiplicity -tree $plays -multiplicity 1 -element_name plays -greather_than + + foreach play $plays { + imsld::parse::parse_and_create_play -method_id $method_id \ + -play_node $play \ + -manifest $manifest \ + -manifest_id $manifest_id \ + -parent_id $cr_folder_id \ + -tmp_dir $tmp_dir + } + + # Method: Complete Method: When play comleted + # The method is completed when the referenced plays are completed + set complete_play [$method child all imsld:complete-unit-of-learning] + if { [llength $complete_play] } { + imsld::parse::validate_multiplicity -tree $complete_play -multiplicity 1 -element_name complete-play -equal + set when_play_completed_list [$complete_play child all imsld:when-play-completed] + foreach when_play_completed $when_play_completed_list { + set ref [string tolower [imsld::parse::get_attribute -node $when_play_completed -attr_name ref]] + # verify that the referenced play exists + if { ![db_0or1row get_rp_id {select play_id from imsld_plays where identifier = :ref and content_revision__is_live(play_id) = 't'} ] } { + return [list 0 "<#_ The referenced play in 'when play completed' in the method does not exist #>"] + } + # found, map the play (with the imsld_mp_completed_rel) with the method + relation_add imsld_mp_completed_rel $method_id $play_id + } + } + return [list $manifest_id {}] } Index: openacs-4/packages/imsld/tcl/imsld-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/tcl/imsld-procs.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/imsld/tcl/imsld-procs.tcl 13 Sep 2005 13:15:03 -0000 1.2 +++ openacs-4/packages/imsld/tcl/imsld-procs.tcl 19 Sep 2005 17:20:15 -0000 1.3 @@ -63,33 +63,27 @@ } } -ad_proc -public imsld::imsld_new { - -identifier +ad_proc -public imsld::item_revision_new { + {-attributes ""} {-item_id ""} {-title ""} - {-level ""} - {-version ""} - -sequence_p - {-learning_objective_id ""} - {-prerequisite_id ""} {-package_id ""} {-user_id ""} {-creation_ip ""} {-creation_date ""} + -content_type -edit:boolean -parent_id } { - Inserts a new manifest according to the imsmanifest.xml file. + Creates a new revision of a content item, calling the cr functions. + If editing, only a new revision is created, otherwise an item is created too. - @param identifier intrinsic manifest identifier. - @option item_id Item_id of the imsld. [db_nextval "acs_object_id_seq"] used by default. - @option title Title of the IMS-LD. - @option version version. - @param sequence_p Indicates if the imsld uses simple sequencing (true if yes, false otherwise) - @option package_id package_id for the instance of IMS-LD - @option user_id user that adds the imsld. [ad_conn user_id] used by default. - @option creation_ip ip-address of the user that adds the imsld. [ad_conn peeraddr] used by default. - @option creation_date Creation date of the imsld. [dt_sysdate] used by default. + @option attributes A list of lists of pairs of additional attributes and their values. + @option title + @option package_id + @option user_id + @option creation_ip + @option creation_date @option edit Are we editing the manifest? @param parent_id Identifier of the parent folder } { @@ -100,70 +94,9 @@ set package_id [expr { [empty_string_p $package_id] ? [ad_conn package_id] : $package_id }] set item_id [expr { [empty_string_p $item_id] ? [db_nextval "acs_object_id_seq"] : $item_id }] - set content_type imsld_imsld - set item_name "${item_id}_[string tolower $identifier]" + set item_name "${item_id}_content_type" set title [expr { [empty_string_p $title] ? $item_name : $title }] - - if { !$edit_p } { - # create - set item_id [content::item::new -item_id $item_id \ - -name $item_name \ - -content_type $content_type \ - -parent_id $parent_id \ - -creation_user $user_id \ - -creation_ip $creation_ip \ - -context_id $package_id] - } - set revision_id [content::revision::new -item_id $item_id \ - -title $title \ - -content_type $content_type \ - -creation_user $user_id \ - -creation_ip $creation_ip \ - -item_id $item_id \ - -is_live "t" \ - -attributes [list [list identifier [string tolower $identifier]] \ - [list version $version] \ - [list level $level] \ - [list sequence_p $sequence_p] \ - [list learning_object_id $learning_object_id] \ - [list prerequisite_id $prerequisite_id]]] - - return $item_id -} - -ad_proc -public imsld::learning_objective_new { - {-item_id ""} - {-title ""} - {-package_id ""} - {-user_id ""} - {-creation_ip ""} - {-creation_date ""} - -edit:boolean - -parent_id:required -} { - Creates a new learning objective for the given imsld_id. - - @option item_id Item_id of the learning objective. [db_nextval "acs_object_id_seq"] used by default. - @option title Title of the learning objective. - @option package_id package_id for the instance of IMS-LD - @option user_id user that adds the learning objective. [ad_conn user_id] used by default. - @option creation_ip ip-address of the user that adds the learning objective. [ad_conn peeraddr] used by default. - @option creation_date Creation date of the learning objective. [dt_sysdate] used by default. - @option edit Are we editing the learning object? - @param parent_id Identifier of the parent folder -} { - - set user_id [expr { [empty_string_p $user_id] ? [ad_conn user_id] : $user_id }] - set creation_ip [expr { [empty_string_p $creation_ip] ? [ad_conn peeraddr] : $creation_ip }] - set creation_date [expr { [empty_string_p $creation_date] ? [dt_sysdate] : $creation_date }] - set package_id [expr { [empty_string_p $package_id] ? [ad_conn package_id] : $package_id }] - set item_id [expr { [empty_string_p $item_id] ? [db_nextval "acs_object_id_seq"] : $item_id }] - - set content_type imsld_learning_objective - set item_name "${item_id}_imsld_learning_objective" - set title [expr { [empty_string_p $title] ? $item_name : $title }] - if { !$edit_p } { # create set item_id [content::item::new -item_id $item_id \ @@ -175,966 +108,25 @@ -context_id $package_id] } - set revision_id [content::revision::new -item_id $item_id \ - -title $title \ - -content_type $content_type \ - -creation_user $user_id \ - -creation_ip $creation_ip \ - -item_id $item_id \ - -is_live "t" \ - -attributes [list [list pretty_title $title]]] - - return $item_id -} - -ad_proc -public imsld::prerequisite_new { - {-item_id ""} - {-title ""} - {-package_id ""} - {-user_id ""} - {-creation_ip ""} - {-creation_date ""} - -edit:boolean - -parent_id:required -} { - Creates a new prerequisite for the given imsld_id. - - @option item_id Item_id of the prerequisite. [db_nextval "acs_object_id_seq"] used by default. - @option title Title of the prerequisite. - @option package_id package_id for the instance of IMS-LD - @option user_id user that adds the prerequisite. [ad_conn user_id] used by default. - @option creation_ip ip-address of the user that adds the prerequisite. [ad_conn peeraddr] used by default. - @option creation_date Creation date of the prerequisite. [dt_sysdate] used by default. - @option edit Are we editing the prerequiste? - @param parent_id Identifier of the parent folder -} { - - set user_id [expr { [empty_string_p $user_id] ? [ad_conn user_id] : $user_id }] - set creation_ip [expr { [empty_string_p $creation_ip] ? [ad_conn peeraddr] : $creation_ip }] - set creation_date [expr { [empty_string_p $creation_date] ? [dt_sysdate] : $creation_date }] - set package_id [expr { [empty_string_p $package_id] ? [ad_conn package_id] : $package_id }] - set item_id [expr { [empty_string_p $item_id] ? [db_nextval "acs_object_id_seq"] : $item_id }] - - set content_type imsld_prerequisite - set item_name "${item_id}_imsld_prerequisite" - set title [expr { [empty_string_p $title] ? $item_name : $title }] - - if { !$edit_p } { - # create - set item_id [content::item::new -item_id $item_id \ - -name $item_name \ - -content_type $content_type \ - -parent_id $parent_id \ - -creation_user $user_id \ - -creation_ip $creation_ip \ - -context_id $package_id] + if { ![empty_string_p $attributes] } { + set revision_id [content::revision::new -item_id $item_id \ + -title $title \ + -content_type $content_type \ + -creation_user $user_id \ + -creation_ip $creation_ip \ + -item_id $item_id \ + -is_live "t" \ + -attributes $attributes] + } else { + set revision_id [content::revision::new -item_id $item_id \ + -title $title \ + -content_type $content_type \ + -creation_user $user_id \ + -creation_ip $creation_ip \ + -item_id $item_id \ + -is_live "t"] } - set revision_id [content::revision::new -item_id $item_id \ - -title $title \ - -content_type $content_type \ - -creation_user $user_id \ - -creation_ip $creation_ip \ - -item_id $item_id \ - -is_live "t" \ - -attributes [list [list pretty_title $pretty_title]]] - return $item_id } -ad_proc -public imsld::activity_description_new { - {-item_id ""} - {-title ""} - {-package_id ""} - {-user_id ""} - {-creation_ip ""} - {-creation_date ""} - -edit:boolean - -parent_id:required -} { - Creates a new activity description for the given imsld_id. - - @option item_id Item_id of the activity description. [db_nextval "acs_object_id_seq"] used by default. - @option title Title of the activity description. - @option package_id package_id for the instance of IMS-LD - @option user_id user that adds the activity description. [ad_conn user_id] used by default. - @option creation_ip ip-address of the user that adds the activity description. [ad_conn peeraddr] used by default. - @option creation_date Creation date of the activity description. [dt_sysdate] used by default. - @option edit Are we editing the prerequiste? - @param parent_id Identifier of the parent folder -} { - - set user_id [expr { [empty_string_p $user_id] ? [ad_conn user_id] : $user_id }] - set creation_ip [expr { [empty_string_p $creation_ip] ? [ad_conn peeraddr] : $creation_ip }] - set creation_date [expr { [empty_string_p $creation_date] ? [dt_sysdate] : $creation_date }] - set package_id [expr { [empty_string_p $package_id] ? [ad_conn package_id] : $package_id }] - set item_id [expr { [empty_string_p $item_id] ? [db_nextval "acs_object_id_seq"] : $item_id }] - - set content_type imsld_activity_description - set item_name "${item_id}_imsld_activity_description" - set title [expr { [empty_string_p $title] ? $item_name : $title }] - - if { !$edit_p } { - # create - set item_id [content::item::new -item_id $item_id \ - -name $item_name \ - -content_type $content_type \ - -parent_id $parent_id \ - -creation_user $user_id \ - -creation_ip $creation_ip \ - -context_id $package_id] - } - - set revision_id [content::revision::new -item_id $item_id \ - -title $title \ - -content_type $content_type \ - -creation_user $user_id \ - -creation_ip $creation_ip \ - -item_id $item_id \ - -is_live "t" \ - -attributes [list [list pretty_title $pretty_title]]] - - return $item_id -} - -ad_proc -public imsld::_new { - {-item_id ""} - {-title ""} - {-package_id ""} - {-user_id ""} - {-creation_ip ""} - {-creation_date ""} - -edit:boolean - -parent_id:required -} { - Creates a new activity description for the given imsld_id. - - @option item_id Item_id of the activity description. [db_nextval "acs_object_id_seq"] used by default. - @option title Title of the activity description. - @option package_id package_id for the instance of IMS-LD - @option user_id user that adds the activity description. [ad_conn user_id] used by default. - @option creation_ip ip-address of the user that adds the activity description. [ad_conn peeraddr] used by default. - @option creation_date Creation date of the activity description. [dt_sysdate] used by default. - @option edit Are we editing the prerequiste? - @param parent_id Identifier of the parent folder -} { - - set user_id [expr { [empty_string_p $user_id] ? [ad_conn user_id] : $user_id }] - set creation_ip [expr { [empty_string_p $creation_ip] ? [ad_conn peeraddr] : $creation_ip }] - set creation_date [expr { [empty_string_p $creation_date] ? [dt_sysdate] : $creation_date }] - set package_id [expr { [empty_string_p $package_id] ? [ad_conn package_id] : $package_id }] - set item_id [expr { [empty_string_p $item_id] ? [db_nextval "acs_object_id_seq"] : $item_id }] - - set content_type imsld_activity_description - set item_name "${item_id}_imsld_activity_description" - set title [expr { [empty_string_p $title] ? $item_name : $title }] - - if { !$edit_p } { - # create - set item_id [content::item::new -item_id $item_id \ - -name $item_name \ - -content_type $content_type \ - -parent_id $parent_id \ - -creation_user $user_id \ - -creation_ip $creation_ip \ - -context_id $package_id] - } - - set revision_id [content::revision::new -item_id $item_id \ - -title $title \ - -content_type $content_type \ - -creation_user $user_id \ - -creation_ip $creation_ip \ - -item_id $item_id \ - -is_live "t" \ - -attributes [list [list pretty_title $pretty_title]]] - - return $item_id -} - -ad_proc -public imsld::item_new { - -identifier - {-identifierref ""} - {-is_visible_p t} - {-parameters ""} - {-parent_item_id ""} - {-item_id ""} - {-title ""} - {-package_id ""} - {-user_id ""} - {-creation_ip ""} - {-creation_date ""} - -edit:boolean - -parent_id:required -} { - Creates a new item for the given imsld_id. - - @param identifier Item identifier in the manifest. - @option identifierref A reference to a identifier (within the same package). - @option is_visible_p Initial visibility value of the item. Defaults to true. - @option parameters Parameters to be passed during runtime. - @option parent_item_id In case it's a nested item. Default null - @option item_id Item_id of the item. [db_nextval "acs_object_id_seq"] used by default. - @option title Title of the item. - @option package_id package_id for the instance of IMS-LD - @option user_id user that adds the item. [ad_conn user_id] used by default. - @option creation_ip ip-address of the user that adds the item. [ad_conn peeraddr] used by default. - @option creation_date Creation date of the item. [dt_sysdate] used by default. - @option edit Are we editing the item? - @param parent_id Identifier of the parent folder -} { - - set user_id [expr { [empty_string_p $user_id] ? [ad_conn user_id] : $user_id }] - set creation_ip [expr { [empty_string_p $creation_ip] ? [ad_conn peeraddr] : $creation_ip }] - set creation_date [expr { [empty_string_p $creation_date] ? [dt_sysdate] : $creation_date }] - set package_id [expr { [empty_string_p $package_id] ? [ad_conn package_id] : $package_id }] - set item_id [expr { [empty_string_p $item_id] ? [db_nextval "acs_object_id_seq"] : $item_id }] - - set content_type imsld_item - set item_name "${item_id}_[string tolower $identifier]" - set title [expr { [empty_string_p $title] ? $item_name : $title }] - - if { !$edit_p } { - # create - set item_id [content::item::new -item_id $item_id \ - -name $item_name \ - -content_type $content_type \ - -parent_id $parent_id \ - -creation_user $user_id \ - -creation_ip $creation_ip \ - -context_id $package_id] - } - - set revision_id [content::revision::new -item_id $item_id \ - -title $title \ - -content_type $content_type \ - -creation_user $user_id \ - -creation_ip $creation_ip \ - -item_id $item_id \ - -is_live "t" \ - -attributes [list [list identifier [string tolower $identifier]] \ - [list identifierref $identifierref] \ - [list is_visible_p $is_visible_p] \ - [list parameters $parameters] \ - [list parent_item_id $parent_item_id]]] - - return $item_id -} - -ad_proc -public imsld::component_new { - -imsld_id - {-item_id ""} - {-package_id ""} - {-user_id ""} - {-creation_ip ""} - {-creation_date ""} - -edit:boolean - -parent_id:required -} { - Creates a new component for the given imsld_id. - - @param imsld_id imsld_id of the imsld that this component belongs to. - @option item_id Item_id of the component. [db_nextval "acs_object_id_seq"] used by default. - @option package_id package_id for the instance of IMS-LD - @option user_id user that adds the component. [ad_conn user_id] used by default. - @option creation_ip ip-address of the user that adds the component. [ad_conn peeraddr] used by default. - @option creation_date Creation date of the component. [dt_sysdate] used by default. - @option edit Are we editing the prerequiste? - @param parent_id Identifier of the parent folder -} { - - set user_id [expr { [empty_string_p $user_id] ? [ad_conn user_id] : $user_id }] - set creation_ip [expr { [empty_string_p $creation_ip] ? [ad_conn peeraddr] : $creation_ip }] - set creation_date [expr { [empty_string_p $creation_date] ? [dt_sysdate] : $creation_date }] - set package_id [expr { [empty_string_p $package_id] ? [ad_conn package_id] : $package_id }] - set item_id [expr { [empty_string_p $item_id] ? [db_nextval "acs_object_id_seq"] : $item_id }] - - set content_type imsld_component - set item_name "${item_id}_imsld_component" - - if { !$edit_p } { - # create - set item_id [content::item::new -item_id $item_id \ - -name $item_name \ - -content_type $content_type \ - -parent_id $parent_id \ - -creation_user $user_id \ - -creation_ip $creation_ip \ - -context_id $package_id] - } - - set revision_id [content::revision::new -item_id $item_id \ - -title $item_name \ - -content_type $content_type \ - -creation_user $user_id \ - -creation_ip $creation_ip \ - -item_id $item_id \ - -is_live "t" \ - -attributes [list [list imsld_id $imsld_id]]] - - return $item_id -} - -ad_proc -public imsld::role_new { - -component_id - -identifier - {-parent_role_id ""} - -role_type - -create_new_p - {-match_persons_p 0} - {-max_persons ""} - {-min_persons ""} - {-href ""} - {-item_id ""} - {-title ""} - {-package_id ""} - {-user_id ""} - {-creation_ip ""} - {-creation_date ""} - -edit:boolean - -parent_id:required -} { - Creates a new role. - - @param component_id component_id of the component wich this role belongs to. - @param identifier Role identifier in the manifest. - @option parent_role_id role_id of the parent role (in case this is a nested role). - @param role_type staff or learner - @param create_new_p Can users with this role create other roles? true for allowed and false for not allowed. - @option max_persons - @option min_persons - @option href - @option item_id Item_id of the role. [db_nextval "acs_object_id_seq"] used by default. - @option title Title of the item. - @option package_id package_id for the instance of IMS-LD - @option user_id user that adds the role. [ad_conn user_id] used by default. - @option creation_ip ip-address of the user that adds the role. [ad_conn peeraddr] used by default. - @option creation_date Creation date of the role. [dt_sysdate] used by default. - @option edit Are we editing the prerequiste? - @param parent_id Identifier of the parent folder -} { - - set user_id [expr { [empty_string_p $user_id] ? [ad_conn user_id] : $user_id }] - set creation_ip [expr { [empty_string_p $creation_ip] ? [ad_conn peeraddr] : $creation_ip }] - set creation_date [expr { [empty_string_p $creation_date] ? [dt_sysdate] : $creation_date }] - set package_id [expr { [empty_string_p $package_id] ? [ad_conn package_id] : $package_id }] - set item_id [expr { [empty_string_p $item_id] ? [db_nextval "acs_object_id_seq"] : $item_id }] - - set content_type imsld_role - set item_name "${item_id}_imsld_role" - set title [expr { [empty_string_p $title] ? $item_name : $title }] - - if { !$edit_p } { - # create - set item_id [content::item::new -item_id $item_id \ - -name $item_name \ - -content_type $content_type \ - -parent_id $parent_id \ - -creation_user $user_id \ - -creation_ip $creation_ip \ - -context_id $package_id] - } - - set revision_id [content::revision::new -item_id $item_id \ - -title $item_name \ - -content_type $content_type \ - -creation_user $user_id \ - -creation_ip $creation_ip \ - -item_id $item_id \ - -is_live "t" \ - -attributes [list [list component_id $component_id] \ - [list identifier [string tolower $identifier]] \ - [list parent_role_id $parent_role_id] \ - [list role_tye $role_type] \ - [list create_new_p $create_new_p] \ - [list max_persons $max_persons] \ - [list min_persons $min_persons] \ - [list href $href]]] - return $item_id -} - -ad_proc -public imsld::learning_object_new { - -environment_id - {-class ""} - -identifier - -is_visible_p - {-parameters ""} - {-type ""} - {-item_id ""} - {-title ""} - {-package_id ""} - {-user_id ""} - {-creation_ip ""} - {-creation_date ""} - -edit:boolean - -parent_id:required -} { - Creates a new learning object. - - @param environment_id Environment where to which learning object belongs - @option class - @param identifier Learning object identifier - @param is_visible_p Initial visibility attribute - @option parameters Parameters to be passed during runtime - @option type The type of learning object - @option item_id Item_id of the learning_object. [db_nextval "acs_object_id_seq"] used by default. - @option title Title of the item. - @option package_id package_id for the instance of IMS-LD - @option user_id user that adds the learning object. [ad_conn user_id] used by default. - @option creation_ip ip-address of the user that adds the learning object. [ad_conn peeraddr] used by default. - @option creation_date Creation date of the learning object. [dt_sysdate] used by default. - @param edit Are we editing the prerequiste? - @param parent_id Identifier of the parent folder -} { - - set user_id [expr { [empty_string_p $user_id] ? [ad_conn user_id] : $user_id }] - set creation_ip [expr { [empty_string_p $creation_ip] ? [ad_conn peeraddr] : $creation_ip }] - set creation_date [expr { [empty_string_p $creation_date] ? [dt_sysdate] : $creation_date }] - set package_id [expr { [empty_string_p $package_id] ? [ad_conn package_id] : $package_id }] - set item_id [expr { [empty_string_p $item_id] ? [db_nextval "acs_object_id_seq"] : $item_id }] - - set content_type imsld_learning_object - set item_name "${item_id}_imsld_learning_object" - set title [expr { [empty_string_p $title] ? $item_name : $title }] - - if { !$edit_p } { - # create - set item_id [content::item::new -item_id $item_id \ - -name $item_name \ - -content_type $content_type \ - -parent_id $parent_id \ - -creation_user $user_id \ - -creation_ip $creation_ip \ - -context_id $package_id] - } - - set revision_id [content::revision::new -item_id $item_id \ - -title $item_name \ - -content_type $content_type \ - -creation_user $user_id \ - -creation_ip $creation_ip \ - -item_id $item_id \ - -is_live "t" \ - -attributes [list [list class $class] \ - [list environment_id $environment_id] \ - [list is_visible_p $-is_visible_p] \ - [list type $type] \ - [list identifier [string tolower $identifier]] \ - [list parameters $parameters]]] - return $item_id -} - -ad_proc -public imsld::service_new { - -environment_id - {-class ""} - -identifier - -is_visible_p - {-parameters ""} - -service_type - {-item_id ""} - {-title ""} - {-package_id ""} - {-user_id ""} - {-creation_ip ""} - {-creation_date ""} - -edit:boolean - -parent_id:required -} { - Creates a new service. - - @param environment_id Environment where to which service belongs - @option class - @param identifier service identifier - @param is_visible_p Initial visibility attribute - @option parameters Parameters to be passed during runtime - @param service_type The type of service - @option item_id Item_id of the service. [db_nextval "acs_object_id_seq"] used by default. - @option title Title of the item. - @option package_id package_id for the instance of IMS-LD - @option user_id user that adds the service. [ad_conn user_id] used by default. - @option creation_ip ip-address of the user that adds the service. [ad_conn peeraddr] used by default. - @option creation_date Creation date of the service. [dt_sysdate] used by default. - @param edit Are we editing the prerequiste? - @param parent_id Identifier of the parent folder -} { - - set user_id [expr { [empty_string_p $user_id] ? [ad_conn user_id] : $user_id }] - set creation_ip [expr { [empty_string_p $creation_ip] ? [ad_conn peeraddr] : $creation_ip }] - set creation_date [expr { [empty_string_p $creation_date] ? [dt_sysdate] : $creation_date }] - set package_id [expr { [empty_string_p $package_id] ? [ad_conn package_id] : $package_id }] - set item_id [expr { [empty_string_p $item_id] ? [db_nextval "acs_object_id_seq"] : $item_id }] - - set content_type imsld_service - set item_name "${item_id}_imsld_service" - set title [expr { [empty_string_p $title] ? $item_name : $title }] - - if { !$edit_p } { - # create - set item_id [content::item::new -item_id $item_id \ - -name $item_name \ - -content_type $content_type \ - -parent_id $parent_id \ - -creation_user $user_id \ - -creation_ip $creation_ip \ - -context_id $package_id] - } - - set revision_id [content::revision::new -item_id $item_id \ - -title $item_name \ - -content_type $content_type \ - -creation_user $user_id \ - -creation_ip $creation_ip \ - -item_id $item_id \ - -is_live "t" \ - -attributes [list [list class $class] \ - [list environment_id $environment_id] \ - [list is_visible_p $-is_visible_p] \ - [list service_type $type] \ - [list identifier [string tolower $identifier]] \ - [list parameters $parameters]]] - return $item_id -} - -ad_proc -public imsld::send_mail_service_new { - -service_id - -is_visible_p - {-parameters ""} - -recipients - {-item_id ""} - {-title ""} - {-package_id ""} - {-user_id ""} - {-creation_ip ""} - {-creation_date ""} - -edit:boolean - -parent_id:required -} { - Creates a new send mail serivce. - - @param service_id service where to which send mail service belongs - @param is_visible_p Initial visibility attribute - @option parameters Parameters to be passed during runtime - @param recipients Select: 'all-persons-in-role' or 'persons-in-role' - @option item_id Item_id of the send mail serivce. [db_nextval "acs_object_id_seq"] used by default. - @option title Title of the item. - @option package_id package_id for the instance of IMS-LD - @option user_id user that adds the send mail serivce. [ad_conn user_id] used by default. - @option creation_ip ip-address of the user that adds the send mail serivce. [ad_conn peeraddr] used by default. - @option creation_date Creation date of the send mail serivce. [dt_sysdate] used by default. - @param edit Are we editing the prerequiste? - @param parent_id Identifier of the parent folder -} { - - set user_id [expr { [empty_string_p $user_id] ? [ad_conn user_id] : $user_id }] - set creation_ip [expr { [empty_string_p $creation_ip] ? [ad_conn peeraddr] : $creation_ip }] - set creation_date [expr { [empty_string_p $creation_date] ? [dt_sysdate] : $creation_date }] - set package_id [expr { [empty_string_p $package_id] ? [ad_conn package_id] : $package_id }] - set item_id [expr { [empty_string_p $item_id] ? [db_nextval "acs_object_id_seq"] : $item_id }] - - set content_type imsld_send_mail_service - set item_name "${item_id}_imsld_send_mail_service" - set title [expr { [empty_string_p $title] ? $item_name : $title }] - - if { !$edit_p } { - # create - set item_id [content::item::new -item_id $item_id \ - -name $item_name \ - -content_type $content_type \ - -parent_id $parent_id \ - -creation_user $user_id \ - -creation_ip $creation_ip \ - -context_id $package_id] - } - - set revision_id [content::revision::new -item_id $item_id \ - -title $item_name \ - -content_type $content_type \ - -creation_user $user_id \ - -creation_ip $creation_ip \ - -item_id $item_id \ - -is_live "t" \ - -attributes [list [list class $class] \ - [list service_id $service_id] \ - [list recipients $recipients] \ - [list is_visible_p $-is_visible_p] \ - [list parameters $parameters]]] - return $item_id -} - -ad_proc -public imsld::send_mail_data_new { - -send_mail_service_id - -role_id - {-mail_data ""} - {-item_id ""} - {-title ""} - {-package_id ""} - {-user_id ""} - {-creation_ip ""} - {-creation_date ""} - -edit:boolean - -parent_id:required -} { - Creates a new send mail data - - @param send_mail_service_id send mail service to which send mail data belongs - @param role_id - @option mail_data - @option item_id Item_id of the send mail data. [db_nextval "acs_object_id_seq"] used by default. - @option title Title of the item. - @option package_id package_id for the instance of IMS-LD - @option user_id user that adds the send mail data. [ad_conn user_id] used by default. - @option creation_ip ip-address of the user that adds the send mail data. [ad_conn peeraddr] used by default. - @option creation_date Creation date of the send mail data. [dt_sysdate] used by default. - @param edit Are we editing the send mail data? - @param parent_id Identifier of the parent folder -} { - - set user_id [expr { [empty_string_p $user_id] ? [ad_conn user_id] : $user_id }] - set creation_ip [expr { [empty_string_p $creation_ip] ? [ad_conn peeraddr] : $creation_ip }] - set creation_date [expr { [empty_string_p $creation_date] ? [dt_sysdate] : $creation_date }] - set package_id [expr { [empty_string_p $package_id] ? [ad_conn package_id] : $package_id }] - set item_id [expr { [empty_string_p $item_id] ? [db_nextval "acs_object_id_seq"] : $item_id }] - - set content_type imsld_send_mail_service - set item_name "${item_id}_imsld_send_mail_service" - set title [expr { [empty_string_p $title] ? $item_name : $title }] - - if { !$edit_p } { - # create - set item_id [content::item::new -item_id $item_id \ - -name $item_name \ - -content_type $content_type \ - -parent_id $parent_id \ - -creation_user $user_id \ - -creation_ip $creation_ip \ - -context_id $package_id] - } - - set revision_id [content::revision::new -item_id $item_id \ - -title $item_name \ - -content_type $content_type \ - -creation_user $user_id \ - -creation_ip $creation_ip \ - -item_id $item_id \ - -is_live "t" \ - -attributes [list [list -send_mail_service_id -send_mail_service_id] \ - [list -role_id -role_id] \ - [list -mail_data -mail_data]]] - return $item_id -} - -ad_proc -public imsld::conference_service_new { - -service_id - -manager_id - {-imsld_item_id ""} - -conference_type - {-item_id ""} - {-title ""} - {-package_id ""} - {-user_id ""} - {-creation_ip ""} - {-creation_date ""} - -edit:boolean - -parent_id:required -} { - Creates a new conference service - - @param service_id Service to which conference service belongs - @param manager_id role_id of the conference manager - @option item_id Item_id of the conference service. [db_nextval "acs_object_id_seq"] used by default. - @option title Title of the item. - @option package_id package_id for the instance of IMS-LD - @option user_id user that adds the conference service. [ad_conn user_id] used by default. - @option creation_ip ip-address of the user that adds the conference service. [ad_conn peeraddr] used by default. - @option creation_date Creation date of the conference service. [dt_sysdate] used by default. - @param edit Are we editing the conference service? - @param parent_id Identifier of the parent folder -} { - - set user_id [expr { [empty_string_p $user_id] ? [ad_conn user_id] : $user_id }] - set creation_ip [expr { [empty_string_p $creation_ip] ? [ad_conn peeraddr] : $creation_ip }] - set creation_date [expr { [empty_string_p $creation_date] ? [dt_sysdate] : $creation_date }] - set package_id [expr { [empty_string_p $package_id] ? [ad_conn package_id] : $package_id }] - set item_id [expr { [empty_string_p $item_id] ? [db_nextval "acs_object_id_seq"] : $item_id }] - - set content_type imsld_conference_service - set item_name "${item_id}_imsld_conference_service" - set title [expr { [empty_string_p $title] ? $item_name : $title }] - - if { !$edit_p } { - # create - set item_id [content::item::new -item_id $item_id \ - -name $item_name \ - -content_type $content_type \ - -parent_id $parent_id \ - -creation_user $user_id \ - -creation_ip $creation_ip \ - -context_id $package_id] - } - - set revision_id [content::revision::new -item_id $item_id \ - -title $item_name \ - -content_type $content_type \ - -creation_user $user_id \ - -creation_ip $creation_ip \ - -item_id $item_id \ - -is_live "t" \ - -attributes [list [list -send_mail_service_id -send_mail_service_id] \ - [list -role_id -role_id] \ - [list -mail_data -mail_data]]] - return $item_id -} - -ad_proc -public imsld::environment_new { - -component_id - -identifier - {-learning_object_id ""} - {-item_id ""} - {-title ""} - {-package_id ""} - {-user_id ""} - {-creation_ip ""} - {-creation_date ""} - -edit:boolean - -parent_id:required -} { - Creates a new environment - - @param component_id Component id of the one that owns the environment. - @param identifier Unique identifier in the manifest. - @option learning_object_id In case the environment has one. - @option item_id Item_id of the environment. [db_nextval "acs_object_id_seq"] used by default. - @option title Title of the item. - @option package_id package_id for the instance of IMS-LD - @option user_id user that adds the environment. [ad_conn user_id] used by default. - @option creation_ip ip-address of the user that adds the environment. [ad_conn peeraddr] used by default. - @option creation_date Creation date of the environment. [dt_sysdate] used by default. - @param edit Are we editing the environment? - @param parent_id Identifier of the parent folder -} { - - set user_id [expr { [empty_string_p $user_id] ? [ad_conn user_id] : $user_id }] - set creation_ip [expr { [empty_string_p $creation_ip] ? [ad_conn peeraddr] : $creation_ip }] - set creation_date [expr { [empty_string_p $creation_date] ? [dt_sysdate] : $creation_date }] - set package_id [expr { [empty_string_p $package_id] ? [ad_conn package_id] : $package_id }] - set item_id [expr { [empty_string_p $item_id] ? [db_nextval "acs_object_id_seq"] : $item_id }] - - set content_type imsld_environment - set item_name "${item_id}_imsld_environment" - set title [expr { [empty_string_p $title] ? $item_name : $title }] - - if { !$edit_p } { - # create - set item_id [content::item::new -item_id $item_id \ - -name $item_name \ - -content_type $content_type \ - -parent_id $parent_id \ - -creation_user $user_id \ - -creation_ip $creation_ip \ - -context_id $package_id] - } - - set revision_id [content::revision::new -item_id $item_id \ - -title $item_name \ - -content_type $content_type \ - -creation_user $user_id \ - -creation_ip $creation_ip \ - -item_id $item_id \ - -is_live "t" \ - -attributes [list [list -component_id $component_id] \ - [list -identifier $identifier] \ - [list -learning_object_id $learning_object_id]]] - return $item_id -} - -ad_proc -public imsld::time_limit_new { - -time_in_seconds - {-item_id ""} - {-title ""} - {-package_id ""} - {-user_id ""} - {-creation_ip ""} - {-creation_date ""} - -edit:boolean - -parent_id:required -} { - Creates a new time limit - - @param time_in_seconds Amount of time in seconds - @option item_id Item_id of the time limit. [db_nextval "acs_object_id_seq"] used by default. - @option title Title of the item. - @option package_id package_id for the instance of IMS-LD - @option user_id user that adds the time limit. [ad_conn user_id] used by default. - @option creation_ip ip-address of the user that adds the time limit. [ad_conn peeraddr] used by default. - @option creation_date Creation date of the time limit. [dt_sysdate] used by default. - @param edit Are we editing the time limit? - @param parent_id Identifier of the parent folder -} { - - set user_id [expr { [empty_string_p $user_id] ? [ad_conn user_id] : $user_id }] - set creation_ip [expr { [empty_string_p $creation_ip] ? [ad_conn peeraddr] : $creation_ip }] - set creation_date [expr { [empty_string_p $creation_date] ? [dt_sysdate] : $creation_date }] - set package_id [expr { [empty_string_p $package_id] ? [ad_conn package_id] : $package_id }] - set item_id [expr { [empty_string_p $item_id] ? [db_nextval "acs_object_id_seq"] : $item_id }] - - set content_type imsld_time_limit - set item_name "${item_id}_imsld_time_limit" - set title [expr { [empty_string_p $title] ? $item_name : $title }] - - if { !$edit_p } { - # create - set item_id [content::item::new -item_id $item_id \ - -name $item_name \ - -content_type $content_type \ - -parent_id $parent_id \ - -creation_user $user_id \ - -creation_ip $creation_ip \ - -context_id $package_id] - } - - set revision_id [content::revision::new -item_id $item_id \ - -title $item_name \ - -content_type $content_type \ - -creation_user $user_id \ - -creation_ip $creation_ip \ - -item_id $item_id \ - -is_live "t" \ - -attributes [list [list -time_in_seconds]]] - return $item_id -} - -ad_proc -public imsld::on_completion_new { - -feedback_title - {-item_id ""} - {-title ""} - {-package_id ""} - {-user_id ""} - {-creation_ip ""} - {-creation_date ""} - -edit:boolean - -parent_id:required -} { - Creates a new on completion - - @param feedback_title - @option item_id Item_id of the on completion. [db_nextval "acs_object_id_seq"] used by default. - @option title Title of the item. - @option package_id package_id for the instance of IMS-LD - @option user_id user that adds the on completion. [ad_conn user_id] used by default. - @option creation_ip ip-address of the user that adds the on completion. [ad_conn peeraddr] used by default. - @option creation_date Creation date of the on completion. [dt_sysdate] used by default. - @param edit Are we editing the on completion? - @param parent_id Identifier of the parent folder -} { - - set user_id [expr { [empty_string_p $user_id] ? [ad_conn user_id] : $user_id }] - set creation_ip [expr { [empty_string_p $creation_ip] ? [ad_conn peeraddr] : $creation_ip }] - set creation_date [expr { [empty_string_p $creation_date] ? [dt_sysdate] : $creation_date }] - set package_id [expr { [empty_string_p $package_id] ? [ad_conn package_id] : $package_id }] - set item_id [expr { [empty_string_p $item_id] ? [db_nextval "acs_object_id_seq"] : $item_id }] - - set content_type imsld_on_completion - set item_name "${item_id}_imsld_on_completion" - set title [expr { [empty_string_p $title] ? $item_name : $title }] - - if { !$edit_p } { - # create - set item_id [content::item::new -item_id $item_id \ - -name $item_name \ - -content_type $content_type \ - -parent_id $parent_id \ - -creation_user $user_id \ - -creation_ip $creation_ip \ - -context_id $package_id] - } - - set revision_id [content::revision::new -item_id $item_id \ - -title $item_name \ - -content_type $content_type \ - -creation_user $user_id \ - -creation_ip $creation_ip \ - -item_id $item_id \ - -is_live "t" \ - -attributes [list [list -feedback_title $feedback_title]]] - return $item_id -} - -ad_proc -public imsld::learning_activity_new { - -identifier - -component_id - {-parameters ""} - -is_visible_p - -user_choice_p - {-time_limit_id ""} - {-on_completion_id ""} - {-learning_objective_id ""} - {-prerequisite_id ""} - {-item_id ""} - {-title ""} - {-package_id ""} - {-user_id ""} - {-creation_ip ""} - {-creation_date ""} - -edit:boolean - -parent_id:required -} { - Creates a new learning activity - - @param identifier learning activity unique identifier in the manifest - @param component_id component_id where the activity belongs - @option parameters Parameters to be passed during runtime - @param is_visible_p Initial visibility attribute - @param user_choice_p Will the learner decide when the activity ends? - @option time_limt_id Possible time limit associated with the activity - @option on_completion_id Learning activity actions to be executed after the activity is finished - @option learning_objective_id Possible learning objectives associated with the acitivty - @option prerequisite_id Possible prerequisites associated with the acitivty - @option item_id Item_id of the learning activity. [db_nextval "acs_object_id_seq"] used by default. - @option title Title of the item. - @option package_id package_id for the instance of IMS-LD - @option user_id user that adds the learning activity. [ad_conn user_id] used by default. - @option creation_ip ip-address of the user that adds the learning activity. [ad_conn peeraddr] used by default. - @option creation_date Creation date of the learning activity. [dt_sysdate] used by default. - @param edit Are we editing the learning activity? - @param parent_id Identifier of the parent folder -} { - - set user_id [expr { [empty_string_p $user_id] ? [ad_conn user_id] : $user_id }] - set creation_ip [expr { [empty_string_p $creation_ip] ? [ad_conn peeraddr] : $creation_ip }] - set creation_date [expr { [empty_string_p $creation_date] ? [dt_sysdate] : $creation_date }] - set package_id [expr { [empty_string_p $package_id] ? [ad_conn package_id] : $package_id }] - set item_id [expr { [empty_string_p $item_id] ? [db_nextval "acs_object_id_seq"] : $item_id }] - - set content_type imsld_learning_activity - set item_name "${item_id}_imsld_learning_activity" - set title [expr { [empty_string_p $title] ? $item_name : $title }] - - if { !$edit_p } { - # create - set item_id [content::item::new -item_id $item_id \ - -name $item_name \ - -content_type $content_type \ - -parent_id $parent_id \ - -creation_user $user_id \ - -creation_ip $creation_ip \ - -context_id $package_id] - } - - set revision_id [content::revision::new -item_id $item_id \ - -title $item_name \ - -content_type $content_type \ - -creation_user $user_id \ - -creation_ip $creation_ip \ - -item_id $item_id \ - -is_live "t" \ - -attributes [list [list -identifier $identifier] \ - [list -component_id $component_id] \ - [list -parameters $parameters] \ - [list -is_visible_p $is_visible_p] \ - [list -user_choice_p $user_choice_p] \ - [list -time_limit_id $time_limit_id] \ - [list -on_completion_id $on_completion_id] \ - [list -learning_objective_id $learning_objective_id] \ - [list -prerequisite_id $prerequisite_id]]] - return $item_id -} Index: openacs-4/packages/imsld/www/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/www/index.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/imsld/www/index.adp 5 Aug 2005 15:25:33 -0000 1.1 +++ openacs-4/packages/imsld/www/index.adp 19 Sep 2005 17:20:15 -0000 1.2 @@ -2,4 +2,5 @@ @page_title;noquote@ @context;noquote@ -index \ No newline at end of file +index +@mensaje@ ;;;; @lista@ \ No newline at end of file Index: openacs-4/packages/imsld/www/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/www/index.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/imsld/www/index.tcl 5 Aug 2005 15:25:33 -0000 1.1 +++ openacs-4/packages/imsld/www/index.tcl 19 Sep 2005 17:20:15 -0000 1.2 @@ -4,3 +4,458 @@ set page_title index set context {} + +ad_proc beta {} {} { + upvar lista lista + set compy $lista + lappend lista [list c d] + zeta +} + +ad_proc zeta {} {} { + upvar lista lista + lappend lista [list e f] + teta +} + +ad_proc teta {} {} { + upvar lista lista + set stypmy $lista + lappend lista [list z z j] +} + +set lista [list a b] +beta + +if { 1==2 } { + + set mensaje "crear" +# # learning objects +# content::type::new -content_type imsld_learning_object -supertype content_revision -pretty_name "<#_ Learning Object #>" -pretty_plural "<#_ Learning Objects #>" -table_name imsld_learning_objects -id_column learning_object_id + +# content::type::attribute::new -content_type imsld_learning_object -attribute_name identifier -datatype string -pretty_name "<#_ Identifier #>" -column_spec "varchar(100)" +# content::type::attribute::new -content_type imsld_learning_object -attribute_name class -datatype string -pretty_name "<#_ Class #>" -column_spec "varchar(4000)" +# content::type::attribute::new -content_type imsld_learning_object -attribute_name is_visible_p -datatype string -pretty_name "<#_ Is Visible? #>" -column_spec "char(1)" +# content::type::attribute::new -content_type imsld_learning_object -attribute_name type -datatype string -pretty_name "<#_ Type #>" -column_spec "varchar(100)" +# content::type::attribute::new -content_type imsld_learning_object -attribute_name parameters -datatype string -pretty_name "<#_ Parameters #>" -column_spec "varchar(4000)" + +# # imsld +# content::type::new -content_type imsld_imsld -supertype content_revision -pretty_name "<#_ IMS-LD #>" -pretty_plural "<#_ IMS-LDs #>" -table_name imsld_imslds -id_column imsld_id + +# content::type::attribute::new -content_type imsld_imsld -attribute_name identifier -datatype string -pretty_name "<#_ Identifier #>" -column_spec "varchar(100)" +# content::type::attribute::new -content_type imsld_imsld -attribute_name version -datatype string -pretty_name "<#_ Version #>" -column_spec "varchar(10)" +# content::type::attribute::new -content_type imsld_imsld -attribute_name level -datatype string -pretty_name "<#_ Level #>" -column_spec "char(1)" +# content::type::attribute::new -content_type imsld_imsld -attribute_name sequence_used_p -datatype string -pretty_name "<#_ Sequence Used #>" -column_spec "char(1)" +# content::type::attribute::new -content_type imsld_imsld -attribute_name learning_objective_id -datatype number -pretty_name "<#_ Learning Objectives ID #>" -column_spec "integer" +# content::type::attribute::new -content_type imsld_imsld -attribute_name prerequisite_id -datatype number -pretty_name "<#_ Prerequistes ID #>" -column_spec "integer" + +# # learning objectives +# content::type::new -content_type imsld_learning_objective -supertype content_revision -pretty_name "<#_ IMS-LD Learning Objective #>" -pretty_plural "<#_ IMS-LD Learning Objectives #>" -table_name imsld_learning_objectives -id_column learning_object_id + +# content::type::attribute::new -content_type imsld_learning_objective -attribute_name pretty_title -datatype string -pretty_name "<#_ Pretty Title #>" -column_spec "varchar(200)" + +# # imsld prerequisites +# content::type::new -content_type imsld_prerequisite -supertype content_revision -pretty_name "<#_ IMS-LD Prerequisite #>" -pretty_plural "<#_ IMS-LD Prerequisites #>" -table_name imsld_prerequisites -id_column prerequisite_id + +# content::type::attribute::new -content_type imsld_prerequisite -attribute_name pretty_title -datatype string -pretty_name "<#_ Pretty Title #>" -column_spec "varchar(200)" + +# # imsld items +# content::type::new -content_type imsld_item -supertype content_revision -pretty_name "<#_ IMS-LD Item #>" -pretty_plural "<#_ IMS-LD Items #>" -table_name imsld_items -id_column imsld_item_id + +# content::type::attribute::new -content_type imsld_item -attribute_name parent_item_id -datatype integer -pretty_name "<#_ Parent Item Identifier #>" -column_spec "integer" +# content::type::attribute::new -content_type imsld_item -attribute_name identifier -datatype string -pretty_name "<#_ Identifier #>" -column_spec "varchar(100)" +# content::type::attribute::new -content_type imsld_item -attribute_name identifierref -datatype string -pretty_name "<#_ Identifier Reference #>" -column_spec "varchar(100)" +# content::type::attribute::new -content_type imsld_item -attribute_name is_visible_p -datatype string -pretty_name "<#_ Is Visible? #>" -column_spec "char(1)" +# content::type::attribute::new -content_type imsld_item -attribute_name parameters -datatype string -pretty_name "<#_ Parameters #>" -column_spec "varchar(4000)" + +# # components +# content::type::new -content_type imsld_component -supertype content_revision -pretty_name "<#_ IMS-LD Component #>" -pretty_plural "<#_ IMS-LD Components #>" -table_name imsld_components -id_column component_id + +# content::type::attribute::new -content_type imsld_component -attribute_name imsld_id -datatype number -pretty_name "<#_ IMS-LD Identifier #>" -column_spec "integer" + +# # imsld roles +# content::type::new -content_type imsld_role -supertype content_revision -pretty_name "<#_ IMS-LD Role #>" -pretty_plural "<#_ IMS-LD Roles #>" -table_name imsld_roles -id_column role_id + +# content::type::attribute::new -content_type imsld_role -attribute_name component_id -datatype string -pretty_name "<#_ Component Identifier #>" -column_spec "integer" +# content::type::attribute::new -content_type imsld_role -attribute_name identifier -datatype string -pretty_name "<#_ Identifier #>" -column_spec "varchar(100)" +# content::type::attribute::new -content_type imsld_role -attribute_name role_type -datatype string -pretty_name "<#_ Role Type #>" -column_spec "varchar(100)" +# content::type::attribute::new -content_type imsld_role -attribute_name parent_role_id -datatype number -pretty_name "<#_ Parent Role Identifier #>" -column_spec "integer" +# content::type::attribute::new -content_type imsld_role -attribute_name create_new_p -datatype string -pretty_name "<#_ Create New? #>" -column_spec "char(1)" +# content::type::attribute::new -content_type imsld_role -attribute_name match_persons_p -datatype string -pretty_name "<#_ Match Persons? #>" -column_spec "char(1)" +# content::type::attribute::new -content_type imsld_role -attribute_name max_persons -datatype number -pretty_name "<#_ Max Persons #>" -column_spec "integer" +# content::type::attribute::new -content_type imsld_role -attribute_name min_persons -datatype number -pretty_name "<#_ Min Persons#>" -column_spec "integer" +# content::type::attribute::new -content_type imsld_role -attribute_name href -datatype string -pretty_name "<#_ Href #>" -column_spec "varchar(2000)" + +# # imsld activity description +# content::type::new -content_type imsld_activity_desc -supertype content_revision -pretty_name "<#_ IMS-LD Activity Description #>" -pretty_plural "<#_ IMS-LD Activity Descriptions #>" -table_name imsld_activity_desc -id_column description_id + +# content::type::attribute::new -content_type imsld_activity_desc -attribute_name pretty_title -datatype string -pretty_name "<#_ Pretty Title #>" -column_spec "varchar(200)" + +# # learning activities +# content::type::new -content_type imsld_learning_activity -supertype content_revision -pretty_name "<#_ IMS-LD Learning Activity #>" -pretty_plural "<#_ IMS-LD Learning Activities #>" -table_name imsld_learning_activities -id_column activity_id + +# content::type::attribute::new -content_type imsld_learning_activity -attribute_name identifier -datatype string -pretty_name "<#_ Identifier #>" -column_spec "varchar(100)" +# content::type::attribute::new -content_type imsld_learning_activity -attribute_name component_id -datatype number -pretty_name "<#_ Component Identifier #>" -column_spec "integer" +# content::type::attribute::new -content_type imsld_learning_activity -attribute_name activity_description_id -datatype number -pretty_name "<#_ Activity Description Identifier #>" -column_spec "integer" +# content::type::attribute::new -content_type imsld_learning_activity -attribute_name is_visible_p -datatype string -pretty_name "<#_ Is Visible? #>" -column_spec "char(1)" +# content::type::attribute::new -content_type imsld_learning_activity -attribute_name user_choice_p -datatype string -pretty_name "<#_ User Choice? #>" -column_spec "char(1)" +# content::type::attribute::new -content_type imsld_learning_activity -attribute_name time_limit_id -datatype number -pretty_name "<#_ Time Limit Identifier #>" -column_spec "integer" +# content::type::attribute::new -content_type imsld_learning_activity -attribute_name on_completion_id -datatype number -pretty_name "<#_ On Completion Identifier #>" -column_spec "integer" +# content::type::attribute::new -content_type imsld_learning_activity -attribute_name parameters -datatype string -pretty_name "<#_ Parameters #>" -column_spec "varchar(4000)" +# content::type::attribute::new -content_type imsld_learning_activity -attribute_name learning_objective_id -datatype number -pretty_name "<#_ Learning Objective ID #>" -column_spec "integer" +# content::type::attribute::new -content_type imsld_learning_activity -attribute_name prerequisite_id -datatype number -pretty_name "<#_ Prerequistes ID #>" -column_spec "integer" + +# # support activities +# content::type::new -content_type imsld_support_activity -supertype content_revision -pretty_name "<#_ IMS-LD Support Activity #>" -pretty_plural "<#_ IMS-LD Support Activities #>" -table_name imsld_support_activities -id_column activity_id + +# content::type::attribute::new -content_type imsld_support_activity -attribute_name identifier -datatype string -pretty_name "<#_ Identifier #>" -column_spec "varchar(100)" +# content::type::attribute::new -content_type imsld_support_activity -attribute_name component_id -datatype number -pretty_name "<#_ Component Identifier #>" -column_spec "integer" +# content::type::attribute::new -content_type imsld_support_activity -attribute_name parameter_id -datatype number -pretty_name "<#_ Parameter Identifier #>" -column_spec "integer" +# content::type::attribute::new -content_type imsld_support_activity -attribute_name is_visible_p -datatype string -pretty_name "<#_ Is Visible? #>" -column_spec "char(1)" +# content::type::attribute::new -content_type imsld_support_activity -attribute_name user_choice_p -datatype string -pretty_name "<#_ User Choice? #>" -column_spec "char(1)" +# content::type::attribute::new -content_type imsld_support_activity -attribute_name time_limit_id -datatype number -pretty_name "<#_ Time Limit Identifier #>" -column_spec "integer" +# content::type::attribute::new -content_type imsld_support_activity -attribute_name on_completion_id -datatype number -pretty_name "<#_ On Completion Identifier #>" -column_spec "integer" +# content::type::attribute::new -content_type imsld_support_activity -attribute_name parameters -datatype string -pretty_name "<#_ Parameters #>" -column_spec "varchar(4000)" + +# # activity structures +# content::type::new -content_type imsld_activity_structure -supertype content_revision -pretty_name "<#_ IMS-LD Activity Structure #>" -pretty_plural "<#_ IMS-LD Activity Structures #>" -table_name imsld_activity_structures -id_column structure_id + +# content::type::attribute::new -content_type imsld_activity_structure -attribute_name component_id -datatype number -pretty_name "<#_Component Identifier #>" -column_spec "integer" +# content::type::attribute::new -content_type imsld_activity_structure -attribute_name identifier -datatype string -pretty_name "<#_ Identifier #>" -column_spec "varchar(100)" +# content::type::attribute::new -content_type imsld_activity_structure -attribute_name number_to_select -datatype number -pretty_name "<#_ Number to Select #>" -column_spec "integer" +# content::type::attribute::new -content_type imsld_activity_structure -attribute_name structure_type -datatype string -pretty_name "<#_ Structure Type #>" -column_spec "char(9)" +# content::type::attribute::new -content_type imsld_activity_structure -attribute_name sort -datatype string -pretty_name "<#_ Sort #>" -column_spec "varchar(4)" + +# # environments +# content::type::new -content_type imsld_environment -supertype content_revision -pretty_name "<#_ IMD-LD Environment #>" -pretty_plural "<#_ IMD-LD Environments #>" -table_name imsld_environments -id_column environment_id + +# content::type::attribute::new -content_type imsld_environment -attribute_name component_id -datatype number -pretty_name "<#_ Component Identifier #>" -column_spec "integer" +# content::type::attribute::new -content_type imsld_environment -attribute_name identifier -datatype string -pretty_name "<#_ Identifier #>" -column_spec "varchar(100)" +# content::type::attribute::new -content_type imsld_environment -attribute_name learning_object_id -datatype number -pretty_name "<#_ Learning Object Identifier #>" -column_spec "integer" + +# # services +# content::type::new -content_type imsld_service -supertype content_revision -pretty_name "<#_ IMS-LD Service #>" -pretty_plural "<#_ IMS-LD Services #>" -table_name imsld_services -id_column service_id + +# content::type::attribute::new -content_type imsld_service -attribute_name environment_id -datatype number -pretty_name "<#_ Environment Identifier #>" -column_spec "integer" +# content::type::attribute::new -content_type imsld_service -attribute_name identifier -datatype string -pretty_name "<#_ Identifier #>" -column_spec "varchar(100)" +# content::type::attribute::new -content_type imsld_service -attribute_name class -datatype string -pretty_name "<#_ Class #>" -column_spec "varchar(4000)" +# content::type::attribute::new -content_type imsld_service -attribute_name is_visible_p -datatype string -pretty_name "<#_ Is Visible? #>" -column_spec "char(1)" +# content::type::attribute::new -content_type imsld_service -attribute_name parameters -datatype string -pretty_name "<#_ Parameters #>" -column_spec "varchar(4000)" +# content::type::attribute::new -content_type imsld_service -attribute_name service_type -datatype string -pretty_name "<#_ Service Type #>" -column_spec "varchar(10)" + +# # send mail services +# content::type::new -content_type imsld_send_mail_service -supertype content_revision -pretty_name "<#_ IMS-LD Sendmail Service #>" -pretty_plural "<#_ IMS-LD Sendmail Services #>" -table_name imsld_send_mail_services -id_column mail_id + +# content::type::attribute::new -content_type imsld_send_mail_service -attribute_name service_id -datatype number -pretty_name "<#_ Service Identifier #>" -column_spec "integer" +# content::type::attribute::new -content_type imsld_send_mail_service -attribute_name recipients -datatype string -pretty_name "<#_ Recipients #>" -column_spec "varchar(11)" +# content::type::attribute::new -content_type imsld_send_mail_service -attribute_name is_visible_p -datatype string -pretty_name "<#_ Is Visible? #>" -column_spec "char(1)" +# content::type::attribute::new -content_type imsld_send_mail_service -attribute_name parameters -datatype string -pretty_name "<#_ Parameters #>" -column_spec "varchar(4000)" + +# # send mail data +# content::type::new -content_type imsld_send_mail_data -supertype content_revision -pretty_name "<#_ IMS-LD Sendmail Data #>" -pretty_plural "<#_ IMS-LD Sendmail Data #>" -table_name imsld_send_mail_data -id_column data_id + +# content::type::attribute::new -content_type imsld_send_mail_data -attribute_name send_mail_id -datatype number -pretty_name "<#_ Sendmail Identifier #>" -column_spec "integer" +# content::type::attribute::new -content_type imsld_send_mail_data -attribute_name role_id -datatype number -pretty_name "<#_ Role Identifier #>" -column_spec "integer" +# content::type::attribute::new -content_type imsld_send_mail_data -attribute_name mail_data -datatype string -pretty_name "<#_ Mail Data #>" -column_spec "varchar(4000)" + +# # conference services +# content::type::new -content_type imsld_conference_service -supertype content_revision -pretty_name "<#_ IMS-LD Conference Service #>" -pretty_plural "<#_ IMS-LD Conference Services #>" -table_name imsld_conference_services -id_column conference_id + +# content::type::attribute::new -content_type imsld_conference_service -attribute_name service_id -datatype number -pretty_name "<#_ Service Identifier #>" -column_spec "integer" +# content::type::attribute::new -content_type imsld_conference_service -attribute_name conference_type -datatype string -pretty_name "<#_ Conference Type #>" -column_spec "char(12)" +# content::type::attribute::new -content_type imsld_conference_service -attribute_name imsld_item_id -datatype number -pretty_name "<#_ Item Identifier #>" -column_spec "integer" +# content::type::attribute::new -content_type imsld_conference_service -attribute_name manager_id -datatype number -pretty_name "<#_ Manager Identifier #>" -column_spec "integer" + +# # methods +# content::type::new -content_type imsld_method -supertype content_revision -pretty_name "<#_ IMS-LD Method #>" -pretty_plural "<#_ IMS-LD Methods #>" -table_name imsld_methods -id_column method_id + +# content::type::attribute::new -content_type imsld_method -attribute_name imsld_id -datatype number -pretty_name "<#_ IMS-LD Identifier #>" -column_spec "integer" +# content::type::attribute::new -content_type imsld_method -attribute_name time_limit_id -datatype number -pretty_name "<#_ Time Limit Identifier #>" -column_spec "integer" +# content::type::attribute::new -content_type imsld_method -attribute_name on_completion_id -datatype number -pretty_name "<#_ On Completion Identifier #>" -column_spec "integer" + +# # plays +# content::type::new -content_type imsld_play -supertype content_revision -pretty_name "<#_ IMS-LD Play #>" -pretty_plural "<#_ IMS-LD Plays #>" -table_name imsld_plays -id_column play_id + +# content::type::attribute::new -content_type imsld_play -attribute_name method_id -datatype number -pretty_name "<#_ Method Identifier #>" -column_spec "integer" +# content::type::attribute::new -content_type imsld_play -attribute_name is_visible_p -datatype string -pretty_name "<#_ Is Visible? #>" -column_spec "char(1)" +# content::type::attribute::new -content_type imsld_play -attribute_name identifier -datatype string -pretty_name "<#_ Identifier #>" -column_spec "varchar(100)" +# content::type::attribute::new -content_type imsld_play -attribute_name when_last_act_completed_p -datatype string -pretty_name "<#_ When Last Act Completed? #>" -column_spec "char(1)" +# content::type::attribute::new -content_type imsld_play -attribute_name time_limit_id -datatype number -pretty_name "<#_ Time Limit Identifier #>" -column_spec "integer" +# content::type::attribute::new -content_type imsld_play -attribute_name on_completion_id -datatype number -pretty_name "<#_ On Completion Identifier #>" -column_spec "integer" + +# # acts +# content::type::new -content_type imsld_act -supertype content_revision -pretty_name "<#_ IMS-LD Act #>" -pretty_plural "<#_ IMS-LD Acts #>" -table_name imsld_acts -id_column act_id + +# content::type::attribute::new -content_type imsld_act -attribute_name play_id -datatype number -pretty_name "<#_ Play Identifier #>" -column_spec "integer" +# content::type::attribute::new -content_type imsld_act -attribute_name time_limit_id -datatype number -pretty_name "<#_ Time Limit Identifier #>" -column_spec "integer" +# content::type::attribute::new -content_type imsld_act -attribute_name identifier -datatype string -pretty_name "<#_ Identifier #>" -column_spec "varchar(100)" +# content::type::attribute::new -content_type imsld_act -attribute_name on_completion_id -datatype number -pretty_name "<#_ On Completion Identifier #>" -column_spec "integer" + +# # role parts +# content::type::new -content_type imsld_role_part -supertype content_revision -pretty_name "<#_ IMS-LD Role Part #>" -pretty_plural "<#_ IMS-LD Role Parts #>" -table_name imsld_role_parts -id_column role_part_id + +# content::type::attribute::new -content_type imsld_role_part -attribute_name identifier -datatype string -pretty_name "<#_ Identifier #>" -column_spec "varchar(100)" +# content::type::attribute::new -content_type imsld_role_part -attribute_name role_id -datatype number -pretty_name "<#_ Role Identifier #>" -column_spec "integer" +# content::type::attribute::new -content_type imsld_role_part -attribute_name learning_activity_id -datatype number -pretty_name "<#_ Learning Activity Identifier #>" -column_spec "integer" +# content::type::attribute::new -content_type imsld_role_part -attribute_name support_activity_id -datatype number -pretty_name "<#_ Support Activity Identifier #>" -column_spec "integer" +# content::type::attribute::new -content_type imsld_role_part -attribute_name activity_structure_id -datatype number -pretty_name "<#_ Activity Structure Identifier #>" -column_spec "integer" +# content::type::attribute::new -content_type imsld_role_part -attribute_name environment_id -datatype number -pretty_name "<#_ Environment Identifier #>" -column_spec "integer" + +# # parameters +# content::type::new -content_type imsld_parameter -supertype content_revision -pretty_name "<#_ IMS-LD Parameter #>" -pretty_plural "<#_ IMS-LD Parameters #>" -table_name imsld_parameters -id_column parameter_id + +# content::type::attribute::new -content_type imsld_parameter -attribute_name value -datatype string -pretty_name "<#_ Value #>" -column_spec "varchar(4000)" + +# # time limits +# content::type::new -content_type imsld_time_limit -supertype content_revision -pretty_name "<#_ IMS-LD Time Limit #>" -pretty_plural "<#_ IMS-LD Time Limits #>" -table_name imsld_time_limits -id_column time_limit_id + +# content::type::attribute::new -content_type imsld_time_limit -attribute_name time_in_seconds -datatype number -pretty_name "<#_ Time in Seconds #>" -column_spec "integer" + +# # on completion +# content::type::new -content_type imsld_on_completion -supertype content_revision -pretty_name "<#_ IMS-LD On Completion #>" -pretty_plural "<#_ IMS-LD On Completions #>" -table_name imsld_on_completion -id_column on_completion_id + +# content::type::attribute::new -content_type imsld_on_completion -attribute_name feedback_title -datatype string -pretty_name "<#_ Feedbach Title #>" -column_spec "varchar(200)" + +# ### IMS-LD Content Packaging + +# # manifests +# content::type::new -content_type imsld_cp_manifest -supertype content_revision -pretty_name "<#_ IMS-LD CP Manifest #>" -pretty_plural "<#_ IMS-LD CP Manifests #>" -table_name imsld_cp_manifests -id_column manifest_id + +# content::type::attribute::new -content_type imsld_cp_manifest -attribute_name identifier -datatype string -pretty_name "<#_ Identifier #>" -column_spec "varchar(1000)" +# content::type::attribute::new -content_type imsld_cp_manifest -attribute_name version -datatype string -pretty_name "<#_ Version #>" -column_spec "varchar(100)" +# content::type::attribute::new -content_type imsld_cp_manifest -attribute_name parent_manifest_id -datatype number -pretty_name "<#_ Parent Manifest Identifier #>" -column_spec "integer" +# content::type::attribute::new -content_type imsld_cp_manifest -attribute_name is_shared_p -datatype string -pretty_name "<#_ Is shared? #>" -column_spec "char(1)" + +# # organizations +# content::type::new -content_type imsld_cp_organization -supertype content_revision -pretty_name "<#_ IMS-LD CP Organization #>" -pretty_plural "<#_ IMS-LD CP Organizations #>" -table_name imsld_cp_organizations -id_column organization_id + +# content::type::attribute::new -content_type imsld_cp_organization -attribute_name manifest_id -datatype number -pretty_name "<#_ Manifest Identifier #>" -column_spec "integer" + +# # resources +# content::type::new -content_type imsld_cp_resource -supertype content_revision -pretty_name "<#_ IMS-LD CP Resource #>" -pretty_plural "<#_ IMS-LD CP Resources #>" -table_name imsld_cp_resources -id_column resource_id + +# content::type::attribute::new -content_type imsld_cp_resource -attribute_name manifest_id -datatype number -pretty_name "<#_ Manifest Identifier #>" -column_spec "integer" +# content::type::attribute::new -content_type imsld_cp_resource -attribute_name identifier -datatype string -pretty_name "<#_ Identifier #>" -column_spec "varchar(100)" +# content::type::attribute::new -content_type imsld_cp_resource -attribute_name type -datatype string -pretty_name "<#_ Type #>" -column_spec "varchar(1000)" +# content::type::attribute::new -content_type imsld_cp_resource -attribute_name href -datatype string -pretty_name "<#_ Href #>" -column_spec "varchar(2000)" + +# # dependencies +# content::type::new -content_type imsld_cp_dependency -supertype content_revision -pretty_name "<#_ IMS-LD CP Dependency #>" -pretty_plural "<#_ IMS-LD CP Dependencies #>" -table_name imsld_cp_dependencies -id_column dependency_id + +# content::type::attribute::new -content_type imsld_cp_dependency -attribute_name resource_id -datatype number -pretty_name "<#_ Resource Identifier #>" -column_spec "integer" +# content::type::attribute::new -content_type imsld_cp_dependency -attribute_name identifierref -datatype string -pretty_name "<#_ Identifierref #>" -column_spec "varchar(100)" + +# # imsld cp files +# content::type::new -content_type imsld_cp_file -supertype content_revision -pretty_name "<#_ IMS-LD CP File #>" -pretty_plural "<#_ IMS-LD CP Filed #>" -table_name imsld_cp_files -id_column imsld_file_id + +# content::type::attribute::new -content_type imsld_cp_file -attribute_name resource_id -datatype number -pretty_name "<#_ Resource Identifier #>" -column_spec "integer" +# content::type::attribute::new -content_type imsld_cp_file -attribute_name path_to_file -datatype string -pretty_name "<#_ Path to File #>" -column_spec "varchar(2000)" +# content::type::attribute::new -content_type imsld_cp_file -attribute_name file_name -datatype string -pretty_name "<#_ File name #>" -column_spec "varchar(2000)" +# content::type::attribute::new -content_type imsld_cp_file -attribute_name href -datatype string -pretty_name "<#_ Href #>" -column_spec "varchar(2000)" + + +} else { + set mensaje "borrar" + +# imsld::apm_callback::before_uninstall + # learning objects +# content::type::attribute::delete -content_type imsld_learning_object -attribute_name identifier +# content::type::attribute::delete -content_type imsld_learning_object -attribute_name class +# content::type::attribute::delete -content_type imsld_learning_object -attribute_name is_visible_p +# content::type::attribute::delete -content_type imsld_learning_object -attribute_name type +# content::type::attribute::delete -content_type imsld_learning_object -attribute_name parameters + +# # imsld +# content::type::attribute::delete -content_type imsld_imsld -attribute_name identifier +# content::type::attribute::delete -content_type imsld_imsld -attribute_name version +# content::type::attribute::delete -content_type imsld_imsld -attribute_name level +# content::type::attribute::delete -content_type imsld_imsld -attribute_name sequence_used_p +# content::type::attribute::delete -content_type imsld_imsld -attribute_name learning_objective_id +# content::type::attribute::delete -content_type imsld_imsld -attribute_name prerequisite_id + +# # learning objectives +# content::type::attribute::delete -content_type imsld_learning_objective -attribute_name pretty_title + +# # imsld prerequisites +# content::type::attribute::delete -content_type imsld_prerequisite -attribute_name pretty_title + +# # imsld items +# content::type::attribute::delete -content_type imsld_item -attribute_name parent_item_id +# content::type::attribute::delete -content_type imsld_item -attribute_name identifier +# content::type::attribute::delete -content_type imsld_item -attribute_name identifierref +# content::type::attribute::delete -content_type imsld_item -attribute_name is_visible_p +# content::type::attribute::delete -content_type imsld_item -attribute_name parameters + +# # componets +# content::type::attribute::delete -content_type imsld_component -attribute_name imsld_id + +# # imsld roles +# content::type::attribute::delete -content_type imsld_role -attribute_name component_id +# content::type::attribute::delete -content_type imsld_role -attribute_name identifier +# content::type::attribute::delete -content_type imsld_role -attribute_name role_type +# content::type::attribute::delete -content_type imsld_role -attribute_name parent_role_id +# content::type::attribute::delete -content_type imsld_role -attribute_name create_new_p +# content::type::attribute::delete -content_type imsld_role -attribute_name match_persons_p +# content::type::attribute::delete -content_type imsld_role -attribute_name max_persons +# content::type::attribute::delete -content_type imsld_role -attribute_name min_persons +# content::type::attribute::delete -content_type imsld_role -attribute_name href + +# # activity descriptions +# content::type::attribute::delete -content_type imsld_activity_desc -attribute_name pretty_title + +# # learning activities +# content::type::attribute::delete -content_type imsld_learning_activity -attribute_name identifier +# content::type::attribute::delete -content_type imsld_learning_activity -attribute_name component_id +# content::type::attribute::delete -content_type imsld_learning_activity -attribute_name activity_description_id +# content::type::attribute::delete -content_type imsld_learning_activity -attribute_name is_visible_p +# content::type::attribute::delete -content_type imsld_learning_activity -attribute_name user_choice_p +# content::type::attribute::delete -content_type imsld_learning_activity -attribute_name time_limit_id +# content::type::attribute::delete -content_type imsld_learning_activity -attribute_name on_completion_id +# content::type::attribute::delete -content_type imsld_learning_activity -attribute_name parameters +# content::type::attribute::delete -content_type imsld_learning_activity -attribute_name learning_objective_id +# content::type::attribute::delete -content_type imsld_learning_activity -attribute_name prerequisite_id + +# # support activities +# content::type::attribute::delete -content_type imsld_support_activity -attribute_name identifier +# content::type::attribute::delete -content_type imsld_support_activity -attribute_name component_id +# content::type::attribute::delete -content_type imsld_support_activity -attribute_name parameter_id +# content::type::attribute::delete -content_type imsld_support_activity -attribute_name is_visible_p +# content::type::attribute::delete -content_type imsld_support_activity -attribute_name user_choice_p +# content::type::attribute::delete -content_type imsld_support_activity -attribute_name time_limit_id +# content::type::attribute::delete -content_type imsld_support_activity -attribute_name on_completion_id +# content::type::attribute::delete -content_type imsld_support_activity -attribute_name parameters + +# # activity structures +# content::type::attribute::delete -content_type imsld_activity_structure -attribute_name component_id +# content::type::attribute::delete -content_type imsld_activity_structure -attribute_name identifier +# content::type::attribute::delete -content_type imsld_activity_structure -attribute_name number_to_select +# content::type::attribute::delete -content_type imsld_activity_structure -attribute_name structure_type +# content::type::attribute::delete -content_type imsld_activity_structure -attribute_name sort + +# # environments +# content::type::attribute::delete -content_type imsld_environment -attribute_name component_id +# content::type::attribute::delete -content_type imsld_environment -attribute_name identifier +# content::type::attribute::delete -content_type imsld_environment -attribute_name learning_object_id + +# # send mail service +# content::type::attribute::delete -content_type imsld_service -attribute_name environment_id +# content::type::attribute::delete -content_type imsld_service -attribute_name identifier +# content::type::attribute::delete -content_type imsld_service -attribute_name class +# content::type::attribute::delete -content_type imsld_service -attribute_name is_visible_p +# content::type::attribute::delete -content_type imsld_service -attribute_name parameters +# content::type::attribute::delete -content_type imsld_service -attribute_name service_type + +# # send mail service +# content::type::attribute::delete -content_type imsld_send_mail_service -attribute_name service_id +# content::type::attribute::delete -content_type imsld_send_mail_service -attribute_name recipients +# content::type::attribute::delete -content_type imsld_send_mail_service -attribute_name is_visible_p +# content::type::attribute::delete -content_type imsld_send_mail_service -attribute_name parameters + +# # send mail data +# content::type::attribute::delete -content_type imsld_send_mail_data -attribute_name send_mail_id +# content::type::attribute::delete -content_type imsld_send_mail_data -attribute_name role_id +# content::type::attribute::delete -content_type imsld_send_mail_data -attribute_name mail_data + +# # conference service +# content::type::attribute::delete -content_type imsld_conference_service -attribute_name service_id +# content::type::attribute::delete -content_type imsld_conference_service -attribute_name conference_type +# content::type::attribute::delete -content_type imsld_conference_service -attribute_name imsld_item_id +# content::type::attribute::delete -content_type imsld_conference_service -attribute_name manager_id + +# # methods +# content::type::attribute::delete -content_type imsld_method -attribute_name imsld_id +# content::type::attribute::delete -content_type imsld_method -attribute_name time_limit_id +# content::type::attribute::delete -content_type imsld_method -attribute_name on_completion_id + +# # plays +# content::type::attribute::delete -content_type imsld_play -attribute_name method_id +# content::type::attribute::delete -content_type imsld_play -attribute_name is_visible_p +# content::type::attribute::delete -content_type imsld_play -attribute_name identifier +# content::type::attribute::delete -content_type imsld_play -attribute_name when_last_act_completed_p +# content::type::attribute::delete -content_type imsld_play -attribute_name time_limit_id +# content::type::attribute::delete -content_type imsld_play -attribute_name on_completion_id + +# # acts +# content::type::attribute::delete -content_type imsld_act -attribute_name play_id +# content::type::attribute::delete -content_type imsld_act -attribute_name time_limit_id +# content::type::attribute::delete -content_type imsld_act -attribute_name identifier +# content::type::attribute::delete -content_type imsld_act -attribute_name on_completion_id + +# # role parts +# content::type::attribute::delete -content_type imsld_role_part -attribute_name identifier +# content::type::attribute::delete -content_type imsld_role_part -attribute_name role_id +# content::type::attribute::delete -content_type imsld_role_part -attribute_name learning_activity_id +# content::type::attribute::delete -content_type imsld_role_part -attribute_name support_activity_id +# content::type::attribute::delete -content_type imsld_role_part -attribute_name activity_structure_id +# content::type::attribute::delete -content_type imsld_role_part -attribute_name environment_id + +# # parameters +# content::type::attribute::delete -content_type imsld_parameter -attribute_name value + +# # time limits +# content::type::attribute::delete -content_type imsld_time_limit -attribute_name time_in_seconds + +# # on completion +# content::type::attribute::delete -content_type imsld_on_completion -attribute_name feedback_title + +# ### IMS-LD Content Packaging + +# # manifests +# content::type::attribute::delete -content_type imsld_cp_manifest -attribute_name identifier +# content::type::attribute::delete -content_type imsld_cp_manifest -attribute_name version +# content::type::attribute::delete -content_type imsld_cp_manifest -attribute_name parent_manifest_id +# content::type::attribute::delete -content_type imsld_cp_manifest -attribute_name is_shared_p + +# # organizations +# content::type::attribute::delete -content_type imsld_cp_organization -attribute_name manifest_id + +# # resources +# content::type::attribute::delete -content_type imsld_cp_resource -attribute_name manifest_id +# content::type::attribute::delete -content_type imsld_cp_resource -attribute_name identifier +# content::type::attribute::delete -content_type imsld_cp_resource -attribute_name type +# content::type::attribute::delete -content_type imsld_cp_resource -attribute_name href + +# # dependencies +# content::type::attribute::delete -content_type imsld_cp_dependency -attribute_name resource_id +# content::type::attribute::delete -content_type imsld_cp_dependency -attribute_name identifierref + +# # imsld cp files +# content::type::attribute::delete -content_type imsld_cp_file -attribute_name resource_id +# content::type::attribute::delete -content_type imsld_cp_file -attribute_name path_to_file +# content::type::attribute::delete -content_type imsld_cp_file -attribute_name file_name +# content::type::attribute::delete -content_type imsld_cp_file -attribute_name href + +# content::type::delete -content_type imsld_learning_object -drop_table_p t +# content::type::delete -content_type imsld_imsld -drop_table_p t +# content::type::delete -content_type imsld_learning_objective -drop_table_p t +# content::type::delete -content_type imsld_prerequisite -drop_table_p t +# content::type::delete -content_type imsld_item -drop_table_p t +# content::type::delete -content_type imsld_component -drop_table_p t +# content::type::delete -content_type imsld_role -drop_table_p t +# content::type::delete -content_type imsld_prerequisite -drop_table_p t +# content::type::delete -content_type imsld_activity_desc -drop_table_p t +# content::type::delete -content_type imsld_learning_activity -drop_table_p t +# content::type::delete -content_type imsld_support_activity -drop_table_p t +# content::type::delete -content_type imsld_activity_structure -drop_table_p t +# content::type::delete -content_type imsld_environment -drop_table_p t +# content::type::delete -content_type imsld_service -drop_table_p t +# content::type::delete -content_type imsld_send_mail_service -drop_table_p t +# content::type::delete -content_type imsld_send_mail_data -drop_table_p t +# content::type::delete -content_type imsld_conference_service -drop_table_p t +# content::type::delete -content_type imsld_method -drop_table_p t +# content::type::delete -content_type imsld_play -drop_table_p t +# content::type::delete -content_type imsld_act -drop_table_p t +# content::type::delete -content_type imsld_role_part -drop_table_p t +# content::type::delete -content_type imsld_parameter -drop_table_p t +# content::type::delete -content_type imsld_time_limit -drop_table_p t +# content::type::delete -content_type imsld_on_completion -drop_table_p t + +# ### IMS-LD Content Packaging +# content::type::delete -content_type imsld_cp_manifest -drop_table_p t +# content::type::delete -content_type imsld_cp_organization -drop_table_p t +# content::type::delete -content_type imsld_cp_resource -drop_table_p t +# content::type::delete -content_type imsld_cp_dependency -drop_table_p t +# content::type::delete -content_type imsld_cp_file -drop_table_p t + + +} \ No newline at end of file Index: openacs-4/packages/imsld/www/admin/imsld-new-3.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/www/admin/Attic/imsld-new-3.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/imsld/www/admin/imsld-new-3.tcl 5 Aug 2005 15:25:33 -0000 1.2 +++ openacs-4/packages/imsld/www/admin/imsld-new-3.tcl 19 Sep 2005 17:20:15 -0000 1.3 @@ -34,7 +34,7 @@ set manifest_list [imsld::parse::parse_and_create_imsld_manifest -xmlfile $tmp_dir/imsmanifest.xml \ -manifest_id $manifest_id \ -tmp_dir $tmp_dir \ - -community_id 2040] + -community_id 2093] set manifest_id [lindex $manifest_list 0]