Index: openacs-4/packages/cronjob/www/admin/cronjob-add-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cronjob/www/admin/cronjob-add-oracle.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/cronjob/www/admin/cronjob-add-oracle.xql 4 Nov 2001 18:09:49 -0000 1.1 @@ -0,0 +1,33 @@ + + + + oracle8.1.6 + + + + + + declare + v_cronjob_id integer; + begin + v_cronjob_id := cronjob.new( + user_id => :user_id, + description => :description, + approved_p => :approved_p, + disabled_p => :disabled_p, + minute => :minute, + hr => :hr, + mon => :mon, + day => :day, + dayofweek => :dayofweek, + run_sql => :run_sql, + run_tcl => :run_tcl, + email => :email + ); + end; + + + + + + Index: openacs-4/packages/cronjob/www/admin/cronjob-add-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cronjob/www/admin/cronjob-add-postgresql.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/cronjob/www/admin/cronjob-add-postgresql.xql 4 Nov 2001 18:09:49 -0000 1.1 @@ -0,0 +1,26 @@ + + + + postgresql7.1 + + + + select [qd_write_query_select cronjob__new { + user_id => :user_id + description => :description + approved_p => :approved_p + disabled_p => :disabled_p + minute => :minute + hr => :hr + mon => :mon + day => :day + dayofweek => :dayofweek + run_sql => :run_sql + run_tcl => :run_tcl + email => :email } ] + + + + + + Index: openacs-4/packages/cronjob/www/admin/cronjob-add.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cronjob/www/admin/cronjob-add.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/cronjob/www/admin/cronjob-add.tcl 4 Nov 2001 18:09:49 -0000 1.1 @@ -0,0 +1,50 @@ +ad_page_contract { + + Cronjobs Add Page 2 + @author: tom@zmbh.com + @creation-date: 22 Sept 2001 + @cvs-id: $Id: cronjob-add.tcl,v 1.1 2001/11/04 18:09:49 tomj Exp $ + +} { + + description:trim,notnull,html + minute:notnull,trim + hr:notnull,trim + mon:notnull,trim + day:notnull,trim + dayofweek:notnull,trim + run_sql:trim + run_tcl:trim + email:trim,email + +} + +set user_id [ad_maybe_redirect_for_registration] + +set approved_p "t" +set disabled_p "f" + + +db_exec_plsql add_cronjob { + + declare + v_cronjob_id integer; + begin + v_cronjob_id := cronjob.new( + user_id => :user_id, + description => :description, + approved_p => :approved_p, + disabled_p => :disabled_p, + minute => :minute, + hr => :hr, + mon => :mon, + day => :day, + dayofweek => :dayofweek, + run_sql => :run_sql, + run_tcl => :run_tcl, + email => :email + ); + end; +} + +ad_returnredirect cronjobs \ No newline at end of file Index: openacs-4/packages/cronjob/www/admin/cronjob-delete-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cronjob/www/admin/cronjob-delete-oracle.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/cronjob/www/admin/cronjob-delete-oracle.xql 4 Nov 2001 18:09:49 -0000 1.1 @@ -0,0 +1,20 @@ + + + + oracle8.1.6 + + + + + + begin + cronjob.delete( + cronjob_id => :cronjob_id + ); + end; + + + + + + Index: openacs-4/packages/cronjob/www/admin/cronjob-delete-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cronjob/www/admin/cronjob-delete-postgresql.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/cronjob/www/admin/cronjob-delete-postgresql.xql 4 Nov 2001 18:09:49 -0000 1.1 @@ -0,0 +1,16 @@ + + + + postgresql7.1 + + + + + select [qd_write_query_select cronjob__delete { + cronjob_id => :cronjob_id } ] + + + + + + Index: openacs-4/packages/cronjob/www/admin/cronjob-delete.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cronjob/www/admin/cronjob-delete.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/cronjob/www/admin/cronjob-delete.tcl 4 Nov 2001 18:09:49 -0000 1.1 @@ -0,0 +1,22 @@ +ad_page_contract { + + Cronjob Delete + @author: tom@zmbh.com + @creation-date: 22 Sept 2001 + @cvs-id: $Id: cronjob-delete.tcl,v 1.1 2001/11/04 18:09:49 tomj Exp $ + +} { + cronjob_id:integer,trim,notnull + +} + +db_exec_plsql edit_cronjob { + + begin + cronjob.delete( + cronjob_id => :cronjob_id + ); + end; +} + +ad_returnredirect cronjobs \ No newline at end of file Index: openacs-4/packages/cronjob/www/admin/cronjob-edit-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cronjob/www/admin/cronjob-edit-oracle.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/cronjob/www/admin/cronjob-edit-oracle.xql 4 Nov 2001 18:09:49 -0000 1.1 @@ -0,0 +1,31 @@ + + + + oracle8.1.6 + + + + + + begin + cronjob.set_attrs( + cronjob_id => :cronjob_id, + description => :description, + approved_p => :approved_p, + disabled_p => :disabled_p, + minute => :minute, + hr => :hr, + mon => :mon, + day => :day, + dayofweek => :dayofweek, + run_sql => :run_sql, + run_tcl => :run_tcl, + email => :email + ); + end; + + + + + + Index: openacs-4/packages/cronjob/www/admin/cronjob-edit-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cronjob/www/admin/cronjob-edit-postgresql.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/cronjob/www/admin/cronjob-edit-postgresql.xql 4 Nov 2001 18:09:49 -0000 1.1 @@ -0,0 +1,27 @@ + + + + postgresql7.1 + + + + + select [qd_write_query_select cronjob__set_attrs { + cronjob_id => :cronjob_id + description => :description + approved_p => :approved_p + disabled_p => :disabled_p + minute => :minute + hr => :hr + mon => :mon + day => :day + dayofweek => :dayofweek + run_sql => :run_sql + run_tcl => :run_tcl + email => :email } ] + + + + + + Index: openacs-4/packages/cronjob/www/admin/cronjob-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cronjob/www/admin/cronjob-edit.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/cronjob/www/admin/cronjob-edit.tcl 4 Nov 2001 18:09:49 -0000 1.1 @@ -0,0 +1,44 @@ +ad_page_contract { + + Cronjobs Edit Page 2 + @author: tom@zmbh.com + @creation-date: 22 Sept 2001 + @cvs-id: $Id: cronjob-edit.tcl,v 1.1 2001/11/04 18:09:49 tomj Exp $ + +} { + cronjob_id:integer,trim,notnull + {description:trim,html ""} + {minute:trim ""} + {hr:trim ""} + {mon:trim ""} + {day:trim ""} + {dayofweek:trim ""} + {run_sql:trim ""} + {run_tcl:trim ""} + {email:trim,email ""} + {approved_p:trim ""} + {disabled_p:trim ""} + +} + +db_exec_plsql edit_cronjob { + + begin + cronjob.set_attrs( + cronjob_id => :cronjob_id, + description => :description, + approved_p => :approved_p, + disabled_p => :disabled_p, + minute => :minute, + hr => :hr, + mon => :mon, + day => :day, + dayofweek => :dayofweek, + run_sql => :run_sql, + run_tcl => :run_tcl, + email => :email + ); + end; +} + +ad_returnredirect cronjobs \ No newline at end of file Index: openacs-4/packages/cronjob/www/admin/cronjob-run-now.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cronjob/www/admin/cronjob-run-now.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/cronjob/www/admin/cronjob-run-now.tcl 4 Nov 2001 18:09:49 -0000 1.1 @@ -0,0 +1,15 @@ +ad_page_contract { + + Run Cronjob + @author: tom@zmbh.com + @creation-date: 22 Sept 2001 + @cvs-id: $Id: cronjob-run-now.tcl,v 1.1 2001/11/04 18:09:49 tomj Exp $ + +} { + cronjob_id:integer,trim,notnull + +} + +ns_schedule_proc -once -thread 1 cronjob_run $cronjob_id + +ad_returnredirect cronjobs \ No newline at end of file Index: openacs-4/packages/cronjob/www/admin/cronjob.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cronjob/www/admin/cronjob.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/cronjob/www/admin/cronjob.adp 4 Nov 2001 18:09:49 -0000 1.1 @@ -0,0 +1,86 @@ + +@page_title@ +@context_bar@ + +

