Comments Module

The Comments module is a general purpose module that allows to associate user comments to any database entity. The module defines several bean types that allow to display a list of comments or edit and publish a new comment.


The Comment_Module manages the comments associated with entities. It provides operations that are used by the comment beans to manage the comments. An instance of the Comment_Module must be declared and registered in the AWA application. The module instance can be defined as follows:

type Application is new AWA.Applications.Application with record
   Comment_Module : aliased AWA.Comments.Modules.Comment_Module;
end record;

And registered in the Initialize_Modules procedure by using:

Register (App    => App.Self.all'Access,
          Name   => AWA.Comments.Modules.NAME,
          URI    => "comments",
          Module => App.Comment_Module'Access);

Ada Beans

Several bean types are provided to represent and manage a list of tags. The tag module registers the bean constructors when it is initialized. To use them, one must declare a bean definition in the application XML configuration.


The Comment_List_Bean holds a list of comments and provides operations used by the awa:tagList component to add or remove tags within a h:form component. A bean can be declared and configured as follows in the XML application configuration file:


The entity_type property defines the name of the database table to which the comments are assigned. The permission property defines the permission name that must be used to verify that the user has the permission do add or remove the comment.


The comment information.

Type Ada Name Description
Identifier id the comment identifier.
String author the comment author's name.
String email the comment author's email.
Date date the comment date.
AWA.Comments.Models.Format_Type format the comment format type.
String comment the comment text.
AWA.Comments.Models.Status_Type status the comment status.
Name Description
comment-list Get the list of comments associated with given database entity
all-comment-list Get the list of comments associated with given database entity

Data model

The database model is generic and it uses the Entity_Type provided by Ada Database Objects to associate a comment to entities stored in different tables. The Entity_Type identifies the database table and the stored identifier in for_entity_id defines the entity in that table.