work in progress
This commit is contained in:
parent
e460b26abb
commit
c1808d7e9b
41 changed files with 349 additions and 393 deletions
|
|
@ -145,6 +145,12 @@
|
|||
<dependency>
|
||||
<groupId>com.vaadin</groupId>
|
||||
<artifactId>vaadin-spring-boot-starter</artifactId>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.vaadin.olli</groupId>
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.autoconfigure.domain.EntityScan;
|
||||
import org.springframework.boot.builder.SpringApplicationBuilder;
|
||||
import org.springframework.boot.context.event.ApplicationReadyEvent;
|
||||
import org.springframework.boot.web.servlet.MultipartConfigFactory;
|
||||
|
|
@ -20,10 +21,12 @@ import org.springframework.boot.web.servlet.ServletRegistrationBean;
|
|||
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.PropertySource;
|
||||
import org.springframework.context.event.EventListener;
|
||||
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
|
||||
import org.springframework.jms.annotation.EnableJms;
|
||||
import org.springframework.jms.core.JmsTemplate;
|
||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
||||
|
|
@ -38,13 +41,15 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2;
|
|||
|
||||
import javax.servlet.MultipartConfigElement;
|
||||
|
||||
@Configuration
|
||||
//@Configuration
|
||||
@SpringBootApplication
|
||||
@EnableJpaRepositories("org.chtijbug.drools.proxy.persistence.repository")
|
||||
@Configuration
|
||||
@EnableJpaRepositories(basePackages = "org.chtijbug.drools.proxy.persistence.repository")
|
||||
@ComponentScan({"org.chtijbug"})
|
||||
@EntityScan("org.chtijbug.drools.proxy.persistence.model")
|
||||
@PropertySource("classpath:application.properties")
|
||||
@EnableSwagger2
|
||||
@EnableScheduling
|
||||
@EnableTransactionManagement
|
||||
@EnableJms
|
||||
public class DroolsSpringBootConsoleApplication extends SpringBootServletInitializer {
|
||||
|
||||
|
||||
|
|
@ -57,8 +62,8 @@ public class DroolsSpringBootConsoleApplication extends SpringBootServletInitial
|
|||
private ActiveMQXAConnectionFactory connectionFactory;
|
||||
|
||||
|
||||
@Autowired
|
||||
private DababaseContentUpdate dababaseContentUpdate;
|
||||
//@Autowired
|
||||
//private DababaseContentUpdate dababaseContentUpdate;
|
||||
@Autowired
|
||||
private KieBusinessCentralConnector kieBusinessCentralConnector;
|
||||
@Autowired
|
||||
|
|
@ -83,7 +88,6 @@ public class DroolsSpringBootConsoleApplication extends SpringBootServletInitial
|
|||
}
|
||||
|
||||
@Bean
|
||||
|
||||
public MultipartConfigElement multipartConfigElement() {
|
||||
|
||||
MultipartConfigFactory factory = new MultipartConfigFactory();
|
||||
|
|
@ -132,58 +136,7 @@ public class DroolsSpringBootConsoleApplication extends SpringBootServletInitial
|
|||
return jmsTemplate;
|
||||
}
|
||||
|
||||
@EventListener(ApplicationReadyEvent.class)
|
||||
public void initPlatform(){
|
||||
dababaseContentUpdate.initDatabaseIfNecessary();
|
||||
/**
|
||||
for (KieWorkbench kieWorkbench: kieWorkbenchRepository.findAll()) {
|
||||
Map<String, KieContainerResource> kies = new HashMap<>();
|
||||
KieServerSetup kieServerSetup = kieBusinessCentralConnector.connectToBusinessCentral("nheron", "adminnheron00@", kieWorkbench.getName(),kieWorkbench.getExternalUrl());
|
||||
if (kieServerSetup != null && kieServerSetup.getContainers() != null) {
|
||||
for (KieContainerResource kieContainerResource : kieServerSetup.getContainers()) {
|
||||
kies.put(kieContainerResource.getContainerId(), kieContainerResource);
|
||||
}
|
||||
}
|
||||
List<ProjectPersist> projectRepositories = projectRepository.findByKieWorkbench(kieWorkbench);
|
||||
if (!projectRepositories.isEmpty()){
|
||||
for (ProjectPersist projectPersist : projectRepository.findAll()) {
|
||||
if (projectPersist.getServerNames().size() > 0) {
|
||||
if (!kies.containsKey(projectPersist.getArtifactID()+"_"+projectPersist.getProjectVersion())) {
|
||||
kieBusinessCentralConnector.createContainer("nheron", "adminnheron00@", projectPersist,kieWorkbench.getExternalUrl());
|
||||
} else {
|
||||
kieBusinessCentralConnector.updateContainer("nheron", "adminnheron00@", projectPersist, kies.get(projectPersist.getArtifactID()+"_"+projectPersist.getProjectVersion()),kieWorkbench.getExternalUrl());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
for (ProjectPersist projectPersist : projectRepository.findAll()) {
|
||||
if (projectPersist.getServerNames().size() > 0) {
|
||||
if (!kies.containsKey(projectPersist.getContainerID())) {
|
||||
kieBusinessCentralConnector.createContainer("nheron", "adminnheron00@", projectPersist);
|
||||
} else {
|
||||
kieBusinessCentralConnector.updateContainer("nheron", "adminnheron00@", projectPersist, kies.get(projectPersist.getContainerID()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ServerInstanceKeyList serverInstanceKeyList = kieBusinessCentralConnector.getListInstances("nheron", "adminnheron00@");
|
||||
if (serverInstanceKeyList != null) {
|
||||
for (ServerInstanceKey serverInstanceKey : serverInstanceKeyList.getServerInstanceKeys()) {
|
||||
String serverInstanceId = serverInstanceKey.getServerInstanceId();
|
||||
ContainerList containerList = kieBusinessCentralConnector.getListContainers("nheron", "adminnheron00@", serverInstanceId);
|
||||
System.out.println("coucou");
|
||||
for (Container container : containerList.getContainers()) {
|
||||
|
||||
}
|
||||
}
|
||||
System.out.println("coucou");
|
||||
}
|
||||
System.out.println("coucou");
|
||||
|
||||
}
|
||||
**/
|
||||
}
|
||||
|
||||
@Bean
|
||||
public Docket api() {
|
||||
|
|
|
|||
|
|
@ -14,6 +14,8 @@ import org.drools.workbench.models.guided.template.backend.RuleTemplateModelXMLP
|
|||
import org.drools.workbench.models.guided.template.shared.TemplateModel;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.boot.context.event.ApplicationReadyEvent;
|
||||
import org.springframework.context.event.EventListener;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
|
@ -248,5 +250,56 @@ public class DababaseContentUpdate {
|
|||
}
|
||||
|
||||
}
|
||||
@EventListener(ApplicationReadyEvent.class)
|
||||
public void initPlatform(){
|
||||
this.initDatabaseIfNecessary();
|
||||
/**
|
||||
for (KieWorkbench kieWorkbench: kieWorkbenchRepository.findAll()) {
|
||||
Map<String, KieContainerResource> kies = new HashMap<>();
|
||||
KieServerSetup kieServerSetup = kieBusinessCentralConnector.connectToBusinessCentral("nheron", "adminnheron00@", kieWorkbench.getName(),kieWorkbench.getExternalUrl());
|
||||
if (kieServerSetup != null && kieServerSetup.getContainers() != null) {
|
||||
for (KieContainerResource kieContainerResource : kieServerSetup.getContainers()) {
|
||||
kies.put(kieContainerResource.getContainerId(), kieContainerResource);
|
||||
}
|
||||
}
|
||||
List<ProjectPersist> projectRepositories = projectRepository.findByKieWorkbench(kieWorkbench);
|
||||
if (!projectRepositories.isEmpty()){
|
||||
for (ProjectPersist projectPersist : projectRepository.findAll()) {
|
||||
if (projectPersist.getServerNames().size() > 0) {
|
||||
if (!kies.containsKey(projectPersist.getArtifactID()+"_"+projectPersist.getProjectVersion())) {
|
||||
kieBusinessCentralConnector.createContainer("nheron", "adminnheron00@", projectPersist,kieWorkbench.getExternalUrl());
|
||||
} else {
|
||||
kieBusinessCentralConnector.updateContainer("nheron", "adminnheron00@", projectPersist, kies.get(projectPersist.getArtifactID()+"_"+projectPersist.getProjectVersion()),kieWorkbench.getExternalUrl());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
for (ProjectPersist projectPersist : projectRepository.findAll()) {
|
||||
if (projectPersist.getServerNames().size() > 0) {
|
||||
if (!kies.containsKey(projectPersist.getContainerID())) {
|
||||
kieBusinessCentralConnector.createContainer("nheron", "adminnheron00@", projectPersist);
|
||||
} else {
|
||||
kieBusinessCentralConnector.updateContainer("nheron", "adminnheron00@", projectPersist, kies.get(projectPersist.getContainerID()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ServerInstanceKeyList serverInstanceKeyList = kieBusinessCentralConnector.getListInstances("nheron", "adminnheron00@");
|
||||
if (serverInstanceKeyList != null) {
|
||||
for (ServerInstanceKey serverInstanceKey : serverInstanceKeyList.getServerInstanceKeys()) {
|
||||
String serverInstanceId = serverInstanceKey.getServerInstanceId();
|
||||
ContainerList containerList = kieBusinessCentralConnector.getListContainers("nheron", "adminnheron00@", serverInstanceId);
|
||||
System.out.println("coucou");
|
||||
for (Container container : containerList.getContainers()) {
|
||||
|
||||
}
|
||||
}
|
||||
System.out.println("coucou");
|
||||
}
|
||||
System.out.println("coucou");
|
||||
|
||||
}
|
||||
**/
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,7 +15,9 @@ import org.chtijbug.guvnor.server.jaxrs.model.WorkspaceAuthData;
|
|||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.context.event.ApplicationReadyEvent;
|
||||
import org.springframework.context.annotation.DependsOn;
|
||||
import org.springframework.context.event.EventListener;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.HttpMethod;
|
||||
import org.springframework.http.MediaType;
|
||||
|
|
|
|||
|
|
@ -11,13 +11,13 @@ org.kie.server.controller=${PYMMA_KIE_CONTROLLER:http://localhost:18080/kie-wb/r
|
|||
org.kie.server.location=${PYMMA_KIE_LOCATION:http://localhost:8200/api/server}
|
||||
org.kie.server.id=${PYMMA_KIE_SERVER_ID:pymmaConsole2}
|
||||
|
||||
|
||||
almady.jms.url=tcp://localhost:1617
|
||||
spring.datasource.driver-class-name=org.postgresql.Driver
|
||||
spring.datasource.url=${PYMMA_DATABASE_URL:jdbc:postgresql://localhost:12432/kiedev}
|
||||
almady.jms.url=tcp://localhost:1617
|
||||
spring.jpa.properties.hibernate.dialect= org.chtijbug.drools.proxy.persistence.dialect.JSONBPostgreSQLDialect
|
||||
spring.datasource.username=${PYMMA_DATABASE_USER:kiedev}
|
||||
spring.datasource.password=${PYMMA_DATABASE_PASSWORD:kiedev}
|
||||
|
||||
spring.jpa.hibernate.ddl-auto=update
|
||||
spring.servlet.multipart.enabled=false
|
||||
kafka.bootstrapAddress=${PYMMA_KAFKA_BOOTSTRAP:localhost:9092,localhost:9093,localhost:9094}
|
||||
|
||||
|
|
@ -36,6 +36,6 @@ spring.servlet.multipart.max-request-size=100MB
|
|||
# Server properties
|
||||
server.tomcat.max-http-post-size=100000000
|
||||
server.tomcat.max-swallow-size=100MB
|
||||
|
||||
|
||||
spring.mvc.pathmatch.matching-strategy = ANT_PATH_MATCHER
|
||||
springfox.documentation.auto-startup= false
|
||||
secretkey=eRaYY7Wo24sDqKSX3IM9ASGmdGPmkTd9jo1QTy4b7P9Ze5_9hKolVX8xNrQDcNRfVEdTZNOuOyqEGhXEbdJI-ZQ19k_o9MI0y3eZN2lp9jow55FfXMiINEdt1XR85VipRLSOkT6kSpzs2x-jbLDiz9iFVzkd81YKxMgPA7VfZeQUm4n-mOmnWMaVX30zGFU4L3oPBctYKkl4dYfqYWqRNfrgPJVi5DGFjywgxx0ASEiJHtV72paI3fDR2XwlSkyhhmY-ICjCRmsJN4fX1pdoL8a18-aQrvyu4j0Os6dVPYIoPvvY0SAZtWYKHfM15g7A3HD4cVREf9cUsprCRK93w
|
||||
|
|
|
|||
|
|
@ -0,0 +1,17 @@
|
|||
package org.chtijbug.drools.console.dto;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class VariableDataList {
|
||||
private List<VariableData> rows = new ArrayList<>();
|
||||
|
||||
public List<VariableData> getRows() {
|
||||
return rows;
|
||||
}
|
||||
|
||||
public void setRows(List<VariableData> rows) {
|
||||
this.rows = rows;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
package org.chtijbug.drools.console.dto;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class VariableDefinitionList {
|
||||
private List<VariableDefinition> variables = new ArrayList<>();
|
||||
|
||||
public List<VariableDefinition> getVariables() {
|
||||
return variables;
|
||||
}
|
||||
|
||||
public void setVariables(List<VariableDefinition> variables) {
|
||||
this.variables = variables;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
editor.link_modal.header
Reference in a new issue