After creating appropriate content sections for the site, the system allows to view/edit/enable/disable the sections. It also allows to link different content sections so as to be shown on the page navigation bar (using ad_scope_navbar).
At this stage, we only support creation and administration of system/admin/custom content sections at the group level. Site wide administrator can only create and manage static public pages.
create table content_sections (
section_id integer primary key,
-- if scope=public, this is the content sections for the whole system
-- if scope=group this is the content sections for particular group
-- is scope=user this is the content sections for particular user
scope varchar(20) not null,
-- if section_type=system, this section corresponds to one of the system sections
-- such as news, bboard, ...
-- if section_type=custom, this section is custom section
-- custom sections serve like url directories. so if group administrator of group travel
-- at photo.net defines custom section sweeden (e.g. photo.net/travel/sweeden), he will be
-- able to then to upload files for this section (see content_files table) in order to display
-- the file photo.net/groups/travel/sweeden/stockholm
-- if section_type=static, this section is static section
-- static sections serve as html pages and address of html page is specified in section_url_stub
-- if you have file arsdigita in your carrers directory then section_url_stub should be
-- /carrers/arsdigita
-- if section_type=admin, this section is system section but does not have associated public pages
-- it only has administration pages.
section_type varchar(20) not null,
-- does user have to be registered in order to access this page
requires_registration_p char(1) default 'f' check(requires_registration_p in ('t','f')),
-- if visibility=public this content section is viewable by everybody
-- if visibility=private this content section is viewable be a user only if scope=user
-- or by group members only if scope=group
visibility varchar(20) not null check(visibility in ('private', 'public')),
user_id references users,
group_id references user_groups,
section_key varchar(30) not null,
-- this is used only for system sections
-- each system sections is associated with an acs module
module_key references acs_modules,
section_url_stub varchar(200),
section_pretty_name varchar(200) not null,
-- if we print lists of sections, where does this go?
-- two sections with same sort_key will sort
-- by upper(section_pretty_name)
sort_key integer,
enabled_p char(1) default 't' check(enabled_p in ('t','f')),
intro_blurb varchar(4000),
help_blurb varchar(4000),
index_page_enabled_p char(1) default 'f' check (index_page_enabled_p in ('t','f')),
-- html content for customizing index page (this is used only for content sections of section_type custom)
body clob,
html_p char(1) default 'f' check(html_p in ('t','f'))
);
The content_files table holds information about different files that belong to a custom section. The files can be of type text/binary.
create table content_files (
content_file_id integer primary key,
section_id references content_sections,
-- this will be part of url; should be a-zA-Z and underscore
file_name varchar(30) not null,
-- this is a MIME type (e.g., text/html, image/jpeg)
file_type varchar(100) not null,
file_extension varchar(50), -- e.g., "jpg"
-- if file is text or html we need page_pretty_name, body and html_p
page_pretty_name varchar(200),
body clob,
html_p char(1) default 'f' check(html_p in ('t','f')),
-- if the file is attachment we need use binary_data blob( e.g. photo, image)
binary_data blob
);
The content_section_links table contains information about links between sections that is used to generate the page navigation bar.
create table content_section_links(
section_link_id integer primary key,
from_section_id references content_sections,
to_section_id references content_sections,
constraint content_section_links_unique unique(from_section_id, to_section_id)
);
As mentioned before, the side wide administrator can Add/View/Edit/Enable/Disable a Static Section from /groups/admin/$group_name/content-sections.