@page_title@

+ +Delete this cronjob + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Description + + +
Enabled
Approved
Minute (0-59) +
Hour (0-23) +
Month (1-12) +
Day (1-31) +
Day of Week +
SQL to Run + +
Tcl Code to Run + +
Email Address +
+ +
+ +Run This CronJob Now \ No newline at end of file Index: openacs-4/packages/cronjob/www/admin/cronjob.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cronjob/www/admin/cronjob.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/cronjob/www/admin/cronjob.tcl 4 Nov 2001 18:09:49 -0000 1.1 @@ -0,0 +1,104 @@ +ad_page_contract { + + Cronjobs List and Add Page + @author: tom@zmbh.com + @creation-date: 22 Sept 2001 + @cvs-id: $Id: cronjob.tcl,v 1.1 2001/11/04 18:09:49 tomj Exp $ +} { + cronjob_id:integer,notnull + +} -properties { + + page_title:onevalue + context_bar:onevalue + hour_option:onevalue + minute_option:onevalue + month_option:onevalue + day_option:onevalue + dayofweek_option:onevalue +} + +set page_title "One Cronjob" + +set context_bar [list [list "cronjobs" Cronjobs ] [list "One Cronjob"] ] + +set hour_option "" +set minute_option "" +set month_option "" +set day_option "" +set dayofweek_option "" + + + +db_1row cronjob_query " +select + * +from + cronjobs +where + cronjob_id = :cronjob_id" + + + +foreach {value name} [list "\*" "Every Month" 01 January 02 February 03 March 04 April 05 May 06 June 07 July 08 August 09 September 10 October 11 November 12 December] { + if {[string match $mon $value]} { + append month_option " +" + } else { + append month_option " +" + } +} + +foreach {value name} [list "\*" "Every Day of Week" 0 Sunday 1 Monday 2 Tuesday 3 Wednesday 4 Thursday 5 Friday 6 Saturday] { + if {[string match $dayofweek $value]} { + append dayofweek_option " +" + } else { + append dayofweek_option " +" + + } +} + +foreach {value name} [list "\*" "Every Day" 01 1 02 2 03 3 04 4 05 5 06 6 07 7 08 8 09 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 20 21 21 22 22 23 23 24 24 25 25 26 26 27 27 28 28 29 29 30 30 31 31] { + if {[string match $day $value]} { + append day_option " +" + } else { + append day_option " +" + + } +} + +foreach {value name} [list "\*" "Every Hour" 00 0 01 1 02 2 03 3 04 4 05 5 06 6 07 7 08 8 09 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 20 21 21 22 22 23 23] { + if {[string match $hr $value]} { + append hour_option " +" + } else { + append hour_option " +" + + } +} + +foreach {value name} [list "\*" "Every Minute" 00 0 01 1 02 2 03 3 04 4 05 5 06 6 07 7 08 8 09 9 10 10\ + 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 20\ + 21 21 22 22 23 23 24 24 25 25 26 26 27 27 28 28 29 29 30 30\ + 31 31 32 32 33 33 34 34 35 35 36 36 37 37 38 38 39 39 40 40\ + 41 41 42 42 43 43 44 44 45 45 46 46 47 47 48 48 49 49 50 50\ + 51 51 52 52 53 53 54 54 55 55 56 56 57 57 58 58 59 59 ] { + if {[string match $minute $value]} { + append minute_option " +" + } else { + append minute_option " +" + + } +} + + + +ad_return_template \ No newline at end of file Index: openacs-4/packages/cronjob/www/admin/cronjob.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cronjob/www/admin/cronjob.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/cronjob/www/admin/cronjob.xql 4 Nov 2001 18:09:49 -0000 1.1 @@ -0,0 +1,17 @@ + + + + + + +select + * +from + cronjobs +where + cronjob_id = :cronjob_id + + + + + Index: openacs-4/packages/cronjob/www/admin/cronjobs.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cronjob/www/admin/cronjobs.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/cronjob/www/admin/cronjobs.adp 4 Nov 2001 18:09:49 -0000 1.1 @@ -0,0 +1,94 @@ + +@page_title@ +@context_bar@ + +

