Class WidgetMcpTool

java.lang.Object
io.meeds.ide.mcp.WidgetMcpTool
All Implemented Interfaces:
io.meeds.mcp.server.plugin.McpToolPlugin

@Service @Profile("mcp-server") public class WidgetMcpTool extends Object implements io.meeds.mcp.server.plugin.McpToolPlugin
The MCP tool that writes an IDE widget's code on the user's draft, the one tool of this add-on: argument mapping and exception translation only, the copy-on-write rule being WidgetService's. Every refusal is a fixed text naming the object or the option it concerns; no engine message reaches the wire.
  • Field Details

  • Constructor Details

    • WidgetMcpTool

      public WidgetMcpTool()
  • Method Details

    • updateWidgetCode

      public WidgetCodeResult updateWidgetCode(Long siteId, String pageRef, String applicationId, String html, String css, String js) throws org.exoplatform.commons.exception.ObjectNotFoundException, IllegalAccessException
      update_widget_code: writes the code of the widget a window renders, on the user's draft of the page or the site, copying the shared widget for the window on the first write of a draft session
      Parameters:
      siteId - the live site, for a window of a site container
      pageRef - the live page reference, for a window of a page
      applicationId - the window's storage id as the read answered it
      html - the HTML to write, null to keep the current one
      css - the CSS to write, null to keep the current one
      js - the JavaScript to write, null to keep the current one
      Returns:
      the window on the draft, the widget it renders and its code
      Throws:
      org.exoplatform.commons.exception.ObjectNotFoundException - when the layout, its draft or the window does not exist
      IllegalAccessException - when the user is not an administrator (administrators only), or may not edit the page or the site (not allowed: page, not allowed: site)