1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * This library is free software; you can redistribute it and/or modify it under
5    * the terms of the GNU Lesser General Public License as published by the Free
6    * Software Foundation; either version 2.1 of the License, or (at your option)
7    * any later version.
8    *
9    * This library is distributed in the hope that it will be useful, but WITHOUT
10   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11   * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12   * details.
13   */
14  
15  package com.liferay.portal.kernel.scripting;
16  
17  import com.liferay.portal.kernel.messaging.proxy.MessagingProxy;
18  import com.liferay.portal.kernel.messaging.proxy.ProxyMode;
19  
20  import java.util.Map;
21  import java.util.Set;
22  
23  import javax.portlet.PortletConfig;
24  import javax.portlet.PortletContext;
25  import javax.portlet.PortletRequest;
26  import javax.portlet.PortletResponse;
27  
28  @MessagingProxy(mode = ProxyMode.SYNC)
29  /**
30   * <a href="Scripting.java.html"><b><i>View Source</i></b></a>
31   *
32   * @author Alberto Montero
33   * @author Brian Wing Shun Chan
34   */
35  public interface Scripting {
36  
37      public void addScriptionExecutor(
38          String language, ScriptingExecutor scriptingExecutor);
39  
40      public void clearCache(String language) throws ScriptingException;
41  
42      public Map<String, Object> eval(
43              Set<String> allowedClasses, Map<String, Object> inputObjects,
44              Set<String> outputNames, String language, String script)
45          throws ScriptingException;
46  
47      public void exec(
48              Set<String> allowedClasses, Map<String, Object> inputObjects,
49              String language, String script)
50          throws ScriptingException;
51  
52      public Map<String, Object> getPortletObjects(
53          PortletConfig portletConfig, PortletContext portletContext,
54          PortletRequest portletRequest, PortletResponse portletResponse);
55  
56      public Set<String> getSupportedLanguages();
57  
58      public void setScriptingExecutors(
59          Map<String, ScriptingExecutor> scriptingExecutors);
60  
61  }