gentics / mesh-incubator

Project which is home for planned enhancements for Gentics Mesh
3 stars 0 forks source link

Add API v2 support for admin client in plugins #216

Open Jotschi opened 5 years ago

Jotschi commented 5 years ago

The admin client will currently only be created with api/v1 - Some plugins may however want to use v2

deckdom commented 5 years ago

I think it should be somewhat easy to do. My idea would be, to specify the version you want to get when you load the client.

// Gets the client in the default Version
MeshRestClient defaultClient = adminClient();

// Gets the client in version 1
MeshRestClient clientV1 = adminClient("v1");

// Gets the client in version 2
MeshRestClient clientV2 = adminClient("v2");

Signature would need to change in here: https://github.com/gentics/mesh/blob/dev/plugin-api/src/main/java/com/gentics/mesh/plugin/MeshPlugin.java

The same should be added to the PluginContext, to get the User-Client in a certain version: https://github.com/gentics/mesh/blob/dev/plugin-api/src/main/java/com/gentics/mesh/plugin/PluginContext.java