From 4306fbaf847127ef3b71a0429c6ef091215668e6 Mon Sep 17 00:00:00 2001 From: delchev Date: Mon, 20 Feb 2023 20:36:17 +0200 Subject: [PATCH] problems functionality, ref: #2107 --- components/api-platform/pom.xml | 5 + .../api/platform/ProblemsFacade.java | 187 ++++++++ .../api/platform/WorkspaceFacade.java | 2 +- .../dirigible/platform/extensions/modules.js | 13 +- .../platform/extensions/modules.json | 13 +- .../META-INF/dirigible/platform/modules.js | 5 + .../META-INF/dirigible/platform/problems.js | 51 +++ components/app-all/pom.xml | 8 +- ...ibleBasicAuthWebSecurityConfiguration.java | 62 +-- components/ide-problems/about.html | 38 ++ components/ide-problems/pom.xml | 51 +++ .../ide/problems/domain/Problem.java | 407 ++++++++++++++++++ .../problems/endpoint/ProblemEndpoint.java | 125 ++++++ .../repository/ProblemRepository.java | 51 +++ .../ide/problems/service/ProblemService.java | 178 ++++++++ .../endpoint/ProblemsEndpointTest.java | 121 ++++++ .../dirigible/ide-problems/js/problems.js | 4 +- .../dirigible/ide-problems/project.json | 7 +- components/pom.xml | 1 + components/ttyd.sh | 1 + .../jobs/repository/JobEmailRepository.java | 4 +- .../jobs/repository/JobLogRepository.java | 4 +- .../repository/JobParameterRepository.java | 4 +- .../jobs/repository/JobRepository.java | 4 +- .../components/jobs/service/JobService.java | 1 - 25 files changed, 1297 insertions(+), 50 deletions(-) create mode 100644 components/api-platform/src/main/java/org/eclipse/dirigible/components/api/platform/ProblemsFacade.java create mode 100644 components/api-platform/src/main/resources/META-INF/dirigible/platform/problems.js create mode 100644 components/ide-problems/about.html create mode 100644 components/ide-problems/pom.xml create mode 100644 components/ide-problems/src/main/java/org/eclipse/dirigible/components/ide/problems/domain/Problem.java create mode 100644 components/ide-problems/src/main/java/org/eclipse/dirigible/components/ide/problems/endpoint/ProblemEndpoint.java create mode 100644 components/ide-problems/src/main/java/org/eclipse/dirigible/components/ide/problems/repository/ProblemRepository.java create mode 100644 components/ide-problems/src/main/java/org/eclipse/dirigible/components/ide/problems/service/ProblemService.java create mode 100644 components/ide-problems/src/test/java/org/eclipse/dirigible/components/ide/problems/endpoint/ProblemsEndpointTest.java create mode 100755 components/ttyd.sh diff --git a/components/api-platform/pom.xml b/components/api-platform/pom.xml index 51c5ae28170..10bdb3a1b5a 100644 --- a/components/api-platform/pom.xml +++ b/components/api-platform/pom.xml @@ -38,6 +38,11 @@ dirigible-components-ide-workspace 8.0.0-SNAPSHOT + + org.eclipse.dirigible + dirigible-components-ide-problems + 8.0.0-SNAPSHOT + diff --git a/components/api-platform/src/main/java/org/eclipse/dirigible/components/api/platform/ProblemsFacade.java b/components/api-platform/src/main/java/org/eclipse/dirigible/components/api/platform/ProblemsFacade.java new file mode 100644 index 00000000000..bd81e944f64 --- /dev/null +++ b/components/api-platform/src/main/java/org/eclipse/dirigible/components/api/platform/ProblemsFacade.java @@ -0,0 +1,187 @@ +/* + * Copyright (c) 2022 SAP SE or an SAP affiliate company and Eclipse Dirigible contributors + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v2.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v20.html + * + * SPDX-FileCopyrightText: 2022 SAP SE or an SAP affiliate company and Eclipse Dirigible contributors + * SPDX-License-Identifier: EPL-2.0 + */ +package org.eclipse.dirigible.components.api.platform; + +import java.util.List; + +import org.eclipse.dirigible.commons.api.helpers.GsonHelper; +import org.eclipse.dirigible.components.ide.problems.domain.Problem; +import org.eclipse.dirigible.components.ide.problems.service.ProblemService; +import org.springframework.beans.factory.InitializingBean; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * The Class ProblemsFacade. + */ +@Component +public class ProblemsFacade implements InitializingBean { + + /** The instance. */ + private static ProblemsFacade INSTANCE; + + /** The problem service. */ + private ProblemService problemService; + + /** + * Instantiates a new problem facade. + * + * @param problemService the problem service + */ + @Autowired + public ProblemsFacade(ProblemService problemService) { + this.problemService = problemService; + } + + /** + * After properties set. + * + * @throws Exception the exception + */ + @Override + public void afterPropertiesSet() throws Exception { + INSTANCE = this; + } + + /** + * Gets the instance. + * + * @return the problem facade + */ + public static ProblemsFacade get() { + return INSTANCE; + } + + /** + * Gets the problem service. + * + * @return the problem service + */ + public ProblemService getProblemService() { + return problemService; + } + + /** + * Save. + * + * @param location the location + * @param type the type + * @param line the line + * @param column the column + * @param cause the cause + * @param expected the expected + * @param category the category + * @param module the module + * @param source the source + * @param program the program + * @throws Exception the exception + */ + public static final void save(String location, String type, String line, String column, String cause, String expected, + String category, String module, String source, String program) throws Exception { + Problem problem = new Problem(location, type, line, column, cause, expected, category, module, source, program); + ProblemsFacade.get().getProblemService().save(problem); + } + + /** + * Find problem. + * + * @param id the id + * @return the string + * @throws Exception the exception + */ + public static final String findProblem(Long id) throws Exception { + return GsonHelper.toJson(ProblemsFacade.get().getProblemService().findById(id)); + } + + /** + * Fetch all problems. + * + * @return the string + * @throws Exception the exception + */ + public static final String fetchAllProblems() throws Exception { + return GsonHelper.toJson(ProblemsFacade.get().getProblemService().getAll()); + } + + /** + * Fetch problems batch. + * + * @param condition the condition + * @param limit the limit + * @return the string + * @throws Exception the exception + */ + public static final String fetchProblemsBatch(String condition, int limit) throws Exception { + return GsonHelper.toJson(ProblemsFacade.get().getProblemService().fetchProblemsBatch(condition, limit)); + } + + /** + * Delete problem. + * + * @param id the id + * @throws Exception the exception + */ + public static final void deleteProblem(Long id) throws Exception { + ProblemsFacade.get().getProblemService().deleteById(id); + } + + /** + * Delete multiple problems by id. + * + * @param ids the ids + * @throws Exception the exception + */ + public static final void deleteMultipleProblemsById(List ids) throws Exception { + ProblemsFacade.get().getProblemService().deleteAllByIds(ids); + } + + /** + * Delete all by status. + * + * @param status the status + * @throws Exception the exception + */ + public static final void deleteAllByStatus(String status) throws Exception { + ProblemsFacade.get().getProblemService().deleteAllByStatus(status); + } + + /** + * Clear all problems. + * + * @throws Exception the exception + */ + public static final void clearAllProblems() throws Exception { + ProblemsFacade.get().getProblemService().deleteAll(); + } + + /** + * Update status. + * + * @param id the id + * @param status the status + * @throws Exception the exception + */ + public static final void updateStatus(Long id, String status) throws Exception { + ProblemsFacade.get().getProblemService().updateStatusById(id, status); + } + + /** + * Update status multiple. + * + * @param ids the ids + * @param status the status + * @throws Exception the exception + */ + public static final void updateStatusMultiple(List ids, String status) throws Exception { + ProblemsFacade.get().getProblemService().updateStatusByIds(ids, status); + } +} diff --git a/components/api-platform/src/main/java/org/eclipse/dirigible/components/api/platform/WorkspaceFacade.java b/components/api-platform/src/main/java/org/eclipse/dirigible/components/api/platform/WorkspaceFacade.java index 69ca5b4fd94..153b2935d5b 100644 --- a/components/api-platform/src/main/java/org/eclipse/dirigible/components/api/platform/WorkspaceFacade.java +++ b/components/api-platform/src/main/java/org/eclipse/dirigible/components/api/platform/WorkspaceFacade.java @@ -58,7 +58,7 @@ public void afterPropertiesSet() throws Exception { /** * Gets the instance. * - * @return the database facade + * @return the workspace facade */ public static WorkspaceFacade get() { return INSTANCE; diff --git a/components/api-platform/src/main/resources/META-INF/dirigible/platform/extensions/modules.js b/components/api-platform/src/main/resources/META-INF/dirigible/platform/extensions/modules.js index 3a2220493a1..74435410906 100644 --- a/components/api-platform/src/main/resources/META-INF/dirigible/platform/extensions/modules.js +++ b/components/api-platform/src/main/resources/META-INF/dirigible/platform/extensions/modules.js @@ -46,7 +46,7 @@ exports.getContent = function () { }, { "name": "platform/workspace", - "description": "Repository API", + "description": "Workspace API", "api": "workspace", "versionedPaths": [ "platform/workspace" @@ -55,12 +55,21 @@ exports.getContent = function () { }, { "name": "platform/engines", - "description": "Repository API", + "description": "Engines API", "api": "engines", "versionedPaths": [ "platform/engines" ], "pathDefault": "platform/engines" + }, + { + "name": "platform/problems", + "description": "Problems API", + "api": "problems", + "versionedPaths": [ + "platform/problems" + ], + "pathDefault": "platform/problems" } ]; }; diff --git a/components/api-platform/src/main/resources/META-INF/dirigible/platform/extensions/modules.json b/components/api-platform/src/main/resources/META-INF/dirigible/platform/extensions/modules.json index 2ef602bc0ea..86fe60850bf 100644 --- a/components/api-platform/src/main/resources/META-INF/dirigible/platform/extensions/modules.json +++ b/components/api-platform/src/main/resources/META-INF/dirigible/platform/extensions/modules.json @@ -34,7 +34,7 @@ }, { "name": "platform/workspace", - "description": "Repository API", + "description": "Workspace API", "api": "workspace", "versionedPaths": [ "platform/workspace" @@ -43,11 +43,20 @@ }, { "name": "platform/engines", - "description": "Repository API", + "description": "Engines API", "api": "engines", "versionedPaths": [ "platform/engines" ], "pathDefault": "platform/engines" + }, + { + "name": "platform/problems", + "description": "Problems API", + "api": "problems", + "versionedPaths": [ + "platform/problems" + ], + "pathDefault": "platform/problems" } ] \ No newline at end of file diff --git a/components/api-platform/src/main/resources/META-INF/dirigible/platform/modules.js b/components/api-platform/src/main/resources/META-INF/dirigible/platform/modules.js index dff5c3307fd..de1e353eebc 100644 --- a/components/api-platform/src/main/resources/META-INF/dirigible/platform/modules.js +++ b/components/api-platform/src/main/resources/META-INF/dirigible/platform/modules.js @@ -34,3 +34,8 @@ exports.getEngines = function() { return engines; }; +exports.getProblems = function() { + const problems = require("platform/problems"); + return problems; +}; + diff --git a/components/api-platform/src/main/resources/META-INF/dirigible/platform/problems.js b/components/api-platform/src/main/resources/META-INF/dirigible/platform/problems.js new file mode 100644 index 00000000000..5dbca2f34a9 --- /dev/null +++ b/components/api-platform/src/main/resources/META-INF/dirigible/platform/problems.js @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2022 SAP SE or an SAP affiliate company and Eclipse Dirigible contributors + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v2.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v20.html + * + * SPDX-FileCopyrightText: 2022 SAP SE or an SAP affiliate company and Eclipse Dirigible contributors + * SPDX-License-Identifier: EPL-2.0 + */ +exports.ACTIVE = "ACTIVE"; +exports.SOLVED = "SOLVED"; +exports.IGNORED = "IGNORED"; + +exports.save = function(location, type, line, column, cause, expected, category, module, source, program) { + org.eclipse.dirigible.components.api.platform.ProblemsFacade.save(location, type, line, column, cause, expected, + category, module, source, program); +}; + +exports.findProblem = function(id) { + returnorg.eclipse.dirigible.components.api.platform.ProblemsFacade.findProblem(id); +}; + +exports.fetchAllProblems = function() { + returnorg.eclipse.dirigible.components.api.platform.ProblemsFacade.fetchAllProblems(); +}; + +exports.fetchProblemsBatch = function(condition, limit) { + returnorg.eclipse.dirigible.components.api.platform.ProblemsFacade.fetchProblemsBatch(condition, limit); +}; + +exports.deleteProblem = function(id) { + org.eclipse.dirigible.components.api.platform.ProblemsFacade.deleteProblem(id); +}; + +exports.deleteAllByStatus = function(status) { + org.eclipse.dirigible.components.api.platform.ProblemsFacade.deleteAllByStatus(status); +}; + +exports.clearAllProblems = function() { + org.eclipse.dirigible.components.api.platform.ProblemsFacade.clearAllProblems(); +}; + +exports.updateStatus = function(id, status) { + org.eclipse.dirigible.components.api.platform.ProblemsFacade.updateStatus(id, status); +}; + +exports.updateStatusMultiple = function(ids, status) { + org.eclipse.dirigible.components.api.platform.ProblemsFacade.updateStatusMultiple(ids, status); +}; \ No newline at end of file diff --git a/components/app-all/pom.xml b/components/app-all/pom.xml index d694a23c769..e41f26d48d5 100644 --- a/components/app-all/pom.xml +++ b/components/app-all/pom.xml @@ -166,11 +166,17 @@ org.eclipse.dirigible dirigible-components-ide-template 8.0.0-SNAPSHOT - + + org.eclipse.dirigible dirigible-components-ide-terminal 8.0.0-SNAPSHOT + + org.eclipse.dirigible + dirigible-components-ide-problems + 8.0.0-SNAPSHOT + diff --git a/components/app-all/src/main/java/org/eclipse/dirigible/DirigibleBasicAuthWebSecurityConfiguration.java b/components/app-all/src/main/java/org/eclipse/dirigible/DirigibleBasicAuthWebSecurityConfiguration.java index 092b1519a1a..cfeac78b9a7 100644 --- a/components/app-all/src/main/java/org/eclipse/dirigible/DirigibleBasicAuthWebSecurityConfiguration.java +++ b/components/app-all/src/main/java/org/eclipse/dirigible/DirigibleBasicAuthWebSecurityConfiguration.java @@ -32,8 +32,8 @@ public class DirigibleBasicAuthWebSecurityConfiguration { @Bean public SecurityFilterChain filterChain(HttpSecurity http) throws Exception { http -// .cors() -// .and() + .cors() + .and() .csrf().disable() .httpBasic() .and() @@ -61,36 +61,36 @@ public InMemoryUserDetailsManager userDetailsService() { return new InMemoryUserDetailsManager(user); } -// @Bean -// public CorsConfigurationSource corsConfigurationSource() { -// CorsConfiguration configuration = new CorsConfiguration(); + @Bean + public CorsConfigurationSource corsConfigurationSource() { + CorsConfiguration configuration = new CorsConfiguration(); // configuration.setAllowedOrigins(Arrays.asList("*")); -//// configuration.setAllowedOriginPatterns(Arrays.asList("*")); -// configuration.setAllowCredentials(false); -// configuration.setAllowedHeaders(Arrays.asList("Access-Control-Allow-Headers","Access-Control-Allow-Origin","Access-Control-Request-Method", "Access-Control-Request-Headers", "Origin", "Cache-Control", "Content-Type", "Authorization")); -// configuration.setExposedHeaders(Arrays.asList("Access-Control-Allow-Headers","Access-Control-Allow-Origin","Access-Control-Request-Method", "Access-Control-Request-Headers", "Origin", "Cache-Control", "Content-Type", "Authorization")); -// configuration.setAllowedMethods(Arrays.asList("HEAD", "DELETE", "GET", "POST", "PATCH", "PUT")); -// UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); -// source.registerCorsConfiguration("/**", configuration); -// return source; -// } + configuration.setAllowedOriginPatterns(Arrays.asList("*")); + configuration.setAllowCredentials(true); + configuration.setAllowedHeaders(Arrays.asList("Access-Control-Allow-Headers","Access-Control-Allow-Origin","Access-Control-Request-Method", "Access-Control-Request-Headers", "Origin", "Cache-Control", "Content-Type", "Authorization")); + configuration.setExposedHeaders(Arrays.asList("Access-Control-Allow-Headers","Access-Control-Allow-Origin","Access-Control-Request-Method", "Access-Control-Request-Headers", "Origin", "Cache-Control", "Content-Type", "Authorization")); + configuration.setAllowedMethods(Arrays.asList("HEAD", "DELETE", "GET", "POST", "PATCH", "PUT")); + UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); + source.registerCorsConfiguration("/**", configuration); + return source; + } - /** - * Cors filter. - * - * @return the filter registration bean - */ - @Bean - public FilterRegistrationBean corsFilter() { - FilterRegistrationBean registrationBean = new FilterRegistrationBean<>(); - - registrationBean.setFilter(new CorsFilter()); - registrationBean.addInitParameter("cors.allowed.origins", "*"); - registrationBean.addInitParameter("cors.allowed.headers", "*"); - registrationBean.addInitParameter("cors.allowed.methods", "GET,PUT,PATCH,POST,DELETE,HEAD,OPTIONS,CONNECT,TRACE"); - registrationBean.addUrlPatterns("/*"); - - return registrationBean; - } +// /** +// * Cors filter. +// * +// * @return the filter registration bean +// */ +// @Bean +// public FilterRegistrationBean corsFilter() { +// FilterRegistrationBean registrationBean = new FilterRegistrationBean<>(); +// +// registrationBean.setFilter(new CorsFilter()); +// registrationBean.addInitParameter("cors.allowed.origins", "*"); +// registrationBean.addInitParameter("cors.allowed.headers", "*"); +// registrationBean.addInitParameter("cors.allowed.methods", "GET,PUT,PATCH,POST,DELETE,HEAD,OPTIONS,CONNECT,TRACE"); +// registrationBean.addUrlPatterns("/*"); +// +// return registrationBean; +// } } diff --git a/components/ide-problems/about.html b/components/ide-problems/about.html new file mode 100644 index 00000000000..d2467877a6e --- /dev/null +++ b/components/ide-problems/about.html @@ -0,0 +1,38 @@ + + + + + + +About + + +

