[Fix] Implemented to JSON for notifications
This commit is contained in:
parent
22359e51d8
commit
a9c393f02a
|
@ -118,7 +118,11 @@ public class NotificationResource {
|
||||||
public Response getAllNotifications(@Context HttpServletRequest request) {
|
public Response getAllNotifications(@Context HttpServletRequest request) {
|
||||||
Certificate cert = validateCertificate(request, PRIVILEGE_GET_NOTIFICATIONS_ALL);
|
Certificate cert = validateCertificate(request, PRIVILEGE_GET_NOTIFICATIONS_ALL);
|
||||||
try (StrolchTransaction tx = openTx(cert)) {
|
try (StrolchTransaction tx = openTx(cert)) {
|
||||||
StrolchRootElementToJsonVisitor visitor = new StrolchRootElementToJsonVisitor().flatBags();
|
StrolchRootElementToJsonVisitor visitor = new StrolchRootElementToJsonVisitor()
|
||||||
|
.withoutPolicies()
|
||||||
|
.withoutVersion()
|
||||||
|
.withoutStateVariables()
|
||||||
|
.flatBagsByType(TYPE_TEXT, TYPE_VISIBILITY);
|
||||||
return toResponse(DATA, tx.streamResources(TYPE_NOTIFICATION).map(a -> a.accept(visitor)).toList());
|
return toResponse(DATA, tx.streamResources(TYPE_NOTIFICATION).map(a -> a.accept(visitor)).toList());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error(e.getMessage(), e);
|
logger.error(e.getMessage(), e);
|
||||||
|
|
Loading…
Reference in New Issue