SDK documentation

This page aims to present a documentation of the SDK possibilities of Xtended Search. Xtended Search includes a number of possible extensions, entry points that allow you to modify the standard functionality or to add your own functions.

On indexing

Indexing connector

At the indexing level, it is possible to override an existing indexing connector or to develop your own connector. In both cases, you must follow the methods imposed by the IIndexExtension2 interface.

Declaration: the connector is declared on the index, in the “extension” attribute.

Self-definition extensions

In theory

Self-defining extensions are positioned in XML under the index. They allow you to avoid manually defining the custom tags to be indexed: thanks to the parameters of the index and to possible additional parameters, they manage to list the custom tags to be implemented by default.

Info

It is possible to pass parameters to our self-definition classes. Among these parameters there is a standard parameter " CUSTOMTAGS_EXCEPTIONS" which allows to specify custom tags not to be indexed.

<index name="IndexSQLAuto"
       label="LG_IndexSQL"
       controller="com.axemble.axvdocsearch.core.controllers.implementation.LuceneController"
       extension="com.axemble.axvdocsearch.extensions.base.implementation.BaseSQLIndexExtension"
       indexStorePath="vdocsearch\test\IndexSQLAuto"
       updateOnIndexedDocuments="true"
       locales="fr">

    <parameters>
        <parameter key="SQLQUERY" value="SELECT * FROM vdoc_user"/>
        <parameter key="ID_SQL_COLUMN_NAME" value="id"/>
        <parameter key="REFERENCE_SQL_COLUMN_NAME" value="login"/>
        <parameter key="TITLE_SQL_COLUMN_NAME" value="lastname"/>
        <parameter key="DESCRIPTION_SQL_COLUMN_NAME" value="description"/>
        <parameter key="CREATIONDATE_SQL_COLUMN_NAME" value="created"/>
    </parameters>

    <autodefinitions>
        <autodefinition
                name="com.axemble.axvdocsearch.extensions.implementation.IAutoDefinitionExtension.SQLAutoDefinitionExtension">
            <parameters>
                <parameter key="CUSTOMTAGS_EXCEPTIONS" value="EmployeeNumber|Country"/>
            </parameters>
        </autodefinition>
    </autodefinitions>
</index>
<index name="IndexSQLAuto"
       label="LG_IndexSQL"
       controller="com.axemble.axvdocsearch.core.controllers.implementation.LuceneController"
       extension="com.axemble.axvdocsearch.extensions.base.implementation.BaseSQLIndexExtension"
       indexStorePath="vdocsearch\test\IndexSQLAuto"
       updateOnIndexedDocuments="true"
       locales="fr">

    <parameters>
        <parameter key="SQLQUERY" value="SELECT * FROM vdoc_user"/>
        <parameter key="ID_SQL_COLUMN_NAME" value="id"/>
        <parameter key="REFERENCE_SQL_COLUMN_NAME" value="login"/>
        <parameter key="TITLE_SQL_COLUMN_NAME" value="lastname"/>
        <parameter key="DESCRIPTION_SQL_COLUMN_NAME" value="description"/>
        <parameter key="CREATIONDATE_SQL_COLUMN_NAME" value="created"/>
    </parameters>

    <autodefinitions>
        <autodefinition
                name="com.axemble.axvdocsearch.extensions.base.implementation.autodefinition.SQLAutoDefinitionExtension">
            <parameters>
                <parameter key="CUSTOMTAGS_EXCEPTIONS" value="EmployeeNumber|Country"/>
            </parameters>
        </autodefinition>
    </autodefinitions>
</index>

Example: in the case of SQL indexing : SELECT * FROM MATABLE. The SQL auto-definition class will declare for us cutomtags for each column of the table.

Lists of available self-definition classes

All the classes are present in the package com.axemble.axvdocsearch.extensions.implementation.IAutoDefinitionExtension.

All the classes are present in the package com.axemble.axvdocsearch.extensions.base.implementation.autodefinition.

