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.portlet.wiki.PageContentException;
18  import com.liferay.portlet.wiki.model.WikiPage;
19  
20  import java.util.Map;
21  
22  import javax.portlet.PortletURL;
23  
24  /**
25   * <a href="WikiEngine.java.html"><b><i>View Source</i></b></a>
26   *
27   * @author Jorge Ferrer
28   */
29  public interface WikiEngine {
30  
31      /**
32       * Convert the content of the given page to HTML using the view and edit
33       * URLs to build links.
34       *
35       * @return HTML string
36       */
37      public String convert(
38              WikiPage page, PortletURL viewPageURL, PortletURL editPageURL,
39              String attachmentURLPrefix)
40          throws PageContentException;
41  
42      /**
43       * Get a map with the links included in the given page. The key of each map
44       * entry is the title of the linked page. The value is a Boolean object that
45       * indicates if the linked page exists or not.
46       *
47       * @return a map of links
48       */
49      public Map<String, Boolean> getOutgoingLinks(WikiPage page)
50          throws PageContentException;
51  
52      /**
53       * Set the configuraton to support quick links to other wikis. The format of
54       * the configuration is specific to the wiki engine.
55       */
56      public void setInterWikiConfiguration(String interWikiConfiguration);
57  
58      /**
59       * Set the main wiki configuraiton as a String. The format of the
60       * configuration is specific to the wiki engine.
61       */
62      public void setMainConfiguration(String mainConfiguration);
63  
64      /**
65       * Validate the content of a wiki page for this engine.
66       *
67       * @return true if the content is valid
68       */
69      public boolean validate(long nodeId, String content);
70  
71  }