Index: openacs-4/packages/application-track/application-track.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/application-track/application-track.info,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/application-track/application-track.info 8 Nov 2005 15:42:51 -0000 1.1 @@ -0,0 +1,29 @@ + + + + + Application Track + Applications Track + f + t + application-track + + + Pablo Mu�oz + David Ortega + Pablo Arozarena + Gives information about the use of applications within communities or classes. + 2005-08-05 + E-Lane Project + Gives information about the use of applications within communities or classes. + + + + + + + + + + + Index: openacs-4/packages/application-track/catalog/application-track.en_US.ISO-8859-1.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/application-track/catalog/application-track.en_US.ISO-8859-1.xml,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/application-track/catalog/application-track.en_US.ISO-8859-1.xml 8 Nov 2005 15:42:52 -0000 1.1 @@ -0,0 +1,42 @@ + + + + Todo + Application + Application Name + Application Track + Application Track Management + Chose the applications to analyze + Class + Class_instance + Select classes and aplications to analyze + Classes Selection + Select communities and applications to analyze + Communities Selection + Community + Community Name + Created elements + Department + Departments + General Report + Go + Group Name + ID + Click on created elements number to see a report about the use of the application within the community. + Click on #application-track.Go# to see a report about every application installed within the community. + Elements created by every application within selected communities + View data about every application in selected communities + View data for selected applications in every community + Members + Please type a keyword + Previous report + Report about installed applications + Select by applications + Select by communities + Select by department and/or term + Select classes to analyze + Select communities to analyze + Show classes only with + Term + term + Index: openacs-4/packages/application-track/catalog/application-track.es_ES.ISO-8859-1.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/application-track/catalog/application-track.es_ES.ISO-8859-1.xml,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/application-track/catalog/application-track.es_ES.ISO-8859-1.xml 8 Nov 2005 15:42:52 -0000 1.1 @@ -0,0 +1,37 @@ + + + + Todo + Aplicaci�n + Nombre de la aplicaci�n + Seguimiento de Aplicaciones + Clase + Instancia de clase + Selecci�n de clases + Selecci�n de Comunidades + Comunidad + Nombre de la comunidad + Elementos creados + Departamento + Departamentos + Informe General + Ver + Nombre del grupo + ID + Pulse en el n�mero de elementos creados para ver informes sobre el uso de la aplicaci�n en la comunidad. + Pulse en "Ver" para ver un informe sobre todas las aplicaciones instaladas en esa comunidad. + Elementos creados por cada aplicaci�n dentro de las comunidades seleccionadas + Ver datos sobre todas las aplicaciones en las comunidades seleccionadas + Ver datos sobre las aplicaciones seleccionadas en todas las comunidades + Miembros + Introduzca palabra + Informe sobre las aplicaciones instaladas + Selecci�n por aplicaci�n + Selecci�n por comunidad + Selecci�n por departamento y/o periodo + Selecciona las clases a analizar + Selecciona las comunidades a analizar + Mostras clases s�lo con + Periodo + Periodo + Index: openacs-4/packages/application-track/tcl/application-track-callback-definition-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/application-track/tcl/application-track-callback-definition-procs.tcl,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/application-track/tcl/application-track-callback-definition-procs.tcl 8 Nov 2005 15:42:52 -0000 1.1 @@ -0,0 +1,39 @@ +ad_library { + + User-tracking Library + + @creation-date 2004-08-10 + @author David Ortega (doa@tid.es) + +} + +namespace eval user-tracking { + + ad_proc -callback getApplicationName { + - + } { + Obtains application names + +} - + + ad_proc -callback GetGeneralInfo { + -comm_id:required +} { + Obtains application independient info + Returns a list with: comm_id, comm_name, number_of_created_elements (forums, news, faqs, ...) + In comm_name there will be a link to call to GetSpecificInfo of that community. +} - + + +ad_proc -callback GetSpecificInfo { + -comm_id:required -query_name -elements_name +} { + Obtains application dependient info + Returns a list with particular data about each application in each community. + For instace, in forums, it will return a list with: forum_name, #threads, 1st_thead_date, last_thread_date +} - + + +} + + Index: openacs-4/packages/application-track/tcl/application-track-callback-implementation-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/application-track/tcl/Attic/application-track-callback-implementation-procs.tcl,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/application-track/tcl/application-track-callback-implementation-procs.tcl 8 Nov 2005 15:42:52 -0000 1.1 @@ -0,0 +1,640 @@ + ad_proc -callback getApplicationName -impl file_storage {} { + callback implementation + } { + return "file_storage" + } + + ad_proc -callback GetGeneralInfo -impl file_storage {} { + callback implementation + } { + + db_1row my_query { + select count(1) as result + from acs_objects a, acs_objects b + where b.object_id = :comm_id + and a.tree_sortkey between b.tree_sortkey + and tree_right(b.tree_sortkey) + and a.object_type = 'file_storage_object' + } + + + return "$result" + } + + + ad_proc -callback GetSpecificInfo -impl file_storage {} { + callback implementation + } { + + upvar $query_name my_query + upvar $elements_name my_elements + + + set my_query { + + SELECT f.name as name, f.file_id, f.type as type, f.content_size as size, + to_char(f.last_modified, 'YYYY-MM-DD HH24:MI:SS') as last_modified, + to_char(o.creation_date, 'YYYY-MM-DD HH24:MI:SS') as creation_date, + (select site_node__url(site_nodes.node_id) + from site_nodes, acs_objects + where site_nodes.object_id = file_storage__get_package_id(f.parent_id) and acs_objects.object_id = f.file_id) as url, + com.community_id as class_id + FROM fs_files f,dotlrn_communities_full com,acs_objects o, acs_objects o2 + WHERE f.file_id = o.object_id + and com.community_id=:class_instance_id + and o2.object_id= file_storage__get_package_id(f.parent_id) + and o2.context_id=com.package_id + + } + + + set my_elements { + name { + label "Name" + display_col name + html {align center} + + } + type { + label "Type" + display_col type + html {align center} + + } + size { + label "Size" + display_col size + html {align center} + + } + last_modification_date { + label "Last_Modification_Date" + display_col last_modified + html {align center} + } + post_date { + label "Post_Date" + display_col creation_date + html {align center} + + } + + } + + + } + + + ad_proc -callback getApplicationName -impl news {} { + callback implementation + } { + return "news" + } + + ad_proc -callback GetGeneralInfo -impl news {} { + callback implementation + } { + db_1row my_query { + select count(n.item_id) as result + FROM news_items_approved n, dotlrn_class_instances_full com + WHERE class_instance_id=:comm_id + and apm_package__parent_id(n.package_id) = com.package_id + } + + return "$result" + } + + + ad_proc -callback GetSpecificInfo -impl news {} { + callback implementation + } { + + upvar $query_name my_query + upvar $elements_name my_elements + + + + set my_query { + SELECT news.publish_title as name, news.pretty_publish_date as initial_date, news.publish_date as finish_date + FROM news_items_approved news,dotlrn_communities_full com + WHERE community_id=:class_instance_id + and apm_package__parent_id(news.package_id) = com.package_id } + + set my_elements { + name { + label "Name" + display_col name + html {align center} + + } + initial_date { + label "Initial Date" + display_col initial_date + html {align center} + } + finish_date { + label "Finish Date" + display_col finish_date + html {align center} + } + } + return "OK" + } + + + ad_proc -callback getApplicationName -impl evaluation {} { + callback implementation + } { + return "evaluation" + } + ad_proc -callback GetGeneralInfo -impl evaluation {} { + callback implementation + } { + + db_1row my_query { + select count(1) as result + from acs_objects a, acs_objects b + where b.object_id = :comm_id + and a.tree_sortkey between b.tree_sortkey + and tree_right(b.tree_sortkey) + and a.object_type = 'evaluation_tasks' + } + return "$result" + } + + ad_proc -callback GetSpecificInfo -impl evaluation {} { + callback implementation + } { + + upvar $query_name my_query + upvar $elements_name my_elements + + set my_query { + select e.task_name as name,e.task_id as task_id,e.number_of_members as number_elements + from acs_objects a, acs_objects b,evaluation_tasks e + where b.object_id = :class_instance_id + and a.tree_sortkey between b.tree_sortkey + and tree_right(b.tree_sortkey) + and a.object_type = 'evaluation_tasks' + and e.task_id = a.object_id + + } + + set my_elements { + name { + label "Name" + display_col name + html {align center} + + } + id { + label "Id" + display_col task_id + html {align center} + } + number_elements { + label "Number of elements" + display_col number_elements + html {align center} + } + + + } + } + + + + + ad_proc -callback getApplicationName -impl forums {} { + callback implementation + } { + return "forums" + } + + ad_proc -callback GetGeneralInfo -impl forums {} { + callback implementation + } { + db_1row my_query { + select count(f.forum_id) as result + FROM forums_forums f, dotlrn_communities_full com + WHERE com.community_id=:comm_id + and apm_package__parent_id(f.package_id) = com.package_id + } + + return "$result" + } + + ad_proc -callback GetSpecificInfo -impl forums {} { + callback implementation + } { + + upvar $query_name my_query + upvar $elements_name my_elements + + set my_query { + SELECT f.name as name,f.thread_count as threads, + f.last_post, + to_char(o.creation_date, 'YYYY-MM-DD HH24:MI:SS') as creation_date + FROM forums_forums f,dotlrn_communities_full com,acs_objects o + WHERE com.community_id=:class_instance_id + and f.forum_id = o.object_id + and apm_package__parent_id(f.package_id) = com.package_id + } + + set my_elements { + name { + label "Name" + display_col name + html {align center} + + } + threads { + label "Threads" + display_col threads + html {align center} + } + creation_date { + label "creation_date" + display_col creation_date + html {align center} + } + last_post { + label "last_post" + display_col last_post + html {align center} + } + + + } + + return "OK" + } + + + ad_proc -callback getApplicationName -impl assessments {} { + callback implementation + } { + return "assessments" + } + + ad_proc -callback GetGeneralInfo -impl assessments {} { + callback implementation + } { + db_1row my_query { + select count(1) as result + FROM as_assessments a,dotlrn_communities_all com, acs_objects ac, acs_objects ac2,acs_objects ac3 + WHERE com.community_id = 2560 + and a.assessment_id = ac.object_id + and ac.context_id = ac2.object_id + and ac2.package_id = ac3.object_id + and ac3.context_id = com.package_id + } + + return "$result" + } + + ad_proc -callback GetSpecificInfo -impl assessments {} { + callback implementation + } { + + upvar $query_name my_query + upvar $elements_name my_elements + + set my_query { + SELECT a.assessment_id as id,a.instructions as instructions,a.start_time as initial_date, + a.end_time as finish_date, + a.number_tries + FROM as_assessments a,dotlrn_communities_all com, acs_objects ac, acs_objects ac2,acs_objects ac3 + WHERE com.community_id = :class_instance_id + and a.assessment_id = ac.object_id + and ac.context_id = ac2.object_id + and ac2.package_id = ac3.object_id + and ac3.context_id = com.package_id + } + + set my_elements { + + id { + label "id" + display_col id + html {align center} + } + instructions { + label "instructions" + display_col instructions + html {align center} + } + creation_date { + label "creation_date" + display_col initial_date + html {align center} + } + finish_date { + label "finish_date" + display_col finish_time + html {align center} + } + number_tries { + label "number_tries" + display_col number_tries + html {align center} + } + + } + + return "OK" + } + + ad_proc -callback getApplicationName -impl faqs {} { + callback implementation + } { + return "faqs" + } + + ad_proc -callback GetGeneralInfo -impl faqs {} { + callback implementation + } { + db_1row my_query { + select count(f.faq_id) as result + from faqs f, acs_objects o, dotlrn_communities com + where o.object_id=f.faq_id + and com.community_id=:comm_id + and apm_package__parent_id(o.context_id) = com.package_id + } + + return "$result" + } + + ad_proc -callback GetSpecificInfo -impl faqs {} { + callback implementation + } { + + upvar $query_name my_query + upvar $elements_name my_elements + + set my_query { + select f.faq_name as name,f1.question as question,f1.answer as answer + from faqs f, acs_objects o, dotlrn_communities com,faq_q_and_as f1 + where o.object_id=f.faq_id + and com.community_id=:class_instance_id + and apm_package__parent_id(o.context_id) = com.package_id + and f.faq_id = f1.faq_id + } + + set my_elements { + name { + label "Name" + display_col name + html {align center} + + } + questions { + label "Questions" + display_col question + html {align center} + } + questions { + label "Answers" + display_col answer + html {align center} + } + + } + + return "OK" + } + + + ad_proc -callback getApplicationName -impl weblogger {} { + callback implementation + } { + return "weblogger" + } + + ad_proc -callback GetGeneralInfo -impl weblogger {} { + callback implementation + } { + db_1row my_query { + select count(1) as result + from pinds_blog_entries w, dotlrn_communities com + where com.community_id=:comm_id + and apm_package__parent_id(w.package_id) = com.package_id + } + + return "$result" + } + ad_proc -callback GetSpecificInfo -impl weblogger {} { + callback implementation + } { + + upvar $query_name my_query + upvar $elements_name my_elements + + set my_query { + select count(c.comment_id) as result + from pinds_blog_entries w, dotlrn_communities com, general_comments c + where com.community_id=:class_instance_id + and apm_package__parent_id(w.package_id) = com.package_id + and c.object_id=w.entry_id + group by w.entry_id + } + + set my_elements { + comments { + label "Comments per weblogger" + display_col result + html {align center} + } + + } + + return "OK" + } + + ad_proc -callback getApplicationName -impl lorsm {} { + callback implementation + } { + return "lorsm" + } + + ad_proc -callback GetGeneralInfo -impl lorsm {} { + callback implementation + } { + db_1row my_query { + select count(1) as result + from ( + select distinct l.course_id + from lorsm_student_track l + where l.community_id=:comm_id + group by l.course_id) as t + } + + return "$result" + } + ad_proc -callback GetSpecificInfo -impl lorsm {} { + callback implementation + } { + + upvar $query_name my_query + upvar $elements_name my_elements + + set my_query { + select d.id,i.course_name,l.start_time,l.end_time + from lorsm_student_track l, dotlrn_users d, ims_cp_manifests i + where l.course_id IN + ( + select distinct l.course_id + from lorsm_student_track l + where l.community_id=:class_instance_id + group by l.course_id) + and l.user_id = d.user_id + and l.course_id = i.man_id + } + + set my_elements "" + + return "OK" + } + + + + ad_proc -callback getApplicationName -impl album {} { + callback implementation + } { + return "album" + } + + ad_proc -callback GetGeneralInfo -impl album {} { + callback implementation + } { + db_1row my_query { + select count(p.pa_album_id) as result + from pa_albums p, cr_items cr,acs_objects a,dotlrn_communities_all d + where d.community_id = :comm_id + and cr.live_revision = p.pa_album_id + and a.object_id = cr.parent_id + and apm_package__parent_id(a.context_id) = d.package_id + + } + + return "$result" + } + + + ad_proc -callback GetSpecificInfo -impl album {} { + callback implementation + } { + + upvar $query_name my_query + upvar $elements_name my_elements + + set my_query { + + select p.pa_photo_id as id,p.story as story,p.photographer as photographer + from pa_photos p, dotlrn_communities com,acs_objects ac,acs_objects ac2,acs_objects ac1 + where com.community_id=:class_instance_id + and ac.object_id = p.pa_photo_id + and ac.context_id = ac1.object_id + and ac1.context_id = ac2.object_id + and ac2.context_id + IN (select ac1.context_id + from pa_albums p, dotlrn_communities com,acs_objects ac,acs_objects ac1 + where com.community_id=:class_instance_id + and ac.object_id = p.pa_album_id + and ac.context_id = ac1.object_id + ) + + } + set my_elements { + photo_id { + label "Photo_id" + display_col id + html {align center} + } + p_story { + label "Story" + display_col story + html {align center} + } + p_photographer { + label "photographer" + display_col photographer + html {align center} + } + + } + + return "OK" + } + + ad_proc -callback getApplicationName -impl presentation {} { + callback implementation + } { + return "presentation" + } + + ad_proc -callback GetGeneralInfo -impl presentation {} { + callback implementation + } { + db_1row my_query { + select count(c.presentation_id) as result + from cr_wp_presentations c,dotlrn_communities com,acs_objects a + where com.community_id=:comm_id + and apm_package__parent_id(a.context_id) = com.package_id + and a.object_id = c.presentation_id + } + + + + return "$result" + } + + + + + + ad_proc -callback GetSpecificInfo -impl presentation {} { + callback implementation + } { + + upvar $query_name my_query + upvar $elements_name my_elements + + set my_query { + select com.community_id as id,com.pretty_name as name,c.presentation_id as p_id,c.pres_title as title + from cr_wp_presentations c,dotlrn_communities com,acs_objects a + where com.community_id=:class_instance_id + and apm_package__parent_id(a.context_id) = com.package_id + and a.object_id = c.presentation_id + } + + + + set my_elements { + id { + label "Community_id" + display_col id + html {align center} + } + name { + label "Name" + display_col name + html {align center} + } + p_id { + label "Presentation_id" + display_col p_id + html {align center} + } + title { + label "Title" + display_col title + html {align center} + } + } + + + + return "OK" + } + Index: openacs-4/packages/application-track/www/applications.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/application-track/www/applications.adp,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/application-track/www/applications.adp 8 Nov 2005 15:42:52 -0000 1.1 @@ -0,0 +1,11 @@ + +#application-track.Previous_report# + +
+ +


