2021-09-02 13:52:17 +00:00
|
|
|
|
|
|
|
|
@ChangeSet(order = "1000", id = "add-{{pascalCase name}}-plugin", author = "")
|
|
|
|
|
public void add{{pascalCase name}}Plugin(MongockTemplate mongoTemplate) {
|
|
|
|
|
Plugin plugin = new Plugin();
|
|
|
|
|
plugin.setName("{{pascalCase name}}");
|
|
|
|
|
plugin.setType(PluginType.DB);
|
|
|
|
|
plugin.setPackageName("{{dashCase name}}");
|
|
|
|
|
plugin.setUiComponent("DbEditorForm");
|
|
|
|
|
plugin.setDatasourceComponent("AutoForm");
|
|
|
|
|
plugin.setResponseType(Plugin.ResponseType.TABLE);
|
2022-01-25 20:49:43 +00:00
|
|
|
plugin.setIconLocation("https://assets.appsmith.com/{{pascalCase name}}.png");
|
2021-09-02 13:52:17 +00:00
|
|
|
plugin.setDocumentationLink("https://docs.appsmith.com/datasource-reference/querying-{{dashCase name}}");
|
|
|
|
|
plugin.setDefaultInstall(false);
|
|
|
|
|
try {
|
|
|
|
|
mongoTemplate.insert(plugin);
|
|
|
|
|
} catch (DuplicateKeyException e) {
|
|
|
|
|
log.warn(plugin.getPackageName() + " already present in database.");
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-01-25 20:49:43 +00:00
|
|
|
}
|