Content Management CHAPTER 6 Fundamental elements to content management: (1) storing stuff in a...

9
Content Management CHAPTER 6 Fundamental elements to content management: (1) storing stuff in a content repository. (2) supporting the workflow of a group of people engaged in putting stuff into repository. An important part of the art of content management for an online learning community is reducing the number of types of content because every new table defined implies roughly twenty Web scripts. Example : 6 tables: articles, comments_on_articles, news, comments_on_news, questions, answers. User Experience scripts : view a directory of content in Table A, view one category, view one item, view the newest items, grab a form to insert an item, confirm insertion, request an email alert of comments on an item. Admin scripts : view a directory of content in Table A, view one category, view one item, view the newest items, approve an item, disapprove an item, delete an item, confirm deletion of an item, etc. It will be a bit tough to code these twenty scripts in a general fashion because the SQL statements will differ in at least the table names used. MOHAMMAD BORUJERDI 1 INTERNET ENGINEERING

Transcript of Content Management CHAPTER 6 Fundamental elements to content management: (1) storing stuff in a...

Page 1: Content Management CHAPTER 6 Fundamental elements to content management: (1) storing stuff in a content repository. (2) supporting the workflow of a group.

Content ManagementCHAPTER 6

Fundamental elements to content management:

(1) storing stuff in a content repository.

(2) supporting the workflow of a group of people engaged in putting stuff into repository.

An important part of the art of content management for an online learning community is reducing the number of types of content because every new table defined implies roughly twenty Web scripts.

Example : 6 tables: articles, comments_on_articles, news, comments_on_news, questions, answers.

User Experience scripts : view a directory of content in Table A, view one category, view one item, view the newest items, grab a form to insert an item, confirm insertion, request an email alert of comments on an item.

Admin scripts : view a directory of content in Table A, view one category, view one item, view the newest items, approve an item, disapprove an item, delete an item, confirm deletion of an item, etc.

It will be a bit tough to code these twenty scripts in a general fashion because the SQL

statements will differ in at least the table names used.

MOHAMMAD BORUJERDI

1

INTERNET ENGINEERING

Page 2: Content Management CHAPTER 6 Fundamental elements to content management: (1) storing stuff in a content repository. (2) supporting the workflow of a group.

Content ManagementCHAPTER 6

A Simple Data Model for Articles :

Here's a very basic data model for storing articles:

create table articles (article_id integer primary key,-- who contributed this and whencreation_user not null references users,creation_date not null date,-- what language is this in?-- visit http://www.w3.org/International/O-charset-lang-- to see the allowable 2-character codes (en is English, ja is Japanese)language char(2) references language_codes,-- could be text/html or text/plain or some sort of XML documentmime_type varchar(100) not null,-- will hold the title in most casesone_line_summary varchar(200) not null,-- the entire article; 4 GB limitbody clob

);

MOHAMMAD BORUJERDI

2

INTERNET ENGINEERING

Page 3: Content Management CHAPTER 6 Fundamental elements to content management: (1) storing stuff in a content repository. (2) supporting the workflow of a group.

Content ManagementCHAPTER 6

Should all articles shown to all users? Perhaps it would be nice to have the ability to store an article and hold it for editorial examination:

create table articles (

. . .

editorial_status varchar(30)

check (editorial_status in ('submitted','rejected','approved','expired'))

);

Programmers in your organization must remember to include a where editorial_status = 'approved' clause in every script on the site? Perhaps not. rename the table altogether and build a view for use by application programmers:

create table articles_raw (

. . .

);

create view articles_approved

as

select *

from articles_raw

where editorial_status = 'approved';

MOHAMMAD BORUJERDI

3

INTERNET ENGINEERING

Page 4: Content Management CHAPTER 6 Fundamental elements to content management: (1) storing stuff in a content repository. (2) supporting the workflow of a group.

Comments on ArticlesOne of the six required elements of online community: means of collaboration.

Are often the most interesting material on a site.

Ability to express and present multiple truths.

create table comments_on_articles_raw (

comment_id integer primary key,

-- on what article is this a comment?

refers_to not null references articles,

creation_use not null references users,

creation_date not null date,

language char(2) references language_codes,

mime_type varchar(100) not null,

one_line_summary varchar(200) not null,

body clob,

editorial_status varchar(30)

check (editorial_status in ('submitted','rejected','approved','expired'))

);

