donb
committed
on 27 Feb 04
Took advantage of Lars's improvement to the template engine (includes are
wrapped in "catch" now so a broken include doesn't break the entir… Show more
Took advantage of Lars's improvement to the template engine (includes are

wrapped in "catch" now so a broken include doesn't break the entire page).

Show less

openacs-4/.../postgresql/portal-core-create.sql (+70 -1)
15 15 --
16 16
17 17 --
18 18 -- create portals model
19 19 --
20 20 -- @author <a href="mailto:arjun@openforce.net">arjun@openforce.net</a>
21 21 -- @author <a href="mailto:yon@openforce.net">yon@openforce.net</a>
22 22 -- @creation-date 2001-10-01
23 23 -- @version $Id$
24 24 --
25 25
26 26 create sequence portal_seq;
27 27
28 28 create table portal_datasources (
29 29     datasource_id                   integer
30 30                                     constraint portal_datasources_pk
31 31                                     primary key,
32 32     name                            varchar(200)
33 33                                     constraint p_datasources_name_nn
34 34                                     not null,
  35     pretty_name                     varchar(200)
  36                                     constraint p_datasources_pretty_name_nn
  37                                     not null,
  38     application                     varchar(100)
  39                                     constraint p_datasources_application_fk
  40                                     references apm_package_types (package_key)
  41                                     on delete cascade
  42                                     constraint p_datasources_application_nn
  43                                     not null,
  44     owner                           varchar(100)
  45                                     constraint p_datasources_owner_fk
  46                                     references apm_package_types (package_key)
  47                                     on delete cascade
  48                                     constraint p_datasources_owner_nn
  49                                     not null,
  50     template                        varchar(200)
  51                                     constraint p_datasources_template_nn
  52                                     not null,
35 53     shadeable_p                     char(1)
36 54                                     default 't'
37 55                                     constraint p_datasources_shadeable_p_nn
38 56                                     not null
39 57                                     constraint p_datasources_shadeable_p_ck
40 58                                     check (shadeable_p in ('t', 'f')),
41 59     hideable_p                      char(1)
42 60                                     default 't'
43 61                                     constraint p_datasources_hideable_p_nn
44 62                                     not null
45 63                                     constraint p_datasources_hideable_p_ck
46 64                                     check (hideable_p in ('t', 'f')),
47 65     description                     varchar(200)
48 66 );
49 67
  68 -- indexes for referential integrity checking
  69
  70 create index p_datasources_application_idx on portal_datasources(application);
  71 create index p_datasources_owner_idx on portal_datasources(owner);
  72
50 73 comment on table portal_datasources is '
51 74     a portal datasource is the package of code that generates the content     
52 75     of a portal element. the foo-portlet packages create datasources.
53 76 ';
54 77
  78 comment on column portal_datasources.name is '
  79     The name of this portal datasourceWe can''t arbitrarily use portlet_key because many
  80     portlet packages will support at least two portlets, one user portlet and one admin
  81     portlet.
  82 ';
  83
  84 comment on column portal_datasources.pretty_name is '
  85     The default pretty name to use for an instance of this portletThis should be a
  86     message key for internationalized portlets.
  87 ';
  88
  89 comment on column portal_datasources.application is '
  90     The package key of the application that this portlet works withFor instance the
  91     forums portlet works with the forums package.
  92 ';
  93
  94 comment on column portal_datasources.owner is '
  95     The package key of the package that implements this portlet.
  96 ';
  97
  98 comment on column portal_datasources.template is '
  99     The name of template that displays the portlet contentNote this is not a full
  100     path, portlet templates go in the standard package template library directory.
  101 ';
  102