Class Description Indexed elements
DirectoryUserAutoDefinitionExtension For indexing the users of the directory - The system custom tags
- All standard attributes (normalized Process names (starting with a capital letter); example: LastName, FirstName, LastVisite, …)
- All extended attributes
DirectoryLocalizationAutoDefinitionExtension For indexing directory locations - All extended attributes
FileCenterAutoDefinitionExtension For the indexing of document spaces - System custom tags
- Document attributes
DMVersionsAutoDefinitionExtension For the indexing of documents from the Document Management GED - The system custom tags
- Documentary attributes
ResourceAutoDefinitionExtension For indexing process documents (or dynamic table in a process) or reservoir data The resource model fields
VDPJProcessResourceHistoryAutoDefinitionExtension For indexing the history of a process document All attributes of the history events (system custom tags)
SQLAutoDefinitionExtension For SQL indexing All columns of the SQL query

At the search level

Search extensions

Search extensions are the main extension to control your search. Here, you have a context of execution of your search: a connected user, … You will be able to intervene on events before and after search execution.

To create an extension, you inherit from the class :

com.axemble.axvdocsearch.extensions.base.implementation.ISearchExtension.BaseSearchExtension.

com.axemble.axvdocsearch.extensions.base.implementation.ISearchExtension.search.

Declaration : this extension is declared on the search, in the “extension” attribute.

The declaration of a search extension class is not mandatory.

Implementing IResourceSearchExtension for advanced manipulations

On your BaseSearchExtension inheriting class, you can additionally implement the * com.axemble.axvdocsearch.extensions.interfaces.IResourceSearchExtension* interface.

With this implementation, you have access to more advanced elements allowing you for example:

  • manipulate the form as an IResource (getValue, setValue, …)
  • Access to an IResourceController so that you can control the form as you would in a standard Process SDK class.

Security extensions

By default, when you perform a search on indexes, all indexed documents are requested, without rights tests.

We can therefore define (on the search, securityExtension attribute) a security extension class. It will filter the documents presented in the search results according to the user connected.

If you don’t need security, don’t place security extensions because it is obvious that search performances are necessarily decreased by security tests.

Two types of security extensions

In memory

Until version 1.5.0, this is the only possibility.

Security tests are performed in memory. Xtended Search retrieves the documents and calls the extension to know if it should display the document or not.

To create a memory security extension, one must implement the * com.axemble.axvdocsearch.extensions.interfaces.security.IMemorySecurityIndexation* interface.

In the index

We assume here that the ACL data necessary for the evaluation of rights is in the index.

We will therefore manage security upstream by applying “system filters” that cannot be removed by the user. This makes security tests much more efficient.

To create a memory security extension, we must implement the * com.axemble.axvdocsearch.extensions.interfaces.security.IIndexSecurityExtension* interface.

Security extension classes delivered by default

By default, we provide two classes of security extensions:

Class Use Description
com.axemble.axvdocsearch.extensions.implementation.ISecurityExtension.VDocSecurityExtension Usable for all Process data, except GED (Document Management) Memory indexing class
com.axemble.axvdocsearch.extensions.implementation.ISecurityExtension.VDocDocumentManagementSecurityExtension Usable for GED (Document Management) data Indexing class of indexes
Class Use Description
com.axemble.axvdocsearch.extensions.implementation.security.VDocSecurityExtension Usable for all Process data, except GED (Document Management) Memory indexing class
com.axemble.axvdocsearch.extensions.implementation.security.VDocDocumentManagementSecurityExtension Usable for GED (Document Management) data Indexing class of indexes

Formula extensions

LFormulas allow you to set up bookmarks, variables in your XML configuration; these variables will be dynamically interpreted and evaluated when the XML is processed by Xtended search.

These bookmarks, in order to be interpreted, must be managed by a formula extension class; this class is in charge of browsing the bookmarks it is able to manage and performing the necessary evaluations.

Declaration : the formula extensions are declared under the search node.

Where can we use these bookmarks ?

  • CustomTag.defaultValue
  • Filter.value
  • Filter.format
