Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[rest] fixed item links in rest api #1591

Merged
merged 1 commit into from
Aug 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,6 @@ public ItemResource(//
private UriBuilder uriBuilder(final UriInfo uriInfo, final HttpHeaders httpHeaders) {
final UriBuilder uriBuilder = uriInfo.getAbsolutePathBuilder();
respectForwarded(uriBuilder, httpHeaders);
uriBuilder.path("{itemName}");
return uriBuilder;
}

Expand All @@ -208,6 +207,7 @@ public Response getItems(final @Context UriInfo uriInfo, final @Context HttpHead
final Set<String> namespaces = splitAndFilterNamespaces(namespaceSelector, locale);

final UriBuilder uriBuilder = uriBuilder(uriInfo, httpHeaders);
uriBuilder.path("{itemName}");

Stream<EnrichedItemDTO> itemStream = getItems(type, tags).stream() //
.map(item -> EnrichedItemDTOMapper.map(item, recursive, null, uriBuilder, locale)) //
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ private PageDTO createPageBean(String sitemapName, @Nullable String title, @Null
boolean isMapview = "mapview".equalsIgnoreCase(widgetTypeName);
Predicate<Item> itemFilter = (i -> CoreItemFactory.LOCATION.equals(i.getType()));
bean.item = EnrichedItemDTOMapper.map(item, isMapview, itemFilter,
UriBuilder.fromUri(uri).path("{itemName}"), locale);
UriBuilder.fromUri(uri).path("items/{itemName}"), locale);
bean.state = itemUIRegistry.getState(widget).toFullString();
// In case the widget state is identical to the item state, its value is set to null.
if (bean.state != null && bean.state.equals(bean.item.state)) {
Expand Down