com.filenet.api.engine
Interface SearchFunctionHandler
-
public interface SearchFunctionHandler
An interface to be implemented as a custom search function handler that runs on the server. A custom search function handler is referenced by aCmSearchFunctionDefinition
object that defines a particular custom search function. Custom search functions are used in the SELECT list of Content Engine SQL queries.
-
-
Method Summary
Methods Modifier and Type Method and Description 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.java.lang.String
getFunctionName()
Returns the case-insensitive name of the custom function as it must be entered in a Content Engine SQL query.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.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.
-
-
-
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:
True
if 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 byClass
objects that represent property value data types. The return data type cannot be either of the object collection types (IndependentObjectSet.class
orDependentObjectList.class
).- Returns:
True
if 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 theClass
objects that are passed to thevalidate()
method. Likewise, the object that is returned must correspond to theClass
object 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.
-
-