enonic / xp

Enonic XP
https://enonic.com
GNU General Public License v3.0
202 stars 34 forks source link

Admintool API mount - choose APIs to mount #10612

Closed rymsha closed 1 month ago

rymsha commented 3 months ago

API is available on /admin/tool/<app>/<admintool>/_/

This functionality is similar to widgets and some internal services + launcher

/admin/tool/_/service/com.enonic.xp.app.main/config ← dashboard wants to access some dynamic parameters. Instead should be an API: /admin/tool/com.enonic.xp.app.main/main/_/com.enonic.xp.app.main/config

/admin/tool/_/service/com.enonic.xp.app.main/i18n ← dashboard wants to access dynamic text translations. Instead should be an API:/admin/tool/com.enonic.xp.app.main/main/_/com.enonic.xp.app.main/i18n

/admin/tool/com.enonic.xp.app.main/launcher ← “right menu“ which can be used by any admin tool (not all necessarily do). Instead should be an API:/admin/tool/com.enonic.xp.app.main/_/com.enonic.xp.app.main/launcher

Admin tool descriptor extends with apis section.

Example /admin/tools/main/main.xml:

<tool>
  <display-name i18n="admin.tool.displayName">Content Studio</display-name>
  <description i18n="admin.tool.description">Manage content and sites</description>
  <allow>
    <principal>role:system.authenticated</principal>
  </allow>
  <apis>
    <api>com.enonic.xp.app.main:launcher</api>
    <api>com.enonic.xp.app-system:status</api>
  <apis>
</tool>

Mounts APIs on /admin/tool/com.enonic.app.contentstudio/main/_/com.enonic.xp.app.main/launcher /admin/tool/com.enonic.app.contentstudio/main/_/com.enonic.xp.app-system/status

Not the special case with admin tool /admin/tool/com.enonic.xp.app.main/home as it has a different tool location right on /admin/tool. Thus, APIs for home admin tool should be available on /admin/tool/_/com.enonic.xp.app.main/launcher /admin/tool/_/com.enonic.xp.app-system/status

rymsha commented 3 months ago

Following tasks

anatol-sialitski commented 2 months ago

The path variables <app> and <admintool> must always are present.

For example: /admin/tool/_/service/com.enonic.xp.app.main/config must be replaced by /admin/tool/com.enonic.xp.app.main/home/_/com.enonic.xp.app.main/config

anatol-sialitski commented 2 months ago

All changes related to this task are done in #10632