@page_title@

+ + + + + + + + + + + + + + + + + + +
CronjobScheduleApprovedEnabledDescription
+ @cronjobs.cronjob_id@ :: @cronjobs.user_id@ @cronjobs.minute@ +@cronjobs.hr@ +@cronjobs.mon@ +@cronjobs.day@ +@cronjobs.dayofweek@ ApprovedNot ApprovedDisabledEnabled@cronjobs.description@
+ +

Add New Cronjob

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Description + +
Minute (0-59) +
Hour (0-23) +
Month (1-12) +
Day (1-31) +
Day of Week +
SQL to Run + +
Tcl Code to Run + +
Email Address +
+ +
\ No newline at end of file Index: openacs-4/packages/cronjob/www/admin/cronjobs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cronjob/www/admin/cronjobs.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/cronjob/www/admin/cronjobs.tcl 4 Nov 2001 18:09:49 -0000 1.1 @@ -0,0 +1,64 @@ +ad_page_contract { + + Cronjobs List and Add Page + @author: tom@zmbh.com + @creation-date: 22 Sept 2001 + @cvs-id: $Id: cronjobs.tcl,v 1.1 2001/11/04 18:09:49 tomj Exp $ +} -properties { + + page_title:onevalue + context_bar:onevalue + hour_option:onevalue + minute_option:onevalue + month_option:onevalue + day_option:onevalue + dayofweek_option:onevalue +} + +set page_title "Cronjobs List and Add Page" + +set context_bar [list [list "Cronjobs"]] + +set hour_option "" +set minute_option "" +set month_option "" +set day_option "" +set dayofweek_option "" + +foreach {value name} [list 01 January 02 February 03 March 04 April 05 May 06 June 07 July 08 August 09 September 10 October 11 November 12 December] { + append month_option " +" +} + +foreach {value name} [list 0 Sunday 1 Monday 2 Tuesday 3 Wednesday 4 Thursday 5 Friday 6 Saturday] { + append dayofweek_option " +" +} + +for {set i 1} {$i < 32} {incr i} { + append day_option " +" +} + +for {set i 0} {$i < 24} {incr i} { + append hour_option " +" + +} + +append minute_option $hour_option +for {} {$i < 60} {incr i} { + append minute_option " +" + +} + +db_multirow cronjobs cronjobs_query " +select + * +from + cronjobs +order by + user_id" + +ad_return_template \ No newline at end of file Index: openacs-4/packages/cronjob/www/admin/cronjobs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cronjob/www/admin/cronjobs.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/cronjob/www/admin/cronjobs.xql 4 Nov 2001 18:09:49 -0000 1.1 @@ -0,0 +1,17 @@ + + + + + + +select + * +from + cronjobs +order by + user_id + + + + +