Add rest for kie-wb and refactoring
This commit is contained in:
parent
8282128547
commit
97affee12c
18 changed files with 602 additions and 14 deletions
15
configuration/kie-wb/post-commit
Normal file
15
configuration/kie-wb/post-commit
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
#!/bin/sh
|
||||
# This hook is used to push a mirrored version of all committed files to your remote repo after they are commited
|
||||
|
||||
# Replace this variable with your remote repo name
|
||||
REPO=git@gitlab.pymma-software.com:onisep/onisep-drools-repo.git
|
||||
|
||||
echo
|
||||
echo "==== Sending changes to $REPO repo ===="
|
||||
echo
|
||||
|
||||
git push --mirror $REPO;
|
||||
|
||||
echo
|
||||
echo "==== Donezo ===="
|
||||
echo
|
||||
|
|
@ -52,7 +52,7 @@ fi
|
|||
if [ "x$JAVA_OPTS" = "x" ]; then
|
||||
JAVA_OPTS = "-Xms4096m -Xmx10012m -XX:MetaspaceSize=1048M -XX:MaxMetaspaceSize=1048M -Djava.net.preferIPv4Stack=true"
|
||||
JAVA_OPTS = "$JAVA_OPTS -Djboss.modules.system.pkgs=$JBOSS_MODULES_SYSTEM_PKGS -Djava.awt.headless=true"
|
||||
JAVA_OPTS = "$JAVA_OPTS -XX:MaxNewSize=256m -XX:PermSize=256m -XX:MaxPermSize=556m -XX:+DisableExplicitGC -Dorg.kie.example.repositories=/home/nheron/kie-base/example-import -Dorg.kie.example=true -Dorg.uberfire.metadata.index.dir=/home/nheron/kie-base/lucene -Dorg.uberfire.nio.git.daemon.host=0.0.0.0 -Dorg.guvnor.m2repo.dir=/Users/nheron/m2_kiewb/ -DM2_HOME=/home/nheron/m2_kiewb -Dorg.uberfire.nio.git.dir=/home/nheron/kie-base/niodir -Dorg.kie.demo=false -Dorg.kie.server.controller=http://localhost:8080/kie-wb/rest/controller -Dorg.appformer.m2repo.url=http://localhost:8080/kie-wb/maven2 -Dkie.maven.settings.custom=/Users/nheron/m2_kiewb/settings.xml -Dorg.kie.server.controller=http://localhost:10080/kie-server/rest/controller "
|
||||
JAVA_OPTS = "$JAVA_OPTS -XX:MaxNewSize=256m -XX:PermSize=256m -XX:MaxPermSize=556m -XX:+DisableExplicitGC -Dorg.kie.example.repositories=/home/nheron/kie-base/example-import -Dorg.kie.example=true -Dorg.uberfire.metadata.index.dir=/home/nheron/kie-base/lucene -Dorg.uberfire.nio.git.daemon.host=0.0.0.0 -Dorg.guvnor.m2repo.dir=/Users/nheron/m2_kiewb/ -DM2_HOME=/home/nheron/m2_kiewb -Dorg.uberfire.nio.git.dir=/home/nheron/kie-base/niodir -Dorg.kie.demo=false -Dorg.appformer.m2repo.url=http://localhost:8080/kie-wb/maven2 -Dkie.maven.settings.custom=/Users/nheron/m2_kiewb/settings.xml "
|
||||
else
|
||||
echo "JAVA_OPTS already set in environment; overriding default settings with values: $JAVA_OPTS"
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -192,6 +192,8 @@ public class DroolsAdminConsole extends UI {
|
|||
userpasswdTextField.getValue());
|
||||
for (Space space : listSpaces) {
|
||||
for (SpaceProject spaceProject : space.getProjects()) {
|
||||
// kieServerRepositoryService.getProjectContent(config.getKiewbUrl(), userNameTextField.getValue(),
|
||||
// userpasswdTextField.getValue(),space.getName(),spaceProject.getName());
|
||||
DisplayData displayData = new DisplayData();
|
||||
displayData.setSpaceName(space.getName());
|
||||
displayData.setSpaceDescription(space.getDescription());
|
||||
|
|
@ -209,7 +211,8 @@ public class DroolsAdminConsole extends UI {
|
|||
}
|
||||
}
|
||||
for (KieContainerInfo kie : listcontainers) {
|
||||
if (kie.getGroupId().equals(displayData.getProjectGroupID())
|
||||
if (kie.getGroupId() != null
|
||||
&& kie.getGroupId().equals(displayData.getProjectGroupID())
|
||||
&& kie.getArtifactId().equals(displayData.getProjectName())
|
||||
&& kie.getVersion().equals(displayData.getProjectVersion())) {
|
||||
displayData.setKieServerArtifactId(kie.getArtifactId());
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import org.chtijbug.drools.console.DroolsAdminConsole;
|
|||
import org.chtijbug.drools.console.service.model.kie.KieContainerInfo;
|
||||
import org.chtijbug.drools.console.service.model.kie.KieContainerRequest;
|
||||
import org.chtijbug.drools.console.service.model.kie.KieServerJobStatus;
|
||||
import org.chtijbug.drools.console.service.model.kie.SpaceProject;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
|
|
@ -34,6 +35,31 @@ public class KieServerRepositoryService {
|
|||
|
||||
private ObjectMapper mapper = new ObjectMapper();
|
||||
|
||||
///spaces/{spaceName}/projects/{projectName}
|
||||
|
||||
public void getProjectContent(String url, String username, String password, String space, String project) {
|
||||
String completeurl = url + "/spaces/" + space + "/projects/" + project;
|
||||
logger.info("url project content : " + completeurl);
|
||||
ResponseEntity<SpaceProject> response = restTemplateKiewb
|
||||
.execute(completeurl, HttpMethod.GET, requestCallback(null, username, password), clientHttpResponse -> {
|
||||
SpaceProject extractedResponse = null;
|
||||
if (clientHttpResponse.getBody() != null) {
|
||||
Scanner s = new Scanner(clientHttpResponse.getBody()).useDelimiter("\\A");
|
||||
String result = s.hasNext() ? s.next() : "";
|
||||
|
||||
SpaceProject values = mapper.readValue(result, SpaceProject.class);
|
||||
extractedResponse = values;
|
||||
}
|
||||
ResponseEntity<SpaceProject> extractedValue = new ResponseEntity<>(extractedResponse, clientHttpResponse.getHeaders(), clientHttpResponse.getStatusCode());
|
||||
return extractedValue;
|
||||
});
|
||||
SpaceProject reponseMoteur;
|
||||
|
||||
reponseMoteur = response.getBody();
|
||||
System.out.println(reponseMoteur);
|
||||
}
|
||||
|
||||
|
||||
public List<KieContainerInfo> getContainerList(String url, String username, String password) {
|
||||
List<KieContainerInfo> results = new ArrayList<>();
|
||||
String completeurl = url + "/containers";
|
||||
|
|
@ -66,9 +92,11 @@ public class KieServerRepositoryService {
|
|||
System.out.println("coucou");
|
||||
kieContainerInfo.setContainerId((String) container.get("container-id"));
|
||||
Map artifact = (Map) container.get("resolved-release-id");
|
||||
if (artifact != null) {
|
||||
kieContainerInfo.setArtifactId((String) artifact.get("artifact-id"));
|
||||
kieContainerInfo.setGroupId((String) artifact.get("group-id"));
|
||||
kieContainerInfo.setVersion((String) artifact.get("version"));
|
||||
}
|
||||
kieContainerInfo.setContainerAlias((String) container.get("container-alias"));
|
||||
results.add(kieContainerInfo);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,155 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<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/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<artifactId>drools-framework-kie-wb-parent</artifactId>
|
||||
<groupId>com.pymmasoftware.jbpm</groupId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>kie-drools-framework-rest-backend</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>kie drools Framework - REST Backend</name>
|
||||
<description>kie drools Framework - REST Backend</description>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.uberfire</groupId>
|
||||
<artifactId>uberfire-rest-client</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jboss.spec.javax.ejb</groupId>
|
||||
<artifactId>jboss-ejb-api_3.2_spec</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.uberfire</groupId>
|
||||
<artifactId>uberfire-nio2-model</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.uberfire</groupId>
|
||||
<artifactId>uberfire-nio2-api</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.uberfire</groupId>
|
||||
<artifactId>uberfire-io</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.uberfire</groupId>
|
||||
<artifactId>uberfire-project-api</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-api</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.uberfire</groupId>
|
||||
<artifactId>uberfire-api</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.uberfire</groupId>
|
||||
<artifactId>uberfire-commons</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.kie.soup</groupId>
|
||||
<artifactId>kie-soup-commons</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jboss.errai</groupId>
|
||||
<artifactId>errai-bus</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jboss.errai</groupId>
|
||||
<artifactId>errai-security-server</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jasypt</groupId>
|
||||
<artifactId>jasypt</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.ocpsoft.prettytime</groupId>
|
||||
<artifactId>prettytime</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.uberfire</groupId>
|
||||
<artifactId>uberfire-social-activities-api</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.uberfire</groupId>
|
||||
<artifactId>uberfire-social-activities-backend</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.uberfire</groupId>
|
||||
<artifactId>uberfire-structure-api</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.uberfire</groupId>
|
||||
<artifactId>uberfire-security-api</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.uberfire</groupId>
|
||||
<artifactId>uberfire-backend-server</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.uberfire</groupId>
|
||||
<artifactId>uberfire-commons-editor-api</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.uberfire</groupId>
|
||||
<artifactId>uberfire-commons-editor-backend</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.uberfire</groupId>
|
||||
<artifactId>uberfire-services-api</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- The version of commons-io in droolsjbpm-build-bootstrap pom is way too old-->
|
||||
<dependency>
|
||||
<groupId>commons-io</groupId>
|
||||
<artifactId>commons-io</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-fileupload</groupId>
|
||||
<artifactId>commons-fileupload</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.thoughtworks.xstream</groupId>
|
||||
<artifactId>xstream</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.jasypt</groupId>
|
||||
<artifactId>jasypt</artifactId>
|
||||
<version>1.9.2</version>
|
||||
</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.ocpsoft.prettytime</groupId>
|
||||
<artifactId>prettytime</artifactId>
|
||||
<version>3.0.2.Final</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-fileupload</groupId>
|
||||
<artifactId>commons-fileupload</artifactId>
|
||||
<version>1.3.1</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
||||
</project>
|
||||
|
|
@ -0,0 +1,284 @@
|
|||
package org.chtijbug.kie.rest.backend;
|
||||
|
||||
import org.guvnor.common.services.project.model.WorkspaceProject;
|
||||
import org.guvnor.common.services.project.service.WorkspaceProjectService;
|
||||
import org.guvnor.rest.client.ProjectResponse;
|
||||
import org.guvnor.rest.client.Space;
|
||||
import org.guvnor.structure.organizationalunit.OrganizationalUnit;
|
||||
import org.guvnor.structure.organizationalunit.OrganizationalUnitService;
|
||||
import org.guvnor.structure.repositories.PublicURI;
|
||||
import org.guvnor.structure.repositories.Repository;
|
||||
import org.guvnor.structure.repositories.RepositoryService;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.uberfire.io.IOService;
|
||||
import org.uberfire.java.nio.file.DirectoryStream;
|
||||
|
||||
import javax.enterprise.context.ApplicationScoped;
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Named;
|
||||
import javax.ws.rs.*;
|
||||
import javax.ws.rs.core.Context;
|
||||
import javax.ws.rs.core.MediaType;
|
||||
import javax.ws.rs.core.UriInfo;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
@Path("/chtijbug")
|
||||
@Named
|
||||
@ApplicationScoped
|
||||
public class PackageResource {
|
||||
|
||||
private static final org.slf4j.Logger logger = LoggerFactory.getLogger(PackageResource.class);
|
||||
|
||||
@Context
|
||||
protected UriInfo uriInfo;
|
||||
|
||||
@Inject
|
||||
@Named("ioStrategy")
|
||||
private IOService ioService;
|
||||
|
||||
@Inject
|
||||
private OrganizationalUnitService organizationalUnitService;
|
||||
|
||||
@Inject
|
||||
private RepositoryService repositoryService;
|
||||
|
||||
|
||||
@Inject
|
||||
private WorkspaceProjectService workspaceProjectService;
|
||||
|
||||
public PackageResource() {
|
||||
System.out.println("coucou");
|
||||
}
|
||||
|
||||
@GET
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
@Path("/detailedSpaces")
|
||||
// @RolesAllowed({REST_ROLE, REST_PROJECT_ROLE})
|
||||
public Collection<Space> getProjects() {
|
||||
logger.debug("-----getSpaces--- ");
|
||||
|
||||
final List<Space> spaces = new ArrayList<Space>();
|
||||
for (OrganizationalUnit ou : organizationalUnitService.getOrganizationalUnits()) {
|
||||
spaces.add(getSpace(ou));
|
||||
}
|
||||
|
||||
return spaces;
|
||||
}
|
||||
|
||||
private Space getSpace(OrganizationalUnit ou) {
|
||||
final Space space = new Space();
|
||||
space.setName(ou.getName());
|
||||
space.setOwner(ou.getOwner());
|
||||
space.setDefaultGroupId(ou.getDefaultGroupId());
|
||||
|
||||
final List<ProjectResponse> repoNames = new ArrayList<>();
|
||||
for (WorkspaceProject workspaceProject : workspaceProjectService.getAllWorkspaceProjects(ou)) {
|
||||
repoNames.add(getProjectResponse(workspaceProject));
|
||||
}
|
||||
|
||||
space.setProjects(repoNames);
|
||||
return space;
|
||||
}
|
||||
|
||||
private ProjectResponse getProjectResponse(WorkspaceProject workspaceProject) {
|
||||
final ProjectResponse projectResponse = new ProjectResponse();
|
||||
projectResponse.setName(workspaceProject.getName());
|
||||
projectResponse.setSpaceName(workspaceProject.getOrganizationalUnit().getName());
|
||||
|
||||
if (workspaceProject.getMainModule() != null) {
|
||||
projectResponse.setGroupId(workspaceProject.getMainModule().getPom().getGav().getGroupId());
|
||||
projectResponse.setVersion(workspaceProject.getMainModule().getPom().getGav().getVersion());
|
||||
projectResponse.setDescription(workspaceProject.getMainModule().getPom().getDescription());
|
||||
}
|
||||
|
||||
final ArrayList<org.guvnor.rest.client.PublicURI> publicURIs = new ArrayList<>();
|
||||
|
||||
for (PublicURI publicURI : workspaceProject.getRepository().getPublicURIs()) {
|
||||
final org.guvnor.rest.client.PublicURI responseURI = new org.guvnor.rest.client.PublicURI();
|
||||
responseURI.setProtocol(publicURI.getProtocol());
|
||||
responseURI.setUri(publicURI.getURI());
|
||||
publicURIs.add(responseURI);
|
||||
}
|
||||
|
||||
projectResponse.setPublicURIs(publicURIs);
|
||||
return projectResponse;
|
||||
}
|
||||
|
||||
@GET
|
||||
@Path("{organizationalUnitName}/{repositoryName}")
|
||||
@Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
|
||||
public Collection<Package> getPackagesAsJAXB(@PathParam("organizationalUnitName") String organizationalUnitName, @PathParam("repositoryName") String repositoryName) {
|
||||
OrganizationalUnit organizationalUnit = organizationalUnitService.getOrganizationalUnit(organizationalUnitName);
|
||||
Collection<Repository> repositories = organizationalUnit.getRepositories();
|
||||
for (Repository repository : repositories) {
|
||||
if (repository.getAlias().equals(repositoryName)) {
|
||||
|
||||
|
||||
Collection<Package> packages = new ArrayList<>();
|
||||
|
||||
return packages;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@GET
|
||||
@Path("{organizationalUnitName}/{repositoryName}/{packageName}/assets")
|
||||
@Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
|
||||
public Collection<String> getAssetsAsJAXB(
|
||||
@PathParam("organizationalUnitName") String organizationalUnitName, @PathParam("repositoryName") String repositoryName,
|
||||
@PathParam("packageName") String packageName,
|
||||
@QueryParam("format") List<String> formats) {
|
||||
try {
|
||||
List<String> contentList = new LinkedList<>();
|
||||
|
||||
|
||||
return contentList;
|
||||
} catch (RuntimeException e) {
|
||||
throw new WebApplicationException(e);
|
||||
}
|
||||
}
|
||||
|
||||
private String getProject(String organizationalUnitName, String repositoryName, String packageName) {
|
||||
OrganizationalUnit organizationalUnit = organizationalUnitService.getOrganizationalUnit(organizationalUnitName);
|
||||
Collection<Repository> repositories = organizationalUnit.getRepositories();
|
||||
|
||||
return "tto";
|
||||
}
|
||||
|
||||
|
||||
private void getContentSource(DirectoryStream<org.uberfire.java.nio.file.Path> directoryStream, String asset, List<org.uberfire.java.nio.file.Path> pathLinkedList) {
|
||||
for (org.uberfire.java.nio.file.Path elementPath : directoryStream) {
|
||||
if (org.uberfire.java.nio.file.Files.isDirectory(elementPath)) {
|
||||
DirectoryStream<org.uberfire.java.nio.file.Path> adirectoryStream = ioService.newDirectoryStream(elementPath);
|
||||
getContentSource(adirectoryStream, asset, pathLinkedList);
|
||||
} else {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void getContent(DirectoryStream<org.uberfire.java.nio.file.Path> directoryStream, Collection<String> contentList) {
|
||||
for (org.uberfire.java.nio.file.Path elementPath : directoryStream) {
|
||||
if (org.uberfire.java.nio.file.Files.isDirectory(elementPath)) {
|
||||
DirectoryStream<org.uberfire.java.nio.file.Path> adirectoryStream = ioService.newDirectoryStream(elementPath);
|
||||
getContent(adirectoryStream, contentList);
|
||||
} else {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private org.uberfire.java.nio.file.Path getFileElementPath(DirectoryStream<org.uberfire.java.nio.file.Path> directoryStream, String assetName) {
|
||||
for (org.uberfire.java.nio.file.Path elementPath : directoryStream) {
|
||||
if (org.uberfire.java.nio.file.Files.isDirectory(elementPath)) {
|
||||
DirectoryStream<org.uberfire.java.nio.file.Path> adirectoryStream = ioService.newDirectoryStream(elementPath);
|
||||
org.uberfire.java.nio.file.Path foundElementPath = getFileElementPath(adirectoryStream, assetName);
|
||||
if (foundElementPath != null) {
|
||||
return foundElementPath;
|
||||
}
|
||||
} else {
|
||||
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private org.uberfire.java.nio.file.Path getDirectoryElementPath(DirectoryStream<org.uberfire.java.nio.file.Path> directoryStream, String assetName) {
|
||||
for (org.uberfire.java.nio.file.Path elementPath : directoryStream) {
|
||||
if (org.uberfire.java.nio.file.Files.isDirectory(elementPath)) {
|
||||
DirectoryStream<org.uberfire.java.nio.file.Path> adirectoryStream = ioService.newDirectoryStream(elementPath);
|
||||
if (elementPath.getFileName().toString().equals(assetName)) {
|
||||
return elementPath;
|
||||
}
|
||||
org.uberfire.java.nio.file.Path foundElementPath = getDirectoryElementPath(adirectoryStream, assetName);
|
||||
if (foundElementPath != null) {
|
||||
return foundElementPath;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@GET
|
||||
@Path("{organizationalUnitName}/{repositoryName}/{packageName}/assets/{assetName}")
|
||||
@Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
|
||||
public Collection<String> getAssetAsJaxB(
|
||||
@PathParam("organizationalUnitName") String organizationalUnitName, @PathParam("repositoryName") String repositoryName,
|
||||
@PathParam("packageName") String packageName, @PathParam("assetName") String assetName) {
|
||||
List<String> resultList = new LinkedList<>();
|
||||
try {
|
||||
|
||||
return resultList;
|
||||
} catch (RuntimeException e) {
|
||||
throw new WebApplicationException(e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@GET
|
||||
@Path("{organizationalUnitName}/{repositoryName}/{packageName}/assets/{assetName}/source")
|
||||
@Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
|
||||
public String getAssetSource(
|
||||
@PathParam("organizationalUnitName") String organizationalUnitName, @PathParam("repositoryName") String repositoryName,
|
||||
@PathParam("packageName") String packageName, @PathParam("assetName") String assetName) {
|
||||
List<String> resultList = new LinkedList<>();
|
||||
String result = "";
|
||||
try {
|
||||
|
||||
return result;
|
||||
} catch (RuntimeException e) {
|
||||
throw new WebApplicationException(e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@PUT
|
||||
@Path("{organizationalUnitName}/{repositoryName}/{packageName}/asset/{assetName}")
|
||||
@Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
|
||||
public void updateAssetFromJAXB(
|
||||
@PathParam("organizationalUnitName") String organizationalUnitName, @PathParam("repositoryName") String repositoryName,
|
||||
@PathParam("packageName") String packageName,
|
||||
@PathParam("assetName") String assetName, String asset) {
|
||||
try {
|
||||
|
||||
} catch (RuntimeException e) {
|
||||
throw new WebApplicationException(e);
|
||||
}
|
||||
}
|
||||
|
||||
@POST
|
||||
@Path("{organizationalUnitName}/{repositoryName}/{packageName}/newAsset")
|
||||
@Consumes(MediaType.MULTIPART_FORM_DATA)
|
||||
@Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
|
||||
public String createAssetFromSourceAndJAXB(
|
||||
@PathParam("organizationalUnitName") String organizationalUnitName, @PathParam("repositoryName") String repositoryName,
|
||||
@PathParam("packageName") String packageName, String asset) {
|
||||
try {
|
||||
|
||||
} catch (Exception e) {
|
||||
throw new WebApplicationException(e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@PUT
|
||||
@Path("{organizationalUnitName}/{repositoryName}/{packageName}/asset/{assetName}/source")
|
||||
@Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN})
|
||||
@Produces({MediaType.WILDCARD})
|
||||
public void updateAssetSource(
|
||||
@PathParam("organizationalUnitName") String organizationalUnitName, @PathParam("repositoryName") String repositoryName,
|
||||
@PathParam("packageName") String packageName, @PathParam("assetName") String assetName, String content) {
|
||||
try {
|
||||
|
||||
|
||||
} catch (Exception e) {
|
||||
throw new WebApplicationException(e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
package org.chtijbug.kie.rest.backend;
|
||||
|
||||
public interface PermissionConstants {
|
||||
|
||||
public static final String REST_ROLE = "rest-all";
|
||||
public static final String REST_PROJECT_ROLE = "rest-project";
|
||||
public static final String REST_DEPLOYMENT_ROLE = "rest-deployment";
|
||||
public static final String REST_PROCESS_ROLE = "rest-process";
|
||||
public static final String REST_PROCESS_RO_ROLE = "rest-process-read-only";
|
||||
public static final String REST_TASK_ROLE = "rest-task";
|
||||
public static final String REST_TASK_RO_ROLE = "rest-task-read-only";
|
||||
public static final String REST_QUERY_ROLE = "rest-query";
|
||||
public static final String REST_CLIENT_ROLE = "rest-client";
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
#
|
||||
# Copyright 2012 JBoss Inc
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# ErraiApp.properties
|
||||
#
|
||||
# Do not remove, even if empty!
|
||||
#
|
||||
# This is a marker file. When it is detected inside a JAR or at the
|
||||
# top of any classpath, the subdirectories are scanned for deployable
|
||||
# components. As such, all Errai application modules in a project
|
||||
# should contain an ErraiApp.properties at the root of all classpaths
|
||||
# that you wish to be scanned.
|
||||
#
|
||||
# There are also some configuration options that can be set in this
|
||||
# file, although it is rarely necessary. See the documentation at
|
||||
# https://docs.jboss.org/author/display/ERRAI/ErraiApp.properties
|
||||
# for details.
|
||||
|
|
@ -3,7 +3,7 @@
|
|||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>pymma-jbpm-platform-parent</artifactId>
|
||||
<artifactId>drools-framework-kie-wb-parent</artifactId>
|
||||
<groupId>com.pymmasoftware.jbpm</groupId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
|
@ -12,11 +12,17 @@
|
|||
<artifactId>kie-wb</artifactId>
|
||||
|
||||
<packaging>pom</packaging>
|
||||
<name>Pymma Plarform jbpm-console</name>
|
||||
<name>Pymma platform jbpm-console</name>
|
||||
<description>Pymma Plarform Kie-wb
|
||||
</description>
|
||||
<dependencies>
|
||||
|
||||
<!--dependency>
|
||||
<groupId>com.pymmasoftware.jbpm</groupId>
|
||||
<artifactId>kie-drools-framework-rest-backend</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency-->
|
||||
|
||||
<dependency>
|
||||
<groupId>org.kie</groupId>
|
||||
<artifactId>kie-wb</artifactId>
|
||||
|
|
@ -9,10 +9,9 @@
|
|||
under the License. -->
|
||||
|
||||
<persistence version="2.0"
|
||||
xmlns="http://java.sun.com/xml/ns/persistence" xmlns:orm="http://java.sun.com/xml/ns/persistence/orm"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd
|
||||
http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xml/ns/persistence/orm_2_0.xsd">
|
||||
xmlns="http://java.sun.com/xml/ns/persistence"
|
||||
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
|
||||
|
||||
<persistence-unit name="org.jbpm.persistence.jpa" transaction-type="JTA">
|
||||
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
|
||||
55
drools-framework-kie-wb-parent/pom.xml
Normal file
55
drools-framework-kie-wb-parent/pom.xml
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<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">
|
||||
<parent>
|
||||
<artifactId>pymma-jbpm-platform-parent</artifactId>
|
||||
<groupId>com.pymmasoftware.jbpm</groupId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<packaging>pom</packaging>
|
||||
<artifactId>drools-framework-kie-wb-parent</artifactId>
|
||||
<modules>
|
||||
<module>kie-wb</module>
|
||||
<module>kie-drools-framework-rest-backend</module>
|
||||
</modules>
|
||||
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.uberfire</groupId>
|
||||
<artifactId>uberfire-bom</artifactId>
|
||||
<!-- Using ${uberfire.version} instead of ${project.version} enables easier way to create hot fixes
|
||||
(one-off patches). This pom is a parent for all uberfire modules, so when version is changed in
|
||||
one of them, the ${project.version} property changes too and therefore also required version of
|
||||
uberfire-bom. Usage of this property makes it possible to change version of the (sub)module
|
||||
and still use the original version of uberfire-bom. -->
|
||||
<version>2.9.0.Final</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>org.kie.soup</groupId>
|
||||
<artifactId>kie-soup-bom</artifactId>
|
||||
<version>7.12.0.Final</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- Errai -->
|
||||
<dependency>
|
||||
<groupId>org.jboss.errai.bom</groupId>
|
||||
<artifactId>errai-internal-bom</artifactId>
|
||||
<version>4.3.3.Final</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
</project>
|
||||
5
pom.xml
5
pom.xml
|
|
@ -15,15 +15,14 @@
|
|||
<module>drools-framework-runtime-base</module>
|
||||
<module>drools-framework-kie-server-parent</module>
|
||||
<module>kie-server</module>
|
||||
|
||||
<module>kie-wb</module>
|
||||
<module>drools-framework-examples</module>
|
||||
<module>drools-framework-admin-console</module>
|
||||
<module>drools-framework-kie-wb-parent</module>
|
||||
</modules>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<properties>
|
||||
<jbpm.version>7.12.0.Final</jbpm.version>
|
||||
<jbpm.version>7.13.0.Final</jbpm.version>
|
||||
<spring.boot.version>1.5.9.Release</spring.boot.version>
|
||||
<spring.version>4.3.3.Release</spring.version>
|
||||
</properties>
|
||||
|
|
|
|||
Loading…
Add table
editor.link_modal.header
Reference in a new issue