deactivatePage
Unpublish a page in Adobe Experience Manager to remove it from public view. Optionally deactivate child pages in the hierarchy.
Instructions
Deactivate (unpublish) a single page
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pagePath | Yes | ||
| deactivateTree | No |
Implementation Reference
- Core handler function that performs the actual deactivation by calling AEM replication API with fallback methods.async deactivatePage(request: DeactivatePageRequest): Promise<DeactivateResponse> { return safeExecute<DeactivateResponse>(async () => { const { pagePath, deactivateTree = 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', 'Deactivate'); formData.append('path', pagePath); formData.append('ignoredeactivated', 'false'); formData.append('onlymodified', 'false'); if (deactivateTree) { 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, deactivatedPath: pagePath, deactivateTree, response: response.data, timestamp: new Date().toISOString(), }, 'deactivatePage') as DeactivateResponse; } catch (error: any) { // Fallback to alternative replication methods try { const wcmResponse = await this.httpClient.post('/bin/wcmcommand', { cmd: 'deactivate', path: pagePath, ignoredeactivated: false, onlymodified: false, }); return createSuccessResponse({ success: true, deactivatedPath: pagePath, deactivateTree, response: wcmResponse.data, fallbackUsed: 'WCM Command', timestamp: new Date().toISOString(), }, 'deactivatePage') as DeactivateResponse; } catch (fallbackError: any) { throw handleAEMHttpError(error, 'deactivatePage'); } } }, 'deactivatePage'); }
- src/mcp-server.ts:729-732 (registration)MCP server dispatch handler that calls aemConnector.deactivatePage when the tool is invoked.case 'deactivatePage': { const result = await aemConnector.deactivatePage(args); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] }; }
- src/mcp-server.ts:345-356 (schema)MCP tool schema definition including input schema for deactivatePage.{ name: 'deactivatePage', description: 'Deactivate (unpublish) a single page', inputSchema: { type: 'object', properties: { pagePath: { type: 'string' }, deactivateTree: { type: 'boolean' }, }, required: ['pagePath'], }, },
- src/mcp-handler.ts:71-72 (handler)Intermediate handler dispatch in MCPRequestHandler.case 'deactivatePage': return await this.aemConnector.deactivatePage(params);
- src/aem-connector-new.ts:103-105 (handler)Wrapper method in AEMConnector that delegates to PageOperations.async deactivatePage(request: any) { return this.pageOps.deactivatePage(request); }