001/* 002 * (C) Copyright 2006-2007 Nuxeo SAS (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.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 * Nuxeo - initial API and implementation 016 * 017 */ 018package org.nuxeo.ecm.automation.seam.operations; 019 020import org.nuxeo.ecm.automation.OperationContext; 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 * Initialise Seam Context so that next operation can use Seam components 029 * 030 * @author Tiry (tdelprat@nuxeo.com) 031 */ 032@Operation(id = InitSeamContext.ID, category = Constants.CAT_UI, label = "Init Seam Context", description = "Initialize a Seam context (including Conversation if needed)", aliases = { "Seam.InitContext" }) 033public class InitSeamContext { 034 035 public static final String ID = "WebUI.InitSeamContext"; 036 037 @Param(name = "conversationId", required = false) 038 protected String conversationId; 039 040 @Context 041 protected OperationContext context; 042 043 @OperationMethod 044 public void run() { 045 SeamOperationFilter.handleBeforeRun(context, conversationId); 046 } 047}