Complex filter query for JcrDeliveryEndpointDefinition (headless)

36 views
Skip to first unread message

Marc Johnen

unread,
Jan 22, 2021, 6:27:22 PM1/22/21
to Magnolia User Mailing List
Hello everyone,
I have the need of a more complex filter than I can find in the examples.
The results should be sorted descending by publicationDate (I tried to add " desc" to the query, then I get no results).
Then content/EventHeader/mainHeadline/text should not be empty (this is not the most important).
I need to filter by content/EventHeader/eventLocations (these are categories mapped with a JcrReferenceResolver) containing an event (category) with a specific id.

Here is my query so far:

As the delivery endpoint is using sql2 and the class FilteringCondition, I guess that my requirements can't be met by the endpoint !?

What would be the best approach to achieve such a filter? Do I need to write my own endpoint?

Thankful for any suggestions.
Greetings
Marc

Excerpt of the JSON:

        {
            "@name": "pageName",
            "@path": "pagePath",
            "@id": "58ea2f3f-df58-4c16-a5bd-1967571bd72a",
            "@nodeType": "mgnl:page",
            "publicationDate": "2020-09-08T06:00:00.000+02:00",
            "de": "true",
            "mgnl:template": "templating:pages/event-page",
            "mgnl:created": "2020-10-26T17:48:34.569+01:00",
            "title": "pagetitle",
            "mgnl:lastModified": "2020-11-02T17:33:34.729+01:00",
            "urlName": "pageName",
            "content": {
                "@name": "content",
                "@path": "pagePath/content",
                "@id": "792e7f63-a629-4019-918c-63c73ef47bec",
                "@nodeType": "mgnl:area",
                "mgnl:lastModified": "2020-11-02T17:33:34.729+01:00",
                "mgnl:created": "2020-10-26T17:48:34.569+01:00",
                "EventHeader": {
                    "@name": "EventHeader",
                    "@path": "pagePath/content/EventHeader",
                    "@id": "eddc406b-624b-4dc7-8f41-d493c73eba03",
                    "@nodeType": "mgnl:component",
                    "validation": "true",
                    "reminder": "true",
                    "mgnl:template": "templating:components/EventHeader",
                    "mgnl:created": "2020-10-26T17:48:34.569+01:00",
                    "registrationDeadline": "4",
                    "mgnl:lastModified": "2020-10-26T18:04:30.921+01:00",
                    "totalSpots": "36",
                    "reminderDeadline": "1",
                    "eventLocations": {
                        "@name": "eventLocations",
                        "@path": "pagePath/content/EventHeader/eventLocations",
                        "@id": "52e8554b-790b-49d5-ba18-9a159d56d07f",
                        "@nodeType": "mgnl:contentNode",
                        "mgnl:lastModified": "2020-10-26T17:52:50.298+01:00",
                        "mgnl:created": "2020-10-26T17:48:34.569+01:00",
                        "00": {
                            "@name": "00",
                            "@path": "pagePath/content/EventHeader/eventLocations/00",
                            "@id": "c03069b3-a739-40ad-8da6-4801a252d2b5",
                            "@nodeType": "mgnl:contentNode",
                            "event": {
                                "@name": "Ort",
                                "@path": "/events/Sektion/Ort",
                                "@id": "83781502-e7ab-47a5-900a-ddb50f69b2eb",
                                "@nodeType": "mgnl:category",
                                "name": "Ort",
                                "level": "level-2",
                                "mgnl:created": "2020-02-25T13:22:07.011+01:00",
                                "displayName": "Limmattal",
                                "mgnl:lastModified": "2020-07-16T14:48:18.773+02:00",
                                "relatedUUID": {
                                    "@name": "relatedUUID",
                                    "@path": "/events/Sektion/Ort/relatedUUID",
                                    "@id": "6d71648a-f272-47d5-8e21-6d0a5eed3ec9",
                                    "@nodeType": "mgnl:contentNode",
                                    "mgnl:lastModified": "2020-04-07T09:00:44.819+02:00",
                                    "mgnl:created": "2020-04-07T09:00:44.819+02:00",
                                    "@nodes": []
                                },
                                "@nodes": [
                                    "relatedUUID"
                                ]
                            },
                            "mgnl:lastModified": "2020-10-26T17:48:34.569+01:00",
                            "mgnl:created": "2020-10-26T17:48:34.569+01:00",
                            "@nodes": []
                        },
                        "@nodes": [
                            "00"
                        ]
                    },
                    ...
                    "mainHeadline": {
                        "@name": "mainHeadline",
                        "@path": "pagePath/content/EventHeader/mainHeadline",
                        "@id": "0b7e5b43-7db1-4432-98aa-36f3c5725263",
                        "@nodeType": "mgnl:contentNode",
                        "text": "sometext, pagetitle",
                        "mgnl:created": "2020-10-26T17:48:34.569+01:00",
                        "type": "h1",
                        "mgnl:lastModified": "2020-10-26T17:52:50.299+01:00",
                        "@nodes": []
                    },
                ...
                "@nodes": [
                    "EventHeader",
                    "00"
                ]
            },
            "@nodes": [
                "content"
            ]
        }
Reply all
Reply to author
Forward
0 new messages