In the Exalead CloudView configuration, you use your custom component by:
The In the Exalead CloudView configuration, the configuration of the custom component is given as a hierarchical listing of string key-values. It is then transformed into a structured object, which must implement
the For example, to create a custom analysis processor that connects to an auxiliary data source needing a login and password, define the component as follows: package com.mycompany.myprocessor;
import com.exalead.mercury.component.config.CVComponentConfig;
public class MyProcessorConfig implements CVComponentConfig {
private String login;
private String password;
public String getLogin() { return login; }
public void setLogin(String login) { this.login = login; }
public String getPassword() { return password; }
public void setPassword(String password) { this.password = password; }}
package com.mycompany.myprocessor;
import com.mycompany.myprocessor.MyProcessorConfig;
import com.exalead.pdoc.analysis.CustomDocumentProcessor;
import com.exalead.mercury.component.config.CVComponentConfigClass;
@CVComponentConfigClass(configClass=MyProcessorConfig.class)
public class MyProcessor extends CustomDocumentProcessor {
public MyProcessor(MyProcessorConfig config) {
super(config);
this.config = config;
}
@Override
public void process(DocumentProcessingContext context,ProcessableDocument document) throws Exception {
// Connect to the data source
connect(config.login, config.password);
// Work ...
}
}
And in the configuration: <CustomDocumentProcessor classId="com.exalead.myprocessor.MyProcessor"> <KeyValue xmlns="exa:exa.bee" key="Login" value="mylogin" /> <KeyValue xmlns="exa:exa.bee" key="Password" value="myverysecretpassword" /> </CustomDocumentProcessor>
Exalead CloudView automatically
transforms the KeyValue in the object specified on The basic rules are:
| ||||||||||