Index: openacs-4/packages/acs-templating/sql/oracle/template-demo-notes-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/sql/oracle/template-demo-notes-create.sql,v diff -u -N -r1.1 -r1.2 --- openacs-4/packages/acs-templating/sql/oracle/template-demo-notes-create.sql 4 Feb 2006 01:54:41 -0000 1.1 +++ openacs-4/packages/acs-templating/sql/oracle/template-demo-notes-create.sql 6 Feb 2006 13:06:29 -0000 1.2 @@ -38,6 +38,14 @@ pretty_plural => 'Bodies', datatype => 'string' ); + + attr_id := acs_attribute.create_attribute ( + object_type => 'template_demo_note', + attribute_name => 'color', + pretty_name => 'Color', + pretty_plural => 'Colors', + datatype => 'string' + ); end; / show errors; @@ -48,7 +56,8 @@ primary key, title varchar(255) not null, - body varchar(4000) + body varchar(4000), + color varchar(100) ); create or replace package template_demo_note @@ -57,6 +66,8 @@ template_demo_note_id in template_demo_notes.template_demo_note_id%TYPE default null, title in template_demo_notes.title%TYPE, body in template_demo_notes.body%TYPE, + color in template_demo_notes.color%TYPE, + object_type in acs_object_types.object_type%TYPE default 'template_demo_note', creation_date in acs_objects.creation_date%TYPE @@ -84,6 +95,8 @@ template_demo_note_id in template_demo_notes.template_demo_note_id%TYPE default null, title in template_demo_notes.title%TYPE, body in template_demo_notes.body%TYPE, + color in template_demo_notes.color%TYPE, + object_type in acs_object_types.object_type%TYPE default 'note', creation_date in acs_objects.creation_date%TYPE @@ -106,9 +119,9 @@ ); insert into template_demo_notes - (template_demo_note_id, title, body) + (template_demo_note_id, title, body, color) values - (v_template_demo_note_id, title, body); + (v_template_demo_note_id, title, body, color); acs_permission.grant_permission( object_id => v_template_demo_note_id, Index: openacs-4/packages/acs-templating/sql/postgresql/template-demo-notes-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/sql/postgresql/template-demo-notes-create.sql,v diff -u -N -r1.3 -r1.4 --- openacs-4/packages/acs-templating/sql/postgresql/template-demo-notes-create.sql 6 Feb 2006 06:53:22 -0000 1.3 +++ openacs-4/packages/acs-templating/sql/postgresql/template-demo-notes-create.sql 6 Feb 2006 13:06:29 -0000 1.4 @@ -66,6 +66,22 @@ ''f'' -- static_p ); + PERFORM acs_attribute__create_attribute ( + ''template_demo_note'', -- object_type + ''color'', -- attribute_name + ''string'', -- datatype + ''Color'', -- pretty_name + ''Colors'', -- pretty_plural + null, -- table_name + null, -- column_name + null, -- default_value + 1, -- min_n_values + 1, -- max_n_values + null, -- sort_order + ''type_specific'', -- storage + ''f'' -- static_p + ); + return 0; end;' language 'plpgsql'; @@ -82,22 +98,24 @@ title varchar(255) constraint template_demo_notes_title_nn not null, - body text + body text, + color text ); -select define_function_args('template_demo_note__new','template_demo_note_id,title,body,object_type;note,creation_date;now,creation_user,creation_ip,context_id'); +select define_function_args('template_demo_note__new','template_demo_note_id,title,body,color,object_type;note,creation_date;now,creation_user,creation_ip,context_id'); -create function template_demo_note__new (integer,varchar,varchar,varchar,timestamptz,integer,varchar,integer) +create function template_demo_note__new (integer,varchar,varchar,varchar,varchar,timestamptz,integer,varchar,integer) returns integer as ' declare p_template_demo_note_id alias for $1; -- default null p_title alias for $2; p_body alias for $3; - p_object_type alias for $4; -- default ''template_demo_note'' - p_creation_date alias for $5; -- default now() - p_creation_user alias for $6; -- default null - p_creation_ip alias for $7; -- default null - p_context_id alias for $8; -- default null + p_color alias for $4; + p_object_type alias for $5; -- default ''template_demo_note'' + p_creation_date alias for $6; -- default now() + p_creation_user alias for $7; -- default null + p_creation_ip alias for $8; -- default null + p_context_id alias for $9; -- default null v_template_demo_note_id template_demo_notes.template_demo_note_id%TYPE; begin v_template_demo_note_id := acs_object__new ( @@ -110,9 +128,9 @@ ); insert into template_demo_notes - (template_demo_note_id, title, body) + (template_demo_note_id, title, body, color) values - (v_template_demo_note_id, p_title, p_body); + (v_template_demo_note_id, p_title, p_body, p_color); if p_creation_user is not null then PERFORM acs_permission__grant_permission( @@ -163,4 +181,4 @@ -- neophytosd -\i template-demo-notes-sample.sql +-- \i template-demo-notes-sample.sql Index: openacs-4/packages/acs-templating/sql/postgresql/template-demo-notes-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/sql/postgresql/template-demo-notes-drop.sql,v diff -u -N -r1.2 -r1.3 --- openacs-4/packages/acs-templating/sql/postgresql/template-demo-notes-drop.sql 6 Feb 2006 06:53:22 -0000 1.2 +++ openacs-4/packages/acs-templating/sql/postgresql/template-demo-notes-drop.sql 6 Feb 2006 13:06:29 -0000 1.3 @@ -6,7 +6,7 @@ -- neophytosd --drop functions -drop function template_demo_note__new (integer,varchar,varchar,varchar,timestamptz,integer,varchar,integer); +drop function template_demo_note__new (integer,varchar,varchar,varchar,varchar,timestamptz,integer,varchar,integer); drop function template_demo_note__del(integer); drop function template_demo_note__name (integer); Index: openacs-4/packages/acs-templating/sql/postgresql/template-demo-notes-sample.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/sql/postgresql/template-demo-notes-sample.sql,v diff -u -N -r1.3 -r1.4 --- openacs-4/packages/acs-templating/sql/postgresql/template-demo-notes-sample.sql 6 Feb 2006 06:53:22 -0000 1.3 +++ openacs-4/packages/acs-templating/sql/postgresql/template-demo-notes-sample.sql 6 Feb 2006 13:06:29 -0000 1.4 @@ -22,8 +22,9 @@ NULL, ''title01'', ''body01'', - ''template_demo_note'', + ''red'', + ''template_demo_note'', now(), owning_party, NULL, @@ -35,8 +36,9 @@ NULL, ''title02'', ''body02'', - ''template_demo_note'', + ''blue'', + ''template_demo_note'', now(), owning_party, NULL, @@ -48,8 +50,9 @@ NULL, ''title03'', ''body03'', - ''template_demo_note'', + ''green'', + ''template_demo_note'', now(), owning_party, NULL, @@ -61,8 +64,9 @@ NULL, ''title04'', ''body04'', - ''template_demo_note'', + ''orange'', + ''template_demo_note'', now(), owning_party, NULL, @@ -74,8 +78,9 @@ NULL, ''title05'', ''body05'', - ''template_demo_note'', + ''purple'', + ''template_demo_note'', now(), owning_party, NULL, @@ -87,8 +92,9 @@ NULL, ''title06'', ''body06'', - ''template_demo_note'', + ''red'', + ''template_demo_note'', now(), owning_party, NULL, @@ -100,8 +106,9 @@ NULL, ''title07'', ''body07'', - ''template_demo_note'', + ''blue'', + ''template_demo_note'', now(), owning_party, NULL, @@ -113,8 +120,9 @@ NULL, ''title08'', ''body08'', - ''template_demo_note'', + ''green'', + ''template_demo_note'', now(), owning_party, NULL, @@ -126,8 +134,9 @@ NULL, ''title09'', ''body09'', - ''template_demo_note'', + ''orange'', + ''template_demo_note'', now(), owning_party, NULL, @@ -139,8 +148,9 @@ NULL, ''title10'', ''body10'', - ''template_demo_note'', + ''purple'', + ''template_demo_note'', now(), owning_party, NULL, @@ -152,8 +162,9 @@ NULL, ''title11'', ''body11'', - ''template_demo_note'', + ''red'', + ''template_demo_note'', now(), owning_party, NULL, @@ -165,8 +176,9 @@ NULL, ''title12'', ''body12'', - ''template_demo_note'', + ''blue'', + ''template_demo_note'', now(), owning_party, NULL, @@ -178,8 +190,9 @@ NULL, ''title13'', ''body13'', - ''template_demo_note'', + ''green'', + ''template_demo_note'', now(), owning_party, NULL, @@ -191,8 +204,9 @@ NULL, ''title14'', ''body14'', - ''template_demo_note'', + ''orange'', + ''template_demo_note'', now(), owning_party, NULL, @@ -204,8 +218,9 @@ NULL, ''title15'', ''body15'', - ''template_demo_note'', + ''purple'', + ''template_demo_note'', now(), owning_party, NULL, @@ -217,8 +232,9 @@ NULL, ''title16'', ''body16'', - ''template_demo_note'', + ''red'', + ''template_demo_note'', now(), owning_party, NULL, @@ -230,8 +246,9 @@ NULL, ''title17'', ''body17'', - ''template_demo_note'', + ''blue'', + ''template_demo_note'', now(), owning_party, NULL, @@ -243,21 +260,9 @@ NULL, ''title18'', ''body18'', - ''template_demo_note'', + ''green'', - now(), - owning_party, - NULL, - context - ); - - perform template_demo_note__new - ( - NULL, - ''title1'', - ''body1'', ''template_demo_note'', - now(), owning_party, NULL, @@ -269,8 +274,9 @@ NULL, ''title19'', ''body19'', - ''template_demo_note'', + ''orange'', + ''template_demo_note'', now(), owning_party, NULL, @@ -282,8 +288,9 @@ NULL, ''title20'', ''body20'', - ''template_demo_note'', + ''purple'', + ''template_demo_note'', now(), owning_party, NULL, Index: openacs-4/packages/acs-templating/www/doc/demo/index.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/doc/demo/index.html,v diff -u -N -r1.5 -r1.6 --- openacs-4/packages/acs-templating/www/doc/demo/index.html 4 Feb 2006 23:07:19 -0000 1.5 +++ openacs-4/packages/acs-templating/www/doc/demo/index.html 6 Feb 2006 13:06:29 -0000 1.6 @@ -346,6 +346,19 @@ View + + Add the ability to sort by any column + + + View .tcl
+ postgres query
+ oracle query + + View + View + View + +

Forms

Index: openacs-4/packages/acs-templating/www/doc/demo/list2/index-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/doc/demo/list2/index-oracle.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/packages/acs-templating/www/doc/demo/list2/index-oracle.xql 4 Feb 2006 23:07:19 -0000 1.1 +++ openacs-4/packages/acs-templating/www/doc/demo/list2/index-oracle.xql 6 Feb 2006 13:06:29 -0000 1.2 @@ -7,6 +7,7 @@ select n.template_demo_note_id, n.title, + n.color, to_char(o.creation_date, 'HH12:MI Month DD, YYYY') as creation_date, p.first_names || ' ' || p.last_name as creation_user_name, decode(acs_permission.permission_p(template_demo_note_id, Index: openacs-4/packages/acs-templating/www/doc/demo/list2/index-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/doc/demo/list2/index-postgresql.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/packages/acs-templating/www/doc/demo/list2/index-postgresql.xql 4 Feb 2006 23:07:19 -0000 1.1 +++ openacs-4/packages/acs-templating/www/doc/demo/list2/index-postgresql.xql 6 Feb 2006 13:06:29 -0000 1.2 @@ -8,6 +8,7 @@ select n.template_demo_note_id, n.title, + n.color, to_char(o.creation_date, 'HH12:MI Month DD, YYYY') as creation_date, p.first_names || ' ' || p.last_name as creation_user_name from Index: openacs-4/packages/acs-templating/www/doc/demo/list2/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/doc/demo/list2/index.tcl,v diff -u -N -r1.1 -r1.2 --- openacs-4/packages/acs-templating/www/doc/demo/list2/index.tcl 4 Feb 2006 23:07:19 -0000 1.1 +++ openacs-4/packages/acs-templating/www/doc/demo/list2/index.tcl 6 Feb 2006 13:06:29 -0000 1.2 @@ -33,6 +33,9 @@ creation_date { label "When Note Created" } + color { + label "Color" + } } ad_return_template