diff --git a/app/server/.gitignore b/app/server/.gitignore index 1b9209adf8..37ae9e3606 100644 --- a/app/server/.gitignore +++ b/app/server/.gitignore @@ -1,3 +1,6 @@ dist/** target/** .idea/** +**/.idea +**/target +**/dist diff --git a/app/server/README.md b/app/server/README.md index 047d49c22f..ad38a43b09 100644 --- a/app/server/README.md +++ b/app/server/README.md @@ -1,3 +1,24 @@ -# internal-tools-server +# Appsmith Server -This is the server-side repo for the internal tools framework \ No newline at end of file +This is the server-side repo for the Appsmith framework. + +### How to build +```bash +$ ./build.sh +``` + +For example: +```$bash +$ ./build.sh -DskipTests +``` + +This will +1. Compile the code +2. Generate the jars for server & plugins +3. Copy them into the `dist` directory + +### How to run +``` +$ cd ./dist +$ java -jar -Dspring.profiles.active=$env server-1.0-SNAPSHOT.jar +``` diff --git a/app/server/appsmith-interfaces/pom.xml b/app/server/appsmith-interfaces/pom.xml new file mode 100644 index 0000000000..35e9d8d487 --- /dev/null +++ b/app/server/appsmith-interfaces/pom.xml @@ -0,0 +1,97 @@ + + + + + com.appsmith + integrated + 1.0-SNAPSHOT + + + 4.0.0 + com.appsmith + interfaces + ${project.version} + + interfaces + + + UTF-8 + 11 + + + + + junit + junit + 4.11 + test + + + + org.pf4j + pf4j + 3.1.0 + + + + io.projectreactor + reactor-core + 3.2.6.RELEASE + + + + org.projectlombok + lombok + 1.18.8 + provided + + + + + + + + + + maven-clean-plugin + 3.1.0 + + + + maven-resources-plugin + 3.0.2 + + + maven-compiler-plugin + 3.8.1 + + + maven-surefire-plugin + 2.22.1 + + + maven-jar-plugin + 3.1.2 + + + maven-install-plugin + 2.5.2 + + + maven-deploy-plugin + 2.8.2 + + + + maven-site-plugin + 3.7.1 + + + maven-project-info-reports-plugin + 3.0.0 + + + + + diff --git a/app/server/appsmith-interfaces/src/main/java/com/appsmith/external/models/CommandParams.java b/app/server/appsmith-interfaces/src/main/java/com/appsmith/external/models/CommandParams.java new file mode 100644 index 0000000000..0cd5b8ecb6 --- /dev/null +++ b/app/server/appsmith-interfaces/src/main/java/com/appsmith/external/models/CommandParams.java @@ -0,0 +1,15 @@ +package com.appsmith.external.models; + +import lombok.Getter; +import lombok.Setter; + +import java.util.List; + +@Getter +@Setter +public class CommandParams { + List queryParams; + + List headerParams; +} + diff --git a/app/server/appsmith-interfaces/src/main/java/com/appsmith/external/models/Param.java b/app/server/appsmith-interfaces/src/main/java/com/appsmith/external/models/Param.java new file mode 100644 index 0000000000..2e4d8278eb --- /dev/null +++ b/app/server/appsmith-interfaces/src/main/java/com/appsmith/external/models/Param.java @@ -0,0 +1,13 @@ +package com.appsmith.external.models; + +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +public class Param { + + String key; + + String value; +} diff --git a/app/server/appsmith-interfaces/src/main/java/com/appsmith/external/plugins/BasePlugin.java b/app/server/appsmith-interfaces/src/main/java/com/appsmith/external/plugins/BasePlugin.java new file mode 100644 index 0000000000..3b937bbb47 --- /dev/null +++ b/app/server/appsmith-interfaces/src/main/java/com/appsmith/external/plugins/BasePlugin.java @@ -0,0 +1,12 @@ +package com.appsmith.external.plugins; + +import org.pf4j.Plugin; +import org.pf4j.PluginWrapper; + +public abstract class BasePlugin extends Plugin { + + public BasePlugin(PluginWrapper wrapper) { + super(wrapper); + } + +} diff --git a/app/server/appsmith-interfaces/src/main/java/com/appsmith/external/plugins/PluginExecutor.java b/app/server/appsmith-interfaces/src/main/java/com/appsmith/external/plugins/PluginExecutor.java new file mode 100644 index 0000000000..22eab06c55 --- /dev/null +++ b/app/server/appsmith-interfaces/src/main/java/com/appsmith/external/plugins/PluginExecutor.java @@ -0,0 +1,10 @@ +package com.appsmith.external.plugins; + +import com.appsmith.external.models.CommandParams; +import org.pf4j.ExtensionPoint; +import reactor.core.publisher.Flux; + +public interface PluginExecutor extends ExtensionPoint { + + Flux execute(String command, CommandParams params); +} diff --git a/app/server/appsmith-plugins/pom.xml b/app/server/appsmith-plugins/pom.xml new file mode 100644 index 0000000000..758a89dd77 --- /dev/null +++ b/app/server/appsmith-plugins/pom.xml @@ -0,0 +1,21 @@ + + + + com.appsmith + integrated + 1.0-SNAPSHOT + + + 4.0.0 + com.appsmith + appsmith-plugins + ${project.version} + pom + + + postgresPlugin + + + \ No newline at end of file diff --git a/app/server/appsmith-plugins/postgresPlugin/pom.xml b/app/server/appsmith-plugins/postgresPlugin/pom.xml new file mode 100644 index 0000000000..ef801162d1 --- /dev/null +++ b/app/server/appsmith-plugins/postgresPlugin/pom.xml @@ -0,0 +1,79 @@ + + + + 4.0.0 + + com.external.plugins + postgresPlugin + 1.0-SNAPSHOT + + postgresPlugin + + + UTF-8 + 11 + ${java.version} + ${java.version} + postgres-plugin + com.external.plugins.PostgresPlugin + 0.0.1 + Arpit Mohan + + + + + + junit + junit + 4.11 + test + + + + org.pf4j + pf4j-spring + 0.5.0 + + + + com.appsmith + interfaces + 1.0-SNAPSHOT + + + + org.projectlombok + lombok + 1.18.8 + provided + + + + + + + + maven-compiler-plugin + 3.8.1 + + + org.apache.maven.plugins + maven-jar-plugin + 3.1.2 + + + + ${plugin.id} + ${plugin.class} + ${plugin.version} + ${plugin.provider} + ${plugin.dependencies} + + + + + + + + diff --git a/app/server/appsmith-plugins/postgresPlugin/src/main/java/com/external/plugins/PostgresPlugin.java b/app/server/appsmith-plugins/postgresPlugin/src/main/java/com/external/plugins/PostgresPlugin.java new file mode 100644 index 0000000000..747eb1cb6e --- /dev/null +++ b/app/server/appsmith-plugins/postgresPlugin/src/main/java/com/external/plugins/PostgresPlugin.java @@ -0,0 +1,101 @@ +package com.external.plugins; + +import com.appsmith.external.models.CommandParams; +import com.appsmith.external.plugins.BasePlugin; +import com.appsmith.external.plugins.PluginExecutor; +import lombok.extern.slf4j.Slf4j; +import org.pf4j.Extension; +import org.pf4j.PluginException; +import org.pf4j.PluginWrapper; +import org.springframework.util.Assert; +import reactor.core.publisher.Flux; + +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.ResultSet; +import java.sql.ResultSetMetaData; +import java.sql.SQLException; +import java.sql.Statement; +import java.util.ArrayList; +import java.util.HashMap; + +@Slf4j +public class PostgresPlugin extends BasePlugin { + static String JDBC_DRIVER="org.postgresql.Driver"; + + static String DB_URL="jdbc:postgresql://localhost/mobtools"; + + // Database credentials + static String DB_USER="root"; + + static String DB_PASS="root"; + + static Connection conn = null; + + public PostgresPlugin(PluginWrapper wrapper) { + super(wrapper); + } + + @Override + public void start() throws PluginException { + log.debug("Going to initialize the PostgresDBPlugin"); + try { + // Load the class into JVM + Class.forName(JDBC_DRIVER); + log.debug("Got the jdbc url as {}", DB_URL); + // Create the connection + conn = DriverManager.getConnection(DB_URL, DB_USER, DB_PASS); + } catch (ClassNotFoundException e) { + log.error("", e); + } catch (SQLException e) { + log.error("", e); + } + } + + @Override + public void stop() throws PluginException { + log.debug("PostgresPlugin.stop()"); + try { + if(conn != null) { + conn.close(); + } + } catch (SQLException e) { + log.error("", e); + throw new PluginException(e); + } + } + + @Slf4j + @Extension + public static class PostgresPluginExecutor implements PluginExecutor { + + @Override + public Flux execute(String command, CommandParams commandParams) { + log.debug("In the PostgresPlugin execute with command: {}", command); + Assert.notNull(conn); + + ArrayList list = new ArrayList(50); + try { + Statement statement = conn.createStatement(); + + ResultSet resultSet = statement.executeQuery(command); + ResultSetMetaData metaData = resultSet.getMetaData(); + Integer colCount = metaData.getColumnCount(); + while (resultSet.next()) { + HashMap row = new HashMap(colCount); + for (int i = 1; i <= colCount; i++) { + row.put(metaData.getColumnName(i), resultSet.getObject(i)); + } + list.add(row); + } + } catch (SQLException e) { + log.error("", e); + } + list.forEach(System.out::println); + + return Flux.fromIterable(list); + } + + } + +} diff --git a/app/server/appsmith-plugins/postgresPlugin/src/test/java/com/external/plugins/PostgresPluginTest.java b/app/server/appsmith-plugins/postgresPlugin/src/test/java/com/external/plugins/PostgresPluginTest.java new file mode 100644 index 0000000000..737371925d --- /dev/null +++ b/app/server/appsmith-plugins/postgresPlugin/src/test/java/com/external/plugins/PostgresPluginTest.java @@ -0,0 +1,20 @@ +package com.external.plugins; + +import static org.junit.Assert.assertTrue; + +import org.junit.Test; + +/** + * Unit test for simple App. + */ +public class PostgresPluginTest +{ + /** + * Rigorous Test :-) + */ + @Test + public void shouldAnswerWithTrue() + { + assertTrue( true ); + } +} diff --git a/app/server/appsmith-server/auth-notes b/app/server/appsmith-server/auth-notes new file mode 100644 index 0000000000..be3734399d --- /dev/null +++ b/app/server/appsmith-server/auth-notes @@ -0,0 +1,5 @@ +ReactiveAuthenticationManager - default: OAuth2AuthorizationCodeReactiveAuthenticationManager +AuthenticationWebFilter - #authenticate function is called after you select the google account on the UI. +OAuth2LoginAuthenticationWebFilter (extends AuthenticationWebFilter) : onAuthenticationSuccess called after the login with Google is a success + +ClientUserRepository : This is a custom Appsmith class that saves the AuthorizedClient object in-memory \ No newline at end of file diff --git a/app/server/appsmith-server/pom.xml b/app/server/appsmith-server/pom.xml new file mode 100644 index 0000000000..91d71693af --- /dev/null +++ b/app/server/appsmith-server/pom.xml @@ -0,0 +1,142 @@ + + + 4.0.0 + + com.appsmith + integrated + 1.0-SNAPSHOT + + + com.appsmith + server + ${project.version} + jar + + server + This is the API server for the Appsmith project + + + 11 + + + + + spring-milestones + Spring Milestones + https://repo.spring.io/milestone + + false + + + + jboss-maven2-release-repository + JBoss Spring Repository + https://repository.jboss.org/nexus/content/repositories/public/ + + false + + + + + + + org.springframework.boot + spring-boot-starter-cache + + + org.springframework.boot + spring-boot-starter-security + + + org.springframework.security + spring-security-oauth2-client + 5.1.4.RELEASE + + + org.springframework.security + spring-security-oauth2-jose + 5.1.4.RELEASE + + + org.springframework.security + spring-security-config + 5.1.4.RELEASE + + + org.springframework.boot + spring-boot-starter-webflux + + + org.postgresql + postgresql + runtime + + + org.springframework.boot + spring-boot-starter-data-mongodb-reactive + + + org.hibernate.validator + hibernate-validator + 6.0.17.Final + + + org.glassfish + javax.el + 3.0.0 + + + org.projectlombok + lombok + true + + + com.github.spullara.mustache.java + compiler + 0.9.6 + + + + + org.pf4j + pf4j-spring + 0.5.0 + + + + + com.appsmith + interfaces + 1.0-SNAPSHOT + + + + org.springframework.boot + spring-boot-starter-test + test + + + org.springframework.security + spring-security-test + test + + + io.projectreactor + reactor-test + 3.2.11.RELEASE + test + + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + + diff --git a/app/server/src/main/java/com/appsmith/server/ServerApplication.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/ServerApplication.java similarity index 100% rename from app/server/src/main/java/com/appsmith/server/ServerApplication.java rename to app/server/appsmith-server/src/main/java/com/appsmith/server/ServerApplication.java diff --git a/app/server/src/main/java/com/appsmith/server/configurations/ClientUserRepository.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/configurations/ClientUserRepository.java similarity index 100% rename from app/server/src/main/java/com/appsmith/server/configurations/ClientUserRepository.java rename to app/server/appsmith-server/src/main/java/com/appsmith/server/configurations/ClientUserRepository.java diff --git a/app/server/src/main/java/com/appsmith/server/configurations/CommonConfig.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/configurations/CommonConfig.java similarity index 100% rename from app/server/src/main/java/com/appsmith/server/configurations/CommonConfig.java rename to app/server/appsmith-server/src/main/java/com/appsmith/server/configurations/CommonConfig.java diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/configurations/CustomReactiveAuthenticationManager.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/configurations/CustomReactiveAuthenticationManager.java new file mode 100644 index 0000000000..b6ed280bcc --- /dev/null +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/configurations/CustomReactiveAuthenticationManager.java @@ -0,0 +1,28 @@ +package com.appsmith.server.configurations; + +import org.springframework.security.authentication.ReactiveAuthenticationManager; +import org.springframework.security.core.Authentication; +import org.springframework.security.oauth2.client.authentication.OAuth2AuthorizationCodeReactiveAuthenticationManager; +import org.springframework.security.oauth2.client.endpoint.OAuth2AuthorizationCodeGrantRequest; +import org.springframework.security.oauth2.client.endpoint.ReactiveOAuth2AccessTokenResponseClient; +import reactor.core.publisher.Mono; + +//@Component +public class CustomReactiveAuthenticationManager + extends OAuth2AuthorizationCodeReactiveAuthenticationManager + implements ReactiveAuthenticationManager { + + public CustomReactiveAuthenticationManager( + ReactiveOAuth2AccessTokenResponseClient accessTokenResponseClient) { + super(accessTokenResponseClient); + } + + @Override + public Mono authenticate(Authentication authentication) { + boolean val = true; + if(val) { + return Mono.error(new Exception("something")); + } + return super.authenticate(authentication); + } +} diff --git a/app/server/src/main/java/com/appsmith/server/configurations/MongoConfig.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/configurations/MongoConfig.java similarity index 100% rename from app/server/src/main/java/com/appsmith/server/configurations/MongoConfig.java rename to app/server/appsmith-server/src/main/java/com/appsmith/server/configurations/MongoConfig.java diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/configurations/PluginConfiguration.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/configurations/PluginConfiguration.java new file mode 100644 index 0000000000..0e25a23750 --- /dev/null +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/configurations/PluginConfiguration.java @@ -0,0 +1,15 @@ +package com.appsmith.server.configurations; + +import org.pf4j.spring.SpringPluginManager; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +@Configuration +public class PluginConfiguration { + + @Bean + public SpringPluginManager pluginManager() { + return new SpringPluginManager(); + } + +} diff --git a/app/server/src/main/java/com/appsmith/server/configurations/SecurityConfig.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/configurations/SecurityConfig.java similarity index 100% rename from app/server/src/main/java/com/appsmith/server/configurations/SecurityConfig.java rename to app/server/appsmith-server/src/main/java/com/appsmith/server/configurations/SecurityConfig.java diff --git a/app/server/src/main/java/com/appsmith/server/constants/FieldName.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/constants/FieldName.java similarity index 100% rename from app/server/src/main/java/com/appsmith/server/constants/FieldName.java rename to app/server/appsmith-server/src/main/java/com/appsmith/server/constants/FieldName.java diff --git a/app/server/src/main/java/com/appsmith/server/constants/Security.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/constants/Security.java similarity index 100% rename from app/server/src/main/java/com/appsmith/server/constants/Security.java rename to app/server/appsmith-server/src/main/java/com/appsmith/server/constants/Security.java diff --git a/app/server/src/main/java/com/appsmith/server/constants/Url.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/constants/Url.java similarity index 100% rename from app/server/src/main/java/com/appsmith/server/constants/Url.java rename to app/server/appsmith-server/src/main/java/com/appsmith/server/constants/Url.java diff --git a/app/server/src/main/java/com/appsmith/server/controllers/ActionController.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/controllers/ActionController.java similarity index 100% rename from app/server/src/main/java/com/appsmith/server/controllers/ActionController.java rename to app/server/appsmith-server/src/main/java/com/appsmith/server/controllers/ActionController.java diff --git a/app/server/src/main/java/com/appsmith/server/controllers/ApplicationController.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/controllers/ApplicationController.java similarity index 100% rename from app/server/src/main/java/com/appsmith/server/controllers/ApplicationController.java rename to app/server/appsmith-server/src/main/java/com/appsmith/server/controllers/ApplicationController.java diff --git a/app/server/src/main/java/com/appsmith/server/controllers/BaseController.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/controllers/BaseController.java similarity index 100% rename from app/server/src/main/java/com/appsmith/server/controllers/BaseController.java rename to app/server/appsmith-server/src/main/java/com/appsmith/server/controllers/BaseController.java diff --git a/app/server/src/main/java/com/appsmith/server/controllers/IndexController.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/controllers/IndexController.java similarity index 100% rename from app/server/src/main/java/com/appsmith/server/controllers/IndexController.java rename to app/server/appsmith-server/src/main/java/com/appsmith/server/controllers/IndexController.java diff --git a/app/server/src/main/java/com/appsmith/server/controllers/LayoutController.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/controllers/LayoutController.java similarity index 100% rename from app/server/src/main/java/com/appsmith/server/controllers/LayoutController.java rename to app/server/appsmith-server/src/main/java/com/appsmith/server/controllers/LayoutController.java diff --git a/app/server/src/main/java/com/appsmith/server/controllers/OrganizationController.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/controllers/OrganizationController.java similarity index 100% rename from app/server/src/main/java/com/appsmith/server/controllers/OrganizationController.java rename to app/server/appsmith-server/src/main/java/com/appsmith/server/controllers/OrganizationController.java diff --git a/app/server/src/main/java/com/appsmith/server/controllers/PluginController.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/controllers/PluginController.java similarity index 100% rename from app/server/src/main/java/com/appsmith/server/controllers/PluginController.java rename to app/server/appsmith-server/src/main/java/com/appsmith/server/controllers/PluginController.java diff --git a/app/server/src/main/java/com/appsmith/server/controllers/QueryController.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/controllers/QueryController.java similarity index 100% rename from app/server/src/main/java/com/appsmith/server/controllers/QueryController.java rename to app/server/appsmith-server/src/main/java/com/appsmith/server/controllers/QueryController.java diff --git a/app/server/src/main/java/com/appsmith/server/controllers/ResourceController.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/controllers/ResourceController.java similarity index 100% rename from app/server/src/main/java/com/appsmith/server/controllers/ResourceController.java rename to app/server/appsmith-server/src/main/java/com/appsmith/server/controllers/ResourceController.java diff --git a/app/server/src/main/java/com/appsmith/server/controllers/SettingController.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/controllers/SettingController.java similarity index 100% rename from app/server/src/main/java/com/appsmith/server/controllers/SettingController.java rename to app/server/appsmith-server/src/main/java/com/appsmith/server/controllers/SettingController.java diff --git a/app/server/src/main/java/com/appsmith/server/controllers/UserController.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/controllers/UserController.java similarity index 100% rename from app/server/src/main/java/com/appsmith/server/controllers/UserController.java rename to app/server/appsmith-server/src/main/java/com/appsmith/server/controllers/UserController.java diff --git a/app/server/src/main/java/com/appsmith/server/controllers/WidgetController.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/controllers/WidgetController.java similarity index 100% rename from app/server/src/main/java/com/appsmith/server/controllers/WidgetController.java rename to app/server/appsmith-server/src/main/java/com/appsmith/server/controllers/WidgetController.java diff --git a/app/server/src/main/java/com/appsmith/server/domains/Action.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/domains/Action.java similarity index 100% rename from app/server/src/main/java/com/appsmith/server/domains/Action.java rename to app/server/appsmith-server/src/main/java/com/appsmith/server/domains/Action.java diff --git a/app/server/src/main/java/com/appsmith/server/domains/ActionConfiguration.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/domains/ActionConfiguration.java similarity index 100% rename from app/server/src/main/java/com/appsmith/server/domains/ActionConfiguration.java rename to app/server/appsmith-server/src/main/java/com/appsmith/server/domains/ActionConfiguration.java diff --git a/app/server/src/main/java/com/appsmith/server/domains/Application.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/domains/Application.java similarity index 100% rename from app/server/src/main/java/com/appsmith/server/domains/Application.java rename to app/server/appsmith-server/src/main/java/com/appsmith/server/domains/Application.java diff --git a/app/server/src/main/java/com/appsmith/server/domains/ApplicationPage.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/domains/ApplicationPage.java similarity index 100% rename from app/server/src/main/java/com/appsmith/server/domains/ApplicationPage.java rename to app/server/appsmith-server/src/main/java/com/appsmith/server/domains/ApplicationPage.java diff --git a/app/server/src/main/java/com/appsmith/server/domains/BaseDomain.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/domains/BaseDomain.java similarity index 100% rename from app/server/src/main/java/com/appsmith/server/domains/BaseDomain.java rename to app/server/appsmith-server/src/main/java/com/appsmith/server/domains/BaseDomain.java diff --git a/app/server/src/main/java/com/appsmith/server/domains/Layout.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/domains/Layout.java similarity index 100% rename from app/server/src/main/java/com/appsmith/server/domains/Layout.java rename to app/server/appsmith-server/src/main/java/com/appsmith/server/domains/Layout.java diff --git a/app/server/src/main/java/com/appsmith/server/domains/LoginSource.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/domains/LoginSource.java similarity index 100% rename from app/server/src/main/java/com/appsmith/server/domains/LoginSource.java rename to app/server/appsmith-server/src/main/java/com/appsmith/server/domains/LoginSource.java diff --git a/app/server/src/main/java/com/appsmith/server/domains/Organization.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/domains/Organization.java similarity index 100% rename from app/server/src/main/java/com/appsmith/server/domains/Organization.java rename to app/server/appsmith-server/src/main/java/com/appsmith/server/domains/Organization.java diff --git a/app/server/src/main/java/com/appsmith/server/domains/OrganizationPlugin.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/domains/OrganizationPlugin.java similarity index 100% rename from app/server/src/main/java/com/appsmith/server/domains/OrganizationPlugin.java rename to app/server/appsmith-server/src/main/java/com/appsmith/server/domains/OrganizationPlugin.java diff --git a/app/server/src/main/java/com/appsmith/server/domains/OrganizationSetting.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/domains/OrganizationSetting.java similarity index 100% rename from app/server/src/main/java/com/appsmith/server/domains/OrganizationSetting.java rename to app/server/appsmith-server/src/main/java/com/appsmith/server/domains/OrganizationSetting.java diff --git a/app/server/src/main/java/com/appsmith/server/domains/Page.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/domains/Page.java similarity index 100% rename from app/server/src/main/java/com/appsmith/server/domains/Page.java rename to app/server/appsmith-server/src/main/java/com/appsmith/server/domains/Page.java diff --git a/app/server/src/main/java/com/appsmith/server/domains/Plugin.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/domains/Plugin.java similarity index 100% rename from app/server/src/main/java/com/appsmith/server/domains/Plugin.java rename to app/server/appsmith-server/src/main/java/com/appsmith/server/domains/Plugin.java diff --git a/app/server/src/main/java/com/appsmith/server/domains/PluginParameterType.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/domains/PluginParameterType.java similarity index 100% rename from app/server/src/main/java/com/appsmith/server/domains/PluginParameterType.java rename to app/server/appsmith-server/src/main/java/com/appsmith/server/domains/PluginParameterType.java diff --git a/app/server/src/main/java/com/appsmith/server/domains/PluginType.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/domains/PluginType.java similarity index 100% rename from app/server/src/main/java/com/appsmith/server/domains/PluginType.java rename to app/server/appsmith-server/src/main/java/com/appsmith/server/domains/PluginType.java diff --git a/app/server/src/main/java/com/appsmith/server/domains/PricingPlan.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/domains/PricingPlan.java similarity index 100% rename from app/server/src/main/java/com/appsmith/server/domains/PricingPlan.java rename to app/server/appsmith-server/src/main/java/com/appsmith/server/domains/PricingPlan.java diff --git a/app/server/src/main/java/com/appsmith/server/domains/Property.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/domains/Property.java similarity index 100% rename from app/server/src/main/java/com/appsmith/server/domains/Property.java rename to app/server/appsmith-server/src/main/java/com/appsmith/server/domains/Property.java diff --git a/app/server/src/main/java/com/appsmith/server/domains/Query.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/domains/Query.java similarity index 100% rename from app/server/src/main/java/com/appsmith/server/domains/Query.java rename to app/server/appsmith-server/src/main/java/com/appsmith/server/domains/Query.java diff --git a/app/server/src/main/java/com/appsmith/server/domains/Resource.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/domains/Resource.java similarity index 100% rename from app/server/src/main/java/com/appsmith/server/domains/Resource.java rename to app/server/appsmith-server/src/main/java/com/appsmith/server/domains/Resource.java diff --git a/app/server/src/main/java/com/appsmith/server/domains/ResourceConfiguration.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/domains/ResourceConfiguration.java similarity index 100% rename from app/server/src/main/java/com/appsmith/server/domains/ResourceConfiguration.java rename to app/server/appsmith-server/src/main/java/com/appsmith/server/domains/ResourceConfiguration.java diff --git a/app/server/src/main/java/com/appsmith/server/domains/Role.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/domains/Role.java similarity index 100% rename from app/server/src/main/java/com/appsmith/server/domains/Role.java rename to app/server/appsmith-server/src/main/java/com/appsmith/server/domains/Role.java diff --git a/app/server/src/main/java/com/appsmith/server/domains/ScreenType.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/domains/ScreenType.java similarity index 100% rename from app/server/src/main/java/com/appsmith/server/domains/ScreenType.java rename to app/server/appsmith-server/src/main/java/com/appsmith/server/domains/ScreenType.java diff --git a/app/server/src/main/java/com/appsmith/server/domains/Setting.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/domains/Setting.java similarity index 100% rename from app/server/src/main/java/com/appsmith/server/domains/Setting.java rename to app/server/appsmith-server/src/main/java/com/appsmith/server/domains/Setting.java diff --git a/app/server/src/main/java/com/appsmith/server/domains/User.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/domains/User.java similarity index 100% rename from app/server/src/main/java/com/appsmith/server/domains/User.java rename to app/server/appsmith-server/src/main/java/com/appsmith/server/domains/User.java diff --git a/app/server/src/main/java/com/appsmith/server/domains/UserState.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/domains/UserState.java similarity index 100% rename from app/server/src/main/java/com/appsmith/server/domains/UserState.java rename to app/server/appsmith-server/src/main/java/com/appsmith/server/domains/UserState.java diff --git a/app/server/src/main/java/com/appsmith/server/domains/Widget.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/domains/Widget.java similarity index 100% rename from app/server/src/main/java/com/appsmith/server/domains/Widget.java rename to app/server/appsmith-server/src/main/java/com/appsmith/server/domains/Widget.java diff --git a/app/server/src/main/java/com/appsmith/server/domains/WidgetType.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/domains/WidgetType.java similarity index 100% rename from app/server/src/main/java/com/appsmith/server/domains/WidgetType.java rename to app/server/appsmith-server/src/main/java/com/appsmith/server/domains/WidgetType.java diff --git a/app/server/src/main/java/com/appsmith/server/dtos/AuthenticationDTO.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/dtos/AuthenticationDTO.java similarity index 100% rename from app/server/src/main/java/com/appsmith/server/dtos/AuthenticationDTO.java rename to app/server/appsmith-server/src/main/java/com/appsmith/server/dtos/AuthenticationDTO.java diff --git a/app/server/src/main/java/com/appsmith/server/dtos/CommandQueryParams.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/dtos/CommandQueryParams.java similarity index 100% rename from app/server/src/main/java/com/appsmith/server/dtos/CommandQueryParams.java rename to app/server/appsmith-server/src/main/java/com/appsmith/server/dtos/CommandQueryParams.java diff --git a/app/server/src/main/java/com/appsmith/server/dtos/OrganizationPluginStatus.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/dtos/OrganizationPluginStatus.java similarity index 100% rename from app/server/src/main/java/com/appsmith/server/dtos/OrganizationPluginStatus.java rename to app/server/appsmith-server/src/main/java/com/appsmith/server/dtos/OrganizationPluginStatus.java diff --git a/app/server/src/main/java/com/appsmith/server/dtos/Param.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/dtos/Param.java similarity index 100% rename from app/server/src/main/java/com/appsmith/server/dtos/Param.java rename to app/server/appsmith-server/src/main/java/com/appsmith/server/dtos/Param.java diff --git a/app/server/src/main/java/com/appsmith/server/dtos/PluginDTO.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/dtos/PluginDTO.java similarity index 100% rename from app/server/src/main/java/com/appsmith/server/dtos/PluginDTO.java rename to app/server/appsmith-server/src/main/java/com/appsmith/server/dtos/PluginDTO.java diff --git a/app/server/src/main/java/com/appsmith/server/dtos/PluginOrgDTO.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/dtos/PluginOrgDTO.java similarity index 100% rename from app/server/src/main/java/com/appsmith/server/dtos/PluginOrgDTO.java rename to app/server/appsmith-server/src/main/java/com/appsmith/server/dtos/PluginOrgDTO.java diff --git a/app/server/src/main/java/com/appsmith/server/dtos/ResponseDto.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/dtos/ResponseDto.java similarity index 100% rename from app/server/src/main/java/com/appsmith/server/dtos/ResponseDto.java rename to app/server/appsmith-server/src/main/java/com/appsmith/server/dtos/ResponseDto.java diff --git a/app/server/src/main/java/com/appsmith/server/exceptions/AppsmithError.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/exceptions/AppsmithError.java similarity index 100% rename from app/server/src/main/java/com/appsmith/server/exceptions/AppsmithError.java rename to app/server/appsmith-server/src/main/java/com/appsmith/server/exceptions/AppsmithError.java diff --git a/app/server/src/main/java/com/appsmith/server/exceptions/AppsmithException.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/exceptions/AppsmithException.java similarity index 100% rename from app/server/src/main/java/com/appsmith/server/exceptions/AppsmithException.java rename to app/server/appsmith-server/src/main/java/com/appsmith/server/exceptions/AppsmithException.java diff --git a/app/server/src/main/java/com/appsmith/server/exceptions/ErrorDTO.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/exceptions/ErrorDTO.java similarity index 100% rename from app/server/src/main/java/com/appsmith/server/exceptions/ErrorDTO.java rename to app/server/appsmith-server/src/main/java/com/appsmith/server/exceptions/ErrorDTO.java diff --git a/app/server/src/main/java/com/appsmith/server/exceptions/GlobalExceptionHandler.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/exceptions/GlobalExceptionHandler.java similarity index 100% rename from app/server/src/main/java/com/appsmith/server/exceptions/GlobalExceptionHandler.java rename to app/server/appsmith-server/src/main/java/com/appsmith/server/exceptions/GlobalExceptionHandler.java diff --git a/app/server/src/main/java/com/appsmith/server/filters/MDCFilter.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/filters/MDCFilter.java similarity index 100% rename from app/server/src/main/java/com/appsmith/server/filters/MDCFilter.java rename to app/server/appsmith-server/src/main/java/com/appsmith/server/filters/MDCFilter.java diff --git a/app/server/src/main/java/com/appsmith/server/helpers/BeanCopyUtils.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/helpers/BeanCopyUtils.java similarity index 100% rename from app/server/src/main/java/com/appsmith/server/helpers/BeanCopyUtils.java rename to app/server/appsmith-server/src/main/java/com/appsmith/server/helpers/BeanCopyUtils.java diff --git a/app/server/src/main/java/com/appsmith/server/helpers/LogHelper.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/helpers/LogHelper.java similarity index 100% rename from app/server/src/main/java/com/appsmith/server/helpers/LogHelper.java rename to app/server/appsmith-server/src/main/java/com/appsmith/server/helpers/LogHelper.java diff --git a/app/server/src/main/java/com/appsmith/server/plugins/PostgresDBPluginExecutor.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/plugins/PostgresDBOldPluginExecutor.java similarity index 95% rename from app/server/src/main/java/com/appsmith/server/plugins/PostgresDBPluginExecutor.java rename to app/server/appsmith-server/src/main/java/com/appsmith/server/plugins/PostgresDBOldPluginExecutor.java index fc80629ba7..2def8fd810 100644 --- a/app/server/src/main/java/com/appsmith/server/plugins/PostgresDBPluginExecutor.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/plugins/PostgresDBOldPluginExecutor.java @@ -2,7 +2,7 @@ package com.appsmith.server.plugins; import com.appsmith.server.domains.Query; import com.appsmith.server.dtos.CommandQueryParams; -import com.appsmith.server.services.PluginExecutor; +import com.appsmith.server.services.OldPluginExecutor; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; @@ -19,7 +19,7 @@ import java.util.HashMap; @Slf4j @Component -public class PostgresDBPluginExecutor extends PluginExecutor { +public class PostgresDBOldPluginExecutor extends OldPluginExecutor { // JDBC driver name and database URL @Value("${jdbc.postgres.driver}") diff --git a/app/server/src/main/java/com/appsmith/server/plugins/RestTemplatePluginExecutor.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/plugins/RestTemplateOldPluginExecutor.java similarity index 95% rename from app/server/src/main/java/com/appsmith/server/plugins/RestTemplatePluginExecutor.java rename to app/server/appsmith-server/src/main/java/com/appsmith/server/plugins/RestTemplateOldPluginExecutor.java index 74a10883fc..e83d470ff6 100644 --- a/app/server/src/main/java/com/appsmith/server/plugins/RestTemplatePluginExecutor.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/plugins/RestTemplateOldPluginExecutor.java @@ -3,7 +3,7 @@ package com.appsmith.server.plugins; import com.appsmith.server.domains.Property; import com.appsmith.server.domains.Query; import com.appsmith.server.dtos.CommandQueryParams; -import com.appsmith.server.services.PluginExecutor; +import com.appsmith.server.services.OldPluginExecutor; import lombok.extern.slf4j.Slf4j; import net.minidev.json.JSONObject; import org.springframework.http.HttpHeaders; @@ -22,7 +22,7 @@ import java.util.stream.Collectors; @Component @Slf4j -public class RestTemplatePluginExecutor extends PluginExecutor { +public class RestTemplateOldPluginExecutor extends OldPluginExecutor { final String PROP_URL = "url"; final String PROP_HTTP_METHOD = "method"; diff --git a/app/server/src/main/java/com/appsmith/server/repositories/ActionRepository.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/repositories/ActionRepository.java similarity index 100% rename from app/server/src/main/java/com/appsmith/server/repositories/ActionRepository.java rename to app/server/appsmith-server/src/main/java/com/appsmith/server/repositories/ActionRepository.java diff --git a/app/server/src/main/java/com/appsmith/server/repositories/ApplicationRepository.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/repositories/ApplicationRepository.java similarity index 100% rename from app/server/src/main/java/com/appsmith/server/repositories/ApplicationRepository.java rename to app/server/appsmith-server/src/main/java/com/appsmith/server/repositories/ApplicationRepository.java diff --git a/app/server/src/main/java/com/appsmith/server/repositories/BaseRepository.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/repositories/BaseRepository.java similarity index 100% rename from app/server/src/main/java/com/appsmith/server/repositories/BaseRepository.java rename to app/server/appsmith-server/src/main/java/com/appsmith/server/repositories/BaseRepository.java diff --git a/app/server/src/main/java/com/appsmith/server/repositories/LayoutRepository.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/repositories/LayoutRepository.java similarity index 100% rename from app/server/src/main/java/com/appsmith/server/repositories/LayoutRepository.java rename to app/server/appsmith-server/src/main/java/com/appsmith/server/repositories/LayoutRepository.java diff --git a/app/server/src/main/java/com/appsmith/server/repositories/OrganizationRepository.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/repositories/OrganizationRepository.java similarity index 100% rename from app/server/src/main/java/com/appsmith/server/repositories/OrganizationRepository.java rename to app/server/appsmith-server/src/main/java/com/appsmith/server/repositories/OrganizationRepository.java diff --git a/app/server/src/main/java/com/appsmith/server/repositories/PluginRepository.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/repositories/PluginRepository.java similarity index 100% rename from app/server/src/main/java/com/appsmith/server/repositories/PluginRepository.java rename to app/server/appsmith-server/src/main/java/com/appsmith/server/repositories/PluginRepository.java diff --git a/app/server/src/main/java/com/appsmith/server/repositories/QueryRepository.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/repositories/QueryRepository.java similarity index 100% rename from app/server/src/main/java/com/appsmith/server/repositories/QueryRepository.java rename to app/server/appsmith-server/src/main/java/com/appsmith/server/repositories/QueryRepository.java diff --git a/app/server/src/main/java/com/appsmith/server/repositories/ResourceRepository.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/repositories/ResourceRepository.java similarity index 100% rename from app/server/src/main/java/com/appsmith/server/repositories/ResourceRepository.java rename to app/server/appsmith-server/src/main/java/com/appsmith/server/repositories/ResourceRepository.java diff --git a/app/server/src/main/java/com/appsmith/server/repositories/SettingRepository.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/repositories/SettingRepository.java similarity index 100% rename from app/server/src/main/java/com/appsmith/server/repositories/SettingRepository.java rename to app/server/appsmith-server/src/main/java/com/appsmith/server/repositories/SettingRepository.java diff --git a/app/server/src/main/java/com/appsmith/server/repositories/UserRepository.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/repositories/UserRepository.java similarity index 100% rename from app/server/src/main/java/com/appsmith/server/repositories/UserRepository.java rename to app/server/appsmith-server/src/main/java/com/appsmith/server/repositories/UserRepository.java diff --git a/app/server/src/main/java/com/appsmith/server/repositories/WidgetRepository.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/repositories/WidgetRepository.java similarity index 100% rename from app/server/src/main/java/com/appsmith/server/repositories/WidgetRepository.java rename to app/server/appsmith-server/src/main/java/com/appsmith/server/repositories/WidgetRepository.java diff --git a/app/server/src/main/java/com/appsmith/server/services/ActionService.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ActionService.java similarity index 100% rename from app/server/src/main/java/com/appsmith/server/services/ActionService.java rename to app/server/appsmith-server/src/main/java/com/appsmith/server/services/ActionService.java diff --git a/app/server/src/main/java/com/appsmith/server/services/ActionServiceImpl.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ActionServiceImpl.java similarity index 100% rename from app/server/src/main/java/com/appsmith/server/services/ActionServiceImpl.java rename to app/server/appsmith-server/src/main/java/com/appsmith/server/services/ActionServiceImpl.java diff --git a/app/server/src/main/java/com/appsmith/server/services/ApplicationService.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ApplicationService.java similarity index 100% rename from app/server/src/main/java/com/appsmith/server/services/ApplicationService.java rename to app/server/appsmith-server/src/main/java/com/appsmith/server/services/ApplicationService.java diff --git a/app/server/src/main/java/com/appsmith/server/services/ApplicationServiceImpl.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ApplicationServiceImpl.java similarity index 100% rename from app/server/src/main/java/com/appsmith/server/services/ApplicationServiceImpl.java rename to app/server/appsmith-server/src/main/java/com/appsmith/server/services/ApplicationServiceImpl.java diff --git a/app/server/src/main/java/com/appsmith/server/services/BaseService.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/services/BaseService.java similarity index 100% rename from app/server/src/main/java/com/appsmith/server/services/BaseService.java rename to app/server/appsmith-server/src/main/java/com/appsmith/server/services/BaseService.java diff --git a/app/server/src/main/java/com/appsmith/server/services/CrudService.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/services/CrudService.java similarity index 100% rename from app/server/src/main/java/com/appsmith/server/services/CrudService.java rename to app/server/appsmith-server/src/main/java/com/appsmith/server/services/CrudService.java diff --git a/app/server/src/main/java/com/appsmith/server/services/LayoutService.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/services/LayoutService.java similarity index 100% rename from app/server/src/main/java/com/appsmith/server/services/LayoutService.java rename to app/server/appsmith-server/src/main/java/com/appsmith/server/services/LayoutService.java diff --git a/app/server/src/main/java/com/appsmith/server/services/LayoutServiceImpl.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/services/LayoutServiceImpl.java similarity index 100% rename from app/server/src/main/java/com/appsmith/server/services/LayoutServiceImpl.java rename to app/server/appsmith-server/src/main/java/com/appsmith/server/services/LayoutServiceImpl.java diff --git a/app/server/src/main/java/com/appsmith/server/services/PluginExecutor.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/services/OldPluginExecutor.java similarity index 98% rename from app/server/src/main/java/com/appsmith/server/services/PluginExecutor.java rename to app/server/appsmith-server/src/main/java/com/appsmith/server/services/OldPluginExecutor.java index 8bfb3ae059..0cb6c33cca 100644 --- a/app/server/src/main/java/com/appsmith/server/services/PluginExecutor.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/services/OldPluginExecutor.java @@ -15,7 +15,7 @@ import java.util.HashMap; import java.util.Map; import java.util.stream.Collectors; -public abstract class PluginExecutor { +public abstract class OldPluginExecutor { /** * This function executes the command against a backend datasource. diff --git a/app/server/src/main/java/com/appsmith/server/services/OrganizationService.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/services/OrganizationService.java similarity index 100% rename from app/server/src/main/java/com/appsmith/server/services/OrganizationService.java rename to app/server/appsmith-server/src/main/java/com/appsmith/server/services/OrganizationService.java diff --git a/app/server/src/main/java/com/appsmith/server/services/OrganizationServiceImpl.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/services/OrganizationServiceImpl.java similarity index 100% rename from app/server/src/main/java/com/appsmith/server/services/OrganizationServiceImpl.java rename to app/server/appsmith-server/src/main/java/com/appsmith/server/services/OrganizationServiceImpl.java diff --git a/app/server/src/main/java/com/appsmith/server/services/PluginService.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/services/PluginService.java similarity index 90% rename from app/server/src/main/java/com/appsmith/server/services/PluginService.java rename to app/server/appsmith-server/src/main/java/com/appsmith/server/services/PluginService.java index a9ee7e537f..0617e6be58 100644 --- a/app/server/src/main/java/com/appsmith/server/services/PluginService.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/services/PluginService.java @@ -16,7 +16,7 @@ public interface PluginService extends CrudService { * @param className * @return PluginExecutor */ - PluginExecutor getPluginExecutor(PluginType pluginType, String className); + OldPluginExecutor getPluginExecutor(PluginType pluginType, String className); public Mono installPlugin(PluginOrgDTO plugin); diff --git a/app/server/src/main/java/com/appsmith/server/services/PluginServiceImpl.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/services/PluginServiceImpl.java similarity index 97% rename from app/server/src/main/java/com/appsmith/server/services/PluginServiceImpl.java rename to app/server/appsmith-server/src/main/java/com/appsmith/server/services/PluginServiceImpl.java index 5fafb8379e..7d96e5f88f 100644 --- a/app/server/src/main/java/com/appsmith/server/services/PluginServiceImpl.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/services/PluginServiceImpl.java @@ -47,11 +47,11 @@ public class PluginServiceImpl extends BaseService clazz; try { clazz = Class.forName(className); - return (PluginExecutor) applicationContext.getBean(clazz); + return (OldPluginExecutor) applicationContext.getBean(clazz); } catch (ClassNotFoundException e) { log.error("Unable to find class {}. ", className, e); } diff --git a/app/server/src/main/java/com/appsmith/server/services/QueryService.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/services/QueryService.java similarity index 100% rename from app/server/src/main/java/com/appsmith/server/services/QueryService.java rename to app/server/appsmith-server/src/main/java/com/appsmith/server/services/QueryService.java diff --git a/app/server/src/main/java/com/appsmith/server/services/QueryServiceImpl.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/services/QueryServiceImpl.java similarity index 63% rename from app/server/src/main/java/com/appsmith/server/services/QueryServiceImpl.java rename to app/server/appsmith-server/src/main/java/com/appsmith/server/services/QueryServiceImpl.java index 152f123df3..f5c90768b2 100644 --- a/app/server/src/main/java/com/appsmith/server/services/QueryServiceImpl.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/services/QueryServiceImpl.java @@ -1,11 +1,13 @@ package com.appsmith.server.services; +import com.appsmith.external.plugins.PluginExecutor; import com.appsmith.server.domains.Query; import com.appsmith.server.dtos.CommandQueryParams; import com.appsmith.server.exceptions.AppsmithError; import com.appsmith.server.exceptions.AppsmithException; import com.appsmith.server.repositories.QueryRepository; import lombok.extern.slf4j.Slf4j; +import org.pf4j.PluginManager; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.mongodb.core.ReactiveMongoTemplate; import org.springframework.data.mongodb.core.convert.MongoConverter; @@ -15,6 +17,7 @@ import reactor.core.publisher.Mono; import reactor.core.scheduler.Scheduler; import javax.validation.Validator; +import java.util.List; @Slf4j @Service @@ -22,15 +25,19 @@ public class QueryServiceImpl extends BaseService Mono.error(new AppsmithException(AppsmithError.NO_RESOURCE_FOUND, "query", name)))); // 2. Instantiate the implementation class based on the query type - Mono pluginExecutorMono = queryMono.map(queryObj -> - pluginService.getPluginExecutor(queryObj.getPlugin().getType(), queryObj.getPlugin().getExecutorClass())); + Mono pluginExecutorMono = queryMono.flatMap(queryObj -> { + String pluginId = queryObj.getPlugin().getExecutorClass(); + List executorList = pluginManager.getExtensions(PluginExecutor.class, pluginId); + if (executorList.isEmpty()) { + return Mono.error(new AppsmithException(AppsmithError.NO_RESOURCE_FOUND, "plugin")); + } + return Mono.just(executorList.get(0)); + } + ); // 3. Execute the query return queryMono - .zipWith(pluginExecutorMono, (queryObj, pluginExecutor) -> { - Query newQueryObj = pluginExecutor.replaceTemplate(queryObj, params); - return pluginExecutor.execute(newQueryObj, params); - }) - .flatMapIterable(Flux::toIterable).subscribeOn(scheduler); + .zipWith(pluginExecutorMono, (queryObj, pluginExecutor) -> + // TODO: The CommandParams is being passed as null here. Move it to interfaces.CommandParams + pluginExecutor.execute(queryObj.getCommandTemplate(), null)) + .flatMapIterable(Flux::toIterable); } } diff --git a/app/server/src/main/java/com/appsmith/server/services/ResourceService.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ResourceService.java similarity index 100% rename from app/server/src/main/java/com/appsmith/server/services/ResourceService.java rename to app/server/appsmith-server/src/main/java/com/appsmith/server/services/ResourceService.java diff --git a/app/server/src/main/java/com/appsmith/server/services/ResourceServiceImpl.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ResourceServiceImpl.java similarity index 100% rename from app/server/src/main/java/com/appsmith/server/services/ResourceServiceImpl.java rename to app/server/appsmith-server/src/main/java/com/appsmith/server/services/ResourceServiceImpl.java diff --git a/app/server/src/main/java/com/appsmith/server/services/SettingService.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/services/SettingService.java similarity index 100% rename from app/server/src/main/java/com/appsmith/server/services/SettingService.java rename to app/server/appsmith-server/src/main/java/com/appsmith/server/services/SettingService.java diff --git a/app/server/src/main/java/com/appsmith/server/services/SettingServiceImpl.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/services/SettingServiceImpl.java similarity index 100% rename from app/server/src/main/java/com/appsmith/server/services/SettingServiceImpl.java rename to app/server/appsmith-server/src/main/java/com/appsmith/server/services/SettingServiceImpl.java diff --git a/app/server/src/main/java/com/appsmith/server/services/UserService.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/services/UserService.java similarity index 100% rename from app/server/src/main/java/com/appsmith/server/services/UserService.java rename to app/server/appsmith-server/src/main/java/com/appsmith/server/services/UserService.java diff --git a/app/server/src/main/java/com/appsmith/server/services/UserServiceImpl.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/services/UserServiceImpl.java similarity index 100% rename from app/server/src/main/java/com/appsmith/server/services/UserServiceImpl.java rename to app/server/appsmith-server/src/main/java/com/appsmith/server/services/UserServiceImpl.java diff --git a/app/server/src/main/java/com/appsmith/server/services/WidgetService.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/services/WidgetService.java similarity index 100% rename from app/server/src/main/java/com/appsmith/server/services/WidgetService.java rename to app/server/appsmith-server/src/main/java/com/appsmith/server/services/WidgetService.java diff --git a/app/server/src/main/java/com/appsmith/server/services/WidgetServiceImpl.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/services/WidgetServiceImpl.java similarity index 100% rename from app/server/src/main/java/com/appsmith/server/services/WidgetServiceImpl.java rename to app/server/appsmith-server/src/main/java/com/appsmith/server/services/WidgetServiceImpl.java diff --git a/app/server/src/main/resources/application-local.properties b/app/server/appsmith-server/src/main/resources/application-local.properties similarity index 92% rename from app/server/src/main/resources/application-local.properties rename to app/server/appsmith-server/src/main/resources/application-local.properties index 573b245504..3e8a1acfe6 100644 --- a/app/server/src/main/resources/application-local.properties +++ b/app/server/appsmith-server/src/main/resources/application-local.properties @@ -5,7 +5,7 @@ spring.data.mongodb.port=27017 #spring.data.mongodb.username= #spring.data.mongodb.password= -logging.level.root=info +logging.level.root=debug logging.level.com.appsmith=debug logging.pattern.console=%X - %m%n diff --git a/app/server/src/main/resources/application-staging.properties b/app/server/appsmith-server/src/main/resources/application-staging.properties similarity index 100% rename from app/server/src/main/resources/application-staging.properties rename to app/server/appsmith-server/src/main/resources/application-staging.properties diff --git a/app/server/src/main/resources/application.properties b/app/server/appsmith-server/src/main/resources/application.properties similarity index 100% rename from app/server/src/main/resources/application.properties rename to app/server/appsmith-server/src/main/resources/application.properties diff --git a/app/server/src/test/java/com/appsmith/server/ServerApplicationTests.java b/app/server/appsmith-server/src/test/java/com/appsmith/server/ServerApplicationTests.java similarity index 100% rename from app/server/src/test/java/com/appsmith/server/ServerApplicationTests.java rename to app/server/appsmith-server/src/test/java/com/appsmith/server/ServerApplicationTests.java diff --git a/app/server/src/test/java/com/appsmith/server/services/OrganizationServiceTest.java b/app/server/appsmith-server/src/test/java/com/appsmith/server/services/OrganizationServiceTest.java similarity index 100% rename from app/server/src/test/java/com/appsmith/server/services/OrganizationServiceTest.java rename to app/server/appsmith-server/src/test/java/com/appsmith/server/services/OrganizationServiceTest.java diff --git a/app/server/src/test/java/com/appsmith/server/services/UserServiceTest.java b/app/server/appsmith-server/src/test/java/com/appsmith/server/services/UserServiceTest.java similarity index 100% rename from app/server/src/test/java/com/appsmith/server/services/UserServiceTest.java rename to app/server/appsmith-server/src/test/java/com/appsmith/server/services/UserServiceTest.java diff --git a/app/server/system.properties b/app/server/appsmith-server/system.properties similarity index 100% rename from app/server/system.properties rename to app/server/appsmith-server/system.properties diff --git a/app/server/build.sh b/app/server/build.sh new file mode 100755 index 0000000000..b3c0cbf5f4 --- /dev/null +++ b/app/server/build.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +# Remove previous dist directory + +# Build the code. $@ accepts all the parameters from the input command line and uses it in the maven build command +mvn clean package "$@" + +# Create the dist directory +mkdir -p dist/plugins + +# Copy the server jar +cp ./appsmith-server/target/server-1.0-SNAPSHOT.jar dist/ + +# Copy all the plugins +cp ./appsmith-plugins/*/target/*.jar dist/plugins/ + + + + diff --git a/app/server/buildpack-run.sh b/app/server/buildpack-run.sh new file mode 100755 index 0000000000..498c0f73e9 --- /dev/null +++ b/app/server/buildpack-run.sh @@ -0,0 +1 @@ +./build.sh -DskipTests diff --git a/app/server/pom.xml b/app/server/pom.xml index 2cf6b31bc2..d62f8812a9 100644 --- a/app/server/pom.xml +++ b/app/server/pom.xml @@ -1,126 +1,48 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-starter-parent - 2.1.3.RELEASE - - - com.appsmith - server - 0.0.1-SNAPSHOT - server - This is the API server for the Appsmith project + + - - 11 - + + org.springframework.boot + spring-boot-starter-parent + 2.1.3.RELEASE + + - - - spring-milestones - Spring Milestones - https://repo.spring.io/milestone - - false - - - - jboss-maven2-release-repository - JBoss Spring Repository - https://repository.jboss.org/nexus/content/repositories/public/ - - false - - - + 4.0.0 + com.appsmith + integrated + 1.0-SNAPSHOT + pom + Integrated Appsmith - - - org.springframework.boot - spring-boot-starter-cache - - - org.springframework.boot - spring-boot-starter-security - - - org.springframework.security - spring-security-oauth2-client - 5.1.4.RELEASE - - - org.springframework.security - spring-security-oauth2-jose - 5.1.4.RELEASE - - - org.springframework.security - spring-security-config - 5.1.4.RELEASE - - - org.springframework.boot - spring-boot-starter-webflux - - - org.postgresql - postgresql - runtime - - - org.springframework.boot - spring-boot-starter-data-mongodb-reactive - - - org.hibernate.validator - hibernate-validator - 6.0.17.Final - - - org.glassfish - javax.el - 3.0.0 - - - org.projectlombok - lombok - true - - - com.github.spullara.mustache.java - compiler - 0.9.6 - + + true + true + true + com.appsmith + 1.0-SNAPSHOT + - - org.springframework.boot - spring-boot-starter-test - test - - - org.springframework.security - spring-security-test - test - - - io.projectreactor - reactor-test - 3.2.11.RELEASE - test - + + + + false + src/main/java + + **/*.java + + + + src/main/resources + + + - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - + + appsmith-interfaces + appsmith-plugins + appsmith-server + +