55 103 create table portal_datasource_parameters (
56 104     datasource_id                   integer
57 105                                     constraint p_ds_params_datasource_id_fk
58 106                                     references portal_datasources (datasource_id)
59 107                                     on delete cascade
60 108                                     constraint p_ds_params_datasource_id_nn
61 109                                     not null,
62 110     key                             varchar(200)
63 111                                     constraint p_ds_params_key_nn
64 112                                     not null,
65 113     value                           varchar(200),
66 114     config_required_p               char(1)
67 115                                     default 'f'
68 116                                     constraint p_ds_params_cfg_req_p_nn
69 117                                     not null
70 118                                     constraint p_ds_params_cfg_req_p_ck
71 119                                     check (config_required_p in ('t', 'f')),
72 120     configured_p                    char(1)
73 121                                     default 'f'
74 122                                     constraint p_ds_params_cfg_p_nn
 
302 350                                     constraint p_elements_sort_key_nn
303 351                                     not null
304 352                                     constraint p_elements_sort_key_ck
305 353                                     check (sort_key > 0),
306 354     state                           varchar(6)
307 355                                     default 'full'
308 356                                     constraint p_elements_state_ck
309 357                                     check (state in ('full', 'shaded', 'hidden', 'pinned')),
310 358     shadeable_p                     char(1)
311 359                                     default 't'
312 360                                     constraint p_elements_shadeable_p_nn
313 361                                     not null
314 362                                     constraint p_elements_shadeable_p_ck
315 363                                     check (shadeable_p in ('t', 'f')),
316 364     hideable_p                      char(1)
317 365                                     default 't'
318 366                                     constraint p_elements_hideable_p_nn
319 367                                     not null
320 368                                     constraint p_elements_hideable_p_ck
321 369                                     check (hideable_p in ('t', 'f')),
  370     application_id                  integer
  371                                     constraint p_elements_application_id_fk
  372                                     references apm_packages (package_id)
  373                                     on delete cascade
  374                                     constraint p_elements_application_id_nn
  375                                     not null,
  376     bound_object_id                 integer
  377                                     constraint p_elements_b_o_id_fk
  378                                     references acs_objects (object_id)
  379                                     on delete cascade
  380                                     constraint p_elements_b_o_id_nn
  381                                     not null,
322 382     constraint p_elements_page_id_name_un
323 383     unique (page_id, name)
324 384 );
325 385
326 386 comment on table portal_elements is '
327 387     the user-visible "box" on a portal page that displays the content of a datasource
328 388 ';
329 389
330 390 comment on column portal_elements.sort_key is '
331 391     an ordering of elements contained in the same region on a page starting from
332 392     0 for the first element and increasing in an gapless integer sequence
333 393 ';
334 394
335 395 comment on column portal_elements.state is '
336 396     one of the set "full" (normal), "shaded" (title bar only), "hidden" (not shown),
337 397     or "pinned" (like full, but without state change links). portal themes impliment these
338 398     different behaviors based on a given elements state
339 399 ';
340 400
  401 comment on column portal_elements.application_id is '
  402     The package_id of the OpenACS application package instance this element interacts
  403     with.
  404 ';
  405
  406 comment on column portal_elements.bound_object_id is '
  407     The object_id of the object bound to this element, often the same as the application_id.
  408 ';
  409
341 410 create table portal_element_parameters (
342 411     parameter_id                    integer
343 412                                     constraint portal_element_parameters_pk
344 413                                     primary key,
345 414     element_id                      integer
346 415                                     constraint p_element_params_element_id_fk
347 416                                     references portal_elements (element_id)
348 417                                     on delete cascade
349 418                                     constraint p_element_params_element_id_nn
350 419                                     not null,
351 420     key                             varchar(50)
352 421                                     constraint p_element_params_key_nn
353 422                                     not null,
354 423     value                           varchar(200),
355 424     config_required_p               char(1)
356 425                                     default 'f'
357 426                                     constraint p_element_params_cfg_req_p_nn
358 427                                     not null
359 428                                     constraint p_element_params_cfg_req_p_ck
360 429                                     check (config_required_p in ('t', 'f')),