use of org.structr.module.api.APIBuilder in project structr by structr.
the class CSVFileImportJob method runInitialChecks.
@Override
public boolean runInitialChecks() throws FrameworkException {
final String targetType = getOrDefault(configuration.get("targetType"), null);
final String delimiter = getOrDefault(configuration.get("delimiter"), ";");
final String quoteChar = getOrDefault(configuration.get("quoteChar"), "\"");
if (targetType == null || delimiter == null || quoteChar == null) {
throw new FrameworkException(400, "Cannot import CSV, please specify target type, delimiter and quote character.");
} else {
final StructrModule module = StructrApp.getConfiguration().getModules().get("api-builder");
if (module == null || !(module instanceof APIBuilder)) {
throw new FrameworkException(400, "Cannot import CSV, API builder module is not available.");
}
}
return true;
}
Aggregations