II. Article Reference

Midgard uses article records to store article content in. Articles are grouped in topics. See Topic Records, Objects & Functions for a description of functions related to topics.

1. Article Record Definition

An article record contains information about an article, its owner and the topic it belongs to.

Fields of an article record

id

The id of the article record.

up

Points to the id of the article this record is a reply/followup to.

topic

Points to the topic-id of the topic this record is under.

title

The title of the article.

abstract

An abstract of the article.

content

The content of the article.

author

Points to the person-id of the author of the article.

created

Date and time the article was created.

url

Pointer to a url containing extra information.

calstart

Date indicating a calendar start.

caldays

An integer representing the number of calendar days.

icon

An integer pointing to a possible icon for this article.

view

An integer pointing to a possible view for this article.

print

An integer pointing to a possible printable version of this article.

extra1

A freeform information field.

extra2

A freeform information field.

extra3

A freeform information field.

name

The name of the article.

creator

Points to the person-id of the creator of the article.

revisor

Points to the person-id of the last revisor of the article.

revision

An integer representing the number of times the article has been revised.

approver

Points to the person-id of the approver of the article.

revised

Date and time of the last revision of the article.

approved

Date and time the article has been approved.

score

An integer value that can be used to sort articles.

type

an integer value that can be used to filter articles.

locked

Data and time the article has been locked.

locker

Points to the person-id of the locker of the article.

sitegroup

Points to the sitegroup-id of the sitegroup to which the article belongs.

2. Article Object Definition

Midgard functions like mgd_get_article and mgd_list_topic_articles return objects upon success. This section describes the contents of those objects. Most object parameters map directly to the record fields described above. Only those object parameters that do not have such direct mapping will be explained further.

The functions listed within the object definition are the object methods that are available for the object. Usage information about those methods can be found in Object Methods.

/* Article Object Prototype */

Class article {

  var $N;       # Only available with objects
                # returned by mgd_list_XXX functions.
  var $id;
  var $up;
  var $topic;
  var $name;
  var $title;
  var $abstract;
  var $content;
  var $author;
  var $date;		
  var $adate;   # Date format D b. Y (ex. 6th Aug 2000)
  var $aldate;  # Date format D M Y (ex. 6th August 2000)
  var $extra1;
  var $extra2;
  var $extra3;
  var $score;
  var $type;
  var $created;
  var $creator;
  var $revised;
  var $revisor;
  var $revision;
  var $approved;
  var $approver;
  var $url;
  var $icon;
  var $view;
  var $print;
  var $calendar;
  var $acalendar;  # Date format D b. Y
  var $alcalendar; # Date format D M Y
  var $startdate;
  var $enddate;
  var $calstart;
  var $calstop;

  function fetch();    # Only available with objects
                       # returned by mgd_list_XXX functions.

  function create();
  function update();
  function delete();

  function setsitegroup();
  function getsitegroup();

  function parameter();
  function listparameters();
  function searchparameters();

  function setscore();

  function settype();

  function createattachment();
  function updateattachment();
  function deleteattachment();
  function getattachment();
  function listattachment();
  function openattachment();
  function serveattachment();
}
Table of Contents
mgd_approve_article — Approve/unapprove an article
mgd_copy_article — Copy an article
mgd_create_article — Create a new article
mgd_delete_article — Delete an article
mgd_get_article — Get an article
mgd_get_article_by_name — Get an article by its name
mgd_get_reply_by_name — Get a reply by its name
mgd_is_article_in_topic_tree — Check location within a topic tree
mgd_is_article_owner — Check article ownership
mgd_list_reply_articles — List articles in reply of an article
mgd_list_topic_articles — List articles under topic
mgd_list_topic_articles_all — List articles under topic tree
mgd_list_topic_articles_all_fast — List articles under topic tree
mgd_list_topic_articles_all_of_person — List articles under topic tree owned by a person
mgd_list_topic_calendar_all — List articles under topic (sub)tree in a time window
mgd_list_topic_calendar_all_fast — List articles under topic (sub)tree in a time window
mgd_list_topic_persons — List persons of a topic
mgd_list_topic_persons_all — List persons of a topic tree
mgd_move_article — Move an article to different topic
mgd_move_reply — Move a reply article to a different parent article
mgd_toggle_article_lock — Toggle the locked/unlocked state of an article
mgd_update_article — Modify an article
mgd_update_article_created — Update the creation date of an article
mgd_update_article_replyto — Link one article to another
mgd_update_article_score — Set the score of an article
mgd_update_article_type — Set the type of an article