There are some extension points in eXo Knowledge, so that you can control how these components work by implementing or extending default implementations, then reconfigure these new components in the configuration.xml file.
ForumEventLifeCycle enables you to listen to the lifecycle of a forum. By implementing ForumEventLifeCycle, you can be notified of new posts and replies, categories and topics. This installation will be injected when the data flow is called to save data. You can find the configuration file of this component at: ext/social-integration/src/main/resources/conf/portal/configuration.xml. For example, when you add a Forum to a space of the Social application and want new activities of Forum (such as, new posts and topics) to be updated to the activities of space, do as follows:
<external-component-plugins>
<target-component>org.exoplatform.forum.service.ForumService</target-component>
<component-plugin>
<name>ForumEventListener</name>
<set-method>addListenerPlugin</set-method>
<type>org.exoplatform.ks.ext.impl.ForumSpaceActivityPublisher</type>
</component-plugin>
</external-component-plugins>
Explanation: ForumSpaceActivityPublisher is the class to implement ForumEventLifeCycle.
AnswerEventLifeCycle installs event updates for the Answers data that is injected while saving answers, saving questions or posting comments. You can find the configuration file of this component at: ext/social-integration/src/main/resources/conf/portal/configuration.xml. For example, when you add an Answers to a space of the Social application and want new activities of Answers to be updated to the activities of space, do as follows:
<external-component-plugins>
<target-component>org.exoplatform.faq.service.FAQService</target-component>
<component-plugin>
<name>AnswerEventListener</name>
<set-method>addListenerPlugin</set-method>
<type>org.exoplatform.ks.ext.impl.AnswersSpaceActivityPublisher</type>
</component-plugin>
</external-component-plugins>
In which, AnswersSpaceActivityPublisher is the class to implement ForumEventLifeCycle.
BBCodeRenderer is used in the core of eXo Knowledge to render BBCodes. In which, the data input is text, containing BBCode tags. The data output will be BBCode tags which have been encrypted into HTML tags.
You can find the configuration file of this component at: extension/webapp/src/main/webapp/WEB-INF/ks-extension/ks/forum/bbcodes-configuration.xml. For example, to register BBCodeRenderer, do as follows:
<external-component-plugins>
<target-component>org.exoplatform.ks.rendering.MarkupRenderingService</target-component>
<component-plugin>
<name>BBCodeRenderer</name>
<set-method>registerRenderer</set-method>
<type>org.exoplatform.ks.rendering.spi.RendererPlugin</type>
<description>BBCode renderer</description>
<init-params>
<object-param>
<name>renderer</name>
<description>Extended BBCodeRenderer</description>
<object type="org.exoplatform.ks.bbcode.core.BBCodeRenderer">
<field name="bbCodeProvider">
<object type="org.exoplatform.ks.bbcode.core.ExtendedBBCodeProvider"/>
</field>
</object>
</object-param>
</init-params>
</component-plugin>
</external-component-plugins>
Explanation: ExtendedBBCodeProvider is the class to implement BBCodeProvider
Applications of eXo Knowledge, such as Forum, Answers and Polls, use REST services to communicate with the server. This section describes REST Services of internal API.
The Forum application of eXo Knowledge uses the ForumWebservice to provide all APIs to work with Forum, such as filtering IPs, viewing RSS, and more.
| Service name | Service URL | Description | Location |
|---|---|---|---|
| ForumWebservice | $portalName/$restcontextname/ks/forum/ | To call extended services of the Forum application. |
* Maven groupId: org.exoplatform.ks * ArtifactId: exo.ks.web.webservice |
APIs Usage
Use the following APIs to build all the functions of Forum application:
| Name | Description | Service URL endpoint | Parameters | Expected Values |
|---|---|---|---|---|
| getMessage | To get all new posts with the number based on the maxcount value. | $portalName/$restcontextname/ks/forum/getmessage/ | String maxcount | integer |
| filterIps | To ban IPs with no access to Forum. | $portalName/$restcontextname/ks/forum/filter/ | String str | String in the IP format. |
| filterIpBanForum | To ban IPs with no access to a specific Forum. | $portalName/$restcontextname/ks/forum/filterIpBanforum/
|
String forumId String str | string in the IP format, string in the Forum format |
| filterTagNameForum | To do quick search for tags that returns the list of tags. | $portalName/$restcontextname/ks/forum/filterTagNameForum/ |
String str String userAndTopicId |
Tag name id of user and topic |
| viewrss | To process the request by the user when he/she wants to view RSS. | $portalName/$restcontextname/ks/forum/rss/ | String resourceid |
category id forum id topic id |
| userrss | To process the request by the user when he/she wants to view their own collected RSS. | $portalName/$restcontextname/ks/forum/rss/user/ | String resourceid | username id |
The Answers application of eXo Knowledge uses the FAQWebservice to view RSS.
| Service name | Service URL | Description | Location |
|---|---|---|---|
| FAQWebservice | $portalName/$restcontextname/ks/faq | To call extended services of the Answers application. |
* Maven groupId: org.exoplatform.ks * ArtifactId: exo.ks.eXoApplication.faq.service |
APIs Usage
Use the following APIs to build all the functions of Answers application:
| Name | Description | Service URL endpoint | Parameters | Expected Values |
|---|---|---|---|---|
| viewrss | To view RSS | $portalName/$restcontextname/ks/faq/rss/
| String resourceid | category id, question id |
The Polls application of eXo Knowledge uses the PollWebservice to create and interact with the Polls gadget.
| Service name | Service URL | Description | Location |
|---|---|---|---|
| PollWebservice | $portalName/$restcontextname/private/ks/poll | To call extended services of the Polls application. |
* Maven groupId: org.exoplatform.ks * ArtifactId: exo.ks.eXoApplication.poll.service |
APIs Usage
Use the following APIs to build all the functions of Answers application:
| Name | Description | Service URL endpoint | Parameters | Expected Values |
|---|---|---|---|---|
| viewPoll | To return data of the Polls system | $portalName/$restcontextname/private/ks/poll/viewpoll/
| String pollId | id of poll |
| votePoll | To update data for the Polls with the returned id | $portalName/$restcontextname/private/ks/poll/votepoll/
|
String pollId String indexVote |
id of poll integer |