001/* 002 * (C) Copyright 2013 Nuxeo SA (http://nuxeo.com/) and contributors. 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 * dmetzler 016 */ 017package org.nuxeo.ecm.automation.test.helpers; 018 019import java.util.ArrayList; 020import java.util.List; 021 022import org.nuxeo.ecm.automation.core.Constants; 023import org.nuxeo.ecm.automation.core.annotations.Operation; 024import org.nuxeo.ecm.automation.core.annotations.OperationMethod; 025import org.nuxeo.ecm.automation.core.annotations.Param; 026import org.nuxeo.ecm.core.api.Blob; 027import org.nuxeo.ecm.core.api.DocumentModel; 028import org.nuxeo.ecm.core.api.DocumentModelList; 029 030/** 031 * Basic operation that just record the documents on which it was called and the parameters used 032 * 033 * @since 5.7.2 034 */ 035@Operation(id = TestOperation.ID, category = Constants.CAT_SERVICES, label = "log call params", description = "Test operation that log call in a static map") 036public class TestOperation { 037 038 public static final String ID = "testOp"; 039 040 @Param(name = "one") 041 String one; 042 043 @Param(name = "two") 044 Integer two; 045 046 @OperationMethod 047 public DocumentModel run(DocumentModel doc) { 048 return doc; 049 } 050 051 @OperationMethod 052 public DocumentModelList run(DocumentModelList docs) { 053 return docs; 054 } 055 056 @OperationMethod 057 public Blob run(Blob blob) throws Exception { 058 return blob; 059 } 060 061}