TSK-896: Removed _embedded from History
This commit is contained in:
parent
8f3b338cef
commit
f68e730a72
|
@ -4,11 +4,11 @@ import java.util.ArrayList;
|
|||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.hateoas.PagedResources.PageMetadata;
|
||||
import org.springframework.util.MultiValueMap;
|
||||
|
||||
import pro.taskana.BaseQuery;
|
||||
import pro.taskana.exceptions.InvalidArgumentException;
|
||||
import pro.taskana.rest.resource.PagedResources.PageMetadata;
|
||||
|
||||
/**
|
||||
* Abstract superclass for taskana REST controller with pageable resources.
|
||||
|
@ -76,7 +76,7 @@ public abstract class AbstractPagingController {
|
|||
return pageMetadata;
|
||||
}
|
||||
|
||||
// This method is deprecated please remove it after updating taskana-simple-history reference to it.
|
||||
// This method is deprecated please remove it after updating taskana-simple-history reference to it.
|
||||
@Deprecated
|
||||
protected PageMetadata initPageMetadata(String pagesizeParam, String pageParam, long totalElements)
|
||||
throws InvalidArgumentException {
|
||||
|
|
|
@ -4,7 +4,6 @@ import java.util.List;
|
|||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.hateoas.PagedResources.PageMetadata;
|
||||
import org.springframework.hateoas.config.EnableHypermediaSupport;
|
||||
import org.springframework.hateoas.config.EnableHypermediaSupport.HypermediaType;
|
||||
import org.springframework.http.HttpStatus;
|
||||
|
@ -37,6 +36,7 @@ import pro.taskana.rest.resource.ClassificationResource;
|
|||
import pro.taskana.rest.resource.ClassificationResourceAssembler;
|
||||
import pro.taskana.rest.resource.ClassificationSummaryListResource;
|
||||
import pro.taskana.rest.resource.ClassificationSummaryResourceAssembler;
|
||||
import pro.taskana.rest.resource.PagedResources.PageMetadata;
|
||||
|
||||
/**
|
||||
* Controller for all {@link Classification} related endpoints.
|
||||
|
|
|
@ -5,7 +5,6 @@ import java.util.List;
|
|||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.hateoas.PagedResources.PageMetadata;
|
||||
import org.springframework.hateoas.config.EnableHypermediaSupport;
|
||||
import org.springframework.hateoas.config.EnableHypermediaSupport.HypermediaType;
|
||||
import org.springframework.http.HttpStatus;
|
||||
|
@ -39,6 +38,7 @@ import pro.taskana.exceptions.NotAuthorizedException;
|
|||
import pro.taskana.exceptions.TaskAlreadyExistException;
|
||||
import pro.taskana.exceptions.TaskNotFoundException;
|
||||
import pro.taskana.exceptions.WorkbasketNotFoundException;
|
||||
import pro.taskana.rest.resource.PagedResources.PageMetadata;
|
||||
import pro.taskana.rest.resource.TaskResource;
|
||||
import pro.taskana.rest.resource.TaskResourceAssembler;
|
||||
import pro.taskana.rest.resource.TaskSummaryListResource;
|
||||
|
|
|
@ -7,7 +7,6 @@ import java.util.List;
|
|||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.hateoas.PagedResources;
|
||||
import org.springframework.hateoas.config.EnableHypermediaSupport;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.util.MultiValueMap;
|
||||
|
@ -24,6 +23,7 @@ import pro.taskana.WorkbasketService;
|
|||
import pro.taskana.exceptions.InvalidArgumentException;
|
||||
import pro.taskana.exceptions.NotAuthorizedException;
|
||||
import pro.taskana.ldap.LdapClient;
|
||||
import pro.taskana.rest.resource.PagedResources.PageMetadata;
|
||||
import pro.taskana.rest.resource.WorkbasketAccessItemPaginatedListResource;
|
||||
import pro.taskana.rest.resource.WorkbasketAccessItemResourceAssembler;
|
||||
|
||||
|
@ -80,7 +80,7 @@ public class WorkbasketAccessItemController extends AbstractPagingController {
|
|||
query = applyFilterParams(query, params);
|
||||
query = applySortingParams(query, params);
|
||||
|
||||
PagedResources.PageMetadata pageMetadata = getPageMetadata(params, query);
|
||||
PageMetadata pageMetadata = getPageMetadata(params, query);
|
||||
List<WorkbasketAccessItem> workbasketAccessItems = getQueryList(query, pageMetadata);
|
||||
|
||||
WorkbasketAccessItemPaginatedListResource pagedResources = workbasketAccessItemResourceAssembler.toResources(
|
||||
|
|
|
@ -6,7 +6,6 @@ import java.util.List;
|
|||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.hateoas.PagedResources.PageMetadata;
|
||||
import org.springframework.hateoas.Resources;
|
||||
import org.springframework.hateoas.config.EnableHypermediaSupport;
|
||||
import org.springframework.hateoas.config.EnableHypermediaSupport.HypermediaType;
|
||||
|
@ -43,6 +42,7 @@ import pro.taskana.impl.util.LoggerUtils;
|
|||
import pro.taskana.rest.resource.DistributionTargetListResource;
|
||||
import pro.taskana.rest.resource.DistributionTargetResource;
|
||||
import pro.taskana.rest.resource.DistributionTargetResourceAssembler;
|
||||
import pro.taskana.rest.resource.PagedResources.PageMetadata;
|
||||
import pro.taskana.rest.resource.WorkbasketAccessItemListResource;
|
||||
import pro.taskana.rest.resource.WorkbasketAccessItemResource;
|
||||
import pro.taskana.rest.resource.WorkbasketAccessItemResourceAssembler;
|
||||
|
|
|
@ -5,15 +5,14 @@ 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;
|
||||
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
import org.springframework.web.servlet.support.ServletUriComponentsBuilder;
|
||||
import org.springframework.web.util.UriComponentsBuilder;
|
||||
|
||||
/**
|
||||
* Abstract resources assembler for taskana REST controller with pageable resources.
|
||||
* This method is deprecated, it can be removed after fixing taskana-simple-history references
|
||||
* Abstract resources assembler for taskana REST controller with pageable resources. This method is deprecated, it can
|
||||
* be removed after fixing taskana-simple-history references
|
||||
*/
|
||||
@Deprecated
|
||||
public abstract class AbstractRessourcesAssembler {
|
||||
|
@ -24,7 +23,8 @@ public abstract class AbstractRessourcesAssembler {
|
|||
}
|
||||
|
||||
protected static UriComponentsBuilder getBuilderForOriginalUri() {
|
||||
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
|
||||
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes())
|
||||
.getRequest();
|
||||
UriComponentsBuilder baseUri = ServletUriComponentsBuilder.fromServletMapping(request)
|
||||
.path(request.getRequestURI());
|
||||
|
||||
|
@ -45,7 +45,7 @@ public abstract class AbstractRessourcesAssembler {
|
|||
(new Link(original.replaceQueryParam("page", 1).toUriString())).withRel("first"));
|
||||
pagedResources.add((new Link(
|
||||
original.replaceQueryParam("page", pageMetadata.getTotalPages()).toUriString())).withRel(
|
||||
"last"));
|
||||
"last"));
|
||||
if (pageMetadata.getNumber() > 1L) {
|
||||
pagedResources.add((new Link(
|
||||
original.replaceQueryParam("page", pageMetadata.getNumber() - 1L)
|
||||
|
|
|
@ -3,7 +3,6 @@ package pro.taskana.rest.resource;
|
|||
import java.util.Collection;
|
||||
|
||||
import org.springframework.hateoas.Link;
|
||||
import org.springframework.hateoas.PagedResources.PageMetadata;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
|
|
|
@ -4,7 +4,6 @@ import java.util.Collection;
|
|||
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.hateoas.PagedResources;
|
||||
import org.springframework.hateoas.mvc.ResourceAssemblerSupport;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
|
@ -12,6 +11,7 @@ import pro.taskana.ClassificationService;
|
|||
import pro.taskana.ClassificationSummary;
|
||||
import pro.taskana.impl.ClassificationImpl;
|
||||
import pro.taskana.rest.ClassificationController;
|
||||
import pro.taskana.rest.resource.PagedResources.PageMetadata;
|
||||
import pro.taskana.rest.resource.links.PageLinks;
|
||||
|
||||
/**
|
||||
|
@ -45,7 +45,7 @@ public class ClassificationSummaryResourceAssembler
|
|||
|
||||
@PageLinks(ClassificationController.class)
|
||||
public ClassificationSummaryListResource toResources(Collection<ClassificationSummary> entities,
|
||||
PagedResources.PageMetadata pageMetadata) {
|
||||
PageMetadata pageMetadata) {
|
||||
return new ClassificationSummaryListResource(toResources(entities), pageMetadata);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,7 +3,6 @@ package pro.taskana.rest.resource;
|
|||
import java.util.Collection;
|
||||
|
||||
import org.springframework.hateoas.Link;
|
||||
import org.springframework.hateoas.PagedResources.PageMetadata;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
|
|
@ -5,9 +5,11 @@ import java.util.Arrays;
|
|||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAttribute;
|
||||
|
||||
import org.springframework.hateoas.Link;
|
||||
import org.springframework.hateoas.PagedResources.PageMetadata;
|
||||
import org.springframework.hateoas.ResourceSupport;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
|
@ -80,4 +82,147 @@ public class PagedResources<T> extends ResourceSupport {
|
|||
public Collection<T> getContent() {
|
||||
return Collections.unmodifiableCollection(content);
|
||||
};
|
||||
|
||||
/**
|
||||
* Class for Page Metadata.
|
||||
*/
|
||||
public static class PageMetadata {
|
||||
|
||||
@XmlAttribute
|
||||
@JsonProperty
|
||||
private long size;
|
||||
@XmlAttribute
|
||||
@JsonProperty
|
||||
private long totalElements;
|
||||
@XmlAttribute
|
||||
@JsonProperty
|
||||
private long totalPages;
|
||||
@XmlAttribute
|
||||
@JsonProperty
|
||||
private long number;
|
||||
|
||||
protected PageMetadata() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new {@link PageMetadata} from the given size, number, total elements and total pages.
|
||||
*
|
||||
* @param size
|
||||
* the size
|
||||
* @param number
|
||||
* zero-indexed, must be less than totalPages
|
||||
* @param totalElements
|
||||
* number of elements
|
||||
* @param totalPages
|
||||
* the total pages
|
||||
*/
|
||||
public PageMetadata(long size, long number, long totalElements, long totalPages) {
|
||||
Assert.isTrue(size > -1, "Size must not be negative!");
|
||||
Assert.isTrue(number > -1, "Number must not be negative!");
|
||||
Assert.isTrue(totalElements > -1, "Total elements must not be negative!");
|
||||
Assert.isTrue(totalPages > -1, "Total pages must not be negative!");
|
||||
|
||||
this.size = size;
|
||||
this.number = number;
|
||||
this.totalElements = totalElements;
|
||||
this.totalPages = totalPages;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new {@link PageMetadata} from the given size, number and total elements.
|
||||
*
|
||||
* @param size
|
||||
* the size of the page
|
||||
* @param number
|
||||
* the number of the page
|
||||
* @param totalElements
|
||||
* the total number of elements available
|
||||
*/
|
||||
public PageMetadata(long size, long number, long totalElements) {
|
||||
this(size, number, totalElements, size == 0 ? 0 : (long) Math.ceil((double) totalElements / (double) size));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the requested size of the page.
|
||||
*
|
||||
* @return the size a positive long.
|
||||
*/
|
||||
public long getSize() {
|
||||
return size;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the total number of elements available.
|
||||
*
|
||||
* @return the totalElements a positive long.
|
||||
*/
|
||||
public long getTotalElements() {
|
||||
return totalElements;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns how many pages are available in total.
|
||||
*
|
||||
* @return the totalPages a positive long.
|
||||
*/
|
||||
public long getTotalPages() {
|
||||
return totalPages;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the number of the current page.
|
||||
*
|
||||
* @return the number a positive long.
|
||||
*/
|
||||
public long getNumber() {
|
||||
return number;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#toString()
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.format("Metadata { number: %d, total pages: %d, total elements: %d, size: %d }", number,
|
||||
totalPages, totalElements, size);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#equals(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
|
||||
if (this == obj) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (obj == null || !obj.getClass().equals(getClass())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
PageMetadata that = (PageMetadata) obj;
|
||||
|
||||
return this.number == that.number && this.size == that.size && this.totalElements == that.totalElements
|
||||
&& this.totalPages == that.totalPages;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#hashCode()
|
||||
*/
|
||||
@Override
|
||||
public int hashCode() {
|
||||
|
||||
int result = 17;
|
||||
result += 31 * (int) (this.number ^ this.number >>> 32);
|
||||
result += 31 * (int) (this.size ^ this.size >>> 32);
|
||||
result += 31 * (int) (this.totalElements ^ this.totalElements >>> 32);
|
||||
result += 31 * (int) (this.totalPages ^ this.totalPages >>> 32);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,7 +3,6 @@ package pro.taskana.rest.resource;
|
|||
import java.util.Collection;
|
||||
|
||||
import org.springframework.hateoas.Link;
|
||||
import org.springframework.hateoas.PagedResources.PageMetadata;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@ package pro.taskana.rest.resource;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.hateoas.PagedResources;
|
||||
import org.springframework.hateoas.mvc.ResourceAssemblerSupport;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
|
@ -10,6 +9,7 @@ import pro.taskana.TaskSummary;
|
|||
import pro.taskana.exceptions.InvalidArgumentException;
|
||||
import pro.taskana.exceptions.SystemException;
|
||||
import pro.taskana.rest.TaskController;
|
||||
import pro.taskana.rest.resource.PagedResources.PageMetadata;
|
||||
import pro.taskana.rest.resource.links.PageLinks;
|
||||
|
||||
/**
|
||||
|
@ -35,8 +35,7 @@ public class TaskSummaryResourceAssembler
|
|||
}
|
||||
|
||||
@PageLinks(TaskController.class)
|
||||
public TaskSummaryListResource toResources(List<TaskSummary> taskSummaries,
|
||||
PagedResources.PageMetadata pageMetadata) {
|
||||
public TaskSummaryListResource toResources(List<TaskSummary> taskSummaries, PageMetadata pageMetadata) {
|
||||
return new TaskSummaryListResource(toResources(taskSummaries), pageMetadata);
|
||||
}
|
||||
|
||||
|
|
|
@ -3,7 +3,6 @@ package pro.taskana.rest.resource;
|
|||
import java.util.Collection;
|
||||
|
||||
import org.springframework.hateoas.Link;
|
||||
import org.springframework.hateoas.PagedResources.PageMetadata;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
|
||||
|
|
|
@ -3,7 +3,6 @@ package pro.taskana.rest.resource;
|
|||
import java.util.Collection;
|
||||
|
||||
import org.springframework.hateoas.Link;
|
||||
import org.springframework.hateoas.PagedResources.PageMetadata;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
|
@ -16,12 +15,14 @@ public class WorkbasketAccessItemPaginatedListResource extends PagedResources<Wo
|
|||
super();
|
||||
}
|
||||
|
||||
public WorkbasketAccessItemPaginatedListResource(Collection<WorkbasketAccessItemResource> content, PageMetadata metadata,
|
||||
public WorkbasketAccessItemPaginatedListResource(Collection<WorkbasketAccessItemResource> content,
|
||||
PageMetadata metadata,
|
||||
Link... links) {
|
||||
super(content, metadata, links);
|
||||
}
|
||||
|
||||
public WorkbasketAccessItemPaginatedListResource(Collection<WorkbasketAccessItemResource> content, PageMetadata metadata,
|
||||
public WorkbasketAccessItemPaginatedListResource(Collection<WorkbasketAccessItemResource> content,
|
||||
PageMetadata metadata,
|
||||
Iterable<Link> links) {
|
||||
super(content, metadata, links);
|
||||
}
|
||||
|
|
|
@ -7,7 +7,6 @@ import java.util.List;
|
|||
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.hateoas.PagedResources;
|
||||
import org.springframework.hateoas.mvc.ResourceAssemblerSupport;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
|
@ -18,6 +17,7 @@ import pro.taskana.exceptions.WorkbasketNotFoundException;
|
|||
import pro.taskana.impl.WorkbasketAccessItemImpl;
|
||||
import pro.taskana.rest.WorkbasketAccessItemController;
|
||||
import pro.taskana.rest.WorkbasketController;
|
||||
import pro.taskana.rest.resource.PagedResources.PageMetadata;
|
||||
import pro.taskana.rest.resource.links.PageLinks;
|
||||
|
||||
/**
|
||||
|
@ -50,8 +50,7 @@ public class WorkbasketAccessItemResourceAssembler extends
|
|||
|
||||
@PageLinks(WorkbasketAccessItemController.class)
|
||||
public WorkbasketAccessItemPaginatedListResource toResources(
|
||||
List<WorkbasketAccessItem> entities,
|
||||
PagedResources.PageMetadata pageMetadata) {
|
||||
List<WorkbasketAccessItem> entities, PageMetadata pageMetadata) {
|
||||
return new WorkbasketAccessItemPaginatedListResource(toResources(entities), pageMetadata);
|
||||
}
|
||||
|
||||
|
|
|
@ -3,7 +3,6 @@ package pro.taskana.rest.resource;
|
|||
import java.util.Collection;
|
||||
|
||||
import org.springframework.hateoas.Link;
|
||||
import org.springframework.hateoas.PagedResources.PageMetadata;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
|
|
|
@ -4,7 +4,6 @@ import java.util.List;
|
|||
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.hateoas.PagedResources;
|
||||
import org.springframework.hateoas.mvc.ResourceAssemblerSupport;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
|
@ -12,6 +11,7 @@ import pro.taskana.WorkbasketService;
|
|||
import pro.taskana.WorkbasketSummary;
|
||||
import pro.taskana.impl.WorkbasketImpl;
|
||||
import pro.taskana.rest.WorkbasketController;
|
||||
import pro.taskana.rest.resource.PagedResources.PageMetadata;
|
||||
import pro.taskana.rest.resource.links.PageLinks;
|
||||
|
||||
/**
|
||||
|
@ -35,7 +35,7 @@ public class WorkbasketSummaryResourceAssembler
|
|||
|
||||
@PageLinks(WorkbasketController.class)
|
||||
public WorkbasketSummaryListResource toResources(List<WorkbasketSummary> entities,
|
||||
PagedResources.PageMetadata pageMetadata) {
|
||||
PageMetadata pageMetadata) {
|
||||
return new WorkbasketSummaryListResource(toResources(entities), pageMetadata);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,23 +1,25 @@
|
|||
package pro.taskana.rest.resource.links;
|
||||
|
||||
import static org.springframework.hateoas.mvc.ControllerLinkBuilder.linkTo;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.aspectj.lang.ProceedingJoinPoint;
|
||||
import org.aspectj.lang.annotation.Around;
|
||||
import org.aspectj.lang.annotation.Aspect;
|
||||
import org.aspectj.lang.reflect.MethodSignature;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.hateoas.Link;
|
||||
import org.springframework.hateoas.PagedResources;
|
||||
import org.springframework.hateoas.ResourceSupport;
|
||||
import org.springframework.web.context.request.RequestContextHolder;
|
||||
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
import org.springframework.web.util.UriComponentsBuilder;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static org.springframework.hateoas.mvc.ControllerLinkBuilder.linkTo;
|
||||
import pro.taskana.rest.resource.PagedResources.PageMetadata;
|
||||
|
||||
/**
|
||||
* Implementation of the PageLinks annotation to generate HATEOAS Links for paged list resources.
|
||||
|
@ -27,9 +29,10 @@ import static org.springframework.hateoas.mvc.ControllerLinkBuilder.linkTo;
|
|||
public class PageLinksAspect {
|
||||
|
||||
@Around("@annotation(pro.taskana.rest.resource.links.PageLinks) && args(data, page, ..)")
|
||||
public ResourceSupport addLinksToPageResource(ProceedingJoinPoint joinPoint, List<?> data, PagedResources.PageMetadata page)
|
||||
public ResourceSupport addLinksToPageResource(ProceedingJoinPoint joinPoint, List<?> data, PageMetadata page)
|
||||
throws Throwable {
|
||||
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
|
||||
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes())
|
||||
.getRequest();
|
||||
Method method = ((MethodSignature) joinPoint.getSignature()).getMethod();
|
||||
PageLinks pageLinks = method.getAnnotation(PageLinks.class);
|
||||
Class<?> controller = pageLinks.value();
|
||||
|
|
|
@ -203,13 +203,13 @@ export class TaskQueryComponent implements OnInit {
|
|||
this.created ? this.created.toISOString().substring(0, 10) : undefined,
|
||||
false).subscribe(taskQueryResource => {
|
||||
this.requestInProgressService.setRequestInProgress(false);
|
||||
if (!taskQueryResource._embedded) {
|
||||
if (!taskQueryResource.taskHistoryEvents) {
|
||||
this.taskQuery = null;
|
||||
this.taskQueryResource = null;
|
||||
return null;
|
||||
}
|
||||
this.taskQueryResource = taskQueryResource;
|
||||
this.taskQuery = taskQueryResource._embedded.taskHistoryEventResourceList;
|
||||
this.taskQuery = taskQueryResource.taskHistoryEvents;
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
@ -2,6 +2,6 @@ import { Links } from './links';
|
|||
import { TaskHistoryEventData } from './task-history-event';
|
||||
|
||||
export class TaskHistoryEventResourceData {
|
||||
public _embedded: { 'taskHistoryEventResourceList': Array<TaskHistoryEventData> }
|
||||
public taskHistoryEvents: Array<TaskHistoryEventData>
|
||||
public _links: Links = undefined
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
export const environment = {
|
||||
production: true,
|
||||
taskanaRestUrl: '',
|
||||
taskanaRestUrl: '/api',
|
||||
taskanaLogoutUrl: ''
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue