001/* 002 * (C) Copyright 2006-2012 Nuxeo SA (http://nuxeo.com/) and others. 003 * 004 * All rights reserved. This program and the accompanying materials 005 * are made available under the terms of the GNU Lesser General Public License 006 * (LGPL) version 2.1 which accompanies this distribution, and is available at 007 * http://www.gnu.org/licenses/lgpl-2.1.html 008 * 009 * This library is distributed in the hope that it will be useful, 010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 012 * Lesser General Public License for more details. 013 * 014 * Contributors: 015 * Thomas Roger <troger@nuxeo.com> 016 */ 017 018package org.nuxeo.ecm.activity.operations; 019 020import org.nuxeo.ecm.activity.ActivityStreamService; 021import org.nuxeo.ecm.automation.core.Constants; 022import org.nuxeo.ecm.automation.core.annotations.Context; 023import org.nuxeo.ecm.automation.core.annotations.Operation; 024import org.nuxeo.ecm.automation.core.annotations.OperationMethod; 025import org.nuxeo.ecm.automation.core.annotations.Param; 026 027/** 028 * Operation to remove an activity reply. 029 * 030 * @author <a href="mailto:troger@nuxeo.com">Thomas Roger</a> 031 * @since 5.6 032 */ 033@Operation(id = RemoveActivityReply.ID, category = Constants.CAT_SERVICES, label = "Remove a reply to an existing activity", description = "Remove a reply to an existing activity.") 034public class RemoveActivityReply { 035 036 public static final String ID = "Services.RemoveActivityReply"; 037 038 @Context 039 protected ActivityStreamService activityStreamService; 040 041 @Param(name = "activityId", required = true) 042 protected String activityId; 043 044 @Param(name = "replyId", required = true) 045 protected String replyId; 046 047 @OperationMethod 048 public void run() throws NumberFormatException { 049 activityStreamService.removeActivityReply(Long.valueOf(activityId), replyId); 050 } 051 052}