Home
Home
German Version
Support
Impressum
20.5 Release ►

    Main Navigation

    • Preparation
      • Connectors
      • Initial Startup for G6 appliances (before January 2018)
      • Initial Startup for G7 appliances
      • Setup InSpire G7 primary and Standby Appliances
    • Datasources
      • Configuration - Atlassian Confluence Connector
      • Configuration - Best Bets Connector
      • Configuration - Data Integration Connector
      • Configuration - Documentum Connector
      • Configuration - Dropbox Connector
      • Configuration - Egnyte Connector
      • Configuration - GitHub Connector
      • Configuration - Google Drive Connector
      • Configuration - GSA Adapter Service
      • Configuration - HL7 Connector
      • Configuration - IBM Connections Connector
      • Configuration - IBM Lotus Connector
      • Configuration - Jira Connector
      • Configuration - JiveSoftware Jive Connector
      • Configuration - JVM Launcher Service
      • Configuration - LDAP Connector
      • Configuration - Microsoft Dynamics CRM Connector
      • Configuration - Microsoft Exchange Connector
      • Configuration - Microsoft File Connector (Legacy)
      • Configuration - Microsoft File Connector
      • Configuration - Microsoft SharePoint Connector
      • Configuration - Salesforce Connector
      • Configuration - SAP KMC Connector
      • Configuration - SemanticWeb Connector
      • Configuration - ServiceNow Connector
      • Configuration - SharePoint Online Connector
      • Configuration - Web Connector
      • Configuration - Yammer Connector
      • Data Integration Guide with SQL Database by Example
      • Indexing user-specific properties (Documentum)
      • Installation & Configuration - Atlassian Confluence Sitemap Generator Add-On
      • Installation & Configuration - Caching Principal Resolution Service
      • Installation & Configuration - Jive Sitemap Generator
      • Mindbreeze InSpire Insight Apps in Microsoft SharePoint Online
      • Mindbreeze InSpire Search Apps in Microsoft SharePoint 2010
      • Mindbreeze InSpire Search Apps in Microsoft SharePoint 2013
      • Mindbreeze Web Parts for Microsoft SharePoint
      • User Defined Properties (SharePoint 2013 Connector)
    • Configuration
      • CAS_Authentication
      • Cognito JWT Authentification
      • Configuration - Alternative Search Suggestions and Automatic Search Expansion
      • Configuration - Back-End Credentials
      • Configuration - Chinese Tokenization Plugin (Jieba)
      • Configuration - CJK Tokenizer Plugin
      • Configuration - Collected Results
      • Configuration - CSV Metadata Mapping Item Transformation Service
      • Configuration - Entity Recognition
      • Configuration - Exporting Results
      • Configuration - GSA Late Binding Authentication
      • Configuration - Index-Servlets
      • Configuration - Item Property Generator
      • Configuration - Japanese Language Tokenizer
      • Configuration - Kerberos Authentication
      • Configuration - Management Center Menu
      • Configuration - Metadata Enrichment
      • Configuration - Metadata Reference Builder Plugin
      • Configuration - Notifications
      • Configuration - Personalized Relevance
      • Configuration - Plugin Installation
      • Configuration - Principal Validation Plugin
      • Configuration - Profile
      • Configuration - Reporting Query Logs
      • Configuration - Reporting Query Performance Tests
      • Configuration - Request Header Session Authentication
      • Configuration - Vocabularies for Synonyms and Suggest
      • Configuration of Thumbnail Images
      • Cookie-Authentication
      • Documentation - Mindbreeze InSpire
      • Google Search Appliance Migration to Mindbreeze InSpire
      • I18n Item Transformation
      • Installation & Configuration - Outlook Add-In
      • Installation - GSA Base Configuration Package
      • Language detection - LanguageDetector Plugin
      • Mindbreeze Personalization
      • Mindbreeze Prediction Service Text Classification
      • Mindbreeze Property Expression Language
      • Mindbreeze Query Expression Transformation
      • Non-Inverted Metadata Item Transformer
      • SAML-based Authentication
      • Trusted Peer Authentication for Mindbreeze InSpire
      • Using the InSpire Snapshot for Development in a CI_CD Scenario
    • Operations
      • app.telemetry Statistics Regarding Search Queries
      • Configuration Usage Analysis
      • Deletion of Hard Disks
      • Handbook - Backup & Restore
      • Handbook - Command Line Tools
      • Handbook - Distributed Operation (G7)
      • Handbook - Filemanager
      • Handbook - Synchronized Operation (G6)
      • Index Operating Concepts
      • Indexing and Search Logs
      • Inspire Diagnostics and Resource Monitoring
      • InSpire Support Documentation
      • Mindbreeze InSpire SFX Update
      • Provision of app.telemetry Information on G7 Appliances via SNMPv3
      • Restoring to As-Delivered Condition
    • User Manual
      • Cheat Sheet
      • iOS App
      • Keyboard Operation
    • SDK
      • api.v2.alertstrigger Interface Description
      • api.v2.export Interface Description
      • api.v2.personalization Interface Description
      • api.v2.search Interface Description
      • api.v2.suggest Interface Description
      • api.v3.admin.SnapshotService Interface Description
      • Debugging (Eclipse)
      • Developing an API V2 search request response transformer
      • Developing Item Transformation and Post Filter Plugins with the Mindbreeze SDK
      • Development of Insight Apps
      • Java API Interface Description
    • Release Notes
      • Release Notes 20.1 Release - Mindbreeze InSpire
      • Release Notes 20.2 Release - Mindbreeze InSpire
      • Release Notes 20.3 Release - Mindbreeze InSpire
      • Release Notes 20.4 Release - Mindbreeze InSpire
      • Release Notes 20.5 Release - Mindbreeze InSpire
      • Release Notes 2018 Spring - Mindbreeze InSpire
      • Release Notes 2018 Winter - Mindbreeze InSpire
      • Release Notes 2019 Fall - Mindbreeze InSpire
      • Release Notes 2019 Winter - Mindbreeze InSpire
    • Security
      • Known Vulnerablities
    • Product Information
      • Product Information - Mindbreeze InSpire - Standby
      • Product Information - Mindbreeze InSpire
    Home

    Path

    Mindbreeze InSpire SDK Plugins

    Mindbreeze Item Transformation and Post Filter Plugins

    Copyright ©

    Mindbreeze GmbH, A-4020 Linz, .

    All rights reserved. All hardware and software names used are registered trade names and/or registered trademarks of the respective manufacturers.

    These documents are highly confidential. No rights to our software or our professional services, or results of our professional services, or other protected rights can be based on the handing over and presentation of these documents.

    Distribution, publication or duplication is not permitted.

    The term ‘user‘ is used in a gender-neutral sense throughout the document.


    PreparationPermanent link for this heading

    For building and deploying the examples from this document, the following third party Software is needed:

    Java SE Development Kit: Version 1.8 or newer

    Eclipse IDE for Java Developers

    Installation of the Mindbreeze Software Development Toolkit:Permanent link for this heading

    If you are using Microsoft Windows: install the Mindbreeze SDK by executing MesSDKSetup.exe

    Linux or OSX: 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.

    Generating a Mindbreeze Plugin ProjectPermanent link for this heading

    The Mindbreeze Software Development Toolkit contains a tool for generating Mindbreeze Plugin Projects called mesjavaplugin.bat in case of Microsoft Windows installations and mesjavaplugin.sh for Unix-based systems. The tool can be used for generating the following Mindbreeze extension types:

    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

    Called without parameter the mesjavaplugin tool displays its usage with examples:

    The <name> parameter 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 <base package> parameter is the java package where the source files will be generated.

    Example1: A Post Filter Transformation PluginPermanent link for this heading

    Please follow these steps to generate and deploy a post filter transformation plugin for editing or adding custom metadata:

    Create the plugin project:

    mesjavaplugin.sh postfilter MetadataProcessor com.mycompany

    Navigate to the metadataprocessor folder in your current path.

    Import the newly created project into your Eclipse IDE:

    After successfully importing the Project you will find a stub implementation of the plugin in the MetadataProcessorPostFilter.java file:

    Note that the name of the Java file is <name>PostFilter.java where <name> is the plugin name parameter from the previous step.

    Extend the source code to fit for your needs. For example an implementation that would add a metadata to the document named “meta” with a string value of : “value” would be the following:

    private void processRequest(FilterAndIndexRequest.Builder request) {

        // Clone the request

        Metadata.Builder metadataBuilder = request.getContentBuilder().getMetadataBuilder();

        

        NamedValue.Builder namedValueBuilder = NamedValue.newBuilder();

        namedValueBuilder.setName("meta");

        namedValueBuilder.addValue(ValueHelper.newBuilder("value"));

        metadataBuilder.addMetadatum(namedValueBuilder)

    }

    Build the plugin archive by executing the script build.bat on Windows Systems or build.sh on Unix in the project directory. If the process is successful, an archive with the name <name>-postfilter.zip should be produced. <name> is here again the plugin name parameter specified.

    The plugin is ready to be installed with the Mindbreeze Configuration Interface:

    After successful installation the plugin can be activated for any Filter service:

    Example2: An Item Transformation PluginPermanent link for this heading

    Please follow these steps to generate an item transformer plugin for editing or adding custom metadata:

    Create the plugin project:

    mesjavaplugin.sh itemtransformer MetadataProcessor com.mycompany

    Navigate to the metadataprocessor folder in your current path.

    Import the newly created project into your Eclipse IDE (As in the previous example).

    After successfully importing the Project you will find a stub implementation of the plugin in the MetadataProcessorItemTransformerService.java file:

    Extend the code according to your needs. An example that again adds a metadata named “meta” with the value “value” is the following:

        private void processItem(Item.Builder itemBuilder) {

        itemBuilder.addProperty(

        NamedValue.newBuilder()

        .setName("meta")

        .addValue(ValueHelper.newBuilder("value"))

        );

    }

    Build the plugin archive by executing the script build.bat on Windows Systems or build.sh on Unix in the project directory. If the process is successful, an archive with the name <name>-postfilter.zip should be produced. <name> is here again the plugin name parameter specified.

    The plugin is ready to be installed with the Mindbreeze Configuration Interface:

    After a successful installation the Plugin is available for all Index Services.

    Plugin ConfigurationPermanent link for this heading

    As you could see in both examples, it is possible to define properties for the installed Plugins from the configuration interface by adding custom plugin properties.

    These configuration properties are accessible in the plugin source code from the properties map:

    Map<String, List<String>> properties = null;

    The init method that is retrieving the configuration properties is called automatically if the plugin implements the com.mindbreeze.enterprisesearch.mesapi.Initializable interface.

    The previous example of an itemtransformer plugin now setting a metadata value to a configuration parameter named “meta” looks like:

        private void processItem(Item.Builder itemBuilder) {

        if (properties != null && properties.containsKey("meta")) {

        List<String> values = properties.get("meta");

        if (values != null && !values.isEmpty()) {

        String value = values.get(0);

        if (value != null) {

        itemBuilder.addProperty(

                NamedValue.newBuilder()

                .setName("meta")

                .addValue(ValueHelper.newBuilder(value))

                );

        }

        }

        }

        }

    Plugin Descriptor Configuration SectionPermanent link for this heading

    The plugins.xml Plugin Descriptor describes the Plugins available in the archive. The main outline is as follows:

    version

    plugins

    Plugin

    id

    kind

    extension

    code

    if kind is CODE

    properties  

    for predefined properties that are passed to the Plugin

    config_options

    • The element config_options itself is a language for describing configuration user interface elements and therefore allows the plugin developer to extend the Mindbreeze InSpire configuration interface. As an example, the following configuration extends the configuration user interface with the “meta” property.  As of this writing the configuration interface supports English translations only. Supported input types are TEXT, NUMBER, BOOLEAN, TEXTAREA, SELECT, PASSWORD, CREDENTIAL. Default values can be added via default_string or default_numeric. Select options can be defined using the select_option element.

          <config_option>

            <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>

            </Group>

          </config_option>

          

    Download PDF

    • Developing Item Transformation and Post Filter Plugins with the Mindbreeze SDK

    Content

    • Preparation
    • Installation of the Mindbreeze Software Development Toolkit:
    • Generating a Mindbreeze Plugin Project
    • Example1: A Post Filter Transformation Plugin
    • Example2: An Item Transformation Plugin
    • Plugin Configuration

    Download PDF

    • Developing Item Transformation and Post Filter Plugins with the Mindbreeze SDK