activatePage
Publish a single page or its entire content tree via REST/JSON-RPC API in Adobe Experience Manager, enabling precise control and automation in content management workflows.
Instructions
Activate (publish) a single page
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| activateTree | No | ||
| pagePath | Yes |
Implementation Reference
- Core handler function that executes the page activation by posting to AEM's replication endpoint with fallback to WCM command.async activatePage(request) { return safeExecute(async () => { const { pagePath, activateTree = false } = request; if (!isValidContentPath(pagePath)) { throw createAEMError(AEM_ERROR_CODES.INVALID_PARAMETERS, `Invalid page path: ${String(pagePath)}`, { pagePath }); } try { // Use the correct AEM replication servlet endpoint const formData = new URLSearchParams(); formData.append('cmd', 'Activate'); formData.append('path', pagePath); formData.append('ignoredeactivated', 'false'); formData.append('onlymodified', 'false'); if (activateTree) { formData.append('deep', 'true'); } const response = await this.httpClient.post('/bin/replicate.json', formData, { headers: { 'Content-Type': 'application/x-www-form-urlencoded', }, }); return createSuccessResponse({ success: true, activatedPath: pagePath, activateTree, response: response.data, timestamp: new Date().toISOString(), }, 'activatePage'); } catch (error) { // Fallback to alternative replication methods try { const wcmResponse = await this.httpClient.post('/bin/wcmcommand', { cmd: 'activate', path: pagePath, ignoredeactivated: false, onlymodified: false, }); return createSuccessResponse({ success: true, activatedPath: pagePath, activateTree, response: wcmResponse.data, fallbackUsed: 'WCM Command', timestamp: new Date().toISOString(), }, 'activatePage'); } catch (fallbackError) { throw handleAEMHttpError(error, 'activatePage'); } } }, 'activatePage'); }
- dist/mcp-server.js:324-334 (schema)MCP tool schema definition including input validation for pagePath (required) and optional activateTree.name: 'activatePage', description: 'Activate (publish) a single page', inputSchema: { type: 'object', properties: { pagePath: { type: 'string' }, activateTree: { type: 'boolean' }, }, required: ['pagePath'], }, },
- dist/mcp-server.js:713-715 (registration)Registration and dispatch handler in MCP server that calls the AEM connector when activatePage tool is invoked.case 'activatePage': { const result = await aemConnector.activatePage(args); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
- dist/aem-connector-new.js:85-86 (helper)Proxy method in AEMConnector class that delegates to PageOperations instance.async activatePage(request) { return this.pageOps.activatePage(request);
- dist/mcp-handler.js:65-66 (registration)Alternative dispatch handler in MCPRequestHandler class.case 'activatePage': return await this.aemConnector.activatePage(params);