JBoss.orgCommunity Documentation
The Initialization plug-in component is to define the default answers data in the .xml or .zip file. It includes categories of question that should be exported from the Answers application.
When the Answers Service starts, it will get values returned from the Initialization plug-in component to initialize the default Answers data.
Default Answers data
The default Answers data is configured in the services-configuration.xml file.
In details, at runtime of Answers Service, the Initialization plug-in component is called, the services-configuration.xml file will be executed. The component-plugin named addInitialDataPlugin will refer to org.exoplatform.faq.service.InitializeDataPlugin to execute some objects to create default data.
The default data in the .zip file is initialized as follows:
<component-plugin>
<name>technical-faq</name>
<set-method>addInitialDataPlugin</set-method>
<type>org.exoplatform.faq.service.InitialDataPlugin</type>
<description>Initialize</description>
<init-params>
<value-param>
<name>location</name>
<description>location where Answers export format file is stored</description>
<value>war:/data/Technical-FAQ.zip</value>
</value-param>
</init-params>
</component-plugin>
In which,
Name | Set-Method | Type | Description |
---|---|---|---|
technical-faq | addInitialDataPlugin | org.exoplatform.faq.service. InitialDataPlugin | Initialize the data plugin. |
Init-param
Name | Possible value | Default value | Description |
---|---|---|---|
location | string | war:/data/ Technical-FAQ.zip | The location where the Answers export format file is stored. |
If the default data is in the XML format:
<value>war:/data/Technical-FAQ.xml</value>
By default, the default Answers data can only import if the importing categories do not exist in database.
To initialize default data in multiple files, it is required to declare them in multiple plugins.
<component-plugin>
....
</component-plugin>