1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * The contents of this file are subject to the terms of the Liferay Enterprise
5    * Subscription License ("License"). You may not use this file except in
6    * compliance with the License. You can obtain a copy of the License by
7    * contacting Liferay, Inc. See the License for the specific language governing
8    * permissions and limitations under the License, including but not limited to
9    * distribution rights of the Software.
10   *
11   *
12   *
13   */
14  
15  package com.liferay.portal.deploy.auto;
16  
17  import com.liferay.portal.kernel.plugin.PluginPackage;
18  
19  import java.io.File;
20  
21  import java.util.HashMap;
22  import java.util.Map;
23  
24  /**
25   * <a href="MVCPortletAutoDeployer.java.html"><b><i>View Source</i></b></a>
26   *
27   * @author Brian Wing Shun Chan
28   */
29  public class MVCPortletAutoDeployer extends PortletAutoDeployer {
30  
31      public void copyXmls(
32              File srcFile, String displayName, PluginPackage pluginPackage)
33          throws Exception {
34  
35          super.copyXmls(srcFile, displayName, pluginPackage);
36  
37          Map<String, String> filterMap = new HashMap<String, String>();
38  
39          String pluginName = displayName;
40  
41          if (pluginPackage != null) {
42              pluginName = pluginPackage.getName();
43          }
44  
45          filterMap.put(
46              "portlet_class", "com.liferay.util.bridges.mvc.MVCPortlet");
47          filterMap.put("portlet_name", pluginName);
48          filterMap.put("portlet_title", pluginName);
49          filterMap.put("restore_current_view", "false");
50          filterMap.put("friendly_url_mapper_class", "");
51          filterMap.put("init_param_name_0", "view-jsp");
52          filterMap.put("init_param_value_0", "/index_mvc.jsp");
53  
54          copyDependencyXml(
55              "liferay-display.xml", srcFile + "/WEB-INF", filterMap);
56          copyDependencyXml(
57              "liferay-portlet.xml", srcFile + "/WEB-INF", filterMap);
58          copyDependencyXml(
59              "portlet.xml", srcFile + "/WEB-INF", filterMap);
60      }
61  
62  }