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 Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final longstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringFields inherited from interface io.meeds.mcp.server.plugin.McpToolPlugin
DEFAULT_LIMIT, DEFAULT_OFFSET -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionupdateWidgetCode(Long siteId, String pageRef, String applicationId, String html, String css, String js) 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 sessionMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.meeds.mcp.server.plugin.McpToolPlugin
getCurrentUserAclIdentity, getCurrentUserLocale, getCurrentUserLocale, getCurrentUserName, getLocale
-
Field Details
-
ADMINISTRATORS_ONLY
- See Also:
-
SITE_ID_NOT_ACCEPTED
- See Also:
-
PAGE_REF_NOT_ACCEPTED
- See Also:
-
APPLICATION_ID_NOT_ACCEPTED
- See Also:
-
APPLICATION_NOT_FOUND
- See Also:
-
HTML_NOT_ACCEPTED
- See Also:
-
CSS_NOT_ACCEPTED
- See Also:
-
JS_NOT_ACCEPTED
- See Also:
-
WIDGET_CODE_NOT_SAVED
- See Also:
-
WIDGET_PORTLET_SUFFIX
- See Also:
-
DEFAULT_MAX_BYTES
public static final long DEFAULT_MAX_BYTES- See Also:
-
-
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 containerpageRef- the live page reference, for a window of a pageapplicationId- the window's storage id as the read answered ithtml- the HTML to write, null to keep the current onecss- the CSS to write, null to keep the current onejs- 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 existIllegalAccessException- when the user is not an administrator (administrators only), or may not edit the page or the site (not allowed: page, not allowed: site)
-