TSK-850: rebase cleanup

This commit is contained in:
Mustapha Zorgati 2019-05-10 15:23:21 +02:00 committed by Holger Hagen
parent 164b585add
commit aebd87b935
23 changed files with 67 additions and 74 deletions

View File

@ -36,8 +36,11 @@ function main {
mvn clean install -q -f $REL/../rest/ -B #reinstalling rest because rest-doc is built during tests.
mvn clean verify -q -f $REL/../rest/ -B -pl taskana-rest-spring-example -P history.plugin
elif [[ "$1" == "H2" && "$2" == "LIB" ]]; then
mvn clean install -q -f $REL/.. -N -B
mvn clean install -q -f $REL/../lib/ -B -Dmaven.javadoc.skip
elif [[ "$1" == "POSTGRES_10_4" && "$2" == "CORE" ]]; then
mvn clean install -q -f $REL/.. -N -B
mvn clean install -q -f $REL/../lib -N -B
mvn clean verify -q -f $REL/../lib/taskana-core -B
elif [[ "$1" == "POSTGRES_10_4" && "$2" == "WILDFLY" ]]; then
#installing dependencies for rest (since this tests runs in a different cache)

View File

@ -11,7 +11,7 @@
<parent>
<groupId>pro.taskana</groupId>
<artifactId>taskana-parent</artifactId>
<version>1.1.2-SNAPSHOT</version>
<version>1.1.3-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>

View File

@ -2,7 +2,7 @@
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>
<artifactId>taskana-cdi-example</artifactId>
<version>1.1.2-SNAPSHOT</version>
<version>1.1.3-SNAPSHOT</version>
<packaging>war</packaging>
<name>${project.groupId}:${project.artifactId}</name>
@ -11,7 +11,7 @@
<parent>
<groupId>pro.taskana</groupId>
<artifactId>taskana-lib-parent</artifactId>
<version>1.1.2-SNAPSHOT</version>
<version>1.1.3-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>

View File

@ -2,7 +2,7 @@
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>
<artifactId>taskana-cdi</artifactId>
<version>1.1.2-SNAPSHOT</version>
<version>1.1.3-SNAPSHOT</version>
<name>${project.groupId}:${project.artifactId}</name>
<description>The helper module to integrate taskana into CDI projects.</description>
@ -10,7 +10,7 @@
<parent>
<groupId>pro.taskana</groupId>
<artifactId>taskana-lib-parent</artifactId>
<version>1.1.2-SNAPSHOT</version>
<version>1.1.3-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>

View File

@ -2,7 +2,7 @@
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>
<artifactId>taskana-core</artifactId>
<version>1.1.2-SNAPSHOT</version>
<version>1.1.3-SNAPSHOT</version>
<name>${project.groupId}:${project.artifactId}</name>
<description>The taskana library to include in your project.</description>
@ -10,7 +10,7 @@
<parent>
<groupId>pro.taskana</groupId>
<artifactId>taskana-lib-parent</artifactId>
<version>1.1.2-SNAPSHOT</version>
<version>1.1.3-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>

View File

@ -2,7 +2,7 @@
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>
<artifactId>taskana-spring-example</artifactId>
<version>1.1.2-SNAPSHOT</version>
<version>1.1.3-SNAPSHOT</version>
<name>${project.groupId}:${project.artifactId}</name>
<description>The Taskana Spring sample application.</description>
@ -10,7 +10,7 @@
<parent>
<groupId>pro.taskana</groupId>
<artifactId>taskana-lib-parent</artifactId>
<version>1.1.2-SNAPSHOT</version>
<version>1.1.3-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>

View File

@ -2,7 +2,7 @@
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>
<artifactId>taskana-spring</artifactId>
<version>1.1.2-SNAPSHOT</version>
<version>1.1.3-SNAPSHOT</version>
<name>${project.groupId}:${project.artifactId}</name>
<description>The helper module to integrate taskana into Spring projects.</description>
@ -10,7 +10,7 @@
<parent>
<groupId>pro.taskana</groupId>
<artifactId>taskana-lib-parent</artifactId>
<version>1.1.2-SNAPSHOT</version>
<version>1.1.3-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>

View File

@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>pro.taskana</groupId>
<artifactId>taskana-parent</artifactId>
<version>1.1.2-SNAPSHOT</version>
<version>1.1.3-SNAPSHOT</version>
<packaging>pom</packaging>
<name>${project.groupId}:${project.artifactId}</name>
@ -28,6 +28,7 @@
<version.slf4j>1.7.25</version.slf4j>
<version.json>20180130</version.json>
<version.jackson>2.9.8</version.jackson>
<version.aspectjweaver>1.9.2</version.aspectjweaver>
<version.javax.validation>2.0.1.Final</version.javax.validation>
<version.javax.servlet>4.0.1</version.javax.servlet>

View File

@ -2,7 +2,7 @@
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>
<artifactId>taskana-rest-parent</artifactId>
<version>1.1.2-SNAPSHOT</version>
<version>1.1.3-SNAPSHOT</version>
<packaging>pom</packaging>
<name>${project.groupId}:${project.artifactId}</name>
@ -11,7 +11,7 @@
<parent>
<groupId>pro.taskana</groupId>
<artifactId>taskana-parent</artifactId>
<version>1.1.2-SNAPSHOT</version>
<version>1.1.3-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>

View File

@ -4,7 +4,7 @@
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>
<artifactId>taskana-rest-spring-base</artifactId>
<version>1.1.2-SNAPSHOT</version>
<version>1.1.3-SNAPSHOT</version>
<name>${project.groupId}:${project.artifactId}</name>
<description>groups the minimum required configuration for a taskana REST APP</description>

View File

@ -4,7 +4,7 @@
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>
<artifactId>taskana-rest-spring-example</artifactId>
<version>1.1.2-SNAPSHOT</version>
<version>1.1.3-SNAPSHOT</version>
<name>${project.groupId}:${project.artifactId}</name>
<description>Demo project for taskana-rest-spring</description>
@ -12,7 +12,7 @@
<parent>
<groupId>pro.taskana</groupId>
<artifactId>taskana-rest-parent</artifactId>
<version>1.1.2-SNAPSHOT</version>
<version>1.1.3-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
<dependencyManagement>
@ -50,7 +50,7 @@
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
</dependency>
</dependency>
<dependency>
<groupId>com.ibm.db2.jcc</groupId>
<artifactId>db2jcc4</artifactId>
@ -61,7 +61,7 @@
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>9.4.1212</version>
<version>${version.postgres}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>

View File

@ -4,7 +4,7 @@
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>
<artifactId>taskana-rest-spring-test</artifactId>
<version>1.1.2-SNAPSHOT</version>
<version>1.1.3-SNAPSHOT</version>
<name>${project.groupId}:${project.artifactId}</name>
<description>Exclusive test module. Contains integration tests and build rest-doc.</description>
@ -12,7 +12,7 @@
<parent>
<groupId>pro.taskana</groupId>
<artifactId>taskana-rest-parent</artifactId>
<version>1.1.2-SNAPSHOT</version>
<version>1.1.3-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>

View File

@ -2,7 +2,7 @@
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>
<artifactId>taskana-rest-spring-wildfly-example</artifactId>
<version>1.1.2-SNAPSHOT</version>
<version>1.1.3-SNAPSHOT</version>
<packaging>war</packaging>
<name>${project.groupId}:${project.artifactId}</name>
@ -11,7 +11,7 @@
<parent>
<groupId>pro.taskana</groupId>
<artifactId>taskana-rest-parent</artifactId>
<version>1.1.2-SNAPSHOT</version>
<version>1.1.3-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>

View File

@ -3,7 +3,7 @@
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>
<artifactId>taskana-rest-spring</artifactId>
<version>1.1.2-SNAPSHOT</version>
<version>1.1.3-SNAPSHOT</version>
<name>${project.groupId}:${project.artifactId}</name>
<description>The taskana rest logic.</description>
@ -11,7 +11,7 @@
<parent>
<groupId>pro.taskana</groupId>
<artifactId>taskana-rest-parent</artifactId>
<version>1.1.2-SNAPSHOT</version>
<version>1.1.3-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
@ -62,6 +62,16 @@
<artifactId>taskana-spring</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
<version>${version.spring}</version>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<version>${version.aspectjweaver}</version>
</dependency>
<!-- TEST -->
<dependency>
@ -107,19 +117,6 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
<version>${spring.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<version>1.9.2</version>
<scope>compile</scope>
</dependency>
<!---->
</dependencies>
</project>

View File

@ -48,8 +48,8 @@ public abstract class AbstractPagingController {
return pageMetadata;
}
protected List<?> getQueryList(BaseQuery<?, ?> query, PageMetadata pageMetadata) {
List<?> resultList;
protected <T> List<T> getQueryList(BaseQuery<T, ?> query, PageMetadata pageMetadata) {
List<T> resultList;
if (pageMetadata != null) {
resultList = query.listPage((int) pageMetadata.getNumber(), (int) pageMetadata.getSize());
} else {

View File

@ -96,8 +96,7 @@ public class ClassificationController extends AbstractPagingController {
query = applyFilterParams(query, params);
PageMetadata pageMetadata = getPageMetadata(params, query);
List<ClassificationSummary> classificationSummaries = (List<ClassificationSummary>) getQueryList(query,
pageMetadata);
List<ClassificationSummary> classificationSummaries = getQueryList(query, pageMetadata);
ResponseEntity<PagedResources<ClassificationSummaryResource>> response = new ResponseEntity<>(
classificationSummaryResourceAssembler.toResources(

View File

@ -109,7 +109,7 @@ public class TaskController extends AbstractPagingController {
query = applySortingParams(query, params);
PageMetadata pageMetadata = getPageMetadata(params, query);
List<TaskSummary> taskSummaries = (List<TaskSummary>) getQueryList(query, pageMetadata);
List<TaskSummary> taskSummaries = getQueryList(query, pageMetadata);
PagedResources<TaskSummaryResource> pagedResources = taskSummaryResourceAssembler.toResources(taskSummaries,
pageMetadata);

View File

@ -25,8 +25,8 @@ import pro.taskana.WorkbasketService;
import pro.taskana.exceptions.InvalidArgumentException;
import pro.taskana.exceptions.NotAuthorizedException;
import pro.taskana.ldap.LdapClient;
import pro.taskana.rest.resource.WorkbasketAccessItemResourceAssembler;
import pro.taskana.rest.resource.WorkbasketAccessItemResource;
import pro.taskana.rest.resource.WorkbasketAccessItemResourceAssembler;
/**
* Controller for Workbasket access.
@ -79,15 +79,15 @@ public class WorkbasketAccessItemController extends AbstractPagingController {
query = applySortingParams(query, params);
PagedResources.PageMetadata pageMetadata = getPageMetadata(params, query);
List<WorkbasketAccessItem> workbasketAccessItems = (List<WorkbasketAccessItem>) getQueryList(query,
pageMetadata);
List<WorkbasketAccessItem> workbasketAccessItems = getQueryList(query, pageMetadata);
PagedResources pagedResources = workbasketAccessItemResourceAssembler.toResources(
PagedResources<WorkbasketAccessItemResource> pagedResources = workbasketAccessItemResourceAssembler.toResources(
workbasketAccessItems,
pageMetadata
);
ResponseEntity<PagedResources<WorkbasketAccessItemResource>> response = new ResponseEntity<>(pagedResources, HttpStatus.OK);
ResponseEntity<PagedResources<WorkbasketAccessItemResource>> response = new ResponseEntity<>(pagedResources,
HttpStatus.OK);
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("Exit from getWorkbasketAccessItems(), returning {}", response);
}

View File

@ -111,8 +111,8 @@ public class WorkbasketController extends AbstractPagingController {
query = applyFilterParams(query, params);
PageMetadata pageMetadata = getPageMetadata(params, query);
List<WorkbasketSummary> workbasketSummaries = (List<WorkbasketSummary>) getQueryList(query, pageMetadata);
PagedResources pagedResources = workbasketSummaryResourceAssembler.toResources(workbasketSummaries,
List<WorkbasketSummary> workbasketSummaries = getQueryList(query, pageMetadata);
PagedResources<WorkbasketSummaryResource> pagedResources = workbasketSummaryResourceAssembler.toResources(workbasketSummaries,
pageMetadata);
ResponseEntity<PagedResources<WorkbasketSummaryResource>> response = new ResponseEntity<>(pagedResources,

View File

@ -1,5 +1,9 @@
package pro.taskana.rest.resource;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import org.springframework.hateoas.Link;
import org.springframework.hateoas.PagedResources;
import org.springframework.web.context.request.RequestContextHolder;
@ -7,11 +11,6 @@ import org.springframework.web.context.request.ServletRequestAttributes;
import org.springframework.web.servlet.support.ServletUriComponentsBuilder;
import org.springframework.web.util.UriComponentsBuilder;
import javax.servlet.http.HttpServletRequest;
import java.util.Iterator;
import java.util.Map;
/**
* Abstract resources assembler for taskana REST controller with pageable resources.
* This method is deprecated, it can be removed after fixing taskana-simple-history references
@ -28,16 +27,11 @@ public abstract class AbstractRessourcesAssembler {
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
UriComponentsBuilder baseUri = ServletUriComponentsBuilder.fromServletMapping(request)
.path(request.getRequestURI());
Iterator var2 = request.getParameterMap().entrySet().iterator();
while (var2.hasNext()) {
Map.Entry<String, String[]> entry = (Map.Entry) var2.next();
String[] var4 = (String[]) entry.getValue();
int var5 = var4.length;
for (int var6 = 0; var6 < var5; ++var6) {
String value = var4[var6];
baseUri.queryParam((String) entry.getKey(), new Object[] {value});
for (Map.Entry<String, String[]> entry : request.getParameterMap().entrySet()) {
String[] var4 = entry.getValue();
for (String value : var4) {
baseUri.queryParam(entry.getKey(), value);
}
}
@ -48,19 +42,19 @@ public abstract class AbstractRessourcesAssembler {
PagedResources.PageMetadata pageMetadata) {
UriComponentsBuilder original = getBuilderForOriginalUri();
pagedResources.add(
(new Link(original.replaceQueryParam("page", new Object[] {1}).toUriString())).withRel("first"));
(new Link(original.replaceQueryParam("page", 1).toUriString())).withRel("first"));
pagedResources.add((new Link(
original.replaceQueryParam("page", new Object[] {pageMetadata.getTotalPages()}).toUriString())).withRel(
original.replaceQueryParam("page", pageMetadata.getTotalPages()).toUriString())).withRel(
"last"));
if (pageMetadata.getNumber() > 1L) {
pagedResources.add((new Link(
original.replaceQueryParam("page", new Object[] {pageMetadata.getNumber() - 1L})
original.replaceQueryParam("page", pageMetadata.getNumber() - 1L)
.toUriString())).withRel("prev"));
}
if (pageMetadata.getNumber() < pageMetadata.getTotalPages()) {
pagedResources.add((new Link(
original.replaceQueryParam("page", new Object[] {pageMetadata.getNumber() + 1L})
original.replaceQueryParam("page", pageMetadata.getNumber() + 1L)
.toUriString())).withRel("next"));
}

View File

@ -84,7 +84,7 @@ public class TaskSummaryResource extends ResourceSupport {
this.isTransferred = taskSummary.isTransferred();
this.attachmentSummaryResources = taskSummary.getAttachmentSummaries()
.stream()
.map(attachment -> new AttachmentSummaryResource(attachment))
.map(AttachmentSummaryResource::new)
.collect(Collectors.toList());
this.custom1 = taskSummary.getCustomAttribute("1");
this.custom2 = taskSummary.getCustomAttribute("2");

View File

@ -25,13 +25,12 @@ public class TaskSummaryResourceAssembler
@Override
public TaskSummaryResource toResource(TaskSummary taskSummary) {
TaskSummaryResource resource = null;
TaskSummaryResource resource;
try {
resource = new TaskSummaryResource(taskSummary);
return resource;
} catch (InvalidArgumentException e) {
throw new SystemException("caught unexpected Exception.", e.getCause());
} finally {
return resource;
}
}

View File

@ -2,7 +2,7 @@
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>
<artifactId>taskana-web</artifactId>
<version>1.1.2-SNAPSHOT</version>
<version>1.1.3-SNAPSHOT</version>
<name>${project.groupId}:${project.artifactId}</name>
<description>taskana web</description>
@ -10,7 +10,7 @@
<parent>
<groupId>pro.taskana</groupId>
<artifactId>taskana-rest-parent</artifactId>
<version>1.1.2-SNAPSHOT</version>
<version>1.1.3-SNAPSHOT</version>
<relativePath>../rest</relativePath>
</parent>