| Portlet name | ForumPortlet |
| War name | forum.war |
| Description | The Forum portlet is the application for users to post and read messages on different topics. |
Declaration template
<portlet-application>
<portlet>
<application-ref>forum</application-ref>
<portlet-ref>ForumPortlet</portlet-ref>
</portlet>
</portlet-application>
| Preference name | Possible value | Default value | Description |
|---|---|---|---|
| useAjax | true, false | true | To define if links in the forum will be plain hrefs or javascript ajax (better for SEO) or not. |
| showForumActionBar | true, false | true | This is the UIForumActionBar. If the value is set true, the UIForumActionBar will be shown. If false, the UIForumActionBar will be hidden. |
| forumNewPost | day number | 1 | To specify if a post is new. If the post is created within the set period, it is new in the forum. |
| enableIPLogging | true, false | true | To enable the IP logging function in the forum. IP addresses of all posts will be collected. |
| enableIPFiltering | true, false | true | To enable the IP filtering function in the forum. It is allowed to block IP addresses on the forums. |
| invisibleCategories | id categories | empty | To hide some categories. If the value is set empty, all categories of the forum will be shown. |
| invisibleForums | id forums | empty | To hide some forums. All forums will be shown if the value is set empty. |
| uploadFileSizeLimitMB | integer | 20 | To limit the size of uploaded files in MB in the forum. |
| isShowForumJump | true, false | true | To specify if the forum jump panel is shown or not. |
| isShowIconsLegend | true, false | true | To specify if the icon legends panel is shown or not. |
| isShowModerators | true, false | true | To specify if the moderators panel is shown or not. |
| isShowPoll | true, false | true | To specify if the poll panel is shown or not. |
| isShowQuickReply | true, false | true | To specify if the quick reply panel is shown or not. |
| isShowRules | true, false | true | To specify if the forum rules panel is shown or not. |
| isShowStatistics | true, false | true | To specify if the statistics panel is shown or not. |
| Name | Description | |
|---|---|---|
| ForumLinkEvent | To set the render for UIForumLinkPortlet and set values for UIForumLinks. | |
| ReLoadPortletEvent | To reload UIForumPortlet. | |
| OpenLink | To update values for UIForumLinks. | |
| ForumPollEvent | To setRender for UIForumPollPortlet. | |
| ForumModerateEvent | To setRender for UIForumModeratorPortlet. | |
| ForumRuleEvent | To setRender for UIForumRulePortlet. | |
| QuickReplyEvent | To setRender for UIForumQuickReplyPortlet. |
This event is fired through UIForumLinkPortlet.
To receive ForumLinkEvent, you must use the ForumParameter class with two properties:
| Name | Type | Possible value | Description | |
|---|---|---|---|---|
| isRenderForumLink | boolean | true/false | If the value is set to true or false, the Forum link is rendered or not respectively. | |
| path | string | Absolute path of the class node (including types: category, forum, topic) defined by JCR | To set data for the UIForumLinkPortlet. |
Example:
PortletRequestContext pcontext = (PortletRequestContext) WebuiRequestContext.getCurrentInstance();
ActionResponse actionRes = (ActionResponse) pcontext.getResponse();
ForumParameter param = new ForumParameter();
String path = forum.getPath();
if ( ...condition to render the UIForumLinkPortlet... ) {
param.setRenderForumLink(true);
param.setPath(path);
} else {
param.setRenderForumLink(false);
}
actionRes.setEvent(new QName("ForumLinkEvent"), param) ;
This event is fired through UIForumPortlet.
To receive ReLoadPortletEvent, you must use the ForumParameter class with two properties:
| Name | Type | Possible value | Description | |
|---|---|---|---|---|
| topicId | string | id of topic | To return id of topic for UIForumPortlet | |
| isRenderPoll | boolean | true/false | If the value is set to true or false, the UITopicPoll component is rendered or not respectively. |
Example:
....
ActionResponse actionRes = pcontext.getResponse() ;
ForumParameter param = new ForumParameter() ;
param.setRenderPoll(true);
param.setTopicId(topic.get());
actionRes.setEvent(new QName("ReLoadPortletEvent"), param) ;
This event is fired through UIForumPortlet.
To receive OpenLink, you must use the ForumParameter class with one property:
| Name | Type | Possible value | Description | |
|---|---|---|---|---|
| path | string | Absolute path of the node defined by JCR | To set data for the UIForumPortlet. |
Example:
....
ActionResponse actionRes = pcontext.getResponse() ;
ForumParameter param = new ForumParameter() ;
param.setPath(path);
actionRes.setEvent(new QName("OpenLink"), param) ;
This event is fired through UIForumPollPortlet.
To receive ForumPollEvent, you must use the ForumParameter class with four properties:
| Name | Type | Possible value | Description | |
|---|---|---|---|---|
| isRenderPoll | boolean | true/false | If the value is set to true or false, the UIForumPollPortlet portlet is rendered or not respectively. | |
| categoryId | string | id of category | To return id of category for UIForumPollPortlet | |
| forumId | string | id of forum | To return id of forum for UIForumPollPortlet | |
| topicId | string | id of topic | To return id of topic for UIForumPollPortlet |
Example:
....
ActionResponse actionRes = pcontext.getResponse() ;
ForumParameter param = new ForumParameter() ;
param.setCategoryId(categoryId) ;
param.setForumId(forumId);
param.setTopicId(topicId);
param.setRenderPoll(topic.getIsPoll());
actionRes.setEvent(new QName("ForumPollEvent"), param);
This event is fired through UIForumModeratePortlet.
To receive ForumModerateEvent, you must use the ForumParameter class with two properties:
| Name | Type | Possible value | Description |
|---|---|---|---|
| isRenderModerator | boolean | true/false | If the value is set to true or false, the UIForumModeratePortlet portlet is rendered or not respectively. |
| moderator | list of strings | list of user name | To set data for UIForumModeratePortlet. |
Example:
....
List<String> moderators = Arays.asList(forum.getModerators());
ActionResponse actionRes = pcontext.getResponse() ;
ForumParameter param = new ForumParameter() ;
param.setModerators(moderators);
param.setRenderModerator(true);
actionRes.setEvent(new QName("ForumPollEvent"), param);
This event is fired through UIForumRulePortlet.
To receive ForumRuleEvent, you must use the ForumParameter class with two properties:
| Name | Type | Possible value | Description |
|---|---|---|---|
| isRenderRule | boolean | true/false | If the value is set to true or false, the UIForumRulePortlet portlet is rendered or not respectively. |
| infoRules | list of strings | list of status: can create topic, can add post and topic has lock | To set permissions for users in UIForumRulePortlet. |
Example:
....
ActionResponse actionRes = pcontext.getResponse() ;
ForumParameter param = new ForumParameter() ;
List<String> list = param.getInfoRules();
if(forum.getIsClosed() || forum.getIsLock()) {
list.set(0, "true");
}
else {
list.set(0, "false");
}
list.set(1, String.valueOf(canCreateTopic));
list.set(2, String.valueOf(isCanPost));
param.setInfoRules(list);
param.setRenderRule(true);
actionRes.setEvent(new QName("ForumRuleEvent"), param) ;
This event is fired through UIQuickReplyPortlet.
To receive QuickReplyEvent, you must use the ForumParameter class with five properties:
| Name | Type | Possible value | Description | |
|---|---|---|---|---|
| isRenderQuickReply | boolean | true/false | If the value is set to true or false, the UIQuickReplyPortlet portlet is rendered or not respectively. | |
| isModerator | boolean | true/false | To specify if the user is moderator of forum containing the topic with quick reply or not. | |
| categoryId | string | id of category | To return id of category for UIQuickReplyPortlet. | |
| forumId | string | id of forum | To return id of forum for UIQuickReplyPortlet. | |
| topicId | string | id of topic | To return id of topic for UIQuickReplyPortlet. |
Example:
....
ActionResponse actionRes = pcontext.getResponse() ;
ForumParameter param = new ForumParameter() ;
param.setRenderQuickReply(isCanPost);
param.setModerator(isMod);
param.setCategoryId(categoryId) ;
param.setForumId(forumId);
param.setTopicId(topicId);
actionRes.setEvent(new QName("QuickReplyEvent"), param) ;;
| Portlet name | AnswersPortlet |
| War name | faq.war |
| Description | The Answers portlet is the application to create answers, to reply and manage questions. |
The Answers portlet consists of preferences as follows:
| Preference name | Possible value | Default value | Description |
|---|---|---|---|
| enableViewAvatar | true, false | true | To enable users to view the avatar of owner posting the question. |
| enableAutomaticRSS | true, false | true | To enable users to get RSS automatically. |
| enableVotesAndComments | true, false | true | To enable users to give votes and comments for the question. |
| enableAnonymousSubmitQuestion | true, false | true | To enable anonymous users to submit questions. |
| display | approved, both | both | To enable administrators to view unapproved questions in the questions list in UIQuestions. |
| SendMailAddNewQuestion | string | empty | To display the content of sent email when a new question is added. |
| SendMailEditResponseQuestion | string | empty | To display the content of email when a response is edited. |
| emailMoveQuestion | string | empty | To display the content of email when a question is moved. |
| orderBy | alphabet, created | alphabet | To arrange questions in the alphabet or created date order. |
| orderType | asc, desc | asc | To display questions in the ascending or descending order. |
| isDiscussForum | true, false | false | To enable the DiscussQuestions function. |
| idNameCategoryForum | CategoryName, ForumName
| empty | To select categories and forums for the DiscussionQuestions function. |
| uploadFileSizeLimitMB | integer | 20
| To set the maximum size of uploaded file. |
| Portlet name | FAQPortlet |
| War name | faq.war |
| Description | The FAQ portlet is the application to show questions and answers. |
FAQ portlet includes some portlet preferences that you can configure to alter the behavior.
At runtime, you can use the EDIT mode portlet to set the preferences:
Alternatively, you can configure the portlet in the portet-preferences.xml file.
| Preference name | Possible value | Default value | Description |
|---|---|---|---|
| useAjax | true, false | false | To specify if the ajax load or href load is used. |
| Portlet name | PollPortlet |
| War name | poll.war |
| Description | The Polls portlet is the application for users to vote any idea, or activity. |
| Preference name | Possible value | Default value | Description |
|---|---|---|---|
| pollIdShow | string | empty | The id of poll is displayed in the Polls portlet. |
| Preference name | Description | |
|---|---|---|
| pollId | The id of poll which is displayed in the Polls gadget. |