Usages

This is a new feature in Joget DX 8.2.

The Console Page Plugin is used to add a menu to the admin console and render the added menu page.

Common use cases:

  • Extending User, Monitoring & Settings features.
  • Adding a central configuration page, like an AI-related settings page.
  • Adding pages in the System Settings page, such as the System Variables page.

Interface Class

org.joget.plugin.base.ConsolePagePlugin

  • Used to add a menu to the admin console and render the page for the added menu.

Interface Methods

getName()

String getName()

Unique identifier of the page without spaces. 

getPluginIcon()

String getPluginIcon()

The icon used for menu rendering.

getLabel()

String getLabel()

The label used for menu rendering.

getOrder()

int getOrder()

The order of the menu. The original page menu has an order with position x 100. eg 100, 200, 300.

getLocation()

Location getLocation()

The location to render the menu. Either DIRECTORY, MONITOR, or SETTINGS.

isAuthorized()

boolean isAuthorized()

Used to decide whether the current user has permission to see this menu.

render(HttpServletRequest request, HttpServletResponse response)

String render(HttpServletRequest request, HttpServletResponse response)

Return the HTML of the page rendering.

Abstract Class

org.joget.apps.app.model.ConsolePagePluginAbstract

  • Extended ExtDefaultPlugin.
  • Implemented ConsolePagePlugin

Annotations

  • Path:
    • To put on the method to mark the method as an additional URL path and use the method to handle the path request.
    • Using AntPathMatcher syntax for the path matching
  • PathParam:
    • To put on path method parameter to mark a parameter to receive the value in the path pattern.
    • E.g., the path is `/form/{id}`, then using `@PathParam("id")` for a method parameter to retrieve the value.

Here are examples of how to use the annotations:

@Path({"/form", "/form/{id}"}) public String renderForm(ModelMap map, HttpServletRequest request, HttpServletResponse response, @PathParam("id") String id) throws IOException { //your logic here map.addAttribute("content", content); return "console/popupTemplate"; }


@Path("/list") public void renderListJsonData(HttpServletRequest request, HttpServletResponse response) throws IOException { String callback = request.getParameter("callback"); JSONObject jsonObject = new JSONObject(); //your logic here AppUtil.writeJson(response.getWriter(), jsonObject, null); }

Sample Plugins

  • No labels