#application-track.Chose_applications#

+
+ +
+ + \ No newline at end of file Index: openacs-4/packages/application-track/www/applications.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/application-track/www/applications.tcl,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/application-track/www/applications.tcl 8 Nov 2005 15:42:52 -0000 1.1 @@ -0,0 +1,28 @@ +ad_page_contract { + +} -query { +} -properties { + classes:multirow +} + +set applicationsList [callback -catch getApplicationName] + +template::multirow create Applications Name +foreach app $applicationsList { + multirow append Applications $app +} + + +template::list::create \ + -name Applications \ + -multirow Applications \ + -key Name \ + -bulk_actions {"#application-track.lt_View_data_for_selected_applications#" "general" "#application-track.lt_View_data_for_selected_applications#"} \ + -elements { + name { + label "[_ application-track.Application_Name]" + display_col Name + html {align center} + } + } + \ No newline at end of file Index: openacs-4/packages/application-track/www/classes.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/application-track/www/classes.adp,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/application-track/www/classes.adp 8 Nov 2005 15:42:52 -0000 1.1 @@ -0,0 +1,124 @@ + +#application-track.Classes_Selection# +#application-track.Classes_Selection# + + +
+ +
+ + + + + + +
+ + + + + + + +
+ + + + + + + + + + + + + + +
+ + #application-track.Departments#:
+
+
+ + #application-track.term#:
+
+
+
+ #application-track.Show_classes_only_with#:
+ + + + +
+ +
+
+ +

#application-track.Select_classes_to_analyze#


+
+

#application-track.Select_applications_to_analyze#