Content ManagementCHAPTER 6

MOHAMMAD BORUJERDI

4

INTERNET ENGINEERING

create view comments_on_articles_approved

as

select *

from comments_on_articles_raw

where editorial_status = 'approved';

Page 5: Content Management CHAPTER 6 Fundamental elements to content management: (1) storing stuff in a content repository. (2) supporting the workflow of a group.

Content ManagementCHAPTER 6

Combining the two tables using refers_to.

create table content_raw (

content_id integer primary key,

-- if not NULL, this row represents a comment

refers_to references content_raw,

-- who contributed this and when

creation_user not null references users,

creation_date not null date,

-- what language is this in? -- visit http://www.w3.org/International/O-charset-lang

language char(2) references language_codes,

-- could be text/html or text/plain or some sort of XML document

mime_type varchar(100) not null,

one_line_summary varchar(200) not null,

body clob,

editorial_status varchar(30)

check (editorial_status in ('submitted','rejected','approved','expired'))

);

MOHAMMAD BORUJERDI

5

INTERNET ENGINEERING

Page 6: Content Management CHAPTER 6 Fundamental elements to content management: (1) storing stuff in a content repository. (2) supporting the workflow of a group.

Content ManagementCHAPTER 6

MOHAMMAD BORUJERDI

6

INTERNET ENGINEERING

To be able to write some scripts without having to think about the fact that different content types are merged

create view articles_approved

as

select *

from content_raw

where refers_to is null

and editorial_status = 'approved';

create view comments_on_articles_approved

as

select *

from content_raw

where refers_to is not null

and editorial_status = 'approved';

Page 7: Content Management CHAPTER 6 Fundamental elements to content management: (1) storing stuff in a content repository. (2) supporting the workflow of a group.

Content ManagementCHAPTER 6

What is Different about News?

An expiration date and a release_time

these columns could be useful for all site content.

create table content_raw (content_id integer primary key,refers_to references content_raw,creation_user not null references users,creation_date not null date,release_time date, -- NULL means "immediate"expiration_time date, -- NULL means "never expires"language char(2) references language_codes,mime_type varchar(100) not null,one_line_summary varchar(200) not null,body clob,editorial_status varchar(30)

check (editorial_status in ('submitted','rejected','approved','expired')));

MOHAMMAD BORUJERDI

7

INTERNET ENGINEERING

Page 8: Content Management CHAPTER 6 Fundamental elements to content management: (1) storing stuff in a content repository. (2) supporting the workflow of a group.

Content ManagementCHAPTER 6

MOHAMMAD BORUJERDI

8

INTERNET ENGINEERING

To distinguishes a news story from an article on the Windows We'll need one more column: create table content_raw (

content_id integer primary key,content_type varchar(100) not null,refers_to references content,creation_user not null references users,creation_date not null date,release_time date,expiration_time date,language char(2) references language_codes,mime_type varchar(100) not null,one_line_summary varchar(200) not null,body clob,editorial_status varchar(30)

check (editorial_status in ('submitted','rejected','approved','expired')));create view news_current_and_approvedasselect *from content_raw where content_type = 'news'and (release_time is null or sysdate >= release_time)and (expiration_time is null or sysdate <= expiration_time)and editorial_status = 'approved';

Page 9: Content Management CHAPTER 6 Fundamental elements to content management: (1) storing stuff in a content repository. (2) supporting the workflow of a group.

Content ManagementCHAPTER 6

What about Discussion?simply add rows to the content_raw table with a content_type of "forum_posting" and

query for the questions by checking refers_to is null.

On a site with multiple forums, we'd need to add a parent_id column to indicatunder which topic a given question falls. Within a forum with many archived posts, we'll also need some way of storing categorization, e.g., "this is aDarkroom question".

Why Not Use the File System?One good thing about the file system is that there are a lot of tools for users with different levels of skill to add, update, remove, and rename files.

One bad thing about giving many people access to the file system is the potential for chaos. A designer is supposed to upload a template, but ends up removing a script by mistake.

The deepest problem with using the file system as a cornerstone of your content management system is that files are outside of the database. You will need to store a lot of references to content in the database, e.g., "User 960 is the author of Article 231", "Comment 912 is a comment on Article 529", etc. It is very difficult to keep a set of consistent references to things outside the RDBMS..

. . . .

MOHAMMAD BORUJERDI

9

INTERNET ENGINEERING