Skip to content
ciceron edited this page Dec 2, 2015 · 7 revisions

Blogs module

Introduction

The blogs plugin is a small blog application which allows users to publish articles. A user may own several blogs, each blog having a name and its own base URI. Within a blog, the user may write articles and publish them. Once published, the articles are visible to anonymous users.

The blogs plugin uses the ] and ] modules to allow to associate tags to a post and allow users to comment on the articles.

Model

Integration

The Blog_Module manages the creation, update, removal of blog posts in an application. It provides operations that are used by the blog beans or other services to create and update posts. An instance of the Blog_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
   Blog_Module : aliased AWA.Blogs.Modules.Blog_Module;
end record;

And registered in the Initialize_Modules procedure by using:

Register (App    => App.Self.all'Access,
          Name   => AWA.Blogs.Modules.NAME,
          URI    => "blogs",
          Module => App.Blog_Module'Access);

Blog Beans

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

Ada Beans

Name Description
post This bean describes a blog post for the creation or the update
postList This bean describes a blog post for the creation or the update
postStatusList A localized list of post statuses to be used for a f:selectItems
adminBlog The list of blogs and posts that the current user can access and update.
blog Information about the current blog.
blogTagSearch The blog tag search bean.
blogTagCloud A list of tags associated with all post entities.
postComments A list of comments associated with a post.
postNewComment The bean to allow a user to post a new comment. This is a specific bean because the permission to create a new post is different from other permissions. If the permission is granted, the comment will be created and put in the COMMENT_WAITING state. An email will be sent to the post author for approval.
blogPublishComment The bean to allow the blog administrator to change the publication status of a comment.
commentEdit The bean to allow a user to edit the comment. This is a specific bean because the permission to edit the comment is different from other permissions.

Permissions

Name Name Description
blog-create awa_workspace Permission to create a new blog.
blog-delete awa_blog Permission to delete a blog.
blog-create-post awa_blog Permission to create a new post.
blog-update-post awa_blog Permission to modify a post.
blog-delete-post awa_blog Permission to delete a post.
blog-add-comment awa_post
blog-publish-comment awa_blog Permission to change the publish status of a comment.

Queries

AWA.Blogs.Models.Admin_Post_Info

The Admin_Post_Info describes a post in the administration interface.

Type Ada Name Description
Identifier id the post identifier.
String title the post title.
String uri the post uri.
Date date the post publish date.
AWA.Blogs.Models.Post_Status_Type status the post status.
Natural read_count the number of times the post was read.
String username the user name.
Natural comment_count the number of comments for this post.

AWA.Blogs.Models.Post_Info

The Post_Info describes a post to be displayed in the blog page

Type Ada Name Description
Identifier id the post identifier.
String title the post title.
String uri the post uri.
Date date the post publish date.
String username the user name.
String text the post text.
Natural comment_count the number of comments for this post.

AWA.Blogs.Models.Comment_Info

The comment information.

Type Ada Name Description
Identifier id the comment identifier.
Identifier post_id the post identifier.
String title the post title.
String author the comment author's name.
String email the comment author's email.
Date date the comment date.
AWA.Comments.Models.Status_Type status the comment status.

AWA.Blogs.Models.Blog_Info

The list of blogs.

Type Ada Name Description
Identifier id the blog identifier.
String title the blog title.
String uid the blog uuid.
Date create_date the blog creation date.
Integer post_count the number of posts published.

Generated by Dynamo from awa-blogs.ads

Clone this wiki locally