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.portlet.wiki.engines;
16  
17  import com.liferay.portal.kernel.util.StringPool;
18  import com.liferay.portlet.wiki.model.WikiPage;
19  
20  import java.util.Collections;
21  import java.util.Map;
22  
23  import javax.portlet.PortletURL;
24  
25  /**
26   * <a href="TextEngine.java.html"><b><i>View Source</i></b></a>
27   *
28   * @author Jorge Ferrer
29   */
30  public class TextEngine implements WikiEngine {
31  
32      public String convert(
33          WikiPage page, PortletURL viewPageURL, PortletURL editPageURL,
34          String attachmentURLPrefix) {
35  
36          if (page.getContent() == null) {
37              return StringPool.BLANK;
38          }
39          else {
40              return "<pre>" + page.getContent() + "</pre>";
41          }
42      }
43  
44      public Map<String, Boolean> getOutgoingLinks(WikiPage page) {
45          return Collections.EMPTY_MAP;
46      }
47  
48      public void setInterWikiConfiguration(String interWikiConfiguration) {
49      }
50  
51      public void setMainConfiguration(String mainConfiguration) {
52      }
53  
54      public boolean validate(long nodeId, String newContent) {
55          return true;
56      }
57  
58  }