+
+ +
+ + + + +
+ + + + +
+ + + + + +
+ #dotlrn.no_class_instances# +
+
+
+
+ + \ No newline at end of file Index: openacs-4/packages/application-track/www/classes.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/application-track/www/classes.tcl,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/application-track/www/classes.tcl 8 Nov 2005 15:42:52 -0000 1.1 @@ -0,0 +1,186 @@ +ad_page_contract { + +} -query { + {term_id "-1"} + {department_key ""} + {orderby "department_name,asc"} + page:optional + {keyword ""} +} -properties { + classes:multirow +} + + +set departments [db_list_of_lists select_departments_for_select_widget { + select dotlrn_departments_full.pretty_name, + dotlrn_departments_full.department_key + from dotlrn_departments_full + order by dotlrn_departments_full.pretty_name, + dotlrn_departments_full.department_key +}] +set departments [linsert $departments 0 {All ""}] + +form create department_form + +element create department_form department_key \ + -label "[_ application-track.Department]" \ + -datatype text \ + -widget select \ + -options $departments \ + -html {onChange document.department_form.submit()} \ + -value $department_key + +element create department_form term_id \ + -label "[_ application-track.Term_ID]" \ + -datatype integer \ + -widget hidden \ + -value $term_id + +if {[form is_valid department_form]} { + form get_values department_form department_key term_id +} + +set terms [db_list_of_lists select_terms_for_select_widget { + select dotlrn_terms.term_name || ' ' || dotlrn_terms.term_year, + dotlrn_terms.term_id + from dotlrn_terms + order by dotlrn_terms.start_date, + dotlrn_terms.end_date +}] +set terms [linsert $terms 0 {All -1}] + +form create term_form + +element create term_form term_id \ + -label "[_ application-track.Term]" \ + -datatype integer \ + -widget select \ + -options $terms \ + -html {onChange document.term_form.submit()} \ + -value $term_id + +element create term_form department_key \ + -label "[_ application-track.Department]" \ + -datatype text \ + -widget hidden \ + -value $department_key + +if {[form is_valid term_form]} { + form get_values term_form term_id department_key + + if {$term_id != -1} { + ad_returnredirect "classes?[export_vars {term_id department_key}]" + } +} + +if {![exists_and_not_null referer]} { + set referer "classes" +} + +set query "select_classes" +set paginator_query "select_classes_paginator" +if {$term_id == -1} { + set query "select_all_classes" + set paginator_query "select_all_classes_paginator" +} + +if {![empty_string_p $department_key]} { + append query "_by_department" + append paginator_query "_by_department" +} + +if { ![empty_string_p $keyword] } { + set keyword_clause [db_map select_all_instances_keyword] +} else { + set keyword_clause [db_map select_all_instances_without_keyword] +} +if {$term_id == -1} { + set title "[_ application-track.All_Terms]" + set context_bar [list [list terms [_ application-track.Terms]] "[_ application-track.All_Terms]"] +} else { + if {[db_0or1row select_term_info {}]} { + set title "$term_name $term_year ($start_date - $end_date)" + set context_bar [list [list terms [_ dotlrn.Terms]] "$term_name $term_year"] + } else { + set title "[_ application-track.Unknown_Term]" + set context_bar [list [list terms [_ application-track.Terms]] "[_ application-track.Unknown_Term]"] + } +} + +# Used by the en_US version of the no_class_instances message in the adp +set class_instances_pretty_plural [parameter::get -localize -parameter class_instances_pretty_plural] + +set elements [list department_name \ + [list label "[_ application-track.Department]" \ + orderby_asc {department_name asc, class_name asc, pretty_name asc} \ + orderby_desc {department_name desc, class_name desc, pretty_name desc} \ + link_url_eval {[export_vars -base "/dotlrn/admin/department" { department_key }]}] \ + class_name \ + [list label "[_ application-track.Class]" \ + orderby_asc {class_name asc, pretty_name asc} \ + orderby_desc {class_name desc, pretty_name desc} \ + link_url_eval {[export_vars -base "/dotlrn/admin/class" { class_key }]}] \ + ] +lappend elements class_instance_id \ + [list label "[_ application-track.ID]" \ + link_url_col url \ + orderby_asc {class_instance_id asc} \ + orderby_desc {class_instance_id desc}] + + +if { $term_id == -1 } { + lappend elements term_name \ + [list label "[_ application-track.Term]" \ + orderby_asc {term_name asc, pretty_name asc} \ + orderby_desc {term_name desc, pretty_name desc}] +} + +lappend elements pretty_name \ + [list label "[_ application-track.Class_instance]" \ + link_url_col url \ + orderby_asc {pretty_name asc} \ + orderby_desc {pretty_name desc}] + +lappend elements n_members \ + [list label "[_ application-track.Members]" \ + orderby_asc {n_members asc, pretty_name asc} \ + orderby_desc {n_members desc, pretty_name desc} ] + + + +template::list::create \ + -name classes \ + -multirow classes \ + -filters { department_key {} term_id {} keyword {} } \ + -key class_instance_id \ + -bulk_actions { + "#application-track.lt_View_data_about_every_application#" "general" "#application-track.lt_View_data_about_every_application#"} \ + -page_size 50 \ + -page_flush_p t \ + -page_query_name $paginator_query \ + -elements $elements + +db_multirow classes $query {} + +set applicationsList [callback -catch getApplicationName] + +template::multirow create Applications Name +foreach app $applicationsList { + multirow append Applications $app +} + + +template::list::create \ + -name Applications \ + -multirow Applications \ + -key Name \ + -bulk_actions {"#application-track.lt_View_data_for_selected_applications#" "general" "#application-track.lt_View_data_for_selected_applications#" } \ + -elements { + name { + label "[_ application-track.Application_Name]" + display_col Name + html {align center} + } + } + +ad_return_template \ No newline at end of file Index: openacs-4/packages/application-track/www/classes.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/application-track/www/classes.xql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/application-track/www/classes.xql 8 Nov 2005 15:42:52 -0000 1.1 @@ -0,0 +1,172 @@ + + + + postgresql7.1 + + + + SELECT t.term_name,t.term_id + FROM dotlrn_terms t + WHERE t.term_id = t.term_id + + + + + + SELECT c.pretty_name + FROM dotlrn_communities_all c, dotlrn_terms t + WHERE c.active_start_date = t.start_date + AND c.active_end_date = t.end_date + + + + + + select dotlrn_class_instances_full.*, v.n_members + from dotlrn_class_instances_full left outer join + (select dotlrn_class_instances_full.class_instance_id, count(1) as n_members + from dotlrn_class_instances_full, dotlrn_member_rels_approved + where dotlrn_member_rels_approved.community_id = dotlrn_class_instances_full.class_instance_id + group by dotlrn_class_instances_full.class_instance_id) v + on dotlrn_class_instances_full.class_instance_id = v.class_instance_id + $keyword_clause + and dotlrn_class_instances_full.term_id = :term_id + [template::list::page_where_clause -and -name "classes" -key "dotlrn_class_instances_full.class_instance_id"] + [template::list::orderby_clause -orderby -name "classes"] + + + + + + select dotlrn_class_instances_full.*, v.n_members + from dotlrn_class_instances_full left outer join + (select dotlrn_class_instances_full.class_instance_id, count(1) as n_members + from dotlrn_class_instances_full, dotlrn_member_rels_approved + where dotlrn_member_rels_approved.community_id = dotlrn_class_instances_full.class_instance_id + group by dotlrn_class_instances_full.class_instance_id) v + on dotlrn_class_instances_full.class_instance_id = v.class_instance_id + $keyword_clause + and dotlrn_class_instances_full.term_id = :term_id + [template::list::orderby_clause -orderby -name "classes"] + + + + + + select dotlrn_class_instances_full.*, v.n_members + from dotlrn_class_instances_full left outer join + (select dotlrn_class_instances_full.class_instance_id, count(1) as n_members + from dotlrn_class_instances_full, dotlrn_member_rels_approved + where dotlrn_member_rels_approved.community_id = dotlrn_class_instances_full.class_instance_id + group by dotlrn_class_instances_full.class_instance_id) v + on dotlrn_class_instances_full.class_instance_id = v.class_instance_id + $keyword_clause + and dotlrn_class_instances_full.term_id = :term_id + and dotlrn_class_instances_full.department_key = :department_key + [template::list::page_where_clause -and -name "classes" -key "dotlrn_class_instances_full.class_instance_id"] + [template::list::orderby_clause -orderby -name "classes"] + + + + + + select dotlrn_class_instances_full.*, v.n_members + from dotlrn_class_instances_full left outer join + (select dotlrn_class_instances_full.class_instance_id, count(1) as n_members + from dotlrn_class_instances_full, dotlrn_member_rels_approved + where dotlrn_member_rels_approved.community_id = dotlrn_class_instances_full.class_instance_id + group by dotlrn_class_instances_full.class_instance_id) v + on dotlrn_class_instances_full.class_instance_id = v.class_instance_id + $keyword_clause + and dotlrn_class_instances_full.term_id = :term_id + and dotlrn_class_instances_full.department_key = :department_key + [template::list::orderby_clause -orderby -name "classes"] + + + + + + select dotlrn_class_instances_full.*, v.n_members + from dotlrn_class_instances_full left outer join + (select dotlrn_class_instances_full.class_instance_id, count(1) as n_members + from dotlrn_class_instances_full, dotlrn_member_rels_approved + where dotlrn_member_rels_approved.community_id = dotlrn_class_instances_full.class_instance_id + group by dotlrn_class_instances_full.class_instance_id) v + on dotlrn_class_instances_full.class_instance_id = v.class_instance_id + $keyword_clause + [template::list::page_where_clause -and -name "classes" -key "dotlrn_class_instances_full.class_instance_id"] + [template::list::orderby_clause -orderby -name "classes"] + + + + + + select dotlrn_class_instances_full.*, v.n_members + from dotlrn_class_instances_full left outer join + (select dotlrn_class_instances_full.class_instance_id, count(1) as n_members + from dotlrn_class_instances_full, dotlrn_member_rels_approved + where dotlrn_member_rels_approved.community_id = dotlrn_class_instances_full.class_instance_id + group by dotlrn_class_instances_full.class_instance_id) v + on dotlrn_class_instances_full.class_instance_id = v.class_instance_id + $keyword_clause + [template::list::orderby_clause -orderby -name "classes"] + + + + + + select dotlrn_class_instances_full.*, v.n_members + from dotlrn_class_instances_full left outer join + (select dotlrn_class_instances_full.class_instance_id, count(1) as n_members + from dotlrn_class_instances_full, dotlrn_member_rels_approved + where dotlrn_member_rels_approved.community_id = dotlrn_class_instances_full.class_instance_id + group by dotlrn_class_instances_full.class_instance_id) v + on dotlrn_class_instances_full.class_instance_id = v.class_instance_id + $keyword_clause + and dotlrn_class_instances_full.department_key = :department_key + [template::list::page_where_clause -and -name "classes" -key "dotlrn_class_instances_full.class_instance_id"] + [template::list::orderby_clause -orderby -name "classes"] + + + + + + select dotlrn_class_instances_full.*, v.n_members + from dotlrn_class_instances_full left outer join + (select dotlrn_class_instances_full.class_instance_id, count(1) as n_members + from dotlrn_class_instances_full, dotlrn_member_rels_approved + where dotlrn_member_rels_approved.community_id = dotlrn_class_instances_full.class_instance_id + group by dotlrn_class_instances_full.class_instance_id) v + on dotlrn_class_instances_full.class_instance_id = v.class_instance_id + $keyword_clause + and dotlrn_class_instances_full.department_key = :department_key + [template::list::orderby_clause -orderby -name "classes"] + + + + + + select term_name, + term_year, + to_char(start_date, 'Mon DD YYYY') as start_date, + to_char(end_date, 'Mon DD YYYY') as end_date + from dotlrn_terms + where term_id = :term_id + + + + + + where lower(dotlrn_class_instances_full.pretty_name) like '%'||lower(:keyword)||'%' + + + + + + where 1 = 1 + + + + + + Index: openacs-4/packages/application-track/www/communities.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/application-track/www/communities.adp,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/application-track/www/communities.adp 8 Nov 2005 15:42:52 -0000 1.1 @@ -0,0 +1,95 @@ + +#application-track.Communities_selection# +#application-track.Communities_selection# + +
+ +
+ + + + + +
+ + + + + + + +
+ +

