Thanks for this very detailed reply. I will work through what you have
suggested and see how I go.

I had a look at tapestry-resteasy but it seems to rely on hibernate or
jpa and I am using cayenne. I am not sure what is required for
org.tynamo.services.PersistenceService. Also tapestry-resteasy says I
don't need to edit web.xml.

Another example I am following says I do need to edit web.xml.
https://github.com/andrus/wowodc13 is an example for tapestry and
cayenne and jersey 1.x rest. It seems to rely on a JerseyTapestryBridge
[1] but the code looks specific to jersey 1.x and wouldn't work with
jersey 2.x

Cheers

Tim

[1]
https://github.com/andrus/wowodc13/blob/master/site/src/main/java/demo/rest/jersey/JerseyTapestryBridge.java

On 3/8/21 17:15, Ben Weidig wrote:
> Hi Tim,
>
> full disclosure: I haven't used Cayenne or Agrest, but I checked out their
> documentation.
>
> I don't think there's anything Tapestry-specific needed to get it up and
> running except setting up Rest.
> They say in their docs that you still have to write your JAX-RS endpoints
> and do security yourself.
>
> For JAX-RS, there's tapestry-resteasy
> https://www.tynamo.org/tapestry-resteasy+guide/
> There are examples how to add Rest to Tapestry and register your resources.
>
> The AgRuntime should be contributable just like a Rest resource. RestEasy
> treats many of its classes are contributable (Resources, Provider, etc.).
> You could create a service to build it.
>
> @Contribute(javax.ws.rs.core.Application.class)
> public static void configureRestProviders(Configuration<Object> singletons,
> YourAgRuntimeBuilder builder) {
>     singletons.add(builder.build());
>     singletons.addInstance(YourCredentialsInterceptor.class);
>     singletons.addInstance(YourResource.class);
> }
>
> For security, we use custom headers containing an API key/secret that are
> validated by a javax.ws.rs.container.ContainerRequestFilter with
> @Priority(Priorities.AUTHENTICATION) and
> @Priority(Priorities.AUTHORIZATION) and plug in your security code.
>
> But as said before, I haven't tested it, and it just looks this way to me
> at first glance.
>
> Cheers,
> Ben
>
> On Tue, Aug 3, 2021 at 5:28 AM D Tim Cummings <t...@triptera.com.au.invalid>
> wrote:
>
>> Does anyone have experience integrating Agrest (https://agrest.io/) into
>> a Tapestry app? My Tapestry app uses Cayenne ORM and it looks like
>> Agrest works well with Cayenne to produce REST functionality. It would
>> be helpful to see some sample code.
>>
>> Thanks in advance
>>
>> Tim
>>
>>
>>
>>

Attachment: OpenPGP_signature
Description: OpenPGP digital signature

Reply via email to