Ajout d'une interface Rest sur le workbench pour la plate-forme pymma
+ suppression travail sur kie-server spring-boot
This commit is contained in:
parent
7e7bf4f631
commit
59072a17dc
17 changed files with 142 additions and 366 deletions
|
|
@ -54,6 +54,11 @@
|
||||||
</exclusions>
|
</exclusions>
|
||||||
|
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.uberfire</groupId>
|
||||||
|
<artifactId>uberfire-rest-client</artifactId>
|
||||||
|
<version>2.9.0.Final</version>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.vaadin</groupId>
|
<groupId>com.vaadin</groupId>
|
||||||
<artifactId>vaadin-push</artifactId>
|
<artifactId>vaadin-push</artifactId>
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,8 @@ import org.chtijbug.drools.console.service.KieServerRepositoryService;
|
||||||
import org.chtijbug.drools.console.service.model.DisplayData;
|
import org.chtijbug.drools.console.service.model.DisplayData;
|
||||||
import org.chtijbug.drools.console.service.model.kie.*;
|
import org.chtijbug.drools.console.service.model.kie.*;
|
||||||
import org.chtijbug.drools.console.service.util.AppContext;
|
import org.chtijbug.drools.console.service.util.AppContext;
|
||||||
|
import org.guvnor.rest.client.ProjectResponse;
|
||||||
|
import org.guvnor.rest.client.PublicURI;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
@ -133,12 +135,12 @@ public class DroolsAdminConsole extends UI {
|
||||||
|
|
||||||
|
|
||||||
JobStatus result = kieRepositoryService.buildProject(config.getKiewbUrl(), userNameTextField.getValue(),
|
JobStatus result = kieRepositoryService.buildProject(config.getKiewbUrl(), userNameTextField.getValue(),
|
||||||
userpasswdTextField.getValue(), displayData.getSpaceName(), displayData.getProjectName(), "compile", this);
|
userpasswdTextField.getValue(), displayData.getSpaceName(), displayData.getProjectArtifactID(), "compile", this);
|
||||||
kieRepositoryService.waitForJobToBeEnded(config.getKiewbUrl(), userNameTextField.getValue(),
|
kieRepositoryService.waitForJobToBeEnded(config.getKiewbUrl(), userNameTextField.getValue(),
|
||||||
userpasswdTextField.getValue(), result.getJobId(), this);
|
userpasswdTextField.getValue(), result.getJobId(), this);
|
||||||
|
|
||||||
result = kieRepositoryService.buildProject(config.getKiewbUrl(), userNameTextField.getValue(),
|
result = kieRepositoryService.buildProject(config.getKiewbUrl(), userNameTextField.getValue(),
|
||||||
userpasswdTextField.getValue(), displayData.getSpaceName(), displayData.getProjectName(), "install", this);
|
userpasswdTextField.getValue(), displayData.getSpaceName(), displayData.getProjectArtifactID(), "install", this);
|
||||||
|
|
||||||
kieRepositoryService.waitForJobToBeEnded(config.getKiewbUrl(), userNameTextField.getValue(),
|
kieRepositoryService.waitForJobToBeEnded(config.getKiewbUrl(), userNameTextField.getValue(),
|
||||||
userpasswdTextField.getValue(), result.getJobId(), this);
|
userpasswdTextField.getValue(), result.getJobId(), this);
|
||||||
|
|
@ -152,10 +154,10 @@ public class DroolsAdminConsole extends UI {
|
||||||
KieContainerRequest newContainer = new KieContainerRequest();
|
KieContainerRequest newContainer = new KieContainerRequest();
|
||||||
newContainer.setContainerId(displayData.getContainerId());
|
newContainer.setContainerId(displayData.getContainerId());
|
||||||
newContainer.setReleaseId(new ReleaseDefinition());
|
newContainer.setReleaseId(new ReleaseDefinition());
|
||||||
newContainer.getReleaseId().setArtifactId(displayData.getProjectName());
|
newContainer.getReleaseId().setArtifactId(displayData.getProjectArtifactID());
|
||||||
newContainer.getReleaseId().setGroupId(displayData.getProjectGroupID());
|
newContainer.getReleaseId().setGroupId(displayData.getProjectGroupID());
|
||||||
newContainer.getReleaseId().setVersion(displayData.getProjectVersion());
|
newContainer.getReleaseId().setVersion(displayData.getProjectVersion());
|
||||||
KieContainerInfo toto = kieServerRepositoryService.createContainer(config.getKieserverUrl(), config.getKieserverUserName(), config.getKieserverPassword(), displayData.getProjectName(), newContainer, this);
|
KieContainerInfo toto = kieServerRepositoryService.createContainer(config.getKieserverUrl(), config.getKieserverUserName(), config.getKieserverPassword(), displayData.getProjectArtifactID(), newContainer, this);
|
||||||
System.out.println("coucou");
|
System.out.println("coucou");
|
||||||
this.refreshList();
|
this.refreshList();
|
||||||
}
|
}
|
||||||
|
|
@ -188,22 +190,22 @@ public class DroolsAdminConsole extends UI {
|
||||||
kieRepositoryService = AppContext.getApplicationContext().getBean(KieRepositoryService.class);
|
kieRepositoryService = AppContext.getApplicationContext().getBean(KieRepositoryService.class);
|
||||||
List<KieContainerInfo> listcontainers = kieServerRepositoryService.getContainerList(config.getKieserverUrl(), config.getKieserverUserName(), config.getKieserverPassword());
|
List<KieContainerInfo> listcontainers = kieServerRepositoryService.getContainerList(config.getKieserverUrl(), config.getKieserverUserName(), config.getKieserverPassword());
|
||||||
|
|
||||||
List<Space> listSpaces = kieRepositoryService.getListSpaces(config.getKiewbUrl(), userNameTextField.getValue(),
|
|
||||||
|
List<ProjectResponse> listSpacesuberfire = kieRepositoryService.getListSpaces2(config.getKiewbUrl(), userNameTextField.getValue(),
|
||||||
userpasswdTextField.getValue());
|
userpasswdTextField.getValue());
|
||||||
for (Space space : listSpaces) {
|
|
||||||
for (SpaceProject spaceProject : space.getProjects()) {
|
// List<Space> listSpaces = kieRepositoryService.getListSpaces(config.getKiewbUrl(), userNameTextField.getValue(),
|
||||||
// kieServerRepositoryService.getProjectContent(config.getKiewbUrl(), userNameTextField.getValue(),
|
// userpasswdTextField.getValue());
|
||||||
// userpasswdTextField.getValue(),space.getName(),spaceProject.getName());
|
|
||||||
DisplayData displayData = new DisplayData();
|
|
||||||
displayData.setSpaceName(space.getName());
|
for (ProjectResponse projectResponse : listSpacesuberfire) {
|
||||||
displayData.setSpaceDescription(space.getDescription());
|
DisplayData displayData = new DisplayData();
|
||||||
displayData.setSpaceDefaultGroupID(space.getDefaultGroupId());
|
displayData.setSpaceName(projectResponse.getSpaceName());
|
||||||
displayData.setSpaceOwner(space.getOwner());
|
displayData.setProjectArtifactID(projectResponse.getName());
|
||||||
displayData.setProjectName(spaceProject.getName());
|
displayData.setProjectGroupID(projectResponse.getGroupId());
|
||||||
displayData.setProjectGroupID(spaceProject.getGroupId());
|
displayData.setProjectVersion(projectResponse.getVersion());
|
||||||
displayData.setProjectVersion(spaceProject.getVersion());
|
displayData.setProjectDescription(projectResponse.getDescription());
|
||||||
displayData.setProjectDescription(spaceProject.getDescription());
|
for (PublicURI uri : projectResponse.getPublicURIs()) {
|
||||||
for (SpaceProjectURI uri : spaceProject.getPublicURIs()) {
|
|
||||||
if (uri.getProtocol().equals("git")) {
|
if (uri.getProtocol().equals("git")) {
|
||||||
displayData.setProjectGitAddress(uri.getUri());
|
displayData.setProjectGitAddress(uri.getUri());
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -213,17 +215,16 @@ public class DroolsAdminConsole extends UI {
|
||||||
for (KieContainerInfo kie : listcontainers) {
|
for (KieContainerInfo kie : listcontainers) {
|
||||||
if (kie.getGroupId() != null
|
if (kie.getGroupId() != null
|
||||||
&& kie.getGroupId().equals(displayData.getProjectGroupID())
|
&& kie.getGroupId().equals(displayData.getProjectGroupID())
|
||||||
&& kie.getArtifactId().equals(displayData.getProjectName())
|
&& kie.getArtifactId().equals(displayData.getProjectArtifactID())
|
||||||
&& kie.getVersion().equals(displayData.getProjectVersion())) {
|
&& kie.getVersion().equals(displayData.getProjectVersion())) {
|
||||||
displayData.setKieServerArtifactId(kie.getArtifactId());
|
displayData.setKieServerArtifactId(kie.getArtifactId());
|
||||||
displayData.setKieServerGroupId(kie.getGroupId());
|
displayData.setKieServerGroupId(kie.getGroupId());
|
||||||
displayData.setKieServerVersion(kie.getVersion());
|
displayData.setKieServerVersion(kie.getVersion());
|
||||||
displayData.setContainerId(kie.getContainerId());
|
displayData.setContainerId(kie.getContainerId());
|
||||||
displayData.setContainerAlias(kie.getContainerAlias());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
gitReposListContainer.addBean(displayData);
|
gitReposListContainer.addBean(displayData);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
System.out.println("coucou");
|
System.out.println("coucou");
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ import org.apache.commons.codec.binary.Base64;
|
||||||
import org.chtijbug.drools.console.DroolsAdminConsole;
|
import org.chtijbug.drools.console.DroolsAdminConsole;
|
||||||
import org.chtijbug.drools.console.service.model.kie.JobStatus;
|
import org.chtijbug.drools.console.service.model.kie.JobStatus;
|
||||||
import org.chtijbug.drools.console.service.model.kie.Space;
|
import org.chtijbug.drools.console.service.model.kie.Space;
|
||||||
|
import org.guvnor.rest.client.ProjectResponse;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.http.HttpHeaders;
|
import org.springframework.http.HttpHeaders;
|
||||||
|
|
@ -32,6 +33,27 @@ public class KieRepositoryService {
|
||||||
private ObjectMapper mapper = new ObjectMapper();
|
private ObjectMapper mapper = new ObjectMapper();
|
||||||
|
|
||||||
|
|
||||||
|
public List<ProjectResponse> getListSpaces2(String url, String username, String password) {
|
||||||
|
String completeurl = url + "/chtijbug/detailedSpaces";
|
||||||
|
logger.info("url moteur reco : " + completeurl);
|
||||||
|
ResponseEntity<List<ProjectResponse>> response = restTemplateKiewb
|
||||||
|
.execute(completeurl, HttpMethod.GET, requestCallback(null, username, password), clientHttpResponse -> {
|
||||||
|
List<ProjectResponse> extractedResponse = null;
|
||||||
|
if (clientHttpResponse.getBody() != null) {
|
||||||
|
Scanner s = new Scanner(clientHttpResponse.getBody()).useDelimiter("\\A");
|
||||||
|
String result = s.hasNext() ? s.next() : "";
|
||||||
|
ProjectResponse[] values = mapper.readValue(result, ProjectResponse[].class);
|
||||||
|
extractedResponse = Arrays.asList(values);
|
||||||
|
}
|
||||||
|
ResponseEntity<List<ProjectResponse>> extractedValue = new ResponseEntity<>(extractedResponse, clientHttpResponse.getHeaders(), clientHttpResponse.getStatusCode());
|
||||||
|
return extractedValue;
|
||||||
|
});
|
||||||
|
List<ProjectResponse> reponseMoteur;
|
||||||
|
|
||||||
|
reponseMoteur = response.getBody();
|
||||||
|
return reponseMoteur;
|
||||||
|
}
|
||||||
|
|
||||||
public List<Space> getListSpaces(String url, String username, String password) {
|
public List<Space> getListSpaces(String url, String username, String password) {
|
||||||
String completeurl = url + "/spaces";
|
String completeurl = url + "/spaces";
|
||||||
logger.info("url moteur reco : " + completeurl);
|
logger.info("url moteur reco : " + completeurl);
|
||||||
|
|
|
||||||
|
|
@ -2,20 +2,17 @@ package org.chtijbug.drools.console.service.model;
|
||||||
|
|
||||||
public class DisplayData {
|
public class DisplayData {
|
||||||
private String spaceName;
|
private String spaceName;
|
||||||
private String spaceDescription;
|
private String projectArtifactID;
|
||||||
private String projectName;
|
|
||||||
private String projectGroupID;
|
private String projectGroupID;
|
||||||
private String projectVersion;
|
private String projectVersion;
|
||||||
private String projectDescription;
|
private String projectDescription;
|
||||||
private String projectGitAddress;
|
private String projectGitAddress;
|
||||||
private String projectSSHAdress;
|
private String projectSSHAdress;
|
||||||
private String spaceOwner;
|
private String spaceOwner;
|
||||||
private String spaceDefaultGroupID;
|
|
||||||
private String containerId;
|
private String containerId;
|
||||||
private String kieServerArtifactId;
|
private String kieServerArtifactId;
|
||||||
private String kieServerGroupId;
|
private String kieServerGroupId;
|
||||||
private String kieServerVersion;
|
private String kieServerVersion;
|
||||||
private String containerAlias;
|
|
||||||
|
|
||||||
public String getSpaceName() {
|
public String getSpaceName() {
|
||||||
return spaceName;
|
return spaceName;
|
||||||
|
|
@ -25,20 +22,13 @@ public class DisplayData {
|
||||||
this.spaceName = spaceName;
|
this.spaceName = spaceName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getSpaceDescription() {
|
|
||||||
return spaceDescription;
|
public String getProjectArtifactID() {
|
||||||
|
return projectArtifactID;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setSpaceDescription(String spaceDescription) {
|
public void setProjectArtifactID(String projectArtifactID) {
|
||||||
this.spaceDescription = spaceDescription;
|
this.projectArtifactID = projectArtifactID;
|
||||||
}
|
|
||||||
|
|
||||||
public String getProjectName() {
|
|
||||||
return projectName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setProjectName(String projectName) {
|
|
||||||
this.projectName = projectName;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getProjectGroupID() {
|
public String getProjectGroupID() {
|
||||||
|
|
@ -89,13 +79,6 @@ public class DisplayData {
|
||||||
this.spaceOwner = spaceOwner;
|
this.spaceOwner = spaceOwner;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getSpaceDefaultGroupID() {
|
|
||||||
return spaceDefaultGroupID;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSpaceDefaultGroupID(String spaceDefaultGroupID) {
|
|
||||||
this.spaceDefaultGroupID = spaceDefaultGroupID;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getContainerId() {
|
public String getContainerId() {
|
||||||
return containerId;
|
return containerId;
|
||||||
|
|
@ -129,11 +112,4 @@ public class DisplayData {
|
||||||
this.kieServerVersion = kieServerVersion;
|
this.kieServerVersion = kieServerVersion;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getContainerAlias() {
|
|
||||||
return containerAlias;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setContainerAlias(String containerAlias) {
|
|
||||||
this.containerAlias = containerAlias;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,19 +0,0 @@
|
||||||
/target
|
|
||||||
/local
|
|
||||||
*.tlog
|
|
||||||
|
|
||||||
# Eclipse, Netbeans and IntelliJ files
|
|
||||||
/.*
|
|
||||||
!.gitignore
|
|
||||||
/nbproject
|
|
||||||
/*.ipr
|
|
||||||
/*.iws
|
|
||||||
*.iml
|
|
||||||
.classpath
|
|
||||||
.project
|
|
||||||
.settings
|
|
||||||
.idea
|
|
||||||
target
|
|
||||||
|
|
||||||
# Repository wide ignore mac DS_Store files
|
|
||||||
.DS_Store
|
|
||||||
|
|
@ -1,72 +0,0 @@
|
||||||
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
|
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
|
||||||
<modelVersion>4.0.0</modelVersion>
|
|
||||||
<parent>
|
|
||||||
<artifactId>drools-framework-kie-server-parent</artifactId>
|
|
||||||
<groupId>com.pymmasoftware.jbpm</groupId>
|
|
||||||
<version>1.0-SNAPSHOT</version>
|
|
||||||
</parent>
|
|
||||||
<artifactId>Chtijbug-kie-server-spring-boot-autoconfiguration-drools</artifactId>
|
|
||||||
<name>Chtijbug KIE :: Spring :: Boot :: KIE Server Auto Configuration :: Drools</name>
|
|
||||||
<description>Chtijbug drools KIE Server SpringBoot Auto Configuration</description>
|
|
||||||
|
|
||||||
<dependencies>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.boot</groupId>
|
|
||||||
<artifactId>spring-boot</artifactId>
|
|
||||||
<exclusions>
|
|
||||||
<exclusion>
|
|
||||||
<artifactId>commons-logging</artifactId>
|
|
||||||
<groupId>commons-logging</groupId>
|
|
||||||
</exclusion>
|
|
||||||
</exclusions>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.boot</groupId>
|
|
||||||
<artifactId>spring-boot-autoconfigure</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.kie.server</groupId>
|
|
||||||
<artifactId>kie-server-api</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.kie.server</groupId>
|
|
||||||
<artifactId>kie-server-services-common</artifactId>
|
|
||||||
<exclusions>
|
|
||||||
<exclusion>
|
|
||||||
<groupId>aopalliance</groupId>
|
|
||||||
<artifactId>aopalliance</artifactId>
|
|
||||||
</exclusion>
|
|
||||||
<exclusion>
|
|
||||||
<groupId>org.jboss.spec.javax.ws.rs</groupId>
|
|
||||||
<artifactId>jboss-jaxrs-api_2.0_spec</artifactId>
|
|
||||||
</exclusion>
|
|
||||||
</exclusions>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework</groupId>
|
|
||||||
<artifactId>spring-context</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.kie</groupId>
|
|
||||||
<artifactId>kie-server-spring-boot-autoconfiguration</artifactId>
|
|
||||||
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- chtijbug drools kie server dependencies -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.pymmasoftware.jbpm</groupId>
|
|
||||||
<artifactId>drools-framework-kie-server-services-drools</artifactId>
|
|
||||||
<version>${project.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.pymmasoftware.jbpm</groupId>
|
|
||||||
<artifactId>drools-framework-kie-server-rest-drools</artifactId>
|
|
||||||
<version>${project.version}</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
|
|
||||||
</dependencies>
|
|
||||||
</project>
|
|
||||||
|
|
@ -1,48 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright 2017 Red Hat, Inc. and/or its affiliates.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package org.chtijbug.kieserver.springboot.autoconfiguration;
|
|
||||||
|
|
||||||
import org.kie.server.services.api.KieServerExtension;
|
|
||||||
import org.kie.server.services.drools.DroolsKieServerExtension;
|
|
||||||
import org.kie.server.services.impl.KieServerImpl;
|
|
||||||
import org.kie.server.springboot.autoconfiguration.KieServerProperties;
|
|
||||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
|
||||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
|
||||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
|
||||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
|
||||||
import org.springframework.context.annotation.Bean;
|
|
||||||
import org.springframework.context.annotation.Configuration;
|
|
||||||
|
|
||||||
@Configuration
|
|
||||||
@ConditionalOnClass({KieServerImpl.class})
|
|
||||||
@EnableConfigurationProperties(KieServerProperties.class)
|
|
||||||
public class ChtijbugDroolsKieServerAutoConfiguration {
|
|
||||||
|
|
||||||
private KieServerProperties properties;
|
|
||||||
|
|
||||||
public ChtijbugDroolsKieServerAutoConfiguration(KieServerProperties properties) {
|
|
||||||
this.properties = properties;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Bean
|
|
||||||
@ConditionalOnMissingBean(name = "droolsServerExtension")
|
|
||||||
@ConditionalOnProperty(name = "kieserver.pymmadrools.enabled")
|
|
||||||
public KieServerExtension droolsServerExtension() {
|
|
||||||
|
|
||||||
return new DroolsKieServerExtension();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
org.springframework.boot.autoconfigure.EnableAutoConfiguration=org.chtijbug.kieserver.springboot.autoconfiguration.ChtijbugDroolsKieServerAutoConfiguration
|
|
||||||
|
|
@ -1,33 +0,0 @@
|
||||||
KIE Server with all capabilities
|
|
||||||
========================================
|
|
||||||
|
|
||||||
KIE Server SpringBoot sample application that uses Spring Security for securing access to KIE Server resources.
|
|
||||||
This is a complete (fully featured KIE Server - includes all capabilities) KIE Server that can be used to leverage
|
|
||||||
business process management, rules management and planning solutions in single runtime.
|
|
||||||
|
|
||||||
How to configure it
|
|
||||||
------------------------------
|
|
||||||
|
|
||||||
Complete configuration is via application.properties of the projects.
|
|
||||||
Users can decide which KIE Server extensions should be activated via following properties:
|
|
||||||
|
|
||||||
```
|
|
||||||
kieserver.drools.enabled=true
|
|
||||||
kieserver.dmn.enabled=true
|
|
||||||
kieserver.jbpm.enabled=true
|
|
||||||
kieserver.jbpmui.enabled=true
|
|
||||||
kieserver.casemgmt.enabled=true
|
|
||||||
kieserver.optaplanner.enabled=true
|
|
||||||
```
|
|
||||||
|
|
||||||
How to run it
|
|
||||||
------------------------------
|
|
||||||
|
|
||||||
You can run the application by simply starting
|
|
||||||
|
|
||||||
```
|
|
||||||
mvn clean spring-boot:run
|
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,38 +0,0 @@
|
||||||
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
|
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
|
||||||
<modelVersion>4.0.0</modelVersion>
|
|
||||||
<parent>
|
|
||||||
<artifactId>drools-framework-kie-server-parent</artifactId>
|
|
||||||
<groupId>com.pymmasoftware.jbpm</groupId>
|
|
||||||
<version>1.0-SNAPSHOT</version>
|
|
||||||
</parent>
|
|
||||||
<artifactId>drools-framework-kie-server-spring-boot</artifactId>
|
|
||||||
|
|
||||||
<name>KIE Server :: Spring :: Boot :: Sample</name>
|
|
||||||
<description>KIE Server SpringBoot Sample (includes all KIE Server capabilities)</description>
|
|
||||||
|
|
||||||
<properties>
|
|
||||||
<start-class>org.chtijbug.kieserver.springboot.server.KieServerApplication</start-class>
|
|
||||||
</properties>
|
|
||||||
|
|
||||||
<dependencies>
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.pymmasoftware.jbpm</groupId>
|
|
||||||
<artifactId>Chtijbug-kie-server-spring-boot-autoconfiguration-drools</artifactId>
|
|
||||||
<version>${project.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.boot</groupId>
|
|
||||||
<artifactId>spring-boot-starter-security</artifactId>
|
|
||||||
<version>${spring.boot.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>commons-beanutils</groupId>
|
|
||||||
<artifactId>commons-beanutils</artifactId>
|
|
||||||
<version>1.9.3</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
</dependencies>
|
|
||||||
|
|
||||||
|
|
||||||
</project>
|
|
||||||
|
|
@ -1,53 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright 2017 Red Hat, Inc. and/or its affiliates.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package org.chtijbug.kieserver.springboot.server;
|
|
||||||
|
|
||||||
import org.kie.server.services.api.KieServer;
|
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.boot.CommandLineRunner;
|
|
||||||
import org.springframework.boot.SpringApplication;
|
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
|
||||||
import org.springframework.boot.autoconfigure.jms.JmsAutoConfiguration;
|
|
||||||
import org.springframework.context.annotation.Bean;
|
|
||||||
|
|
||||||
|
|
||||||
@SpringBootApplication(exclude = JmsAutoConfiguration.class)
|
|
||||||
|
|
||||||
public class KieServerApplication {
|
|
||||||
|
|
||||||
private static final Logger LOGGER = LoggerFactory.getLogger(KieServerApplication.class);
|
|
||||||
|
|
||||||
public static void main(String[] args) {
|
|
||||||
SpringApplication.run(KieServerApplication.class, args);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Bean
|
|
||||||
CommandLineRunner deployAndValidate() {
|
|
||||||
return new CommandLineRunner() {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private KieServer kieServer;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void run(String... strings) throws Exception {
|
|
||||||
LOGGER.info("KieServer {} started", kieServer);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,25 +0,0 @@
|
||||||
#
|
|
||||||
# https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#common-application-properties
|
|
||||||
#
|
|
||||||
#server configuration
|
|
||||||
server.address=localhost
|
|
||||||
server.port=8090
|
|
||||||
#jbpm configuration
|
|
||||||
jbpm.executor.enabled=false
|
|
||||||
#jbpm.executor.retries=5
|
|
||||||
#jbpm.executor.interval=0
|
|
||||||
#jbpm.executor.threadPoolSize=1
|
|
||||||
#jbpm.executor.timeUnit=SECONDS
|
|
||||||
kieserver.restContextPath=/rest
|
|
||||||
kieserver.location=http://${server.address}:${server.port}${kieserver.restContextPath}/server
|
|
||||||
#kieserver.controllers=
|
|
||||||
org.kie.server.controller=http://localhost:8080/kie-wb/rest/controller
|
|
||||||
kieserver.drools.enabled=false
|
|
||||||
kieserver.dmn.enabled=false
|
|
||||||
kieserver.jbpm.enabled=false
|
|
||||||
kieserver.jbpmui.enabled=false
|
|
||||||
kieserver.casemgmt.enabled=false
|
|
||||||
kieserver.optaplanner.enabled=false
|
|
||||||
kieserver.pymmadrools.enabled=true
|
|
||||||
# only required for jBPM
|
|
||||||
#data source configuration
|
|
||||||
|
|
@ -15,8 +15,6 @@
|
||||||
<module>drools-framework-kie-server-rest-drools</module>
|
<module>drools-framework-kie-server-rest-drools</module>
|
||||||
<module>drools-framework-kie-server-client-connector</module>
|
<module>drools-framework-kie-server-client-connector</module>
|
||||||
<module>drools-framework-kie-server-extension-interface</module>
|
<module>drools-framework-kie-server-extension-interface</module>
|
||||||
<!--module>drools-framework-kie-server-spring-boot-autoconfiguration-drools</module>
|
|
||||||
<module>drools-framework-kie-server-spring-boot</module-->
|
|
||||||
</modules>
|
</modules>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
|
@ -16,6 +16,76 @@
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
|
<groupId>org.jboss.spec.javax.ejb</groupId>
|
||||||
|
<artifactId>jboss-ejb-api_3.2_spec</artifactId>
|
||||||
|
<version>1.0.0.Final</version>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.slf4j</groupId>
|
||||||
|
<artifactId>slf4j-api</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.jboss.spec.javax.ws.rs</groupId>
|
||||||
|
<artifactId>jboss-jaxrs-api_2.0_spec</artifactId>
|
||||||
|
<version>1.0.0.Final</version>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>javax.inject</groupId>
|
||||||
|
<artifactId>javax.inject</artifactId>
|
||||||
|
<version>1</version>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>javax.enterprise</groupId>
|
||||||
|
<artifactId>cdi-api</artifactId>
|
||||||
|
<version>1.0</version>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.uberfire</groupId>
|
||||||
|
<artifactId>uberfire-nio2-model</artifactId>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.uberfire</groupId>
|
||||||
|
<artifactId>uberfire-nio2-api</artifactId>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.uberfire</groupId>
|
||||||
|
<artifactId>uberfire-io</artifactId>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.uberfire</groupId>
|
||||||
|
<artifactId>uberfire-project-api</artifactId>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.uberfire</groupId>
|
||||||
|
<artifactId>uberfire-api</artifactId>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.uberfire</groupId>
|
||||||
|
<artifactId>uberfire-commons</artifactId>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.uberfire</groupId>
|
||||||
|
<artifactId>uberfire-rest-client</artifactId>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.uberfire</groupId>
|
||||||
|
<artifactId>uberfire-structure-api</artifactId>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!--dependency>
|
||||||
<groupId>org.uberfire</groupId>
|
<groupId>org.uberfire</groupId>
|
||||||
<artifactId>uberfire-rest-client</artifactId>
|
<artifactId>uberfire-rest-client</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
@ -40,10 +110,7 @@
|
||||||
<groupId>org.uberfire</groupId>
|
<groupId>org.uberfire</groupId>
|
||||||
<artifactId>uberfire-project-api</artifactId>
|
<artifactId>uberfire-project-api</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>org.slf4j</groupId>
|
|
||||||
<artifactId>slf4j-api</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.uberfire</groupId>
|
<groupId>org.uberfire</groupId>
|
||||||
<artifactId>uberfire-api</artifactId>
|
<artifactId>uberfire-api</artifactId>
|
||||||
|
|
@ -113,8 +180,7 @@
|
||||||
<artifactId>uberfire-services-api</artifactId>
|
<artifactId>uberfire-services-api</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- The version of commons-io in droolsjbpm-build-bootstrap pom is way too old-->
|
<dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>commons-io</groupId>
|
<groupId>commons-io</groupId>
|
||||||
<artifactId>commons-io</artifactId>
|
<artifactId>commons-io</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
@ -148,7 +214,7 @@
|
||||||
<groupId>commons-fileupload</groupId>
|
<groupId>commons-fileupload</groupId>
|
||||||
<artifactId>commons-fileupload</artifactId>
|
<artifactId>commons-fileupload</artifactId>
|
||||||
<version>1.3.1</version>
|
<version>1.3.1</version>
|
||||||
</dependency>
|
</dependency-->
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
package org.chtijbug.kie.rest.backend;
|
package org.chtijbug.kie.rest.backend;
|
||||||
|
|
||||||
|
|
||||||
import org.guvnor.common.services.project.model.WorkspaceProject;
|
import org.guvnor.common.services.project.model.WorkspaceProject;
|
||||||
import org.guvnor.common.services.project.service.WorkspaceProjectService;
|
import org.guvnor.common.services.project.service.WorkspaceProjectService;
|
||||||
import org.guvnor.rest.client.ProjectResponse;
|
import org.guvnor.rest.client.ProjectResponse;
|
||||||
import org.guvnor.rest.client.Space;
|
|
||||||
import org.guvnor.structure.organizationalunit.OrganizationalUnit;
|
import org.guvnor.structure.organizationalunit.OrganizationalUnit;
|
||||||
import org.guvnor.structure.organizationalunit.OrganizationalUnitService;
|
import org.guvnor.structure.organizationalunit.OrganizationalUnitService;
|
||||||
import org.guvnor.structure.repositories.PublicURI;
|
import org.guvnor.structure.repositories.PublicURI;
|
||||||
|
|
@ -12,6 +12,7 @@ import org.guvnor.structure.repositories.RepositoryService;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.uberfire.io.IOService;
|
import org.uberfire.io.IOService;
|
||||||
import org.uberfire.java.nio.file.DirectoryStream;
|
import org.uberfire.java.nio.file.DirectoryStream;
|
||||||
|
import org.uberfire.spaces.Space;
|
||||||
|
|
||||||
import javax.enterprise.context.ApplicationScoped;
|
import javax.enterprise.context.ApplicationScoped;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
|
@ -25,6 +26,7 @@ import java.util.Collection;
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
@Path("/chtijbug")
|
@Path("/chtijbug")
|
||||||
@Named
|
@Named
|
||||||
@ApplicationScoped
|
@ApplicationScoped
|
||||||
|
|
@ -57,30 +59,26 @@ public class PackageResource {
|
||||||
@Produces(MediaType.APPLICATION_JSON)
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
@Path("/detailedSpaces")
|
@Path("/detailedSpaces")
|
||||||
// @RolesAllowed({REST_ROLE, REST_PROJECT_ROLE})
|
// @RolesAllowed({REST_ROLE, REST_PROJECT_ROLE})
|
||||||
public Collection<Space> getProjects() {
|
public Collection<ProjectResponse> getProjects() {
|
||||||
logger.debug("-----getSpaces--- ");
|
logger.debug("-----getSpaces--- ");
|
||||||
|
|
||||||
final List<Space> spaces = new ArrayList<Space>();
|
final List<ProjectResponse> spaces = new ArrayList<>();
|
||||||
for (OrganizationalUnit ou : organizationalUnitService.getOrganizationalUnits()) {
|
for (OrganizationalUnit ou : organizationalUnitService.getOrganizationalUnits()) {
|
||||||
spaces.add(getSpace(ou));
|
spaces.addAll(getSpace(ou));
|
||||||
}
|
}
|
||||||
|
|
||||||
return spaces;
|
return spaces;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Space getSpace(OrganizationalUnit ou) {
|
private List<ProjectResponse> getSpace(OrganizationalUnit ou) {
|
||||||
final Space space = new Space();
|
final Space space = new Space(ou.getName());
|
||||||
space.setName(ou.getName());
|
|
||||||
space.setOwner(ou.getOwner());
|
|
||||||
space.setDefaultGroupId(ou.getDefaultGroupId());
|
|
||||||
|
|
||||||
final List<ProjectResponse> repoNames = new ArrayList<>();
|
final List<ProjectResponse> repoNames = new ArrayList<>();
|
||||||
for (WorkspaceProject workspaceProject : workspaceProjectService.getAllWorkspaceProjects(ou)) {
|
for (WorkspaceProject workspaceProject : workspaceProjectService.getAllWorkspaceProjects(ou)) {
|
||||||
repoNames.add(getProjectResponse(workspaceProject));
|
repoNames.add(getProjectResponse(workspaceProject));
|
||||||
}
|
}
|
||||||
|
|
||||||
space.setProjects(repoNames);
|
return repoNames;
|
||||||
return space;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private ProjectResponse getProjectResponse(WorkspaceProject workspaceProject) {
|
private ProjectResponse getProjectResponse(WorkspaceProject workspaceProject) {
|
||||||
|
|
|
||||||
|
|
@ -12,16 +12,15 @@
|
||||||
<artifactId>kie-wb</artifactId>
|
<artifactId>kie-wb</artifactId>
|
||||||
|
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
<name>Pymma platform jbpm-console</name>
|
<name>Pymma platform workbench</name>
|
||||||
<description>Pymma Plarform Kie-wb
|
<description>Pymma Plarform Kie-wb</description>
|
||||||
</description>
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
|
||||||
<!--dependency>
|
<dependency>
|
||||||
<groupId>com.pymmasoftware.jbpm</groupId>
|
<groupId>com.pymmasoftware.jbpm</groupId>
|
||||||
<artifactId>kie-drools-framework-rest-backend</artifactId>
|
<artifactId>kie-drools-framework-rest-backend</artifactId>
|
||||||
<version>${project.version}</version>
|
<version>${project.version}</version>
|
||||||
</dependency-->
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.kie</groupId>
|
<groupId>org.kie</groupId>
|
||||||
|
|
|
||||||
2
pom.xml
2
pom.xml
|
|
@ -25,7 +25,7 @@
|
||||||
<properties>
|
<properties>
|
||||||
<jbpm.version>7.13.0.Final</jbpm.version>
|
<jbpm.version>7.13.0.Final</jbpm.version>
|
||||||
<spring.boot.version>1.5.9.Release</spring.boot.version>
|
<spring.boot.version>1.5.9.Release</spring.boot.version>
|
||||||
<spring.version>4.3.3.Release</spring.version>
|
<spring.version>4.3.1.Release</spring.version>
|
||||||
<version.thorntail>2.2.1.Final</version.thorntail>
|
<version.thorntail>2.2.1.Final</version.thorntail>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
editor.link_modal.header
Reference in a new issue