#application-track.Select_Communities_to_analyze#

+

+

#application-track.Select_applications_to_analyze#


+
+ + + +
+
+ #application-track.Show_classes_only_with#: + + +
+
+
+ + + + +
+
+
+ + + + + +
+ #dotlrn.no_class_instances# +
+
+
+
+ + + + + \ No newline at end of file Index: openacs-4/packages/application-track/www/communities.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/application-track/www/communities.tcl,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/application-track/www/communities.tcl 8 Nov 2005 15:42:52 -0000 1.1 @@ -0,0 +1,90 @@ +ad_page_contract { + +} -query { + page:optional + {orderby "community_id,asc"} + {keyword ""} +} -properties { + classes:multirow +} + + +if {![exists_and_not_null referer]} { + set referer "[_ application-track.communities]" +} + +set query "select_all_classes" +set paginator_query "select_all_classes_paginator" + +if { ![empty_string_p $keyword] } { + set keyword_clause [db_map select_all_instances_keyword] +} else { + set keyword_clause [db_map select_all_instances_without_keyword] +} +set title "[_ application-track.All_Terms]" +set context_bar [list [list terms [_ dotlrn.Terms]] "[_ application-track.All_Terms]"] +# Used by the en_US version of the no_class_instances message in the adp +set class_instances_pretty_plural [parameter::get -localize -parameter class_instances_pretty_plural] + + +set elements [list pretty_name \ + [list label "[_ application-track.Community_Name]" \ + link_url_col url \ + orderby_asc {pretty_name asc} \ + orderby_desc {pretty_name desc}] \ + ] + +lappend elements community_id \ + [list label "[_ application-track.ID]" \ + link_url_col url \ + orderby_asc {community_id asc} \ + orderby_desc {community_id desc}] + +lappend elements group_name \ + [list label "[_ application-track.Group_Name]" \ + orderby_asc {group_name asc, pretty_name asc} \ + orderby_desc {group_name desc, pretty_name desc} \ + link_url_eval {[export_vars -base "/dotlrn/admin/class" { class_key }]}] + + +lappend elements n_members \ + [list label "[_ application-track.Members]" \ + orderby_asc {n_members asc, pretty_name asc} \ + orderby_desc {n_members desc, pretty_name desc} ] + + +template::list::create \ + -name classes \ + -multirow classes \ + -filters { keyword {} } \ + -key community_id \ + -bulk_actions { + "#application-track.lt_View_data_about_every_application#" "general" "#application-track.lt_View_data_about_every_application#"} \ + -page_size 50 \ + -page_flush_p t \ + -page_query_name $paginator_query \ + -elements $elements + +db_multirow classes $query {} + + +set applicationsList [callback -catch getApplicationName] + +template::multirow create Applications Name +foreach app $applicationsList { + multirow append Applications $app +} + + +template::list::create \ + -name Applications \ + -multirow Applications \ + -key Name \ + -bulk_actions {"#application-track.lt_View_data_for_selected_applications#" "general" "#application-track.lt_View_data_for_selected_applications#" } \ + -elements { + name { + label "[_ application-track.Application_Name]" + display_col Name + html {align center} + } + } \ No newline at end of file Index: openacs-4/packages/application-track/www/communities.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/application-track/www/communities.xql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/application-track/www/communities.xql 8 Nov 2005 15:42:52 -0000 1.1 @@ -0,0 +1,50 @@ + + + + postgresql7.1 + + + + select dotlrn_communities_full.*, v.n_members + from dotlrn_communities_full left outer join + (select dotlrn_communities_full.community_id, count(1) as n_members + from dotlrn_communities_full, dotlrn_member_rels_approved + where dotlrn_member_rels_approved.community_id = dotlrn_communities_full.community_id + group by dotlrn_communities_full.community_id) v + on dotlrn_communities_full.community_id = v.community_id + $keyword_clause + [template::list::page_where_clause -and -name "classes" -key "dotlrn_communities_full.community_id"] + [template::list::orderby_clause -orderby -name "classes"] + + + + + + select dotlrn_communities_full.*, v.n_members + from dotlrn_communities_full left outer join + (select dotlrn_communities_full.community_id, count(1) as n_members + from dotlrn_communities_full, dotlrn_member_rels_approved + where dotlrn_member_rels_approved.community_id = dotlrn_communities_full.community_id + group by dotlrn_communities_full.community_id) v + on dotlrn_communities_full.community_id = v.community_id + $keyword_clause + [template::list::orderby_clause -orderby -name "classes"] + + + + + + + where lower(dotlrn_communities_full.pretty_name) like '%'||lower(:keyword)||'%' + + + + + + where 1 = 1 + + + + + + Index: openacs-4/packages/application-track/www/general.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/application-track/www/general.adp,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/application-track/www/general.adp 8 Nov 2005 15:42:52 -0000 1.1 @@ -0,0 +1,21 @@ + +#application-track.General_Report# +#application-track.General_Report# + +

#application-track.General_Report#

+ +

#application-track.lt_elements_created#