<search ...>
    <formulaExtensions>
    <formulaExtension name="com.axemble.axvdocsearch.extensions.implementation.IFormulaExtension.UserConnectedFormulaExtension" />
    <formulaExtension name="com.axemble.axvdocsearch.extensions.implementation.IFormulaExtension.DatesFormulaExtension" />
    </formulaExtensions>
    ...
<search ...>
    <formulaExtensions>
    <formulaExtension name="com.axemble.axvdocsearch.extensions.implementation.formula.UserConnectedFormulaExtension" />
    <formulaExtension name="com.axemble.axvdocsearch.extensions.implementation.formula.DatesFormulaExtension" />
    </formulaExtensions>
    ...

Default formulas extensions

Class Description
com.axemble.axvdocsearch.extensions.implementation.IFormulaExtension.UserConnectedFormulaExtension Allows to retrieve data about the connected user.
We can retrieve the various properties of the user (IUser SDK).
Formula extension perform Java introspection.
Examples: ${user.getLogin()}, ${user.getLastName()}, ${user.getOrganization().getName()}
com.axemble.axvdocsearch.extensions.implementation.IFormulaExtension.DatesFormulaExtension Two formulas:
- toString() evaluates the current date
- computeDate(x,y) calculates a date based on x,y and the current date (example: ${date.computeDate(-2,MONTH)} today’s date minus two months) (where x is a relative integer and y is one of the following elements: [YEAR, MONTH, DAY])
Class Description
com.axemble.axvdocsearch.extensions.implementation.formula.UserConnectedFormulaExtension Allows to retrieve data about the connected user.
We can retrieve the various properties of the user (IUser SDK).
Formula extension perform Java introspection.
Examples: ${user.getLogin()}, ${user.getLastName()}, ${user.getOrganization().getName()}
com.axemble.axvdocsearch.extensions.implementation.formula.DatesFormulaExtension Two formulas:
- toString() evaluates the current date
- computeDate(x,y) calculates a date based on x,y and the current date (example: ${date.computeDate(-2,MONTH)} today’s date minus two months) (where x is a relative integer and y is one of the following elements: [YEAR, MONTH, DAY])

Extensions at the search result level

Result group extensions

Functional reminder: resultgroups allow you to group search results according to a fixed logic.

We propose to develop your own resultgroup extensions.

Declaration: resultgroup extensions are declared in the result group XML.

<search ...>
    <resultGroups extension="com.axemble.axvdocsearch.extensions.implementation.IResultGroupsExtension.CustomTagResultGroupsExtension" >
    <parameters>
    <parameter key="customTagKey" value="Champlistesimple" />
    </parameters>
    </resultGroups>
    ...
<search ...>
    <resultGroups extension="com.axemble.axvdocsearch.extensions.implementation.resultgroups.CustomTagResultGroupsExtension" >
    <parameters>
    <parameter key="customTagKey" value="Champlistesimple" />
    </parameters>
    </resultGroups>
    ...

For an example of creating a result groups extension class see the following article.

Result groups extension classes delivered by default
Class Description
com.axemble.axvdocsearch.extensions.implementation.IResultGroupsExtension.IndexesResultGroupsExtension This class groups search results according to their source index.
com.axemble.axvdocsearch.extensions.implementation.IResultGroupsExtension.CustomTagResultGroupsExtension This class groups the search results according to the possible values of a customtag.
We must therefore specify the customtag concerned as a configuration parameter (see XML example above).
Class Description
com.axemble.axvdocsearch.extensions.implementation.resultgroups.IndexesResultGroupsExtension This class groups search results according to their source index.
com.axemble.axvdocsearch.extensions.implementation.resultgroups.CustomTagResultGroupsExtension This class groups the search results according to the possible values of a customtag.
We must therefore specify the customtag concerned as a configuration parameter (see XML example above).

Action extensions

Action extensions allow you to manage actions on search results.

You have just executed your search and you wish to exploit one or more result documents to perform a specific treatment.

Example:

  • Put documents in a “basket”.
  • Export documents
  • Modify documents in bulk

