Presentation is loading. Please wait.

Presentation is loading. Please wait.

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

Similar presentations


Presentation on theme: "Content Management CHAPTER 6 Fundamental elements to content management: (1) storing stuff in a content repository. (2) supporting the workflow of a group."— Presentation transcript:

1 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

2 Content Management CHAPTER 6 A Simple Data Model for Articles : Here's a very basic data model for storing articles: create table articles ( article_idinteger primary key, -- who contributed this and when creation_usernot null references users, creation_datenot 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) languagechar(2) references language_codes, -- could be text/html or text/plain or some sort of XML document mime_typevarchar(100) not null, -- will hold the title in most cases one_line_summaryvarchar(200) not null, -- the entire article; 4 GB limit bodyclob ); MOHAMMAD BORUJERDI 2 INTERNET ENGINEERING

3 Content Management CHAPTER 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_statusvarchar(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

4 Comments on Articles One 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_idinteger primary key, -- on what article is this a comment? refers_tonot null references articles, creation_usenot null references users, creation_datenot null date, languagechar(2) references language_codes, mime_typevarchar(100) not null, one_line_summaryvarchar(200) not null, bodyclob, editorial_statusvarchar(30) check (editorial_status in ('submitted','rejected','approved','expired')) ); Content Management CHAPTER 6 MOHAMMAD BORUJERDI 4 INTERNET ENGINEERING create view comments_on_articles_approved as select * from comments_on_articles_raw where editorial_status = 'approved';

5 Content Management CHAPTER 6 Combining the two tables using refers_to. create table content_raw ( content_idinteger primary key, -- if not NULL, this row represents a comment refers_toreferences content_raw, -- who contributed this and when creation_usernot null references users, creation_datenot null date, -- what language is this in? -- visit http://www.w3.org/International/O-charset-lang languagechar(2) references language_codes, -- could be text/html or text/plain or some sort of XML document mime_typevarchar(100) not null, one_line_summaryvarchar(200) not null, bodyclob, editorial_statusvarchar(30) check (editorial_status in ('submitted','rejected','approved','expired')) ); MOHAMMAD BORUJERDI 5 INTERNET ENGINEERING

6 Content Management CHAPTER 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';

7 Content Management CHAPTER 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_idinteger primary key, refers_toreferences content_raw, creation_usernot null references users, creation_datenot null date, release_timedate,-- NULL means "immediate" expiration_timedate,-- NULL means "never expires" languagechar(2) references language_codes, mime_typevarchar(100) not null, one_line_summaryvarchar(200) not null, bodyclob, editorial_statusvarchar(30) check (editorial_status in ('submitted','rejected','approved','expired')) ); MOHAMMAD BORUJERDI 7 INTERNET ENGINEERING

8 Content Management CHAPTER 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_idinteger primary key, content_typevarchar(100) not null, refers_toreferences content, creation_usernot null references users, creation_datenot null date, release_timedate, expiration_timedate, languagechar(2) references language_codes, mime_typevarchar(100) not null, one_line_summaryvarchar(200) not null, bodyclob, editorial_statusvarchar(30) check (editorial_status in ('submitted','rejected','approved','expired')) ); create view news_current_and_approved as select * 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';

9 Content Management CHAPTER 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 indicat under 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


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

Similar presentations


Ads by Google