+
+ +
+ + +
+
+#application-track.lt_click_on_elements_number# +
+#application-track.lt_click_on_Go# +
+ + + Index: openacs-4/packages/application-track/www/general.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/application-track/www/general.tcl,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/application-track/www/general.tcl 8 Nov 2005 15:42:52 -0000 1.1 @@ -0,0 +1,116 @@ +ad_page_contract { + +} -query { + page:optional + {community_id:multiple ""} + {class_instance_id:multiple ""} + {Name:multiple ""} + orderby:optional +} -properties { + result:onevalue +} + +# Input parameters treatment +if {[exists_and_not_null Name]} { + set applicationsList $Name +} else { +set applicationsList [callback -catch getApplicationName] +} + +if { [exists_and_not_null community_id] } { +set class_instance_id $community_id +} + +if {! [exists_and_not_null class_instance_id] } { + set class_instance_id "" + db_foreach select_all_classes {} { + append class_instance_id "$id " + } +} + +#Deleting {} from the lists +regsub -all -- "\[\{ \}\]+" $class_instance_id " " class_instance_id +regsub -all -- "\[\{ \}\]+" $Name " " Name + + +#Creating the multirow +template::multirow create CommList CommName url url2 result result_url + +#Creating the elements list +set elements { + name { + label "[_ application-track.Community]" + display_col CommName + link_url_col url + html {align center} + } +} + +set link "" + +foreach app $applicationsList { + + #Adding a new field to the elements list + append elements $app + + append elements " \{ + label $app + display_col $app + link_url_col ${app}_url + html {align center} + orderby_asc {${app} asc} + orderby_desc {${app} desc} + \} + " + #Adding a new column to the multirow + template::multirow extend CommList $app "${app}_url" + + append link "&Name=$app" +} + +append elements { + comm { + label "[_ application-track.All_Applications]" + display_template "#application-track.Go#" + link_url_col url2 + html {align center} + } +} + +foreach class_id $class_instance_id { + db_0or1row select_classes {} -column_array class_info + multirow append CommList ${class_info(pretty_name)} ${class_info(url)} + + #"specific?class_instance_id=$class_id" + template::multirow set CommList [template::multirow size CommList] "url2" "specific?class_instance_id=$class_id$link" + + foreach app $applicationsList { + template::multirow set CommList [template::multirow size CommList] "$app" [lindex [callback -impl "$app" GetGeneralInfo -comm_id $class_id] 0] + template::multirow set CommList [template::multirow size CommList] "${app}_url" "specific?class_instance_id=$class_id&Name=$app" + } + +} + +# List creation +template::list::create \ + -name CommList \ + -multirow CommList \ + -filters { class_instance_id:multival {} Name:multival {} } \ + -elements $elements \ + -html {align center} + + +# This list is not created as result of an XQL query, so we must order directly the multirow +if { [exists_and_not_null orderby] } { + regexp {([^,]*),(.*)} $orderby match column order + + if { $order == "asc" } { + template::multirow sort CommList -increasing $column + } elseif { $order == "desc" } { + template::multirow sort CommList -decreasing $column + } + +} + + + Index: openacs-4/packages/application-track/www/general.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/application-track/www/general.xql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/application-track/www/general.xql 8 Nov 2005 15:42:52 -0000 1.1 @@ -0,0 +1,20 @@ + + + + + + + select pretty_name, url + from dotlrn_communities_full + where community_id = :class_id + + + + + + select community_id as id + from dotlrn_communities_full + + + + \ No newline at end of file Index: openacs-4/packages/application-track/www/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/application-track/www/index.adp,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/application-track/www/index.adp 8 Nov 2005 15:42:52 -0000 1.1 @@ -0,0 +1,9 @@ + +@title;noquote@ +@context;noquote@ + + Index: openacs-4/packages/application-track/www/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/application-track/www/index.tcl,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/application-track/www/index.tcl 8 Nov 2005 15:42:52 -0000 1.1 @@ -0,0 +1,21 @@ +# index.tcl + +ad_page_contract { + +} { + +} -properties { + + + title:onevalue + context:onevalue + admin_p:onevalue + +} + +set title [_ application-track.Application_Track] +set context "" + +set package_id [ad_conn package_id] + +set admin_p [ad_permission_p $package_id admin] \ No newline at end of file Index: openacs-4/packages/application-track/www/specific.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/application-track/www/specific.adp,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/application-track/www/specific.adp 8 Nov 2005 15:42:52 -0000 1.1 @@ -0,0 +1,48 @@ + +@class_info.pretty_name@ +@class_info.pretty_name@ + +

+#application-track.Report_about_installed_applications# +