About This Content

+ +

April 25, 2020

+

License

+ +

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise +indicated below, the Content is provided to you under the terms and conditions of the +Eclipse Public License Version 2.0 ("EPL"). A copy of the EPL is available +at http://www.eclipse.org/legal/epl-v20.html. +For purposes of the EPL, "Program" will mean the Content.

+ +

If you did not receive this Content directly from the Eclipse Foundation, the Content is +being redistributed by another party ("Redistributor") and different terms and conditions may +apply to your use of any object code in the Content. Check the Redistributor's license that was +provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise +indicated below, the terms and conditions of the EPL still apply to any source code in the Content +and such source code may be obtained at http://www.eclipse.org.

+ + + diff --git a/components/ide-problems/pom.xml b/components/ide-problems/pom.xml new file mode 100644 index 00000000000..32d6193eb4c --- /dev/null +++ b/components/ide-problems/pom.xml @@ -0,0 +1,51 @@ + + 4.0.0 + + + org.eclipse.dirigible + dirigible-components-parent + 8.0.0-SNAPSHOT + ../pom.xml + + + Components - IDE - Problems + dirigible-components-ide-problems + jar + + + + + + org.eclipse.dirigible + dirigible-components-core-base + 8.0.0-SNAPSHOT + + + org.eclipse.dirigible + dirigible-components-core-database + 8.0.0-SNAPSHOT + + + + + org.eclipse.dirigible + dirigible-components-api-security + 8.0.0-SNAPSHOT + + + + + org.eclipse.dirigible + dirigible-components-unit-security + 8.0.0-SNAPSHOT + test + + + + + + ../../licensing-header.txt + + + diff --git a/components/ide-problems/src/main/java/org/eclipse/dirigible/components/ide/problems/domain/Problem.java b/components/ide-problems/src/main/java/org/eclipse/dirigible/components/ide/problems/domain/Problem.java new file mode 100644 index 00000000000..5380f92e2ae --- /dev/null +++ b/components/ide-problems/src/main/java/org/eclipse/dirigible/components/ide/problems/domain/Problem.java @@ -0,0 +1,407 @@ +/* + * Copyright (c) 2022 SAP SE or an SAP affiliate company and Eclipse Dirigible contributors + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v2.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v20.html + * + * SPDX-FileCopyrightText: 2022 SAP SE or an SAP affiliate company and Eclipse Dirigible contributors + * SPDX-License-Identifier: EPL-2.0 + */ +package org.eclipse.dirigible.components.ide.problems.domain; + +import java.sql.Timestamp; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Table; +import javax.persistence.UniqueConstraint; + +import org.eclipse.dirigible.components.api.security.UserFacade; + +/** + * The Class Problem. + */ +@Entity +@Table(name = "DIRIGIBLE_PROBLEMS", uniqueConstraints= + @UniqueConstraint(columnNames={"PROBLEM_LOCATION", "PROBLEM_TYPE", "PROBLEM_LINE", "PROBLEM_COLUMN"})) +public class Problem { + + /** + * Always on insert. + */ + public static final String ACTIVE = "ACTIVE"; + /** + * Marked by the user as solved. + */ + public static final String SOLVED = "SOLVED"; + /** + * Marked by the user as ignored. + */ + public static final String IGNORED = "IGNORED"; + + /** The id. */ + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "PROBLEM_ID", columnDefinition = "BIGINT", nullable = false) + private Long id; + + /** The location. */ + @Column(name = "PROBLEM_LOCATION", columnDefinition = "VARCHAR", nullable = false, length = 512) + private String location; + + /** The type. */ + @Column(name = "PROBLEM_TYPE", columnDefinition = "VARCHAR", nullable = false, length = 32) + private String type; + + /** The line. */ + @Column(name = "PROBLEM_LINE", columnDefinition = "VARCHAR", nullable = false, length = 11) + private String line; + + /** The column. */ + @Column(name = "PROBLEM_COLUMN", columnDefinition = "VARCHAR", nullable = false, length = 11) + private String column; + + /** The cause. */ + @Column(name = "PROBLEM_CAUSE", columnDefinition = "VARCHAR", nullable = false, length = 1024) + private String cause; + + /** The expected. */ + @Column(name = "PROBLEM_EXPECTED", columnDefinition = "VARCHAR", nullable = false, length = 512) + private String expected; + + /** The created at. */ + @Column(name = "PROBLEM_CREATED_AT", columnDefinition = "TIMESTAMP", nullable = false) + private Timestamp createdAt; + + /** The created by. */ + @Column(name = "PROBLEM_CREATED_BY", columnDefinition = "VARCHAR", nullable = false, length = 32) + private String createdBy; + + /** The category. */ + @Column(name = "PROBLEM_CATEGORY", columnDefinition = "VARCHAR", nullable = false, length = 32) + private String category; + + /** The module. */ + @Column(name = "PROBLEM_MODULE", columnDefinition = "VARCHAR", nullable = false, length = 32) + private String module; + + /** The source. */ + @Column(name = "PROBLEM_SOURCE", columnDefinition = "VARCHAR", nullable = false, length = 32) + private String source; + + /** The program. */ + @Column(name = "PROBLEM_PROGRAM", columnDefinition = "VARCHAR", nullable = false, length = 32) + private String program; + + /** The status. */ + @Column(name = "PROBLEM_STATUS", columnDefinition = "VARCHAR", nullable = false, length = 8) + private String status; + + /** + * Instantiates a new problem. + */ + public Problem() { + } + + /** + * Instantiates a new problem. + * + * @param location the location + * @param type the type + * @param line the line + * @param column the column + * @param cause the cause + * @param expected the expected + * @param category the category + * @param module the module + * @param source the source + * @param program the program + */ + public Problem(String location, String type, String line, String column, String cause, String expected, + String category, String module, String source, String program) { + this.location = location; + this.type = type; + this.line = line; + this.column = column; + this.cause = cause; + this.expected = expected; + this.createdAt = new Timestamp(System.currentTimeMillis()); + this.createdBy = UserFacade.getName(); + this.category = category; + this.module = module; + this.source = source; + this.program = program; + this.status = ACTIVE; + } + + /** + * Gets the id. + * + * @return the id + */ + public Long getId() { + return id; + } + + /** + * Sets the id. + * + * @param id the id to set + */ + public void setId(Long id) { + this.id = id; + } + + /** + * Gets the location. + * + * @return the location + */ + public String getLocation() { + return location; + } + + /** + * Sets the location. + * + * @param location the location to set + */ + public void setLocation(String location) { + this.location = location; + } + + /** + * Gets the type. + * + * @return the type + */ + public String getType() { + return type; + } + + /** + * Sets the type. + * + * @param type the type to set + */ + public void setType(String type) { + this.type = type; + } + + /** + * Gets the line. + * + * @return the line + */ + public String getLine() { + return line; + } + + /** + * Sets the line. + * + * @param line the line to set + */ + public void setLine(String line) { + this.line = line; + } + + /** + * Gets the column. + * + * @return the column + */ + public String getColumn() { + return column; + } + + /** + * Sets the column. + * + * @param column the column to set + */ + public void setColumn(String column) { + this.column = column; + } + + /** + * Gets the cause. + * + * @return the cause + */ + public String getCause() { + return cause; + } + + /** + * Sets the cause. + * + * @param cause the cause to set + */ + public void setCause(String cause) { + this.cause = cause; + } + + /** + * Gets the expected. + * + * @return the expected + */ + public String getExpected() { + return expected; + } + + /** + * Sets the expected. + * + * @param expected the expected to set + */ + public void setExpected(String expected) { + this.expected = expected; + } + + /** + * Gets the created at. + * + * @return the createdAt + */ + public Timestamp getCreatedAt() { + return createdAt; + } + + /** + * Sets the created at. + * + * @param createdAt the createdAt to set + */ + public void setCreatedAt(Timestamp createdAt) { + this.createdAt = createdAt; + } + + /** + * Gets the created by. + * + * @return the createdBy + */ + public String getCreatedBy() { + return createdBy; + } + + /** + * Sets the created by. + * + * @param createdBy the createdBy to set + */ + public void setCreatedBy(String createdBy) { + this.createdBy = createdBy; + } + + /** + * Gets the category. + * + * @return the category + */ + public String getCategory() { + return category; + } + + /** + * Sets the category. + * + * @param category the category to set + */ + public void setCategory(String category) { + this.category = category; + } + + /** + * Gets the module. + * + * @return the module + */ + public String getModule() { + return module; + } + + /** + * Sets the module. + * + * @param module the module to set + */ + public void setModule(String module) { + this.module = module; + } + + /** + * Gets the source. + * + * @return the source + */ + public String getSource() { + return source; + } + + /** + * Sets the source. + * + * @param source the source to set + */ + public void setSource(String source) { + this.source = source; + } + + /** + * Gets the program. + * + * @return the program + */ + public String getProgram() { + return program; + } + + /** + * Sets the program. + * + * @param program the program to set + */ + public void setProgram(String program) { + this.program = program; + } + + /** + * Gets the status. + * + * @return the status + */ + public String getStatus() { + return status; + } + + /** + * Sets the status. + * + * @param status the status to set + */ + public void setStatus(String status) { + this.status = status; + } + + /** + * To string. + * + * @return the string + */ + @Override + public String toString() { + return "Problem [id=" + id + ", location=" + location + ", type=" + type + ", line=" + line + ", column=" + + column + ", cause=" + cause + ", expected=" + expected + ", createdAt=" + createdAt + ", createdBy=" + + createdBy + ", category=" + category + ", module=" + module + ", source=" + source + ", program=" + + program + ", status=" + status + "]"; + } + +} diff --git a/components/ide-problems/src/main/java/org/eclipse/dirigible/components/ide/problems/endpoint/ProblemEndpoint.java b/components/ide-problems/src/main/java/org/eclipse/dirigible/components/ide/problems/endpoint/ProblemEndpoint.java new file mode 100644 index 00000000000..e3ea3264ffc --- /dev/null +++ b/components/ide-problems/src/main/java/org/eclipse/dirigible/components/ide/problems/endpoint/ProblemEndpoint.java @@ -0,0 +1,125 @@ +/* + * Copyright (c) 2022 SAP SE or an SAP affiliate company and Eclipse Dirigible contributors + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v2.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v20.html + * + * SPDX-FileCopyrightText: 2022 SAP SE or an SAP affiliate company and Eclipse Dirigible contributors + * SPDX-License-Identifier: EPL-2.0 + */ +package org.eclipse.dirigible.components.ide.problems.endpoint; + +import java.util.List; + +import org.eclipse.dirigible.components.base.endpoint.BaseEndpoint; +import org.eclipse.dirigible.components.ide.problems.domain.Problem; +import org.eclipse.dirigible.components.ide.problems.service.ProblemService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +/** + * The Class ProblemEndpoint. + */ +@RestController +@RequestMapping(BaseEndpoint.PREFIX_ENDPOINT_IDE + "problems") +public class ProblemEndpoint extends BaseEndpoint { + + /** The problem service. */ + private final ProblemService problemService; + + /** + * Instantiates a new problem endpoint. + * + * @param problemService the problem service + */ + @Autowired + public ProblemEndpoint(ProblemService problemService) { + this.problemService = problemService; + } + + /** + * List problems. + * + * @return the response entity + * @throws Exception the exception + */ + @GetMapping(produces = "application/json") + public ResponseEntity> listProblems() throws Exception { + return ResponseEntity.ok(problemService.getAll()); + } + + /** + * List all the problems currently registered. + * + * @param condition the condition + * @param limit the limit + * @return the response + * @throws Exception the scheduler exception + */ + @GetMapping(value = "/search", produces = "application/json") + public ResponseEntity> fetchProblemsBatch(@RequestParam("condition") String condition, @RequestParam("limit") int limit) throws Exception { + return ResponseEntity.ok(problemService.fetchProblemsBatch(condition, limit)); + } + + /** + * Updates the status of all selected problems. + * + * @param status the status + * @param selectedIds the selected ids + * @return the complete list of problems after the update + * @throws Exception the scheduler exception + */ + @PostMapping(value = "/update/{status}", produces = "application/json", consumes = "application/json") + public ResponseEntity updateStatus(@PathVariable("status") String status, List selectedIds) throws Exception { + problemService.updateStatusByIds(selectedIds, status); + return ResponseEntity.noContent().build(); + } + + /** + * Deletes all problems by their status. + * + * @param status the status + * @return the response + * @throws Exception the scheduler exception + */ + @DeleteMapping(value = "/delete/{status}", produces = "application/json") + public ResponseEntity deleteProblemsByStatus(@PathVariable("status") String status) throws Exception { + problemService.deleteAllByStatus(status); + return ResponseEntity.noContent().build(); + } + + /** + * Deletes all problems. + *s + * @return the response + * @throws Exception the scheduler exception + */ + @DeleteMapping(value = "/clear", produces = "application/json") + public ResponseEntity clearProblems() throws Exception { + problemService.deleteAll(); + return ResponseEntity.noContent().build(); + } + + /** + * Deletes all selected problems. + * + * @param selectedIds the selected ids + * @return the response + * @throws Exception the scheduler exception + */ + @PostMapping(value = "/delete/selected", produces = "application/json", consumes = "application/json") + public ResponseEntity deleteMultipleProblems(List selectedIds) throws Exception { + problemService.deleteAllByIds(selectedIds); + return ResponseEntity.noContent().build(); + } + +} diff --git a/components/ide-problems/src/main/java/org/eclipse/dirigible/components/ide/problems/repository/ProblemRepository.java b/components/ide-problems/src/main/java/org/eclipse/dirigible/components/ide/problems/repository/ProblemRepository.java new file mode 100644 index 00000000000..6957936ceda --- /dev/null +++ b/components/ide-problems/src/main/java/org/eclipse/dirigible/components/ide/problems/repository/ProblemRepository.java @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2022 SAP SE or an SAP affiliate company and Eclipse Dirigible contributors + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v2.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v20.html + * + * SPDX-FileCopyrightText: 2022 SAP SE or an SAP affiliate company and Eclipse Dirigible contributors + * SPDX-License-Identifier: EPL-2.0 + */ +package org.eclipse.dirigible.components.ide.problems.repository; + +import java.util.List; + +import org.eclipse.dirigible.components.ide.problems.domain.Problem; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.Query; +import org.springframework.data.repository.query.Param; +import org.springframework.stereotype.Repository; + +/** + * The Interface ProblemRepository. + */ +@Repository("problemRepository") +public interface ProblemRepository extends JpaRepository { + + /** + * Fetch problems batch. + * + * @param condition the condition + * @param limit the limit + * @return the list + */ + @Query(value = "SELECT * FROM DIRIGIBLE_PROBLEMS " + + "WHERE " + + "PROBLEM_LOCATION LIKE :condition " + + "OR PROBLEM_TYPE LIKE :condition " + + "OR PROBLEM_LINE LIKE :condition " + + "OR PROBLEM_COLUMN LIKE :condition " + + "OR PROBLEM_CAUSE LIKE :condition " + + "OR PROBLEM_CREATED_BY LIKE :condition " + + "OR PROBLEM_CATEGORY LIKE :condition " + + "OR PROBLEM_MODULE LIKE :condition " + + "OR PROBLEM_SOURCE LIKE :condition " + + "OR PROBLEM_PROGRAM LIKE :condition " + + "OR PROBLEM_STATUS LIKE :condition " + + "LIMIT :limit", nativeQuery = true) + List findProblemsByConditionAndLimit(@Param("condition") String condition, @Param("limit") int limit); + +} diff --git a/components/ide-problems/src/main/java/org/eclipse/dirigible/components/ide/problems/service/ProblemService.java b/components/ide-problems/src/main/java/org/eclipse/dirigible/components/ide/problems/service/ProblemService.java new file mode 100644 index 00000000000..866a7af89fd --- /dev/null +++ b/components/ide-problems/src/main/java/org/eclipse/dirigible/components/ide/problems/service/ProblemService.java @@ -0,0 +1,178 @@ +/* + * Copyright (c) 2022 SAP SE or an SAP affiliate company and Eclipse Dirigible contributors + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v2.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v20.html + * + * SPDX-FileCopyrightText: 2022 SAP SE or an SAP affiliate company and Eclipse Dirigible contributors + * SPDX-License-Identifier: EPL-2.0 + */ +package org.eclipse.dirigible.components.ide.problems.service; + +import java.util.List; +import java.util.Optional; + +import org.eclipse.dirigible.components.ide.problems.domain.Problem; +import org.eclipse.dirigible.components.ide.problems.repository.ProblemRepository; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.domain.Example; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * The Class ProblemService. + */ +@Service +@Transactional +public class ProblemService { + + /** The problem repository. */ + @Autowired + private ProblemRepository problemRepository; + + /** + * Gets the all. + * + * @return the all + */ + @Transactional(readOnly = true) + public List getAll() { + return problemRepository.findAll(); + } + + /** + * Find all. + * + * @param pageable the pageable + * @return the page + */ + @Transactional(readOnly = true) + public Page getPages(Pageable pageable) { + return problemRepository.findAll(pageable); + } + + /** + * Find by id. + * + * @param id the id + * @return the problem + */ + @Transactional(readOnly = true) + public Problem findById(Long id) { + Optional problem = problemRepository.findById(id); + if (problem.isPresent()) { + return problem.get(); + } else { + throw new IllegalArgumentException("Problem with id does not exist: " + id); + } + } + + /** + * Save. + * + * @param problem the problem + * @return the problem + */ + public Problem save(Problem problem) { + return problemRepository.saveAndFlush(problem); + } + + /** + * Delete. + * + * @param problem the problem + */ + public void delete(Problem problem) { + problemRepository.delete(problem); + } + + /** + * Delete. + * + */ + public void deleteAll() { + problemRepository.deleteAll(); + } + + /** + * Delete by id. + * + * @param id the id + */ + public void deleteById(Long id) { + problemRepository.deleteById(id); + } + + /** + * Delete by ids. + * + * @param ids the ids + */ + public void deleteAllByIds(List ids) { + problemRepository.deleteAllById(ids); + } + + /** + * Delete all by status. + * + * @param status the status + */ + public void deleteAllByStatus(String status) { + Problem filter = new Problem(); + filter.setStatus(status); + Example example = Example.of(filter); + List problems = problemRepository.findAll(example); + problems.forEach(p -> deleteById(p.getId())); + } + + /** + * Update status by id. + * + * @param id the id + * @param status the status + */ + public void updateStatusById(Long id, String status) { + Problem filter = new Problem(); + filter.setStatus(status); + Example example = Example.of(filter); + Optional problem = problemRepository.findOne(example); + if (problem.isPresent()) { + Problem existing = problem.get(); + existing.setStatus(status); + save(existing); + } + } + + /** + * Update status by ids. + * + * @param id the id + * @param status the status + */ + public void updateStatusByIds(List id, String status) { + Problem filter = new Problem(); + filter.setStatus(status); + Example example = Example.of(filter); + List problems = problemRepository.findAll(example); + problems.forEach(p -> { + p.setStatus(status); + save(p); + }); + } + + /** + * Fetch problems batch. + * + * @param condition the condition + * @param limit the limit + * @return the list + */ + public List fetchProblemsBatch(String condition, int limit) { + return problemRepository.findProblemsByConditionAndLimit(condition, limit); + } + +} diff --git a/components/ide-problems/src/test/java/org/eclipse/dirigible/components/ide/problems/endpoint/ProblemsEndpointTest.java b/components/ide-problems/src/test/java/org/eclipse/dirigible/components/ide/problems/endpoint/ProblemsEndpointTest.java new file mode 100644 index 00000000000..57dde07cdc0 --- /dev/null +++ b/components/ide-problems/src/test/java/org/eclipse/dirigible/components/ide/problems/endpoint/ProblemsEndpointTest.java @@ -0,0 +1,121 @@ +/* + * Copyright (c) 2022 SAP SE or an SAP affiliate company and Eclipse Dirigible contributors + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v2.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v20.html + * + * SPDX-FileCopyrightText: 2022 SAP SE or an SAP affiliate company and Eclipse Dirigible contributors + * SPDX-License-Identifier: EPL-2.0 + */ +package org.eclipse.dirigible.components.ide.problems.endpoint; + +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.print; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +import javax.persistence.EntityManager; + +import org.eclipse.dirigible.components.ide.problems.domain.Problem; +import org.eclipse.dirigible.components.ide.problems.repository.ProblemRepository; +import org.eclipse.dirigible.components.ide.problems.service.ProblemService; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.autoconfigure.domain.EntityScan; +import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.data.domain.PageRequest; +import org.springframework.data.domain.Pageable; +import org.springframework.security.test.context.support.WithMockUser; +import org.springframework.security.web.FilterChainProxy; +import org.springframework.test.context.junit.jupiter.SpringExtension; +import org.springframework.test.web.servlet.MockMvc; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.context.WebApplicationContext; + +@WithMockUser +@ExtendWith(SpringExtension.class) +@SpringBootTest +@AutoConfigureMockMvc +@ComponentScan(basePackages = { "org.eclipse.dirigible.components" }) +@EntityScan("org.eclipse.dirigible.components") +@Transactional +public class ProblemsEndpointTest { + + @Autowired + private EntityManager entityManager; + + @Autowired + private ProblemService problemService; + + @Autowired + private ProblemRepository problemRepository; + + @Autowired + private MockMvc mockMvc; + + @Autowired + protected WebApplicationContext wac; + + @Autowired + private FilterChainProxy springSecurityFilterChain; + + @BeforeEach + public void setup() throws Exception { + + cleanup(); + + problemService.save(createProblem("location1", "type1", "line1", "column1", "cause1", "expected1", + "category1", "module1", "source1", "program1")); + problemService.save(createProblem("location2", "type2", "line2", "column2", "cause2", "expected2", + "category2", "module2", "source2", "program2")); + + } + + @AfterEach + public void cleanup() throws Exception { + + } + + @Test + public void findAllProblems() { + Integer size = 10; + Integer page = 0; + Pageable pageable = PageRequest.of(page, size); + assertNotNull(problemService.getPages(pageable)); + } + + @Test + public void getProblems() throws Exception { + mockMvc.perform(get("/services/ide/problems/")) + .andDo(print()) + .andExpect(status().is2xxSuccessful()) + ; + } + + @Test + public void getProblemsByCondition() throws Exception { + mockMvc.perform(get("/services/ide/problems/search?condition=co&limit=5")) + .andDo(print()) + .andExpect(status().is2xxSuccessful()) + ; + } + + public static Problem createProblem(String location, String type, String line, String column, String cause, String expected, + String category, String module, String source, String program) { + Problem problem = new Problem(location, type, line, column, cause, expected, + category, module, source, program); + return problem; + } + + @SpringBootApplication + static class TestConfiguration { + } +} diff --git a/components/ide-ui-problems/src/main/resources/META-INF/dirigible/ide-problems/js/problems.js b/components/ide-ui-problems/src/main/resources/META-INF/dirigible/ide-problems/js/problems.js index 5654828dbee..85ddfd12cc7 100644 --- a/components/ide-ui-problems/src/main/resources/META-INF/dirigible/ide-problems/js/problems.js +++ b/components/ide-ui-problems/src/main/resources/META-INF/dirigible/ide-problems/js/problems.js @@ -33,7 +33,7 @@ problemsView.controller('ProblemsController', ['$http', '$timeout', 'messageHub' return; } - $http.get('/services/ops/problems/search', { params: { 'condition': this.filterBy, 'limit': limit } }) + $http.get('/services/ide/problems/search', { params: { 'condition': this.filterBy, 'limit': limit } }) .then((response) => { const { result, totalRows } = response.data; const pageItems = result.slice(startIndex);// to be removed when the pagination is fixed @@ -138,7 +138,7 @@ problemsView.controller('ProblemsController', ['$http', '$timeout', 'messageHub' }, []); if (selectedIds.length > 0) { - $http.post('/services/ops/problems/delete/selected', selectedIds).then(() => { + $http.post('/services/ide/problems/delete/selected', selectedIds).then(() => { fetchData(); }); } diff --git a/components/ide-ui-problems/src/main/resources/META-INF/dirigible/ide-problems/project.json b/components/ide-ui-problems/src/main/resources/META-INF/dirigible/ide-problems/project.json index 88e17f45fcd..5054bd3f7cd 100644 --- a/components/ide-ui-problems/src/main/resources/META-INF/dirigible/ide-problems/project.json +++ b/components/ide-ui-problems/src/main/resources/META-INF/dirigible/ide-problems/project.json @@ -1,8 +1,3 @@ { - "guid": "ide-problems", - "repository": { - "type": "git", - "branch": "master", - "url": "https://github.com/dirigiblelabs/ide-problems.git" - } + "guid": "ide-problems" } \ No newline at end of file diff --git a/components/pom.xml b/components/pom.xml index 4ee37255869..4845ff1c5b1 100644 --- a/components/pom.xml +++ b/components/pom.xml @@ -52,6 +52,7 @@ ide-console ide-template ide-terminal + ide-problems ide-ui-about diff --git a/components/ttyd.sh b/components/ttyd.sh new file mode 100755 index 00000000000..25c7ada267c --- /dev/null +++ b/components/ttyd.sh @@ -0,0 +1 @@ +ttyd -p 9000 bash \ No newline at end of file diff --git a/components/unit-jobs/src/main/java/org/eclipse/dirigible/components/jobs/repository/JobEmailRepository.java b/components/unit-jobs/src/main/java/org/eclipse/dirigible/components/jobs/repository/JobEmailRepository.java index fa328de4608..7a60f760d00 100644 --- a/components/unit-jobs/src/main/java/org/eclipse/dirigible/components/jobs/repository/JobEmailRepository.java +++ b/components/unit-jobs/src/main/java/org/eclipse/dirigible/components/jobs/repository/JobEmailRepository.java @@ -19,4 +19,6 @@ * The Interface JobEmailRepository. */ @Repository("jobEmailDefinitionRepository") -public interface JobEmailRepository extends JpaRepository {} +public interface JobEmailRepository extends JpaRepository { + +} diff --git a/components/unit-jobs/src/main/java/org/eclipse/dirigible/components/jobs/repository/JobLogRepository.java b/components/unit-jobs/src/main/java/org/eclipse/dirigible/components/jobs/repository/JobLogRepository.java index 70e8a6a4ed6..67b9b781ef2 100644 --- a/components/unit-jobs/src/main/java/org/eclipse/dirigible/components/jobs/repository/JobLogRepository.java +++ b/components/unit-jobs/src/main/java/org/eclipse/dirigible/components/jobs/repository/JobLogRepository.java @@ -19,4 +19,6 @@ * The Interface JobLogRepository. */ @Repository("jobsLogsRepository") -public interface JobLogRepository extends JpaRepository {} +public interface JobLogRepository extends JpaRepository { + +} diff --git a/components/unit-jobs/src/main/java/org/eclipse/dirigible/components/jobs/repository/JobParameterRepository.java b/components/unit-jobs/src/main/java/org/eclipse/dirigible/components/jobs/repository/JobParameterRepository.java index 8775c3f0de6..718c9fae1ba 100644 --- a/components/unit-jobs/src/main/java/org/eclipse/dirigible/components/jobs/repository/JobParameterRepository.java +++ b/components/unit-jobs/src/main/java/org/eclipse/dirigible/components/jobs/repository/JobParameterRepository.java @@ -19,4 +19,6 @@ * The Interface JobParameterRepository. */ @Repository("jobsParameterRepository") -public interface JobParameterRepository extends JpaRepository {} +public interface JobParameterRepository extends JpaRepository { + +} diff --git a/components/unit-jobs/src/main/java/org/eclipse/dirigible/components/jobs/repository/JobRepository.java b/components/unit-jobs/src/main/java/org/eclipse/dirigible/components/jobs/repository/JobRepository.java index 6f7b07d8246..4d1dcb00d0b 100644 --- a/components/unit-jobs/src/main/java/org/eclipse/dirigible/components/jobs/repository/JobRepository.java +++ b/components/unit-jobs/src/main/java/org/eclipse/dirigible/components/jobs/repository/JobRepository.java @@ -19,4 +19,6 @@ * The Interface JobRepository. */ @Repository("jobsRepository") -public interface JobRepository extends JpaRepository {} +public interface JobRepository extends JpaRepository { + +} diff --git a/components/unit-jobs/src/main/java/org/eclipse/dirigible/components/jobs/service/JobService.java b/components/unit-jobs/src/main/java/org/eclipse/dirigible/components/jobs/service/JobService.java index 4805212a6be..47011deaedb 100644 --- a/components/unit-jobs/src/main/java/org/eclipse/dirigible/components/jobs/service/JobService.java +++ b/components/unit-jobs/src/main/java/org/eclipse/dirigible/components/jobs/service/JobService.java @@ -18,7 +18,6 @@ import java.util.Map; import java.util.Optional; -import org.eclipse.dirigible.commons.api.helpers.NameValuePair; import org.eclipse.dirigible.commons.config.Configuration; import org.eclipse.dirigible.components.base.artefact.ArtefactService; import org.eclipse.dirigible.components.engine.javascript.service.JavascriptService;