Declaration : actions are declared under the “view” node.

When you click on your action you will be called on a method * *com.axemble.axvdocsearch.extensions.base.implementation.ISearchExtension/search.BaseSearchExtension.afterSelectDocuments( String, Collection)**.

You will be passed as parameters the name of the relevant action and the collection of selected documents.

...
<view linksTarget="_blank" toolTips="REFERENCE" >
    <actions>
        <action name="action1" label="LG_ACTION1"/>
        <action name="action2" label="LG_ACTION2"/>
    </actions>
    <column name="Email" label="LG_Email" type="text" />
    ...

Navigation extensions allow you to use a results column to navigate to another screen.

We therefore reproduce the principle of a hypertext link but it may not be the standard link but a specific link.

Examples:

  • Example 1:
    • I have indexed tables in my ERP.
    • I can create a navigation extension that will allow me to navigate from a search result, in the “Customer” column, to the WEB interface of my ERP, directly to the description of this customer (by passing the customer ID as a parameter)
  • Example 2 :
    • I have two Xtended Search indexes: Customers and Orders.
    • I have a search interface that shows me the customers.
    • From a customer, search result, I navigate to another search on my orders, pre-filtered on the customer from which I have navigated.

To create a navigation extension, we need to use the class * com.axemble.axvdocsearch.extensions.base.implementation.BaseNavigationExtension*.

Declaration: a navigation extension is declared under a “column”.

Navigation extensions can accept parameters that are specified in the XML and retrievable in Java in the SDK class.

<view linksTarget="_blank">
    <column name="TITLE" label="LG_TITLE" type="text">
        <navigation
                name="com.axemble.axvdocsearch.extensions.implementation.INavigationExtension.PopUpNavigationExtension">
            <parameters>
                <parameter key="targetSearchName" value="NavigationSearch"/>
                <parameter key="targetFilterGroupName" value="otherFilterGroups"/>
                <parameter key="targetFilters" value="test_nombre"/>
                <parameter key="targetFilter.test_nombre.localCustomTagName" value="test_nombre"/>
                <parameter key="targetURL" value=""/>
            </parameters>
        </navigation>
    </column>
</view>
<view linksTarget="_blank">
    <column name="TITLE" label="LG_TITLE" type="text">
        <navigation name="com.axemble.axvdocsearch.extensions.implementation.navigation.PopUpNavigationExtension">
            <parameters>
                <parameter key="targetSearchName" value="NavigationSearch"/>
                <parameter key="targetFilterGroupName" value="otherFilterGroups"/>
                <parameter key="targetFilters" value="test_nombre"/>
                <parameter key="targetFilter.test_nombre.localCustomTagName" value="test_nombre"/>
                <parameter key="targetURL" value=""/>
            </parameters>
        </navigation>
    </column>
</view>
The navigation extension classes delivered by default
Class Description
com.axemble.axvdocsearch.extensions.implementation.INavigationExtension.PopUpNavigationExtension Allows you to set up a link that opens a new search in a popup window. This new search can be filtered according to the result line from which you have navigated.
Class Description
com.axemble.axvdocsearch.extensions.implementation.navigation.PopUpNavigationExtension Allows you to set up a link that opens a new search in a popup window. This new search can be filtered according to the result line from which you have navigated.

Parameters required for this class :

Parameter Name Description Mandatory
targetSearchName To which target search do we want to navigate? Yes
targetFilterGroupName Which filtergroup in the target search do we want to navigate to? No
targetFilters Which target filters do we want to value at the time of navigation (automatic filtering) No
targetFilter.[FILTERNAME].localCustomTagName For each filter declared in the “targetFilters” parameter, we declare the name of the local custom tag from which we are going to value the remote filtergroup. No
targetURL This field is optional.
By default, the system will open the “sub-search” in a new screen, full page.
You can however redirect the navigation to your own URL (Example: a Process Easy Site page)
No

Source : https://wiki.myvdoc.net/xwiki/bin/view/Dev+Floor/XtendedSearchDocumentationSDK