To build and deploy the examples described in this document, the following third-party software is needed:
Extract the mes-devel-<version>.zip to a folder of your choice and add the SDK/bin folder from the archive to your path variable.
The Mindbreeze Software Development Toolkit contains a tool for generating Mindbreeze Plugin Projects:
The tool can be used for generating the following Mindbreeze extension types:
Description | |
datasource | Crawler, context and authorization plugin for a given data source. |
filter | Filter plugin for a given data type. |
postfilter | Post filter transformation plugin. |
itemtransformer | Item transformation plugin |
Itemtransformer-launchedservice | Item transformation launchedservice plugin |
The mesjavaplugin tool displays its usage with examples when its called without parameter:
Usage: mesjavaplugin.sh <plugin-type> <name> <base package>
Available plugin-types:
datasource: crawler, contextualization and authorization
filter: a ContentFilterPlugin. filter has an additional parameter containing the extensions the filter will be used for.
postfilter: a post filter transformation plugin.
itemtransformer: an item transformation service plugin.
itemtransformer-launchedservice: an item transformation launched service plugin.
searchtransformer: an API V2 search request response transformation plugin.
queryexpressiontransformer: a query transformation plugin.
Example:
mesjavaplugin.sh datasource WordPress com.mycompany
mesjavaplugin.sh filter Text com.mycompany "txt;csv"
mesjavaplugin.sh postfilter CustomMetadata com.mycompany
mesjavaplugin.sh itemtransformer CustomMetadata com.mycompany
mesjavaplugin.sh itemtransformer-launchedservice CustomMetadata com.mycompany
mesjavaplugin.sh searchtransformer CustomSearchInterface com.mycompany
mesjavaplugin.sh queryexpressiontransformer CustomName com.mycompany
The parameter <name> is the name of the plugin. The project will be generated in a folder with the name of this parameter lowercased in the current path.
The parameter <base package> is the java package where the source files will be generated.
Please follow the described steps to generate an item transformer launched service plugin for editing or adding custom metadata:
private void processItem(Item.Builder itemBuilder) {
itemBuilder.addProperty(
NamedValue.newBuilder()
.setName("meta")
.addValue(ValueHelper.newBuilder(metaPropertyValue))
);
}
String metaPropertyValue = configuration.getProperty("meta", null);
Once the plugin is uploaded, proceed to the tab “Indices” in the section “Services” to continue configuration. Click “Add Service” and select MetadataProcessor from the list of ItemTransformationServicePlugins.
After the service was added, configure the following settings in the section “Service Settings”:
The service will be available in the section “Item Transformation Services” of the Index Services.
The Plugin Descriptor plugins.xml describes the plugins available in the archive. The main outline is as follows:
plugins
Plugin
id
kind
extension
code
for predefined properties that are passed to the Plugin
<Group>
<label>
<LangString>
<lang>en</lang>
<value>Base Configuration</value>
</LangString>
</label>
<level>DEFAULT_LEVEL</level>
<option>
<Option>
<name>meta</name>
<input>TEXT</input>
<hint>The value that is added as the meta property.</hint>
<label>
<LangString>
<lang>en</lang>
<value>Meta Property Value</value>
</LangString>
</label>
<option />
</Option>
<Option>
<level>DEFAULT_LEVEL</level>
<name>BindPort</name>
<input>NUMERIC</input>
<hint/>
<label>
<LangString>
<lang>en</lang>
<value>Webservice Port</value>
</LangString>
</label>
<option/>
<default_numeric>23920</default_numeric>
</Option>
</option>
</Group>
</config_option>