Edit Properties Usage
Following are examples on how to use EditProperties to configure connectors.
Integration Connections
When loading Integration Connections for a job in Simflofy, the names of the connectors' tabs are requested, based on whether the connector is in read or write mode.
@Override
public final List<String> getSpecTabNames(boolean isRepo) throws Exception {
List<String> tabsArray = new ArrayList<>();
if (isRepo) {
tabsArray.add(getGenMessage("queryTab")); //getGenMessage is an Internationalization Feature.
}
return tabsArray;
}
Each tab name will be passed to the connector, along with the current specification. Here is a truncated version from FileNet.
@Override
public final EditPropertyCollection getSpecificationProperties(JobSpecification docSpec, String tabName) {
EditPropertyFactory epf = new EditPropertyFactory(docSpec, getMessageSource()); //Add the specification and message source
if (tabName.equals(getMessage(FILENET_REPO_TAB))) {
epf.addTextEP(PARAM_FILENET_QUERY, getMessage(FILENET_QUERY_LABEL));
epf.addCheckEP(PARAM_FILENET_P_FOLDERS, getMessage(FILENET_P_FOLDERS_LABEL), getMessage(FILENET_P_FOLDERS_DESCRIPTION));
epf.addTextEP(PARAM_NAME_PROP, getMessage(NAME_PROP_LABEL), "DocumentTitle", getMessage(NAME_PROP_DESCRIPTION));
}else{
return new EditPropertyCollection();
}
return epf.getAsEditPropertyCollection();
}
Authentications Connections
For connectors without tabs
public List<EditProperty> getCustomProperties() {
EditPropertyFactory epf = new EditPropertyFactory(getProps(), getMessageSource())
epf.addBasicAuthFieldsHost(true);
epf.addTextEP(PARAM_REPO, getMessage("repoName"));
return epf.getEpList();
}
For connectors with tabs - isTabs()
returns true
@Override
public List<EditPropertyTab> getTabs() {
List<EditPropertyTab> tabs = new ArrayList<>();
EditPropertyFactory epf = new EditPropertyFactory(getProps(), getMessageSource());
epf.addIntEP(BOX_CONNECT_TIMEOUT, getMessage("connTimeout"), 1000);
epf.addIntEP(BOX_READ_TIMEOUT, getMessage("readTimeout"), 6000);
tabs.add(epf.getAsEditPropertyTab("connTab", getGenMessage("connTab"), true));
return tabs;
}
Discovery Connectors
@Override
public List<EditProperty> getProperties(Map<String, String> spec) {
EditPropertyFactory epf = new EditPropertyFactory(spec,getMessageSource());
epf.addTextEP(FOLDER_CRAWL_ID, getMessage("boxConnector.discFolder"));
return epf.getEpList();
}
Content Service/Search Connections
These connections return empty collections then populates the values separately, so the specification can be empty.
@Override
public final EditPropertyCollection getFormProperties() {
EditPropertyFactory epf = new EditPropertyFactory();//No specification or message source needed.
epf.addTextEP(PARAM_SITE_NAME, getMessage("siteName"),"");
epf.addTextEP(PARAM_LIST_NAME, getGenMessage("listName"),"");
return epf.getAsEditPropertyCollection();
}