+
+ +<% foreach app $applicationsList { + set nelements [callback -impl "$app" GetGeneralInfo -comm_id $class_instance_id] + set nelements_p 0 + set show_p 1 + + if {$nelements != 0 } { + set nelements_p 1 + set resultado [callback -impl $app GetSpecificInfo -comm_id $class_instance_id -query_name "query" -elements_name "elements" ] + if {[exists_and_not_null query]} { + template::list::create \ + -name $app \ + -multirow $app \ + -elements $elements \ + -html {align center} + + db_multirow $app $app $query + set "nelements" [template::multirow size $app] + } else { + set show_p 1 + } + } +%> +
+ +

+
#application-track.Application#: @app;noquote@ +
#application-track.created_elements#: @nelements;noquote@ +

+ + +
+
+
+<% + +} +%> +
+
Index: openacs-4/packages/application-track/www/specific.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/application-track/www/specific.tcl,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/application-track/www/specific.tcl 8 Nov 2005 15:42:52 -0000 1.1 @@ -0,0 +1,28 @@ +ad_page_contract { + +} { + class_instance_id + {Name:multiple ""} + orderby:optional +} -properties { +show_p:onevalue +} + +if {[exists_and_not_null Name]} { + set applicationsList $Name +} else { +set applicationsList [callback -catch getApplicationName] +} + + + +db_1row select_class {} -column_array class_info + + +set query "" +set elements "" + + + + + Index: openacs-4/packages/application-track/www/specific.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/application-track/www/specific.xql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/application-track/www/specific.xql 8 Nov 2005 15:42:52 -0000 1.1 @@ -0,0 +1,13 @@ + + + + + + + select pretty_name, url + from dotlrn_communities_full + where community_id = :class_instance_id + + + + \ No newline at end of file Index: openacs-4/packages/application-track-portlet/application-track-portlet.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/application-track-portlet/application-track-portlet.info,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/application-track-portlet/application-track-portlet.info 8 Nov 2005 15:44:31 -0000 1.1 @@ -0,0 +1,29 @@ + + + + + ApplicationTrack Portlet + ApplicationTrack Portlets + f + t + + + David Ortega + Pablo Mu�oz + Pablo Arozarena + 2005-04-13 + E-lane + + + + + + + + + + + + + + Index: openacs-4/packages/application-track-portlet/catalog/application-track-portlet.en_US.ISO-8859-1.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/application-track-portlet/catalog/application-track-portlet.en_US.ISO-8859-1.xml,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/application-track-portlet/catalog/application-track-portlet.en_US.ISO-8859-1.xml 8 Nov 2005 15:44:31 -0000 1.1 @@ -0,0 +1,8 @@ + + + + Admin Options + See a general report about this community + See a specific report about this community + APPLICATION TRACK + Index: openacs-4/packages/application-track-portlet/sql/postgresql/application-track-admin-portlet-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/application-track-portlet/sql/postgresql/application-track-admin-portlet-create.sql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/application-track-portlet/sql/postgresql/application-track-admin-portlet-create.sql 8 Nov 2005 15:44:31 -0000 1.1 @@ -0,0 +1,150 @@ +-- /application-track-portlet/sql/postgresql/application-track-admin-portlet-create.sql +-- +-- Creates User Tracking portlet +-- +-- @author David Ortega (doa@tid.es) +-- @creation-date 2004-10-25 +-- + +create function inline_0 () +returns integer as ' +declare + ds_id portal_datasources.datasource_id%TYPE; +begin + ds_id = portal_datasource__new( + ''application_track_admin_portlet'', + ''User Tracking Admin Portlet'' + ); + +RAISE NOTICE '' created new ds''; + + perform portal_datasource__set_def_param ( + ds_id, + ''t'', + ''t'', + ''shadeable_p'', + ''f'' + ); + +RAISE NOTICE '' set shadeable''; + perform portal_datasource__set_def_param ( + ds_id, + ''t'', + ''t'', + ''hideable_p'', + ''f'' + ); + +RAISE NOTICE '' set hideable''; + perform portal_datasource__set_def_param ( + ds_id, + ''t'', + ''t'', + ''user_editable_p'', + ''f'' + ); + + perform portal_datasource__set_def_param ( + ds_id, + ''t'', + ''t'', + ''shaded_p'', + ''f'' + ); + + perform portal_datasource__set_def_param ( + ds_id, + ''t'', + ''t'', + ''link_hideable_p'', + ''t'' + ); + + perform portal_datasource__set_def_param ( + ds_id, + ''t'', + ''f'', + ''package_id'', + '' '' + ); + + +return 0; + +end;' language 'plpgsql'; + + + +select inline_0(); + +drop function inline_0 (); + +-- create the implementation +select acs_sc_impl__new ( + 'portal_datasource', + 'application_track_admin_portlet', + 'application_track_admin_portlet' +); + +-- add all the hooks +select acs_sc_impl_alias__new( + 'portal_datasource', + 'application_track_admin_portlet', + 'GetMyName', + 'application_track_admin_portlet::get_my_name', + 'TCL' +); + +select acs_sc_impl_alias__new( + 'portal_datasource', + 'application_track_admin_portlet', + 'GetPrettyName', + 'application_track_admin_portlet::get_pretty_name', + 'TCL' +); + +select acs_sc_impl_alias__new( + 'portal_datasource', + 'application_track_admin_portlet', + 'Link', + 'application_track_admin_portlet::link', + 'TCL' +); + +select acs_sc_impl_alias__new( + 'portal_datasource', + 'application_track_admin_portlet', + 'AddSelfToPage', + 'application_track_admin_portlet::add_self_to_page', + 'TCL' +); + +select acs_sc_impl_alias__new( + 'portal_datasource', + 'application_track_admin_portlet', + 'Show', + 'application_track_admin_portlet::show', + 'TCL' +); + +select acs_sc_impl_alias__new( + 'portal_datasource', + 'application_track_admin_portlet', + 'Edit', + 'application_track_admin_portlet::edit', + 'TCL' +); + +select acs_sc_impl_alias__new( + 'portal_datasource', + 'application_track_admin_portlet', + 'RemoveSelfFromPage', + 'application_track_admin_portlet::remove_self_from_page', + 'TCL' +); + +-- Add the binding +select acs_sc_binding__new( + 'portal_datasource', + 'application_track_admin_portlet' +); Index: openacs-4/packages/application-track-portlet/sql/postgresql/application-track-admin-portlet-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/application-track-portlet/sql/postgresql/application-track-admin-portlet-drop.sql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/application-track-portlet/sql/postgresql/application-track-admin-portlet-drop.sql 8 Nov 2005 15:44:31 -0000 1.1 @@ -0,0 +1,91 @@ +-- /application-track-portlet/sql/oracle/application-track-admin-portlet-create.sql +-- + +-- Creates application-track admin portlet + +-- @author David Ortega (doa@tid.es) +-- @creation-date 2004-10-25 + + +create function inline_0 () +returns integer as ' +declare + ds_id portal_datasources.datasource_id%TYPE; +begin + + select datasource_id into ds_id + from portal_datasources + where name = ''application_track_admin_portlet''; + + if not found then + raise exception ''No datasource_id found here '',ds_id ; + ds_id := null; + end if; + + + if ds_id is NOT null then + perform portal_datasource__delete(ds_id); + end if; + +return 0; + +end;' language 'plpgsql'; + +select inline_0 (); + +drop function inline_0 (); + +-- create the implementation +select acs_sc_impl__delete ( + 'portal_datasource', + 'application_track_admin_portlet' +); + +-- delete all the hooks +select acs_sc_impl_alias__delete ( + 'portal_datasource', + 'application_track_admin_portlet', + 'GetMyName' +); + +select acs_sc_impl_alias__delete ( + 'portal_datasource', + 'application_track_admin_portlet', + 'GetPrettyName' +); + +select acs_sc_impl_alias__delete ( + 'portal_datasource', + 'application_track_admin_portlet', + 'Link' +); + +select acs_sc_impl_alias__delete ( + 'portal_datasource', + 'application_track_admin_portlet', + 'AddSelfToPage' +); + +select acs_sc_impl_alias__delete ( + 'portal_datasource', + 'application_track_admin_portlet', + 'Show' +); + +select acs_sc_impl_alias__delete ( + 'portal_datasource', + 'application_track_admin_portlet', + 'Edit' +); + +select acs_sc_impl_alias__delete ( + 'portal_datasource', + 'application_track_admin_portlet', + 'RemoveSelfFromPage' +); + +-- Add the binding +select acs_sc_binding__delete ( + 'portal_datasource', + 'application_track_admin_portlet' +); Index: openacs-4/packages/application-track-portlet/sql/postgresql/application-track-portlet-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/application-track-portlet/sql/postgresql/application-track-portlet-create.sql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/application-track-portlet/sql/postgresql/application-track-portlet-create.sql 8 Nov 2005 15:44:31 -0000 1.1 @@ -0,0 +1,155 @@ +-- /application-track-portlet/sql/postgresql/application-track-portlet-create.sql +-- +-- Creates UserTracking Management portlet +-- +-- @author David Ortega (doa@tid.es) +-- @creation-date 2004-10-25 +-- + +create function inline_0 () +returns integer as ' +declare + ds_id portal_datasources.datasource_id%TYPE; +begin + ds_id = portal_datasource__new( + ''application_track_portlet'', + ''User Tracking Portlet'' + ); + + +perform portal_datasource__set_def_param( + ds_id, + ''t'', + ''t'', + ''shadeable_p'', + ''t'' +); + +perform portal_datasource__set_def_param ( + ds_id, + ''t'', + ''t'', + ''hideable_p'', + ''t'' +); + +perform portal_datasource__set_def_param ( + ds_id, + ''t'', + ''t'', + ''user_editable_p'', + ''f'' +); + +perform portal_datasource__set_def_param ( + ds_id, + ''t'', + ''t'', + ''shaded_p'', + ''f'' +); + +perform portal_datasource__set_def_param ( + ds_id, + ''t'', + ''t'', + ''link_hideable_p'', + ''t'' +); + +perform portal_datasource__set_def_param ( + ds_id, + ''t'', + ''t'', + ''style'', + ''list'' +); + +perform portal_datasource__set_def_param ( + ds_id, + ''t'', + ''f'', + ''package_id'', + '' '' +); + +return 0; + +end; ' language 'plpgsql'; + +select inline_0 (); + +drop function inline_0 (); + +-- create the implementation +select acs_sc_impl__new( + 'portal_datasource', + 'application_track_portlet', + 'application_track_portlet' +); + + +-- add all the hooks +select acs_sc_impl_alias__new( + 'portal_datasource', + 'application_track_portlet', + 'GetMyName', + 'application_track_portlet::get_my_name', + 'TCL' +); + +select acs_sc_impl_alias__new( + 'portal_datasource', + 'application_track_portlet', + 'GetPrettyName', + 'application_track_portlet::get_pretty_name', + 'TCL' +); + +select acs_sc_impl_alias__new( + 'portal_datasource', + 'application_track_portlet', + 'Link', + 'application_track_portlet::link', + 'TCL' +); + +select acs_sc_impl_alias__new( + 'portal_datasource', + 'application_track_portlet', + 'AddSelfToPage', + 'application_track_portlet::add_self_to_page', + 'TCL' + ); + +select acs_sc_impl_alias__new( + 'portal_datasource', + 'application_track_portlet', + 'Show', + 'application_track_portlet::show', + 'TCL' + ); + +select acs_sc_impl_alias__new( + 'portal_datasource', + 'application_track_portlet', + 'Edit', + 'application_track_portlet::edit', + 'TCL' + ); + +select acs_sc_impl_alias__new( + 'portal_datasource', + 'application_track_portlet', + 'RemoveSelfFromPage', + 'application_track_portlet::remove_self_from_page', + 'TCL' + ); + + -- Add the binding +select acs_sc_binding__new ( + 'portal_datasource', + 'application_track_portlet' +); + +\i application-track-admin-portlet-create.sql Index: openacs-4/packages/application-track-portlet/sql/postgresql/application-track-portlet-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/application-track-portlet/sql/postgresql/application-track-portlet-drop.sql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/application-track-portlet/sql/postgresql/application-track-portlet-drop.sql 8 Nov 2005 15:44:31 -0000 1.1 @@ -0,0 +1,91 @@ +-- /application-track-portlet/sql/postgresql/application-track-portlet-drop.sql +-- + +-- Drops application-track datasources for portal portlets + +-- @author David Ortega (doa@tid.es) +-- @creation-date 2004-10-25 + + +create function inline_1() +returns integer as ' +declare + ds_id portal_datasources.datasource_id%TYPE; +begin + + select datasource_id into ds_id + from portal_datasources + where name = ''application_track_portlet''; + + if not found then + RAISE EXCEPTION '' No datasource id found '', ds_id; + ds_id := null; + end if; + + if ds_id is NOT null then + perform portal_datasource__delete(ds_id); + end if; + + -- drop the hooks + perform acs_sc_impl_alias__delete ( + ''portal_datasource'', + ''application_track_portlet'', + ''GetMyName'' + ); + + perform acs_sc_impl_alias__delete ( + ''portal_datasource'', + ''application_track_portlet'', + ''GetPrettyName'' + ); + + + perform acs_sc_impl_alias__delete ( + ''portal_datasource'', + ''application_track_portlet'', + ''Link'' + ); + + perform acs_sc_impl_alias__delete ( + ''portal_datasource'', + ''application_track_portlet'', + ''AddSelfToPage'' + ); + + perform acs_sc_impl_alias__delete ( + ''portal_datasource'', + ''application_track_portlet'', + ''Show'' + ); + + perform acs_sc_impl_alias__delete ( + ''portal_datasource'', + ''application_track_portlet'', + ''Edit'' + ); + + perform acs_sc_impl_alias__delete ( + ''portal_datasource'', + ''application_track_portlet'', + ''RemoveSelfFromPage'' + ); + + -- Drop the binding + perform acs_sc_binding__delete ( + ''portal_datasource'', + ''application_track_portlet'' + ); + + -- drop the impl + perform acs_sc_impl__delete ( + ''portal_datasource'', + ''application_track_portlet'' + ); + + return 0; +end;' language 'plpgsql'; + +select inline_1(); +drop function inline_1(); + +\i application-track-admin-portlet-drop.sql Index: openacs-4/packages/application-track-portlet/tcl/application-track-admin-portlet-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/application-track-portlet/tcl/application-track-admin-portlet-procs.tcl,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/application-track-portlet/tcl/application-track-admin-portlet-procs.tcl 8 Nov 2005 15:44:31 -0000 1.1 @@ -0,0 +1,70 @@ +ad_library { + + Procedures to support the application-track management portlet. + + @creation-date 2004-10-25 + @author David Ortega (doa@tid.es) + +} + +namespace eval application_track_admin_portlet { + + ad_proc -private get_my_name { + } { + return "application_track_admin_portlet" + } + + ad_proc -public get_pretty_name { + } { + return "#application-track.admin_portlet#" + } + + ad_proc -private my_package_key { + } { + return "application-track-portlet" + } + + ad_proc -public link { + } { + return "" + } + + ad_proc -public add_self_to_page { + {-portal_id:required} + {-package_id:required} + } { + Adds a UserTracking mgt admin PE to the given admin portal. There should only + ever be one of these portals on an admin page with only one application_track_package_id + + @param portal_id The page to add self to + @param package_id the id of the application_track package + + @return element_id The new element's id + } { + return [portal::add_element_parameters \ + -portal_id $portal_id \ + -portlet_name [get_my_name] \ + -key package_id \ + -value $package_id + ] + } + + ad_proc -public remove_self_from_page { + portal_id + } { + Removes a UserTracking admin PE from the given portal + } { + portal::remove_element -portal_id $portal_id -portlet_name [get_my_name] + } + + ad_proc -public show { + cf + } { + } { + portal::show_proc_helper \ + -package_key [my_package_key] \ + -config_list $cf \ + -template_src "application-track-admin-portlet" + } + +} Index: openacs-4/packages/application-track-portlet/tcl/application-track-portlet-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/application-track-portlet/tcl/application-track-portlet-postgresql.xql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/application-track-portlet/tcl/application-track-portlet-postgresql.xql 8 Nov 2005 15:44:31 -0000 1.1 @@ -0,0 +1,15 @@ + + + + + + + select first_names , last_name + from persons + where person_id=:user_id; + + + + + + \ No newline at end of file Index: openacs-4/packages/application-track-portlet/tcl/application-track-portlet-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/application-track-portlet/tcl/application-track-portlet-procs.tcl,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/application-track-portlet/tcl/application-track-portlet-procs.tcl 8 Nov 2005 15:44:31 -0000 1.1 @@ -0,0 +1,86 @@ +ad_library { + + Procedures to support the application-track Management portlet. + + @creation-date 2004-10-25 + @author David Ortega (doa@tid.es) + +} + +namespace eval application_track_portlet { + + ad_proc -private get_my_name { + } { + return "application_track_portlet" + } + + ad_proc -private my_package_key { + } { + return "application-track-portlet" + } + + ad_proc -public get_pretty_name { + } { + return "#application-track-portlet.application_title#" + } + + ad_proc -public link { + } { + return "" + } + + ad_proc -public add_self_to_page { + {-portal_id:required} + {-package_id:required} + {-param_action:required} + } { + Adds a Applicationtrack Mgt PE to the given portal or appends the given + application_track_package_id to the params of the application_track pe already there + + @param portal_id The page to add self to + @param package_id the id of the application_track package for this community + + @return element_id The new element's id + } { + return [portal::add_element_parameters \ + -portal_id $portal_id \ + -portlet_name [get_my_name] \ + -key package_id \ + -value $package_id \ + -pretty_name [get_pretty_name] \ + -force_region [parameter::get_from_package_key \ + -package_key [my_package_key] \ + -parameter "application_track_portlet_force_region"] \ + -param_action $param_action + ] + } + + ad_proc -public remove_self_from_page { + {-portal_id:required} + {-package_id:required} + } { + Removes a application_track PE from the given page or just the passed + in application_track_package_id parameter from the portlet + (that has other application_track_package_ids) + + @param portal_id The page to remove self from + @param package_id + } { + portal::remove_element_parameters \ + -portal_id $portal_id \ + -portlet_name [get_my_name] \ + -key package_id \ + -value $package_id + } + + ad_proc -public show { + cf + } { + } { + portal::show_proc_helper \ + -package_key [my_package_key] \ + -config_list $cf \ + -template_src "application-track-portlet" + } + +} Index: openacs-4/packages/application-track-portlet/www/application-track-admin-portlet.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/application-track-portlet/www/application-track-admin-portlet.adp,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/application-track-portlet/www/application-track-admin-portlet.adp 8 Nov 2005 15:44:31 -0000 1.1 @@ -0,0 +1,7 @@ + + Index: openacs-4/packages/application-track-portlet/www/application-track-admin-portlet.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/application-track-portlet/www/application-track-admin-portlet.tcl,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/application-track-portlet/www/application-track-admin-portlet.tcl 8 Nov 2005 15:44:31 -0000 1.1 @@ -0,0 +1,27 @@ +ad_page_contract { + + The display logic for the User Tracking Management admin portlet + + @creation-date 2005-11-4 + @author David Ortega (doa@tid.es) + @author Pablo Mu�oz (pablomp@tid.es) + +} -properties { +community_id: onevalue +} + +array set config $cf +set list_of_package_ids $config(package_id) + +if {[llength $list_of_package_ids] > 1} { + # We have a problem! + return -code error "There should be only one instance of application-track for admin purposes" +} + +set package_id [lindex $list_of_package_ids 0] + +set url [lindex [site_node::get_url_from_object_id -object_id $package_id] 0] + +set community_id [dotlrn_community::get_community_id] + +ad_return_template Index: openacs-4/packages/application-track-portlet/www/application-track-portlet-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/application-track-portlet/www/application-track-portlet-postgresql.xql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/application-track-portlet/www/application-track-portlet-postgresql.xql 8 Nov 2005 15:44:31 -0000 1.1 @@ -0,0 +1,15 @@ + + + + + + + select first_names , last_name + from persons + where person_id=:user_id; + + + + + + \ No newline at end of file Index: openacs-4/packages/application-track-portlet/www/application-track-portlet.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/application-track-portlet/www/application-track-portlet.adp,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/application-track-portlet/www/application-track-portlet.adp 8 Nov 2005 15:44:31 -0000 1.1 @@ -0,0 +1,24 @@ + + + +
+ +
+ + + \ No newline at end of file Index: openacs-4/packages/application-track-portlet/www/application-track-portlet.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/application-track-portlet/www/application-track-portlet.tcl,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/application-track-portlet/www/application-track-portlet.tcl 8 Nov 2005 15:44:31 -0000 1.1 @@ -0,0 +1,31 @@ +ad_page_contract { + + The logic for the user-tracking portlet. + + @creation-date 2005-11-4 + @author Pablo Mu�oz (pablomp@tid.es) + @author David Ortega (doa@tid.es) + +} -query { +} -properties { + community_id_p: onevalue + community_id: onevalue + admin_p: onevalue + user_id: onevalue +} + +array set config $cf +set list_of_package_ids [lsort $config(package_id)] + +set community_id [dotlrn_community::get_community_id] +set user_id [ad_conn user_id] + +if {[exists_and_not_null community_id]} { + set community_id_p 1 + +} else { + set community_id_p 0 +} + + +ad_return_template Index: openacs-4/packages/dotlrn-application-track/dotlrn-application-track.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-application-track/dotlrn-application-track.info,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn-application-track/dotlrn-application-track.info 8 Nov 2005 15:45:38 -0000 1.1 @@ -0,0 +1,28 @@ + + + + + dotLRN ApplicationTrack Management Applet + dotLRN ApplicationTrack Management Applets + f + t + + + Pablo Arozarena + David Ortega + Pablo Mu�oz + 2005-04-13 + Elane + + + + + + + + + + + + + \ No newline at end of file Index: openacs-4/packages/dotlrn-application-track/sql/postgresql/dotlrn-application-track-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-application-track/sql/postgresql/dotlrn-application-track-create.sql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn-application-track/sql/postgresql/dotlrn-application-track-create.sql 8 Nov 2005 15:45:39 -0000 1.1 @@ -0,0 +1,148 @@ +-- This file is part of dotLRN. +-- +-- dotLRN is free software; you can redistribute it and/or modify it under the +-- terms of the GNU General Public License as published by the Free Software +-- Foundation; either version 2 of the License, or (at your option) any later +-- version. +-- +-- dotLRN is distributed in the hope that it will be useful, but WITHOUT ANY +-- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +-- FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +-- details. +-- +-- The UserTracking applet for dotLRN +-- +-- @author David Ortega (doa@tid.es) +-- @creation-date 2004-10-25 +-- + +-- create the implementation +select acs_sc_impl__new ( + 'dotlrn_applet', + 'dotlrn_application_track', + 'dotlrn_application_track' +); + +-- add all the hooks + +-- GetPrettyName +select acs_sc_impl_alias__new ( + 'dotlrn_applet', + 'dotlrn_application_track', + 'GetPrettyName', + 'dotlrn_application_track::get_pretty_name', + 'TCL' +); + +-- AddApplet +select acs_sc_impl_alias__new ( + 'dotlrn_applet', + 'dotlrn_application_track', + 'AddApplet', + 'dotlrn_application_track::add_applet', + 'TCL' +); + +-- RemoveApplet +select acs_sc_impl_alias__new ( + 'dotlrn_applet', + 'dotlrn_application_track', + 'RemoveApplet', + 'dotlrn_application_track::remove_applet', + 'TCL' +); + +-- AddAppletToCommunity +select acs_sc_impl_alias__new ( + 'dotlrn_applet', + 'dotlrn_application_track', + 'AddAppletToCommunity', + 'dotlrn_application_track::add_applet_to_community', + 'TCL' +); + +-- RemoveAppletFromCommunity +select acs_sc_impl_alias__new ( + 'dotlrn_applet', + 'dotlrn_application_track', + 'RemoveAppletFromCommunity', + 'dotlrn_application_track::remove_applet_from_community', + 'TCL' +); + +-- AddUser +select acs_sc_impl_alias__new ( + 'dotlrn_applet', + 'dotlrn_application_track', + 'AddUser', + 'dotlrn_application_track::add_user', + 'TCL' +); + +-- RemoveUser +select acs_sc_impl_alias__new ( + 'dotlrn_applet', + 'dotlrn_application_track', + 'RemoveUser', + 'dotlrn_application_track::remove_user', + 'TCL' +); + +-- AddUserToCommunity +select acs_sc_impl_alias__new ( + 'dotlrn_applet', + 'dotlrn_application_track', + 'AddUserToCommunity', + 'dotlrn_application_track::add_user_to_community', + 'TCL' +); + +-- RemoveUserFromCommunity +select acs_sc_impl_alias__new ( + 'dotlrn_applet', + 'dotlrn_application_track', + 'RemoveUserFromCommunity', + 'dotlrn_application_track::remove_user_from_community', + 'TCL' +); + +-- AddPortlet +select acs_sc_impl_alias__new ( + 'dotlrn_applet', + 'dotlrn_application_track', + 'AddPortlet', + 'dotlrn_application_track::add_portlet', + 'TCL' + ); + +-- RemovePortlet +select acs_sc_impl_alias__new ( + 'dotlrn_applet', + 'dotlrn_application_track', + 'RemovePortlet', + 'dotlrn_application_track::remove_portlet', + 'TCL' +); + +-- Clone +select acs_sc_impl_alias__new ( + 'dotlrn_applet', + 'dotlrn_application_track', + 'Clone', + 'dotlrn_application_track::clone', + 'TCL' +); + +select acs_sc_impl_alias__new ( + 'dotlrn_applet', + 'dotlrn_application_track', + 'ChangeEventHandler', + 'dotlrn_application_track::change_event_handler', + 'TCL' +); + +-- Add the binding +select acs_sc_binding__new ( + 'dotlrn_applet', + 'dotlrn_application_track' +); Index: openacs-4/packages/dotlrn-application-track/sql/postgresql/dotlrn-application-track-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-application-track/sql/postgresql/dotlrn-application-track-drop.sql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn-application-track/sql/postgresql/dotlrn-application-track-drop.sql 8 Nov 2005 15:45:39 -0000 1.1 @@ -0,0 +1,132 @@ +-- +-- Copyright (C) 2001, 2002 MIT +-- +-- This file is part of dotLRN. +-- +-- dotLRN is free software; you can redistribute it and/or modify it under the +-- terms of the GNU General Public License as published by the Free Software +-- Foundation; either version 2 of the License, or (at your option) any later +-- version. +-- +-- dotLRN is distributed in the hope that it will be useful, but WITHOUT ANY +-- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +-- FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +-- details. +-- + + +-- +-- The application-track applet for dotLRN +-- +-- ben,arjun@openforce.net +-- +-- 10/05/2001 +-- +-- Postgresql port adarsh@symphinity.com +-- +-- 10th July 2002 +-- +-- Postgresql port adarsh@symphinity.com +-- +-- 8th July 2002 + + + +select acs_sc_impl__delete( + 'dotlrn_applet', -- impl_contract_name + 'dotlrn_application_track' -- impl_name +); + + +-- add all the hooks + +-- GetPrettyName +select acs_sc_impl_alias__delete ( + 'dotlrn_applet', + 'dotlrn_application_track', + 'GetPrettyName' +); + +-- AddApplet +select acs_sc_impl_alias__delete ( + 'dotlrn_applet', + 'dotlrn_application_track', + 'AddApplet' +); + +-- RemoveApplet +select acs_sc_impl_alias__delete ( + 'dotlrn_applet', + 'dotlrn_application_track', + 'RemoveApplet' +); + +-- AddAppletToCommunity +select acs_sc_impl_alias__delete ( + 'dotlrn_applet', + 'dotlrn_application_track', + 'AddAppletToCommunity' +); + +-- RemoveAppletFromCommunity +select acs_sc_impl_alias__delete ( + 'dotlrn_applet', + 'dotlrn_application_track', + 'RemoveAppletFromCommunity' +); + +-- AddUser +select acs_sc_impl_alias__delete ( + 'dotlrn_applet', + 'dotlrn_application_track', + 'AddUser' +); + +-- RemoveUser +select acs_sc_impl_alias__delete ( + 'dotlrn_applet', + 'dotlrn_application_track', + 'RemoveUser' +); + +-- AddUserToCommunity +select acs_sc_impl_alias__delete ( + 'dotlrn_applet', + 'dotlrn_application_track', + 'AddUserToCommunity' +); + +-- RemoveUserFromCommunity +select acs_sc_impl_alias__delete ( + 'dotlrn_applet', + 'dotlrn_application_track', + 'RemoveUserFromCommunity' +); + +-- AddPortlet +select acs_sc_impl_alias__delete ( + 'dotlrn_applet', + 'dotlrn_application_track', + 'AddPortlet' + ); + +-- RemovePortlet +select acs_sc_impl_alias__delete ( + 'dotlrn_applet', + 'dotlrn_application_track', + 'RemovePortlet' +); + +-- Clone +select acs_sc_impl_alias__delete ( + 'dotlrn_applet', + 'dotlrn_application_track', + 'Clone' +); + + +-- Add the binding +select acs_sc_binding__delete ( + 'dotlrn_applet', + 'dotlrn_application_track' +); Index: openacs-4/packages/dotlrn-application-track/tcl/dotlrn-application-track-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-application-track/tcl/dotlrn-application-track-procs.tcl,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn-application-track/tcl/dotlrn-application-track-procs.tcl 8 Nov 2005 15:45:39 -0000 1.1 @@ -0,0 +1,245 @@ +# +# This file is part of dotLRN. +# +# dotLRN is free software; you can redistribute it and/or modify it under the +# terms of the GNU General Public License as published by the Free Software +# Foundation; either version 2 of the License, or (at your option) any later +# version. +# +# dotLRN is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +# details. +# + +ad_library { + + Procs to set up the dotLRN application-track applet + + @author David Ortega (doa@tid.es) + +} + +namespace eval dotlrn_application_track { + + ad_proc -public applet_key { + } { + What's my applet key? + } { + return "dotlrn_application_track" + } + + ad_proc -public package_key { + } { + What package do I deal with? + } { + return "application-track" + } + + ad_proc -public my_package_key { + } { + What's my package key? + } { + return "dotlrn-application-track" + } + + ad_proc -public get_pretty_name { + } { + returns the pretty name + } { + return "#application-track.application_track_managment#" + } + + ad_proc -public add_applet { + } { + Add the application_track applet to dotlrn. One time init - must be repeatable! + } { + dotlrn_applet::add_applet_to_dotlrn -applet_key [applet_key] -package_key [my_package_key] + } + + ad_proc -public remove_applet {} { + remove the applet + } { + set applet_id [dotlrn_applet::get_applet_id_from_key [my_package_key]] + db_exec_plsql delete_applet_from_communities { *SQL* } + db_exec_plsql delete_applet { *SQL* } + } + + ad_proc -public add_applet_to_community { + community_id + } { + Add the application_track applet to a specifc dotlrn community + } { + set portal_id [dotlrn_community::get_portal_id -community_id $community_id] + + # create the application_track package instance (all in one, I've mounted it) + set package_id [dotlrn::instantiate_and_mount $community_id [package_key]] + + # set up the admin portal + set admin_portal_id [dotlrn_community::get_admin_portal_id \ + -community_id $community_id + ] + + application_track_admin_portlet::add_self_to_page \ + -portal_id $admin_portal_id \ + -package_id $package_id + + # add the portlet to the comm's portal using + # add_portlet_helper + set args [ns_set create] + ns_set put $args package_id $package_id + add_portlet_helper $portal_id $args + + return $package_id + } + + ad_proc -public remove_applet_from_community { + community_id + } { + remove the applet from the community + } { + ad_return_complaint 1 "[applet_key] remove_applet_from_community not implemented!" + } + + ad_proc -public add_user { + user_id + } { + one time user-specifuc init + } { + # noop + } + + ad_proc -public remove_user { + user_id + } { + } { + ad_return_complaint 1 "[applet_key] remove_user not implemented!" + } + + ad_proc -public add_user_to_community { + community_id + user_id + } { + Add a user to a specifc dotlrn community + } { + set package_id [dotlrn_community::get_applet_package_id -community_id $community_id -applet_key [applet_key]] + set portal_id [dotlrn::get_portal_id -user_id $user_id] + + # use "append" here since we want to aggregate + set args [ns_set create] + ns_set put $args package_id $package_id + ns_set put $args param_action append + add_portlet_helper $portal_id $args + } + + ad_proc -public remove_user_from_community { + community_id + user_id + } { + Remove a user from a community + } { + set package_id [dotlrn_community::get_applet_package_id -community_id $community_id -applet_key [applet_key]] + set portal_id [dotlrn::get_portal_id -user_id $user_id] + + set args [ns_set create] + ns_set put $args package_id $package_id + + remove_portlet $portal_id $args + } + + ad_proc -public add_portlet { + portal_id + } { + A helper proc to add the underlying portlet to the given portal. + + @param portal_id + } { + # simple, no type specific stuff, just set some dummy values + + set args [ns_set create] + ns_set put $args package_id 0 + ns_set put $args param_action overwrite + add_portlet_helper $portal_id $args + } + + ad_proc -public add_portlet_helper { + portal_id + args + } { + A helper proc to add the underlying portlet to the given portal. + + @param portal_id + @param args an ns_set + } { + application_track_portlet::add_self_to_page \ + -portal_id $portal_id \ + -package_id [ns_set get $args package_id] \ + -param_action [ns_set get $args param_action] + } + + ad_proc -public remove_portlet { + portal_id + args + } { + A helper proc to remove the underlying portlet from the given portal. + + @param portal_id + @param args A list of key-value pairs (possibly user_id, community_id, and more) + } { + application_track_portlet::remove_self_from_page \ + -portal_id $portal_id \ + -package_id [ns_set get $args package_id] + } + + ad_proc -public clone { + old_community_id + new_community_id + } { + Clone this applet's content from the old community to the new one + } { + ns_log notice "Cloning: [applet_key]" + set new_package_id [add_applet_to_community $new_community_id] + set old_package_id [dotlrn_community::get_applet_package_id \ + -community_id $old_community_id \ + -applet_key [applet_key] + ] + + set clone_courses [db_list_of_lists course_clone { + SELECT man_id, application_track_instance_id, community_id, class_key, isenabled, istrackable + FROM ims_cp_manifest_class + WHERE community_id = :old_community_id + }] + + if {![empty_string_p $clone_courses]} { + + foreach course $clone_courses { + set man_id [lindex $course 0] + set isenabled [lindex $course 4] + set istrackable [lindex $course 5] + set class_key [dotlrn_community::get_community_type_from_community_id $new_community_id] + + db_dml add-course { + insert into ims_cp_manifest_class \ + (man_id, application_track_instance_id, community_id, class_key, isenabled, istrackable) \ + values \ + (:man_id, :new_package_id, :new_community_id, :class_key, :isenabled, :istrackable) + } + + } + + } + + return $new_package_id + } + + ad_proc -public change_event_handler { + community_id + event + old_value + new_value + } { + listens for the following events: + } { + } + +} Index: openacs-4/packages/dotlrn-application-track/tcl/dotlrn-application-track-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-application-track/tcl/dotlrn-application-track-procs.xql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn-application-track/tcl/dotlrn-application-track-procs.xql 8 Nov 2005 15:45:39 -0000 1.1 @@ -0,0 +1,31 @@ + + + + + + + select application_track__clone ( + :old_package_id, + :new_package_id + ); + + + + + + + delete from dotlrn_community_applets where applet_id = :applet_id + + + + + + + + delete from dotlrn_applets where applet_id = :applet_id + + + + + +