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.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(WikiPage page, PortletURL portletURL) {
33          if (page.getContent() == null) {
34              return StringPool.BLANK;
35          }
36          else {
37              return "<pre>" + page.getContent() + "</pre>";
38          }
39      }
40  
41      public Map<String, Boolean> getOutgoingLinks(WikiPage page) {
42          return Collections.EMPTY_MAP;
43      }
44  
45      public void setInterWikiConfiguration(String interWikiConfiguration) {
46      }
47  
48      public void setMainConfiguration(String mainConfiguration) {
49      }
50  
51      public boolean validate(long nodeId, String newContent) {
52          return true;
53      }
54  
55  }