com.filenet.api.engine
Interface SearchFunctionHandler
-
public interface SearchFunctionHandlerAn interface to be implemented as a custom search function handler that runs on the server. A custom search function handler is referenced by aCmSearchFunctionDefinitionobject that defines a particular custom search function. Custom search functions are used in the SELECT list of Content Engine SQL queries.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method and Description java.lang.Objectevaluate(CmSearchFunctionDefinition definition, java.lang.Object[] parameters)This method is called once for each search result row, after security filtering but before processing, to evaluate the custom function for that result row.java.lang.StringgetFunctionName()Returns the case-insensitive name of the custom function as it must be entered in a Content Engine SQL query.booleanrequiresTransaction()This method is called once during a search to determine if the custom function will need to be executed in a distributed transaction by the server.java.lang.Classvalidate(CmSearchFunctionDefinition definition, java.lang.Class[] parameterTypes)This method is called once during a search to determine if the custom function is being used correctly by verifying that the custom function is called with the correct number of parameters and the correct types for the parameters.
-
-
-
Method Detail
-
getFunctionName
java.lang.String getFunctionName()
Returns the case-insensitive name of the custom function as it must be entered in a Content Engine SQL query. The custom function name is of the form <namespace>::<name> where both <namespace> and <name> must have a nonzero length, adhere to the Content Engine symbolic name conventions, and be unique relative to other custom function names within an object store. This name is set when the custom function is created. Custom function names are structured to facilitate collision avoidance and to allow them to be recognized by the query parser.- Returns:
- The name of the custom function.
-
requiresTransaction
boolean requiresTransaction()
This method is called once during a search to determine if the custom function will need to be executed in a distributed transaction by the server.- Returns:
Trueif any work will be performed that needs to be executed atomically; otherwise, the method returnsfalse.
-
validate
java.lang.Class validate(CmSearchFunctionDefinition definition, java.lang.Class[] parameterTypes)
This method is called once during a search to determine if the custom function is being used correctly by verifying that the custom function is called with the correct number of parameters and the correct types for the parameters. It also identifies the return value type of the custom function. The types of the inputs and return values are specified byClassobjects that represent property value data types. The return data type cannot be either of the object collection types (IndependentObjectSet.classorDependentObjectList.class).- Returns:
Trueif the custom function is being used correctly; otherwise, returnsfalse.- Throws:
EngineRuntimeException- An exception is thrown if the number of parameters is incorrect or any parameter is of an incorrect data type. The exception that is thrown is returned to the caller of thefetchRows()method.
-
evaluate
java.lang.Object evaluate(CmSearchFunctionDefinition definition, java.lang.Object[] parameters)
This method is called once for each search result row, after security filtering but before processing, to evaluate the custom function for that result row. The objects passed in the parameters array must either be null or be of types that correspond to theClassobjects that are passed to thevalidate()method. Likewise, the object that is returned must correspond to theClassobject that is returned by thevalidate()method.- Returns:
- The object that is returned by the custom function after it processes its input parameters.
- Throws:
EngineRuntimeException- A runtime exception is thrown if an error condition is detected.
-
-