ArsDigita Archives
 
 
   
 
spacer

News Module Design

part of the ArsDigita Community System by Philip Greenspun and Jesse Koontz

I. Essentials

II. Introduction

A news item is something that is interesting for awhile and then should disappear into the archives without further administrator intervention. We want a news article to serve as the focus of user comments. You could use the /bboard system to accomplish the same function. If you did, you'd get the advantages of file attachments, group-based administration, etc. But we think that news truly is different from discussion. We want to present it by date, not by topic. The publisher probably wants to be very selective about what gets posted (as news if not as comments on news). So it gets a separate module.

The /calendar module is better if the news is about an upcoming event. In this module, the non-expired items that are closest are displayed. Also, there is some support for personalization by state or country. See www.harpcolumn.com for a good running example that distinguishes /news from /calendar.

The /bboard system is better if you want to support lively discussion and archive the exchanges.

III. Design Tradeoffs

A Newsgroup approach only allows a small about of administrative control over group scoped news postings.
A message area in the Usenet News, each newsgroup can be either 'moderated' with only postings approved by a moderator publically posted, or 'unmoderated' where all messages are distributed to the newsgroup immediately.

This module has three special newsgroups. The public newsgroup contains news items that are accessed at the site wide scope. The all_users newsgroup contains news items that show up on all newsgroups. The registered_users newsgroup contains news items that show up for all registered users.

IV. Data Model Discussion

The data model has a two tables; one for describing newsgroup and another for holding the news items.

create sequence newsgroup_id_sequence start with 1;

create table newsgroups (
	newsgroup_id	integer primary key,
        -- if scope=all_users, this is the news for all newsgroups
        -- is scope=registered_users, this is the news for all registered users
	-- if scope=public, this is the news for the main newsgroup
	-- if scope=group, this is news associated with a group
        scope           varchar(20) not null,
	group_id	references user_groups,
	check ((scope='group' and group_id is not null) or
	(scope='public') or
	(scope='all_users') or
	(scope='registered_users'))
);


create sequence news_item_id_sequence start with 100000;

create table news_items (
	news_item_id		integer primary key,
	newsgroup_id		references newsgroups not null,
	title			varchar(200) not null,
	body			clob not null,
	-- is the body in HTML or plain text (the default)
	html_p			char(1) default 'f' check(html_p in ('t','f')),
	approval_state		varchar(15) default 'unexamined' check(approval_state in ('unexamined','approved', 'disapproved')),
	approval_date		date,
	approval_user		references users(user_id),
	approval_ip_address	varchar(50),
	release_date		date not null,
	expiration_date		date not null,
	creation_date		date not null,
	creation_user		not null references users(user_id),
	creation_ip_address	varchar(50) not null
);
Comments are handled by the general comments facility and are attached to news items.

Permissions are handled by the general permissions system, and are attached to the newsgroup rows.

This module requires that a row exists in the newsgroups table before news items can be stored for a group (or scope). The all_users, registered_users, and public newsgroups are created by default. The group newsgroups are created when a group administrator or site-wide admin attempts to add an item or set the newsgroup permissions. The default permissions for a non-existent group scope newsgroup is to allow members to view and admins to modify.

V. Legal Transactions

From the Site Administration pages at /admin/news/ the site-wide administrator can
  • Add an item to any of the three newsgroups (registered_users, all_users, or public): insert a new row into table newsgroups
  • View an item in any of the three newsgroups (registered_users, all_users, or public): view rows in table newsgroups
  • Edit an item in any of the three newsgroups (registered_users, all_users, or public), includes release/expire dates: changes rows in table newsgroups
  • Approve/Revoke items for posting in any of the three groups (registered_users, all_users, or public): changes approval_state

From the Maintainers admin pages at /news/admin/ news maintainers can

  • Add an item to his newsgroup: insert a new row into table newsgroups
  • View an item in his newsgroup: view rows in table newsgroups
  • Edit an item in his newsgroup, includes release/expire dates: changes rows in table newsgroups
  • Approve/Revoke items for posting in his newsgroup: changes approval_state

VI. User Interface

The Site-wide Administrator Interface

The administrator may create or edit (includes release/expire dates) all news items on his Web site from the site-wide administration directory.

The Sub-site-wide Administrator Interface

The sub-admin may create or edit (includes release/expire dates) all news items for his sub-site (user group).

The User Interface

The user may only read news items. And, he may only read news items from the public newsgroups and news items belonging to newsgroups of which he is a member.

VII. Acceptance Test

  • As site-wide admin:
    • Go to /admin/news/
    • Create a news item in the public newsgroup
    • Visit /news/ and click on the news item
    • Edit the news item
    • Expire the news item
  • As a simple user:
    • Go to /news/
    • Read the public news item
  • As an administrator for Group X
    • Go to /news/admin/
    • Create a news item
    • Visit /news/ and click on the news item
    • Edit the news item
    • Expire the news item

VIII. Future Improvements/Areas of Likely Change

This module will eventually be designed to produce an XML document of the news items to be displayed. This can then be displayed in an adp templating system or incorporated as a part of a larger XML document.

The module may also eventually support the deletion of items (and associated permissions and comments).

IX. Authors


audrey@arsdigita.com
spacer